blob: 43e6cc40b868bd8e1bc627df8aec7017d5b20b2a [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
Bernie Innocenti98951792018-06-26 17:13:44 +090048// Modules common to both netd and netd_unit_test
49cc_library_static {
50 name: "libnetd_server",
51 defaults: ["netd_defaults"],
52 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090053 "system/netd/include",
54 "system/netd/server/binder",
55 ],
56 srcs: [
57 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090058 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080059 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090060 "Controllers.cpp",
61 "NetdConstants.cpp",
62 "FirewallController.cpp",
63 "IdletimerController.cpp",
64 "InterfaceController.cpp",
65 "IptablesRestoreController.cpp",
66 "NFLogListener.cpp",
67 "NetlinkCommands.cpp",
68 "NetlinkListener.cpp",
69 "NetlinkManager.cpp",
70 "RouteController.cpp",
71 "SockDiag.cpp",
72 "StrictController.cpp",
73 "TcpSocketMonitor.cpp",
74 "TetherController.cpp",
75 "TrafficController.cpp",
76 "UidRanges.cpp",
77 "WakeupController.cpp",
78 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090079 ],
80 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080081 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090082 "libbase",
83 "libbinder",
84 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070085 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090086 "libnetutils",
87 "libnetdutils",
88 "libpcap",
89 "libqtaguid",
90 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +080091 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +090092 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090093 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +090094 header_libs: [
95 "libnetd_resolv_headers",
96 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090097 aidl: {
98 export_aidl_headers: true,
99 local_include_dirs: ["binder"],
100 },
101}
102
103cc_binary {
104 name: "netd",
105 defaults: ["netd_defaults"],
106 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900107 "external/mdnsresponder/mDNSShared",
108 "system/netd/include",
109 ],
110 init_rc: ["netd.rc"],
111 shared_libs: [
112 "android.system.net.netd@1.0",
113 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900114 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900115 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800116 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900117 "libcutils",
118 "libdl",
119 "libhidlbase",
120 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900121 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900122 "liblog",
123 "liblogwrap",
124 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700125 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900126 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900127 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900128 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800129 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libqtaguid",
131 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900132 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800134 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900135 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900136 ],
137 static_libs: [
138 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900139 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900140 header_libs: [
141 "libnetd_resolv_headers",
142 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900143 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 "EventReporter.cpp",
146 "FwmarkServer.cpp",
147 "LocalNetwork.cpp",
148 "MDnsSdListener.cpp",
149 "NetdCommand.cpp",
150 "NetdHwService.cpp",
151 "NetdNativeService.cpp",
152 "NetlinkHandler.cpp",
153 "Network.cpp",
154 "NetworkController.cpp",
155 "PhysicalNetwork.cpp",
156 "PppController.cpp",
157 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900158 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900159 "VirtualNetwork.cpp",
160 "main.cpp",
161 "oem_iptables_hook.cpp",
162 ],
163}
164
165cc_binary {
166 name: "ndc",
167 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800168 include_dirs: [
169 "system/netd/include",
170 ],
171 header_libs: [
172 "libnetd_client_headers",
173 ],
174 shared_libs: [
175 "libbase",
176 "libnetdutils",
177 "libnetutils",
178 "libcutils",
179 "liblog",
180 "libutils",
181 "libbinder",
182 "dnsresolver_aidl_interface-cpp",
183 "netd_aidl_interface-cpp",
184 ],
185 srcs: [
186 "ndc.cpp",
187 "UidRanges.cpp",
188 "NdcDispatcher.cpp",
189 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900190}
191
192cc_test {
193 name: "netd_unit_test",
194 defaults: ["netd_defaults"],
195 test_suites: ["device-tests"],
196 include_dirs: [
197 "system/netd/include",
198 "system/netd/server/binder",
199 "system/netd/tests",
200 "system/core/logwrapper/include",
201 ],
202 srcs: [
203 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900204 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800205 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900206 "ControllersTest.cpp",
207 "FirewallControllerTest.cpp",
208 "IdletimerControllerTest.cpp",
209 "InterfaceControllerTest.cpp",
210 "IptablesBaseTest.cpp",
211 "IptablesRestoreControllerTest.cpp",
212 "NFLogListenerTest.cpp",
213 "RouteControllerTest.cpp",
214 "SockDiagTest.cpp",
215 "StrictControllerTest.cpp",
216 "TetherControllerTest.cpp",
217 "TrafficControllerTest.cpp",
218 "XfrmControllerTest.cpp",
219 "WakeupControllerTest.cpp",
220 ],
221 static_libs: [
222 "libgmock",
223 "libnetd_server",
224 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900225 ],
226 shared_libs: [
227 "libbase",
228 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800229 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900230 "libcrypto",
231 "libcutils",
232 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700233 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900234 "libnetdutils",
235 "libnetutils",
236 "libqtaguid",
237 "libsysutils",
238 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900239 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900240 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900241 ],
242}