Lines Matching refs:n

132     int n;  in getanswer()  local
177 n = dn_expand(answer->buf, eom, cp, bp, (int) (ep - bp)); in getanswer()
178 if ((n < 0) || !name_ok(bp)) goto no_recovery; in getanswer()
180 BOUNDED_INCR(n + QFIXEDSZ); in getanswer()
186 n = (int) strlen(bp) + 1; /* for the \0 */ in getanswer()
187 if (n >= MAXHOSTNAMELEN) goto no_recovery; in getanswer()
189 bp += n; in getanswer()
198 n = dn_expand(answer->buf, eom, cp, bp, (int) (ep - bp)); in getanswer()
199 if ((n < 0) || !name_ok(bp)) { in getanswer()
203 cp += n; /* name */ in getanswer()
209 n = ntohs(*reinterpret_cast<const uint16_t*>(cp)); in getanswer()
211 BOUNDS_CHECK(cp, n); in getanswer()
212 erdata = cp + n; in getanswer()
215 cp += n; in getanswer()
219 n = dn_expand(answer->buf, eom, cp, tbuf, (int) sizeof tbuf); in getanswer()
220 if ((n < 0) || !name_ok(tbuf)) { in getanswer()
224 cp += n; in getanswer()
228 n = (int) strlen(bp) + 1; /* for the \0 */ in getanswer()
229 if (n >= MAXHOSTNAMELEN) { in getanswer()
233 bp += n; in getanswer()
235 n = (int) strlen(tbuf) + 1; /* for the \0 */ in getanswer()
236 if (n > ep - bp || n >= MAXHOSTNAMELEN) { in getanswer()
242 bp += n; in getanswer()
246 n = dn_expand(answer->buf, eom, cp, tbuf, (int) sizeof tbuf); in getanswer()
247 if (n < 0 || !res_dnok(tbuf)) { in getanswer()
251 cp += n; in getanswer()
254 n = (int) strlen(tbuf) + 1; /* for the \0 */ in getanswer()
255 if (n > ep - bp || n >= MAXHOSTNAMELEN) { in getanswer()
261 bp += n; in getanswer()
268 cp += n; in getanswer()
276 cp += n; in getanswer()
279 n = dn_expand(answer->buf, eom, cp, bp, (int) (ep - bp)); in getanswer()
280 if ((n < 0) || !res_hnok(bp)) { in getanswer()
284 cp += n; in getanswer()
290 if (n != -1) { in getanswer()
291 n = (int) strlen(bp) + 1; /* for the \0 */ in getanswer()
292 if (n >= MAXHOSTNAMELEN) { in getanswer()
296 bp += n; in getanswer()
304 cp += n; in getanswer()
307 if (n != hent->h_length) { in getanswer()
308 cp += n; in getanswer()
315 cp += n; in getanswer()
329 if (bp + n >= ep) { in getanswer()
330 LOG(DEBUG) << __func__ << ": size (" << n << ") too big"; in getanswer()
338 cp += n; in getanswer()
341 (void) memcpy(*hap++ = bp, cp, (size_t) n); in getanswer()
342 bp += n; in getanswer()
343 cp += n; in getanswer()
354 n = (int) strlen(qname) + 1; /* for the \0 */ in getanswer()
355 if (n > ep - bp || n >= MAXHOSTNAMELEN) goto no_recovery; in getanswer()
358 bp += n; in getanswer()
375 n = (int) (hap - addr_ptrs); in getanswer()
376 qlen = (n + 1) * sizeof(*hent->h_addr_list); in getanswer()
652 int n, type; in dns_gethtbyname() local
670 n = res_nsearch(res, name, C_IN, type, buf->buf, (int)sizeof(buf->buf), &he); in dns_gethtbyname()
671 if (n < 0) { in dns_gethtbyname()
672 LOG(DEBUG) << __func__ << ": res_nsearch failed (" << n << ")"; in dns_gethtbyname()
678 hostent* hp = getanswer(buf.get(), n, name, type, info->hp, info->buf, info->buflen, &he); in dns_gethtbyname()
688 int n; in dns_gethtbyaddr() local
703 for (n = NS_IN6ADDRSZ - 1; n >= 0; n--) { in dns_gethtbyaddr()
704 advance = snprintf(qp, (size_t)(ep - qp), "%x.%x.", uaddr[n] & 0xf, in dns_gethtbyaddr()
705 ((unsigned int) uaddr[n] >> 4) & 0xf); in dns_gethtbyaddr()
733 n = res_nquery(&res, qbuf, C_IN, T_PTR, buf->buf, (int)sizeof(buf->buf), &he); in dns_gethtbyaddr()
734 if (n < 0) { in dns_gethtbyaddr()
735 LOG(DEBUG) << __func__ << ": res_nquery failed (" << n << ")"; in dns_gethtbyaddr()
741 hostent* hp = getanswer(buf.get(), n, qbuf, T_PTR, info->hp, info->buf, info->buflen, &he); in dns_gethtbyaddr()