blob: 2f8ee895bd877e3151846118a9d678f1916a08b5 [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",
34 ],
35 api_dir: "binder/api",
36}
37
Steven Moreland0b7e3802018-03-02 12:41:52 -080038cc_library {
39 name: "libnetdaidl",
Bernie Innocenti0c532742018-06-11 14:12:08 +090040 defaults: ["netd_defaults"],
Steven Moreland0b7e3802018-03-02 12:41:52 -080041 shared_libs: [
42 "libbinder",
43 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +080044 "netd_aidl_interface-cpp",
Steven Moreland0b7e3802018-03-02 12:41:52 -080045 ],
Bernie Innocenti4f9c3222018-10-12 17:00:51 +090046 export_shared_lib_headers: [
47 "netd_aidl_interface-cpp",
48 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080049 aidl: {
50 export_aidl_headers: true,
51 local_include_dirs: ["binder"],
52 include_dirs: ["frameworks/native/aidl/binder"],
53 },
54 srcs: [
Bernie Innocentia28c5f22018-10-01 20:02:21 +090055 ":netd_aidl",
Steven Moreland0b7e3802018-03-02 12:41:52 -080056 "binder/android/net/UidRange.cpp",
57 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080058 export_include_dirs: ["binder"],
59}
Bernie Innocenti98951792018-06-26 17:13:44 +090060
61// Modules common to both netd and netd_unit_test
62cc_library_static {
63 name: "libnetd_server",
64 defaults: ["netd_defaults"],
65 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090066 "system/netd/include",
67 "system/netd/server/binder",
68 ],
69 srcs: [
70 "BandwidthController.cpp",
71 "Controllers.cpp",
72 "NetdConstants.cpp",
73 "FirewallController.cpp",
74 "IdletimerController.cpp",
75 "InterfaceController.cpp",
76 "IptablesRestoreController.cpp",
77 "NFLogListener.cpp",
78 "NetlinkCommands.cpp",
79 "NetlinkListener.cpp",
80 "NetlinkManager.cpp",
81 "RouteController.cpp",
82 "SockDiag.cpp",
83 "StrictController.cpp",
84 "TcpSocketMonitor.cpp",
85 "TetherController.cpp",
86 "TrafficController.cpp",
87 "UidRanges.cpp",
88 "WakeupController.cpp",
89 "XfrmController.cpp",
Bernie Innocentia28c5f22018-10-01 20:02:21 +090090 ":netd_metrics_aidl",
Bernie Innocenti98951792018-06-26 17:13:44 +090091 ],
92 shared_libs: [
93 "libbpf",
Bernie Innocentif89b3512018-08-30 07:34:37 +090094 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +090095 "libnetdaidl",
96 "libbase",
97 "libbinder",
98 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070099 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900100 "libnetutils",
101 "libnetdutils",
102 "libpcap",
103 "libqtaguid",
104 "libssl",
105 ],
106 aidl: {
107 export_aidl_headers: true,
108 local_include_dirs: ["binder"],
109 },
110}
111
112cc_binary {
113 name: "netd",
114 defaults: ["netd_defaults"],
115 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900116 "external/mdnsresponder/mDNSShared",
117 "system/netd/include",
118 ],
119 init_rc: ["netd.rc"],
120 shared_libs: [
121 "android.system.net.netd@1.0",
122 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900123 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900124 "libbinder",
125 "libbpf",
126 "libcrypto",
127 "libcutils",
128 "libdl",
129 "libhidlbase",
130 "libhidltransport",
131 "liblog",
132 "liblogwrap",
133 "libmdnssd",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900134 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +0900135 "libnetdaidl",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700136 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900137 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900138 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900139 "libpcap",
140 "libqtaguid",
141 "libselinux",
142 "libssl",
143 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800145 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900146 ],
147 static_libs: [
148 "libnetd_server",
149 "libnetddns",
150 ],
151 srcs: [
152 "ClatdController.cpp",
153 "CommandListener.cpp",
154 "DnsProxyListener.cpp",
155 "DummyNetwork.cpp",
156 "DumpWriter.cpp",
157 "EventReporter.cpp",
158 "FwmarkServer.cpp",
159 "LocalNetwork.cpp",
160 "MDnsSdListener.cpp",
161 "NetdCommand.cpp",
162 "NetdHwService.cpp",
163 "NetdNativeService.cpp",
164 "NetlinkHandler.cpp",
165 "Network.cpp",
166 "NetworkController.cpp",
167 "PhysicalNetwork.cpp",
168 "PppController.cpp",
169 "Process.cpp",
170 "ResolverController.cpp",
171 "VirtualNetwork.cpp",
172 "main.cpp",
173 "oem_iptables_hook.cpp",
174 ],
175}
176
177cc_binary {
178 name: "ndc",
179 defaults: ["netd_defaults"],
180 shared_libs: ["libcutils"],
181 srcs: ["ndc.cpp"],
182}
183
184cc_test {
185 name: "netd_unit_test",
186 defaults: ["netd_defaults"],
187 test_suites: ["device-tests"],
188 include_dirs: [
189 "system/netd/include",
190 "system/netd/server/binder",
191 "system/netd/tests",
192 "system/core/logwrapper/include",
193 ],
194 srcs: [
195 "BandwidthControllerTest.cpp",
196 "ControllersTest.cpp",
197 "FirewallControllerTest.cpp",
198 "IdletimerControllerTest.cpp",
199 "InterfaceControllerTest.cpp",
200 "IptablesBaseTest.cpp",
201 "IptablesRestoreControllerTest.cpp",
202 "NFLogListenerTest.cpp",
203 "RouteControllerTest.cpp",
204 "SockDiagTest.cpp",
205 "StrictControllerTest.cpp",
206 "TetherControllerTest.cpp",
207 "TrafficControllerTest.cpp",
208 "XfrmControllerTest.cpp",
209 "WakeupControllerTest.cpp",
210 ],
211 static_libs: [
212 "libgmock",
213 "libnetd_server",
214 "libnetd_test_tun_interface",
215 "libnetddns",
216 ],
217 shared_libs: [
218 "libbase",
219 "libbinder",
220 "libbpf",
221 "libcrypto",
222 "libcutils",
223 "liblog",
224 "libnetdaidl",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700225 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900226 "libnetdutils",
227 "libnetutils",
228 "libqtaguid",
229 "libsysutils",
230 "libutils",
231 ],
232}