/system/netd/resolv/ |
D | sethostent.cpp | 67 struct hostent *hp, hent; in _hf_gethtbyname2() local 93 info->hp->h_addrtype = af; in _hf_gethtbyname2() 94 info->hp->h_length = 0; in _hf_gethtbyname2() 97 hp = netbsd_gethostent_r(hf, info->hp, info->buf, info->buflen, &he); in _hf_gethtbyname2() 98 if (hp == NULL) { in _hf_gethtbyname2() 105 if (strcasecmp(hp->h_name, name) != 0) { in _hf_gethtbyname2() 107 for (cp = hp->h_aliases; *cp != NULL; cp++) in _hf_gethtbyname2() 114 hent.h_addrtype = hp->h_addrtype; in _hf_gethtbyname2() 115 hent.h_length = hp->h_length; in _hf_gethtbyname2() 117 HENT_SCOPY(hent.h_name, hp->h_name, ptr, len); in _hf_gethtbyname2() [all …]
|
D | gethnamaddr.cpp | 110 static void convert_v4v6_hostent(struct hostent* hp, char** bpp, char* ep, 111 std::function<void(struct hostent* hp)> mapping_param, 115 static void pad_v4v6_hostent(struct hostent* hp, char** bpp, char* ep); 122 static int gethostbyname_internal(const char* name, int af, res_state res, hostent* hp, char* hbuf, 124 static int gethostbyname_internal_real(const char* name, int af, res_state res, hostent* hp, 131 hostent** hp); 147 const HEADER* hp; in getanswer() local 184 hp = &answer->hdr; in getanswer() 185 ancount = ntohs(hp->ancount); in getanswer() 186 qdcount = ntohs(hp->qdcount); in getanswer() [all …]
|
D | res_mkquery.cpp | 111 HEADER* hp; in res_nmkquery() local 124 hp = (HEADER*) (void*) buf; in res_nmkquery() 125 hp->id = htons(arc4random_uniform(65536)); in res_nmkquery() 126 hp->opcode = op; in res_nmkquery() 127 hp->rd = (statp->options & RES_RECURSE) != 0U; in res_nmkquery() 128 hp->ad = (statp->options & RES_USE_DNSSEC) != 0U; in res_nmkquery() 129 hp->rcode = NOERROR; in res_nmkquery() 150 hp->qdcount = htons(1); in res_nmkquery() 167 hp->arcount = htons(1); in res_nmkquery() 188 hp->ancount = htons(1); in res_nmkquery() [all …]
|
D | DnsProxyListener.cpp | 220 int extractGetHostByNameAnswers(const hostent* hp, std::vector<std::string>* ip_addrs) { in extractGetHostByNameAnswers() argument 222 if (hp == nullptr) { in extractGetHostByNameAnswers() 225 if (hp->h_addrtype == AF_INET) { in extractGetHostByNameAnswers() 226 in_addr** list = (in_addr**) hp->h_addr_list; in extractGetHostByNameAnswers() 232 } else if (hp->h_addrtype == AF_INET6) { in extractGetHostByNameAnswers() 233 in6_addr** list = (in6_addr**) hp->h_addr_list; in extractGetHostByNameAnswers() 283 auto hp = reinterpret_cast<HEADER*>(msg); in setQueryId() local 284 hp->id = htons(query_id); in setQueryId() 353 bool onlyNonSpecialUseIPv4Addresses(struct hostent* hp) { in onlyNonSpecialUseIPv4Addresses() argument 356 if (hp->h_addrtype != AF_INET) return false; in onlyNonSpecialUseIPv4Addresses() [all …]
|
D | res_query.cpp | 117 HEADER* hp = (HEADER*) (void*) answer; in res_nquery() local 123 hp->rcode = NOERROR; /* default */ 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() 173 << "), counts = an:" << ntohs(hp->ancount) << " ns:" << ntohs(hp->nscount) in res_nquery() 174 << " ar:" << ntohs(hp->arcount); in res_nquery() 176 switch (hp->rcode) { in res_nquery() 212 HEADER* hp = (HEADER*) (void*) answer; in res_nsearch() local 294 if (hp->rcode == SERVFAIL) { in res_nsearch()
|
D | libnetd_resolv_test.cpp | 490 struct hostent* hp = nullptr; in TEST_F() local 492 &hp); in TEST_F() 494 EXPECT_TRUE(hp != nullptr); in TEST_F() 496 EXPECT_EQ(config.expected_addr, ToString(hp)); in TEST_F() 514 struct hostent* hp = nullptr; in TEST_F() local 515 int rv = android_gethostbynamefornetcontext("v4only", AF_INET6, &mNetcontext, &hp); in TEST_F() 517 EXPECT_TRUE(hp == nullptr); in TEST_F() 557 struct hostent* hp = nullptr; in TEST_F() local 558 int rv = android_gethostbynamefornetcontext(host_name, AF_INET, &mNetcontext, &hp); in TEST_F() 559 EXPECT_TRUE(hp == nullptr); in TEST_F() [all …]
|
D | getaddrinfo.cpp | 835 const HEADER* hp; in getanswer() local 866 hp = &answer->hdr; in getanswer() 867 ancount = ntohs(hp->ancount); in getanswer() 868 qdcount = ntohs(hp->qdcount); in getanswer() 1574 HEADER* hp; in res_queryN() local 1590 hp = (HEADER*) (void*) t->answer; in res_queryN() 1593 hp->rcode = NOERROR; /* default */ in res_queryN() 1613 if (n < 0 || hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { in res_queryN() 1616 if (rcode != RCODE_TIMEOUT) rcode = hp->rcode; /* record most recent error */ in res_queryN() 1624 LOG(DEBUG) << __func__ << ": rcode=" << hp->rcode << ", ancount=" << ntohs(hp->ancount); in res_queryN() [all …]
|
D | hostent.h | 38 struct hostent* hp; member
|
D | res_send.cpp | 397 HEADER* hp = (HEADER*)(void*)ans; in res_nsend() local 398 *rcode = hp->rcode; in res_nsend() 509 auto hp = reinterpret_cast<const HEADER*>(buf); in res_nsend() local 512 int selectedServer = (hp->id % usableServersCount) + 1; in res_nsend() 711 const HEADER* hp = (const HEADER*) (const void*) buf; in send_vc() local 891 if (hp->id != anhp->id) { in send_vc() 978 const HEADER* hp = (const HEADER*) (const void*) buf; in send_dg() local 1090 if (hp->id != anhp->id) { in send_dg()
|
D | resolver_test.cpp | 2264 auto hp = reinterpret_cast<HEADER*>(buf); in TEST_F() local 2265 EXPECT_EQ(21862U, htons(hp->id)); in TEST_F() 2293 EXPECT_EQ(0x0053U, htons(hp->id)); in TEST_F()
|