blob: 75667e97838025ec8cc0c72144e68f25c4dae7e9 [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",
94 "libnetutils",
95 "libnetdutils",
96 "libpcap",
97 "libqtaguid",
98 "libssl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080099 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900100 ],
101 aidl: {
102 export_aidl_headers: true,
103 local_include_dirs: ["binder"],
104 },
105}
106
107cc_binary {
108 name: "netd",
109 defaults: ["netd_defaults"],
110 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900111 "external/mdnsresponder/mDNSShared",
112 "system/netd/include",
113 ],
114 init_rc: ["netd.rc"],
115 shared_libs: [
116 "android.system.net.netd@1.0",
117 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900118 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900119 "libbinder",
120 "libbpf",
121 "libcrypto",
122 "libcutils",
123 "libdl",
124 "libhidlbase",
125 "libhidltransport",
126 "liblog",
127 "liblogwrap",
128 "libmdnssd",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900129 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libnetdaidl",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900132 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "libpcap",
134 "libqtaguid",
135 "libselinux",
136 "libssl",
137 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900138 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800139 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 ],
141 static_libs: [
142 "libnetd_server",
143 "libnetddns",
144 ],
145 srcs: [
146 "ClatdController.cpp",
147 "CommandListener.cpp",
148 "DnsProxyListener.cpp",
149 "DummyNetwork.cpp",
150 "DumpWriter.cpp",
151 "EventReporter.cpp",
152 "FwmarkServer.cpp",
153 "LocalNetwork.cpp",
154 "MDnsSdListener.cpp",
155 "NetdCommand.cpp",
156 "NetdHwService.cpp",
157 "NetdNativeService.cpp",
158 "NetlinkHandler.cpp",
159 "Network.cpp",
160 "NetworkController.cpp",
161 "PhysicalNetwork.cpp",
162 "PppController.cpp",
163 "Process.cpp",
164 "ResolverController.cpp",
165 "VirtualNetwork.cpp",
166 "main.cpp",
167 "oem_iptables_hook.cpp",
168 ],
169}
170
171cc_binary {
172 name: "ndc",
173 defaults: ["netd_defaults"],
174 shared_libs: ["libcutils"],
175 srcs: ["ndc.cpp"],
176}
177
178cc_test {
179 name: "netd_unit_test",
180 defaults: ["netd_defaults"],
181 test_suites: ["device-tests"],
182 include_dirs: [
183 "system/netd/include",
184 "system/netd/server/binder",
185 "system/netd/tests",
186 "system/core/logwrapper/include",
187 ],
188 srcs: [
189 "BandwidthControllerTest.cpp",
190 "ControllersTest.cpp",
191 "FirewallControllerTest.cpp",
192 "IdletimerControllerTest.cpp",
193 "InterfaceControllerTest.cpp",
194 "IptablesBaseTest.cpp",
195 "IptablesRestoreControllerTest.cpp",
196 "NFLogListenerTest.cpp",
197 "RouteControllerTest.cpp",
198 "SockDiagTest.cpp",
199 "StrictControllerTest.cpp",
200 "TetherControllerTest.cpp",
201 "TrafficControllerTest.cpp",
202 "XfrmControllerTest.cpp",
203 "WakeupControllerTest.cpp",
204 ],
205 static_libs: [
206 "libgmock",
207 "libnetd_server",
208 "libnetd_test_tun_interface",
209 "libnetddns",
210 ],
211 shared_libs: [
212 "libbase",
213 "libbinder",
214 "libbpf",
215 "libcrypto",
216 "libcutils",
217 "liblog",
218 "libnetdaidl",
219 "libnetdutils",
220 "libnetutils",
221 "libqtaguid",
222 "libsysutils",
223 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800224 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900225 ],
226}