Lines Matching +full:- +full:- +full:host
3 * Copyright (c) The c-ares project and its contributors
24 * SPDX-License-Identifier: MIT
26 #include "ares-test.h"
27 #include "dns-proto.h"
39 .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) in TEST_F()
40 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); in TEST_F()
43 struct hostent *host = nullptr; in TEST_F() local
45 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
46 ASSERT_NE(nullptr, host); in TEST_F()
48 ss << HostEnt(host); in TEST_F()
50 ares_free_hostent(host); in TEST_F()
57 .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) in TEST_F()
58 .add_answer(new DNSCnameRR("64.48.32.16.in-addr.arpa", 50, "64.48.32.8.in-addr.arpa")) in TEST_F()
59 .add_answer(new DNSPtrRR("64.48.32.8.in-addr.arpa", 100, "other.com")); in TEST_F()
62 struct hostent *host = nullptr; in TEST_F() local
64 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
65 ASSERT_NE(nullptr, host); in TEST_F()
67 ss << HostEnt(host); in TEST_F()
69 ares_free_hostent(host); in TEST_F()
91 .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) in TEST_F()
92 .add_answer(new DNSMalformedCnameRR("64.48.32.16.in-addr.arpa", 50, "64.48.32.8.in-addr.arpa")) in TEST_F()
93 .add_answer(new DNSPtrRR("64.48.32.8.in-addr.arpa", 100, "other.com")); in TEST_F()
96 struct hostent *host = nullptr; in TEST_F() local
98 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
99 ASSERT_EQ(nullptr, host); in TEST_F()
106 .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) in TEST_F()
107 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "main.com")) in TEST_F()
108 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other1.com")) in TEST_F()
109 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other2.com")) in TEST_F()
110 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other3.com")) in TEST_F()
111 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other4.com")) in TEST_F()
112 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other5.com")) in TEST_F()
113 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other6.com")) in TEST_F()
114 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other7.com")) in TEST_F()
115 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other8.com")) in TEST_F()
116 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other9.com")); in TEST_F()
119 struct hostent *host = nullptr; in TEST_F() local
121 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
122 ASSERT_NE(nullptr, host); in TEST_F()
123 ares_free_hostent(host); in TEST_F()
130 .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) in TEST_F()
131 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 55, "other.com")) in TEST_F()
132 .add_auth(new DNSNsRR("16.in-addr.arpa", 234, "ns1.other.com")) in TEST_F()
133 .add_auth(new DNSNsRR("16.in-addr.arpa", 234, "bb.ns2.other.com")) in TEST_F()
134 .add_auth(new DNSNsRR("16.in-addr.arpa", 234, "ns3.other.com")) in TEST_F()
140 struct hostent *host = nullptr; in TEST_F() local
142 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
143 ASSERT_NE(nullptr, host); in TEST_F()
145 ss << HostEnt(host); in TEST_F()
147 ares_free_hostent(host); in TEST_F()
154 .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) in TEST_F()
155 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); in TEST_F()
157 struct hostent *host = nullptr; in TEST_F() local
163 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
164 pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); in TEST_F()
167 host = nullptr; in TEST_F()
169 pkt.add_question(new DNSQuestion("99.48.32.16.in-addr.arpa", T_PTR)); in TEST_F()
172 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
173 ASSERT_NE(nullptr, host); in TEST_F()
175 ss << HostEnt(host); in TEST_F()
177 ares_free_hostent(host); in TEST_F()
179 host = nullptr; in TEST_F()
181 pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); in TEST_F()
184 pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); in TEST_F()
187 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
188 EXPECT_EQ(nullptr, host); in TEST_F()
190 pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)); in TEST_F()
197 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
198 EXPECT_EQ(nullptr, host); in TEST_F()
200 pkt.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); in TEST_F()
206 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
207 EXPECT_EQ(nullptr, host); in TEST_F()
208 pkt.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com")); in TEST_F()
214 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
215 EXPECT_EQ(nullptr, host); in TEST_F()
219 pkt.add_answer(new DNSCnameRR("64.48.32.16.in-addr.arpa", 50, "64.48.32.8.in-addr.arpa")); in TEST_F()
223 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
224 EXPECT_EQ(nullptr, host); in TEST_F()
228 EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), -1, in TEST_F()
229 addrv4, sizeof(addrv4), AF_INET, &host)); in TEST_F()
236 .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) in TEST_F()
237 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "main.com")) in TEST_F()
238 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other1.com")) in TEST_F()
239 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other2.com")) in TEST_F()
240 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other3.com")); in TEST_F()
242 struct hostent *host = nullptr; in TEST_F() local
248 addrv4, sizeof(addrv4), AF_INET, &host)) << ii; in TEST_F()
256 .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR)) in TEST_F()
257 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "main.com")) in TEST_F()
258 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other1.com")) in TEST_F()
259 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other2.com")) in TEST_F()
260 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other3.com")) in TEST_F()
261 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other4.com")) in TEST_F()
262 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other5.com")) in TEST_F()
263 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other6.com")) in TEST_F()
264 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other7.com")) in TEST_F()
265 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other8.com")) in TEST_F()
266 .add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other9.com")); in TEST_F()
268 struct hostent *host = nullptr; in TEST_F() local
274 addrv4, sizeof(addrv4), AF_INET, &host); in TEST_F()
277 ares_free_hostent(host); in TEST_F()
278 host = nullptr; in TEST_F()