Lines Matching refs:pai

95 #define nsdispatch(pResult,dtab,database,routine,files,hostname,pai)  NS_NOTFOUND  argument
272 (ai) = get_ai(pai, (afd), (addr)); \
290 error = get_canonname(pai, (ai), (str)); \
362 struct addrinfo *pai; in getaddrinfo() local
375 pai = &ai; in getaddrinfo()
376 pai->ai_flags = 0; in getaddrinfo()
377 pai->ai_family = PF_UNSPEC; in getaddrinfo()
378 pai->ai_socktype = ANY; in getaddrinfo()
379 pai->ai_protocol = ANY; in getaddrinfo()
380 pai->ai_addrlen = 0; in getaddrinfo()
381 pai->ai_canonname = NULL; in getaddrinfo()
382 pai->ai_addr = NULL; in getaddrinfo()
383 pai->ai_next = NULL; in getaddrinfo()
404 memcpy(pai, hints, sizeof(*pai)); in getaddrinfo()
410 if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) { in getaddrinfo()
412 if (pai->ai_family != ex->e_af) in getaddrinfo()
418 if (pai->ai_socktype == ex->e_socktype in getaddrinfo()
419 && pai->ai_protocol != ex->e_protocol) { in getaddrinfo()
431 if (MATCH_FAMILY(pai->ai_family, PF_INET, 1) in getaddrinfo()
433 || MATCH_FAMILY(pai->ai_family, PF_INET6, 1) in getaddrinfo()
436 ai0 = *pai; /* backup *pai */ in getaddrinfo()
438 if (pai->ai_family == PF_UNSPEC) { in getaddrinfo()
440 pai->ai_family = PF_INET6; in getaddrinfo()
442 pai->ai_family = PF_INET; in getaddrinfo()
445 error = get_portmatch(pai, servname, &svd); in getaddrinfo()
449 *pai = ai0; in getaddrinfo()
452 ai0 = *pai; in getaddrinfo()
456 *pai = ai0; in getaddrinfo()
462 if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex))) in getaddrinfo()
464 if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex))) in getaddrinfo()
466 if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex))) in getaddrinfo()
469 if (pai->ai_family == PF_UNSPEC) in getaddrinfo()
470 pai->ai_family = ex->e_af; in getaddrinfo()
471 if (pai->ai_socktype == ANY && ex->e_socktype != ANY) in getaddrinfo()
472 pai->ai_socktype = ex->e_socktype; in getaddrinfo()
473 if (pai->ai_protocol == ANY && ex->e_protocol != ANY) in getaddrinfo()
474 pai->ai_protocol = ex->e_protocol; in getaddrinfo()
477 error = explore_null(pai, servname, &cur->ai_next, in getaddrinfo()
480 error = explore_numeric_scope(pai, hostname, servname, in getaddrinfo()
500 if (pai->ai_flags & AI_NUMERICHOST) in getaddrinfo()
509 *pai = ai0; in getaddrinfo()
512 if (pai->ai_family != ex->e_af) in getaddrinfo()
515 if (!MATCH(pai->ai_socktype, ex->e_socktype, in getaddrinfo()
519 if (!MATCH(pai->ai_protocol, ex->e_protocol, in getaddrinfo()
524 if (pai->ai_socktype == ANY && ex->e_socktype != ANY) in getaddrinfo()
525 pai->ai_socktype = ex->e_socktype; in getaddrinfo()
526 if (pai->ai_protocol == ANY && ex->e_protocol != ANY) in getaddrinfo()
527 pai->ai_protocol = ex->e_protocol; in getaddrinfo()
529 error = explore_fqdn(pai, hostname, servname, &cur->ai_next, in getaddrinfo()
570 explore_fqdn(const struct addrinfo *pai, const char *hostname, in explore_fqdn() argument
577 _DIAGASSERT(pai != NULL); in explore_fqdn()
587 if (get_portmatch(pai, servname, svd) != 0) in explore_fqdn()
591 default_dns_files, hostname, pai)) { in explore_fqdn()
626 explore_null(const struct addrinfo *pai, const char *servname, in explore_null() argument
635 _DIAGASSERT(pai != NULL); in explore_null()
647 s = socket(pai->ai_family, SOCK_DGRAM, 0); in explore_null()
657 if (get_portmatch(pai, servname, svd) != 0) in explore_null()
660 afd = find_afd(pai->ai_family); in explore_null()
664 if (pai->ai_flags & AI_PASSIVE) { in explore_null()
692 explore_numeric(const struct addrinfo *pai, const char *hostname, in explore_numeric() argument
702 _DIAGASSERT(pai != NULL); in explore_numeric()
714 if (get_portmatch(pai, servname, svd) != 0) in explore_numeric()
717 afd = find_afd(pai->ai_family); in explore_numeric()
725 if (pai->ai_family == afd->a_af || in explore_numeric()
726 pai->ai_family == PF_UNSPEC /*?*/) { in explore_numeric()
729 if ((pai->ai_flags & AI_CANONNAME)) { in explore_numeric()
746 if (pai->ai_family == afd->a_af || in explore_numeric()
747 pai->ai_family == PF_UNSPEC /*?*/) { in explore_numeric()
750 if ((pai->ai_flags & AI_CANONNAME)) { in explore_numeric()
780 explore_numeric_scope(const struct addrinfo *pai, const char *hostname, in explore_numeric_scope() argument
784 return explore_numeric(pai, hostname, servname, res, hostname, svd); in explore_numeric_scope()
792 _DIAGASSERT(pai != NULL); in explore_numeric_scope()
800 if (get_portmatch(pai, servname, svd) != 0) in explore_numeric_scope()
803 afd = find_afd(pai->ai_family); in explore_numeric_scope()
808 return explore_numeric(pai, hostname, servname, res, hostname, in explore_numeric_scope()
813 return explore_numeric(pai, hostname, servname, res, hostname, in explore_numeric_scope()
827 error = explore_numeric(pai, addr, servname, res, hostname, svd); in explore_numeric_scope()
850 get_canonname(const struct addrinfo *pai, struct addrinfo *ai, const char *str) in get_canonname() argument
853 _DIAGASSERT(pai != NULL); in get_canonname()
857 if ((pai->ai_flags & AI_CANONNAME) != 0) { in get_canonname()
866 get_ai(const struct addrinfo *pai, const struct afd *afd, const char *addr) in get_ai() argument
871 _DIAGASSERT(pai != NULL); in get_ai()
880 memcpy(ai, pai, sizeof(struct addrinfo)); in get_ai()
1070 const struct addrinfo *pai) in getanswer() argument
1089 _DIAGASSERT(pai != NULL); in getanswer()
1233 ai = *pai; in getanswer()
1255 (void)get_canonname(pai, sentinel.ai_next, qname); in getanswer()
1257 (void)get_canonname(pai, sentinel.ai_next, canonname); in getanswer()
1304 const struct addrinfo *pai; in _dns_getaddrinfo() local
1310 pai = va_arg(ap, const struct addrinfo *); in _dns_getaddrinfo()
1329 switch (pai->ai_family) { in _dns_getaddrinfo()
1377 ai = getanswer(buf, q.n, q.name, q.qtype, pai); in _dns_getaddrinfo()
1384 ai = getanswer(buf2, q2.n, q2.name, q2.qtype, pai); in _dns_getaddrinfo()
1432 _gethtent(FILE **hostf, const char *name, const struct addrinfo *pai) in _gethtent() argument
1442 _DIAGASSERT(pai != NULL); in _gethtent()
1476 hints = *pai; in _gethtent()
1483 res->ai_flags = pai->ai_flags; in _gethtent()
1485 if (pai->ai_flags & AI_CANONNAME) { in _gethtent()
1486 if (get_canonname(pai, res, cname) != 0) { in _gethtent()
1500 const struct addrinfo *pai; in _files_getaddrinfo() local
1509 pai = va_arg(ap, const struct addrinfo *); in _files_getaddrinfo()
1515 while ((p = _gethtent(&hostf, name, pai)) != NULL) { in _files_getaddrinfo()
1531 _yphostent(char *line, const struct addrinfo *pai) in _yphostent() argument
1542 _DIAGASSERT(pai != NULL); in _yphostent()
1581 hints = *pai; in _yphostent()
1587 res->ai_flags = pai->ai_flags; in _yphostent()
1589 if (pai->ai_flags & AI_CANONNAME) in _yphostent()
1590 (void)get_canonname(pai, res, canonname); in _yphostent()
1618 const struct addrinfo *pai; in _yp_getaddrinfo() local
1625 pai = va_arg(ap, const struct addrinfo *); in _yp_getaddrinfo()
1631 if (pai->ai_family == PF_UNSPEC || pai->ai_family == PF_INET) { in _yp_getaddrinfo()
1637 ai4 = *pai; in _yp_getaddrinfo()
1653 ai = _yphostent(ypbuf, pai); in _yp_getaddrinfo()