Home
last modified time | relevance | path

Searched refs:rcode (Results 1 – 25 of 33) sorted by relevance

12

/packages/modules/DnsResolver/
Dres_send.cpp147 uint8_t* ans, int anssiz, int* terrno, size_t ns, time_t* at, int* rcode,
151 int* gotsomewhere, time_t* at, int* rcode, int* delay);
159 static int res_tls_send(res_state, const Slice query, const Slice answer, int* rcode,
420 int res_nsend(res_state statp, const uint8_t* buf, int buflen, uint8_t* ans, int anssiz, int* rcode, in res_nsend() argument
439 *rcode = hp->rcode; in res_nsend()
470 Slice(ans, anssiz), rcode, &fallback); in res_nsend()
525 *rcode = RCODE_INTERNAL_ERROR; in res_nsend()
547 &query_time, rcode, &delay); in res_nsend()
559 &useTcp, &gotsomewhere, &query_time, rcode, &delay); in res_nsend()
577 dnsQueryEvent->set_rcode(static_cast<NsRcode>(*rcode)); in res_nsend()
[all …]
DDnsStats.cpp41 std::string rcodeToName(int rcode) { in rcodeToName() argument
43 switch (rcode) { in rcodeToName()
57 default: return StringPrintf("UNKNOWN(%d)", rcode); in rcodeToName()
90 for (const auto& [rcode, counts] : rcodeCounts) { in toString()
92 buf += StringPrintf("%s:%d ", rcodeToName(rcode).c_str(), counts); in toString()
126 const int rcode = record.rcode; in updateStatsData() local
129 mStatsData.rcodeCounts[rcode] += 1; in updateStatsData()
133 mStatsData.rcodeCounts[rcode] -= 1; in updateStatsData()
140 switch (record.rcode) { in updatePenalty()
205 .rcode = record.rcode(), in addStats()
Dres_query.cpp112 int rcode = NOERROR; in res_nquery() local
116 hp->rcode = NOERROR; // default in res_nquery()
132 n = res_nsend(statp, buf, n, answer, anslen, &rcode, 0); in res_nquery()
159 switch (rcode) { in res_nquery()
171 if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { in res_nquery()
172 LOG(DEBUG) << __func__ << ": rcode = (" << p_rcode(hp->rcode) in res_nquery()
176 switch (hp->rcode) { in res_nquery()
287 if (hp->rcode == SERVFAIL) { in res_nsearch()
Dgetaddrinfo.cpp1581 int getHerrnoFromRcode(int rcode) { in getHerrnoFromRcode() argument
1582 switch (rcode) { in getHerrnoFromRcode()
1604 int rcode; member
1614 hp->rcode = NOERROR; // default in doQuery()
1637 .rcode = -1, in doQuery()
1646 int rcode = NOERROR; in doQuery() local
1647 n = res_nsend(&res_temp, buf, n, t->answer.data(), anslen, &rcode, 0, sleepTimeMs); in doQuery()
1648 if (n < 0 || hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { in doQuery()
1650 if (rcode != RCODE_TIMEOUT) rcode = hp->rcode; in doQuery()
1658 n = res_nsend(&res_temp, buf, n, t->answer.data(), anslen, &rcode, 0); in doQuery()
[all …]
Dres_stats.cpp35 void res_stats_set_sample(res_sample* sample, time_t now, int rcode, int rtt) { in res_stats_set_sample() argument
36 LOG(INFO) << __func__ << ": rcode = " << rcode << ", sec = " << rtt; in res_stats_set_sample()
38 sample->rcode = rcode; in res_stats_set_sample()
65 switch (stats->samples[i].rcode) { in android_net_res_stats_aggregate()
DDnsStatsTest.cpp47 DnsQueryEvent makeDnsQueryEvent(const Protocol protocol, const NsRcode rcode, in makeDnsQueryEvent() argument
51 event.set_rcode(rcode); in makeDnsQueryEvent()
75 .rcode = NS_R_NO_ERROR, in TEST_F()
80 .rcode = NS_R_TIMEOUT, in TEST_F()
391 const NsRcode rcode = static_cast<NsRcode>(rcodes[i % rcodeNum]); in TEST_F() local
392 const auto eventTcp = makeDnsQueryEvent(PROTO_TCP, rcode, milliseconds(i)); in TEST_F()
393 const auto eventUdp = makeDnsQueryEvent(PROTO_UDP, rcode, milliseconds(i)); in TEST_F()
394 const auto eventDot = makeDnsQueryEvent(PROTO_DOT, rcode, milliseconds(i)); in TEST_F()
404 for (const auto& rcode : rcodes) { in TEST_F() local
405 expectedRcodeCounts.try_emplace(rcode, 32); in TEST_F()
Dres_debug.cpp244 uint32_t opcode, rcode, id; in res_pquery() local
251 rcode = ns_msg_getflag(handle, ns_f_rcode); in res_pquery()
263 p_rcode((int)rcode), id); in res_pquery()
478 const char* p_rcode(int rcode) { in p_rcode() argument
479 return (sym_ntos(p_rcode_syms, rcode, (int*) 0)); in p_rcode()
Dstats.h32 uint8_t rcode; // the DNS rcode or RCODE_XXX defined above member
63 void res_stats_set_sample(res_sample* sample, time_t now, int rcode, int rtt);
DDnsProxyListener.cpp218 int rcodeToAiError(int rcode) { in rcodeToAiError() argument
219 switch (rcode) { in rcodeToAiError()
229 int resNSendToAiError(int err, int rcode) { in resNSendToAiError() argument
231 return rcodeToAiError(rcode); in resNSendToAiError()
378 if (query.cache_hit() != CS_FOUND && query.rcode() == NS_R_NO_ERROR) {
935 int rcode = ns_r_noerror; in run() local
942 &rcode, static_cast<ResNsendFlags>(mFlags), &event); in run()
966 resNSendToAiError(nsendAns, rcode), event, rr_name); in run()
972 if (!sendBE32(mClient, rcode)) { in run()
991 resNSendToAiError(nsendAns, rcode), event, rr_name, ip_addrs, in run()
Dres_debug.h29 const char* p_rcode(int rcode);
Dres_send.h24 uint8_t* ans, int ansLen, int* rcode, uint32_t flags,
Dstats.proto66 // Define rcode=12~15(UNASSIGNED) in rcode enum type.
351 optional NsRcode rcode = 1; field
/packages/modules/Connectivity/framework/src/android/net/
DDnsResolver.java142 void onAnswer(@NonNull T answer, int rcode); in onAnswer() argument
287 public void onAnswer(@NonNull byte[] answer, int rcode) { in onAnswer() argument
290 if (mReceivedAnswerCount == 0 || rcode == 0) { in onAnswer()
291 mRcode = rcode; in onAnswer()
469 public final int rcode; field in DnsResolver.DnsResponse
470 public DnsResponse(@NonNull byte[] answerbuf, int rcode) { in DnsResponse() argument
472 this.rcode = rcode; in DnsResponse()
511 answerCallback.onAnswer(resp.answerbuf, resp.rcode); in registerFDListener()
/packages/modules/Connectivity/tests/cts/net/native/dns/
DNativeDnsAsyncTest.cpp37 int getAsyncResponse(int fd, int timeoutMs, int* rcode, uint8_t* buf, size_t bufLen) { in getAsyncResponse() argument
46 int n = android_res_nresult(fd, rcode, buf, bufLen); in getAsyncResponse()
79 int rcode = -1; in expectAnswersValid() local
81 int res = getAsyncResponse(fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersValid()
83 EXPECT_EQ(rcode, expectedRcode); in expectAnswersValid()
96 int rcode = -1; in expectAnswersNotValid() local
98 int res = getAsyncResponse(fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersNotValid()
/packages/modules/Connectivity/tests/cts/net/jni/
DNativeMultinetworkJni.cpp80 int getAsyncResponse(JNIEnv* env, int fd, int timeoutMs, int* rcode, uint8_t* buf, size_t bufLen) { in getAsyncResponse() argument
85 int n = android_res_nresult(fd, rcode, buf, bufLen); in getAsyncResponse()
124 int rcode = -1; in expectAnswersValid() local
126 int res = getAsyncResponse(env, fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersValid()
131 EXPECT_EQ(env, expectedRcode, rcode, "rcode is not expected"); in expectAnswersValid()
140 int rcode = -1; in expectAnswersNotValid() local
142 int res = getAsyncResponse(env, fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersNotValid()
/packages/modules/Connectivity/framework/jni/
Dandroid_net_NetworkUtils.cpp160 int rcode; in android_net_utils_resNetworkResult() local
163 int res = android_res_nresult(fd, &rcode, buf, MAXPACKETSIZE); in android_net_utils_resNetworkResult()
181 return env->NewObject(class_DnsResponse, ctor, answer, rcode); in android_net_utils_resNetworkResult()
/packages/modules/DnsResolver/tests/
Dresolv_stats_test_utils.h39 ::testing::Property("rcode", &DnsQueryEvent::rcode,
40 ::testing::Eq(other.rcode())),
Dresolv_integration_test.cpp2208 int getAsyncResponse(int fd, int* rcode, uint8_t* buf, int bufLen) { in getAsyncResponse() argument
2218 return resNetworkResult(fd, rcode, buf, bufLen); in getAsyncResponse()
2264 int rcode = -1; in expectAnswersValid() local
2267 int res = getAsyncResponse(fd, &rcode, buf, MAXPACKET); in expectAnswersValid()
2273 int rcode = -1; in expectAnswersNotValid() local
2276 int res = getAsyncResponse(fd, &rcode, buf, MAXPACKET); in expectAnswersNotValid()
2301 int rcode; in TEST_F() local
2302 int res = getAsyncResponse(fd2, &rcode, buf, MAXPACKET); in TEST_F()
2306 res = getAsyncResponse(fd1, &rcode, buf, MAXPACKET); in TEST_F()
2319 res = getAsyncResponse(fd2, &rcode, buf, MAXPACKET); in TEST_F()
[all …]
Dresolv_cache_unit_test.cpp108 return std::tie(a.at, a.rtt, a.rcode) == std::tie(b.at, b.rtt, b.rcode); in operator ==()
750 res_sample sample = {.at = time(NULL), .rtt = 100, .rcode = ns_r_noerror}; in TEST_F()
851 const res_sample sample1 = {.at = time(nullptr), .rtt = 100, .rcode = ns_r_noerror}; in TEST_F()
852 const res_sample sample2 = {.at = time(nullptr), .rtt = 200, .rcode = ns_r_noerror}; in TEST_F()
853 const res_sample sample3 = {.at = time(nullptr), .rtt = 300, .rcode = ns_r_noerror}; in TEST_F()
Dresolv_unit_test.cpp622 ns_rcode rcode; in TEST_F() member
638 SCOPED_TRACE(StringPrintf("rcode: %d", config.rcode)); in TEST_F()
640 test::DNSResponder dns(config.rcode); in TEST_F()
1330 ns_rcode rcode; in TEST_F() member
1348 SCOPED_TRACE(StringPrintf("rcode: %d", config.rcode)); in TEST_F()
1350 test::DNSResponder dns(config.rcode); in TEST_F()
/packages/modules/Connectivity/tests/cts/net/src/android/net/cts/
DDnsResolverTest.java178 return mHeader.rcode; in getRcode()
225 public void onAnswer(@NonNull byte[] answer, int rcode) { in onAnswer() argument
232 mRcode = rcode; in onAnswer()
547 public void onAnswer(@NonNull List<InetAddress> answerList, int rcode) { in onAnswer() argument
695 public void onAnswer(@NonNull List<InetAddress> answerList, int rcode) { in testPrivateDnsBypass()
/packages/modules/DnsResolver/tests/dns_responder/
Ddns_responder.h88 uint8_t rcode; member
260 bool generateErrorResponse(DNSHeader* header, ns_rcode rcode, char* response,
268 bool makeErrorResponse(DNSHeader* header, ns_rcode rcode, char* response,
Ddns_responder.cpp423 header.flags1 = (ad << 5) | rcode; in write()
478 rcode = header.flags1 & 0xF; in readHeader()
904 bool DNSResponder::makeErrorResponse(DNSHeader* header, ns_rcode rcode, char* response, in makeErrorResponse() argument
909 header->rcode = rcode; in makeErrorResponse()
/packages/modules/NetworkStack/src/com/android/networkstack/util/
DDnsUtils.java108 public void onAnswer(List<InetAddress> answer, int rcode) { in getAllByName()
109 if (rcode == 0 && answer != null && answer.size() != 0) { in getAllByName()
/packages/modules/Connectivity/service/src/com/android/server/connectivity/
DNetworkDiagnostics.java571 protected String responseCodeStr(int rcode) { in responseCodeStr() argument
573 return DnsResponseCode.values()[rcode].toString(); in responseCodeStr()
575 return String.valueOf(rcode); in responseCodeStr()

12