• Home
  • Raw
  • Download

Lines Matching refs:hp

110 static void convert_v4v6_hostent(struct hostent* hp, char** bpp, char* ep,
111 std::function<void(struct hostent* hp)> mapping_param,
115 static void pad_v4v6_hostent(struct hostent* hp, char** bpp, char* ep);
122 static int gethostbyname_internal(const char* name, int af, res_state res, hostent* hp, char* hbuf,
124 static int gethostbyname_internal_real(const char* name, int af, res_state res, hostent* hp,
131 hostent** hp);
147 const HEADER* hp; in getanswer() local
184 hp = &answer->hdr; in getanswer()
185 ancount = ntohs(hp->ancount); in getanswer()
186 qdcount = ntohs(hp->qdcount); in getanswer()
411 static int gethostbyname_internal_real(const char* name, int af, res_state res, hostent* hp, in gethostbyname_internal_real() argument
430 hp->h_addrtype = af; in gethostbyname_internal_real()
431 hp->h_length = (int) size; in gethostbyname_internal_real()
466 info.hp = hp; in gethostbyname_internal_real()
477 HENT_ARRAY(hp->h_addr_list, 1, buf, buflen); in gethostbyname_internal_real()
478 HENT_ARRAY(hp->h_aliases, 0, buf, buflen); in gethostbyname_internal_real()
480 hp->h_aliases[0] = NULL; in gethostbyname_internal_real()
486 hp->h_addr_list[0] = buf; in gethostbyname_internal_real()
487 hp->h_addr_list[1] = NULL; in gethostbyname_internal_real()
490 HENT_SCOPY(hp->h_name, name, buf, buflen); in gethostbyname_internal_real()
491 if (res->options & RES_USE_INET6) map_v4v6_hostent(hp, &buf, buf + buflen); in gethostbyname_internal_real()
496 static int gethostbyname_internal(const char* name, int af, res_state res, hostent* hp, char* hbuf, in gethostbyname_internal() argument
499 return gethostbyname_internal_real(name, af, res, hp, hbuf, hbuflen); in gethostbyname_internal()
503 struct hostent* hp, char* buf, size_t buflen, in android_gethostbyaddrfornetcontext_real() argument
542 info.hp = hp; in android_gethostbyaddrfornetcontext_real()
553 const void* addr, socklen_t len, int af, struct hostent* hp, char* hbuf, size_t hbuflen, in android_gethostbyaddrfornetcontext_proxy_internal() argument
555 return android_gethostbyaddrfornetcontext_real(addr, len, af, hp, hbuf, hbuflen, netcontext); in android_gethostbyaddrfornetcontext_proxy_internal()
678 static void convert_v4v6_hostent(struct hostent* hp, char** bpp, char* ep, in convert_v4v6_hostent() argument
679 std::function<void(struct hostent* hp)> map_param, in convert_v4v6_hostent()
681 _DIAGASSERT(hp != NULL); in convert_v4v6_hostent()
685 if (hp->h_addrtype != AF_INET || hp->h_length != NS_INADDRSZ) return; in convert_v4v6_hostent()
686 map_param(hp); in convert_v4v6_hostent()
687 for (char** ap = hp->h_addr_list; *ap; ap++) { in convert_v4v6_hostent()
702 static void map_v4v6_hostent(struct hostent* hp, char** bpp, char* ep) { in map_v4v6_hostent() argument
703 convert_v4v6_hostent(hp, bpp, ep, in map_v4v6_hostent()
704 [](struct hostent* hp) { in map_v4v6_hostent() argument
705 hp->h_addrtype = AF_INET6; in map_v4v6_hostent()
706 hp->h_length = NS_IN6ADDRSZ; in map_v4v6_hostent()
712 static void pad_v4v6_hostent(struct hostent* hp, char** bpp, char* ep) { in pad_v4v6_hostent() argument
713 convert_v4v6_hostent(hp, bpp, ep, in pad_v4v6_hostent()
714 [](struct hostent* hp) { in pad_v4v6_hostent() argument
715 (void) hp; /* unused */ in pad_v4v6_hostent()
745 char* hp; in addrsort() local
751 hp = ap[j]; in addrsort()
753 ap[j + 1] = hp; in addrsort()
763 info->hp->h_addrtype = addr_type; in dns_gethtbyname()
765 switch (info->hp->h_addrtype) { in dns_gethtbyname()
767 info->hp->h_length = NS_INADDRSZ; in dns_gethtbyname()
771 info->hp->h_length = NS_IN6ADDRSZ; in dns_gethtbyname()
791 hostent* hp = getanswer(buf.get(), n, name, type, res, info->hp, info->buf, info->buflen, &he); in dns_gethtbyname() local
792 if (hp == NULL) return herrnoToAiErrno(he); in dns_gethtbyname()
803 info->hp->h_length = len; in dns_gethtbyaddr()
804 info->hp->h_addrtype = af; in dns_gethtbyaddr()
806 switch (info->hp->h_addrtype) { in dns_gethtbyaddr()
855 hostent* hp = getanswer(buf.get(), n, qbuf, T_PTR, res, info->hp, info->buf, info->buflen, &he); in dns_gethtbyaddr() local
856 if (hp == NULL) return herrnoToAiErrno(he); in dns_gethtbyaddr()
858 char* bf = (char*) (hp->h_addr_list + 2); in dns_gethtbyaddr()
860 if (blen + info->hp->h_length > info->buflen) goto nospc; in dns_gethtbyaddr()
861 hp->h_addr_list[0] = bf; in dns_gethtbyaddr()
862 hp->h_addr_list[1] = NULL; in dns_gethtbyaddr()
863 memcpy(bf, uaddr, (size_t) info->hp->h_length); in dns_gethtbyaddr()
864 if (info->hp->h_addrtype == AF_INET && (res->options & RES_USE_INET6)) { in dns_gethtbyaddr()
867 hp->h_addrtype = AF_INET6; in dns_gethtbyaddr()
868 hp->h_length = NS_IN6ADDRSZ; in dns_gethtbyaddr()
872 if (info->hp->h_addrtype == AF_INET) { in dns_gethtbyaddr()
889 const struct android_net_context* netcontext, hostent** hp) { in android_gethostbynamefornetcontext() argument
897 *hp = &rs->host; in android_gethostbynamefornetcontext()
903 const struct android_net_context* netcontext, hostent** hp) { in android_gethostbyaddrfornetcontext() argument
904 return android_gethostbyaddrfornetcontext_proxy(addr, len, af, netcontext, hp); in android_gethostbyaddrfornetcontext()
909 hostent** hp) { in android_gethostbyaddrfornetcontext_proxy() argument
913 if (error == 0) *hp = &rs->host; in android_gethostbyaddrfornetcontext_proxy()