Home
last modified time | relevance | path

Searched refs:statp (Results 1 – 6 of 6) sorted by relevance

/system/netd/resolv/
Dres_init.cpp126 int res_ninit(res_state statp) { in res_ninit() argument
127 return res_vinit(statp, 0); in res_ninit()
131 int res_vinit(res_state statp, int preinit) { in res_vinit() argument
139 if ((statp->options & RES_INIT) != 0U) res_ndestroy(statp); in res_vinit()
142 statp->netid = NETID_UNSET; in res_vinit()
143 statp->options = RES_DEFAULT; in res_vinit()
144 statp->id = arc4random_uniform(65536); in res_vinit()
145 statp->_mark = MARK_UNSET; in res_vinit()
153 statp->nscount = 0; in res_vinit()
154 statp->ndots = 1; in res_vinit()
[all …]
Dres_send.cpp267 static int res_ourserver_p(const res_state statp, const sockaddr* sa) { in res_ourserver_p() argument
275 for (ns = 0; ns < statp->nscount; ns++) { in res_ourserver_p()
276 srv = (struct sockaddr_in*) (void*) get_nsaddr(statp, (size_t) ns); in res_ourserver_p()
284 if (statp->_u._ext.ext == NULL) break; in res_ourserver_p()
286 for (ns = 0; ns < statp->nscount; ns++) { in res_ourserver_p()
287 srv6 = (struct sockaddr_in6*) (void*) get_nsaddr(statp, (size_t) ns); in res_ourserver_p()
376 int res_nsend(res_state statp, const u_char* buf, int buflen, u_char* ans, int anssiz, int* rcode, in res_nsend() argument
389 v_circuit = (statp->options & RES_USEVC) || buflen > PACKETSZ; in res_nsend()
394 cache_status = _resolv_cache_lookup(statp->netid, buf, buflen, ans, anssiz, &anslen, flags); in res_nsend()
403 _resolv_populate_res_for_net(statp); in res_nsend()
[all …]
Dres_query.cpp109 int res_nquery(res_state statp, const char* name, // domain name in res_nquery() argument
127 n = res_nmkquery(statp, QUERY, name, cl, type, NULL, 0, NULL, buf, sizeof(buf)); in res_nquery()
128 if (n > 0 && (statp->options & (RES_USE_EDNS0 | RES_USE_DNSSEC)) != 0U && !retried) in res_nquery()
129 n = res_nopt(statp, n, buf, sizeof(buf), anslen); in res_nquery()
135 n = res_nsend(statp, buf, n, answer, anslen, &rcode, 0); in res_nquery()
138 if ((statp->options & (RES_USE_EDNS0 | RES_USE_DNSSEC)) != 0U && in res_nquery()
139 (statp->_flags & RES_F_EDNS0ERR) && !retried) { in res_nquery()
204 int res_nsearch(res_state statp, const char* name, /* domain name */ in res_nsearch() argument
233 if (dots >= statp->ndots || trailing_dot) { in res_nsearch()
234 ret = res_nquerydomain(statp, name, NULL, cl, type, answer, anslen, herrno); in res_nsearch()
[all …]
Dres_mkquery.cpp102 int res_nmkquery(res_state statp, int op, /* opcode of query */ in res_nmkquery() argument
127 hp->rd = (statp->options & RES_RECURSE) != 0U; in res_nmkquery()
128 hp->ad = (statp->options & RES_USE_DNSSEC) != 0U; in res_nmkquery()
197 int res_nopt(res_state statp, int n0, /* current offset in buffer */ in res_nopt() argument
224 if (statp->options & RES_USE_DNSSEC) { in res_nopt()
Dres_cache.cpp1869 void _resolv_populate_res_for_net(res_state statp) { in _resolv_populate_res_for_net() argument
1870 if (statp == NULL) { in _resolv_populate_res_for_net()
1873 LOG(INFO) << __func__ << ": netid=" << statp->netid; in _resolv_populate_res_for_net()
1876 resolv_cache_info* info = find_cache_info_locked(statp->netid); in _resolv_populate_res_for_net()
1886 if ((size_t) ai->ai_addrlen <= sizeof(statp->_u._ext.ext->nsaddrs[0])) { in _resolv_populate_res_for_net()
1887 if (statp->_u._ext.ext != NULL) { in _resolv_populate_res_for_net()
1888 memcpy(&statp->_u._ext.ext->nsaddrs[nserv], ai->ai_addr, ai->ai_addrlen); in _resolv_populate_res_for_net()
1889 statp->nsaddr_list[nserv].sin_family = AF_UNSPEC; in _resolv_populate_res_for_net()
1891 if ((size_t) ai->ai_addrlen <= sizeof(statp->nsaddr_list[0])) { in _resolv_populate_res_for_net()
1892 memcpy(&statp->nsaddr_list[nserv], ai->ai_addr, ai->ai_addrlen); in _resolv_populate_res_for_net()
[all …]
Dresolv_cache.h42 void _resolv_populate_res_for_net(struct __res_state* statp);