blob: 49ecba3915405d2429844ed2f57bac1e880765ca [file] [log] [blame]
Colin Crossc03086f2017-11-14 13:05:37 -08001// AIDL interface between netd and framework.jar
2filegroup {
3 name: "netd_aidl",
4 srcs: ["binder/android/net/INetd.aidl"],
Bernie Innocentia28c5f22018-10-01 20:02:21 +09005 path: "binder",
Colin Crossc03086f2017-11-14 13:05:37 -08006}
Colin Cross1a8e7972017-12-05 22:35:52 -08007
8// AIDL interface between netd and services.core
9filegroup {
10 name: "netd_metrics_aidl",
11 srcs: ["binder/android/net/metrics/INetdEventListener.aidl"],
Bernie Innocentia28c5f22018-10-01 20:02:21 +090012 path: "binder",
Colin Cross1a8e7972017-12-05 22:35:52 -080013}
Steven Moreland0b7e3802018-03-02 12:41:52 -080014
Bernie Innocenti37ceb532018-06-11 21:10:44 +090015// These are used in netd_integration_test
16// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
17filegroup {
18 name: "netd_integration_test_shared",
19 srcs: [
20 "NetdConstants.cpp",
21 "InterfaceController.cpp",
22 "NetlinkCommands.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070023 "NetlinkListener.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090024 "XfrmController.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070025 "TrafficController.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090026 ],
27}
28
Luke Huangcaebcbb2018-09-27 20:37:14 +080029aidl_interface {
30 name: "netd_aidl_interface",
31 local_include_dir: "binder",
32 srcs: [
33 "binder/android/net/TetherStatsParcel.aidl",
Luke Huang94658ac2018-10-18 19:35:12 +090034 "binder/android/net/UidRangeParcel.aidl",
Luke Huangf7782042018-08-08 13:13:04 +080035 "binder/android/net/InterfaceConfigurationParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080036 ],
37 api_dir: "binder/api",
Luke Huangf7782042018-08-08 13:13:04 +080038 // NDK doesn't support array now.
39 backend: {
40 ndk: {
41 enabled: false,
42 },
43 },
Luke Huangcaebcbb2018-09-27 20:37:14 +080044}
45
Steven Moreland0b7e3802018-03-02 12:41:52 -080046cc_library {
47 name: "libnetdaidl",
Bernie Innocenti0c532742018-06-11 14:12:08 +090048 defaults: ["netd_defaults"],
Steven Moreland0b7e3802018-03-02 12:41:52 -080049 shared_libs: [
50 "libbinder",
51 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +080052 "netd_aidl_interface-cpp",
Steven Moreland0b7e3802018-03-02 12:41:52 -080053 ],
Bernie Innocenti4f9c3222018-10-12 17:00:51 +090054 export_shared_lib_headers: [
55 "netd_aidl_interface-cpp",
56 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080057 aidl: {
58 export_aidl_headers: true,
59 local_include_dirs: ["binder"],
60 include_dirs: ["frameworks/native/aidl/binder"],
61 },
62 srcs: [
Bernie Innocentia28c5f22018-10-01 20:02:21 +090063 ":netd_aidl",
Steven Moreland0b7e3802018-03-02 12:41:52 -080064 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080065 export_include_dirs: ["binder"],
66}
Bernie Innocenti98951792018-06-26 17:13:44 +090067
68// Modules common to both netd and netd_unit_test
69cc_library_static {
70 name: "libnetd_server",
71 defaults: ["netd_defaults"],
72 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090073 "system/netd/include",
74 "system/netd/server/binder",
75 ],
76 srcs: [
77 "BandwidthController.cpp",
78 "Controllers.cpp",
Mike Yu5ae61542018-10-19 22:11:43 +080079 "Dns64Configuration.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090080 "NetdConstants.cpp",
81 "FirewallController.cpp",
82 "IdletimerController.cpp",
83 "InterfaceController.cpp",
84 "IptablesRestoreController.cpp",
85 "NFLogListener.cpp",
86 "NetlinkCommands.cpp",
87 "NetlinkListener.cpp",
88 "NetlinkManager.cpp",
89 "RouteController.cpp",
90 "SockDiag.cpp",
91 "StrictController.cpp",
92 "TcpSocketMonitor.cpp",
93 "TetherController.cpp",
94 "TrafficController.cpp",
95 "UidRanges.cpp",
96 "WakeupController.cpp",
97 "XfrmController.cpp",
Bernie Innocentia28c5f22018-10-01 20:02:21 +090098 ":netd_metrics_aidl",
Bernie Innocenti98951792018-06-26 17:13:44 +090099 ],
100 shared_libs: [
101 "libbpf",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900102 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +0900103 "libnetdaidl",
104 "libbase",
105 "libbinder",
106 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700107 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900108 "libnetutils",
109 "libnetdutils",
110 "libpcap",
111 "libqtaguid",
112 "libssl",
113 ],
114 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",
133 "libbpf",
134 "libcrypto",
135 "libcutils",
136 "libdl",
137 "libhidlbase",
138 "libhidltransport",
139 "liblog",
140 "liblogwrap",
141 "libmdnssd",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900142 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +0900143 "libnetdaidl",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700144 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900146 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900147 "libpcap",
148 "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",
Bernie Innocenti98951792018-06-26 17:13:44 +0900153 ],
154 static_libs: [
155 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900156 ],
157 srcs: [
158 "ClatdController.cpp",
159 "CommandListener.cpp",
160 "DnsProxyListener.cpp",
161 "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",
176 "ResolverController.cpp",
177 "VirtualNetwork.cpp",
178 "main.cpp",
179 "oem_iptables_hook.cpp",
180 ],
181}
182
183cc_binary {
184 name: "ndc",
185 defaults: ["netd_defaults"],
186 shared_libs: ["libcutils"],
187 srcs: ["ndc.cpp"],
188}
189
190cc_test {
191 name: "netd_unit_test",
192 defaults: ["netd_defaults"],
193 test_suites: ["device-tests"],
194 include_dirs: [
195 "system/netd/include",
196 "system/netd/server/binder",
197 "system/netd/tests",
198 "system/core/logwrapper/include",
199 ],
200 srcs: [
201 "BandwidthControllerTest.cpp",
202 "ControllersTest.cpp",
203 "FirewallControllerTest.cpp",
204 "IdletimerControllerTest.cpp",
205 "InterfaceControllerTest.cpp",
206 "IptablesBaseTest.cpp",
207 "IptablesRestoreControllerTest.cpp",
208 "NFLogListenerTest.cpp",
209 "RouteControllerTest.cpp",
210 "SockDiagTest.cpp",
211 "StrictControllerTest.cpp",
212 "TetherControllerTest.cpp",
213 "TrafficControllerTest.cpp",
214 "XfrmControllerTest.cpp",
215 "WakeupControllerTest.cpp",
216 ],
217 static_libs: [
218 "libgmock",
219 "libnetd_server",
220 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900221 ],
222 shared_libs: [
223 "libbase",
224 "libbinder",
225 "libbpf",
226 "libcrypto",
227 "libcutils",
228 "liblog",
229 "libnetdaidl",
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",
Bernie Innocenti98951792018-06-26 17:13:44 +0900237 ],
238}