blob: c6ee9208e3f162763aa82562be9f130c021515f8 [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 Huangcaebcbb2018-09-27 20:37:14 +080035 ],
36 api_dir: "binder/api",
37}
38
Steven Moreland0b7e3802018-03-02 12:41:52 -080039cc_library {
40 name: "libnetdaidl",
Bernie Innocenti0c532742018-06-11 14:12:08 +090041 defaults: ["netd_defaults"],
Steven Moreland0b7e3802018-03-02 12:41:52 -080042 shared_libs: [
43 "libbinder",
44 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +080045 "netd_aidl_interface-cpp",
Steven Moreland0b7e3802018-03-02 12:41:52 -080046 ],
Bernie Innocenti4f9c3222018-10-12 17:00:51 +090047 export_shared_lib_headers: [
48 "netd_aidl_interface-cpp",
49 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080050 aidl: {
51 export_aidl_headers: true,
52 local_include_dirs: ["binder"],
53 include_dirs: ["frameworks/native/aidl/binder"],
54 },
55 srcs: [
Bernie Innocentia28c5f22018-10-01 20:02:21 +090056 ":netd_aidl",
Steven Moreland0b7e3802018-03-02 12:41:52 -080057 ],
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",
Mike Yu5ae61542018-10-19 22:11:43 +080072 "Dns64Configuration.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090073 "NetdConstants.cpp",
74 "FirewallController.cpp",
75 "IdletimerController.cpp",
76 "InterfaceController.cpp",
77 "IptablesRestoreController.cpp",
78 "NFLogListener.cpp",
79 "NetlinkCommands.cpp",
80 "NetlinkListener.cpp",
81 "NetlinkManager.cpp",
82 "RouteController.cpp",
83 "SockDiag.cpp",
84 "StrictController.cpp",
85 "TcpSocketMonitor.cpp",
86 "TetherController.cpp",
87 "TrafficController.cpp",
88 "UidRanges.cpp",
89 "WakeupController.cpp",
90 "XfrmController.cpp",
Bernie Innocentia28c5f22018-10-01 20:02:21 +090091 ":netd_metrics_aidl",
Bernie Innocenti98951792018-06-26 17:13:44 +090092 ],
93 shared_libs: [
94 "libbpf",
Bernie Innocentif89b3512018-08-30 07:34:37 +090095 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +090096 "libnetdaidl",
97 "libbase",
98 "libbinder",
99 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700100 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900101 "libnetutils",
102 "libnetdutils",
103 "libpcap",
104 "libqtaguid",
105 "libssl",
106 ],
107 aidl: {
108 export_aidl_headers: true,
109 local_include_dirs: ["binder"],
110 },
111}
112
113cc_binary {
114 name: "netd",
115 defaults: ["netd_defaults"],
116 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900117 "external/mdnsresponder/mDNSShared",
118 "system/netd/include",
119 ],
120 init_rc: ["netd.rc"],
121 shared_libs: [
122 "android.system.net.netd@1.0",
123 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900124 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900125 "libbinder",
126 "libbpf",
127 "libcrypto",
128 "libcutils",
129 "libdl",
130 "libhidlbase",
131 "libhidltransport",
132 "liblog",
133 "liblogwrap",
134 "libmdnssd",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900135 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +0900136 "libnetdaidl",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700137 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900138 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900139 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 "libpcap",
141 "libqtaguid",
142 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900143 "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",
Bernie Innocenti98951792018-06-26 17:13:44 +0900149 ],
150 srcs: [
151 "ClatdController.cpp",
152 "CommandListener.cpp",
153 "DnsProxyListener.cpp",
154 "DummyNetwork.cpp",
155 "DumpWriter.cpp",
156 "EventReporter.cpp",
157 "FwmarkServer.cpp",
158 "LocalNetwork.cpp",
159 "MDnsSdListener.cpp",
160 "NetdCommand.cpp",
161 "NetdHwService.cpp",
162 "NetdNativeService.cpp",
163 "NetlinkHandler.cpp",
164 "Network.cpp",
165 "NetworkController.cpp",
166 "PhysicalNetwork.cpp",
167 "PppController.cpp",
168 "Process.cpp",
169 "ResolverController.cpp",
170 "VirtualNetwork.cpp",
171 "main.cpp",
172 "oem_iptables_hook.cpp",
173 ],
174}
175
176cc_binary {
177 name: "ndc",
178 defaults: ["netd_defaults"],
179 shared_libs: ["libcutils"],
180 srcs: ["ndc.cpp"],
181}
182
183cc_test {
184 name: "netd_unit_test",
185 defaults: ["netd_defaults"],
186 test_suites: ["device-tests"],
187 include_dirs: [
188 "system/netd/include",
189 "system/netd/server/binder",
190 "system/netd/tests",
191 "system/core/logwrapper/include",
192 ],
193 srcs: [
194 "BandwidthControllerTest.cpp",
195 "ControllersTest.cpp",
196 "FirewallControllerTest.cpp",
197 "IdletimerControllerTest.cpp",
198 "InterfaceControllerTest.cpp",
199 "IptablesBaseTest.cpp",
200 "IptablesRestoreControllerTest.cpp",
201 "NFLogListenerTest.cpp",
202 "RouteControllerTest.cpp",
203 "SockDiagTest.cpp",
204 "StrictControllerTest.cpp",
205 "TetherControllerTest.cpp",
206 "TrafficControllerTest.cpp",
207 "XfrmControllerTest.cpp",
208 "WakeupControllerTest.cpp",
209 ],
210 static_libs: [
211 "libgmock",
212 "libnetd_server",
213 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900214 ],
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 Huang94658ac2018-10-18 19:35:12 +0900229 "netd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900230 ],
231}