Lines Matching refs:res
93 #define maybe_ok(res, nm, ok) (((res)->options & RES_NOCHECKNAME) != 0U || \ argument
95 #define maybe_hnok(res, hn) maybe_ok((res), (hn), res_hnok) argument
96 #define maybe_dnok(res, dn) maybe_ok((res), (dn), res_dnok) argument
185 debugprintf(const char *msg, res_state res, ...) in debugprintf() argument
189 if (res->options & RES_DEBUG) { in debugprintf()
193 va_start (ap, res); in debugprintf()
201 # define debugprintf(msg, res, num) /*nada*/ argument
218 res_state res, struct hostent *hent, char *buf, size_t buflen, int *he) in getanswer() argument
270 if ((n < 0) || !maybe_ok(res, bp, name_ok)) in getanswer()
295 if ((n < 0) || !maybe_ok(res, bp, name_ok)) { in getanswer()
317 if ((n < 0) || !maybe_ok(res, tbuf, name_ok)) { in getanswer()
346 if (n < 0 || !maybe_dnok(res, tbuf)) { in getanswer()
382 if ((n < 0) || !maybe_hnok(res, bp)) { in getanswer()
405 if (res->options & RES_USE_INET6) { in getanswer()
448 debugprintf("size (%d) too big\n", res, n); in getanswer()
455 res, MAXADDRS); in getanswer()
480 if (res->nsort && haveanswer > 1 && qtype == T_A) in getanswer()
481 addrsort(addr_ptrs, haveanswer, res); in getanswer()
490 if (res->options & RES_USE_INET6) in getanswer()
530 res_state res = __res_get_state(); in gethostbyname_r() local
531 if (res == NULL) { in gethostbyname_r()
539 if (res->options & RES_USE_INET6) { in gethostbyname_r()
540 *result = gethostbyname_internal(name, AF_INET6, res, hp, buf, buflen, errorp, in gethostbyname_r()
543 __res_put_state(res); in gethostbyname_r()
547 *result = gethostbyname_internal(name, AF_INET, res, hp, buf, buflen, errorp, in gethostbyname_r()
557 res_state res = __res_get_state(); in gethostbyname2_r() local
558 if (res == NULL) { in gethostbyname2_r()
563 *result = gethostbyname_internal(name, af, res, hp, buf, buflen, errorp, in gethostbyname2_r()
675 gethostbyname_internal_real(const char *name, int af, res_state res, struct hostent *hp, char *buf, in gethostbyname_internal_real() argument
714 if (!strchr(name, '.') && (cp = res_hostalias(res, name, in gethostbyname_internal_real()
785 if (res->options & RES_USE_INET6) in gethostbyname_internal_real()
792 gethostbyname_internal(const char *name, int af, res_state res, struct hostent *hp, char *hbuf, in gethostbyname_internal() argument
798 res_setnetcontext(res, netcontext); in gethostbyname_internal()
799 return gethostbyname_internal_real(name, af, res, hp, hbuf, hbuflen, errorp); in gethostbyname_internal()
980 res_state res = __res_get_state(); in netbsd_gethostent_r() local
981 if (res == NULL) in netbsd_gethostent_r()
983 if (res->options & RES_USE_INET6) { in netbsd_gethostent_r()
991 __res_put_state(res); in netbsd_gethostent_r()
1093 addrsort(char **ap, int num, res_state res) in addrsort() argument
1104 for (j = 0 ; (unsigned)j < res->nsort; j++) in addrsort()
1105 if (res->sort_list[j].addr.s_addr == in addrsort()
1107 res->sort_list[j].mask)) in addrsort()
1143 res_state res; in _dns_gethtbyname() local
1169 res = __res_get_state(); in _dns_gethtbyname()
1170 if (res == NULL) { in _dns_gethtbyname()
1174 n = res_nsearch(res, name, C_IN, type, buf->buf, (int)sizeof(buf->buf)); in _dns_gethtbyname()
1177 debugprintf("res_nsearch failed (%d)\n", res, n); in _dns_gethtbyname()
1178 __res_put_state(res); in _dns_gethtbyname()
1181 hp = getanswer(buf, n, name, type, res, info->hp, info->buf, in _dns_gethtbyname()
1184 __res_put_state(res); in _dns_gethtbyname()
1207 res_state res; in _dns_gethtbyaddr() local
1255 res = __res_get_state(); in _dns_gethtbyaddr()
1256 if (res == NULL) { in _dns_gethtbyaddr()
1260 res_setnetcontext(res, netcontext); in _dns_gethtbyaddr()
1261 n = res_nquery(res, qbuf, C_IN, T_PTR, buf->buf, (int)sizeof(buf->buf)); in _dns_gethtbyaddr()
1264 debugprintf("res_nquery failed (%d)\n", res, n); in _dns_gethtbyaddr()
1265 __res_put_state(res); in _dns_gethtbyaddr()
1268 hp = getanswer(buf, n, qbuf, T_PTR, res, info->hp, info->buf, in _dns_gethtbyaddr()
1272 __res_put_state(res); in _dns_gethtbyaddr()
1290 if (info->hp->h_addrtype == AF_INET && (res->options & RES_USE_INET6)) { in _dns_gethtbyaddr()
1298 __res_put_state(res); in _dns_gethtbyaddr()
1583 res_state res = __res_get_state(); in android_gethostbynamefornetcontext() local
1584 if (res == NULL) in android_gethostbynamefornetcontext()
1587 hp = gethostbyname_internal(name, af, res, &rs->host, rs->hostbuf, sizeof(rs->hostbuf), in android_gethostbynamefornetcontext()
1589 __res_put_state(res); in android_gethostbynamefornetcontext()