blob: 75e7d20e9c3c0041de86abaf50fcbc246d327d79 [file] [log] [blame]
Colin Crossc03086f2017-11-14 13:05:37 -08001// AIDL interface between netd and framework.jar
2filegroup {
3 name: "netd_aidl",
4 srcs: ["binder/android/net/INetd.aidl"],
Bernie Innocentia28c5f22018-10-01 20:02:21 +09005 path: "binder",
Colin Crossc03086f2017-11-14 13:05:37 -08006}
Colin Cross1a8e7972017-12-05 22:35:52 -08007
8// AIDL interface between netd and services.core
9filegroup {
10 name: "netd_metrics_aidl",
11 srcs: ["binder/android/net/metrics/INetdEventListener.aidl"],
Bernie Innocentia28c5f22018-10-01 20:02:21 +090012 path: "binder",
Colin Cross1a8e7972017-12-05 22:35:52 -080013}
Steven Moreland0b7e3802018-03-02 12:41:52 -080014
Bernie Innocenti37ceb532018-06-11 21:10:44 +090015// These are used in netd_integration_test
16// TODO: fold these into a cc_library_static after converting netd/server to Android.bp
17filegroup {
18 name: "netd_integration_test_shared",
19 srcs: [
20 "NetdConstants.cpp",
21 "InterfaceController.cpp",
22 "NetlinkCommands.cpp",
23 "XfrmController.cpp",
24 ],
25}
26
Steven Moreland0b7e3802018-03-02 12:41:52 -080027cc_library {
28 name: "libnetdaidl",
Bernie Innocenti0c532742018-06-11 14:12:08 +090029 defaults: ["netd_defaults"],
Steven Moreland0b7e3802018-03-02 12:41:52 -080030 shared_libs: [
31 "libbinder",
32 "libutils",
33 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080034 aidl: {
35 export_aidl_headers: true,
36 local_include_dirs: ["binder"],
37 include_dirs: ["frameworks/native/aidl/binder"],
38 },
39 srcs: [
Bernie Innocentia28c5f22018-10-01 20:02:21 +090040 ":netd_aidl",
Steven Moreland0b7e3802018-03-02 12:41:52 -080041 "binder/android/net/UidRange.cpp",
42 ],
Steven Moreland0b7e3802018-03-02 12:41:52 -080043 export_include_dirs: ["binder"],
44}
Bernie Innocenti98951792018-06-26 17:13:44 +090045
46// Modules common to both netd and netd_unit_test
47cc_library_static {
48 name: "libnetd_server",
49 defaults: ["netd_defaults"],
50 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +090051 "system/netd/include",
52 "system/netd/server/binder",
53 ],
54 srcs: [
55 "BandwidthController.cpp",
56 "Controllers.cpp",
57 "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 Innocentia28c5f22018-10-01 20:02:21 +090075 ":netd_metrics_aidl",
Bernie Innocenti98951792018-06-26 17:13:44 +090076 ],
77 shared_libs: [
78 "libbpf",
Bernie Innocentif89b3512018-08-30 07:34:37 +090079 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +090080 "libnetdaidl",
81 "libbase",
82 "libbinder",
83 "liblogwrap",
84 "libnetutils",
85 "libnetdutils",
86 "libpcap",
87 "libqtaguid",
88 "libssl",
89 ],
90 aidl: {
91 export_aidl_headers: true,
92 local_include_dirs: ["binder"],
93 },
94}
95
96cc_binary {
97 name: "netd",
98 defaults: ["netd_defaults"],
99 include_dirs: [
Bernie Innocenti98951792018-06-26 17:13:44 +0900100 "external/mdnsresponder/mDNSShared",
101 "system/netd/include",
102 ],
103 init_rc: ["netd.rc"],
104 shared_libs: [
105 "android.system.net.netd@1.0",
106 "android.system.net.netd@1.1",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900107 "libbase",
Bernie Innocenti98951792018-06-26 17:13:44 +0900108 "libbinder",
109 "libbpf",
110 "libcrypto",
111 "libcutils",
112 "libdl",
113 "libhidlbase",
114 "libhidltransport",
115 "liblog",
116 "liblogwrap",
117 "libmdnssd",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900118 "libnetd_resolv",
Bernie Innocenti98951792018-06-26 17:13:44 +0900119 "libnetdaidl",
Bernie Innocenti98951792018-06-26 17:13:44 +0900120 "libnetdutils",
Bernie Innocentif89b3512018-08-30 07:34:37 +0900121 "libnetutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900122 "libpcap",
123 "libqtaguid",
124 "libselinux",
125 "libssl",
126 "libsysutils",
Bernie Innocenti98951792018-06-26 17:13:44 +0900127 "libutils",
128 ],
129 static_libs: [
130 "libnetd_server",
131 "libnetddns",
132 ],
133 srcs: [
134 "ClatdController.cpp",
135 "CommandListener.cpp",
136 "DnsProxyListener.cpp",
137 "DummyNetwork.cpp",
138 "DumpWriter.cpp",
139 "EventReporter.cpp",
140 "FwmarkServer.cpp",
141 "LocalNetwork.cpp",
142 "MDnsSdListener.cpp",
143 "NetdCommand.cpp",
144 "NetdHwService.cpp",
145 "NetdNativeService.cpp",
146 "NetlinkHandler.cpp",
147 "Network.cpp",
148 "NetworkController.cpp",
149 "PhysicalNetwork.cpp",
150 "PppController.cpp",
151 "Process.cpp",
152 "ResolverController.cpp",
153 "VirtualNetwork.cpp",
154 "main.cpp",
155 "oem_iptables_hook.cpp",
156 ],
157}
158
159cc_binary {
160 name: "ndc",
161 defaults: ["netd_defaults"],
162 shared_libs: ["libcutils"],
163 srcs: ["ndc.cpp"],
164}
165
166cc_test {
167 name: "netd_unit_test",
168 defaults: ["netd_defaults"],
169 test_suites: ["device-tests"],
170 include_dirs: [
171 "system/netd/include",
172 "system/netd/server/binder",
173 "system/netd/tests",
174 "system/core/logwrapper/include",
175 ],
176 srcs: [
177 "BandwidthControllerTest.cpp",
178 "ControllersTest.cpp",
179 "FirewallControllerTest.cpp",
180 "IdletimerControllerTest.cpp",
181 "InterfaceControllerTest.cpp",
182 "IptablesBaseTest.cpp",
183 "IptablesRestoreControllerTest.cpp",
184 "NFLogListenerTest.cpp",
185 "RouteControllerTest.cpp",
186 "SockDiagTest.cpp",
187 "StrictControllerTest.cpp",
188 "TetherControllerTest.cpp",
189 "TrafficControllerTest.cpp",
190 "XfrmControllerTest.cpp",
191 "WakeupControllerTest.cpp",
192 ],
193 static_libs: [
194 "libgmock",
195 "libnetd_server",
196 "libnetd_test_tun_interface",
197 "libnetddns",
198 ],
199 shared_libs: [
200 "libbase",
201 "libbinder",
202 "libbpf",
203 "libcrypto",
204 "libcutils",
205 "liblog",
206 "libnetdaidl",
207 "libnetdutils",
208 "libnetutils",
209 "libqtaguid",
210 "libsysutils",
211 "libutils",
212 ],
213}