Home | History | Annotate | Download | only in irs

Lines Matching refs:dns

1 /*	$NetBSD: dns.c,v 1.1.1.2 2012/09/09 16:07:57 christos Exp $	*/
21 static const char rcsid[] = "Id: dns.c,v 1.5 2006/03/09 23:57:56 marka Exp ";
26 * dns.c --- this is the top-level accessor function for the dns
63 struct dns_p *dns;
72 if (!(dns = memget(sizeof *dns))) {
77 memset(dns, 0x5e, sizeof *dns);
78 dns->res = NULL;
79 dns->free_res = NULL;
80 if (hesiod_init(&dns->hes_ctx) < 0) {
82 * We allow the dns accessor class to initialize
84 * since dns host queries don't depend on hesiod.
86 dns->hes_ctx = NULL;
88 acc->private = dns;
113 struct dns_p *dns = (struct dns_p *)this->private;
115 if (dns->res == NULL) {
124 if ((dns->res->options & RES_INIT) == 0U &&
125 res_ninit(dns->res) < 0)
128 return (dns->res);
134 struct dns_p *dns = (struct dns_p *)this->private;
136 if (dns->res && dns->free_res) {
137 res_nclose(dns->res);
138 (*dns->free_res)(dns->res);
140 dns->res = res;
141 dns->free_res = free_res;
146 struct dns_p *dns;
148 dns = (struct dns_p *)this->private;
149 if (dns->res && dns->free_res)
150 (*dns->free_res)(dns->res);
151 if (dns->hes_ctx)
152 hesiod_end(dns->hes_ctx);
153 memput(dns, sizeof *dns);