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 | fbc8506 | 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 | ], |
Maciej Żenczykowski | cb45540 | 2022-06-13 22:53:58 -0700 | [diff] [blame] | 48 | header_libs: ["bpf_headers"], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 49 | 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 Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 59 | "NetlinkManager.cpp", |
| 60 | "RouteController.cpp", |
| 61 | "SockDiag.cpp", |
| 62 | "StrictController.cpp", |
| 63 | "TcpSocketMonitor.cpp", |
| 64 | "TetherController.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 65 | "UidRanges.cpp", |
| 66 | "WakeupController.cpp", |
| 67 | "XfrmController.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 68 | ], |
| 69 | shared_libs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 70 | "libbase", |
| 71 | "libbinder", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 72 | "libnetutils", |
| 73 | "libnetdutils", |
| 74 | "libpcap", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 75 | "libssl", |
Elliott Hughes | ab68352 | 2020-08-20 15:15:45 -0700 | [diff] [blame] | 76 | "libsysutils", |
Jeongik Cha | 5f72c8f | 2021-01-26 22:35:13 +0900 | [diff] [blame] | 77 | "netd_event_listener_interface-V1-cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 78 | ], |
Lorenzo Colitti | f2bd0d7 | 2021-12-09 16:18:48 +0900 | [diff] [blame] | 79 | static_libs: [ |
| 80 | "libip_checksum", |
Patrick Rohr | b791bd6 | 2022-03-29 21:18:31 +0200 | [diff] [blame] | 81 | "libtcutils", |
Lorenzo Colitti | f2bd0d7 | 2021-12-09 16:18:48 +0900 | [diff] [blame] | 82 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 83 | aidl: { |
| 84 | export_aidl_headers: true, |
| 85 | local_include_dirs: ["binder"], |
| 86 | }, |
| 87 | } |
| 88 | |
| 89 | cc_binary { |
| 90 | name: "netd", |
Ken Chen | fbc8506 | 2022-04-20 15:10:31 +0800 | [diff] [blame] | 91 | defaults: [ |
| 92 | "netd_aidl_interface_lateststable_cpp_shared", |
| 93 | "netd_defaults", |
| 94 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 95 | include_dirs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 96 | "external/mdnsresponder/mDNSShared", |
| 97 | "system/netd/include", |
| 98 | ], |
| 99 | init_rc: ["netd.rc"], |
Maciej Żenczykowski | f428d6e | 2020-02-19 10:26:35 -0800 | [diff] [blame] | 100 | required: [ |
| 101 | "bpfloader", |
Maciej Żenczykowski | f428d6e | 2020-02-19 10:26:35 -0800 | [diff] [blame] | 102 | ], |
Maciej Żenczykowski | cb45540 | 2022-06-13 22:53:58 -0700 | [diff] [blame] | 103 | header_libs: ["bpf_headers"], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 104 | shared_libs: [ |
| 105 | "android.system.net.netd@1.0", |
| 106 | "android.system.net.netd@1.1", |
Bernie Innocenti | f89b351 | 2018-08-30 07:34:37 +0900 | [diff] [blame] | 107 | "libbase", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 108 | "libbinder", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 109 | "libcutils", |
| 110 | "libdl", |
| 111 | "libhidlbase", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 112 | "liblog", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 113 | "libmdnssd", |
Ken Chen | ebdeba8 | 2021-10-28 09:54:46 +0800 | [diff] [blame] | 114 | "libnetd_updatable", |
Jooyung Han | 3e64aa1 | 2019-11-27 15:36:29 +0900 | [diff] [blame] | 115 | "libnetd_resolv", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 116 | "libnetdutils", |
Bernie Innocenti | f89b351 | 2018-08-30 07:34:37 +0900 | [diff] [blame] | 117 | "libnetutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 118 | "libpcap", |
Suren Baghdasaryan | e072a3c | 2019-01-16 14:36:07 -0800 | [diff] [blame] | 119 | "libprocessgroup", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 120 | "libselinux", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 121 | "libsysutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 122 | "libutils", |
paulhu | c8a58ff | 2022-02-09 18:37:27 +0800 | [diff] [blame] | 123 | "mdns_aidl_interface-V1-cpp", |
Jeongik Cha | 5f72c8f | 2021-01-26 22:35:13 +0900 | [diff] [blame] | 124 | "netd_event_listener_interface-V1-cpp", |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 125 | "oemnetd_aidl_interface-cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 126 | ], |
| 127 | static_libs: [ |
Lorenzo Colitti | f2bd0d7 | 2021-12-09 16:18:48 +0900 | [diff] [blame] | 128 | "libip_checksum", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 129 | "libnetd_server", |
Patrick Rohr | b791bd6 | 2022-03-29 21:18:31 +0200 | [diff] [blame] | 130 | "libtcutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 131 | ], |
| 132 | srcs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 133 | "DummyNetwork.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 134 | "EventReporter.cpp", |
| 135 | "FwmarkServer.cpp", |
| 136 | "LocalNetwork.cpp", |
paulhu | 7274295 | 2022-02-09 21:24:09 +0800 | [diff] [blame] | 137 | "MDnsEventReporter.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 138 | "MDnsSdListener.cpp", |
paulhu | c8a58ff | 2022-02-09 18:37:27 +0800 | [diff] [blame] | 139 | "MDnsService.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 140 | "NetdCommand.cpp", |
| 141 | "NetdHwService.cpp", |
| 142 | "NetdNativeService.cpp", |
| 143 | "NetlinkHandler.cpp", |
| 144 | "Network.cpp", |
| 145 | "NetworkController.cpp", |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 146 | "OemNetdListener.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 147 | "PhysicalNetwork.cpp", |
| 148 | "PppController.cpp", |
| 149 | "Process.cpp", |
Ken Chen | 4e8ef9b | 2021-03-17 01:57:19 +0800 | [diff] [blame] | 150 | "UnreachableNetwork.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 151 | "VirtualNetwork.cpp", |
| 152 | "main.cpp", |
| 153 | "oem_iptables_hook.cpp", |
| 154 | ], |
Ken Chen | 2e413c3 | 2020-01-13 11:59:53 +0800 | [diff] [blame] | 155 | sanitize: { |
| 156 | cfi: true, |
Evgenii Stepanov | ea2f603 | 2021-05-21 15:27:10 -0700 | [diff] [blame] | 157 | memtag_heap: true, |
Ken Chen | 2e413c3 | 2020-01-13 11:59:53 +0800 | [diff] [blame] | 158 | }, |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | cc_binary { |
| 162 | name: "ndc", |
Ken Chen | fbc8506 | 2022-04-20 15:10:31 +0800 | [diff] [blame] | 163 | defaults: [ |
| 164 | "netd_aidl_interface_lateststable_cpp_shared", |
| 165 | "netd_defaults", |
| 166 | ], |
Luke Huang | cfd04b2 | 2019-03-18 15:53:21 +0800 | [diff] [blame] | 167 | 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 Cha | 5f72c8f | 2021-01-26 22:35:13 +0900 | [diff] [blame] | 181 | "dnsresolver_aidl_interface-V7-cpp", |
Luke Huang | cfd04b2 | 2019-03-18 15:53:21 +0800 | [diff] [blame] | 182 | ], |
| 183 | srcs: [ |
| 184 | "ndc.cpp", |
| 185 | "UidRanges.cpp", |
| 186 | "NdcDispatcher.cpp", |
| 187 | ], |
Ken Chen | 2e413c3 | 2020-01-13 11:59:53 +0800 | [diff] [blame] | 188 | sanitize: { |
| 189 | cfi: true, |
Evgenii Stepanov | d18e38a | 2021-04-02 15:46:24 -0700 | [diff] [blame] | 190 | memtag_heap: true, |
Ken Chen | 2e413c3 | 2020-01-13 11:59:53 +0800 | [diff] [blame] | 191 | }, |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | cc_test { |
| 195 | name: "netd_unit_test", |
Ken Chen | fbc8506 | 2022-04-20 15:10:31 +0800 | [diff] [blame] | 196 | defaults: [ |
| 197 | "netd_aidl_interface_lateststable_cpp_static", |
| 198 | "netd_defaults", |
| 199 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 200 | test_suites: ["device-tests"], |
Bernie Innocenti | 83a67ca | 2019-06-19 16:28:05 +0900 | [diff] [blame] | 201 | require_root: true, |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 202 | include_dirs: [ |
| 203 | "system/netd/include", |
| 204 | "system/netd/server/binder", |
| 205 | "system/netd/tests", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 206 | ], |
Maciej Żenczykowski | cb45540 | 2022-06-13 22:53:58 -0700 | [diff] [blame] | 207 | header_libs: ["bpf_headers"], |
Chih-Hung Hsieh | f1ecd6d | 2022-02-17 17:29:33 -0800 | [diff] [blame] | 208 | tidy_timeout_srcs: [ |
| 209 | "BandwidthControllerTest.cpp", |
| 210 | "InterfaceControllerTest.cpp", |
| 211 | "XfrmControllerTest.cpp", |
| 212 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 213 | 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 Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 226 | "XfrmControllerTest.cpp", |
| 227 | "WakeupControllerTest.cpp", |
| 228 | ], |
| 229 | static_libs: [ |
| 230 | "libgmock", |
Lorenzo Colitti | f2bd0d7 | 2021-12-09 16:18:48 +0900 | [diff] [blame] | 231 | "libip_checksum", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 232 | "libnetd_server", |
| 233 | "libnetd_test_tun_interface", |
Patrick Rohr | b791bd6 | 2022-03-29 21:18:31 +0200 | [diff] [blame] | 234 | "libtcutils", |
Jeongik Cha | 5f72c8f | 2021-01-26 22:35:13 +0900 | [diff] [blame] | 235 | "netd_event_listener_interface-V1-cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 236 | ], |
| 237 | shared_libs: [ |
| 238 | "libbase", |
| 239 | "libbinder", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 240 | "libcrypto", |
| 241 | "libcutils", |
| 242 | "liblog", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 243 | "libnetdutils", |
| 244 | "libnetutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 245 | "libsysutils", |
| 246 | "libutils", |
| 247 | ], |
Lorenzo Colitti | 10819c5 | 2020-09-17 21:32:44 +0900 | [diff] [blame] | 248 | // tidy: false, // cuts test build time by almost 1 minute |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 249 | } |