Lines Matching defs:statp
145 res_nquery(res_state statp,
156 oflags = statp->_flags;
161 if (statp->options & RES_DEBUG)
165 n = res_nmkquery(statp, QUERY, name, class, type, NULL, 0, NULL,
168 if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
169 (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID)) != 0U) {
170 n = res_nopt(statp, n, buf, (int)sizeof(buf), anslen);
171 if (n > 0 && (statp->options & RES_NSID) != 0U) {
172 n = res_nopt_rdata(statp, n, buf, (int)sizeof(buf),
179 if (statp->options & RES_DEBUG)
182 RES_SET_H_ERRNO(statp, NO_RECOVERY);
186 n = res_nsend(statp, buf, n, answer, anslen);
190 if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U &&
191 ((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) {
192 statp->_flags |= RES_F_EDNS0ERR;
193 if (statp->options & RES_DEBUG)
199 if (statp->options & RES_DEBUG)
202 RES_SET_H_ERRNO(statp, TRY_AGAIN);
208 if (statp->options & RES_DEBUG)
217 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND);
220 RES_SET_H_ERRNO(statp, TRY_AGAIN);
223 RES_SET_H_ERRNO(statp, NO_DATA);
229 RES_SET_H_ERRNO(statp, NO_RECOVERY);
244 res_nsearch(res_state statp,
260 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND); /*%< True if we never query. */
269 if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL)
270 return (res_nquery(statp, cp, class, type, answer, anslen));
278 if (dots >= statp->ndots || trailing_dot) {
279 ret = res_nquerydomain(statp, name, NULL, class, type,
283 saved_herrno = statp->res_h_errno;
293 if ((!dots && (statp->options & RES_DEFNAMES) != 0U) ||
294 (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0U)) {
297 for (domain = (const char * const *)statp->dnsrch;
306 ret = res_nquerydomain(statp, name, *domain,
326 RES_SET_H_ERRNO(statp, TRY_AGAIN);
330 switch (statp->res_h_errno) {
352 if ((statp->options & RES_DNSRCH) == 0U)
361 if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0U) &&
363 ret = res_nquerydomain(statp, name, NULL, class, type,
377 RES_SET_H_ERRNO(statp, saved_herrno);
379 RES_SET_H_ERRNO(statp, NO_DATA);
381 RES_SET_H_ERRNO(statp, TRY_AGAIN);
390 res_nquerydomain(res_state statp,
402 if (statp->options & RES_DEBUG)
413 RES_SET_H_ERRNO(statp, NO_RECOVERY);
423 RES_SET_H_ERRNO(statp, NO_RECOVERY);
427 return (res_nquery(statp, longname, class, type, answer, anslen));
431 res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) {
436 if (statp->options & RES_NOALIASES)