blob: 1bea8a06aa195438c3710c3416a92d0cbaef9a3e [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",
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 ],
Luke Huangf7782042018-08-08 13:13:04 +080036 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090037 cpp: {
38 gen_log: true,
39 },
Luke Huangf7782042018-08-08 13:13:04 +080040 },
Luke Huang00681282019-04-26 12:09:05 +080041 versions: [
42 "1",
43 "2",
44 ],
Luke Huangcaebcbb2018-09-27 20:37:14 +080045}
46
Luke Huang0e5e69d2019-03-06 15:42:38 +080047aidl_interface {
Luke Huang2ff8b342019-04-30 15:33:33 +080048 // This interface is for OEM calls to netd and vice versa that do not exist in AOSP.
49 // Those calls cannot be part of INetd.aidl and INetdUnsolicitedEventListener.aidl
50 // because those interfaces are versioned.
51 // These interfaces must never be versioned or OEMs will not be able to change them.
Luke Huang0e5e69d2019-03-06 15:42:38 +080052 name: "oemnetd_aidl_interface",
53 local_include_dir: "binder",
54 srcs: [
55 "binder/com/android/internal/net/IOemNetd.aidl",
Luke Huang2ff8b342019-04-30 15:33:33 +080056 "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl",
Luke Huang0e5e69d2019-03-06 15:42:38 +080057 ],
58}
59
Bernie Innocenti98951792018-06-26 17:13:44 +090060// Modules common to both netd and netd_unit_test
61cc_library_static {
62 name: "libnetd_server",
63 defaults: ["netd_defaults"],
64 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090065 "system/netd/include",
66 "system/netd/server/binder",
67 ],
68 srcs: [
69 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090070 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080071 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090072 "Controllers.cpp",
73 "NetdConstants.cpp",
74 "FirewallController.cpp",
75 "IdletimerController.cpp",
76 "InterfaceController.cpp",
77 "IptablesRestoreController.cpp",
78 "NFLogListener.cpp",
79 "NetlinkCommands.cpp",
80 "NetlinkListener.cpp",
81 "NetlinkManager.cpp",
82 "RouteController.cpp",
83 "SockDiag.cpp",
84 "StrictController.cpp",
85 "TcpSocketMonitor.cpp",
86 "TetherController.cpp",
87 "TrafficController.cpp",
88 "UidRanges.cpp",
89 "WakeupController.cpp",
90 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090091 ],
92 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080093 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090094 "libbase",
95 "libbinder",
Chenbo Fengd6104d12018-10-16 20:29:29 -070096 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090097 "libnetutils",
98 "libnetdutils",
99 "libpcap",
100 "libqtaguid",
101 "libssl",
Luke Huang91bd3e12019-08-20 11:33:52 +0800102 "netd_aidl_interface-cpp",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900103 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900104 ],
105 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",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900128 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900129 "liblog",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libmdnssd",
Jooyung Han3e64aa12019-11-27 15:36:29 +0900131 "libnetd_resolv",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700132 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900134 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900135 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800136 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900137 "libqtaguid",
138 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900139 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 "libutils",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900141 "netd_aidl_interface-unstable-cpp",
142 "netd_event_listener_interface-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800143 "oemnetd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 ],
145 static_libs: [
146 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900147 ],
148 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900149 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900150 "EventReporter.cpp",
151 "FwmarkServer.cpp",
152 "LocalNetwork.cpp",
153 "MDnsSdListener.cpp",
154 "NetdCommand.cpp",
155 "NetdHwService.cpp",
156 "NetdNativeService.cpp",
157 "NetlinkHandler.cpp",
158 "Network.cpp",
159 "NetworkController.cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800160 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900161 "PhysicalNetwork.cpp",
162 "PppController.cpp",
163 "Process.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900164 "VirtualNetwork.cpp",
165 "main.cpp",
166 "oem_iptables_hook.cpp",
167 ],
168}
169
170cc_binary {
171 name: "ndc",
172 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800173 include_dirs: [
174 "system/netd/include",
175 ],
176 header_libs: [
177 "libnetd_client_headers",
178 ],
179 shared_libs: [
180 "libbase",
181 "libnetdutils",
182 "libnetutils",
183 "libcutils",
184 "liblog",
185 "libutils",
186 "libbinder",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900187 "dnsresolver_aidl_interface-cpp",
188 "netd_aidl_interface-cpp",
Luke Huangcfd04b22019-03-18 15:53:21 +0800189 ],
190 srcs: [
191 "ndc.cpp",
192 "UidRanges.cpp",
193 "NdcDispatcher.cpp",
194 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900195}
196
197cc_test {
198 name: "netd_unit_test",
199 defaults: ["netd_defaults"],
200 test_suites: ["device-tests"],
Bernie Innocenti83a67ca2019-06-19 16:28:05 +0900201 require_root: true,
Bernie Innocenti98951792018-06-26 17:13:44 +0900202 include_dirs: [
203 "system/netd/include",
204 "system/netd/server/binder",
205 "system/netd/tests",
Bernie Innocenti98951792018-06-26 17:13:44 +0900206 ],
207 srcs: [
208 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900209 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800210 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900211 "ControllersTest.cpp",
212 "FirewallControllerTest.cpp",
213 "IdletimerControllerTest.cpp",
214 "InterfaceControllerTest.cpp",
215 "IptablesBaseTest.cpp",
216 "IptablesRestoreControllerTest.cpp",
217 "NFLogListenerTest.cpp",
218 "RouteControllerTest.cpp",
219 "SockDiagTest.cpp",
220 "StrictControllerTest.cpp",
221 "TetherControllerTest.cpp",
222 "TrafficControllerTest.cpp",
223 "XfrmControllerTest.cpp",
224 "WakeupControllerTest.cpp",
225 ],
226 static_libs: [
227 "libgmock",
228 "libnetd_server",
229 "libnetd_test_tun_interface",
Lorenzo Colitti3f52fae2019-06-27 18:46:22 +0900230 "libqtaguid",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900231 "netd_aidl_interface-cpp",
232 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900233 ],
234 shared_libs: [
235 "libbase",
236 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800237 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900238 "libcrypto",
239 "libcutils",
240 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700241 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900242 "libnetdutils",
243 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900244 "libsysutils",
245 "libutils",
246 ],
247}