blob: e0048c6c5785157194ac0e738e94f93f2e107951 [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 // NDK doesn't support array now.
38 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090039 cpp: {
40 gen_log: true,
41 },
Luke Huangf7782042018-08-08 13:13:04 +080042 ndk: {
43 enabled: false,
44 },
45 },
Remi NGUYEN VAN6b91b492019-04-09 13:57:03 +090046 versions: ["1"],
Luke Huangcaebcbb2018-09-27 20:37:14 +080047}
48
Bernie Innocenti98951792018-06-26 17:13:44 +090049// Modules common to both netd and netd_unit_test
50cc_library_static {
51 name: "libnetd_server",
52 defaults: ["netd_defaults"],
53 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090054 "system/netd/include",
55 "system/netd/server/binder",
56 ],
57 srcs: [
58 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090059 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080060 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090061 "Controllers.cpp",
62 "NetdConstants.cpp",
63 "FirewallController.cpp",
64 "IdletimerController.cpp",
65 "InterfaceController.cpp",
66 "IptablesRestoreController.cpp",
67 "NFLogListener.cpp",
68 "NetlinkCommands.cpp",
69 "NetlinkListener.cpp",
70 "NetlinkManager.cpp",
71 "RouteController.cpp",
72 "SockDiag.cpp",
73 "StrictController.cpp",
74 "TcpSocketMonitor.cpp",
75 "TetherController.cpp",
76 "TrafficController.cpp",
77 "UidRanges.cpp",
78 "WakeupController.cpp",
79 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090080 ],
81 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080082 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090083 "libbase",
84 "libbinder",
85 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070086 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090087 "libnetutils",
88 "libnetdutils",
89 "libpcap",
90 "libqtaguid",
91 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +080092 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +090093 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090094 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +090095 header_libs: [
96 "libnetd_resolv_headers",
97 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090098 aidl: {
99 export_aidl_headers: true,
100 local_include_dirs: ["binder"],
101 },
102}
103
104cc_binary {
105 name: "netd",
106 defaults: ["netd_defaults"],
107 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900108 "external/mdnsresponder/mDNSShared",
109 "system/netd/include",
110 ],
111 init_rc: ["netd.rc"],
112 shared_libs: [
113 "android.system.net.netd@1.0",
114 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900115 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900116 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800117 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900118 "libcutils",
119 "libdl",
120 "libhidlbase",
121 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900122 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900123 "liblog",
124 "liblogwrap",
125 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700126 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900127 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900128 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900129 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800130 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 "libqtaguid",
132 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900134 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800135 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900136 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900137 ],
138 static_libs: [
139 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900141 header_libs: [
142 "libnetd_resolv_headers",
143 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 "CommandListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900146 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900147 "EventReporter.cpp",
148 "FwmarkServer.cpp",
149 "LocalNetwork.cpp",
150 "MDnsSdListener.cpp",
151 "NetdCommand.cpp",
152 "NetdHwService.cpp",
153 "NetdNativeService.cpp",
154 "NetlinkHandler.cpp",
155 "Network.cpp",
156 "NetworkController.cpp",
157 "PhysicalNetwork.cpp",
158 "PppController.cpp",
159 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900160 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900161 "VirtualNetwork.cpp",
162 "main.cpp",
163 "oem_iptables_hook.cpp",
164 ],
165}
166
167cc_binary {
168 name: "ndc",
169 defaults: ["netd_defaults"],
170 shared_libs: ["libcutils"],
171 srcs: ["ndc.cpp"],
172}
173
174cc_test {
175 name: "netd_unit_test",
176 defaults: ["netd_defaults"],
177 test_suites: ["device-tests"],
178 include_dirs: [
179 "system/netd/include",
180 "system/netd/server/binder",
181 "system/netd/tests",
182 "system/core/logwrapper/include",
183 ],
184 srcs: [
185 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900186 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800187 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900188 "ControllersTest.cpp",
189 "FirewallControllerTest.cpp",
190 "IdletimerControllerTest.cpp",
191 "InterfaceControllerTest.cpp",
192 "IptablesBaseTest.cpp",
193 "IptablesRestoreControllerTest.cpp",
194 "NFLogListenerTest.cpp",
195 "RouteControllerTest.cpp",
196 "SockDiagTest.cpp",
197 "StrictControllerTest.cpp",
198 "TetherControllerTest.cpp",
199 "TrafficControllerTest.cpp",
200 "XfrmControllerTest.cpp",
201 "WakeupControllerTest.cpp",
202 ],
203 static_libs: [
204 "libgmock",
205 "libnetd_server",
206 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900207 ],
208 shared_libs: [
209 "libbase",
210 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800211 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900212 "libcrypto",
213 "libcutils",
214 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700215 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900216 "libnetdutils",
217 "libnetutils",
218 "libqtaguid",
219 "libsysutils",
220 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900221 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900222 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900223 ],
224}