Lines Matching full:statp
127 res_nquery(res_state statp,
138 oflags = statp->_flags;
144 if (statp->options & RES_DEBUG)
148 n = res_nmkquery(statp, QUERY, name, class, type, NULL, 0, NULL,
151 if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
152 (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U)
153 n = res_nopt(statp, n, buf, sizeof(buf), anslen);
157 if (statp->options & RES_DEBUG)
160 RES_SET_H_ERRNO(statp, NO_RECOVERY);
163 n = res_nsend(statp, buf, n, answer, anslen);
167 if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U &&
168 ((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) {
169 statp->_flags |= RES_F_EDNS0ERR;
170 if (statp->options & RES_DEBUG)
176 if (statp->options & RES_DEBUG)
179 RES_SET_H_ERRNO(statp, TRY_AGAIN);
185 if (statp->options & RES_DEBUG)
194 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND);
197 RES_SET_H_ERRNO(statp, TRY_AGAIN);
200 RES_SET_H_ERRNO(statp, NO_DATA);
206 RES_SET_H_ERRNO(statp, NO_RECOVERY);
221 res_nsearch(res_state statp,
237 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND); /* True if we never query. */
247 if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL)
248 return (res_nquery(statp, cp, class, type, answer, anslen));
256 if (dots >= statp->ndots || trailing_dot) {
257 ret = res_nquerydomain(statp, name, NULL, class, type,
261 saved_herrno = statp->res_h_errno;
271 if ((!dots && (statp->options & RES_DEFNAMES) != 0U) ||
272 (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0U)) {
275 for (domain = (const char * const *)statp->dnsrch;
284 ret = res_nquerydomain(statp, name, *domain,
304 RES_SET_H_ERRNO(statp, TRY_AGAIN);
308 switch (statp->res_h_errno) {
330 if ((statp->options & RES_DNSRCH) == 0U)
339 if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0U) &&
341 ret = res_nquerydomain(statp, name, NULL, class, type,
355 RES_SET_H_ERRNO(statp, saved_herrno);
357 RES_SET_H_ERRNO(statp, NO_DATA);
359 RES_SET_H_ERRNO(statp, TRY_AGAIN);
368 res_nquerydomain(res_state statp,
380 if (statp->options & RES_DEBUG)
391 RES_SET_H_ERRNO(statp, NO_RECOVERY);
404 RES_SET_H_ERRNO(statp, NO_RECOVERY);
409 return (res_nquery(statp, longname, class, type, answer, anslen));
413 res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) {