Lines Matching refs:ans

158 static int send_dg(ResState* statp, res_params* params, span<const uint8_t> msg, span<uint8_t> ans,
160 static int send_vc(ResState* statp, res_params* params, span<const uint8_t> msg, span<uint8_t> ans,
162 static int send_mdns(ResState* statp, span<const uint8_t> msg, span<uint8_t> ans, int* terrno,
439 int res_nsend(ResState* statp, span<const uint8_t> msg, span<uint8_t> ans, int* rcode, in res_nsend() argument
444 if (ans.size() < HFIXEDSZ) { in res_nsend()
453 ResolvCacheStatus cache_status = resolv_cache_lookup(statp->netid, msg, ans, &anslen, flags); in res_nsend()
456 HEADER* hp = (HEADER*)(void*)ans.data(); in res_nsend()
476 resplen = send_mdns(statp, msg, ans, &terrno, rcode); in res_nsend()
491 res_pquery(ans.first(resplen)); in res_nsend()
494 resolv_cache_add(statp->netid, msg, std::span(ans.data(), resplen)); in res_nsend()
517 Slice(ans.data(), ans.size()), rcode, &fallback); in res_nsend()
520 res_pquery(ans.first(resplen)); in res_nsend()
522 resolv_cache_add(statp->netid, msg, ans.first(resplen)); in res_nsend()
600 resplen = send_vc(statp, &params, msg, ans, &terrno, ns, rcode); in res_nsend()
612 resplen = send_dg(statp, &params, msg, ans, &terrno, &actualNs, &useTcp, in res_nsend()
667 res_pquery(ans.first(resplen)); in res_nsend()
670 resolv_cache_add(statp->netid, msg, std::span(ans.data(), resplen)); in res_nsend()
708 static int send_vc(ResState* statp, res_params* params, span<const uint8_t> msg, span<uint8_t> ans, in send_vc() argument
711 HEADER* anhp = (HEADER*)(void*)ans.data(); in send_vc()
820 cp = ans.data(); in send_vc()
845 uint16_t resplen = ntohs(*reinterpret_cast<const uint16_t*>(ans.data())); in send_vc()
846 if (resplen > ans.size()) { in send_vc()
849 len = ans.size(); in send_vc()
861 cp = ans.data(); in send_vc()
878 len = resplen - ans.size(); in send_vc()
888 LOG(WARNING) << __func__ << ": resplen " << resplen << " exceeds buf size " << ans.size(); in send_vc()
890 resplen = ans.size(); in send_vc()
901 res_pquery({ans.data(), resplen}); in send_vc()
1027 span<uint8_t> ans, int* receivedFromNs) { in ignoreInvalidAnswer() argument
1029 HEADER* anhp = (HEADER*)(void*)ans.data(); in ignoreInvalidAnswer()
1040 if (!res_queriesmatch(msg.data(), msg.data() + msg.size(), ans.data(), in ignoreInvalidAnswer()
1041 ans.data() + ans.size())) { in ignoreInvalidAnswer()
1085 static int send_dg(ResState* statp, res_params* params, span<const uint8_t> msg, span<uint8_t> ans, in send_dg() argument
1146 recvfrom(fd, ans.data(), ans.size(), 0, (sockaddr*)(void*)&from, &fromlen); in send_dg()
1159 if (resplen > static_cast<ptrdiff_t>(ans.size())) { in send_dg()
1164 if (needRetry = ignoreInvalidAnswer(statp, from, msg, ans, &receivedFromNs); in send_dg()
1166 res_pquery(ans.first(resplen)); in send_dg()
1170 HEADER* anhp = (HEADER*)(void*)ans.data(); in send_dg()
1176 res_pquery(ans.first(resplen)); in send_dg()
1185 res_pquery(ans.first(resplen)); in send_dg()
1211 static int send_mdns(ResState* statp, span<const uint8_t> msg, span<uint8_t> ans, int* terrno, in send_mdns() argument
1237 int resplen = recvfrom(fd, ans.data(), ans.size(), 0, (sockaddr*)(void*)&from, &fromlen); in send_mdns()
1251 HEADER* anhp = (HEADER*)(void*)ans.data(); in send_mdns()
1459 span<uint8_t> ans, int* rcode, uint32_t flags, in resolv_res_nsend() argument
1465 return res_nsend(&res, msg, ans, rcode, flags); in resolv_res_nsend()