blob: f4a96bc2f6ca15b28b1f6d86b5ea30e5397f2011 [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 Colitti2394a332019-05-22 15:34:53 +09008 api_dir: "aidl/netdeventlistener",
Lorenzo Colitti866a03a2019-05-22 15:46:05 +09009 versions: ["1"],
Colin Cross1a8e7972017-12-05 22:35:52 -080010}
Steven Moreland0b7e3802018-03-02 12:41:52 -080011
Bernie Innocenti37ceb532018-06-11 21:10:44 +090012// These are used in netd_integration_test
13// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
14filegroup {
15 name: "netd_integration_test_shared",
16 srcs: [
17 "NetdConstants.cpp",
18 "InterfaceController.cpp",
19 "NetlinkCommands.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070020 "NetlinkListener.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090021 "XfrmController.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070022 "TrafficController.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090023 ],
24}
25
Luke Huangcaebcbb2018-09-27 20:37:14 +080026aidl_interface {
27 name: "netd_aidl_interface",
28 local_include_dir: "binder",
29 srcs: [
Luke Huang03074eb2018-11-23 17:03:03 +080030 "binder/android/net/INetd.aidl",
Luke Huang528af602018-08-29 19:06:05 +080031 // AIDL interface that callers can implement to receive networking events from netd.
32 "binder/android/net/INetdUnsolicitedEventListener.aidl",
Luke Huang03074eb2018-11-23 17:03:03 +080033 "binder/android/net/InterfaceConfigurationParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080034 "binder/android/net/TetherStatsParcel.aidl",
Luke Huang94658ac2018-10-18 19:35:12 +090035 "binder/android/net/UidRangeParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080036 ],
Lorenzo Colitti2394a332019-05-22 15:34:53 +090037 api_dir: "aidl/netd",
Luke Huangf7782042018-08-08 13:13:04 +080038 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090039 cpp: {
40 gen_log: true,
41 },
Luke Huangf7782042018-08-08 13:13:04 +080042 },
Luke Huang00681282019-04-26 12:09:05 +080043 versions: [
44 "1",
45 "2",
46 ],
Luke Huangcaebcbb2018-09-27 20:37:14 +080047}
48
Luke Huang0e5e69d2019-03-06 15:42:38 +080049aidl_interface {
Luke Huang2ff8b342019-04-30 15:33:33 +080050 // This interface is for OEM calls to netd and vice versa that do not exist in AOSP.
51 // Those calls cannot be part of INetd.aidl and INetdUnsolicitedEventListener.aidl
52 // because those interfaces are versioned.
53 // These interfaces must never be versioned or OEMs will not be able to change them.
Luke Huang0e5e69d2019-03-06 15:42:38 +080054 name: "oemnetd_aidl_interface",
55 local_include_dir: "binder",
56 srcs: [
57 "binder/com/android/internal/net/IOemNetd.aidl",
Luke Huang2ff8b342019-04-30 15:33:33 +080058 "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl",
Luke Huang0e5e69d2019-03-06 15:42:38 +080059 ],
60}
61
Bernie Innocenti98951792018-06-26 17:13:44 +090062// Modules common to both netd and netd_unit_test
63cc_library_static {
64 name: "libnetd_server",
65 defaults: ["netd_defaults"],
66 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090067 "system/netd/include",
68 "system/netd/server/binder",
69 ],
70 srcs: [
71 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090072 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080073 "ClatUtils.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",
84 "RouteController.cpp",
85 "SockDiag.cpp",
86 "StrictController.cpp",
87 "TcpSocketMonitor.cpp",
88 "TetherController.cpp",
89 "TrafficController.cpp",
90 "UidRanges.cpp",
91 "WakeupController.cpp",
92 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090093 ],
94 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080095 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090096 "libbase",
97 "libbinder",
98 "liblogwrap",
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 Huang03074eb2018-11-23 17:03:03 +0800105 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900106 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900107 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900108 header_libs: [
109 "libnetd_resolv_headers",
110 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900111 aidl: {
112 export_aidl_headers: true,
113 local_include_dirs: ["binder"],
114 },
115}
116
117cc_binary {
118 name: "netd",
119 defaults: ["netd_defaults"],
120 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900121 "external/mdnsresponder/mDNSShared",
122 "system/netd/include",
123 ],
124 init_rc: ["netd.rc"],
125 shared_libs: [
126 "android.system.net.netd@1.0",
127 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900128 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900129 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800130 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 "libcutils",
132 "libdl",
133 "libhidlbase",
134 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900135 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900136 "liblog",
137 "liblogwrap",
138 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700139 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900141 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800143 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 "libqtaguid",
145 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900146 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900147 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800148 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900149 "netd_event_listener_interface-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800150 "oemnetd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900151 ],
152 static_libs: [
153 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900154 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900155 header_libs: [
156 "libnetd_resolv_headers",
157 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900158 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900159 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900160 "EventReporter.cpp",
161 "FwmarkServer.cpp",
162 "LocalNetwork.cpp",
163 "MDnsSdListener.cpp",
164 "NetdCommand.cpp",
165 "NetdHwService.cpp",
166 "NetdNativeService.cpp",
167 "NetlinkHandler.cpp",
168 "Network.cpp",
169 "NetworkController.cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800170 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900171 "PhysicalNetwork.cpp",
172 "PppController.cpp",
173 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900174 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900175 "VirtualNetwork.cpp",
176 "main.cpp",
177 "oem_iptables_hook.cpp",
178 ],
179}
180
181cc_binary {
182 name: "ndc",
183 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800184 include_dirs: [
185 "system/netd/include",
186 ],
187 header_libs: [
188 "libnetd_client_headers",
189 ],
190 shared_libs: [
191 "libbase",
192 "libnetdutils",
193 "libnetutils",
194 "libcutils",
195 "liblog",
196 "libutils",
197 "libbinder",
198 "dnsresolver_aidl_interface-cpp",
199 "netd_aidl_interface-cpp",
200 ],
201 srcs: [
202 "ndc.cpp",
203 "UidRanges.cpp",
204 "NdcDispatcher.cpp",
205 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900206}
207
208cc_test {
209 name: "netd_unit_test",
210 defaults: ["netd_defaults"],
211 test_suites: ["device-tests"],
212 include_dirs: [
213 "system/netd/include",
214 "system/netd/server/binder",
215 "system/netd/tests",
216 "system/core/logwrapper/include",
217 ],
218 srcs: [
219 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900220 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800221 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900222 "ControllersTest.cpp",
223 "FirewallControllerTest.cpp",
224 "IdletimerControllerTest.cpp",
225 "InterfaceControllerTest.cpp",
226 "IptablesBaseTest.cpp",
227 "IptablesRestoreControllerTest.cpp",
228 "NFLogListenerTest.cpp",
229 "RouteControllerTest.cpp",
230 "SockDiagTest.cpp",
231 "StrictControllerTest.cpp",
232 "TetherControllerTest.cpp",
233 "TrafficControllerTest.cpp",
234 "XfrmControllerTest.cpp",
235 "WakeupControllerTest.cpp",
236 ],
237 static_libs: [
238 "libgmock",
239 "libnetd_server",
240 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900241 ],
242 shared_libs: [
243 "libbase",
244 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800245 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900246 "libcrypto",
247 "libcutils",
248 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700249 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900250 "libnetdutils",
251 "libnetutils",
252 "libqtaguid",
253 "libsysutils",
254 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900255 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900256 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900257 ],
258}