blob: 18d7c5f368074dd777427be2c1d44ee439cb75cc [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
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +090011
12
Bernie Innocenti37ceb532018-06-11 21:10:44 +090013// These are used in netd_integration_test
14// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
15filegroup {
16 name: "netd_integration_test_shared",
17 srcs: [
18 "NetdConstants.cpp",
19 "InterfaceController.cpp",
20 "NetlinkCommands.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070021 "NetlinkListener.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090022 "XfrmController.cpp",
Chenbo Feng49586642018-08-30 18:01:53 -070023 "TrafficController.cpp",
Bernie Innocenti37ceb532018-06-11 21:10:44 +090024 ],
25}
26
Luke Huangcaebcbb2018-09-27 20:37:14 +080027aidl_interface {
28 name: "netd_aidl_interface",
29 local_include_dir: "binder",
30 srcs: [
Luke Huang03074eb2018-11-23 17:03:03 +080031 "binder/android/net/INetd.aidl",
32 "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: {
39 ndk: {
40 enabled: false,
41 },
42 },
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",
55 "Controllers.cpp",
Mike Yu5ae61542018-10-19 22:11:43 +080056 "Dns64Configuration.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090057 "NetdConstants.cpp",
58 "FirewallController.cpp",
59 "IdletimerController.cpp",
60 "InterfaceController.cpp",
61 "IptablesRestoreController.cpp",
62 "NFLogListener.cpp",
63 "NetlinkCommands.cpp",
64 "NetlinkListener.cpp",
65 "NetlinkManager.cpp",
66 "RouteController.cpp",
67 "SockDiag.cpp",
68 "StrictController.cpp",
69 "TcpSocketMonitor.cpp",
70 "TetherController.cpp",
71 "TrafficController.cpp",
72 "UidRanges.cpp",
73 "WakeupController.cpp",
74 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090075 ],
76 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080077 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090078 "libbase",
79 "libbinder",
80 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070081 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090082 "libnetutils",
83 "libnetdutils",
84 "libpcap",
85 "libqtaguid",
86 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +080087 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +090088 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090089 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +090090 header_libs: [
91 "libnetd_resolv_headers",
92 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090093 aidl: {
94 export_aidl_headers: true,
95 local_include_dirs: ["binder"],
96 },
97}
98
99cc_binary {
100 name: "netd",
101 defaults: ["netd_defaults"],
102 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900103 "external/mdnsresponder/mDNSShared",
104 "system/netd/include",
105 ],
106 init_rc: ["netd.rc"],
107 shared_libs: [
108 "android.system.net.netd@1.0",
109 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900110 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900111 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800112 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900113 "libcrypto",
114 "libcutils",
115 "libdl",
116 "libhidlbase",
117 "libhidltransport",
118 "liblog",
119 "liblogwrap",
120 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700121 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900122 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900123 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900124 "libpcap",
125 "libqtaguid",
126 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900127 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900128 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800129 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900130 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 ],
132 static_libs: [
133 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900134 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900135 header_libs: [
136 "libnetd_resolv_headers",
137 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900138 srcs: [
139 "ClatdController.cpp",
140 "CommandListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 "DummyNetwork.cpp",
142 "DumpWriter.cpp",
143 "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 "ResolverController.cpp",
158 "VirtualNetwork.cpp",
159 "main.cpp",
160 "oem_iptables_hook.cpp",
161 ],
162}
163
164cc_binary {
165 name: "ndc",
166 defaults: ["netd_defaults"],
167 shared_libs: ["libcutils"],
168 srcs: ["ndc.cpp"],
169}
170
171cc_test {
172 name: "netd_unit_test",
173 defaults: ["netd_defaults"],
174 test_suites: ["device-tests"],
175 include_dirs: [
176 "system/netd/include",
177 "system/netd/server/binder",
178 "system/netd/tests",
179 "system/core/logwrapper/include",
180 ],
181 srcs: [
182 "BandwidthControllerTest.cpp",
183 "ControllersTest.cpp",
184 "FirewallControllerTest.cpp",
185 "IdletimerControllerTest.cpp",
186 "InterfaceControllerTest.cpp",
187 "IptablesBaseTest.cpp",
188 "IptablesRestoreControllerTest.cpp",
189 "NFLogListenerTest.cpp",
190 "RouteControllerTest.cpp",
191 "SockDiagTest.cpp",
192 "StrictControllerTest.cpp",
193 "TetherControllerTest.cpp",
194 "TrafficControllerTest.cpp",
195 "XfrmControllerTest.cpp",
196 "WakeupControllerTest.cpp",
197 ],
198 static_libs: [
199 "libgmock",
200 "libnetd_server",
201 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900202 ],
203 shared_libs: [
204 "libbase",
205 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800206 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900207 "libcrypto",
208 "libcutils",
209 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700210 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900211 "libnetdutils",
212 "libnetutils",
213 "libqtaguid",
214 "libsysutils",
215 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900216 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900217 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900218 ],
219}