blob: 2842395166c803d47400084c030a92a6408a9ad9 [file] [log] [blame]
Lorenzo Colitti84485a42018-12-18 19:16:12 +09001cc_library_headers {
2 name: "libnetd_resolv_headers",
3 export_include_dirs: ["include"],
4}
5
Bernie Innocenti86890c92020-01-08 21:00:39 +09006// Used only by dns_responder_client_ndk.cpp for ResolverStats.h
7// TODO: refactor stats to use a Parcel and eliminate this dependency
chenbruce2e2446c2019-06-28 16:37:36 +08008cc_library_headers {
9 name: "libnetd_resolv_internal_headers",
10 export_include_dirs: ["."],
11}
12
Luke Huang403c0442019-02-25 15:33:42 +080013aidl_interface {
14 name: "dnsresolver_aidl_interface",
15 local_include_dir: "binder",
16 srcs: [
17 "binder/android/net/IDnsResolver.aidl",
waynema37255182019-03-18 13:22:56 +080018 "binder/android/net/ResolverParamsParcel.aidl",
Luke Huang403c0442019-02-25 15:33:42 +080019 ],
Hungming Chena32c8c12019-01-25 10:47:40 +080020 imports: [
21 "netd_event_listener_interface",
22 ],
Luke Huang598daad2019-05-02 18:10:15 +080023 backend: {
24 ndk: {
25 gen_log: true,
26 },
27 },
Luke Huang5aa6a992019-04-29 22:02:11 +080028 versions: [
29 "1",
30 "2",
Luke Huang0fc985f2019-11-14 19:18:14 +080031 "3",
Luke Huang5aa6a992019-04-29 22:02:11 +080032 ],
Luke Huang403c0442019-02-25 15:33:42 +080033}
34
Lorenzo Colitti8505af42018-12-19 20:30:41 +090035cc_library {
Bernie Innocentiafaacf72018-08-30 07:34:37 +090036 name: "libnetd_resolv",
Bernie Innocenti1e886742018-10-25 18:41:47 +090037 version_script: "libnetd_resolv.map.txt",
Jooyung Han41fa73d2019-11-27 15:41:44 +090038 stubs: {
39 versions: [
40 "1",
41 ],
42 symbol_file: "libnetd_resolv.map.txt",
43 },
Bernie Innocentiafaacf72018-08-30 07:34:37 +090044 defaults: ["netd_defaults"],
45 srcs: [
Bernie Innocenti9c575932018-09-07 21:10:25 +090046 "getaddrinfo.cpp",
47 "gethnamaddr.cpp",
48 "sethostent.cpp",
49 "res_cache.cpp",
50 "res_comp.cpp",
Bernie Innocenti9c575932018-09-07 21:10:25 +090051 "res_debug.cpp",
52 "res_init.cpp",
53 "res_mkquery.cpp",
54 "res_query.cpp",
55 "res_send.cpp",
Bernie Innocenti9c575932018-09-07 21:10:25 +090056 "res_stats.cpp",
Mike Yu021c3e12019-10-08 17:29:34 +080057 "util.cpp",
Luke Huang7b26b202019-03-28 14:09:24 +080058 "Dns64Configuration.cpp",
Mike Yu19108d52018-11-15 21:58:19 +080059 "DnsProxyListener.cpp",
Mike Yu939e3692019-10-29 17:28:34 +080060 "DnsQueryLog.cpp",
Luke Huang36796f32019-03-13 02:54:45 +080061 "DnsResolver.cpp",
Luke Huang403c0442019-02-25 15:33:42 +080062 "DnsResolverService.cpp",
Mike Yue655b1d2019-08-28 17:49:59 +080063 "DnsStats.cpp",
Mike Yubab3daa2018-10-19 22:11:43 +080064 "DnsTlsDispatcher.cpp",
65 "DnsTlsQueryMap.cpp",
66 "DnsTlsTransport.cpp",
67 "DnsTlsServer.cpp",
68 "DnsTlsSessionCache.cpp",
69 "DnsTlsSocket.cpp",
Mike Yub601ff72018-11-01 20:07:00 +080070 "PrivateDnsConfiguration.cpp",
Luke Huang7b26b202019-03-28 14:09:24 +080071 "ResolverController.cpp",
Mike Yu39cc6892018-12-14 16:18:27 +080072 "ResolverEventReporter.cpp",
Bernie Innocentiafaacf72018-08-30 07:34:37 +090073 ],
Tobias Thierer469b6332019-08-28 20:25:33 +010074 // Link most things statically to minimize our dependence on system ABIs.
Bernie Innocenti2a9244c2018-09-13 16:12:56 +090075 stl: "libc++_static",
Bernie Innocenti9f05f5e2018-09-12 23:20:10 +090076 static_libs: [
Jeongik Cha9af2c7e2019-10-15 17:06:40 +090077 "dnsresolver_aidl_interface-unstable-ndk_platform",
Bernie Innocenti9f05f5e2018-09-12 23:20:10 +090078 "libbase",
Mike Yu19108d52018-11-15 21:58:19 +080079 "libcutils",
Luke Huang598daad2019-05-02 18:10:15 +080080 "libjsoncpp",
chenbruced8e992e2019-07-03 14:25:48 +080081 "liblog", //Used by libstatslog_resolv
Mike Yubab3daa2018-10-19 22:11:43 +080082 "libnetdutils",
Bernie Innocenti83a968f2019-06-27 14:35:53 +090083 "libprotobuf-cpp-lite",
lifr9b87e362019-05-08 13:00:14 +080084 "libstatslog_resolv",
85 "libstatssocket",
Mike Yu19108d52018-11-15 21:58:19 +080086 "libsysutils",
Luke Huang0fc985f2019-11-14 19:18:14 +080087 "libutils", // Used by libstatslog_resolv
Jeongik Cha9af2c7e2019-10-15 17:06:40 +090088 "netd_event_listener_interface-ndk_platform",
waynemaa74195e2019-01-18 14:02:31 +080089 "server_configurable_flags",
lifr9b87e362019-05-08 13:00:14 +080090 "stats_proto",
Mike Yu39cc6892018-12-14 16:18:27 +080091 ],
Tobias Thierer469b6332019-08-28 20:25:33 +010092 // libcrypto needs to be used as a shared library because it performs an
93 // integrity check (against a checksum) that is not supported for static
94 // libs. See http://b/141248879
95 // We're also adding libssl here to treat it consistently.
Mike Yu39cc6892018-12-14 16:18:27 +080096 shared_libs: [
97 "libbinder_ndk",
Tobias Thierer469b6332019-08-28 20:25:33 +010098 "libcrypto",
99 "libssl",
Mike Yu19108d52018-11-15 21:58:19 +0800100 ],
Luke Huangf4c98f22019-06-14 01:57:00 +0800101 header_libs: [
102 "libnetd_client_headers",
Mike Yubab3daa2018-10-19 22:11:43 +0800103 ],
Bernie Innocentiac18b122018-10-01 23:10:18 +0900104 export_include_dirs: ["include"],
chenbruce99cbfd82019-09-05 15:08:13 +0800105
Bernie Innocenti9f05f5e2018-09-12 23:20:10 +0900106 product_variables: {
107 debuggable: {
108 cppflags: [
109 "-DRESOLV_ALLOW_VERBOSE_LOGGING=1",
waynema0e73c2e2019-07-31 15:04:08 +0800110 "-DRESOLV_INJECT_CA_CERTIFICATE=1",
Bernie Innocenti9f05f5e2018-09-12 23:20:10 +0900111 ],
112 },
113 },
Ken Chen4961dfe2019-11-15 09:03:29 +0800114 header_abi_checker: {
115 enabled: true,
116 symbol_file: "libnetd_resolv.map.txt",
117 },
Bernie Innocentiafaacf72018-08-30 07:34:37 +0900118}
Mike Yuc52739e2018-10-19 21:06:32 +0800119
lifr9b87e362019-05-08 13:00:14 +0800120cc_library_static {
121 name: "stats_proto",
122 defaults: ["netd_defaults"],
123 proto: {
124 export_proto_headers: true,
125 type: "lite",
126 },
127 srcs: [
128 "stats.proto",
129 ],
130}
131
132genrule {
133 name: "statslog_resolv.h",
134 tools: ["stats-log-api-gen"],
135 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_resolv.h --module resolv --namespace android,net,stats",
136 out: [
137 "statslog_resolv.h",
138 ],
139}
140
141genrule {
142 name: "statslog_resolv.cpp",
143 tools: ["stats-log-api-gen"],
144 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_resolv.cpp --module resolv --namespace android,net,stats --importHeader statslog_resolv.h",
145 out: [
146 "statslog_resolv.cpp",
147 ],
148}
149
150cc_library_static {
151 name: "libstatslog_resolv",
152 generated_sources: ["statslog_resolv.cpp"],
153 generated_headers: ["statslog_resolv.h"],
154 defaults: ["netd_defaults"],
155 export_generated_headers: ["statslog_resolv.h"],
156 static_libs: [
157 "libcutils",
lifr9b87e362019-05-08 13:00:14 +0800158 "libstatssocket",
lifr9b87e362019-05-08 13:00:14 +0800159 ],
160}
161
Luke Huangf8215372019-11-22 11:53:41 +0800162// TODO: Move this test to tests/
Ken Chenb9fa2062018-11-13 21:51:13 +0800163cc_test {
164 name: "resolv_unit_test",
Bernie Innocenticac27842019-12-13 11:49:33 +0900165 test_suites: ["device-tests", "mts"],
chenbruce609db9d2019-06-26 23:30:33 +0800166 require_root: true,
167 //TODO: drop root privileges and make it be an real unit test.
Mike Yuc52739e2018-10-19 21:06:32 +0800168 defaults: ["netd_defaults"],
169 srcs: [
waynemae9302592019-08-15 14:50:58 +0800170 "resolv_cache_unit_test.cpp",
chenbruce98f19c22019-11-20 14:58:20 +0800171 "resolv_callback_unit_test.cpp",
waynemae9302592019-08-15 14:50:58 +0800172 "resolv_tls_unit_test.cpp",
173 "resolv_unit_test.cpp",
Mike Yue655b1d2019-08-28 17:49:59 +0800174 "DnsStatsTest.cpp",
Mike Yu39df0b12019-10-31 16:12:23 +0800175 "DnsQueryLogTest.cpp",
Mike Yuc52739e2018-10-19 21:06:32 +0800176 ],
Mike Yuc52739e2018-10-19 21:06:32 +0800177 shared_libs: [
178 "libbase",
Mike Yub601ff72018-11-01 20:07:00 +0800179 "libcrypto",
Luke Huange126fbe2019-07-20 17:36:30 +0800180 "libcutils",
Mike Yubab3daa2018-10-19 22:11:43 +0800181 "libssl",
Sehee Parkd975bf32019-08-07 13:21:16 +0900182 "libbinder_ndk",
Mike Yuc52739e2018-10-19 21:06:32 +0800183 ],
nuccachen0efcc802018-11-28 18:19:39 +0800184 static_libs: [
Jeongik Cha9af2c7e2019-10-15 17:06:40 +0900185 "dnsresolver_aidl_interface-cpp",
186 "dnsresolver_aidl_interface-ndk_platform",
187 "netd_event_listener_interface-ndk_platform",
Luke Huange126fbe2019-07-20 17:36:30 +0800188 "libgmock",
Sehee Parkd975bf32019-08-07 13:21:16 +0900189 "liblog",
Lorenzo Colitti8505af42018-12-19 20:30:41 +0900190 "libnetd_resolv",
nuccachen0efcc802018-11-28 18:19:39 +0800191 "libnetd_test_dnsresponder",
Hungming Chend52f6b12019-07-24 16:01:47 +0800192 "libnetd_test_resolv_utils",
Lorenzo Colittidae66672018-12-19 21:13:03 +0900193 "libnetdutils",
lifr94981782019-05-17 21:15:19 +0800194 "libprotobuf-cpp-lite",
chenbruce98f19c22019-11-20 14:58:20 +0800195 "libstatslog_resolv",
196 "libstatssocket",
197 "libsysutils",
198 "libutils",
waynemaa74195e2019-01-18 14:02:31 +0800199 "server_configurable_flags",
lifr94981782019-05-17 21:15:19 +0800200 "stats_proto",
nuccachen0efcc802018-11-28 18:19:39 +0800201 ],
Bernie Innocenticac27842019-12-13 11:49:33 +0900202 compile_multilib: "both",
203 multilib: {
204 lib32: {
205 suffix: "32",
206 },
207 lib64: {
208 suffix: "64",
209 },
210 },
Mike Yuc52739e2018-10-19 21:06:32 +0800211}