blob: ad4e4ff66fae6d81a80016110e0ccef227d6d0ed [file] [log] [blame]
Colin Cross1a8e7972017-12-05 22:35:52 -08001// AIDL interface between netd and services.core
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +09002aidl_interface {
3 name: "netd_event_listener_interface",
4 local_include_dir: "binder",
5 srcs: [
Remi NGUYEN VAN6b91b492019-04-09 13:57:03 +09006 "binder/android/net/metrics/INetdEventListener.aidl",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +09007 ],
Lorenzo Colitti866a03a2019-05-22 15:46:05 +09008 versions: ["1"],
Colin Cross1a8e7972017-12-05 22:35:52 -08009}
Steven Moreland0b7e3802018-03-02 12:41:52 -080010
Bernie Innocenti37ceb532018-06-11 21:10:44 +090011// These are used in netd_integration_test
12// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
13filegroup {
14 name: "netd_integration_test_shared",
15 srcs: [
16 "NetdConstants.cpp",
17 "InterfaceController.cpp",
18 "NetlinkCommands.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070019 "NetlinkListener.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090020 "XfrmController.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070021 "TrafficController.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090022 ],
23}
24
Luke Huangcaebcbb2018-09-27 20:37:14 +080025aidl_interface {
26 name: "netd_aidl_interface",
27 local_include_dir: "binder",
28 srcs: [
Luke Huang03074eb2018-11-23 17:03:03 +080029 "binder/android/net/INetd.aidl",
Luke Huang528af602018-08-29 19:06:05 +080030 // AIDL interface that callers can implement to receive networking events from netd.
31 "binder/android/net/INetdUnsolicitedEventListener.aidl",
Luke Huang03074eb2018-11-23 17:03:03 +080032 "binder/android/net/InterfaceConfigurationParcel.aidl",
Chiachang Wang00fc62f2019-12-04 20:38:26 +080033 "binder/android/net/MarkMaskParcel.aidl",
Chiachang Wang08cb2112019-12-10 09:53:24 +080034 "binder/android/net/TetherConfigParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080035 "binder/android/net/TetherStatsParcel.aidl",
Luke Huang94658ac2018-10-18 19:35:12 +090036 "binder/android/net/UidRangeParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080037 ],
Luke Huangf7782042018-08-08 13:13:04 +080038 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090039 cpp: {
40 gen_log: true,
41 },
Luke Huangf7782042018-08-08 13:13:04 +080042 },
Luke Huang00681282019-04-26 12:09:05 +080043 versions: [
44 "1",
45 "2",
46 ],
Luke Huangcaebcbb2018-09-27 20:37:14 +080047}
48
Luke Huang0e5e69d2019-03-06 15:42:38 +080049aidl_interface {
Luke Huang2ff8b342019-04-30 15:33:33 +080050 // 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 Huang0e5e69d2019-03-06 15:42:38 +080054 name: "oemnetd_aidl_interface",
55 local_include_dir: "binder",
56 srcs: [
57 "binder/com/android/internal/net/IOemNetd.aidl",
Luke Huang2ff8b342019-04-30 15:33:33 +080058 "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl",
Luke Huang0e5e69d2019-03-06 15:42:38 +080059 ],
60}
61
Bernie Innocenti98951792018-06-26 17:13:44 +090062// Modules common to both netd and netd_unit_test
63cc_library_static {
64 name: "libnetd_server",
65 defaults: ["netd_defaults"],
66 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090067 "system/netd/include",
68 "system/netd/server/binder",
69 ],
70 srcs: [
71 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090072 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080073 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090074 "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 Innocenti98951792018-06-26 17:13:44 +090093 ],
94 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080095 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090096 "libbase",
97 "libbinder",
Chenbo Fengd6104d12018-10-16 20:29:29 -070098 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090099 "libnetutils",
100 "libnetdutils",
101 "libpcap",
102 "libqtaguid",
103 "libssl",
Luke Huang91bd3e12019-08-20 11:33:52 +0800104 "netd_aidl_interface-cpp",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900105 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900106 ],
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",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800126 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900127 "libcutils",
128 "libdl",
129 "libhidlbase",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900130 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 "liblog",
Bernie Innocenti98951792018-06-26 17:13:44 +0900132 "libmdnssd",
Jooyung Han3e64aa12019-11-27 15:36:29 +0900133 "libnetd_resolv",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700134 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900135 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900136 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900137 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800138 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900139 "libqtaguid",
140 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 "libutils",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900143 "netd_aidl_interface-unstable-cpp",
144 "netd_event_listener_interface-cpp",
Luke Huang0e5e69d2019-03-06 15:42:38 +0800145 "oemnetd_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: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900151 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900152 "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 Huang0e5e69d2019-03-06 15:42:38 +0800162 "OemNetdListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900163 "PhysicalNetwork.cpp",
164 "PppController.cpp",
165 "Process.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900166 "VirtualNetwork.cpp",
167 "main.cpp",
168 "oem_iptables_hook.cpp",
169 ],
170}
171
172cc_binary {
173 name: "ndc",
174 defaults: ["netd_defaults"],
Luke Huangcfd04b22019-03-18 15:53:21 +0800175 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 Chab54ecec2019-10-15 17:06:59 +0900189 "dnsresolver_aidl_interface-cpp",
190 "netd_aidl_interface-cpp",
Luke Huangcfd04b22019-03-18 15:53:21 +0800191 ],
192 srcs: [
193 "ndc.cpp",
194 "UidRanges.cpp",
195 "NdcDispatcher.cpp",
196 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900197}
198
199cc_test {
200 name: "netd_unit_test",
201 defaults: ["netd_defaults"],
202 test_suites: ["device-tests"],
Bernie Innocenti83a67ca2019-06-19 16:28:05 +0900203 require_root: true,
Bernie Innocenti98951792018-06-26 17:13:44 +0900204 include_dirs: [
205 "system/netd/include",
206 "system/netd/server/binder",
207 "system/netd/tests",
Bernie Innocenti98951792018-06-26 17:13:44 +0900208 ],
209 srcs: [
210 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900211 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800212 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900213 "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 Colitti3f52fae2019-06-27 18:46:22 +0900232 "libqtaguid",
Jeongik Chab54ecec2019-10-15 17:06:59 +0900233 "netd_aidl_interface-cpp",
234 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900235 ],
236 shared_libs: [
237 "libbase",
238 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800239 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900240 "libcrypto",
241 "libcutils",
242 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700243 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900244 "libnetdutils",
245 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900246 "libsysutils",
247 "libutils",
248 ],
249}