• Home
  • Raw
  • Download

Lines Matching refs:rs

186 	res_static  rs = __res_get_static();  in getanswer()  local
192 rs->host.h_name = NULL; in getanswer()
211 bp = rs->hostbuf; in getanswer()
212 ep = rs->hostbuf + sizeof rs->hostbuf; in getanswer()
235 rs->host.h_name = bp; in getanswer()
238 qname = rs->host.h_name; in getanswer()
240 ap = rs->host_aliases; in getanswer()
242 rs->host.h_aliases = rs->host_aliases; in getanswer()
243 hap = rs->h_addr_ptrs; in getanswer()
245 rs->host.h_addr_list = rs->h_addr_ptrs; in getanswer()
270 if (ap >= &rs->host_aliases[MAXALIASES-1]) in getanswer()
297 rs->host.h_name = bp; in getanswer()
352 rs->host.h_name = bp; in getanswer()
353 else if (ap < &rs->host_aliases[MAXALIASES-1]) in getanswer()
367 rs->host.h_name = bp; in getanswer()
375 map_v4v6_hostent(&rs->host, &bp, ep); in getanswer()
378 return &rs->host; in getanswer()
382 if (strcasecmp(rs->host.h_name, bp) != 0) { in getanswer()
384 AskedForGot, rs->host.h_name, bp); in getanswer()
388 if (n != rs->host.h_length) { in getanswer()
403 rs->host.h_name = bp; in getanswer()
411 if (bp + n >= &rs->hostbuf[sizeof rs->hostbuf]) { in getanswer()
416 if (hap >= &rs->h_addr_ptrs[MAXADDRS-1]) { in getanswer()
446 addrsort(rs->h_addr_ptrs, haveanswer, res); in getanswer()
447 if (!rs->host.h_name) { in getanswer()
452 rs->host.h_name = bp; in getanswer()
456 map_v4v6_hostent(&rs->host, &bp, ep); in getanswer()
458 return &rs->host; in getanswer()
526 res_static rs = __res_get_static(); in gethostbyname_internal() local
549 rs->host.h_addrtype = af; in gethostbyname_internal()
550 rs->host.h_length = size; in gethostbyname_internal()
575 (char *)(void *)rs->host_addr) <= 0) { in gethostbyname_internal()
579 strncpy(rs->hostbuf, name, MAXDNAME); in gethostbyname_internal()
580 rs->hostbuf[MAXDNAME] = '\0'; in gethostbyname_internal()
581 bp = rs->hostbuf + MAXDNAME; in gethostbyname_internal()
582 ep = rs->hostbuf + sizeof rs->hostbuf; in gethostbyname_internal()
583 rs->host.h_name = rs->hostbuf; in gethostbyname_internal()
584 rs->host.h_aliases = rs->host_aliases; in gethostbyname_internal()
585 rs->host_aliases[0] = NULL; in gethostbyname_internal()
586 rs->h_addr_ptrs[0] = (char *)(void *)rs->host_addr; in gethostbyname_internal()
587 rs->h_addr_ptrs[1] = NULL; in gethostbyname_internal()
588 rs->host.h_addr_list = rs->h_addr_ptrs; in gethostbyname_internal()
590 map_v4v6_hostent(&rs->host, &bp, ep); in gethostbyname_internal()
592 return &rs->host; in gethostbyname_internal()
609 (char *)(void *)rs->host_addr) <= 0) { in gethostbyname_internal()
613 strncpy(rs->hostbuf, name, MAXDNAME); in gethostbyname_internal()
614 rs->hostbuf[MAXDNAME] = '\0'; in gethostbyname_internal()
615 bp = rs->hostbuf + MAXDNAME; in gethostbyname_internal()
616 ep = rs->hostbuf + sizeof rs->hostbuf; in gethostbyname_internal()
617 rs->host.h_name = rs->hostbuf; in gethostbyname_internal()
618 rs->host.h_aliases = rs->host_aliases; in gethostbyname_internal()
619 rs->host_aliases[0] = NULL; in gethostbyname_internal()
620 rs->h_addr_ptrs[0] = (char *)(void *)rs->host_addr; in gethostbyname_internal()
621 rs->h_addr_ptrs[1] = NULL; in gethostbyname_internal()
622 rs->host.h_addr_list = rs->h_addr_ptrs; in gethostbyname_internal()
624 return &rs->host; in gethostbyname_internal()
699 res_static rs = __res_get_static(); in _sethtent() local
700 if (rs == NULL) return; in _sethtent()
701 if (!rs->hostf) in _sethtent()
702 rs->hostf = fopen(_PATH_HOSTS, "r" ); in _sethtent()
704 rewind(rs->hostf); in _sethtent()
705 rs->stayopen = f; in _sethtent()
711 res_static rs = __res_get_static(); in _endhtent() local
712 if (rs == NULL) return; in _endhtent()
714 if (rs->hostf && !rs->stayopen) { in _endhtent()
715 (void) fclose(rs->hostf); in _endhtent()
716 rs->hostf = NULL; in _endhtent()
726 res_static rs = __res_get_static(); in _gethtent() local
728 if (!rs->hostf && !(rs->hostf = fopen(_PATH_HOSTS, "r" ))) { in _gethtent()
733 if (!(p = fgets(rs->hostbuf, sizeof rs->hostbuf, rs->hostf))) { in _gethtent()
745 if (inet_pton(AF_INET6, p, (char *)(void *)rs->host_addr) > 0) { in _gethtent()
748 } else if (inet_pton(AF_INET, p, (char *)(void *)rs->host_addr) > 0) { in _gethtent()
753 map_v4v6_address((char *)(void *)rs->host_addr, in _gethtent()
754 (char *)(void *)rs->host_addr); in _gethtent()
766 if (rs->host.h_addrtype != 0 && rs->host.h_addrtype != af) in _gethtent()
768 if (rs->host.h_length != 0 && rs->host.h_length != len) in _gethtent()
770 rs->h_addr_ptrs[0] = (char *)(void *)rs->host_addr; in _gethtent()
771 rs->h_addr_ptrs[1] = NULL; in _gethtent()
772 rs->host.h_addr_list = rs->h_addr_ptrs; in _gethtent()
773 rs->host.h_length = len; in _gethtent()
774 rs->host.h_addrtype = af; in _gethtent()
777 rs->host.h_name = cp; in _gethtent()
778 q = rs->host.h_aliases = rs->host_aliases; in _gethtent()
786 if (q < &rs->host_aliases[MAXALIASES - 1]) in _gethtent()
793 return &rs->host; in _gethtent()
840 res_static rs = __res_get_static(); in _gethtbyname2() local
844 _sethtent(rs->stayopen); in _gethtbyname2()
892 if (len > (sizeof(rs->hostbuf) - ALIGNBYTES)) { in _gethtbyname2()
898 ptr = memcpy((void *)ALIGN(rs->hostbuf), tmpbuf, len); in _gethtbyname2()
901 rs->host.h_name = ptr; in _gethtbyname2()
904 cp = rs->host_aliases; in _gethtbyname2()
913 cp = rs->h_addr_ptrs; in _gethtbyname2()
916 ptr += rs->host.h_length; in _gethtbyname2()
920 return &rs->host; in _gethtbyname2()
930 res_static rs = __res_get_static(); in _gethtbyaddr() local
938 rs->host.h_length = len; in _gethtbyaddr()
939 rs->host.h_addrtype = af; in _gethtbyaddr()
941 _sethtent(rs->stayopen); in _gethtbyaddr()
1050 res_static rs = __res_get_static(); in gethostent() local
1051 rs->host.h_addrtype = 0; in gethostent()
1052 rs->host.h_length = 0; in gethostent()
1127 res_static rs = __res_get_static(); in _dns_gethtbyaddr() local
1197 (void)memcpy(rs->host_addr, uaddr, (size_t)len); in _dns_gethtbyaddr()
1198 rs->h_addr_ptrs[0] = (char *)(void *)rs->host_addr; in _dns_gethtbyaddr()
1199 rs->h_addr_ptrs[1] = NULL; in _dns_gethtbyaddr()
1201 map_v4v6_address((char *)(void *)rs->host_addr, in _dns_gethtbyaddr()
1202 (char *)(void *)rs->host_addr); in _dns_gethtbyaddr()