Lines Matching defs:ns
182 int ns;
187 for (ns = 0; ns < statp->nscount; ns++) {
188 srv = (struct sockaddr_in *)get_nsaddr(statp, ns);
200 for (ns = 0; ns < statp->nscount; ns++) {
201 srv6 = (struct sockaddr_in6 *)get_nsaddr(statp, ns);
313 int gotsomewhere, terrno, tries, v_circuit, resplen, ns, n;
352 for (ns = 0; ns < statp->nscount; ns++) {
353 if (statp->nsaddr_list[ns].sin_family &&
354 !sock_eq((struct sockaddr *)&statp->nsaddr_list[ns],
355 (struct sockaddr *)&EXT(statp).ext->nsaddrs[ns])) {
360 if (EXT(statp).nssocks[ns] == -1)
363 if (getpeername(EXT(statp).nssocks[ns],
369 get_nsaddr(statp, ns))) {
395 for (ns = 0; ns < statp->nscount; ns++) {
396 EXT(statp).nstimes[ns] = RES_MAXTIME;
397 EXT(statp).nssocks[ns] = -1;
398 if (!statp->nsaddr_list[ns].sin_family)
400 EXT(statp).ext->nsaddrs[ns].sin =
401 statp->nsaddr_list[ns];
403 res_set_defer_state(statp, ns, RES_DEFER_ONLINE);
433 for (ns = 0; ns < lastns; ns++) {
435 EXT(statp).ext->nsaddrs[ns] =
436 EXT(statp).ext->nsaddrs[ns + 1];
438 EXT(statp).ext->nsdefer[ns] =
439 EXT(statp).ext->nsdefer[ns + 1];
442 statp->nsaddr_list[ns] = statp->nsaddr_list[ns + 1];
443 EXT(statp).nssocks[ns] = EXT(statp).nssocks[ns + 1];
444 EXT(statp).nstimes[ns] = EXT(statp).nstimes[ns + 1];
465 for (ns = 0; ns < statp->nscount; ns++) {
468 nsap = get_nsaddr(statp, ns);
472 res_get_defer_state(statp, ns, &defer_state);
479 ns + 1, abuf));
496 statp->_flags |= (ns << RES_F_LASTSHIFT);
532 ns + 1, abuf));
539 ns);
541 res_set_defer_state(statp, ns,
552 ns, tries, &v_circuit, &gotsomewhere);
554 res_set_defer_state(statp, ns,
616 } /*foreach ns*/
690 int *terrno, int ns)
705 nsap = get_nsaddr(statp, ns);
887 int anssiz, int *terrno, int ns, int tries, int *v_circuit,
908 nsap = get_nsaddr(statp, ns);
910 if (EXT(statp).nssocks[ns] == -1) {
911 EXT(statp).nssocks[ns] = socket(nsap->sa_family, SOCK_DGRAM, 0);
912 if (EXT(statp).nssocks[ns] > highestFD) {
916 if (EXT(statp).nssocks[ns] < 0) {
943 if (connect(EXT(statp).nssocks[ns], nsap, nsaplen) < 0) {
953 s = EXT(statp).nssocks[ns];
982 if (ns > 0)
990 if (ns > 0)
1238 res_set_defer_state(res_state statp, int ns, res_defer_state_t defer_state)
1259 statp->_u._ext.ext->nsdefer[ns] = ts_zero;
1269 if (evCmpTime(ts_now, statp->_u._ext.ext->nsdefer[ns]) >= 0) {
1270 statp->_u._ext.ext->nsdefer[ns] = evAddTime(ts_now,
1284 res_get_defer_state(res_state statp, int ns, res_defer_state_t *defer_state)
1303 if (evCmpTime(ts_zero, statp->_u._ext.ext->nsdefer[ns]) == 0) {
1313 if (evCmpTime(ts_now, statp->_u._ext.ext->nsdefer[ns]) >= 0) {
1314 statp->_u._ext.ext->nsdefer[ns] = ts_zero;