blob: 4375467e41a46cc1ae3e0ef8f8a10b7ef3052699 [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: [
6 "binder/android/net/metrics/INetdEventListener.aidl"
7 ],
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 // NDK doesn't support array now.
38 backend: {
Xiao Ma33d562a2018-12-16 16:27:38 +090039 cpp: {
40 gen_log: true,
41 },
Luke Huangf7782042018-08-08 13:13:04 +080042 ndk: {
43 enabled: false,
44 },
45 },
Luke Huangcaebcbb2018-09-27 20:37:14 +080046}
47
Bernie Innocenti98951792018-06-26 17:13:44 +090048// Modules common to both netd and netd_unit_test
49cc_library_static {
50 name: "libnetd_server",
51 defaults: ["netd_defaults"],
52 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090053 "system/netd/include",
54 "system/netd/server/binder",
55 ],
56 srcs: [
57 "BandwidthController.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +090058 "ClatdController.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -080059 "ClatUtils.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090060 "Controllers.cpp",
61 "NetdConstants.cpp",
62 "FirewallController.cpp",
63 "IdletimerController.cpp",
64 "InterfaceController.cpp",
65 "IptablesRestoreController.cpp",
66 "NFLogListener.cpp",
67 "NetlinkCommands.cpp",
68 "NetlinkListener.cpp",
69 "NetlinkManager.cpp",
70 "RouteController.cpp",
71 "SockDiag.cpp",
72 "StrictController.cpp",
73 "TcpSocketMonitor.cpp",
74 "TetherController.cpp",
75 "TrafficController.cpp",
76 "UidRanges.cpp",
77 "WakeupController.cpp",
78 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090079 ],
80 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080081 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090082 "libbase",
83 "libbinder",
84 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070085 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090086 "libnetutils",
87 "libnetdutils",
88 "libpcap",
89 "libqtaguid",
90 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +080091 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +090092 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090093 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +090094 header_libs: [
95 "libnetd_resolv_headers",
96 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090097 aidl: {
98 export_aidl_headers: true,
99 local_include_dirs: ["binder"],
100 },
101}
102
103cc_binary {
104 name: "netd",
105 defaults: ["netd_defaults"],
106 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900107 "external/mdnsresponder/mDNSShared",
108 "system/netd/include",
109 ],
110 init_rc: ["netd.rc"],
111 shared_libs: [
112 "android.system.net.netd@1.0",
113 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900114 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900115 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800116 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900117 "libcutils",
118 "libdl",
119 "libhidlbase",
120 "libhidltransport",
Jeongik Cha0f750c22019-02-22 18:43:44 +0900121 "libjsoncpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900122 "liblog",
123 "liblogwrap",
124 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700125 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900126 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900127 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900128 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800129 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libqtaguid",
131 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900132 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800134 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900135 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900136 ],
137 static_libs: [
138 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900139 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900140 header_libs: [
141 "libnetd_resolv_headers",
142 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900143 srcs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 "CommandListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900145 "DummyNetwork.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900146 "EventReporter.cpp",
147 "FwmarkServer.cpp",
148 "LocalNetwork.cpp",
149 "MDnsSdListener.cpp",
150 "NetdCommand.cpp",
151 "NetdHwService.cpp",
152 "NetdNativeService.cpp",
153 "NetlinkHandler.cpp",
154 "Network.cpp",
155 "NetworkController.cpp",
156 "PhysicalNetwork.cpp",
157 "PppController.cpp",
158 "Process.cpp",
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900159 "ResolvStub.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900160 "VirtualNetwork.cpp",
161 "main.cpp",
162 "oem_iptables_hook.cpp",
163 ],
164}
165
166cc_binary {
167 name: "ndc",
168 defaults: ["netd_defaults"],
169 shared_libs: ["libcutils"],
170 srcs: ["ndc.cpp"],
171}
172
173cc_test {
174 name: "netd_unit_test",
175 defaults: ["netd_defaults"],
176 test_suites: ["device-tests"],
177 include_dirs: [
178 "system/netd/include",
179 "system/netd/server/binder",
180 "system/netd/tests",
181 "system/core/logwrapper/include",
182 ],
183 srcs: [
184 "BandwidthControllerTest.cpp",
Lorenzo Colitti7ef8c0f2019-01-11 22:34:58 +0900185 "ClatdControllerTest.cpp",
Maciej Żenczykowskib70da762019-01-28 15:20:48 -0800186 "ClatUtilsTest.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900187 "ControllersTest.cpp",
188 "FirewallControllerTest.cpp",
189 "IdletimerControllerTest.cpp",
190 "InterfaceControllerTest.cpp",
191 "IptablesBaseTest.cpp",
192 "IptablesRestoreControllerTest.cpp",
193 "NFLogListenerTest.cpp",
194 "RouteControllerTest.cpp",
195 "SockDiagTest.cpp",
196 "StrictControllerTest.cpp",
197 "TetherControllerTest.cpp",
198 "TrafficControllerTest.cpp",
199 "XfrmControllerTest.cpp",
200 "WakeupControllerTest.cpp",
201 ],
202 static_libs: [
203 "libgmock",
204 "libnetd_server",
205 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900206 ],
207 shared_libs: [
208 "libbase",
209 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800210 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900211 "libcrypto",
212 "libcutils",
213 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700214 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900215 "libnetdutils",
216 "libnetutils",
217 "libqtaguid",
218 "libsysutils",
219 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900220 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900221 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900222 ],
223}