Lines Matching defs:statp

111 res_nquery(res_state statp,
123 oflags = statp->_flags;
128 if (statp->options & RES_DEBUG)
132 n = res_nmkquery(statp, QUERY, name, class, type, NULL, 0, NULL,
135 if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
136 (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) {
137 n = res_nopt(statp, n, buf, sizeof(buf), anslen);
138 if (n > 0 && (statp->options & RES_NSID) != 0U) {
140 n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata,
147 if (statp->options & RES_DEBUG)
150 RES_SET_H_ERRNO(statp, NO_RECOVERY);
154 n = res_nsend(statp, buf, n, answer, anslen);
158 if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U &&
159 ((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) {
160 statp->_flags |= RES_F_EDNS0ERR;
161 if (statp->options & RES_DEBUG)
167 if (statp->options & RES_DEBUG)
170 RES_SET_H_ERRNO(statp, TRY_AGAIN);
176 if (statp->options & RES_DEBUG)
185 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND);
188 RES_SET_H_ERRNO(statp, TRY_AGAIN);
191 RES_SET_H_ERRNO(statp, NO_DATA);
197 RES_SET_H_ERRNO(statp, NO_RECOVERY);
212 res_nsearch(res_state statp,
228 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND); /*%< True if we never query. */
237 if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL)
238 return (res_nquery(statp, cp, class, type, answer, anslen));
246 if (dots >= statp->ndots || trailing_dot) {
247 ret = res_nquerydomain(statp, name, NULL, class, type,
252 RES_SET_H_ERRNO(statp, TRY_AGAIN);
255 switch (statp->res_h_errno) {
266 saved_herrno = statp->res_h_errno;
276 if ((!dots && (statp->options & RES_DEFNAMES) != 0U) ||
277 (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0U)) {
280 for (domain = (const char * const *)statp->dnsrch;
292 ret = res_nquerydomain(statp, name, *domain,
312 RES_SET_H_ERRNO(statp, TRY_AGAIN);
316 switch (statp->res_h_errno) {
355 if ((statp->options & RES_DNSRCH) == 0U)
360 switch (statp->res_h_errno) {
376 if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0U) &&
378 ret = res_nquerydomain(statp, name, NULL, class, type,
393 RES_SET_H_ERRNO(statp, saved_herrno);
395 RES_SET_H_ERRNO(statp, NO_DATA);
397 RES_SET_H_ERRNO(statp, TRY_AGAIN);
406 res_nquerydomain(res_state statp,
418 if (statp->options & RES_DEBUG)
429 RES_SET_H_ERRNO(statp, NO_RECOVERY);
442 RES_SET_H_ERRNO(statp, NO_RECOVERY);
447 return (res_nquery(statp, longname, class, type, answer, anslen));
451 res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) {
456 if (statp->options & RES_NOALIASES)