blob: b655988e457c31a0a3515bb018b60cc4e6574d48 [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",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090075 "ClatdController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090076 "Controllers.cpp",
Mike Yu5ae61542018-10-19 22:11:43 +080077 "Dns64Configuration.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090078 "NetdConstants.cpp",
79 "FirewallController.cpp",
80 "IdletimerController.cpp",
81 "InterfaceController.cpp",
82 "IptablesRestoreController.cpp",
83 "NFLogListener.cpp",
84 "NetlinkCommands.cpp",
85 "NetlinkListener.cpp",
86 "NetlinkManager.cpp",
87 "RouteController.cpp",
88 "SockDiag.cpp",
89 "StrictController.cpp",
90 "TcpSocketMonitor.cpp",
91 "TetherController.cpp",
92 "TrafficController.cpp",
93 "UidRanges.cpp",
94 "WakeupController.cpp",
95 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090096 ],
97 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080098 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090099 "libbase",
100 "libbinder",
101 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700102 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900103 "libnetutils",
104 "libnetdutils",
105 "libpcap",
106 "libqtaguid",
107 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +0800108 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900109 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900110 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900111 header_libs: [
112 "libnetd_resolv_headers",
113 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900114 aidl: {
115 export_aidl_headers: true,
116 local_include_dirs: ["binder"],
117 },
118}
119
120cc_binary {
121 name: "netd",
122 defaults: ["netd_defaults"],
123 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900124 "external/mdnsresponder/mDNSShared",
125 "system/netd/include",
126 ],
127 init_rc: ["netd.rc"],
128 shared_libs: [
129 "android.system.net.netd@1.0",
130 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900131 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900132 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800133 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900134 "libcrypto",
135 "libcutils",
136 "libdl",
137 "libhidlbase",
138 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900139 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 "liblog",
141 "liblogwrap",
142 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700143 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900145 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900146 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800147 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900148 "libqtaguid",
149 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900150 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900151 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800152 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900153 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900154 ],
155 static_libs: [
156 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900157 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900158 header_libs: [
159 "libnetd_resolv_headers",
160 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900161 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900162 "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",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900205 "ClatdControllerTest.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}