Lines Matching refs:ns

226 	int ns;  in res_ourserver_p()  local
231 for (ns = 0; ns < statp->nscount; ns++) { in res_ourserver_p()
232 srv = (struct sockaddr_in *)(void *)get_nsaddr(statp, (size_t)ns); in res_ourserver_p()
244 for (ns = 0; ns < statp->nscount; ns++) { in res_ourserver_p()
245 srv6 = (struct sockaddr_in6 *)(void *)get_nsaddr(statp, (size_t)ns); in res_ourserver_p()
354 int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; in res_nsend() local
401 for (ns = 0; ns < statp->nscount; ns++) { in res_nsend()
402 if (statp->nsaddr_list[ns].sin_family && in res_nsend()
403 !sock_eq((struct sockaddr *)(void *)&statp->nsaddr_list[ns], in res_nsend()
404 (struct sockaddr *)(void *)&EXT(statp).ext->nsaddrs[ns])) { in res_nsend()
409 if (EXT(statp).nssocks[ns] == -1) in res_nsend()
412 if (getpeername(EXT(statp).nssocks[ns], in res_nsend()
418 get_nsaddr(statp, (size_t)ns))) { in res_nsend()
434 for (ns = 0; ns < statp->nscount; ns++) { in res_nsend()
435 EXT(statp).nstimes[ns] = RES_MAXTIME; in res_nsend()
436 EXT(statp).nssocks[ns] = -1; in res_nsend()
437 if (!statp->nsaddr_list[ns].sin_family) in res_nsend()
439 EXT(statp).ext->nsaddrs[ns].sin = in res_nsend()
440 statp->nsaddr_list[ns]; in res_nsend()
462 for (ns = 0; ns < lastns; ns++) { in res_nsend()
464 EXT(statp).ext->nsaddrs[ns] = in res_nsend()
465 EXT(statp).ext->nsaddrs[ns + 1]; in res_nsend()
466 statp->nsaddr_list[ns] = statp->nsaddr_list[ns + 1]; in res_nsend()
467 EXT(statp).nssocks[ns] = EXT(statp).nssocks[ns + 1]; in res_nsend()
468 EXT(statp).nstimes[ns] = EXT(statp).nstimes[ns + 1]; in res_nsend()
488 for (ns = 0; ns < statp->nscount; ns++) { in res_nsend()
489 if (!usable_servers[ns]) continue; in res_nsend()
495 nsap = get_nsaddr(statp, (size_t)ns); in res_nsend()
498 statp->_flags |= (ns << RES_F_LASTSHIFT); in res_nsend()
539 ns + 1, abuf)); in res_nsend()
547 ns, &now, &rcode, &delay); in res_nsend()
558 ns, &sample, params.max_samples); in res_nsend()
578 ns, &v_circuit, &gotsomewhere, &now, &rcode, &delay); in res_nsend()
585 ns, &sample, params.max_samples); in res_nsend()
727 …struct timespec get_timeout(const res_state statp, const struct __res_params* params, const int ns) in get_timeout() argument
737 msec = (statp->retrans * 1000) << ns; in get_timeout()
738 if (ns > 0) { in get_timeout()
758 int *terrno, int ns, time_t* at, int* rcode, int* delay) in send_vc() argument
777 nsap = get_nsaddr(statp, (size_t)ns); in send_vc()
840 get_timeout(statp, params, ns)) < 0) { in send_vc()
1072 int *terrno, int ns, int *v_circuit, int *gotsomewhere, in send_dg() argument
1087 nsap = get_nsaddr(statp, (size_t)ns); in send_dg()
1089 if (EXT(statp).nssocks[ns] == -1) { in send_dg()
1090 EXT(statp).nssocks[ns] = socket(nsap->sa_family, SOCK_DGRAM | SOCK_CLOEXEC, 0); in send_dg()
1091 if (EXT(statp).nssocks[ns] < 0) { in send_dg()
1107 fchown(EXT(statp).nssocks[ns], AID_DNS, -1); in send_dg()
1109 if (setsockopt(EXT(statp).nssocks[ns], SOL_SOCKET, in send_dg()
1127 if (random_bind(EXT(statp).nssocks[ns], nsap->sa_family) < 0) { in send_dg()
1133 if (__connect(EXT(statp).nssocks[ns], nsap, (socklen_t)nsaplen) < 0) { in send_dg()
1144 s = EXT(statp).nssocks[ns]; in send_dg()
1163 timeout = get_timeout(statp, params, ns); in send_dg()