blob: 398ce33c2d1d68c97a137d352ce00956d3e47b0e [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: [
6 "binder/android/net/metrics/INetdEventListener.aidl"
7 ],
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 },
Luke Huangcaebcbb2018-09-27 20:37:14 +080046}
47
Remi NGUYEN VANabdb0bd2019-02-13 18:33:57 +090048aidl_interface {
49 name: "netd_aidl_parcelables",
50 local_include_dir: "binder",
51 srcs: [
52 "binder/android/net/InterfaceConfigurationParcel.aidl",
53 "binder/android/net/TetherStatsParcel.aidl",
54 "binder/android/net/UidRangeParcel.aidl",
55 ],
56 api_dir: "binder/api",
57 // NDK doesn't support array now.
58 backend: {
59 ndk: {
60 enabled: false,
61 },
62 },
63}
64
Bernie Innocenti98951792018-06-26 17:13:44 +090065// Modules common to both netd and netd_unit_test
66cc_library_static {
67 name: "libnetd_server",
68 defaults: ["netd_defaults"],
69 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090070 "system/netd/include",
71 "system/netd/server/binder",
72 ],
73 srcs: [
74 "BandwidthController.cpp",
75 "Controllers.cpp",
Mike Yu5ae61542018-10-19 22:11:43 +080076 "Dns64Configuration.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090077 "NetdConstants.cpp",
78 "FirewallController.cpp",
79 "IdletimerController.cpp",
80 "InterfaceController.cpp",
81 "IptablesRestoreController.cpp",
82 "NFLogListener.cpp",
83 "NetlinkCommands.cpp",
84 "NetlinkListener.cpp",
85 "NetlinkManager.cpp",
86 "RouteController.cpp",
87 "SockDiag.cpp",
88 "StrictController.cpp",
89 "TcpSocketMonitor.cpp",
90 "TetherController.cpp",
91 "TrafficController.cpp",
92 "UidRanges.cpp",
93 "WakeupController.cpp",
94 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090095 ],
96 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080097 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090098 "libbase",
99 "libbinder",
100 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700101 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900102 "libnetutils",
103 "libnetdutils",
104 "libpcap",
105 "libqtaguid",
106 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +0800107 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900108 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900109 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900110 header_libs: [
111 "libnetd_resolv_headers",
112 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900113 aidl: {
114 export_aidl_headers: true,
115 local_include_dirs: ["binder"],
116 },
117}
118
119cc_binary {
120 name: "netd",
121 defaults: ["netd_defaults"],
122 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900123 "external/mdnsresponder/mDNSShared",
124 "system/netd/include",
125 ],
126 init_rc: ["netd.rc"],
127 shared_libs: [
128 "android.system.net.netd@1.0",
129 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900130 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800132 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "libcrypto",
134 "libcutils",
135 "libdl",
136 "libhidlbase",
137 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900138 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900139 "liblog",
140 "liblogwrap",
141 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700142 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900143 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900144 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800146 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900147 "libqtaguid",
148 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900149 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900150 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800151 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900152 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900153 ],
154 static_libs: [
155 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900156 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900157 header_libs: [
158 "libnetd_resolv_headers",
159 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900160 srcs: [
161 "ClatdController.cpp",
162 "CommandListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900163 "DummyNetwork.cpp",
164 "DumpWriter.cpp",
165 "EventReporter.cpp",
166 "FwmarkServer.cpp",
167 "LocalNetwork.cpp",
168 "MDnsSdListener.cpp",
169 "NetdCommand.cpp",
170 "NetdHwService.cpp",
171 "NetdNativeService.cpp",
172 "NetlinkHandler.cpp",
173 "Network.cpp",
174 "NetworkController.cpp",
175 "PhysicalNetwork.cpp",
176 "PppController.cpp",
177 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900178 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900179 "ResolverController.cpp",
180 "VirtualNetwork.cpp",
181 "main.cpp",
182 "oem_iptables_hook.cpp",
183 ],
184}
185
186cc_binary {
187 name: "ndc",
188 defaults: ["netd_defaults"],
189 shared_libs: ["libcutils"],
190 srcs: ["ndc.cpp"],
191}
192
193cc_test {
194 name: "netd_unit_test",
195 defaults: ["netd_defaults"],
196 test_suites: ["device-tests"],
197 include_dirs: [
198 "system/netd/include",
199 "system/netd/server/binder",
200 "system/netd/tests",
201 "system/core/logwrapper/include",
202 ],
203 srcs: [
204 "BandwidthControllerTest.cpp",
205 "ControllersTest.cpp",
206 "FirewallControllerTest.cpp",
207 "IdletimerControllerTest.cpp",
208 "InterfaceControllerTest.cpp",
209 "IptablesBaseTest.cpp",
210 "IptablesRestoreControllerTest.cpp",
211 "NFLogListenerTest.cpp",
212 "RouteControllerTest.cpp",
213 "SockDiagTest.cpp",
214 "StrictControllerTest.cpp",
215 "TetherControllerTest.cpp",
216 "TrafficControllerTest.cpp",
217 "XfrmControllerTest.cpp",
218 "WakeupControllerTest.cpp",
219 ],
220 static_libs: [
221 "libgmock",
222 "libnetd_server",
223 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900224 ],
225 shared_libs: [
226 "libbase",
227 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800228 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900229 "libcrypto",
230 "libcutils",
231 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700232 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900233 "libnetdutils",
234 "libnetutils",
235 "libqtaguid",
236 "libsysutils",
237 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900238 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900239 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900240 ],
241}