blob: 5f2f373e2edec94b5c2c20a80168b5a5243e4d85 [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 ],
8 api_dir: "binder/api",
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",
Luke Huangcaebcbb2018-09-27 20:37:14 +080033 "binder/android/net/TetherStatsParcel.aidl",
Luke Huang94658ac2018-10-18 19:35:12 +090034 "binder/android/net/UidRangeParcel.aidl",
Luke Huangcaebcbb2018-09-27 20:37:14 +080035 ],
36 api_dir: "binder/api",
Luke Huangf7782042018-08-08 13:13:04 +080037 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090038 cpp: {
39 gen_log: true,
40 },
Luke Huangf7782042018-08-08 13:13:04 +080041 },
Remi NGUYEN VAN6b91b492019-04-09 13:57:03 +090042 versions: ["1"],
Luke Huangcaebcbb2018-09-27 20:37:14 +080043}
44
Bernie Innocenti98951792018-06-26 17:13:44 +090045// Modules common to both netd and netd_unit_test
46cc_library_static {
47 name: "libnetd_server",
48 defaults: ["netd_defaults"],
49 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090050 "system/netd/include",
51 "system/netd/server/binder",
52 ],
53 srcs: [
54 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090055 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080056 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090057 "Controllers.cpp",
58 "NetdConstants.cpp",
59 "FirewallController.cpp",
60 "IdletimerController.cpp",
61 "InterfaceController.cpp",
62 "IptablesRestoreController.cpp",
63 "NFLogListener.cpp",
64 "NetlinkCommands.cpp",
65 "NetlinkListener.cpp",
66 "NetlinkManager.cpp",
67 "RouteController.cpp",
68 "SockDiag.cpp",
69 "StrictController.cpp",
70 "TcpSocketMonitor.cpp",
71 "TetherController.cpp",
72 "TrafficController.cpp",
73 "UidRanges.cpp",
74 "WakeupController.cpp",
75 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090076 ],
77 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080078 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090079 "libbase",
80 "libbinder",
81 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070082 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090083 "libnetutils",
84 "libnetdutils",
85 "libpcap",
86 "libqtaguid",
87 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +080088 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +090089 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090090 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +090091 header_libs: [
92 "libnetd_resolv_headers",
93 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090094 aidl: {
95 export_aidl_headers: true,
96 local_include_dirs: ["binder"],
97 },
98}
99
100cc_binary {
101 name: "netd",
102 defaults: ["netd_defaults"],
103 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900104 "external/mdnsresponder/mDNSShared",
105 "system/netd/include",
106 ],
107 init_rc: ["netd.rc"],
108 shared_libs: [
109 "android.system.net.netd@1.0",
110 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900111 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900112 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800113 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900114 "libcutils",
115 "libdl",
116 "libhidlbase",
117 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900118 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900119 "liblog",
120 "liblogwrap",
121 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700122 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900123 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900124 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900125 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800126 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900127 "libqtaguid",
128 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900129 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800131 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900132 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 ],
134 static_libs: [
135 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900136 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900137 header_libs: [
138 "libnetd_resolv_headers",
139 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900140 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 "CommandListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900142 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900143 "EventReporter.cpp",
144 "FwmarkServer.cpp",
145 "LocalNetwork.cpp",
146 "MDnsSdListener.cpp",
147 "NetdCommand.cpp",
148 "NetdHwService.cpp",
149 "NetdNativeService.cpp",
150 "NetlinkHandler.cpp",
151 "Network.cpp",
152 "NetworkController.cpp",
153 "PhysicalNetwork.cpp",
154 "PppController.cpp",
155 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900156 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900157 "VirtualNetwork.cpp",
158 "main.cpp",
159 "oem_iptables_hook.cpp",
160 ],
161}
162
163cc_binary {
164 name: "ndc",
165 defaults: ["netd_defaults"],
166 shared_libs: ["libcutils"],
167 srcs: ["ndc.cpp"],
168}
169
170cc_test {
171 name: "netd_unit_test",
172 defaults: ["netd_defaults"],
173 test_suites: ["device-tests"],
174 include_dirs: [
175 "system/netd/include",
176 "system/netd/server/binder",
177 "system/netd/tests",
178 "system/core/logwrapper/include",
179 ],
180 srcs: [
181 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900182 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800183 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900184 "ControllersTest.cpp",
185 "FirewallControllerTest.cpp",
186 "IdletimerControllerTest.cpp",
187 "InterfaceControllerTest.cpp",
188 "IptablesBaseTest.cpp",
189 "IptablesRestoreControllerTest.cpp",
190 "NFLogListenerTest.cpp",
191 "RouteControllerTest.cpp",
192 "SockDiagTest.cpp",
193 "StrictControllerTest.cpp",
194 "TetherControllerTest.cpp",
195 "TrafficControllerTest.cpp",
196 "XfrmControllerTest.cpp",
197 "WakeupControllerTest.cpp",
198 ],
199 static_libs: [
200 "libgmock",
201 "libnetd_server",
202 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900203 ],
204 shared_libs: [
205 "libbase",
206 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800207 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900208 "libcrypto",
209 "libcutils",
210 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700211 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900212 "libnetdutils",
213 "libnetutils",
214 "libqtaguid",
215 "libsysutils",
216 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900217 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900218 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900219 ],
220}