blob: dc8a3cce9a026f6f7201350458e55bf9e4eeb757 [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 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080046 aidl: {
47 export_aidl_headers: true,
48 local_include_dirs: ["binder"],
49 include_dirs: ["frameworks/native/aidl/binder"],
50 },
51 srcs: [
Bernie Innocentia28c5f22018-10-01 20:02:21 +090052 ":netd_aidl",
Steven Moreland0b7e3802018-03-02 12:41:52 -080053 "binder/android/net/UidRange.cpp",
54 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080055 export_include_dirs: ["binder"],
56}
Bernie Innocenti98951792018-06-26 17:13:44 +090057
58// Modules common to both netd and netd_unit_test
59cc_library_static {
60 name: "libnetd_server",
61 defaults: ["netd_defaults"],
62 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090063 "system/netd/include",
64 "system/netd/server/binder",
65 ],
66 srcs: [
67 "BandwidthController.cpp",
68 "Controllers.cpp",
69 "NetdConstants.cpp",
70 "FirewallController.cpp",
71 "IdletimerController.cpp",
72 "InterfaceController.cpp",
73 "IptablesRestoreController.cpp",
74 "NFLogListener.cpp",
75 "NetlinkCommands.cpp",
76 "NetlinkListener.cpp",
77 "NetlinkManager.cpp",
78 "RouteController.cpp",
79 "SockDiag.cpp",
80 "StrictController.cpp",
81 "TcpSocketMonitor.cpp",
82 "TetherController.cpp",
83 "TrafficController.cpp",
84 "UidRanges.cpp",
85 "WakeupController.cpp",
86 "XfrmController.cpp",
Bernie Innocentia28c5f22018-10-01 20:02:21 +090087 ":netd_metrics_aidl",
Bernie Innocenti98951792018-06-26 17:13:44 +090088 ],
89 shared_libs: [
90 "libbpf",
Bernie Innocentif89b3512018-08-30 07:34:37 +090091 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +090092 "libnetdaidl",
93 "libbase",
94 "libbinder",
95 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070096 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090097 "libnetutils",
98 "libnetdutils",
99 "libpcap",
100 "libqtaguid",
101 "libssl",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800102 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900103 ],
104 aidl: {
105 export_aidl_headers: true,
106 local_include_dirs: ["binder"],
107 },
108}
109
110cc_binary {
111 name: "netd",
112 defaults: ["netd_defaults"],
113 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900114 "external/mdnsresponder/mDNSShared",
115 "system/netd/include",
116 ],
117 init_rc: ["netd.rc"],
118 shared_libs: [
119 "android.system.net.netd@1.0",
120 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900121 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900122 "libbinder",
123 "libbpf",
124 "libcrypto",
125 "libcutils",
126 "libdl",
127 "libhidlbase",
128 "libhidltransport",
129 "liblog",
130 "liblogwrap",
131 "libmdnssd",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900132 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "libnetdaidl",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700134 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900135 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900136 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900137 "libpcap",
138 "libqtaguid",
139 "libselinux",
140 "libssl",
141 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800143 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 ],
145 static_libs: [
146 "libnetd_server",
147 "libnetddns",
148 ],
149 srcs: [
150 "ClatdController.cpp",
151 "CommandListener.cpp",
152 "DnsProxyListener.cpp",
153 "DummyNetwork.cpp",
154 "DumpWriter.cpp",
155 "EventReporter.cpp",
156 "FwmarkServer.cpp",
157 "LocalNetwork.cpp",
158 "MDnsSdListener.cpp",
159 "NetdCommand.cpp",
160 "NetdHwService.cpp",
161 "NetdNativeService.cpp",
162 "NetlinkHandler.cpp",
163 "Network.cpp",
164 "NetworkController.cpp",
165 "PhysicalNetwork.cpp",
166 "PppController.cpp",
167 "Process.cpp",
168 "ResolverController.cpp",
169 "VirtualNetwork.cpp",
170 "main.cpp",
171 "oem_iptables_hook.cpp",
172 ],
173}
174
175cc_binary {
176 name: "ndc",
177 defaults: ["netd_defaults"],
178 shared_libs: ["libcutils"],
179 srcs: ["ndc.cpp"],
180}
181
182cc_test {
183 name: "netd_unit_test",
184 defaults: ["netd_defaults"],
185 test_suites: ["device-tests"],
186 include_dirs: [
187 "system/netd/include",
188 "system/netd/server/binder",
189 "system/netd/tests",
190 "system/core/logwrapper/include",
191 ],
192 srcs: [
193 "BandwidthControllerTest.cpp",
194 "ControllersTest.cpp",
195 "FirewallControllerTest.cpp",
196 "IdletimerControllerTest.cpp",
197 "InterfaceControllerTest.cpp",
198 "IptablesBaseTest.cpp",
199 "IptablesRestoreControllerTest.cpp",
200 "NFLogListenerTest.cpp",
201 "RouteControllerTest.cpp",
202 "SockDiagTest.cpp",
203 "StrictControllerTest.cpp",
204 "TetherControllerTest.cpp",
205 "TrafficControllerTest.cpp",
206 "XfrmControllerTest.cpp",
207 "WakeupControllerTest.cpp",
208 ],
209 static_libs: [
210 "libgmock",
211 "libnetd_server",
212 "libnetd_test_tun_interface",
213 "libnetddns",
214 ],
215 shared_libs: [
216 "libbase",
217 "libbinder",
218 "libbpf",
219 "libcrypto",
220 "libcutils",
221 "liblog",
222 "libnetdaidl",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700223 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900224 "libnetdutils",
225 "libnetutils",
226 "libqtaguid",
227 "libsysutils",
228 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800229 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900230 ],
231}