blob: de94e235aba28c2db4b4fae71b0d074a0b620dd2 [file] [log] [blame]
Colin Cross1a8e7972017-12-05 22:35:52 -08001// AIDL interface between netd and services.core
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +09002aidl_interface {
3 name: "netd_event_listener_interface",
4 local_include_dir: "binder",
5 srcs: [
Remi NGUYEN VAN6b91b492019-04-09 13:57:03 +09006 "binder/android/net/metrics/INetdEventListener.aidl",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +09007 ],
Lorenzo Colitti866a03a2019-05-22 15:46:05 +09008 versions: ["1"],
Colin Cross1a8e7972017-12-05 22:35:52 -08009}
Steven Moreland0b7e3802018-03-02 12:41:52 -080010
Bernie Innocenti37ceb532018-06-11 21:10:44 +090011// These are used in netd_integration_test
12// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
13filegroup {
14 name: "netd_integration_test_shared",
15 srcs: [
16 "NetdConstants.cpp",
17 "InterfaceController.cpp",
18 "NetlinkCommands.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070019 "NetlinkListener.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090020 "XfrmController.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070021 "TrafficController.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090022 ],
23}
24
Luke Huangcaebcbb2018-09-27 20:37:14 +080025aidl_interface {
26 name: "netd_aidl_interface",
27 local_include_dir: "binder",
28 srcs: [
Luke Huang03074eb2018-11-23 17:03:03 +080029 "binder/android/net/INetd.aidl",
Luke Huang528af602018-08-29 19:06:05 +080030 // AIDL interface that callers can implement to receive networking events from netd.
31 "binder/android/net/INetdUnsolicitedEventListener.aidl",
Luke Huang03074eb2018-11-23 17:03:03 +080032 "binder/android/net/InterfaceConfigurationParcel.aidl",
Chiachang Wang00fc62f2019-12-04 20:38:26 +080033 "binder/android/net/MarkMaskParcel.aidl",
Tyler Wearfa94a272019-12-05 15:01:48 -080034 "binder/android/net/RouteInfoParcel.aidl",
Chiachang Wang08cb2112019-12-10 09:53:24 +080035 "binder/android/net/TetherConfigParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080036 "binder/android/net/TetherStatsParcel.aidl",
Luke Huang94658ac2018-10-18 19:35:12 +090037 "binder/android/net/UidRangeParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080038 ],
Luke Huangf7782042018-08-08 13:13:04 +080039 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090040 cpp: {
41 gen_log: true,
42 },
Luke Huangf7782042018-08-08 13:13:04 +080043 },
Luke Huang00681282019-04-26 12:09:05 +080044 versions: [
45 "1",
46 "2",
47 ],
Luke Huangcaebcbb2018-09-27 20:37:14 +080048}
49
Luke Huang0e5e69d2019-03-06 15:42:38 +080050aidl_interface {
Luke Huang2ff8b342019-04-30 15:33:33 +080051 // This interface is for OEM calls to netd and vice versa that do not exist in AOSP.
52 // Those calls cannot be part of INetd.aidl and INetdUnsolicitedEventListener.aidl
53 // because those interfaces are versioned.
54 // These interfaces must never be versioned or OEMs will not be able to change them.
Luke Huang0e5e69d2019-03-06 15:42:38 +080055 name: "oemnetd_aidl_interface",
56 local_include_dir: "binder",
57 srcs: [
58 "binder/com/android/internal/net/IOemNetd.aidl",
Luke Huang2ff8b342019-04-30 15:33:33 +080059 "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl",
Luke Huang0e5e69d2019-03-06 15:42:38 +080060 ],
61}
62
Bernie Innocenti98951792018-06-26 17:13:44 +090063// Modules common to both netd and netd_unit_test
64cc_library_static {
65 name: "libnetd_server",
66 defaults: ["netd_defaults"],
67 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090068 "system/netd/include",
69 "system/netd/server/binder",
70 ],
71 srcs: [
72 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090073 "ClatdController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090074 "Controllers.cpp",
75 "NetdConstants.cpp",
76 "FirewallController.cpp",
77 "IdletimerController.cpp",
78 "InterfaceController.cpp",
79 "IptablesRestoreController.cpp",
80 "NFLogListener.cpp",
81 "NetlinkCommands.cpp",
82 "NetlinkListener.cpp",
83 "NetlinkManager.cpp",
Maciej Żenczykowskieec72082020-02-04 23:29:41 -080084 "OffloadUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090085 "RouteController.cpp",
86 "SockDiag.cpp",
87 "StrictController.cpp",
88 "TcpSocketMonitor.cpp",
89 "TetherController.cpp",
90 "TrafficController.cpp",
91 "UidRanges.cpp",
92 "WakeupController.cpp",
93 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090094 ],
95 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080096 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090097 "libbase",
98 "libbinder",
Chenbo Fengd6104d12018-10-16 20:29:29 -070099 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900100 "libnetutils",
101 "libnetdutils",
102 "libpcap",
103 "libqtaguid",
104 "libssl",
Luke Huang91bd3e12019-08-20 11:33:52 +0800105 "netd_aidl_interface-cpp",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900106 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900107 ],
108 aidl: {
109 export_aidl_headers: true,
110 local_include_dirs: ["binder"],
111 },
112}
113
114cc_binary {
115 name: "netd",
116 defaults: ["netd_defaults"],
117 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900118 "external/mdnsresponder/mDNSShared",
119 "system/netd/include",
120 ],
121 init_rc: ["netd.rc"],
Maciej Żenczykowskif428d6e2020-02-19 10:26:35 -0800122 required: [
123 "bpfloader",
124 "clatd.o",
125 "netd.o",
126 "offload.o",
127 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900128 shared_libs: [
129 "android.system.net.netd@1.0",
130 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900131 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900132 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800133 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900134 "libcutils",
135 "libdl",
136 "libhidlbase",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900137 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900138 "liblog",
Bernie Innocenti98951792018-06-26 17:13:44 +0900139 "libmdnssd",
Jooyung Han3e64aa12019-11-27 15:36:29 +0900140 "libnetd_resolv",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700141 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900143 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800145 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900146 "libqtaguid",
147 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900148 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900149 "libutils",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900150 "netd_aidl_interface-unstable-cpp",
151 "netd_event_listener_interface-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800152 "oemnetd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900153 ],
154 static_libs: [
155 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900156 ],
157 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900158 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900159 "EventReporter.cpp",
160 "FwmarkServer.cpp",
161 "LocalNetwork.cpp",
162 "MDnsSdListener.cpp",
163 "NetdCommand.cpp",
164 "NetdHwService.cpp",
165 "NetdNativeService.cpp",
166 "NetlinkHandler.cpp",
167 "Network.cpp",
168 "NetworkController.cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800169 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900170 "PhysicalNetwork.cpp",
171 "PppController.cpp",
172 "Process.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900173 "VirtualNetwork.cpp",
174 "main.cpp",
175 "oem_iptables_hook.cpp",
176 ],
Ken Chen2e413c32020-01-13 11:59:53 +0800177 sanitize: {
178 cfi: true,
Ken Chen2e413c32020-01-13 11:59:53 +0800179 },
Bernie Innocenti98951792018-06-26 17:13:44 +0900180}
181
182cc_binary {
183 name: "ndc",
184 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800185 include_dirs: [
186 "system/netd/include",
187 ],
188 header_libs: [
189 "libnetd_client_headers",
190 ],
191 shared_libs: [
192 "libbase",
193 "libnetdutils",
194 "libnetutils",
195 "libcutils",
196 "liblog",
197 "libutils",
198 "libbinder",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900199 "dnsresolver_aidl_interface-cpp",
200 "netd_aidl_interface-cpp",
Luke Huangcfd04b22019-03-18 15:53:21 +0800201 ],
202 srcs: [
203 "ndc.cpp",
204 "UidRanges.cpp",
205 "NdcDispatcher.cpp",
206 ],
Ken Chen2e413c32020-01-13 11:59:53 +0800207 sanitize: {
208 cfi: true,
Ken Chen2e413c32020-01-13 11:59:53 +0800209 },
Bernie Innocenti98951792018-06-26 17:13:44 +0900210}
211
212cc_test {
213 name: "netd_unit_test",
214 defaults: ["netd_defaults"],
215 test_suites: ["device-tests"],
Bernie Innocenti83a67ca2019-06-19 16:28:05 +0900216 require_root: true,
Bernie Innocenti98951792018-06-26 17:13:44 +0900217 include_dirs: [
218 "system/netd/include",
219 "system/netd/server/binder",
220 "system/netd/tests",
Bernie Innocenti98951792018-06-26 17:13:44 +0900221 ],
222 srcs: [
223 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900224 "ClatdControllerTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900225 "ControllersTest.cpp",
226 "FirewallControllerTest.cpp",
227 "IdletimerControllerTest.cpp",
228 "InterfaceControllerTest.cpp",
229 "IptablesBaseTest.cpp",
230 "IptablesRestoreControllerTest.cpp",
231 "NFLogListenerTest.cpp",
Maciej Żenczykowskieec72082020-02-04 23:29:41 -0800232 "OffloadUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900233 "RouteControllerTest.cpp",
234 "SockDiagTest.cpp",
235 "StrictControllerTest.cpp",
236 "TetherControllerTest.cpp",
237 "TrafficControllerTest.cpp",
238 "XfrmControllerTest.cpp",
239 "WakeupControllerTest.cpp",
240 ],
241 static_libs: [
242 "libgmock",
243 "libnetd_server",
244 "libnetd_test_tun_interface",
Lorenzo Colitti3f52fae2019-06-27 18:46:22 +0900245 "libqtaguid",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900246 "netd_aidl_interface-cpp",
247 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900248 ],
249 shared_libs: [
250 "libbase",
251 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800252 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900253 "libcrypto",
254 "libcutils",
255 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700256 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900257 "libnetdutils",
258 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900259 "libsysutils",
260 "libutils",
261 ],
262}