blob: 7c85f59ecebc2a4bc189be8f8471016849cd4a2d [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",
Luke Huang528af602018-08-29 19:06:05 +080032 // AIDL interface that callers can implement to receive networking events from netd.
33 "binder/android/net/INetdUnsolicitedEventListener.aidl",
Luke Huang03074eb2018-11-23 17:03:03 +080034 "binder/android/net/InterfaceConfigurationParcel.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 ],
38 api_dir: "binder/api",
Luke Huangf7782042018-08-08 13:13:04 +080039 // NDK doesn't support array now.
40 backend: {
41 ndk: {
42 enabled: false,
43 },
44 },
Luke Huangcaebcbb2018-09-27 20:37:14 +080045}
46
Bernie Innocenti98951792018-06-26 17:13:44 +090047// Modules common to both netd and netd_unit_test
48cc_library_static {
49 name: "libnetd_server",
50 defaults: ["netd_defaults"],
51 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090052 "system/netd/include",
53 "system/netd/server/binder",
54 ],
55 srcs: [
56 "BandwidthController.cpp",
57 "Controllers.cpp",
Mike Yu5ae61542018-10-19 22:11:43 +080058 "Dns64Configuration.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090059 "NetdConstants.cpp",
60 "FirewallController.cpp",
61 "IdletimerController.cpp",
62 "InterfaceController.cpp",
63 "IptablesRestoreController.cpp",
64 "NFLogListener.cpp",
65 "NetlinkCommands.cpp",
66 "NetlinkListener.cpp",
67 "NetlinkManager.cpp",
68 "RouteController.cpp",
69 "SockDiag.cpp",
70 "StrictController.cpp",
71 "TcpSocketMonitor.cpp",
72 "TetherController.cpp",
73 "TrafficController.cpp",
74 "UidRanges.cpp",
75 "WakeupController.cpp",
76 "XfrmController.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090077 ],
78 shared_libs: [
Chenbo Fenga54aaf52018-11-07 17:51:51 -080079 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +090080 "libbase",
81 "libbinder",
82 "liblogwrap",
Chenbo Fengd6104d12018-10-16 20:29:29 -070083 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +090084 "libnetutils",
85 "libnetdutils",
86 "libpcap",
87 "libqtaguid",
88 "libssl",
Luke Huang03074eb2018-11-23 17:03:03 +080089 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +090090 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +090091 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +090092 header_libs: [
93 "libnetd_resolv_headers",
94 ],
Bernie Innocenti98951792018-06-26 17:13:44 +090095 aidl: {
96 export_aidl_headers: true,
97 local_include_dirs: ["binder"],
98 },
99}
100
101cc_binary {
102 name: "netd",
103 defaults: ["netd_defaults"],
104 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900105 "external/mdnsresponder/mDNSShared",
106 "system/netd/include",
107 ],
108 init_rc: ["netd.rc"],
109 shared_libs: [
110 "android.system.net.netd@1.0",
111 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900112 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900113 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800114 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900115 "libcrypto",
116 "libcutils",
117 "libdl",
118 "libhidlbase",
119 "libhidltransport",
120 "liblog",
121 "liblogwrap",
122 "libmdnssd",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700123 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900124 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900125 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900126 "libpcap",
Suren Baghdasaryane072a3c2019-01-16 14:36:07 -0800127 "libprocessgroup",
Bernie Innocenti98951792018-06-26 17:13:44 +0900128 "libqtaguid",
129 "libselinux",
Bernie Innocenti98951792018-06-26 17:13:44 +0900130 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900131 "libutils",
Luke Huangcaebcbb2018-09-27 20:37:14 +0800132 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900133 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900134 ],
135 static_libs: [
136 "libnetd_server",
Bernie Innocenti98951792018-06-26 17:13:44 +0900137 ],
Lorenzo Colittiafaaa8e2018-12-18 19:16:12 +0900138 header_libs: [
139 "libnetd_resolv_headers",
140 ],
Bernie Innocenti98951792018-06-26 17:13:44 +0900141 srcs: [
142 "ClatdController.cpp",
143 "CommandListener.cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900144 "DummyNetwork.cpp",
145 "DumpWriter.cpp",
146 "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 "ResolverController.cpp",
161 "VirtualNetwork.cpp",
162 "main.cpp",
163 "oem_iptables_hook.cpp",
164 ],
165}
166
167cc_binary {
168 name: "ndc",
169 defaults: ["netd_defaults"],
170 shared_libs: ["libcutils"],
171 srcs: ["ndc.cpp"],
172}
173
174cc_test {
175 name: "netd_unit_test",
176 defaults: ["netd_defaults"],
177 test_suites: ["device-tests"],
178 include_dirs: [
179 "system/netd/include",
180 "system/netd/server/binder",
181 "system/netd/tests",
182 "system/core/logwrapper/include",
183 ],
184 srcs: [
185 "BandwidthControllerTest.cpp",
186 "ControllersTest.cpp",
187 "FirewallControllerTest.cpp",
188 "IdletimerControllerTest.cpp",
189 "InterfaceControllerTest.cpp",
190 "IptablesBaseTest.cpp",
191 "IptablesRestoreControllerTest.cpp",
192 "NFLogListenerTest.cpp",
193 "RouteControllerTest.cpp",
194 "SockDiagTest.cpp",
195 "StrictControllerTest.cpp",
196 "TetherControllerTest.cpp",
197 "TrafficControllerTest.cpp",
198 "XfrmControllerTest.cpp",
199 "WakeupControllerTest.cpp",
200 ],
201 static_libs: [
202 "libgmock",
203 "libnetd_server",
204 "libnetd_test_tun_interface",
Bernie Innocenti98951792018-06-26 17:13:44 +0900205 ],
206 shared_libs: [
207 "libbase",
208 "libbinder",
Chenbo Fenga54aaf52018-11-07 17:51:51 -0800209 "libbpf_android",
Bernie Innocenti98951792018-06-26 17:13:44 +0900210 "libcrypto",
211 "libcutils",
212 "liblog",
Chenbo Fengd6104d12018-10-16 20:29:29 -0700213 "libnetdbpf",
Bernie Innocenti98951792018-06-26 17:13:44 +0900214 "libnetdutils",
215 "libnetutils",
216 "libqtaguid",
217 "libsysutils",
218 "libutils",
Luke Huang94658ac2018-10-18 19:35:12 +0900219 "netd_aidl_interface-cpp",
Lorenzo Colitti57bca9f2018-12-11 13:02:05 +0900220 "netd_event_listener_interface-cpp",
Bernie Innocenti98951792018-06-26 17:13:44 +0900221 ],
222}