Lines Matching defs:pvt

125 struct pvt {
171 static int add_hostent(struct pvt *pvt, char *bp, char **hap,
180 struct pvt *pvt;
184 if (!(pvt = memget(sizeof *pvt))) {
188 memset(pvt, 0, sizeof *pvt);
191 memput(pvt, sizeof *pvt);
196 ho->private = pvt;
214 struct pvt *pvt = (struct pvt *)this->private;
217 if (pvt->res && pvt->free_res)
218 (*pvt->free_res)(pvt->res);
219 memput(pvt, sizeof *pvt);
225 struct pvt *pvt = (struct pvt *)this->private;
231 if (pvt->res->options & RES_USE_INET6) {
242 struct pvt *pvt = (struct pvt *)this->private;
256 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
280 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
291 if (!strchr(name, '.') && (cp = res_hostalias(pvt->res, name,
307 if ((n = res_nsearch(pvt->res, name, p->qclass, p->qtype,
332 struct pvt *pvt = (struct pvt *)this->private;
347 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
385 if ((pvt->res->options & RES_NO_NIBBLE2) != 0U)
392 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
398 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
413 const char *nibsuff = res_get_nibblesuffix(pvt->res);
426 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
433 const char *nibsuff2 = res_get_nibblesuffix2(pvt->res);
446 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
469 if ((n = res_nquery(pvt->res, p->qname, p->qclass, p->qtype,
484 memcpy(pvt->host_addr, addr, len);
485 pvt->h_addr_ptrs[0] = (char *)pvt->host_addr;
486 pvt->h_addr_ptrs[1] = NULL;
487 if (af == AF_INET && (pvt->res->options & RES_USE_INET6)) {
488 map_v4v6_address((char*)pvt->host_addr,
489 (char*)pvt->host_addr);
490 pvt->host.h_addrtype = AF_INET6;
491 pvt->host.h_length = IN6ADDRSZ;
494 RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS);
524 struct pvt *pvt = (struct pvt *)this->private;
526 if (pvt->res)
527 res_nclose(pvt->res);
532 struct pvt *pvt = (struct pvt *)this->private;
534 if (!pvt->res) {
545 return (pvt->res);
555 struct pvt *pvt = (struct pvt *)this->private;
572 RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
609 RES_SET_H_ERRNO(pvt->res, NO_RECOVERY); /*%< better error? */
618 if (!strchr(name, '.') && (cp = res_hostalias(pvt->res, name,
636 if ((n = res_nsearch(pvt->res, name, p->qclass, p->qtype,
664 struct pvt *pvt = (struct pvt *)this->private;
666 if (pvt->res && pvt->free_res) {
667 res_nclose(pvt->res);
668 (*pvt->free_res)(pvt->res);
671 pvt->res = res;
672 pvt->free_res = free_res;
683 struct pvt *pvt = (struct pvt *)this->private;
718 pvt->host.h_addrtype = af;
719 pvt->host.h_length = size;
720 hname = pvt->host.h_name = NULL;
726 RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
732 bp = pvt->hostbuf;
733 ep = pvt->hostbuf + sizeof(pvt->hostbuf);
736 RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
740 if (n < 0 || !maybe_ok(pvt->res, bp, name_ok)) {
741 RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
746 RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
756 RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
759 pvt->host.h_name = bp;
763 qname = pvt->host.h_name;
765 ap = pvt->host_aliases;
767 pvt->host.h_aliases = pvt->host_aliases;
768 hap = pvt->h_addr_ptrs;
770 pvt->host.h_addr_list = pvt->h_addr_ptrs;
775 if (n < 0 || !maybe_ok(pvt->res, bp, name_ok)) {
805 if (n < 0 || !maybe_ok(pvt->res, tbuf, name_ok)) {
811 if (ap >= &pvt->host_aliases[MAXALIASES-1])
823 pvt->host.h_name = bp;
830 if (n < 0 || !maybe_dnok(pvt->res, tbuf)) {
836 if ((pvt->res->options & RES_USE_DNAME) != 0U)
880 if (n < 0 || !maybe_hnok(pvt->res, bp) ||
887 pvt->host.h_name = bp;
890 else if (ap < &pvt->host_aliases[MAXALIASES-1])
932 pvt->host.h_name = bp;
940 if (bp + n > &pvt->hostbuf[sizeof(pvt->hostbuf) - 1]) {
954 m = add_hostent(pvt, bp, hap, aip);
961 if (hap < &pvt->h_addr_ptrs[MAXADDRS])
983 if (pvt->res->nsort && hap != pvt->h_addr_ptrs &&
985 addrsort(pvt->res, pvt->h_addr_ptrs,
986 hap - pvt->h_addr_ptrs);
987 if (pvt->host.h_name == NULL) {
992 pvt->host.h_name = bp;
995 if (pvt->res->options & RES_USE_INET6)
996 map_v4v6_hostent(&pvt->host, &bp, ep);
997 RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS);
998 return (&pvt->host);
1001 if (pvt->host.h_name == NULL) {
1007 strdup(pvt->host.h_name);
1020 RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
1022 RES_SET_H_ERRNO(pvt->res, error);
1027 add_hostent(struct pvt *pvt, char *bp, char **hap, struct addrinfo *ai)
1051 if (bp + addrlen > &pvt->hostbuf[sizeof(pvt->hostbuf) - 1])
1053 if (hap >= &pvt->h_addr_ptrs[MAXADDRS])
1056 for (tap = (const char **)pvt->h_addr_ptrs;
1135 struct pvt *pvt = (struct pvt *)this->private;
1137 if (!pvt->res && !ho_res_get(this))
1139 if (((pvt->res->options & RES_INIT) == 0U) &&
1140 res_ninit(pvt->res) == -1)