blob: 7083f47192088dada6d227fdf1d0d8bc77ab99a4 [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 ],
8 api_dir: "binder/api",
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",
Luke Huangcaebcbb2018-09-27 20:37:14 +080033 "binder/android/net/TetherStatsParcel.aidl",
Luke Huang94658ac2018-10-18 19:35:12 +090034 "binder/android/net/UidRangeParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080035 ],
36 api_dir: "binder/api",
Luke Huangf7782042018-08-08 13:13:04 +080037 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090038 cpp: {
39 gen_log: true,
40 },
Luke Huangf7782042018-08-08 13:13:04 +080041 },
Luke Huang00681282019-04-26 12:09:05 +080042 versions: [
43 "1",
44 "2",
45 ],
Luke Huangcaebcbb2018-09-27 20:37:14 +080046}
47
Luke Huang0e5e69d2019-03-06 15:42:38 +080048aidl_interface {
49 name: "oemnetd_aidl_interface",
50 local_include_dir: "binder",
51 srcs: [
52 "binder/com/android/internal/net/IOemNetd.aidl",
53 ],
54}
55
Bernie Innocenti98951792018-06-26 17:13:44 +090056// Modules common to both netd and netd_unit_test
57cc_library_static {
58 name: "libnetd_server",
59 defaults: ["netd_defaults"],
60 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090061 "system/netd/include",
62 "system/netd/server/binder",
63 ],
64 srcs: [
65 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090066 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080067 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090068 "Controllers.cpp",
69 "NetdConstants.cpp",
70 "FirewallController.cpp",
71 "IdletimerController.cpp",
72 "InterfaceController.cpp",
73 "IptablesRestoreController.cpp",
74 "NFLogListener.cpp",
75 "NetlinkCommands.cpp",
76 "NetlinkListener.cpp",
77 "NetlinkManager.cpp",
78 "RouteController.cpp",
79 "SockDiag.cpp",
80 "StrictController.cpp",
81 "TcpSocketMonitor.cpp",
82 "TetherController.cpp",
83 "TrafficController.cpp",
84 "UidRanges.cpp",
85 "WakeupController.cpp",
86 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090087 ],
88 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080089 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090090 "libbase",
91 "libbinder",
92 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070093 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090094 "libnetutils",
95 "libnetdutils",
96 "libpcap",
97 "libqtaguid",
98 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +080099 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900100 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900101 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900102 header_libs: [
103 "libnetd_resolv_headers",
104 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900105 aidl: {
106 export_aidl_headers: true,
107 local_include_dirs: ["binder"],
108 },
109}
110
111cc_binary {
112 name: "netd",
113 defaults: ["netd_defaults"],
114 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900115 "external/mdnsresponder/mDNSShared",
116 "system/netd/include",
117 ],
118 init_rc: ["netd.rc"],
119 shared_libs: [
120 "android.system.net.netd@1.0",
121 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900122 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900123 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800124 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900125 "libcutils",
126 "libdl",
127 "libhidlbase",
128 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900129 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "liblog",
131 "liblogwrap",
132 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700133 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900134 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900135 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900136 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800137 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900138 "libqtaguid",
139 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800142 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900143 "netd_event_listener_interface-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800144 "oemnetd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 ],
146 static_libs: [
147 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900148 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900149 header_libs: [
150 "libnetd_resolv_headers",
151 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900152 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900153 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900154 "EventReporter.cpp",
155 "FwmarkServer.cpp",
156 "LocalNetwork.cpp",
157 "MDnsSdListener.cpp",
158 "NetdCommand.cpp",
159 "NetdHwService.cpp",
160 "NetdNativeService.cpp",
161 "NetlinkHandler.cpp",
162 "Network.cpp",
163 "NetworkController.cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800164 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900165 "PhysicalNetwork.cpp",
166 "PppController.cpp",
167 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900168 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900169 "VirtualNetwork.cpp",
170 "main.cpp",
171 "oem_iptables_hook.cpp",
172 ],
173}
174
175cc_binary {
176 name: "ndc",
177 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800178 include_dirs: [
179 "system/netd/include",
180 ],
181 header_libs: [
182 "libnetd_client_headers",
183 ],
184 shared_libs: [
185 "libbase",
186 "libnetdutils",
187 "libnetutils",
188 "libcutils",
189 "liblog",
190 "libutils",
191 "libbinder",
192 "dnsresolver_aidl_interface-cpp",
193 "netd_aidl_interface-cpp",
194 ],
195 srcs: [
196 "ndc.cpp",
197 "UidRanges.cpp",
198 "NdcDispatcher.cpp",
199 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900200}
201
202cc_test {
203 name: "netd_unit_test",
204 defaults: ["netd_defaults"],
205 test_suites: ["device-tests"],
206 include_dirs: [
207 "system/netd/include",
208 "system/netd/server/binder",
209 "system/netd/tests",
210 "system/core/logwrapper/include",
211 ],
212 srcs: [
213 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900214 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800215 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900216 "ControllersTest.cpp",
217 "FirewallControllerTest.cpp",
218 "IdletimerControllerTest.cpp",
219 "InterfaceControllerTest.cpp",
220 "IptablesBaseTest.cpp",
221 "IptablesRestoreControllerTest.cpp",
222 "NFLogListenerTest.cpp",
223 "RouteControllerTest.cpp",
224 "SockDiagTest.cpp",
225 "StrictControllerTest.cpp",
226 "TetherControllerTest.cpp",
227 "TrafficControllerTest.cpp",
228 "XfrmControllerTest.cpp",
229 "WakeupControllerTest.cpp",
230 ],
231 static_libs: [
232 "libgmock",
233 "libnetd_server",
234 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900235 ],
236 shared_libs: [
237 "libbase",
238 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800239 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900240 "libcrypto",
241 "libcutils",
242 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700243 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900244 "libnetdutils",
245 "libnetutils",
246 "libqtaguid",
247 "libsysutils",
248 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900249 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900250 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900251 ],
252}