15 .
add_answer(
new DNSAaaaRR(
"example.com", 0x01020304, {0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5}));
16 std::vector<byte>
data = {
25 0x07,
'e',
'x',
'a',
'm',
'p',
'l',
'e',
31 0x07,
'e',
'x',
'a',
'm',
'p',
'l',
'e',
36 0x01, 0x02, 0x03, 0x04,
38 0x02, 0x03, 0x04, 0x05,
40 0x07,
'e',
'x',
'a',
'm',
'p',
'l',
'e',
45 0x01, 0x02, 0x03, 0x04,
47 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x04, 0x05,
50 struct hostent *host =
nullptr;
54 &host, info, &
count));
57 unsigned long expected_addr = htonl(0x02030405);
63 EXPECT_EQ(
"{'example.com' aliases=[] addrs=[2.3.4.5]}", ss.str());
68 nullptr, info, &
count));
76 std::vector<byte>
data = {
85 0x07,
'e',
'x',
'a',
'm',
'p',
'l',
'e',
91 0x07,
'e',
'x',
'a',
'm',
'p',
'l',
'e',
96 0x01, 0x02, 0x03, 0x04,
98 0x02, 0x03, 0x04, 0x05,
100 struct hostent *host =
nullptr;
105 std::vector<byte> invalid_rrlen(
data);
106 invalid_rrlen[51] = 180;
108 &host, info, &
count));
112 &host, info, &
count));
116 &host, info, &
count));
123 std::vector<byte>
data = pkt.
data();
124 struct hostent *host =
nullptr;
128 &host, info, &
count));
137 &host, info, &
count));
140 std::stringstream ss;
142 EXPECT_EQ(
"{'c.example.com' aliases=[example.com] addrs=[]}", ss.str());
155 struct hostent *host =
nullptr;
158 std::vector<byte>
data = pkt.
data();
160 &host, info, &
count));
172 struct hostent *host =
nullptr;
175 std::vector<byte>
data = pkt.
data();
177 &host, info, &
count));
180 std::stringstream ss;
182 EXPECT_EQ(
"{'other.mit.edu' aliases=[mit.edu] addrs=[]}", ss.str());
200 struct hostent *host =
nullptr;
203 std::vector<byte>
data = pkt.
data();
205 &host, info, &
count));
215 nullptr, info, &
count));
229 {0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
230 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}));
231 struct hostent *host =
nullptr;
234 std::vector<byte>
data = pkt.
data();
236 &host, info, &
count));
247 .
add_answer(
new DNSARR(
"redirect.query.example.com", 300, {129,97,123,221}))
248 .
add_answer(
new DNSARR(
"redirect.query.example.com", 300, {129,97,123,222}))
249 .
add_answer(
new DNSARR(
"redirect.query.example.com", 300, {129,97,123,223}))
250 .
add_answer(
new DNSARR(
"redirect.query.example.com", 300, {129,97,123,224}))
253 struct hostent *host =
nullptr;
256 std::vector<byte>
data = pkt.
data();
258 &host, info, &
count));
276 std::vector<byte>
data;
278 struct hostent *host =
nullptr;
286 &host, info, &
count));
295 &host, info, &
count));
305 &host, info, &
count));
313 &host, info, &
count));
322 &host, info, &
count));
332 &host, info, &
count));
341 &host, info, &
count));
349 &host, info, &
count));
352 nullptr, info, &
count));
362 std::vector<byte>
data = pkt.
data();
364 struct hostent *host =
nullptr;
368 for (
int ii = 1; ii <= 8; ii++) {
372 &host, info, &
count)) << ii;