blob: 2424f08e9d28d0c7247a9dc8d638ae764310df57 [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",
Tyler Wearfa94a272019-12-05 15:01:48 -080034 "binder/android/net/RouteInfoParcel.aidl",
Chiachang Wang08cb2112019-12-10 09:53:24 +080035 "binder/android/net/TetherConfigParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080036 "binder/android/net/TetherStatsParcel.aidl",
Luke Huang94658ac2018-10-18 19:35:12 +090037 "binder/android/net/UidRangeParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080038 ],
Luke Huangf7782042018-08-08 13:13:04 +080039 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090040 cpp: {
41 gen_log: true,
42 },
Luke Huangf7782042018-08-08 13:13:04 +080043 },
Luke Huang00681282019-04-26 12:09:05 +080044 versions: [
45 "1",
46 "2",
47 ],
Luke Huangcaebcbb2018-09-27 20:37:14 +080048}
49
Luke Huang0e5e69d2019-03-06 15:42:38 +080050aidl_interface {
Luke Huang2ff8b342019-04-30 15:33:33 +080051 // This interface is for OEM calls to netd and vice versa that do not exist in AOSP.
52 // Those calls cannot be part of INetd.aidl and INetdUnsolicitedEventListener.aidl
53 // because those interfaces are versioned.
54 // These interfaces must never be versioned or OEMs will not be able to change them.
Luke Huang0e5e69d2019-03-06 15:42:38 +080055 name: "oemnetd_aidl_interface",
56 local_include_dir: "binder",
57 srcs: [
58 "binder/com/android/internal/net/IOemNetd.aidl",
Luke Huang2ff8b342019-04-30 15:33:33 +080059 "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl",
Luke Huang0e5e69d2019-03-06 15:42:38 +080060 ],
61}
62
Bernie Innocenti98951792018-06-26 17:13:44 +090063// Modules common to both netd and netd_unit_test
64cc_library_static {
65 name: "libnetd_server",
66 defaults: ["netd_defaults"],
67 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090068 "system/netd/include",
69 "system/netd/server/binder",
70 ],
71 srcs: [
72 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090073 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080074 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090075 "Controllers.cpp",
76 "NetdConstants.cpp",
77 "FirewallController.cpp",
78 "IdletimerController.cpp",
79 "InterfaceController.cpp",
80 "IptablesRestoreController.cpp",
81 "NFLogListener.cpp",
82 "NetlinkCommands.cpp",
83 "NetlinkListener.cpp",
84 "NetlinkManager.cpp",
85 "RouteController.cpp",
86 "SockDiag.cpp",
87 "StrictController.cpp",
88 "TcpSocketMonitor.cpp",
89 "TetherController.cpp",
90 "TrafficController.cpp",
91 "UidRanges.cpp",
92 "WakeupController.cpp",
93 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090094 ],
95 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080096 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090097 "libbase",
98 "libbinder",
Chenbo Fengd6104d12018-10-16 20:29:29 -070099 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900100 "libnetutils",
101 "libnetdutils",
102 "libpcap",
103 "libqtaguid",
104 "libssl",
Luke Huang91bd3e12019-08-20 11:33:52 +0800105 "netd_aidl_interface-cpp",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900106 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900107 ],
108 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",
Jooyung Han3e64aa12019-11-27 15:36:29 +0900134 "libnetd_resolv",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700135 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900136 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900137 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900138 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800139 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 "libqtaguid",
141 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900143 "libutils",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900144 "netd_aidl_interface-unstable-cpp",
145 "netd_event_listener_interface-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800146 "oemnetd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900147 ],
148 static_libs: [
149 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900150 ],
151 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900152 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900153 "EventReporter.cpp",
154 "FwmarkServer.cpp",
155 "LocalNetwork.cpp",
156 "MDnsSdListener.cpp",
157 "NetdCommand.cpp",
158 "NetdHwService.cpp",
159 "NetdNativeService.cpp",
160 "NetlinkHandler.cpp",
161 "Network.cpp",
162 "NetworkController.cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800163 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900164 "PhysicalNetwork.cpp",
165 "PppController.cpp",
166 "Process.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900167 "VirtualNetwork.cpp",
168 "main.cpp",
169 "oem_iptables_hook.cpp",
170 ],
Ken Chen2e413c32020-01-13 11:59:53 +0800171 sanitize: {
172 cfi: true,
173 diag: {
174 cfi: true,
175 },
176 },
Bernie Innocenti98951792018-06-26 17:13:44 +0900177}
178
179cc_binary {
180 name: "ndc",
181 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800182 include_dirs: [
183 "system/netd/include",
184 ],
185 header_libs: [
186 "libnetd_client_headers",
187 ],
188 shared_libs: [
189 "libbase",
190 "libnetdutils",
191 "libnetutils",
192 "libcutils",
193 "liblog",
194 "libutils",
195 "libbinder",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900196 "dnsresolver_aidl_interface-cpp",
197 "netd_aidl_interface-cpp",
Luke Huangcfd04b22019-03-18 15:53:21 +0800198 ],
199 srcs: [
200 "ndc.cpp",
201 "UidRanges.cpp",
202 "NdcDispatcher.cpp",
203 ],
Ken Chen2e413c32020-01-13 11:59:53 +0800204 sanitize: {
205 cfi: true,
206 diag: {
207 cfi: true,
208 },
209 },
Bernie Innocenti98951792018-06-26 17:13:44 +0900210}
211
212cc_test {
213 name: "netd_unit_test",
214 defaults: ["netd_defaults"],
215 test_suites: ["device-tests"],
Bernie Innocenti83a67ca2019-06-19 16:28:05 +0900216 require_root: true,
Bernie Innocenti98951792018-06-26 17:13:44 +0900217 include_dirs: [
218 "system/netd/include",
219 "system/netd/server/binder",
220 "system/netd/tests",
Bernie Innocenti98951792018-06-26 17:13:44 +0900221 ],
222 srcs: [
223 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900224 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800225 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900226 "ControllersTest.cpp",
227 "FirewallControllerTest.cpp",
228 "IdletimerControllerTest.cpp",
229 "InterfaceControllerTest.cpp",
230 "IptablesBaseTest.cpp",
231 "IptablesRestoreControllerTest.cpp",
232 "NFLogListenerTest.cpp",
233 "RouteControllerTest.cpp",
234 "SockDiagTest.cpp",
235 "StrictControllerTest.cpp",
236 "TetherControllerTest.cpp",
237 "TrafficControllerTest.cpp",
238 "XfrmControllerTest.cpp",
239 "WakeupControllerTest.cpp",
240 ],
241 static_libs: [
242 "libgmock",
243 "libnetd_server",
244 "libnetd_test_tun_interface",
Lorenzo Colitti3f52fae2019-06-27 18:46:22 +0900245 "libqtaguid",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900246 "netd_aidl_interface-cpp",
247 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900248 ],
249 shared_libs: [
250 "libbase",
251 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800252 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900253 "libcrypto",
254 "libcutils",
255 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700256 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900257 "libnetdutils",
258 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900259 "libsysutils",
260 "libutils",
261 ],
262}