Lines Matching refs:hp
220 const HEADER *hp; in getanswer() local
259 hp = &answer->hdr; in getanswer()
260 ancount = ntohs(hp->ancount); in getanswer()
261 qdcount = ntohs(hp->qdcount); in getanswer()
527 gethostbyname_r(const char *name, struct hostent *hp, char *buf, size_t buflen, in gethostbyname_r() argument
540 *result = gethostbyname_internal(name, AF_INET6, res, hp, buf, buflen, errorp, in gethostbyname_r()
547 *result = gethostbyname_internal(name, AF_INET, res, hp, buf, buflen, errorp, in gethostbyname_r()
554 gethostbyname2_r(const char *name, int af, struct hostent *hp, char *buf, in gethostbyname2_r() argument
563 *result = gethostbyname_internal(name, af, res, hp, buf, buflen, errorp, in gethostbyname2_r()
569 android_read_hostent(FILE* proxy, struct hostent* hp, char* hbuf, size_t hbuflen, int *he) in android_read_hostent() argument
587 memset(hp, 0, sizeof(*hp)); in android_read_hostent()
595 hp->h_name = ptr; in android_read_hostent()
622 int aliases_len = ((int)(aliases - aliases_ptrs) + 1) * sizeof(*hp->h_aliases); in android_read_hostent()
626 hp->h_aliases = (void*)ptr; in android_read_hostent()
631 hp->h_addrtype = ntohl(size); in android_read_hostent()
634 hp->h_length = ntohl(size); in android_read_hostent()
659 int addrs_len = ((int)(addr_p - addr_ptrs) + 1) * sizeof(*hp->h_addr_list); in android_read_hostent()
663 hp->h_addr_list = (void*)ptr; in android_read_hostent()
666 return hp; in android_read_hostent()
675 gethostbyname_internal_real(const char *name, int af, res_state res, struct hostent *hp, char *buf, in gethostbyname_internal_real() argument
706 hp->h_addrtype = af; in gethostbyname_internal_real()
707 hp->h_length = (int)size; in gethostbyname_internal_real()
755 info.hp = hp; in gethostbyname_internal_real()
763 return hp; in gethostbyname_internal_real()
769 HENT_ARRAY(hp->h_addr_list, 1, buf, buflen); in gethostbyname_internal_real()
770 HENT_ARRAY(hp->h_aliases, 0, buf, buflen); in gethostbyname_internal_real()
772 hp->h_aliases[0] = NULL; in gethostbyname_internal_real()
780 hp->h_addr_list[0] = buf; in gethostbyname_internal_real()
781 hp->h_addr_list[1] = NULL; in gethostbyname_internal_real()
784 HENT_SCOPY(hp->h_name, name, buf, buflen); in gethostbyname_internal_real()
786 map_v4v6_hostent(hp, &buf, buf + buflen); in gethostbyname_internal_real()
788 return hp; in gethostbyname_internal_real()
792 gethostbyname_internal(const char *name, int af, res_state res, struct hostent *hp, char *hbuf, in gethostbyname_internal() argument
799 return gethostbyname_internal_real(name, af, res, hp, hbuf, hbuflen, errorp); in gethostbyname_internal()
818 struct hostent* result = android_read_hostent(proxy, hp, hbuf, hbuflen, errorp); in gethostbyname_internal()
824 int gethostbyaddr_r(const void *addr, socklen_t len, int af, struct hostent *hp, char *buf, in gethostbyaddr_r() argument
828 addr, len, af, hp, buf, buflen, h_errnop, &NETCONTEXT_UNSET); in gethostbyaddr_r()
833 android_gethostbyaddrfornetcontext_real(const void *addr, socklen_t len, int af, struct hostent *hp, in android_gethostbyaddrfornetcontext_real() argument
881 info.hp = hp; in android_gethostbyaddrfornetcontext_real()
890 return hp; in android_gethostbyaddrfornetcontext_real()
895 struct hostent *hp, char *hbuf, size_t hbuflen, int *he, in android_gethostbyaddrfornetcontext_proxy_internal() argument
901 return android_gethostbyaddrfornetcontext_real(addr,len, af, hp, hbuf, hbuflen, he, netcontext); in android_gethostbyaddrfornetcontext_proxy_internal()
923 struct hostent *result = android_read_hostent(proxy, hp, hbuf, hbuflen, he); in android_gethostbyaddrfornetcontext_proxy_internal()
1064 map_v4v6_hostent(struct hostent *hp, char **bpp, char *ep) in map_v4v6_hostent() argument
1068 _DIAGASSERT(hp != NULL); in map_v4v6_hostent()
1072 if (hp->h_addrtype != AF_INET || hp->h_length != NS_INADDRSZ) in map_v4v6_hostent()
1074 hp->h_addrtype = AF_INET6; in map_v4v6_hostent()
1075 hp->h_length = NS_IN6ADDRSZ; in map_v4v6_hostent()
1076 for (ap = hp->h_addr_list; *ap; ap++) { in map_v4v6_hostent()
1119 char *hp; in addrsort() local
1125 hp = ap[j]; in addrsort()
1127 ap[j+1] = hp; in addrsort()
1141 struct hostent *hp; in _dns_gethtbyname() local
1150 info->hp->h_addrtype = va_arg(ap, int); in _dns_gethtbyname()
1152 switch (info->hp->h_addrtype) { in _dns_gethtbyname()
1154 info->hp->h_length = NS_INADDRSZ; in _dns_gethtbyname()
1158 info->hp->h_length = NS_IN6ADDRSZ; in _dns_gethtbyname()
1181 hp = getanswer(buf, n, name, type, res, info->hp, info->buf, in _dns_gethtbyname()
1185 if (hp == NULL) in _dns_gethtbyname()
1204 struct hostent *hp; in _dns_gethtbyaddr() local
1216 info->hp->h_length = va_arg(ap, int); in _dns_gethtbyaddr()
1217 info->hp->h_addrtype = va_arg(ap, int); in _dns_gethtbyaddr()
1220 switch (info->hp->h_addrtype) { in _dns_gethtbyaddr()
1268 hp = getanswer(buf, n, qbuf, T_PTR, res, info->hp, info->buf, in _dns_gethtbyaddr()
1271 if (hp == NULL) { in _dns_gethtbyaddr()
1283 bf = (void *)(hp->h_addr_list + 2); in _dns_gethtbyaddr()
1285 if (blen + info->hp->h_length > info->buflen) in _dns_gethtbyaddr()
1287 hp->h_addr_list[0] = bf; in _dns_gethtbyaddr()
1288 hp->h_addr_list[1] = NULL; in _dns_gethtbyaddr()
1289 (void)memcpy(bf, uaddr, (size_t)info->hp->h_length); in _dns_gethtbyaddr()
1290 if (info->hp->h_addrtype == AF_INET && (res->options & RES_USE_INET6)) { in _dns_gethtbyaddr()
1294 hp->h_addrtype = AF_INET6; in _dns_gethtbyaddr()
1295 hp->h_length = NS_IN6ADDRSZ; in _dns_gethtbyaddr()
1321 struct hostent *hp = info->hp; in _yp_hostent() local
1325 hp->h_name = NULL; in _yp_hostent()
1326 hp->h_addrtype = af; in _yp_hostent()
1329 hp->h_length = NS_INADDRSZ; in _yp_hostent()
1332 hp->h_length = NS_IN6ADDRSZ; in _yp_hostent()
1376 if (!hp->h_name) in _yp_hostent()
1377 hp->h_name = p; in _yp_hostent()
1378 else if (strcmp(hp->h_name, p) == 0) in _yp_hostent()
1402 if (hp->h_name == NULL) { in _yp_hostent()
1411 HENT_ARRAY(hp->h_addr_list, naddrs, ptr, len); in _yp_hostent()
1412 HENT_ARRAY(hp->h_aliases, anum, ptr, len); in _yp_hostent()
1415 HENT_COPY(hp->h_addr_list[i], &host_addrs[i], hp->h_length, in _yp_hostent()
1417 hp->h_addr_list[naddrs] = NULL; in _yp_hostent()
1419 HENT_SCOPY(hp->h_name, hp->h_name, ptr, len); in _yp_hostent()
1422 HENT_SCOPY(hp->h_aliases[i], aliases[i], ptr, len); in _yp_hostent()
1423 hp->h_aliases[anum] = NULL; in _yp_hostent()
1426 return hp; in _yp_hostent()
1438 struct hostent *hp = NULL; in _yp_gethtbyaddr() local
1475 hp = _yp_hostent(ypcurrent, af, info); in _yp_gethtbyaddr()
1477 hp = NULL; in _yp_gethtbyaddr()
1479 if (hp == NULL) { in _yp_gethtbyaddr()
1490 struct hostent *hp; in _yp_gethtbyname() local
1520 hp = _yp_hostent(ypcurrent, af, info); in _yp_gethtbyname()
1522 hp = NULL; in _yp_gethtbyname()
1524 if (hp == NULL) { in _yp_gethtbyname()
1582 struct hostent *hp; in android_gethostbynamefornetcontext() local
1587 hp = gethostbyname_internal(name, af, res, &rs->host, rs->hostbuf, sizeof(rs->hostbuf), in android_gethostbynamefornetcontext()
1590 return hp; in android_gethostbynamefornetcontext()