Colin Cross | 1a8e797 | 2017-12-05 22:35:52 -0800 | [diff] [blame] | 1 | // AIDL interface between netd and services.core |
Lorenzo Colitti | 57bca9f | 2018-12-11 13:02:05 +0900 | [diff] [blame] | 2 | aidl_interface { |
| 3 | name: "netd_event_listener_interface", |
| 4 | local_include_dir: "binder", |
| 5 | srcs: [ |
Remi NGUYEN VAN | 6b91b49 | 2019-04-09 13:57:03 +0900 | [diff] [blame] | 6 | "binder/android/net/metrics/INetdEventListener.aidl", |
Lorenzo Colitti | 57bca9f | 2018-12-11 13:02:05 +0900 | [diff] [blame] | 7 | ], |
Lorenzo Colitti | 866a03a | 2019-05-22 15:46:05 +0900 | [diff] [blame] | 8 | versions: ["1"], |
Colin Cross | 1a8e797 | 2017-12-05 22:35:52 -0800 | [diff] [blame] | 9 | } |
Steven Moreland | 0b7e380 | 2018-03-02 12:41:52 -0800 | [diff] [blame] | 10 | |
Bernie Innocenti | 37ceb53 | 2018-06-11 21:10:44 +0900 | [diff] [blame] | 11 | // These are used in netd_integration_test |
| 12 | // TODO: fold these into a cc_library_static after converting netd/server to Android.bp |
| 13 | filegroup { |
| 14 | name: "netd_integration_test_shared", |
| 15 | srcs: [ |
| 16 | "NetdConstants.cpp", |
| 17 | "InterfaceController.cpp", |
| 18 | "NetlinkCommands.cpp", |
Chenbo Feng | 4958664 | 2018-08-30 18:01:53 -0700 | [diff] [blame] | 19 | "NetlinkListener.cpp", |
Bernie Innocenti | 37ceb53 | 2018-06-11 21:10:44 +0900 | [diff] [blame] | 20 | "XfrmController.cpp", |
Chenbo Feng | 4958664 | 2018-08-30 18:01:53 -0700 | [diff] [blame] | 21 | "TrafficController.cpp", |
Bernie Innocenti | 37ceb53 | 2018-06-11 21:10:44 +0900 | [diff] [blame] | 22 | ], |
| 23 | } |
| 24 | |
Luke Huang | caebcbb | 2018-09-27 20:37:14 +0800 | [diff] [blame] | 25 | aidl_interface { |
| 26 | name: "netd_aidl_interface", |
| 27 | local_include_dir: "binder", |
| 28 | srcs: [ |
Luke Huang | 03074eb | 2018-11-23 17:03:03 +0800 | [diff] [blame] | 29 | "binder/android/net/INetd.aidl", |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame] | 30 | // AIDL interface that callers can implement to receive networking events from netd. |
| 31 | "binder/android/net/INetdUnsolicitedEventListener.aidl", |
Luke Huang | 03074eb | 2018-11-23 17:03:03 +0800 | [diff] [blame] | 32 | "binder/android/net/InterfaceConfigurationParcel.aidl", |
Chiachang Wang | 00fc62f | 2019-12-04 20:38:26 +0800 | [diff] [blame] | 33 | "binder/android/net/MarkMaskParcel.aidl", |
Chiachang Wang | 08cb211 | 2019-12-10 09:53:24 +0800 | [diff] [blame] | 34 | "binder/android/net/TetherConfigParcel.aidl", |
Luke Huang | caebcbb | 2018-09-27 20:37:14 +0800 | [diff] [blame] | 35 | "binder/android/net/TetherStatsParcel.aidl", |
Luke Huang | 94658ac | 2018-10-18 19:35:12 +0900 | [diff] [blame] | 36 | "binder/android/net/UidRangeParcel.aidl", |
Luke Huang | caebcbb | 2018-09-27 20:37:14 +0800 | [diff] [blame] | 37 | ], |
Luke Huang | f778204 | 2018-08-08 13:13:04 +0800 | [diff] [blame] | 38 | backend: { |
Xiao Ma | 33d562a | 2018-12-16 16:27:38 +0900 | [diff] [blame] | 39 | cpp: { |
| 40 | gen_log: true, |
| 41 | }, |
Luke Huang | f778204 | 2018-08-08 13:13:04 +0800 | [diff] [blame] | 42 | }, |
Luke Huang | 0068128 | 2019-04-26 12:09:05 +0800 | [diff] [blame] | 43 | versions: [ |
| 44 | "1", |
| 45 | "2", |
| 46 | ], |
Luke Huang | caebcbb | 2018-09-27 20:37:14 +0800 | [diff] [blame] | 47 | } |
| 48 | |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 49 | aidl_interface { |
Luke Huang | 2ff8b34 | 2019-04-30 15:33:33 +0800 | [diff] [blame] | 50 | // This interface is for OEM calls to netd and vice versa that do not exist in AOSP. |
| 51 | // Those calls cannot be part of INetd.aidl and INetdUnsolicitedEventListener.aidl |
| 52 | // because those interfaces are versioned. |
| 53 | // 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] | 54 | name: "oemnetd_aidl_interface", |
| 55 | local_include_dir: "binder", |
| 56 | srcs: [ |
| 57 | "binder/com/android/internal/net/IOemNetd.aidl", |
Luke Huang | 2ff8b34 | 2019-04-30 15:33:33 +0800 | [diff] [blame] | 58 | "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl", |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 59 | ], |
| 60 | } |
| 61 | |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 62 | // Modules common to both netd and netd_unit_test |
| 63 | cc_library_static { |
| 64 | name: "libnetd_server", |
| 65 | defaults: ["netd_defaults"], |
| 66 | include_dirs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 67 | "system/netd/include", |
| 68 | "system/netd/server/binder", |
| 69 | ], |
| 70 | srcs: [ |
| 71 | "BandwidthController.cpp", |
Lorenzo Colitti | 7ef8c0f | 2019-01-11 22:34:58 +0900 | [diff] [blame] | 72 | "ClatdController.cpp", |
Maciej Żenczykowski | b70da76 | 2019-01-28 15:20:48 -0800 | [diff] [blame] | 73 | "ClatUtils.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 74 | "Controllers.cpp", |
| 75 | "NetdConstants.cpp", |
| 76 | "FirewallController.cpp", |
| 77 | "IdletimerController.cpp", |
| 78 | "InterfaceController.cpp", |
| 79 | "IptablesRestoreController.cpp", |
| 80 | "NFLogListener.cpp", |
| 81 | "NetlinkCommands.cpp", |
| 82 | "NetlinkListener.cpp", |
| 83 | "NetlinkManager.cpp", |
| 84 | "RouteController.cpp", |
| 85 | "SockDiag.cpp", |
| 86 | "StrictController.cpp", |
| 87 | "TcpSocketMonitor.cpp", |
| 88 | "TetherController.cpp", |
| 89 | "TrafficController.cpp", |
| 90 | "UidRanges.cpp", |
| 91 | "WakeupController.cpp", |
| 92 | "XfrmController.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 93 | ], |
| 94 | shared_libs: [ |
Chenbo Feng | a54aaf5 | 2018-11-07 17:51:51 -0800 | [diff] [blame] | 95 | "libbpf_android", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 96 | "libbase", |
| 97 | "libbinder", |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame] | 98 | "libnetdbpf", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 99 | "libnetutils", |
| 100 | "libnetdutils", |
| 101 | "libpcap", |
| 102 | "libqtaguid", |
| 103 | "libssl", |
Luke Huang | 91bd3e1 | 2019-08-20 11:33:52 +0800 | [diff] [blame] | 104 | "netd_aidl_interface-cpp", |
Jeongik Cha | b54ecec | 2019-10-15 17:06:59 +0900 | [diff] [blame] | 105 | "netd_event_listener_interface-cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 106 | ], |
| 107 | aidl: { |
| 108 | export_aidl_headers: true, |
| 109 | local_include_dirs: ["binder"], |
| 110 | }, |
| 111 | } |
| 112 | |
| 113 | cc_binary { |
| 114 | name: "netd", |
| 115 | defaults: ["netd_defaults"], |
| 116 | include_dirs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 117 | "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 Innocenti | f89b351 | 2018-08-30 07:34:37 +0900 | [diff] [blame] | 124 | "libbase", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 125 | "libbinder", |
Chenbo Feng | a54aaf5 | 2018-11-07 17:51:51 -0800 | [diff] [blame] | 126 | "libbpf_android", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 127 | "libcutils", |
| 128 | "libdl", |
| 129 | "libhidlbase", |
Jeongik Cha | 0f750c2 | 2019-02-22 18:43:44 +0900 | [diff] [blame] | 130 | "libjsoncpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 131 | "liblog", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 132 | "libmdnssd", |
Jooyung Han | 3e64aa1 | 2019-11-27 15:36:29 +0900 | [diff] [blame] | 133 | "libnetd_resolv", |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame] | 134 | "libnetdbpf", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 135 | "libnetdutils", |
Bernie Innocenti | f89b351 | 2018-08-30 07:34:37 +0900 | [diff] [blame] | 136 | "libnetutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 137 | "libpcap", |
Suren Baghdasaryan | e072a3c | 2019-01-16 14:36:07 -0800 | [diff] [blame] | 138 | "libprocessgroup", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 139 | "libqtaguid", |
| 140 | "libselinux", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 141 | "libsysutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 142 | "libutils", |
Jeongik Cha | b54ecec | 2019-10-15 17:06:59 +0900 | [diff] [blame] | 143 | "netd_aidl_interface-unstable-cpp", |
| 144 | "netd_event_listener_interface-cpp", |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 145 | "oemnetd_aidl_interface-cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 146 | ], |
| 147 | static_libs: [ |
| 148 | "libnetd_server", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 149 | ], |
| 150 | srcs: [ |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 151 | "DummyNetwork.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 152 | "EventReporter.cpp", |
| 153 | "FwmarkServer.cpp", |
| 154 | "LocalNetwork.cpp", |
| 155 | "MDnsSdListener.cpp", |
| 156 | "NetdCommand.cpp", |
| 157 | "NetdHwService.cpp", |
| 158 | "NetdNativeService.cpp", |
| 159 | "NetlinkHandler.cpp", |
| 160 | "Network.cpp", |
| 161 | "NetworkController.cpp", |
Luke Huang | 0e5e69d | 2019-03-06 15:42:38 +0800 | [diff] [blame] | 162 | "OemNetdListener.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 163 | "PhysicalNetwork.cpp", |
| 164 | "PppController.cpp", |
| 165 | "Process.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 166 | "VirtualNetwork.cpp", |
| 167 | "main.cpp", |
| 168 | "oem_iptables_hook.cpp", |
| 169 | ], |
| 170 | } |
| 171 | |
| 172 | cc_binary { |
| 173 | name: "ndc", |
| 174 | defaults: ["netd_defaults"], |
Luke Huang | cfd04b2 | 2019-03-18 15:53:21 +0800 | [diff] [blame] | 175 | include_dirs: [ |
| 176 | "system/netd/include", |
| 177 | ], |
| 178 | header_libs: [ |
| 179 | "libnetd_client_headers", |
| 180 | ], |
| 181 | shared_libs: [ |
| 182 | "libbase", |
| 183 | "libnetdutils", |
| 184 | "libnetutils", |
| 185 | "libcutils", |
| 186 | "liblog", |
| 187 | "libutils", |
| 188 | "libbinder", |
Jeongik Cha | b54ecec | 2019-10-15 17:06:59 +0900 | [diff] [blame] | 189 | "dnsresolver_aidl_interface-cpp", |
| 190 | "netd_aidl_interface-cpp", |
Luke Huang | cfd04b2 | 2019-03-18 15:53:21 +0800 | [diff] [blame] | 191 | ], |
| 192 | srcs: [ |
| 193 | "ndc.cpp", |
| 194 | "UidRanges.cpp", |
| 195 | "NdcDispatcher.cpp", |
| 196 | ], |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 197 | } |
| 198 | |
| 199 | cc_test { |
| 200 | name: "netd_unit_test", |
| 201 | defaults: ["netd_defaults"], |
| 202 | test_suites: ["device-tests"], |
Bernie Innocenti | 83a67ca | 2019-06-19 16:28:05 +0900 | [diff] [blame] | 203 | require_root: true, |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 204 | include_dirs: [ |
| 205 | "system/netd/include", |
| 206 | "system/netd/server/binder", |
| 207 | "system/netd/tests", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 208 | ], |
| 209 | srcs: [ |
| 210 | "BandwidthControllerTest.cpp", |
Lorenzo Colitti | 7ef8c0f | 2019-01-11 22:34:58 +0900 | [diff] [blame] | 211 | "ClatdControllerTest.cpp", |
Maciej Żenczykowski | b70da76 | 2019-01-28 15:20:48 -0800 | [diff] [blame] | 212 | "ClatUtilsTest.cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 213 | "ControllersTest.cpp", |
| 214 | "FirewallControllerTest.cpp", |
| 215 | "IdletimerControllerTest.cpp", |
| 216 | "InterfaceControllerTest.cpp", |
| 217 | "IptablesBaseTest.cpp", |
| 218 | "IptablesRestoreControllerTest.cpp", |
| 219 | "NFLogListenerTest.cpp", |
| 220 | "RouteControllerTest.cpp", |
| 221 | "SockDiagTest.cpp", |
| 222 | "StrictControllerTest.cpp", |
| 223 | "TetherControllerTest.cpp", |
| 224 | "TrafficControllerTest.cpp", |
| 225 | "XfrmControllerTest.cpp", |
| 226 | "WakeupControllerTest.cpp", |
| 227 | ], |
| 228 | static_libs: [ |
| 229 | "libgmock", |
| 230 | "libnetd_server", |
| 231 | "libnetd_test_tun_interface", |
Lorenzo Colitti | 3f52fae | 2019-06-27 18:46:22 +0900 | [diff] [blame] | 232 | "libqtaguid", |
Jeongik Cha | b54ecec | 2019-10-15 17:06:59 +0900 | [diff] [blame] | 233 | "netd_aidl_interface-cpp", |
| 234 | "netd_event_listener_interface-cpp", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 235 | ], |
| 236 | shared_libs: [ |
| 237 | "libbase", |
| 238 | "libbinder", |
Chenbo Feng | a54aaf5 | 2018-11-07 17:51:51 -0800 | [diff] [blame] | 239 | "libbpf_android", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 240 | "libcrypto", |
| 241 | "libcutils", |
| 242 | "liblog", |
Chenbo Feng | d6104d1 | 2018-10-16 20:29:29 -0700 | [diff] [blame] | 243 | "libnetdbpf", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 244 | "libnetdutils", |
| 245 | "libnetutils", |
Bernie Innocenti | 9895179 | 2018-06-26 17:13:44 +0900 | [diff] [blame] | 246 | "libsysutils", |
| 247 | "libutils", |
| 248 | ], |
| 249 | } |