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