blob: 600d80f42dbc495e14f50d0bf3bdfb07b19049f0 [file] [log] [blame]
Colin Cross1a8e7972017-12-05 22:35:52 -08001// AIDL interface between netd and services.core
2filegroup {
3 name: "netd_metrics_aidl",
4 srcs: ["binder/android/net/metrics/INetdEventListener.aidl"],
Bernie Innocentia28c5f22018-10-01 20:02:21 +09005 path: "binder",
Colin Cross1a8e7972017-12-05 22:35:52 -08006}
Steven Moreland0b7e3802018-03-02 12:41:52 -08007
Bernie Innocenti37ceb532018-06-11 21:10:44 +09008// These are used in netd_integration_test
9// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
10filegroup {
11 name: "netd_integration_test_shared",
12 srcs: [
13 "NetdConstants.cpp",
14 "InterfaceController.cpp",
15 "NetlinkCommands.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070016 "NetlinkListener.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090017 "XfrmController.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070018 "TrafficController.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090019 ],
20}
21
Luke Huangcaebcbb2018-09-27 20:37:14 +080022aidl_interface {
23 name: "netd_aidl_interface",
24 local_include_dir: "binder",
25 srcs: [
Luke Huang03074eb2018-11-23 17:03:03 +080026 "binder/android/net/INetd.aidl",
27 "binder/android/net/InterfaceConfigurationParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080028 "binder/android/net/TetherStatsParcel.aidl",
Luke Huang94658ac2018-10-18 19:35:12 +090029 "binder/android/net/UidRangeParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080030 ],
31 api_dir: "binder/api",
Luke Huangf7782042018-08-08 13:13:04 +080032 // NDK doesn't support array now.
33 backend: {
34 ndk: {
35 enabled: false,
36 },
37 },
Luke Huangcaebcbb2018-09-27 20:37:14 +080038}
39
Bernie Innocenti98951792018-06-26 17:13:44 +090040// Modules common to both netd and netd_unit_test
41cc_library_static {
42 name: "libnetd_server",
43 defaults: ["netd_defaults"],
44 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090045 "system/netd/include",
46 "system/netd/server/binder",
47 ],
48 srcs: [
49 "BandwidthController.cpp",
50 "Controllers.cpp",
Mike Yu5ae61542018-10-19 22:11:43 +080051 "Dns64Configuration.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090052 "NetdConstants.cpp",
53 "FirewallController.cpp",
54 "IdletimerController.cpp",
55 "InterfaceController.cpp",
56 "IptablesRestoreController.cpp",
57 "NFLogListener.cpp",
58 "NetlinkCommands.cpp",
59 "NetlinkListener.cpp",
60 "NetlinkManager.cpp",
61 "RouteController.cpp",
62 "SockDiag.cpp",
63 "StrictController.cpp",
64 "TcpSocketMonitor.cpp",
65 "TetherController.cpp",
66 "TrafficController.cpp",
67 "UidRanges.cpp",
68 "WakeupController.cpp",
69 "XfrmController.cpp",
Bernie Innocentia28c5f22018-10-01 20:02:21 +090070 ":netd_metrics_aidl",
Bernie Innocenti98951792018-06-26 17:13:44 +090071 ],
72 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080073 "libbpf_android",
Bernie Innocentif89b3512018-08-30 07:34:37 +090074 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +090075 "libbase",
76 "libbinder",
77 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070078 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090079 "libnetutils",
80 "libnetdutils",
81 "libpcap",
82 "libqtaguid",
83 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +080084 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090085 ],
86 aidl: {
87 export_aidl_headers: true,
88 local_include_dirs: ["binder"],
89 },
90}
91
92cc_binary {
93 name: "netd",
94 defaults: ["netd_defaults"],
95 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090096 "external/mdnsresponder/mDNSShared",
97 "system/netd/include",
98 ],
99 init_rc: ["netd.rc"],
100 shared_libs: [
101 "android.system.net.netd@1.0",
102 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900103 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900104 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800105 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900106 "libcrypto",
107 "libcutils",
108 "libdl",
109 "libhidlbase",
110 "libhidltransport",
111 "liblog",
112 "liblogwrap",
113 "libmdnssd",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900114 "libnetd_resolv",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700115 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900116 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900117 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900118 "libpcap",
119 "libqtaguid",
120 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900121 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900122 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800123 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900124 ],
125 static_libs: [
126 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900127 ],
128 srcs: [
129 "ClatdController.cpp",
130 "CommandListener.cpp",
131 "DnsProxyListener.cpp",
132 "DummyNetwork.cpp",
133 "DumpWriter.cpp",
134 "EventReporter.cpp",
135 "FwmarkServer.cpp",
136 "LocalNetwork.cpp",
137 "MDnsSdListener.cpp",
138 "NetdCommand.cpp",
139 "NetdHwService.cpp",
140 "NetdNativeService.cpp",
141 "NetlinkHandler.cpp",
142 "Network.cpp",
143 "NetworkController.cpp",
144 "PhysicalNetwork.cpp",
145 "PppController.cpp",
146 "Process.cpp",
147 "ResolverController.cpp",
148 "VirtualNetwork.cpp",
149 "main.cpp",
150 "oem_iptables_hook.cpp",
151 ],
152}
153
154cc_binary {
155 name: "ndc",
156 defaults: ["netd_defaults"],
157 shared_libs: ["libcutils"],
158 srcs: ["ndc.cpp"],
159}
160
161cc_test {
162 name: "netd_unit_test",
163 defaults: ["netd_defaults"],
164 test_suites: ["device-tests"],
165 include_dirs: [
166 "system/netd/include",
167 "system/netd/server/binder",
168 "system/netd/tests",
169 "system/core/logwrapper/include",
170 ],
171 srcs: [
172 "BandwidthControllerTest.cpp",
173 "ControllersTest.cpp",
174 "FirewallControllerTest.cpp",
175 "IdletimerControllerTest.cpp",
176 "InterfaceControllerTest.cpp",
177 "IptablesBaseTest.cpp",
178 "IptablesRestoreControllerTest.cpp",
179 "NFLogListenerTest.cpp",
180 "RouteControllerTest.cpp",
181 "SockDiagTest.cpp",
182 "StrictControllerTest.cpp",
183 "TetherControllerTest.cpp",
184 "TrafficControllerTest.cpp",
185 "XfrmControllerTest.cpp",
186 "WakeupControllerTest.cpp",
187 ],
188 static_libs: [
189 "libgmock",
190 "libnetd_server",
191 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900192 ],
193 shared_libs: [
194 "libbase",
195 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800196 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900197 "libcrypto",
198 "libcutils",
199 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700200 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900201 "libnetdutils",
202 "libnetutils",
203 "libqtaguid",
204 "libsysutils",
205 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900206 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900207 ],
208}