Bob Badour | 4114d1a | 2021-02-12 15:38:42 -0800 | [diff] [blame] | 1 | package { |
| 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 Colitti | c3bc584 | 2020-04-28 16:52:21 +0900 | [diff] [blame] | 10 | aidl_interface { |
Luke Huang | 2ff8b34 | 2019-04-30 15:33:33 +0800 | [diff] [blame] | 11 | // 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 Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 15 | name: "oemnetd_aidl_interface", |
Jiyong Park | cfdd338 | 2020-04-13 15:09:35 +0900 | [diff] [blame] | 16 | unstable: true, |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 17 | local_include_dir: "binder", |
| 18 | srcs: [ |
| 19 | "binder/com/android/internal/net/IOemNetd.aidl", |
Luke Huang | 2ff8b34 | 2019-04-30 15:33:33 +0800 | [diff] [blame] | 20 | "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl", |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 21 | ], |
| 22 | } |
| 23 | |
Lorenzo Colitti | c3bc584 | 2020-04-28 16:52:21 +0900 | [diff] [blame] | 24 | // These are used in netd_integration_test |
| 25 | // TODO: fold these into a cc_library_static after converting netd/server to Android.bp |
| 26 | filegroup { |
| 27 | name: "netd_integration_test_shared", |
| 28 | srcs: [ |
| 29 | "NetdConstants.cpp", |
| 30 | "InterfaceController.cpp", |
| 31 | "NetlinkCommands.cpp", |
Lorenzo Colitti | c3bc584 | 2020-04-28 16:52:21 +0900 | [diff] [blame] | 32 | "SockDiag.cpp", |
| 33 | "XfrmController.cpp", |
Lorenzo Colitti | c3bc584 | 2020-04-28 16:52:21 +0900 | [diff] [blame] | 34 | ], |
| 35 | } |
| 36 | |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 37 | // Modules common to both netd and netd_unit_test |
| 38 | cc_library_static { |
| 39 | name: "libnetd_server", |
Ken Chen | b2d8888 | 2022-04-20 15:10:31 +0800 | [diff] [blame] | 40 | defaults: [ |
| 41 | "netd_aidl_interface_lateststable_cpp_shared", |
| 42 | "netd_defaults", |
| 43 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 44 | include_dirs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 45 | "system/netd/include", |
| 46 | "system/netd/server/binder", |
| 47 | ], |
| 48 | srcs: [ |
| 49 | "BandwidthController.cpp", |
| 50 | "Controllers.cpp", |
| 51 | "NetdConstants.cpp", |
| 52 | "FirewallController.cpp", |
| 53 | "IdletimerController.cpp", |
| 54 | "InterfaceController.cpp", |
| 55 | "IptablesRestoreController.cpp", |
| 56 | "NFLogListener.cpp", |
| 57 | "NetlinkCommands.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 58 | "NetlinkManager.cpp", |
| 59 | "RouteController.cpp", |
| 60 | "SockDiag.cpp", |
| 61 | "StrictController.cpp", |
| 62 | "TcpSocketMonitor.cpp", |
| 63 | "TetherController.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 64 | "UidRanges.cpp", |
| 65 | "WakeupController.cpp", |
| 66 | "XfrmController.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 67 | ], |
| 68 | shared_libs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 69 | "libbase", |
| 70 | "libbinder", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 71 | "libnetutils", |
| 72 | "libnetdutils", |
| 73 | "libpcap", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 74 | "libssl", |
Elliott Hughes | ab68352 | 2020-08-20 15:15:45 -0700 | [diff] [blame] | 75 | "libsysutils", |
Jeongik Cha | 5f72c8f | 2021-01-26 22:35:13 +0900 | [diff] [blame] | 76 | "netd_event_listener_interface-V1-cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 77 | ], |
Lorenzo Colitti | f2bd0d7 | 2021-12-09 16:18:48 +0900 | [diff] [blame] | 78 | static_libs: [ |
| 79 | "libip_checksum", |
Patrick Rohr | b791bd6 | 2022-03-29 21:18:31 +0200 | [diff] [blame] | 80 | "libtcutils", |
Lorenzo Colitti | f2bd0d7 | 2021-12-09 16:18:48 +0900 | [diff] [blame] | 81 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 82 | aidl: { |
| 83 | export_aidl_headers: true, |
| 84 | local_include_dirs: ["binder"], |
| 85 | }, |
| 86 | } |
| 87 | |
Pawan Wagh | 3eb3bc4 | 2023-02-27 03:44:46 +0000 | [diff] [blame] | 88 | cc_defaults { |
| 89 | name: "netd_default_sources", |
Ken Chen | b2d8888 | 2022-04-20 15:10:31 +0800 | [diff] [blame] | 90 | defaults: [ |
| 91 | "netd_aidl_interface_lateststable_cpp_shared", |
| 92 | "netd_defaults", |
| 93 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 94 | include_dirs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 95 | "external/mdnsresponder/mDNSShared", |
| 96 | "system/netd/include", |
| 97 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 98 | shared_libs: [ |
| 99 | "android.system.net.netd@1.0", |
| 100 | "android.system.net.netd@1.1", |
Devin Moore | c304b47 | 2022-04-08 21:42:50 +0000 | [diff] [blame] | 101 | "android.system.net.netd-V1-ndk", |
Bernie Innocenti | f89b351 | 2018-08-30 07:34:37 +0900 | [diff] [blame] | 102 | "libbase", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 103 | "libbinder", |
Devin Moore | c304b47 | 2022-04-08 21:42:50 +0000 | [diff] [blame] | 104 | "libbinder_ndk", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 105 | "libcutils", |
| 106 | "libdl", |
| 107 | "libhidlbase", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 108 | "liblog", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 109 | "libmdnssd", |
Ken Chen | ebdeba8 | 2021-10-28 09:54:46 +0800 | [diff] [blame] | 110 | "libnetd_updatable", |
Jooyung Han | 3e64aa1 | 2019-11-27 15:36:29 +0900 | [diff] [blame] | 111 | "libnetd_resolv", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 112 | "libnetdutils", |
Bernie Innocenti | f89b351 | 2018-08-30 07:34:37 +0900 | [diff] [blame] | 113 | "libnetutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 114 | "libpcap", |
Suren Baghdasaryan | e072a3c | 2019-01-16 14:36:07 -0800 | [diff] [blame] | 115 | "libprocessgroup", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 116 | "libselinux", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 117 | "libsysutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 118 | "libutils", |
paulhu | c8a58ff | 2022-02-09 18:37:27 +0800 | [diff] [blame] | 119 | "mdns_aidl_interface-V1-cpp", |
Jeongik Cha | 5f72c8f | 2021-01-26 22:35:13 +0900 | [diff] [blame] | 120 | "netd_event_listener_interface-V1-cpp", |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 121 | "oemnetd_aidl_interface-cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 122 | ], |
| 123 | static_libs: [ |
Lorenzo Colitti | f2bd0d7 | 2021-12-09 16:18:48 +0900 | [diff] [blame] | 124 | "libip_checksum", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 125 | "libnetd_server", |
Patrick Rohr | b791bd6 | 2022-03-29 21:18:31 +0200 | [diff] [blame] | 126 | "libtcutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 127 | ], |
| 128 | srcs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 129 | "DummyNetwork.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 130 | "EventReporter.cpp", |
| 131 | "FwmarkServer.cpp", |
| 132 | "LocalNetwork.cpp", |
paulhu | 7274295 | 2022-02-09 21:24:09 +0800 | [diff] [blame] | 133 | "MDnsEventReporter.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 134 | "MDnsSdListener.cpp", |
paulhu | c8a58ff | 2022-02-09 18:37:27 +0800 | [diff] [blame] | 135 | "MDnsService.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 136 | "NetdCommand.cpp", |
Devin Moore | c304b47 | 2022-04-08 21:42:50 +0000 | [diff] [blame] | 137 | "NetdHwAidlService.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 138 | "NetdHwService.cpp", |
| 139 | "NetdNativeService.cpp", |
| 140 | "NetlinkHandler.cpp", |
| 141 | "Network.cpp", |
| 142 | "NetworkController.cpp", |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 143 | "OemNetdListener.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 144 | "PhysicalNetwork.cpp", |
| 145 | "PppController.cpp", |
| 146 | "Process.cpp", |
Ken Chen | 4e8ef9b | 2021-03-17 01:57:19 +0800 | [diff] [blame] | 147 | "UnreachableNetwork.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 148 | "VirtualNetwork.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 149 | "oem_iptables_hook.cpp", |
| 150 | ], |
Pawan Wagh | 3eb3bc4 | 2023-02-27 03:44:46 +0000 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | cc_binary { |
| 154 | name: "netd", |
| 155 | defaults: [ |
| 156 | "netd_default_sources", |
| 157 | ], |
| 158 | init_rc: ["netd.rc"], |
| 159 | vintf_fragments: ["android.system.net.netd-service.xml"], |
| 160 | required: [ |
| 161 | "bpfloader", |
| 162 | ], |
| 163 | srcs: [ |
| 164 | "main.cpp", |
| 165 | ], |
Ken Chen | 2e413c3 | 2020-01-13 11:59:53 +0800 | [diff] [blame] | 166 | sanitize: { |
| 167 | cfi: true, |
Evgenii Stepanov | ea2f603 | 2021-05-21 15:27:10 -0700 | [diff] [blame] | 168 | memtag_heap: true, |
Ken Chen | 2e413c3 | 2020-01-13 11:59:53 +0800 | [diff] [blame] | 169 | }, |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | cc_binary { |
| 173 | name: "ndc", |
Ken Chen | b2d8888 | 2022-04-20 15:10:31 +0800 | [diff] [blame] | 174 | defaults: [ |
| 175 | "netd_aidl_interface_lateststable_cpp_shared", |
| 176 | "netd_defaults", |
| 177 | ], |
Luke Huang | cfd04b2 | 2019-03-18 15:53:21 +0800 | [diff] [blame] | 178 | include_dirs: [ |
| 179 | "system/netd/include", |
| 180 | ], |
| 181 | header_libs: [ |
| 182 | "libnetd_client_headers", |
| 183 | ], |
| 184 | shared_libs: [ |
| 185 | "libbase", |
| 186 | "libnetdutils", |
| 187 | "libnetutils", |
| 188 | "libcutils", |
| 189 | "liblog", |
| 190 | "libutils", |
| 191 | "libbinder", |
Jeongik Cha | 5f72c8f | 2021-01-26 22:35:13 +0900 | [diff] [blame] | 192 | "dnsresolver_aidl_interface-V7-cpp", |
Luke Huang | cfd04b2 | 2019-03-18 15:53:21 +0800 | [diff] [blame] | 193 | ], |
| 194 | srcs: [ |
| 195 | "ndc.cpp", |
| 196 | "UidRanges.cpp", |
| 197 | "NdcDispatcher.cpp", |
| 198 | ], |
Ken Chen | 2e413c3 | 2020-01-13 11:59:53 +0800 | [diff] [blame] | 199 | sanitize: { |
| 200 | cfi: true, |
Evgenii Stepanov | d18e38a | 2021-04-02 15:46:24 -0700 | [diff] [blame] | 201 | memtag_heap: true, |
Ken Chen | 2e413c3 | 2020-01-13 11:59:53 +0800 | [diff] [blame] | 202 | }, |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | cc_test { |
| 206 | name: "netd_unit_test", |
Ken Chen | b2d8888 | 2022-04-20 15:10:31 +0800 | [diff] [blame] | 207 | defaults: [ |
| 208 | "netd_aidl_interface_lateststable_cpp_static", |
| 209 | "netd_defaults", |
| 210 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 211 | test_suites: ["device-tests"], |
Bernie Innocenti | 83a67ca | 2019-06-19 16:28:05 +0900 | [diff] [blame] | 212 | require_root: true, |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 213 | include_dirs: [ |
| 214 | "system/netd/include", |
| 215 | "system/netd/server/binder", |
| 216 | "system/netd/tests", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 217 | ], |
Chih-Hung Hsieh | f1ecd6d | 2022-02-17 17:29:33 -0800 | [diff] [blame] | 218 | tidy_timeout_srcs: [ |
| 219 | "BandwidthControllerTest.cpp", |
| 220 | "InterfaceControllerTest.cpp", |
| 221 | "XfrmControllerTest.cpp", |
| 222 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 223 | srcs: [ |
| 224 | "BandwidthControllerTest.cpp", |
| 225 | "ControllersTest.cpp", |
| 226 | "FirewallControllerTest.cpp", |
| 227 | "IdletimerControllerTest.cpp", |
| 228 | "InterfaceControllerTest.cpp", |
| 229 | "IptablesBaseTest.cpp", |
| 230 | "IptablesRestoreControllerTest.cpp", |
| 231 | "NFLogListenerTest.cpp", |
| 232 | "RouteControllerTest.cpp", |
| 233 | "SockDiagTest.cpp", |
| 234 | "StrictControllerTest.cpp", |
| 235 | "TetherControllerTest.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 236 | "XfrmControllerTest.cpp", |
| 237 | "WakeupControllerTest.cpp", |
| 238 | ], |
| 239 | static_libs: [ |
| 240 | "libgmock", |
Lorenzo Colitti | f2bd0d7 | 2021-12-09 16:18:48 +0900 | [diff] [blame] | 241 | "libip_checksum", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 242 | "libnetd_server", |
| 243 | "libnetd_test_tun_interface", |
Patrick Rohr | b791bd6 | 2022-03-29 21:18:31 +0200 | [diff] [blame] | 244 | "libtcutils", |
Jeongik Cha | 5f72c8f | 2021-01-26 22:35:13 +0900 | [diff] [blame] | 245 | "netd_event_listener_interface-V1-cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 246 | ], |
| 247 | shared_libs: [ |
| 248 | "libbase", |
| 249 | "libbinder", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 250 | "libcrypto", |
| 251 | "libcutils", |
| 252 | "liblog", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 253 | "libnetdutils", |
| 254 | "libnetutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 255 | "libsysutils", |
| 256 | "libutils", |
| 257 | ], |
Lorenzo Colitti | 10819c5 | 2020-09-17 21:32:44 +0900 | [diff] [blame] | 258 | // tidy: false, // cuts test build time by almost 1 minute |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 259 | } |
Pawan Wagh | 7739344 | 2023-02-17 22:14:06 +0000 | [diff] [blame] | 260 | |
| 261 | cc_defaults { |
| 262 | name: "netd_aidl_fuzzer_defaults", |
| 263 | defaults: [ |
Pawan Wagh | 3eb3bc4 | 2023-02-27 03:44:46 +0000 | [diff] [blame] | 264 | "netd_default_sources", |
Pawan Wagh | 7739344 | 2023-02-17 22:14:06 +0000 | [diff] [blame] | 265 | ], |
| 266 | srcs: [ |
Pawan Wagh | 7739344 | 2023-02-17 22:14:06 +0000 | [diff] [blame] | 267 | "Controllers.cpp", |
| 268 | ], |
| 269 | fuzz_config: { |
| 270 | cc: [ |
| 271 | "cken@google.com", |
Pawan Wagh | 7739344 | 2023-02-17 22:14:06 +0000 | [diff] [blame] | 272 | ], |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | cc_fuzz { |
| 277 | name: "mdns_service_fuzzer", |
| 278 | defaults: [ |
| 279 | "service_fuzzer_defaults", |
| 280 | "netd_aidl_fuzzer_defaults", |
| 281 | ], |
| 282 | srcs: [ |
| 283 | "aidl-fuzzers/MDnsServiceFuzzer.cpp", |
| 284 | ], |
Pawan Wagh | 3eb3bc4 | 2023-02-27 03:44:46 +0000 | [diff] [blame] | 285 | fuzz_config: { |
| 286 | cc: [ |
| 287 | "paulhu@google.com", |
| 288 | ], |
| 289 | } |
Pawan Wagh | 7739344 | 2023-02-17 22:14:06 +0000 | [diff] [blame] | 290 | } |
Pawan Wagh | 5d44be7 | 2023-02-17 22:36:23 +0000 | [diff] [blame] | 291 | |
| 292 | cc_fuzz { |
| 293 | name: "netd_hw_service_fuzzer", |
| 294 | defaults: [ |
| 295 | "service_fuzzer_defaults", |
| 296 | "netd_aidl_fuzzer_defaults", |
| 297 | ], |
| 298 | srcs: [ |
| 299 | "aidl-fuzzers/NetdHwAidlServiceFuzzer.cpp", |
| 300 | ], |
| 301 | } |
Pawan Wagh | 7f3ca96 | 2023-02-17 22:57:53 +0000 | [diff] [blame] | 302 | |
| 303 | cc_fuzz { |
| 304 | name: "netd_native_service_fuzzer", |
| 305 | defaults: [ |
| 306 | "service_fuzzer_defaults", |
| 307 | "netd_aidl_fuzzer_defaults", |
| 308 | ], |
| 309 | srcs: [ |
| 310 | "aidl-fuzzers/NetdNativeServiceFuzzer.cpp", |
| 311 | ], |
| 312 | } |
| 313 | |