Lines Matching refs:buf
149 static int send_vc(res_state statp, res_params* params, const uint8_t* buf, int buflen,
152 static int send_dg(res_state statp, res_params* params, const uint8_t* buf, int buflen,
349 int res_nameinquery(const char* name, int type, int cl, const uint8_t* buf, const uint8_t* eom) { in res_nameinquery() argument
350 const uint8_t* cp = buf + HFIXEDSZ; in res_nameinquery()
351 int qdcount = ntohs(((const HEADER*) (const void*) buf)->qdcount); in res_nameinquery()
355 int n = dn_expand(buf, eom, cp, tname, sizeof tname); in res_nameinquery()
423 int res_nsend(res_state statp, const uint8_t* buf, int buflen, uint8_t* ans, int anssiz, int* rcode, in res_nsend() argument
433 res_pquery(buf, buflen); in res_nsend()
438 resolv_cache_lookup(statp->netid, buf, buflen, ans, anssiz, &anslen, flags); in res_nsend()
446 dnsQueryEvent->set_type(getQueryType(buf, buflen)); in res_nsend()
457 _resolv_cache_query_failed(statp->netid, buf, buflen, flags); in res_nsend()
472 int resplen = res_tls_send(statp, Slice(const_cast<uint8_t*>(buf), buflen), in res_nsend()
478 resolv_cache_add(statp->netid, buf, buflen, ans, resplen); in res_nsend()
483 _resolv_cache_query_failed(statp->netid, buf, buflen, flags); in res_nsend()
510 auto hp = reinterpret_cast<const HEADER*>(buf); in res_nsend()
549 resplen = send_vc(statp, ¶ms, buf, buflen, ans, anssiz, &terrno, ns, in res_nsend()
561 resplen = send_dg(statp, ¶ms, buf, buflen, ans, anssiz, &terrno, &actualNs, in res_nsend()
582 dnsQueryEvent->set_type(getQueryType(buf, buflen)); in res_nsend()
611 _resolv_cache_query_failed(statp->netid, buf, buflen, flags); in res_nsend()
620 resolv_cache_add(statp->netid, buf, buflen, ans, resplen); in res_nsend()
633 _resolv_cache_query_failed(statp->netid, buf, buflen, flags); in res_nsend()
658 static int send_vc(res_state statp, res_params* params, const uint8_t* buf, int buflen, in send_vc() argument
663 const HEADER* hp = (const HEADER*) (const void*) buf; in send_vc()
761 {.iov_base = const_cast<uint8_t*>(buf), .iov_len = static_cast<size_t>(buflen)}, in send_vc()
978 bool ignoreInvalidAnswer(res_state statp, const sockaddr_storage& from, const uint8_t* buf, in ignoreInvalidAnswer() argument
980 const HEADER* hp = (const HEADER*)(const void*)buf; in ignoreInvalidAnswer()
992 if (!res_queriesmatch(buf, buf + buflen, ans, ans + anssiz)) { in ignoreInvalidAnswer()
1000 static int send_dg(res_state statp, res_params* params, const uint8_t* buf, int buflen, in send_dg() argument
1059 if (send(statp->nssocks[*ns], (const char*)buf, (size_t)buflen, 0) != buflen) { in send_dg()
1106 ignoreInvalidAnswer(statp, from, buf, buflen, ans, anssiz, &receivedFromNs); in send_dg()