Home | History | Annotate | Download | only in net

Lines Matching refs:hp

204 	const HEADER *hp;
243 hp = &answer->hdr;
244 ancount = ntohs(hp->ancount);
245 qdcount = ntohs(hp->qdcount);
511 gethostbyname_r(const char *name, struct hostent *hp, char *buf, size_t buflen,
525 *result = gethostbyname_internal(name, AF_INET6, res, hp, buf, buflen, errorp, NETID_UNSET,
532 *result = gethostbyname_internal(name, AF_INET, res, hp, buf, buflen, errorp, NETID_UNSET,
544 gethostbyname2_r(const char *name, int af, struct hostent *hp, char *buf,
554 *result = gethostbyname_internal(name, af, res, hp, buf, buflen, errorp, NETID_UNSET,
593 android_read_hostent(FILE* proxy, struct hostent* hp, char* hbuf, size_t hbuflen, int *he)
611 memset(hphp));
619 hp->h_name = ptr;
646 int aliases_len = ((int)(aliases - aliases_ptrs) + 1) * sizeof(*hp->h_aliases);
650 hp->h_aliases = (void*)ptr;
655 hp->h_addrtype = ntohl(size);
658 hp->h_length = ntohl(size);
683 int addrs_len = ((int)(addr_p - addr_ptrs) + 1) * sizeof(*hp->h_addr_list);
687 hp->h_addr_list = (void*)ptr;
690 return hp;
699 gethostbyname_internal_real(const char *name, int af, res_state res, struct hostent *hp, char *buf,
730 hp->h_addrtype = af;
731 hp->h_length = (int)size;
779 info.hp = hp;
787 return hp;
793 HENT_ARRAY(hp->h_addr_list, 1, buf, buflen);
794 HENT_ARRAY(hp->h_aliases, 0, buf, buflen);
796 hp->h_aliases[0] = NULL;
804 hp->h_addr_list[0] = buf;
805 hp->h_addr_list[1] = NULL;
808 HENT_SCOPY(hp->h_name, name, buf, buflen);
810 map_v4v6_hostent(hp, &buf, buf + buflen);
812 return hp;
817 gethostbyname_internal(const char *name, int af, res_state res, struct hostent *hp, char *hbuf,
825 return gethostbyname_internal_real(name, af, res, hp, hbuf, hbuflen, errorp);
845 struct hostent* result = android_read_hostent(proxy, hp, hbuf, hbuflen, errorp);
851 int gethostbyaddr_r(const void *addr, socklen_t len, int af, struct hostent *hp, char *buf,
854 *result = android_gethostbyaddrfornet_proxy_internal(addr, len, af, hp, buf, buflen, h_errnop,
864 android_gethostbyaddrfornet_real(const void *addr, socklen_t len, int af, struct hostent *hp,
911 info.hp = hp;
920 return hp;
925 struct hostent *hp, char *hbuf, size_t hbuflen, int *he,
931 return android_gethostbyaddrfornet_real(addr,len, af, hp, hbuf, hbuflen, he, netid, mark);
954 struct hostent *result = android_read_hostent(proxy, hp, hbuf, hbuflen, he);
1095 map_v4v6_hostent(struct hostent *hp, char **bpp, char *ep)
1099 _DIAGASSERT(hp != NULL);
1103 if (hp->h_addrtype != AF_INET || hp->h_length != NS_INADDRSZ)
1105 hp->h_addrtype = AF_INET6;
1106 hp->h_length = NS_IN6ADDRSZ;
1107 for (ap = hp->h_addr_list; *ap; ap++) {
1150 char *hp;
1156 hp = ap[j];
1158 ap[j+1] = hp;
1172 struct hostent *hp;
1181 info->hp->h_addrtype = va_arg(ap, int);
1183 switch (info->hp->h_addrtype) {
1185 info->hp->h_length = NS_INADDRSZ;
1189 info->hp->h_length = NS_IN6ADDRSZ;
1212 hp = getanswer(buf, n, name, type, res, info->hp, info->buf,
1216 if (hp == NULL)
1235 struct hostent *hp;
1247 info->hp->h_length = va_arg(ap, int);
1248 info->hp->h_addrtype = va_arg(ap, int);
1252 switch (info->hp->h_addrtype) {
1301 hp = getanswer(buf, n, qbuf, T_PTR, res, info->hp, info->buf,
1304 if (hp == NULL) {
1316 bf = (void *)(hp->h_addr_list + 2);
1318 if (blen + info->hp->h_length > info->buflen)
1320 hp->h_addr_list[0] = bf;
1321 hp->h_addr_list[1] = NULL;
1322 (void)memcpy(bf, uaddr, (size_t)info->hp->h_length);
1323 if (info->hp->h_addrtype == AF_INET && (res->options & RES_USE_INET6)) {
1327 hp->h_addrtype = AF_INET6;
1328 hp->h_length = NS_IN6ADDRSZ;
1354 struct hostent *hp = info->hp;
1358 hp->h_name = NULL;
1359 hp->h_addrtype = af;
1362 hp->h_length = NS_INADDRSZ;
1365 hp->h_length = NS_IN6ADDRSZ;
1409 if (!hp->h_name)
1410 hp->h_name = p;
1411 else if (strcmp(hp->h_name, p) == 0)
1435 if (hp->h_name == NULL) {
1444 HENT_ARRAY(hp->h_addr_list, naddrs, ptr, len);
1445 HENT_ARRAY(hp->h_aliases, anum, ptr, len);
1448 HENT_COPY(hp->h_addr_list[i], &host_addrs[i], hp->h_length,
1450 hp->h_addr_list[naddrs] = NULL;
1452 HENT_SCOPY(hp->h_name, hp->h_name, ptr, len);
1455 HENT_SCOPY(hp->h_aliases[i], aliases[i], ptr, len);
1456 hp->h_aliases[anum] = NULL;
1459 return hp;
1471 struct hostent *hp = NULL;
1508 hp = _yp_hostent(ypcurrent, af, info);
1510 hp = NULL;
1512 if (hp == NULL) {
1523 struct hostent *hp;
1553 hp = _yp_hostent(ypcurrent, af, info);
1555 hp = NULL;
1557 if (hp == NULL) {
1592 struct hostent *hp;
1597 hp = gethostbyname_internal(name, af, res, &rs->host, rs->hostbuf, sizeof(rs->hostbuf),
1600 return hp;