Lines Matching defs:dns
19 static const char rcsid[] = "$Id: dns.c,v 1.5 2006/03/09 23:57:56 marka Exp $";
24 * dns.c --- this is the top-level accessor function for the dns
61 struct dns_p *dns;
70 if (!(dns = memget(sizeof *dns))) {
75 memset(dns, 0x5e, sizeof *dns);
76 dns->res = NULL;
77 dns->free_res = NULL;
78 if (hesiod_init(&dns->hes_ctx) < 0) {
80 * We allow the dns accessor class to initialize
82 * since dns host queries don't depend on hesiod.
84 dns->hes_ctx = NULL;
86 acc->private = dns;
111 struct dns_p *dns = (struct dns_p *)this->private;
113 if (dns->res == NULL) {
122 if ((dns->res->options & RES_INIT) == 0U &&
123 res_ninit(dns->res) < 0)
126 return (dns->res);
132 struct dns_p *dns = (struct dns_p *)this->private;
134 if (dns->res && dns->free_res) {
135 res_nclose(dns->res);
136 (*dns->free_res)(dns->res);
138 dns->res = res;
139 dns->free_res = free_res;
144 struct dns_p *dns;
146 dns = (struct dns_p *)this->private;
147 if (dns->res && dns->free_res)
148 (*dns->free_res)(dns->res);
149 if (dns->hes_ctx)
150 hesiod_end(dns->hes_ctx);
151 memput(dns, sizeof *dns);