blob: d1586a24ba3763a6244e635ffae45138042693bc [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 {
Luke Huang2ff8b342019-04-30 15:33:33 +080049 // This interface is for OEM calls to netd and vice versa that do not exist in AOSP.
50 // Those calls cannot be part of INetd.aidl and INetdUnsolicitedEventListener.aidl
51 // because those interfaces are versioned.
52 // These interfaces must never be versioned or OEMs will not be able to change them.
Luke Huang0e5e69d2019-03-06 15:42:38 +080053 name: "oemnetd_aidl_interface",
54 local_include_dir: "binder",
55 srcs: [
56 "binder/com/android/internal/net/IOemNetd.aidl",
Luke Huang2ff8b342019-04-30 15:33:33 +080057 "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl",
Luke Huang0e5e69d2019-03-06 15:42:38 +080058 ],
59}
60
Bernie Innocenti98951792018-06-26 17:13:44 +090061// Modules common to both netd and netd_unit_test
62cc_library_static {
63 name: "libnetd_server",
64 defaults: ["netd_defaults"],
65 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090066 "system/netd/include",
67 "system/netd/server/binder",
68 ],
69 srcs: [
70 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090071 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080072 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090073 "Controllers.cpp",
74 "NetdConstants.cpp",
75 "FirewallController.cpp",
76 "IdletimerController.cpp",
77 "InterfaceController.cpp",
78 "IptablesRestoreController.cpp",
79 "NFLogListener.cpp",
80 "NetlinkCommands.cpp",
81 "NetlinkListener.cpp",
82 "NetlinkManager.cpp",
83 "RouteController.cpp",
84 "SockDiag.cpp",
85 "StrictController.cpp",
86 "TcpSocketMonitor.cpp",
87 "TetherController.cpp",
88 "TrafficController.cpp",
89 "UidRanges.cpp",
90 "WakeupController.cpp",
91 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090092 ],
93 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080094 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090095 "libbase",
96 "libbinder",
97 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070098 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090099 "libnetutils",
100 "libnetdutils",
101 "libpcap",
102 "libqtaguid",
103 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +0800104 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900105 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900106 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900107 header_libs: [
108 "libnetd_resolv_headers",
109 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900110 aidl: {
111 export_aidl_headers: true,
112 local_include_dirs: ["binder"],
113 },
114}
115
116cc_binary {
117 name: "netd",
118 defaults: ["netd_defaults"],
119 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900120 "external/mdnsresponder/mDNSShared",
121 "system/netd/include",
122 ],
123 init_rc: ["netd.rc"],
124 shared_libs: [
125 "android.system.net.netd@1.0",
126 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900127 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900128 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800129 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libcutils",
131 "libdl",
132 "libhidlbase",
133 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900134 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900135 "liblog",
136 "liblogwrap",
137 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700138 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900139 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900140 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800142 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900143 "libqtaguid",
144 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900146 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800147 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900148 "netd_event_listener_interface-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800149 "oemnetd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900150 ],
151 static_libs: [
152 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900153 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900154 header_libs: [
155 "libnetd_resolv_headers",
156 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900157 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",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900173 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900174 "VirtualNetwork.cpp",
175 "main.cpp",
176 "oem_iptables_hook.cpp",
177 ],
178}
179
180cc_binary {
181 name: "ndc",
182 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800183 include_dirs: [
184 "system/netd/include",
185 ],
186 header_libs: [
187 "libnetd_client_headers",
188 ],
189 shared_libs: [
190 "libbase",
191 "libnetdutils",
192 "libnetutils",
193 "libcutils",
194 "liblog",
195 "libutils",
196 "libbinder",
197 "dnsresolver_aidl_interface-cpp",
198 "netd_aidl_interface-cpp",
199 ],
200 srcs: [
201 "ndc.cpp",
202 "UidRanges.cpp",
203 "NdcDispatcher.cpp",
204 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900205}
206
207cc_test {
208 name: "netd_unit_test",
209 defaults: ["netd_defaults"],
210 test_suites: ["device-tests"],
211 include_dirs: [
212 "system/netd/include",
213 "system/netd/server/binder",
214 "system/netd/tests",
215 "system/core/logwrapper/include",
216 ],
217 srcs: [
218 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900219 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800220 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900221 "ControllersTest.cpp",
222 "FirewallControllerTest.cpp",
223 "IdletimerControllerTest.cpp",
224 "InterfaceControllerTest.cpp",
225 "IptablesBaseTest.cpp",
226 "IptablesRestoreControllerTest.cpp",
227 "NFLogListenerTest.cpp",
228 "RouteControllerTest.cpp",
229 "SockDiagTest.cpp",
230 "StrictControllerTest.cpp",
231 "TetherControllerTest.cpp",
232 "TrafficControllerTest.cpp",
233 "XfrmControllerTest.cpp",
234 "WakeupControllerTest.cpp",
235 ],
236 static_libs: [
237 "libgmock",
238 "libnetd_server",
239 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900240 ],
241 shared_libs: [
242 "libbase",
243 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800244 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900245 "libcrypto",
246 "libcutils",
247 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700248 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900249 "libnetdutils",
250 "libnetutils",
251 "libqtaguid",
252 "libsysutils",
253 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900254 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900255 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900256 ],
257}