Lines Matching refs:statp

109 res_nquery(res_state statp,
121 oflags = statp->_flags;
126 if (statp->options & RES_DEBUG)
130 n = res_nmkquery(statp, QUERY, name, class, type, NULL, 0, NULL,
133 if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
134 (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID)) != 0U) {
135 n = res_nopt(statp, n, buf, (int)sizeof(buf), anslen);
137 if (n > 0 && (statp->options & RES_NSID) != 0U) {
138 n = res_nopt_rdata(statp, n, buf, (int)sizeof(buf),
145 if (statp->options & RES_DEBUG)
148 RES_SET_H_ERRNO(statp, NO_RECOVERY);
152 n = res_nsend(statp, buf, n, answer, anslen);
156 if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U &&
157 ((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) {
158 statp->_flags |= RES_F_EDNS0ERR;
159 if (statp->options & RES_DEBUG)
165 if (statp->options & RES_DEBUG)
168 RES_SET_H_ERRNO(statp, TRY_AGAIN);
174 if (statp->options & RES_DEBUG)
183 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND);
186 RES_SET_H_ERRNO(statp, TRY_AGAIN);
189 RES_SET_H_ERRNO(statp, NO_DATA);
195 RES_SET_H_ERRNO(statp, NO_RECOVERY);
210 res_nsearch(res_state statp,
226 RES_SET_H_ERRNO(statp, HOST_NOT_FOUND); /*%< True if we never query. */
235 if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL)
236 return (res_nquery(statp, cp, class, type, answer, anslen));
244 if (dots >= statp->ndots || trailing_dot) {
245 ret = res_nquerydomain(statp, name, NULL, class, type,
249 saved_herrno = statp->res_h_errno;
259 if ((!dots && (statp->options & RES_DEFNAMES) != 0U) ||
260 (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0U)) {
263 for (domain = (const char * const *)statp->dnsrch;
272 ret = res_nquerydomain(statp, name, *domain,
292 RES_SET_H_ERRNO(statp, TRY_AGAIN);
296 switch (statp->res_h_errno) {
318 if ((statp->options & RES_DNSRCH) == 0U)
327 if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0U) &&
329 ret = res_nquerydomain(statp, name, NULL, class, type,
343 RES_SET_H_ERRNO(statp, saved_herrno);
345 RES_SET_H_ERRNO(statp, NO_DATA);
347 RES_SET_H_ERRNO(statp, TRY_AGAIN);
356 res_nquerydomain(res_state statp,
368 if (statp->options & RES_DEBUG)
379 RES_SET_H_ERRNO(statp, NO_RECOVERY);
391 RES_SET_H_ERRNO(statp, NO_RECOVERY);
396 return (res_nquery(statp, longname, class, type, answer, anslen));
400 res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) {
405 if (statp->options & RES_NOALIASES)