Lines Matching refs:ns
238 int ns; in res_ourserver_p() local
243 for (ns = 0; ns < statp->nscount; ns++) { in res_ourserver_p()
244 srv = (struct sockaddr_in *)(void *)get_nsaddr(statp, (size_t)ns); in res_ourserver_p()
256 for (ns = 0; ns < statp->nscount; ns++) { in res_ourserver_p()
257 srv6 = (struct sockaddr_in6 *)(void *)get_nsaddr(statp, (size_t)ns); in res_ourserver_p()
367 int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; in res_nsend() local
426 for (ns = 0; ns < statp->nscount; ns++) { in res_nsend()
427 if (statp->nsaddr_list[ns].sin_family && in res_nsend()
428 !sock_eq((struct sockaddr *)(void *)&statp->nsaddr_list[ns], in res_nsend()
429 (struct sockaddr *)(void *)&EXT(statp).ext->nsaddrs[ns])) { in res_nsend()
434 if (EXT(statp).nssocks[ns] == -1) in res_nsend()
437 if (getpeername(EXT(statp).nssocks[ns], in res_nsend()
443 get_nsaddr(statp, (size_t)ns))) { in res_nsend()
458 for (ns = 0; ns < statp->nscount; ns++) { in res_nsend()
459 EXT(statp).nstimes[ns] = RES_MAXTIME; in res_nsend()
460 EXT(statp).nssocks[ns] = -1; in res_nsend()
461 if (!statp->nsaddr_list[ns].sin_family) in res_nsend()
463 EXT(statp).ext->nsaddrs[ns].sin = in res_nsend()
464 statp->nsaddr_list[ns]; in res_nsend()
486 for (ns = 0; ns < lastns; ns++) { in res_nsend()
488 EXT(statp).ext->nsaddrs[ns] = in res_nsend()
489 EXT(statp).ext->nsaddrs[ns + 1]; in res_nsend()
490 statp->nsaddr_list[ns] = statp->nsaddr_list[ns + 1]; in res_nsend()
491 EXT(statp).nssocks[ns] = EXT(statp).nssocks[ns + 1]; in res_nsend()
492 EXT(statp).nstimes[ns] = EXT(statp).nstimes[ns + 1]; in res_nsend()
505 for (ns = 0; ns < statp->nscount; ns++) { in res_nsend()
508 nsap = get_nsaddr(statp, (size_t)ns); in res_nsend()
511 statp->_flags |= (ns << RES_F_LASTSHIFT); in res_nsend()
547 ns + 1, abuf)); in res_nsend()
555 ns); in res_nsend()
574 ns, &v_circuit, &gotsomewhere); in res_nsend()
719 static int get_timeout(const res_state statp, const int ns) in get_timeout() argument
721 int timeout = (statp->retrans << ns); in get_timeout()
722 if (ns > 0) { in get_timeout()
738 int *terrno, int ns) in send_vc() argument
754 nsap = get_nsaddr(statp, (size_t)ns); in send_vc()
818 get_timeout(statp, ns)) < 0) { in send_vc()
1049 int *terrno, int ns, int *v_circuit, int *gotsomewhere) in send_dg() argument
1061 nsap = get_nsaddr(statp, (size_t)ns); in send_dg()
1063 if (EXT(statp).nssocks[ns] == -1) { in send_dg()
1064 EXT(statp).nssocks[ns] = socket(nsap->sa_family, SOCK_DGRAM | SOCK_CLOEXEC, 0); in send_dg()
1065 if (EXT(statp).nssocks[ns] > highestFD) { in send_dg()
1069 if (EXT(statp).nssocks[ns] < 0) { in send_dg()
1086 if (setsockopt(EXT(statp).nssocks[ns], SOL_SOCKET, in send_dg()
1104 if (random_bind(EXT(statp).nssocks[ns], nsap->sa_family) < 0) { in send_dg()
1110 if (__connect(EXT(statp).nssocks[ns], nsap, (socklen_t)nsaplen) < 0) { in send_dg()
1121 s = EXT(statp).nssocks[ns]; in send_dg()
1140 seconds = get_timeout(statp, ns); in send_dg()