blob: 1fcb7eefdb413f7e67443c03350d77f4e99150a7 [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 Innocentif89b3512018-08-30 07:34:37 +090078 "libnetd_resolv",
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 ],
91 aidl: {
92 export_aidl_headers: true,
93 local_include_dirs: ["binder"],
94 },
95}
96
97cc_binary {
98 name: "netd",
99 defaults: ["netd_defaults"],
100 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900101 "external/mdnsresponder/mDNSShared",
102 "system/netd/include",
103 ],
104 init_rc: ["netd.rc"],
105 shared_libs: [
106 "android.system.net.netd@1.0",
107 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900108 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900109 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800110 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900111 "libcrypto",
112 "libcutils",
113 "libdl",
114 "libhidlbase",
115 "libhidltransport",
116 "liblog",
117 "liblogwrap",
118 "libmdnssd",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900119 "libnetd_resolv",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700120 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900121 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900122 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900123 "libpcap",
124 "libqtaguid",
125 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900126 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900127 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800128 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900129 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 ],
131 static_libs: [
132 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900133 ],
134 srcs: [
135 "ClatdController.cpp",
136 "CommandListener.cpp",
137 "DnsProxyListener.cpp",
138 "DummyNetwork.cpp",
139 "DumpWriter.cpp",
140 "EventReporter.cpp",
141 "FwmarkServer.cpp",
142 "LocalNetwork.cpp",
143 "MDnsSdListener.cpp",
144 "NetdCommand.cpp",
145 "NetdHwService.cpp",
146 "NetdNativeService.cpp",
147 "NetlinkHandler.cpp",
148 "Network.cpp",
149 "NetworkController.cpp",
150 "PhysicalNetwork.cpp",
151 "PppController.cpp",
152 "Process.cpp",
153 "ResolverController.cpp",
154 "VirtualNetwork.cpp",
155 "main.cpp",
156 "oem_iptables_hook.cpp",
157 ],
158}
159
160cc_binary {
161 name: "ndc",
162 defaults: ["netd_defaults"],
163 shared_libs: ["libcutils"],
164 srcs: ["ndc.cpp"],
165}
166
167cc_test {
168 name: "netd_unit_test",
169 defaults: ["netd_defaults"],
170 test_suites: ["device-tests"],
171 include_dirs: [
172 "system/netd/include",
173 "system/netd/server/binder",
174 "system/netd/tests",
175 "system/core/logwrapper/include",
176 ],
177 srcs: [
178 "BandwidthControllerTest.cpp",
179 "ControllersTest.cpp",
180 "FirewallControllerTest.cpp",
181 "IdletimerControllerTest.cpp",
182 "InterfaceControllerTest.cpp",
183 "IptablesBaseTest.cpp",
184 "IptablesRestoreControllerTest.cpp",
185 "NFLogListenerTest.cpp",
186 "RouteControllerTest.cpp",
187 "SockDiagTest.cpp",
188 "StrictControllerTest.cpp",
189 "TetherControllerTest.cpp",
190 "TrafficControllerTest.cpp",
191 "XfrmControllerTest.cpp",
192 "WakeupControllerTest.cpp",
193 ],
194 static_libs: [
195 "libgmock",
196 "libnetd_server",
197 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900198 ],
199 shared_libs: [
200 "libbase",
201 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800202 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900203 "libcrypto",
204 "libcutils",
205 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700206 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900207 "libnetdutils",
208 "libnetutils",
209 "libqtaguid",
210 "libsysutils",
211 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900212 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900213 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900214 ],
215}