blob: 2b6cf328587d3d9d4f623e8cfcbafe6bd1ce5e6e [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
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +090011
12
Bernie Innocenti37ceb532018-06-11 21:10:44 +090013// These are used in netd_integration_test
14// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
15filegroup {
16 name: "netd_integration_test_shared",
17 srcs: [
18 "NetdConstants.cpp",
19 "InterfaceController.cpp",
20 "NetlinkCommands.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070021 "NetlinkListener.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090022 "XfrmController.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070023 "TrafficController.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090024 ],
25}
26
Luke Huangcaebcbb2018-09-27 20:37:14 +080027aidl_interface {
28 name: "netd_aidl_interface",
29 local_include_dir: "binder",
30 srcs: [
Luke Huang03074eb2018-11-23 17:03:03 +080031 "binder/android/net/INetd.aidl",
Luke Huang528af602018-08-29 19:06:05 +080032 // AIDL interface that callers can implement to receive networking events from netd.
33 "binder/android/net/INetdUnsolicitedEventListener.aidl",
Luke Huang03074eb2018-11-23 17:03:03 +080034 "binder/android/net/InterfaceConfigurationParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080035 "binder/android/net/TetherStatsParcel.aidl",
Luke Huang94658ac2018-10-18 19:35:12 +090036 "binder/android/net/UidRangeParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080037 ],
38 api_dir: "binder/api",
Luke Huangf7782042018-08-08 13:13:04 +080039 // NDK doesn't support array now.
40 backend: {
41 ndk: {
42 enabled: false,
43 },
44 },
Luke Huangcaebcbb2018-09-27 20:37:14 +080045}
46
Remi NGUYEN VANabdb0bd2019-02-13 18:33:57 +090047aidl_interface {
48 name: "netd_aidl_parcelables",
49 local_include_dir: "binder",
50 srcs: [
51 "binder/android/net/InterfaceConfigurationParcel.aidl",
52 "binder/android/net/TetherStatsParcel.aidl",
53 "binder/android/net/UidRangeParcel.aidl",
54 ],
55 api_dir: "binder/api",
56 // NDK doesn't support array now.
57 backend: {
58 ndk: {
59 enabled: false,
60 },
61 },
62}
63
Bernie Innocenti98951792018-06-26 17:13:44 +090064// Modules common to both netd and netd_unit_test
65cc_library_static {
66 name: "libnetd_server",
67 defaults: ["netd_defaults"],
68 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090069 "system/netd/include",
70 "system/netd/server/binder",
71 ],
72 srcs: [
73 "BandwidthController.cpp",
74 "Controllers.cpp",
Mike Yu5ae61542018-10-19 22:11:43 +080075 "Dns64Configuration.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090076 "NetdConstants.cpp",
77 "FirewallController.cpp",
78 "IdletimerController.cpp",
79 "InterfaceController.cpp",
80 "IptablesRestoreController.cpp",
81 "NFLogListener.cpp",
82 "NetlinkCommands.cpp",
83 "NetlinkListener.cpp",
84 "NetlinkManager.cpp",
85 "RouteController.cpp",
86 "SockDiag.cpp",
87 "StrictController.cpp",
88 "TcpSocketMonitor.cpp",
89 "TetherController.cpp",
90 "TrafficController.cpp",
91 "UidRanges.cpp",
92 "WakeupController.cpp",
93 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090094 ],
95 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080096 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090097 "libbase",
98 "libbinder",
99 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700100 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900101 "libnetutils",
102 "libnetdutils",
103 "libpcap",
104 "libqtaguid",
105 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +0800106 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900107 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900108 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900109 header_libs: [
110 "libnetd_resolv_headers",
111 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900112 aidl: {
113 export_aidl_headers: true,
114 local_include_dirs: ["binder"],
115 },
116}
117
118cc_binary {
119 name: "netd",
120 defaults: ["netd_defaults"],
121 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900122 "external/mdnsresponder/mDNSShared",
123 "system/netd/include",
124 ],
125 init_rc: ["netd.rc"],
126 shared_libs: [
127 "android.system.net.netd@1.0",
128 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900129 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800131 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900132 "libcrypto",
133 "libcutils",
134 "libdl",
135 "libhidlbase",
136 "libhidltransport",
137 "liblog",
138 "liblogwrap",
139 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700140 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900142 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900143 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800144 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 "libqtaguid",
146 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900147 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900148 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800149 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900150 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900151 ],
152 static_libs: [
153 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900154 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900155 header_libs: [
156 "libnetd_resolv_headers",
157 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900158 srcs: [
159 "ClatdController.cpp",
160 "CommandListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900161 "DummyNetwork.cpp",
162 "DumpWriter.cpp",
163 "EventReporter.cpp",
164 "FwmarkServer.cpp",
165 "LocalNetwork.cpp",
166 "MDnsSdListener.cpp",
167 "NetdCommand.cpp",
168 "NetdHwService.cpp",
169 "NetdNativeService.cpp",
170 "NetlinkHandler.cpp",
171 "Network.cpp",
172 "NetworkController.cpp",
173 "PhysicalNetwork.cpp",
174 "PppController.cpp",
175 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900176 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900177 "ResolverController.cpp",
178 "VirtualNetwork.cpp",
179 "main.cpp",
180 "oem_iptables_hook.cpp",
181 ],
182}
183
184cc_binary {
185 name: "ndc",
186 defaults: ["netd_defaults"],
187 shared_libs: ["libcutils"],
188 srcs: ["ndc.cpp"],
189}
190
191cc_test {
192 name: "netd_unit_test",
193 defaults: ["netd_defaults"],
194 test_suites: ["device-tests"],
195 include_dirs: [
196 "system/netd/include",
197 "system/netd/server/binder",
198 "system/netd/tests",
199 "system/core/logwrapper/include",
200 ],
201 srcs: [
202 "BandwidthControllerTest.cpp",
203 "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}