blob: c1705d65f65a12304a3bbe1d893c86cc9e64bf58 [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 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900105 header_libs: [
106 "libnetd_resolv_headers",
107 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900108 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"],
122 shared_libs: [
123 "android.system.net.netd@1.0",
124 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900125 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900126 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800127 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900128 "libcutils",
129 "libdl",
130 "libhidlbase",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900131 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900132 "liblog",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700134 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900135 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900136 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900137 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800138 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900139 "libqtaguid",
140 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 "libutils",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900143 "netd_aidl_interface-unstable-cpp",
144 "netd_event_listener_interface-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800145 "oemnetd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900146 ],
147 static_libs: [
148 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900149 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900150 header_libs: [
151 "libnetd_resolv_headers",
152 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900153 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900154 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900155 "EventReporter.cpp",
156 "FwmarkServer.cpp",
157 "LocalNetwork.cpp",
158 "MDnsSdListener.cpp",
159 "NetdCommand.cpp",
160 "NetdHwService.cpp",
161 "NetdNativeService.cpp",
162 "NetlinkHandler.cpp",
163 "Network.cpp",
164 "NetworkController.cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800165 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900166 "PhysicalNetwork.cpp",
167 "PppController.cpp",
168 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900169 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900170 "VirtualNetwork.cpp",
171 "main.cpp",
172 "oem_iptables_hook.cpp",
173 ],
174}
175
176cc_binary {
177 name: "ndc",
178 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800179 include_dirs: [
180 "system/netd/include",
181 ],
182 header_libs: [
183 "libnetd_client_headers",
184 ],
185 shared_libs: [
186 "libbase",
187 "libnetdutils",
188 "libnetutils",
189 "libcutils",
190 "liblog",
191 "libutils",
192 "libbinder",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900193 "dnsresolver_aidl_interface-cpp",
194 "netd_aidl_interface-cpp",
Luke Huangcfd04b22019-03-18 15:53:21 +0800195 ],
196 srcs: [
197 "ndc.cpp",
198 "UidRanges.cpp",
199 "NdcDispatcher.cpp",
200 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900201}
202
203cc_test {
204 name: "netd_unit_test",
205 defaults: ["netd_defaults"],
206 test_suites: ["device-tests"],
Bernie Innocenti83a67ca2019-06-19 16:28:05 +0900207 require_root: true,
Bernie Innocenti98951792018-06-26 17:13:44 +0900208 include_dirs: [
209 "system/netd/include",
210 "system/netd/server/binder",
211 "system/netd/tests",
Bernie Innocenti98951792018-06-26 17:13:44 +0900212 ],
213 srcs: [
214 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900215 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800216 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900217 "ControllersTest.cpp",
218 "FirewallControllerTest.cpp",
219 "IdletimerControllerTest.cpp",
220 "InterfaceControllerTest.cpp",
221 "IptablesBaseTest.cpp",
222 "IptablesRestoreControllerTest.cpp",
223 "NFLogListenerTest.cpp",
224 "RouteControllerTest.cpp",
225 "SockDiagTest.cpp",
226 "StrictControllerTest.cpp",
227 "TetherControllerTest.cpp",
228 "TrafficControllerTest.cpp",
229 "XfrmControllerTest.cpp",
230 "WakeupControllerTest.cpp",
231 ],
232 static_libs: [
233 "libgmock",
234 "libnetd_server",
235 "libnetd_test_tun_interface",
Lorenzo Colitti3f52fae2019-06-27 18:46:22 +0900236 "libqtaguid",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900237 "netd_aidl_interface-cpp",
238 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900239 ],
240 shared_libs: [
241 "libbase",
242 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800243 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900244 "libcrypto",
245 "libcutils",
246 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700247 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900248 "libnetdutils",
249 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900250 "libsysutils",
251 "libutils",
252 ],
253}