blob: 1128252e8b6e1d5678bac15bd38027585b574bc3 [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
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",
Mike Yu5ae61542018-10-19 22:11:43 +080061 "Dns64Configuration.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090062 "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 "libcrypto",
119 "libcutils",
120 "libdl",
121 "libhidlbase",
122 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900123 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900124 "liblog",
125 "liblogwrap",
126 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700127 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900128 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900129 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800131 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900132 "libqtaguid",
133 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900134 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900135 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800136 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900137 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900138 ],
139 static_libs: [
140 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900142 header_libs: [
143 "libnetd_resolv_headers",
144 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900146 "CommandListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900147 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900148 "EventReporter.cpp",
149 "FwmarkServer.cpp",
150 "LocalNetwork.cpp",
151 "MDnsSdListener.cpp",
152 "NetdCommand.cpp",
153 "NetdHwService.cpp",
154 "NetdNativeService.cpp",
155 "NetlinkHandler.cpp",
156 "Network.cpp",
157 "NetworkController.cpp",
158 "PhysicalNetwork.cpp",
159 "PppController.cpp",
160 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900161 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900162 "ResolverController.cpp",
163 "VirtualNetwork.cpp",
164 "main.cpp",
165 "oem_iptables_hook.cpp",
166 ],
167}
168
169cc_binary {
170 name: "ndc",
171 defaults: ["netd_defaults"],
172 shared_libs: ["libcutils"],
173 srcs: ["ndc.cpp"],
174}
175
176cc_test {
177 name: "netd_unit_test",
178 defaults: ["netd_defaults"],
179 test_suites: ["device-tests"],
180 include_dirs: [
181 "system/netd/include",
182 "system/netd/server/binder",
183 "system/netd/tests",
184 "system/core/logwrapper/include",
185 ],
186 srcs: [
187 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900188 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800189 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900190 "ControllersTest.cpp",
191 "FirewallControllerTest.cpp",
192 "IdletimerControllerTest.cpp",
193 "InterfaceControllerTest.cpp",
194 "IptablesBaseTest.cpp",
195 "IptablesRestoreControllerTest.cpp",
196 "NFLogListenerTest.cpp",
197 "RouteControllerTest.cpp",
198 "SockDiagTest.cpp",
199 "StrictControllerTest.cpp",
200 "TetherControllerTest.cpp",
201 "TrafficControllerTest.cpp",
202 "XfrmControllerTest.cpp",
203 "WakeupControllerTest.cpp",
204 ],
205 static_libs: [
206 "libgmock",
207 "libnetd_server",
208 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900209 ],
210 shared_libs: [
211 "libbase",
212 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800213 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900214 "libcrypto",
215 "libcutils",
216 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700217 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900218 "libnetdutils",
219 "libnetutils",
220 "libqtaguid",
221 "libsysutils",
222 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900223 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900224 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900225 ],
226}