blob: e0d3545220b825c71be3c8892dc6bda9ab5dc9e2 [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",
Chiachang Wang00fc62f2019-12-04 20:38:26 +080033 "binder/android/net/MarkMaskParcel.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 ],
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",
Chenbo Fengd6104d12018-10-16 20:29:29 -070097 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090098 "libnetutils",
99 "libnetdutils",
100 "libpcap",
101 "libqtaguid",
102 "libssl",
Luke Huang91bd3e12019-08-20 11:33:52 +0800103 "netd_aidl_interface-cpp",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900104 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900105 ],
106 aidl: {
107 export_aidl_headers: true,
108 local_include_dirs: ["binder"],
109 },
110}
111
112cc_binary {
113 name: "netd",
114 defaults: ["netd_defaults"],
115 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900116 "external/mdnsresponder/mDNSShared",
117 "system/netd/include",
118 ],
119 init_rc: ["netd.rc"],
120 shared_libs: [
121 "android.system.net.netd@1.0",
122 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900123 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900124 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800125 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900126 "libcutils",
127 "libdl",
128 "libhidlbase",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900129 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "liblog",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 "libmdnssd",
Jooyung Han3e64aa12019-11-27 15:36:29 +0900132 "libnetd_resolv",
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",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900142 "netd_aidl_interface-unstable-cpp",
143 "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 ],
149 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900150 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900151 "EventReporter.cpp",
152 "FwmarkServer.cpp",
153 "LocalNetwork.cpp",
154 "MDnsSdListener.cpp",
155 "NetdCommand.cpp",
156 "NetdHwService.cpp",
157 "NetdNativeService.cpp",
158 "NetlinkHandler.cpp",
159 "Network.cpp",
160 "NetworkController.cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800161 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900162 "PhysicalNetwork.cpp",
163 "PppController.cpp",
164 "Process.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900165 "VirtualNetwork.cpp",
166 "main.cpp",
167 "oem_iptables_hook.cpp",
168 ],
169}
170
171cc_binary {
172 name: "ndc",
173 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800174 include_dirs: [
175 "system/netd/include",
176 ],
177 header_libs: [
178 "libnetd_client_headers",
179 ],
180 shared_libs: [
181 "libbase",
182 "libnetdutils",
183 "libnetutils",
184 "libcutils",
185 "liblog",
186 "libutils",
187 "libbinder",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900188 "dnsresolver_aidl_interface-cpp",
189 "netd_aidl_interface-cpp",
Luke Huangcfd04b22019-03-18 15:53:21 +0800190 ],
191 srcs: [
192 "ndc.cpp",
193 "UidRanges.cpp",
194 "NdcDispatcher.cpp",
195 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900196}
197
198cc_test {
199 name: "netd_unit_test",
200 defaults: ["netd_defaults"],
201 test_suites: ["device-tests"],
Bernie Innocenti83a67ca2019-06-19 16:28:05 +0900202 require_root: true,
Bernie Innocenti98951792018-06-26 17:13:44 +0900203 include_dirs: [
204 "system/netd/include",
205 "system/netd/server/binder",
206 "system/netd/tests",
Bernie Innocenti98951792018-06-26 17:13:44 +0900207 ],
208 srcs: [
209 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900210 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800211 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900212 "ControllersTest.cpp",
213 "FirewallControllerTest.cpp",
214 "IdletimerControllerTest.cpp",
215 "InterfaceControllerTest.cpp",
216 "IptablesBaseTest.cpp",
217 "IptablesRestoreControllerTest.cpp",
218 "NFLogListenerTest.cpp",
219 "RouteControllerTest.cpp",
220 "SockDiagTest.cpp",
221 "StrictControllerTest.cpp",
222 "TetherControllerTest.cpp",
223 "TrafficControllerTest.cpp",
224 "XfrmControllerTest.cpp",
225 "WakeupControllerTest.cpp",
226 ],
227 static_libs: [
228 "libgmock",
229 "libnetd_server",
230 "libnetd_test_tun_interface",
Lorenzo Colitti3f52fae2019-06-27 18:46:22 +0900231 "libqtaguid",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900232 "netd_aidl_interface-cpp",
233 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900234 ],
235 shared_libs: [
236 "libbase",
237 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800238 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900239 "libcrypto",
240 "libcutils",
241 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700242 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900243 "libnetdutils",
244 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900245 "libsysutils",
246 "libutils",
247 ],
248}