Lines Matching refs:hp
211 const HEADER *hp; in getanswer() local
250 hp = &answer->hdr; in getanswer()
251 ancount = ntohs(hp->ancount); in getanswer()
252 qdcount = ntohs(hp->qdcount); in getanswer()
518 gethostbyname_r(const char *name, struct hostent *hp, char *buf, size_t buflen, in gethostbyname_r() argument
532 *result = gethostbyname_internal(name, AF_INET6, res, hp, buf, buflen, errorp, in gethostbyname_r()
539 *result = gethostbyname_internal(name, AF_INET, res, hp, buf, buflen, errorp, in gethostbyname_r()
551 gethostbyname2_r(const char *name, int af, struct hostent *hp, char *buf, in gethostbyname2_r() argument
561 *result = gethostbyname_internal(name, af, res, hp, buf, buflen, errorp, in gethostbyname2_r()
600 android_read_hostent(FILE* proxy, struct hostent* hp, char* hbuf, size_t hbuflen, int *he) in android_read_hostent() argument
618 memset(hp, 0, sizeof(*hp)); in android_read_hostent()
626 hp->h_name = ptr; in android_read_hostent()
653 int aliases_len = ((int)(aliases - aliases_ptrs) + 1) * sizeof(*hp->h_aliases); in android_read_hostent()
657 hp->h_aliases = (void*)ptr; in android_read_hostent()
662 hp->h_addrtype = ntohl(size); in android_read_hostent()
665 hp->h_length = ntohl(size); in android_read_hostent()
690 int addrs_len = ((int)(addr_p - addr_ptrs) + 1) * sizeof(*hp->h_addr_list); in android_read_hostent()
694 hp->h_addr_list = (void*)ptr; in android_read_hostent()
697 return hp; in android_read_hostent()
706 gethostbyname_internal_real(const char *name, int af, res_state res, struct hostent *hp, char *buf, in gethostbyname_internal_real() argument
737 hp->h_addrtype = af; in gethostbyname_internal_real()
738 hp->h_length = (int)size; in gethostbyname_internal_real()
786 info.hp = hp; in gethostbyname_internal_real()
794 return hp; in gethostbyname_internal_real()
800 HENT_ARRAY(hp->h_addr_list, 1, buf, buflen); in gethostbyname_internal_real()
801 HENT_ARRAY(hp->h_aliases, 0, buf, buflen); in gethostbyname_internal_real()
803 hp->h_aliases[0] = NULL; in gethostbyname_internal_real()
811 hp->h_addr_list[0] = buf; in gethostbyname_internal_real()
812 hp->h_addr_list[1] = NULL; in gethostbyname_internal_real()
815 HENT_SCOPY(hp->h_name, name, buf, buflen); in gethostbyname_internal_real()
817 map_v4v6_hostent(hp, &buf, buf + buflen); in gethostbyname_internal_real()
819 return hp; in gethostbyname_internal_real()
824 gethostbyname_internal(const char *name, int af, res_state res, struct hostent *hp, char *hbuf, in gethostbyname_internal() argument
831 return gethostbyname_internal_real(name, af, res, hp, hbuf, hbuflen, errorp); in gethostbyname_internal()
851 struct hostent* result = android_read_hostent(proxy, hp, hbuf, hbuflen, errorp); in gethostbyname_internal()
857 int gethostbyaddr_r(const void *addr, socklen_t len, int af, struct hostent *hp, char *buf, in gethostbyaddr_r() argument
861 addr, len, af, hp, buf, buflen, h_errnop, &NETCONTEXT_UNSET); in gethostbyaddr_r()
870 android_gethostbyaddrfornetcontext_real(const void *addr, socklen_t len, int af, struct hostent *hp, in android_gethostbyaddrfornetcontext_real() argument
918 info.hp = hp; in android_gethostbyaddrfornetcontext_real()
927 return hp; in android_gethostbyaddrfornetcontext_real()
932 struct hostent *hp, char *hbuf, size_t hbuflen, int *he, in android_gethostbyaddrfornetcontext_proxy_internal() argument
938 return android_gethostbyaddrfornetcontext_real(addr,len, af, hp, hbuf, hbuflen, he, netcontext); in android_gethostbyaddrfornetcontext_proxy_internal()
961 struct hostent *result = android_read_hostent(proxy, hp, hbuf, hbuflen, he); in android_gethostbyaddrfornetcontext_proxy_internal()
1102 map_v4v6_hostent(struct hostent *hp, char **bpp, char *ep) in map_v4v6_hostent() argument
1106 _DIAGASSERT(hp != NULL); in map_v4v6_hostent()
1110 if (hp->h_addrtype != AF_INET || hp->h_length != NS_INADDRSZ) in map_v4v6_hostent()
1112 hp->h_addrtype = AF_INET6; in map_v4v6_hostent()
1113 hp->h_length = NS_IN6ADDRSZ; in map_v4v6_hostent()
1114 for (ap = hp->h_addr_list; *ap; ap++) { in map_v4v6_hostent()
1157 char *hp; in addrsort() local
1163 hp = ap[j]; in addrsort()
1165 ap[j+1] = hp; in addrsort()
1179 struct hostent *hp; in _dns_gethtbyname() local
1188 info->hp->h_addrtype = va_arg(ap, int); in _dns_gethtbyname()
1190 switch (info->hp->h_addrtype) { in _dns_gethtbyname()
1192 info->hp->h_length = NS_INADDRSZ; in _dns_gethtbyname()
1196 info->hp->h_length = NS_IN6ADDRSZ; in _dns_gethtbyname()
1219 hp = getanswer(buf, n, name, type, res, info->hp, info->buf, in _dns_gethtbyname()
1223 if (hp == NULL) in _dns_gethtbyname()
1242 struct hostent *hp; in _dns_gethtbyaddr() local
1254 info->hp->h_length = va_arg(ap, int); in _dns_gethtbyaddr()
1255 info->hp->h_addrtype = va_arg(ap, int); in _dns_gethtbyaddr()
1258 switch (info->hp->h_addrtype) { in _dns_gethtbyaddr()
1306 hp = getanswer(buf, n, qbuf, T_PTR, res, info->hp, info->buf, in _dns_gethtbyaddr()
1309 if (hp == NULL) { in _dns_gethtbyaddr()
1321 bf = (void *)(hp->h_addr_list + 2); in _dns_gethtbyaddr()
1323 if (blen + info->hp->h_length > info->buflen) in _dns_gethtbyaddr()
1325 hp->h_addr_list[0] = bf; in _dns_gethtbyaddr()
1326 hp->h_addr_list[1] = NULL; in _dns_gethtbyaddr()
1327 (void)memcpy(bf, uaddr, (size_t)info->hp->h_length); in _dns_gethtbyaddr()
1328 if (info->hp->h_addrtype == AF_INET && (res->options & RES_USE_INET6)) { in _dns_gethtbyaddr()
1332 hp->h_addrtype = AF_INET6; in _dns_gethtbyaddr()
1333 hp->h_length = NS_IN6ADDRSZ; in _dns_gethtbyaddr()
1359 struct hostent *hp = info->hp; in _yp_hostent() local
1363 hp->h_name = NULL; in _yp_hostent()
1364 hp->h_addrtype = af; in _yp_hostent()
1367 hp->h_length = NS_INADDRSZ; in _yp_hostent()
1370 hp->h_length = NS_IN6ADDRSZ; in _yp_hostent()
1414 if (!hp->h_name) in _yp_hostent()
1415 hp->h_name = p; in _yp_hostent()
1416 else if (strcmp(hp->h_name, p) == 0) in _yp_hostent()
1440 if (hp->h_name == NULL) { in _yp_hostent()
1449 HENT_ARRAY(hp->h_addr_list, naddrs, ptr, len); in _yp_hostent()
1450 HENT_ARRAY(hp->h_aliases, anum, ptr, len); in _yp_hostent()
1453 HENT_COPY(hp->h_addr_list[i], &host_addrs[i], hp->h_length, in _yp_hostent()
1455 hp->h_addr_list[naddrs] = NULL; in _yp_hostent()
1457 HENT_SCOPY(hp->h_name, hp->h_name, ptr, len); in _yp_hostent()
1460 HENT_SCOPY(hp->h_aliases[i], aliases[i], ptr, len); in _yp_hostent()
1461 hp->h_aliases[anum] = NULL; in _yp_hostent()
1464 return hp; in _yp_hostent()
1476 struct hostent *hp = NULL; in _yp_gethtbyaddr() local
1513 hp = _yp_hostent(ypcurrent, af, info); in _yp_gethtbyaddr()
1515 hp = NULL; in _yp_gethtbyaddr()
1517 if (hp == NULL) { in _yp_gethtbyaddr()
1528 struct hostent *hp; in _yp_gethtbyname() local
1558 hp = _yp_hostent(ypcurrent, af, info); in _yp_gethtbyname()
1560 hp = NULL; in _yp_gethtbyname()
1562 if (hp == NULL) { in _yp_gethtbyname()
1620 struct hostent *hp; in android_gethostbynamefornetcontext() local
1625 hp = gethostbyname_internal(name, af, res, &rs->host, rs->hostbuf, sizeof(rs->hostbuf), in android_gethostbynamefornetcontext()
1628 return hp; in android_gethostbynamefornetcontext()