blob: fe586adb596ca36e576bdb7a191758005aff584a [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",
chenbrucefd837fa2019-10-29 18:35:36 +080018 "binder/android/net/ResolverHostsParcel.aidl",
waynema37255182019-03-18 13:22:56 +080019 "binder/android/net/ResolverParamsParcel.aidl",
Luke Huang403c0442019-02-25 15:33:42 +080020 ],
Hungming Chena32c8c12019-01-25 10:47:40 +080021 imports: [
22 "netd_event_listener_interface",
23 ],
Luke Huang598daad2019-05-02 18:10:15 +080024 backend: {
25 ndk: {
26 gen_log: true,
27 },
28 },
Luke Huang5aa6a992019-04-29 22:02:11 +080029 versions: [
30 "1",
31 "2",
Luke Huang0fc985f2019-11-14 19:18:14 +080032 "3",
Luke Huang5aa6a992019-04-29 22:02:11 +080033 ],
Luke Huang403c0442019-02-25 15:33:42 +080034}
35
Lorenzo Colitti8505af42018-12-19 20:30:41 +090036cc_library {
Bernie Innocentiafaacf72018-08-30 07:34:37 +090037 name: "libnetd_resolv",
Bernie Innocenti1e886742018-10-25 18:41:47 +090038 version_script: "libnetd_resolv.map.txt",
Jooyung Han41fa73d2019-11-27 15:41:44 +090039 stubs: {
40 versions: [
41 "1",
42 ],
43 symbol_file: "libnetd_resolv.map.txt",
44 },
Bernie Innocentiafaacf72018-08-30 07:34:37 +090045 defaults: ["netd_defaults"],
46 srcs: [
Bernie Innocenti9c575932018-09-07 21:10:25 +090047 "getaddrinfo.cpp",
48 "gethnamaddr.cpp",
49 "sethostent.cpp",
50 "res_cache.cpp",
51 "res_comp.cpp",
Bernie Innocenti9c575932018-09-07 21:10:25 +090052 "res_debug.cpp",
53 "res_init.cpp",
54 "res_mkquery.cpp",
55 "res_query.cpp",
56 "res_send.cpp",
Bernie Innocenti9c575932018-09-07 21:10:25 +090057 "res_stats.cpp",
Mike Yu021c3e12019-10-08 17:29:34 +080058 "util.cpp",
Luke Huang7b26b202019-03-28 14:09:24 +080059 "Dns64Configuration.cpp",
Mike Yu19108d52018-11-15 21:58:19 +080060 "DnsProxyListener.cpp",
Mike Yu939e3692019-10-29 17:28:34 +080061 "DnsQueryLog.cpp",
Luke Huang36796f32019-03-13 02:54:45 +080062 "DnsResolver.cpp",
Luke Huang403c0442019-02-25 15:33:42 +080063 "DnsResolverService.cpp",
Mike Yue655b1d2019-08-28 17:49:59 +080064 "DnsStats.cpp",
Mike Yubab3daa2018-10-19 22:11:43 +080065 "DnsTlsDispatcher.cpp",
66 "DnsTlsQueryMap.cpp",
67 "DnsTlsTransport.cpp",
68 "DnsTlsServer.cpp",
69 "DnsTlsSessionCache.cpp",
70 "DnsTlsSocket.cpp",
Mike Yub601ff72018-11-01 20:07:00 +080071 "PrivateDnsConfiguration.cpp",
Luke Huang7b26b202019-03-28 14:09:24 +080072 "ResolverController.cpp",
Mike Yu39cc6892018-12-14 16:18:27 +080073 "ResolverEventReporter.cpp",
Bernie Innocentiafaacf72018-08-30 07:34:37 +090074 ],
Tobias Thierer469b6332019-08-28 20:25:33 +010075 // Link most things statically to minimize our dependence on system ABIs.
Bernie Innocenti2a9244c2018-09-13 16:12:56 +090076 stl: "libc++_static",
Bernie Innocenti9f05f5e2018-09-12 23:20:10 +090077 static_libs: [
Jeongik Cha9af2c7e2019-10-15 17:06:40 +090078 "dnsresolver_aidl_interface-unstable-ndk_platform",
Bernie Innocenti9f05f5e2018-09-12 23:20:10 +090079 "libbase",
Mike Yu19108d52018-11-15 21:58:19 +080080 "libcutils",
Luke Huang598daad2019-05-02 18:10:15 +080081 "libjsoncpp",
chenbruced8e992e2019-07-03 14:25:48 +080082 "liblog", //Used by libstatslog_resolv
Mike Yubab3daa2018-10-19 22:11:43 +080083 "libnetdutils",
Bernie Innocenti83a968f2019-06-27 14:35:53 +090084 "libprotobuf-cpp-lite",
lifr9b87e362019-05-08 13:00:14 +080085 "libstatslog_resolv",
Muhammad Qureshi10b3d272019-12-03 15:25:19 -080086 "libstatspush_compat",
Mike Yu19108d52018-11-15 21:58:19 +080087 "libsysutils",
Luke Huang0fc985f2019-11-14 19:18:14 +080088 "libutils", // Used by libstatslog_resolv
Jeongik Cha9af2c7e2019-10-15 17:06:40 +090089 "netd_event_listener_interface-ndk_platform",
waynemaa74195e2019-01-18 14:02:31 +080090 "server_configurable_flags",
lifr9b87e362019-05-08 13:00:14 +080091 "stats_proto",
Mike Yu39cc6892018-12-14 16:18:27 +080092 ],
Tobias Thierer469b6332019-08-28 20:25:33 +010093 // libcrypto needs to be used as a shared library because it performs an
94 // integrity check (against a checksum) that is not supported for static
95 // libs. See http://b/141248879
96 // We're also adding libssl here to treat it consistently.
Mike Yu39cc6892018-12-14 16:18:27 +080097 shared_libs: [
98 "libbinder_ndk",
Tobias Thierer469b6332019-08-28 20:25:33 +010099 "libcrypto",
100 "libssl",
Mike Yu19108d52018-11-15 21:58:19 +0800101 ],
Luke Huangf4c98f22019-06-14 01:57:00 +0800102 header_libs: [
103 "libnetd_client_headers",
Mike Yubab3daa2018-10-19 22:11:43 +0800104 ],
Bernie Innocentiac18b122018-10-01 23:10:18 +0900105 export_include_dirs: ["include"],
chenbruce99cbfd82019-09-05 15:08:13 +0800106
Bernie Innocenti9f05f5e2018-09-12 23:20:10 +0900107 product_variables: {
108 debuggable: {
109 cppflags: [
110 "-DRESOLV_ALLOW_VERBOSE_LOGGING=1",
waynema0e73c2e2019-07-31 15:04:08 +0800111 "-DRESOLV_INJECT_CA_CERTIFICATE=1",
Bernie Innocenti9f05f5e2018-09-12 23:20:10 +0900112 ],
113 },
114 },
Ken Chen4961dfe2019-11-15 09:03:29 +0800115 header_abi_checker: {
116 enabled: true,
117 symbol_file: "libnetd_resolv.map.txt",
118 },
Bernie Innocentiafaacf72018-08-30 07:34:37 +0900119}
Mike Yuc52739e2018-10-19 21:06:32 +0800120
lifr9b87e362019-05-08 13:00:14 +0800121cc_library_static {
122 name: "stats_proto",
123 defaults: ["netd_defaults"],
124 proto: {
125 export_proto_headers: true,
126 type: "lite",
127 },
128 srcs: [
129 "stats.proto",
130 ],
131}
132
133genrule {
134 name: "statslog_resolv.h",
135 tools: ["stats-log-api-gen"],
136 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_resolv.h --module resolv --namespace android,net,stats",
137 out: [
138 "statslog_resolv.h",
139 ],
140}
141
142genrule {
143 name: "statslog_resolv.cpp",
144 tools: ["stats-log-api-gen"],
Muhammad Qureshi10b3d272019-12-03 15:25:19 -0800145 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_resolv.cpp --module resolv --namespace android,net,stats --importHeader statslog_resolv.h --supportQ",
lifr9b87e362019-05-08 13:00:14 +0800146 out: [
147 "statslog_resolv.cpp",
148 ],
149}
150
151cc_library_static {
152 name: "libstatslog_resolv",
153 generated_sources: ["statslog_resolv.cpp"],
154 generated_headers: ["statslog_resolv.h"],
155 defaults: ["netd_defaults"],
156 export_generated_headers: ["statslog_resolv.h"],
157 static_libs: [
158 "libcutils",
Muhammad Qureshi10b3d272019-12-03 15:25:19 -0800159 "libgtest_prod", // Used by libstatspush_compat
160 "libstatspush_compat",
lifr9b87e362019-05-08 13:00:14 +0800161 "libstatssocket",
lifr9b87e362019-05-08 13:00:14 +0800162 ],
163}
164
Luke Huangf8215372019-11-22 11:53:41 +0800165// TODO: Move this test to tests/
Ken Chenb9fa2062018-11-13 21:51:13 +0800166cc_test {
167 name: "resolv_unit_test",
Bernie Innocenticac27842019-12-13 11:49:33 +0900168 test_suites: ["device-tests", "mts"],
chenbruce609db9d2019-06-26 23:30:33 +0800169 require_root: true,
170 //TODO: drop root privileges and make it be an real unit test.
Mike Yuc52739e2018-10-19 21:06:32 +0800171 defaults: ["netd_defaults"],
172 srcs: [
waynemae9302592019-08-15 14:50:58 +0800173 "resolv_cache_unit_test.cpp",
chenbruce98f19c22019-11-20 14:58:20 +0800174 "resolv_callback_unit_test.cpp",
waynemae9302592019-08-15 14:50:58 +0800175 "resolv_tls_unit_test.cpp",
176 "resolv_unit_test.cpp",
Mike Yue655b1d2019-08-28 17:49:59 +0800177 "DnsStatsTest.cpp",
Mike Yu39df0b12019-10-31 16:12:23 +0800178 "DnsQueryLogTest.cpp",
Mike Yuc52739e2018-10-19 21:06:32 +0800179 ],
Mike Yuc52739e2018-10-19 21:06:32 +0800180 shared_libs: [
181 "libbase",
Mike Yub601ff72018-11-01 20:07:00 +0800182 "libcrypto",
Luke Huange126fbe2019-07-20 17:36:30 +0800183 "libcutils",
Mike Yubab3daa2018-10-19 22:11:43 +0800184 "libssl",
Sehee Parkd975bf32019-08-07 13:21:16 +0900185 "libbinder_ndk",
Mike Yuc52739e2018-10-19 21:06:32 +0800186 ],
nuccachen0efcc802018-11-28 18:19:39 +0800187 static_libs: [
chenbrucefd837fa2019-10-29 18:35:36 +0800188 "dnsresolver_aidl_interface-unstable-ndk_platform",
Jeongik Cha9af2c7e2019-10-15 17:06:40 +0900189 "netd_event_listener_interface-ndk_platform",
Luke Huange126fbe2019-07-20 17:36:30 +0800190 "libgmock",
Sehee Parkd975bf32019-08-07 13:21:16 +0900191 "liblog",
Lorenzo Colitti8505af42018-12-19 20:30:41 +0900192 "libnetd_resolv",
nuccachen0efcc802018-11-28 18:19:39 +0800193 "libnetd_test_dnsresponder",
Hungming Chend52f6b12019-07-24 16:01:47 +0800194 "libnetd_test_resolv_utils",
Lorenzo Colittidae66672018-12-19 21:13:03 +0900195 "libnetdutils",
lifr94981782019-05-17 21:15:19 +0800196 "libprotobuf-cpp-lite",
chenbruce98f19c22019-11-20 14:58:20 +0800197 "libstatslog_resolv",
Muhammad Qureshi2361d132020-01-19 07:06:45 -0800198 "libstatspush_compat",
chenbruce98f19c22019-11-20 14:58:20 +0800199 "libstatssocket",
200 "libsysutils",
201 "libutils",
waynemaa74195e2019-01-18 14:02:31 +0800202 "server_configurable_flags",
lifr94981782019-05-17 21:15:19 +0800203 "stats_proto",
nuccachen0efcc802018-11-28 18:19:39 +0800204 ],
Bernie Innocenticac27842019-12-13 11:49:33 +0900205 compile_multilib: "both",
206 multilib: {
207 lib32: {
208 suffix: "32",
209 },
210 lib64: {
211 suffix: "64",
212 },
213 },
Mike Yuc52739e2018-10-19 21:06:32 +0800214}