blob: bf2c1dd53c4002288981cddf0d8a3f1eaa16e0fb [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 Colitti2394a332019-05-22 15:34:53 +09008 api_dir: "aidl/netdeventlistener",
Lorenzo Colitti866a03a2019-05-22 15:46:05 +09009 versions: ["1"],
Colin Cross1a8e7972017-12-05 22:35:52 -080010}
Steven Moreland0b7e3802018-03-02 12:41:52 -080011
Bernie Innocenti37ceb532018-06-11 21:10:44 +090012// These are used in netd_integration_test
13// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
14filegroup {
15 name: "netd_integration_test_shared",
16 srcs: [
17 "NetdConstants.cpp",
18 "InterfaceController.cpp",
19 "NetlinkCommands.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070020 "NetlinkListener.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090021 "XfrmController.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070022 "TrafficController.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090023 ],
24}
25
Luke Huangcaebcbb2018-09-27 20:37:14 +080026aidl_interface {
27 name: "netd_aidl_interface",
28 local_include_dir: "binder",
29 srcs: [
Luke Huang03074eb2018-11-23 17:03:03 +080030 "binder/android/net/INetd.aidl",
Luke Huang528af602018-08-29 19:06:05 +080031 // AIDL interface that callers can implement to receive networking events from netd.
32 "binder/android/net/INetdUnsolicitedEventListener.aidl",
Luke Huang03074eb2018-11-23 17:03:03 +080033 "binder/android/net/InterfaceConfigurationParcel.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 ],
Lorenzo Colitti2394a332019-05-22 15:34:53 +090037 api_dir: "aidl/netd",
Luke Huangf7782042018-08-08 13:13:04 +080038 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090039 cpp: {
40 gen_log: true,
41 },
Luke Huangf7782042018-08-08 13:13:04 +080042 },
Luke Huang00681282019-04-26 12:09:05 +080043 versions: [
44 "1",
45 "2",
46 ],
Luke Huangcaebcbb2018-09-27 20:37:14 +080047}
48
Luke Huang0e5e69d2019-03-06 15:42:38 +080049aidl_interface {
Luke Huang2ff8b342019-04-30 15:33:33 +080050 // This interface is for OEM calls to netd and vice versa that do not exist in AOSP.
51 // Those calls cannot be part of INetd.aidl and INetdUnsolicitedEventListener.aidl
52 // because those interfaces are versioned.
53 // These interfaces must never be versioned or OEMs will not be able to change them.
Luke Huang0e5e69d2019-03-06 15:42:38 +080054 name: "oemnetd_aidl_interface",
55 local_include_dir: "binder",
56 srcs: [
57 "binder/com/android/internal/net/IOemNetd.aidl",
Luke Huang2ff8b342019-04-30 15:33:33 +080058 "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl",
Luke Huang0e5e69d2019-03-06 15:42:38 +080059 ],
60}
61
Bernie Innocenti98951792018-06-26 17:13:44 +090062// Modules common to both netd and netd_unit_test
63cc_library_static {
64 name: "libnetd_server",
65 defaults: ["netd_defaults"],
66 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090067 "system/netd/include",
68 "system/netd/server/binder",
69 ],
70 srcs: [
71 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090072 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080073 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090074 "Controllers.cpp",
75 "NetdConstants.cpp",
76 "FirewallController.cpp",
77 "IdletimerController.cpp",
78 "InterfaceController.cpp",
79 "IptablesRestoreController.cpp",
80 "NFLogListener.cpp",
81 "NetlinkCommands.cpp",
82 "NetlinkListener.cpp",
83 "NetlinkManager.cpp",
84 "RouteController.cpp",
85 "SockDiag.cpp",
86 "StrictController.cpp",
87 "TcpSocketMonitor.cpp",
88 "TetherController.cpp",
89 "TrafficController.cpp",
90 "UidRanges.cpp",
91 "WakeupController.cpp",
92 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090093 ],
94 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080095 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090096 "libbase",
97 "libbinder",
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",
Lorenzo Colittie152e9f2019-05-22 12:16:50 +0900104 "netd_aidl_interface-V2-cpp",
105 "netd_event_listener_interface-V1-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",
Bernie Innocenti98951792018-06-26 17:13:44 +0900136 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700137 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900138 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900139 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800141 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 "libqtaguid",
143 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 "libutils",
Lorenzo Colittie152e9f2019-05-22 12:16:50 +0900146 "netd_aidl_interface-V2-cpp",
147 "netd_event_listener_interface-V1-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800148 "oemnetd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900149 ],
150 static_libs: [
151 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900152 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900153 header_libs: [
154 "libnetd_resolv_headers",
155 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900156 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900157 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900158 "EventReporter.cpp",
159 "FwmarkServer.cpp",
160 "LocalNetwork.cpp",
161 "MDnsSdListener.cpp",
162 "NetdCommand.cpp",
163 "NetdHwService.cpp",
164 "NetdNativeService.cpp",
165 "NetlinkHandler.cpp",
166 "Network.cpp",
167 "NetworkController.cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800168 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900169 "PhysicalNetwork.cpp",
170 "PppController.cpp",
171 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900172 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900173 "VirtualNetwork.cpp",
174 "main.cpp",
175 "oem_iptables_hook.cpp",
176 ],
177}
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",
Lorenzo Colittie152e9f2019-05-22 12:16:50 +0900196 "dnsresolver_aidl_interface-V2-cpp",
197 "netd_aidl_interface-V2-cpp",
Luke Huangcfd04b22019-03-18 15:53:21 +0800198 ],
199 srcs: [
200 "ndc.cpp",
201 "UidRanges.cpp",
202 "NdcDispatcher.cpp",
203 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900204}
205
206cc_test {
207 name: "netd_unit_test",
208 defaults: ["netd_defaults"],
209 test_suites: ["device-tests"],
Bernie Innocenti83a67ca2019-06-19 16:28:05 +0900210 require_root: true,
Bernie Innocenti98951792018-06-26 17:13:44 +0900211 include_dirs: [
212 "system/netd/include",
213 "system/netd/server/binder",
214 "system/netd/tests",
Bernie Innocenti98951792018-06-26 17:13:44 +0900215 ],
216 srcs: [
217 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900218 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800219 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900220 "ControllersTest.cpp",
221 "FirewallControllerTest.cpp",
222 "IdletimerControllerTest.cpp",
223 "InterfaceControllerTest.cpp",
224 "IptablesBaseTest.cpp",
225 "IptablesRestoreControllerTest.cpp",
226 "NFLogListenerTest.cpp",
227 "RouteControllerTest.cpp",
228 "SockDiagTest.cpp",
229 "StrictControllerTest.cpp",
230 "TetherControllerTest.cpp",
231 "TrafficControllerTest.cpp",
232 "XfrmControllerTest.cpp",
233 "WakeupControllerTest.cpp",
234 ],
235 static_libs: [
236 "libgmock",
237 "libnetd_server",
238 "libnetd_test_tun_interface",
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",
250 "libqtaguid",
251 "libsysutils",
252 "libutils",
Lorenzo Colittie152e9f2019-05-22 12:16:50 +0900253 "netd_aidl_interface-V2-cpp",
254 "netd_event_listener_interface-V1-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900255 ],
256}