blob: b3063a2e6993d16181cd756b1d84bd1de11f09a4 [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",
23 "XfrmController.cpp",
24 ],
25}
26
Luke Huangcaebcbb2018-09-27 20:37:14 +080027aidl_interface {
28 name: "netd_aidl_interface",
29 local_include_dir: "binder",
30 srcs: [
31 "binder/android/net/TetherStatsParcel.aidl",
32 ],
33 api_dir: "binder/api",
34}
35
Steven Moreland0b7e3802018-03-02 12:41:52 -080036cc_library {
37 name: "libnetdaidl",
Bernie Innocenti0c532742018-06-11 14:12:08 +090038 defaults: ["netd_defaults"],
Steven Moreland0b7e3802018-03-02 12:41:52 -080039 shared_libs: [
40 "libbinder",
41 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +080042 "netd_aidl_interface-cpp",
Steven Moreland0b7e3802018-03-02 12:41:52 -080043 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080044 aidl: {
45 export_aidl_headers: true,
46 local_include_dirs: ["binder"],
47 include_dirs: ["frameworks/native/aidl/binder"],
48 },
49 srcs: [
Bernie Innocentia28c5f22018-10-01 20:02:21 +090050 ":netd_aidl",
Steven Moreland0b7e3802018-03-02 12:41:52 -080051 "binder/android/net/UidRange.cpp",
52 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080053 export_include_dirs: ["binder"],
54}
Bernie Innocenti98951792018-06-26 17:13:44 +090055
56// Modules common to both netd and netd_unit_test
57cc_library_static {
58 name: "libnetd_server",
59 defaults: ["netd_defaults"],
60 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090061 "system/netd/include",
62 "system/netd/server/binder",
63 ],
64 srcs: [
65 "BandwidthController.cpp",
66 "Controllers.cpp",
67 "NetdConstants.cpp",
68 "FirewallController.cpp",
69 "IdletimerController.cpp",
70 "InterfaceController.cpp",
71 "IptablesRestoreController.cpp",
72 "NFLogListener.cpp",
73 "NetlinkCommands.cpp",
74 "NetlinkListener.cpp",
75 "NetlinkManager.cpp",
76 "RouteController.cpp",
77 "SockDiag.cpp",
78 "StrictController.cpp",
79 "TcpSocketMonitor.cpp",
80 "TetherController.cpp",
81 "TrafficController.cpp",
82 "UidRanges.cpp",
83 "WakeupController.cpp",
84 "XfrmController.cpp",
Bernie Innocentia28c5f22018-10-01 20:02:21 +090085 ":netd_metrics_aidl",
Bernie Innocenti98951792018-06-26 17:13:44 +090086 ],
87 shared_libs: [
88 "libbpf",
Bernie Innocentif89b3512018-08-30 07:34:37 +090089 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +090090 "libnetdaidl",
91 "libbase",
92 "libbinder",
93 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070094 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090095 "libnetutils",
96 "libnetdutils",
97 "libpcap",
98 "libqtaguid",
99 "libssl",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800100 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900101 ],
102 aidl: {
103 export_aidl_headers: true,
104 local_include_dirs: ["binder"],
105 },
106}
107
108cc_binary {
109 name: "netd",
110 defaults: ["netd_defaults"],
111 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900112 "external/mdnsresponder/mDNSShared",
113 "system/netd/include",
114 ],
115 init_rc: ["netd.rc"],
116 shared_libs: [
117 "android.system.net.netd@1.0",
118 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900119 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900120 "libbinder",
121 "libbpf",
122 "libcrypto",
123 "libcutils",
124 "libdl",
125 "libhidlbase",
126 "libhidltransport",
127 "liblog",
128 "liblogwrap",
129 "libmdnssd",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900130 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 "libnetdaidl",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700132 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900134 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900135 "libpcap",
136 "libqtaguid",
137 "libselinux",
138 "libssl",
139 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800141 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 ],
143 static_libs: [
144 "libnetd_server",
145 "libnetddns",
146 ],
147 srcs: [
148 "ClatdController.cpp",
149 "CommandListener.cpp",
150 "DnsProxyListener.cpp",
151 "DummyNetwork.cpp",
152 "DumpWriter.cpp",
153 "EventReporter.cpp",
154 "FwmarkServer.cpp",
155 "LocalNetwork.cpp",
156 "MDnsSdListener.cpp",
157 "NetdCommand.cpp",
158 "NetdHwService.cpp",
159 "NetdNativeService.cpp",
160 "NetlinkHandler.cpp",
161 "Network.cpp",
162 "NetworkController.cpp",
163 "PhysicalNetwork.cpp",
164 "PppController.cpp",
165 "Process.cpp",
166 "ResolverController.cpp",
167 "VirtualNetwork.cpp",
168 "main.cpp",
169 "oem_iptables_hook.cpp",
170 ],
171}
172
173cc_binary {
174 name: "ndc",
175 defaults: ["netd_defaults"],
176 shared_libs: ["libcutils"],
177 srcs: ["ndc.cpp"],
178}
179
180cc_test {
181 name: "netd_unit_test",
182 defaults: ["netd_defaults"],
183 test_suites: ["device-tests"],
184 include_dirs: [
185 "system/netd/include",
186 "system/netd/server/binder",
187 "system/netd/tests",
188 "system/core/logwrapper/include",
189 ],
190 srcs: [
191 "BandwidthControllerTest.cpp",
192 "ControllersTest.cpp",
193 "FirewallControllerTest.cpp",
194 "IdletimerControllerTest.cpp",
195 "InterfaceControllerTest.cpp",
196 "IptablesBaseTest.cpp",
197 "IptablesRestoreControllerTest.cpp",
198 "NFLogListenerTest.cpp",
199 "RouteControllerTest.cpp",
200 "SockDiagTest.cpp",
201 "StrictControllerTest.cpp",
202 "TetherControllerTest.cpp",
203 "TrafficControllerTest.cpp",
204 "XfrmControllerTest.cpp",
205 "WakeupControllerTest.cpp",
206 ],
207 static_libs: [
208 "libgmock",
209 "libnetd_server",
210 "libnetd_test_tun_interface",
211 "libnetddns",
212 ],
213 shared_libs: [
214 "libbase",
215 "libbinder",
216 "libbpf",
217 "libcrypto",
218 "libcutils",
219 "liblog",
220 "libnetdaidl",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700221 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900222 "libnetdutils",
223 "libnetutils",
224 "libqtaguid",
225 "libsysutils",
226 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800227 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900228 ],
229}