Lines Matching refs:statp

128 res_nquery(res_state statp,  in res_nquery()  argument
139 oflags = statp->_flags; in res_nquery()
145 if (statp->options & RES_DEBUG) in res_nquery()
149 n = res_nmkquery(statp, QUERY, name, class, type, NULL, 0, NULL, in res_nquery()
152 if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 && in res_nquery()
153 (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U) in res_nquery()
154 n = res_nopt(statp, n, buf, sizeof(buf), anslen); in res_nquery()
158 if (statp->options & RES_DEBUG) in res_nquery()
161 RES_SET_H_ERRNO(statp, NO_RECOVERY); in res_nquery()
164 n = res_nsend(statp, buf, n, answer, anslen); in res_nquery()
168 if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U && in res_nquery()
169 ((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) { in res_nquery()
170 statp->_flags |= RES_F_EDNS0ERR; in res_nquery()
171 if (statp->options & RES_DEBUG) in res_nquery()
177 if (statp->options & RES_DEBUG) in res_nquery()
180 RES_SET_H_ERRNO(statp, TRY_AGAIN); in res_nquery()
186 if (statp->options & RES_DEBUG) in res_nquery()
195 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND); in res_nquery()
198 RES_SET_H_ERRNO(statp, TRY_AGAIN); in res_nquery()
201 RES_SET_H_ERRNO(statp, NO_DATA); in res_nquery()
207 RES_SET_H_ERRNO(statp, NO_RECOVERY); in res_nquery()
222 res_nsearch(res_state statp, in res_nsearch() argument
238 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND); /* True if we never query. */ in res_nsearch()
248 if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL) in res_nsearch()
249 return (res_nquery(statp, cp, class, type, answer, anslen)); in res_nsearch()
257 if (dots >= statp->ndots || trailing_dot) { in res_nsearch()
258 ret = res_nquerydomain(statp, name, NULL, class, type, in res_nsearch()
262 saved_herrno = statp->res_h_errno; in res_nsearch()
272 if ((!dots && (statp->options & RES_DEFNAMES) != 0U) || in res_nsearch()
273 (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0U)) { in res_nsearch()
283 _resolv_populate_res_for_net(statp); in res_nsearch()
285 for (domain = (const char * const *)statp->dnsrch; in res_nsearch()
294 ret = res_nquerydomain(statp, name, *domain, in res_nsearch()
314 RES_SET_H_ERRNO(statp, TRY_AGAIN); in res_nsearch()
318 switch (statp->res_h_errno) { in res_nsearch()
340 if ((statp->options & RES_DNSRCH) == 0U) in res_nsearch()
349 if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0U) && in res_nsearch()
351 ret = res_nquerydomain(statp, name, NULL, class, type, in res_nsearch()
365 RES_SET_H_ERRNO(statp, saved_herrno); in res_nsearch()
367 RES_SET_H_ERRNO(statp, NO_DATA); in res_nsearch()
369 RES_SET_H_ERRNO(statp, TRY_AGAIN); in res_nsearch()
378 res_nquerydomain(res_state statp, in res_nquerydomain() argument
390 if (statp->options & RES_DEBUG) in res_nquerydomain()
401 RES_SET_H_ERRNO(statp, NO_RECOVERY); in res_nquerydomain()
414 RES_SET_H_ERRNO(statp, NO_RECOVERY); in res_nquerydomain()
419 return (res_nquery(statp, longname, class, type, answer, anslen)); in res_nquerydomain()
423 res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) { in res_hostalias() argument