Lines Matching refs:pai

221 	(ai) = get_ai(pai, (afd), (addr)); \
239 error = get_canonname(pai, (ai), (str)); \
306 struct addrinfo *pai; local
324 pai = &ai;
325 pai->ai_flags = 0;
326 pai->ai_family = PF_UNSPEC;
327 pai->ai_socktype = ANY;
328 pai->ai_protocol = ANY;
329 pai->ai_addrlen = 0;
330 pai->ai_canonname = NULL;
331 pai->ai_addr = NULL;
332 pai->ai_next = NULL;
353 memcpy(pai, hints, sizeof(*pai));
359 if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) {
361 if (pai->ai_family != ex->e_af)
367 if (pai->ai_socktype == ex->e_socktype
368 && pai->ai_protocol != ex->e_protocol) {
380 if (MATCH_FAMILY(pai->ai_family, PF_INET, 1)
382 || MATCH_FAMILY(pai->ai_family, PF_INET6, 1)
385 ai0 = *pai;
387 if (pai->ai_family == PF_UNSPEC) {
389 pai->ai_family = PF_INET6;
391 pai->ai_family = PF_INET;
394 error = get_portmatch(pai, servname);
398 *pai = ai0;
401 ai0 = *pai;
405 *pai = ai0;
407 if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
409 if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex)))
411 if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex)))
414 if (pai->ai_family == PF_UNSPEC)
415 pai->ai_family = ex->e_af;
416 if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
417 pai->ai_socktype = ex->e_socktype;
418 if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
419 pai->ai_protocol = ex->e_protocol;
422 error = explore_null(pai, hostname, servname, &cur->ai_next);
424 error = explore_numeric_scope(pai, hostname, servname, &cur->ai_next);
441 if (pai->ai_flags & AI_NUMERICHOST)
452 *pai = ai0;
454 if (!MATCH_FAMILY(pai->ai_family, afd->a_af, 1))
458 *pai = ai0;
460 if (pai->ai_family == PF_UNSPEC)
461 pai->ai_family = afd->a_af;
463 if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
465 if (!MATCH(pai->ai_socktype, ex->e_socktype,
469 if (!MATCH(pai->ai_protocol, ex->e_protocol,
474 if (pai->ai_family == PF_UNSPEC)
475 pai->ai_family = ex->e_af;
476 if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
477 pai->ai_socktype = ex->e_socktype;
478 if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
479 pai->ai_protocol = ex->e_protocol;
481 error = explore_fqdn(pai, hostname, servname,
515 explore_fqdn(pai, hostname, servname, res) in explore_fqdn() argument
516 const struct addrinfo *pai; in explore_fqdn()
547 if (get_portmatch(pai, servname) != 0)
550 afd = find_afd(pai->ai_family);
558 hp = getipnodebyname(hostname, pai->ai_family, AI_ADDRCONFIG, &h_error);
561 hp = gethostbyname2(hostname, pai->ai_family);
563 if (pai->ai_family != AF_INET)
641 if (af != pai->ai_family)
644 if ((pai->ai_flags & AI_CANONNAME) == 0) {
659 ap, pai, servname);
689 explore_null(pai, hostname, servname, res) in explore_null() argument
690 const struct addrinfo *pai; in explore_null()
709 s = socket(pai->ai_family, SOCK_DGRAM, 0);
719 if (get_portmatch(pai, servname) != 0)
722 afd = find_afd(pai->ai_family);
724 if (pai->ai_flags & AI_PASSIVE) {
752 explore_numeric(pai, hostname, servname, res) in explore_numeric() argument
753 const struct addrinfo *pai; in explore_numeric()
772 if (get_portmatch(pai, servname) != 0)
775 afd = find_afd(pai->ai_family);
776 flags = pai->ai_flags;
802 if (pai->ai_family == afd->a_af ||
803 pai->ai_family == PF_UNSPEC /*?*/) {
819 pton, pai, servname);
841 explore_numeric_scope(pai, hostname, servname, res) in explore_numeric_scope() argument
842 const struct addrinfo *pai; in explore_numeric_scope()
848 return explore_numeric(pai, hostname, servname, res);
860 if (get_portmatch(pai, servname) != 0)
863 afd = find_afd(pai->ai_family);
865 return explore_numeric(pai, hostname, servname, res);
869 return explore_numeric(pai, hostname, servname, res);
881 switch (pai->ai_family) {
893 error = explore_numeric(pai, hostname2, servname, res);
912 get_name(addr, afd, res, numaddr, pai, servname) in get_name() argument
917 const struct addrinfo *pai;
981 get_canonname(pai, ai, str) in get_canonname() argument
982 const struct addrinfo *pai; in get_canonname()
986 if ((pai->ai_flags & AI_CANONNAME) != 0) {
995 get_ai(pai, afd, addr) in get_ai() argument
996 const struct addrinfo *pai; in get_ai()
1008 memcpy(ai, pai, sizeof(struct addrinfo));