blob: 06ea0bab518101830df99bf33b9fa1afdd7ec0d8 [file] [log] [blame]
Bob Badour4114d1a2021-02-12 15:38:42 -08001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "system_netd_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["system_netd_license"],
8}
9
Lorenzo Colittic3bc5842020-04-28 16:52:21 +090010aidl_interface {
Luke Huang2ff8b342019-04-30 15:33:33 +080011 // This interface is for OEM calls to netd and vice versa that do not exist in AOSP.
12 // Those calls cannot be part of INetd.aidl and INetdUnsolicitedEventListener.aidl
13 // because those interfaces are versioned.
14 // These interfaces must never be versioned or OEMs will not be able to change them.
Luke Huang0e5e69d2019-03-06 15:42:38 +080015 name: "oemnetd_aidl_interface",
Jiyong Parkcfdd3382020-04-13 15:09:35 +090016 unstable: true,
Luke Huang0e5e69d2019-03-06 15:42:38 +080017 local_include_dir: "binder",
18 srcs: [
19 "binder/com/android/internal/net/IOemNetd.aidl",
Luke Huang2ff8b342019-04-30 15:33:33 +080020 "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl",
Luke Huang0e5e69d2019-03-06 15:42:38 +080021 ],
22}
23
Lorenzo Colittic3bc5842020-04-28 16:52:21 +090024// These are used in netd_integration_test
25// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
26filegroup {
27 name: "netd_integration_test_shared",
28 srcs: [
29 "NetdConstants.cpp",
30 "InterfaceController.cpp",
31 "NetlinkCommands.cpp",
Lorenzo Colittic3bc5842020-04-28 16:52:21 +090032 "SockDiag.cpp",
33 "XfrmController.cpp",
Lorenzo Colittic3bc5842020-04-28 16:52:21 +090034 ],
35}
36
Bernie Innocenti98951792018-06-26 17:13:44 +090037// Modules common to both netd and netd_unit_test
38cc_library_static {
39 name: "libnetd_server",
Ken Chenfbc85062022-04-20 15:10:31 +080040 defaults: [
41 "netd_aidl_interface_lateststable_cpp_shared",
42 "netd_defaults",
43 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090044 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090045 "system/netd/include",
46 "system/netd/server/binder",
47 ],
Maciej Żenczykowskicb455402022-06-13 22:53:58 -070048 header_libs: ["bpf_headers"],
Bernie Innocenti98951792018-06-26 17:13:44 +090049 srcs: [
50 "BandwidthController.cpp",
51 "Controllers.cpp",
52 "NetdConstants.cpp",
53 "FirewallController.cpp",
54 "IdletimerController.cpp",
55 "InterfaceController.cpp",
56 "IptablesRestoreController.cpp",
57 "NFLogListener.cpp",
58 "NetlinkCommands.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090059 "NetlinkManager.cpp",
60 "RouteController.cpp",
61 "SockDiag.cpp",
62 "StrictController.cpp",
63 "TcpSocketMonitor.cpp",
64 "TetherController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090065 "UidRanges.cpp",
66 "WakeupController.cpp",
67 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090068 ],
69 shared_libs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090070 "libbase",
71 "libbinder",
Bernie Innocenti98951792018-06-26 17:13:44 +090072 "libnetutils",
73 "libnetdutils",
74 "libpcap",
Bernie Innocenti98951792018-06-26 17:13:44 +090075 "libssl",
Elliott Hughesab683522020-08-20 15:15:45 -070076 "libsysutils",
Jeongik Cha5f72c8f2021-01-26 22:35:13 +090077 "netd_event_listener_interface-V1-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090078 ],
Lorenzo Colittif2bd0d72021-12-09 16:18:48 +090079 static_libs: [
80 "libip_checksum",
Patrick Rohrb791bd62022-03-29 21:18:31 +020081 "libtcutils",
Lorenzo Colittif2bd0d72021-12-09 16:18:48 +090082 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090083 aidl: {
84 export_aidl_headers: true,
85 local_include_dirs: ["binder"],
86 },
87}
88
89cc_binary {
90 name: "netd",
Ken Chenfbc85062022-04-20 15:10:31 +080091 defaults: [
92 "netd_aidl_interface_lateststable_cpp_shared",
93 "netd_defaults",
94 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090095 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090096 "external/mdnsresponder/mDNSShared",
97 "system/netd/include",
98 ],
99 init_rc: ["netd.rc"],
Maciej Żenczykowskif428d6e2020-02-19 10:26:35 -0800100 required: [
101 "bpfloader",
Maciej Żenczykowskif428d6e2020-02-19 10:26:35 -0800102 ],
Maciej Żenczykowskicb455402022-06-13 22:53:58 -0700103 header_libs: ["bpf_headers"],
Bernie Innocenti98951792018-06-26 17:13:44 +0900104 shared_libs: [
105 "android.system.net.netd@1.0",
106 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900107 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900108 "libbinder",
Bernie Innocenti98951792018-06-26 17:13:44 +0900109 "libcutils",
110 "libdl",
111 "libhidlbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900112 "liblog",
Bernie Innocenti98951792018-06-26 17:13:44 +0900113 "libmdnssd",
Ken Chenebdeba82021-10-28 09:54:46 +0800114 "libnetd_updatable",
Jooyung Han3e64aa12019-11-27 15:36:29 +0900115 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +0900116 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900117 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900118 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800119 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900120 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900121 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900122 "libutils",
paulhuc8a58ff2022-02-09 18:37:27 +0800123 "mdns_aidl_interface-V1-cpp",
Jeongik Cha5f72c8f2021-01-26 22:35:13 +0900124 "netd_event_listener_interface-V1-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800125 "oemnetd_aidl_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900126 ],
127 static_libs: [
Lorenzo Colittif2bd0d72021-12-09 16:18:48 +0900128 "libip_checksum",
Bernie Innocenti98951792018-06-26 17:13:44 +0900129 "libnetd_server",
Patrick Rohrb791bd62022-03-29 21:18:31 +0200130 "libtcutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 ],
132 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900134 "EventReporter.cpp",
135 "FwmarkServer.cpp",
136 "LocalNetwork.cpp",
paulhu72742952022-02-09 21:24:09 +0800137 "MDnsEventReporter.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900138 "MDnsSdListener.cpp",
paulhuc8a58ff2022-02-09 18:37:27 +0800139 "MDnsService.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 "NetdCommand.cpp",
141 "NetdHwService.cpp",
142 "NetdNativeService.cpp",
143 "NetlinkHandler.cpp",
144 "Network.cpp",
145 "NetworkController.cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800146 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900147 "PhysicalNetwork.cpp",
148 "PppController.cpp",
149 "Process.cpp",
Ken Chen4e8ef9b2021-03-17 01:57:19 +0800150 "UnreachableNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900151 "VirtualNetwork.cpp",
152 "main.cpp",
153 "oem_iptables_hook.cpp",
154 ],
Ken Chen2e413c32020-01-13 11:59:53 +0800155 sanitize: {
156 cfi: true,
Evgenii Stepanovea2f6032021-05-21 15:27:10 -0700157 memtag_heap: true,
Ken Chen2e413c32020-01-13 11:59:53 +0800158 },
Bernie Innocenti98951792018-06-26 17:13:44 +0900159}
160
161cc_binary {
162 name: "ndc",
Ken Chenfbc85062022-04-20 15:10:31 +0800163 defaults: [
164 "netd_aidl_interface_lateststable_cpp_shared",
165 "netd_defaults",
166 ],
Luke Huangcfd04b22019-03-18 15:53:21 +0800167 include_dirs: [
168 "system/netd/include",
169 ],
170 header_libs: [
171 "libnetd_client_headers",
172 ],
173 shared_libs: [
174 "libbase",
175 "libnetdutils",
176 "libnetutils",
177 "libcutils",
178 "liblog",
179 "libutils",
180 "libbinder",
Jeongik Cha5f72c8f2021-01-26 22:35:13 +0900181 "dnsresolver_aidl_interface-V7-cpp",
Luke Huangcfd04b22019-03-18 15:53:21 +0800182 ],
183 srcs: [
184 "ndc.cpp",
185 "UidRanges.cpp",
186 "NdcDispatcher.cpp",
187 ],
Ken Chen2e413c32020-01-13 11:59:53 +0800188 sanitize: {
189 cfi: true,
Evgenii Stepanovd18e38a2021-04-02 15:46:24 -0700190 memtag_heap: true,
Ken Chen2e413c32020-01-13 11:59:53 +0800191 },
Bernie Innocenti98951792018-06-26 17:13:44 +0900192}
193
194cc_test {
195 name: "netd_unit_test",
Ken Chenfbc85062022-04-20 15:10:31 +0800196 defaults: [
197 "netd_aidl_interface_lateststable_cpp_static",
198 "netd_defaults",
199 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900200 test_suites: ["device-tests"],
Bernie Innocenti83a67ca2019-06-19 16:28:05 +0900201 require_root: true,
Bernie Innocenti98951792018-06-26 17:13:44 +0900202 include_dirs: [
203 "system/netd/include",
204 "system/netd/server/binder",
205 "system/netd/tests",
Bernie Innocenti98951792018-06-26 17:13:44 +0900206 ],
Maciej Żenczykowskicb455402022-06-13 22:53:58 -0700207 header_libs: ["bpf_headers"],
Chih-Hung Hsiehf1ecd6d2022-02-17 17:29:33 -0800208 tidy_timeout_srcs: [
209 "BandwidthControllerTest.cpp",
210 "InterfaceControllerTest.cpp",
211 "XfrmControllerTest.cpp",
212 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900213 srcs: [
214 "BandwidthControllerTest.cpp",
215 "ControllersTest.cpp",
216 "FirewallControllerTest.cpp",
217 "IdletimerControllerTest.cpp",
218 "InterfaceControllerTest.cpp",
219 "IptablesBaseTest.cpp",
220 "IptablesRestoreControllerTest.cpp",
221 "NFLogListenerTest.cpp",
222 "RouteControllerTest.cpp",
223 "SockDiagTest.cpp",
224 "StrictControllerTest.cpp",
225 "TetherControllerTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900226 "XfrmControllerTest.cpp",
227 "WakeupControllerTest.cpp",
228 ],
229 static_libs: [
230 "libgmock",
Lorenzo Colittif2bd0d72021-12-09 16:18:48 +0900231 "libip_checksum",
Bernie Innocenti98951792018-06-26 17:13:44 +0900232 "libnetd_server",
233 "libnetd_test_tun_interface",
Patrick Rohrb791bd62022-03-29 21:18:31 +0200234 "libtcutils",
Jeongik Cha5f72c8f2021-01-26 22:35:13 +0900235 "netd_event_listener_interface-V1-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900236 ],
237 shared_libs: [
238 "libbase",
239 "libbinder",
Bernie Innocenti98951792018-06-26 17:13:44 +0900240 "libcrypto",
241 "libcutils",
242 "liblog",
Bernie Innocenti98951792018-06-26 17:13:44 +0900243 "libnetdutils",
244 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900245 "libsysutils",
246 "libutils",
247 ],
Lorenzo Colitti10819c52020-09-17 21:32:44 +0900248 // tidy: false, // cuts test build time by almost 1 minute
Bernie Innocenti98951792018-06-26 17:13:44 +0900249}