blob: bd30f47a2eb2a37196d3fbe3735057fbe0b6f9ae [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 },
Remi NGUYEN VAN6b91b492019-04-09 13:57:03 +090042 versions: ["1"],
Luke Huangcaebcbb2018-09-27 20:37:14 +080043}
44
Bernie Innocenti98951792018-06-26 17:13:44 +090045// Modules common to both netd and netd_unit_test
46cc_library_static {
47 name: "libnetd_server",
48 defaults: ["netd_defaults"],
49 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090050 "system/netd/include",
51 "system/netd/server/binder",
52 ],
53 srcs: [
54 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090055 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080056 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090057 "Controllers.cpp",
58 "NetdConstants.cpp",
59 "FirewallController.cpp",
60 "IdletimerController.cpp",
61 "InterfaceController.cpp",
62 "IptablesRestoreController.cpp",
63 "NFLogListener.cpp",
64 "NetlinkCommands.cpp",
65 "NetlinkListener.cpp",
66 "NetlinkManager.cpp",
67 "RouteController.cpp",
68 "SockDiag.cpp",
69 "StrictController.cpp",
70 "TcpSocketMonitor.cpp",
71 "TetherController.cpp",
72 "TrafficController.cpp",
73 "UidRanges.cpp",
74 "WakeupController.cpp",
75 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090076 ],
77 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080078 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090079 "libbase",
80 "libbinder",
81 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070082 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090083 "libnetutils",
84 "libnetdutils",
85 "libpcap",
86 "libqtaguid",
87 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +080088 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +090089 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090090 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +090091 header_libs: [
92 "libnetd_resolv_headers",
93 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090094 aidl: {
95 export_aidl_headers: true,
96 local_include_dirs: ["binder"],
97 },
98}
99
100cc_binary {
101 name: "netd",
102 defaults: ["netd_defaults"],
103 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900104 "external/mdnsresponder/mDNSShared",
105 "system/netd/include",
106 ],
107 init_rc: ["netd.rc"],
108 shared_libs: [
109 "android.system.net.netd@1.0",
110 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900111 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900112 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800113 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900114 "libcutils",
115 "libdl",
116 "libhidlbase",
117 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900118 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900119 "liblog",
120 "liblogwrap",
121 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700122 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900123 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900124 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900125 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800126 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900127 "libqtaguid",
128 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900129 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800131 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900132 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 ],
134 static_libs: [
135 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900136 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900137 header_libs: [
138 "libnetd_resolv_headers",
139 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 "EventReporter.cpp",
143 "FwmarkServer.cpp",
144 "LocalNetwork.cpp",
145 "MDnsSdListener.cpp",
146 "NetdCommand.cpp",
147 "NetdHwService.cpp",
148 "NetdNativeService.cpp",
149 "NetlinkHandler.cpp",
150 "Network.cpp",
151 "NetworkController.cpp",
152 "PhysicalNetwork.cpp",
153 "PppController.cpp",
154 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900155 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900156 "VirtualNetwork.cpp",
157 "main.cpp",
158 "oem_iptables_hook.cpp",
159 ],
160}
161
162cc_binary {
163 name: "ndc",
164 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800165 include_dirs: [
166 "system/netd/include",
167 ],
168 header_libs: [
169 "libnetd_client_headers",
170 ],
171 shared_libs: [
172 "libbase",
173 "libnetdutils",
174 "libnetutils",
175 "libcutils",
176 "liblog",
177 "libutils",
178 "libbinder",
179 "dnsresolver_aidl_interface-cpp",
180 "netd_aidl_interface-cpp",
181 ],
182 srcs: [
183 "ndc.cpp",
184 "UidRanges.cpp",
185 "NdcDispatcher.cpp",
186 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900187}
188
189cc_test {
190 name: "netd_unit_test",
191 defaults: ["netd_defaults"],
192 test_suites: ["device-tests"],
193 include_dirs: [
194 "system/netd/include",
195 "system/netd/server/binder",
196 "system/netd/tests",
197 "system/core/logwrapper/include",
198 ],
199 srcs: [
200 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900201 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800202 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900203 "ControllersTest.cpp",
204 "FirewallControllerTest.cpp",
205 "IdletimerControllerTest.cpp",
206 "InterfaceControllerTest.cpp",
207 "IptablesBaseTest.cpp",
208 "IptablesRestoreControllerTest.cpp",
209 "NFLogListenerTest.cpp",
210 "RouteControllerTest.cpp",
211 "SockDiagTest.cpp",
212 "StrictControllerTest.cpp",
213 "TetherControllerTest.cpp",
214 "TrafficControllerTest.cpp",
215 "XfrmControllerTest.cpp",
216 "WakeupControllerTest.cpp",
217 ],
218 static_libs: [
219 "libgmock",
220 "libnetd_server",
221 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900222 ],
223 shared_libs: [
224 "libbase",
225 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800226 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900227 "libcrypto",
228 "libcutils",
229 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700230 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900231 "libnetdutils",
232 "libnetutils",
233 "libqtaguid",
234 "libsysutils",
235 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900236 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900237 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900238 ],
239}