
3.4 Implementation of IPv6 DNS Resolver 231
FIGURE 3-14
name
qclass
qtype
answer
anslen
n
res_target{}
IN
AAAA
next
HEADER
HFIXEDSZ
anslen
= MAXPACKET
= 64KB
querybuf{}
n
Relationship between the res_target{} structur e and the querybuf{} union.
Initialization
Listing 3-6
getaddrinfo.c
4455 static int
4456 _dns_getaddrinfo(pai, hostname, res)
4457 const struct addrinfo *pai;
4458 const char *hostname;
4459 struct addrinfo **res;
4460 {
4461 struct addrinfo *ai;
4462 querybuf *buf, *buf2;
4463 const char *name;
4464 struct addrinfo sentinel, *cur;
4465 struct res_target q, q2;
4466
4467 memset(&q, 0, sizeof(q2));
4468 memset(&q2, 0, sizeof(q2));
4469 memset(&sentinel, 0, sizeof(sentinel)); ...