Lines Matching refs:pai

226 	(ai) = get_ai(pai, (afd), (addr)); \
244 error = get_canonname(pai, (ai), (str)); \
311 struct addrinfo *pai; local
329 pai = &ai;
330 pai->ai_flags = 0;
331 pai->ai_family = PF_UNSPEC;
332 pai->ai_socktype = ANY;
333 pai->ai_protocol = ANY;
334 pai->ai_addrlen = 0;
335 pai->ai_canonname = NULL;
336 pai->ai_addr = NULL;
337 pai->ai_next = NULL;
358 memcpy(pai, hints, sizeof(*pai));
364 if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) {
366 if (pai->ai_family != ex->e_af)
372 if (pai->ai_socktype == ex->e_socktype
373 && pai->ai_protocol != ex->e_protocol) {
385 if (MATCH_FAMILY(pai->ai_family, PF_INET, 1)
387 || MATCH_FAMILY(pai->ai_family, PF_INET6, 1)
390 ai0 = *pai;
392 if (pai->ai_family == PF_UNSPEC) {
394 pai->ai_family = PF_INET6;
396 pai->ai_family = PF_INET;
399 error = get_portmatch(pai, servname);
403 *pai = ai0;
406 ai0 = *pai;
410 *pai = ai0;
412 if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
414 if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex)))
416 if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex)))
419 if (pai->ai_family == PF_UNSPEC)
420 pai->ai_family = ex->e_af;
421 if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
422 pai->ai_socktype = ex->e_socktype;
423 if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
424 pai->ai_protocol = ex->e_protocol;
427 error = explore_null(pai, hostname, servname, &cur->ai_next);
429 error = explore_numeric_scope(pai, hostname, servname, &cur->ai_next);
446 if (pai->ai_flags & AI_NUMERICHOST)
457 *pai = ai0;
459 if (!MATCH_FAMILY(pai->ai_family, afd->a_af, 1))
463 *pai = ai0;
465 if (pai->ai_family == PF_UNSPEC)
466 pai->ai_family = afd->a_af;
468 if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
470 if (!MATCH(pai->ai_socktype, ex->e_socktype,
474 if (!MATCH(pai->ai_protocol, ex->e_protocol,
479 if (pai->ai_family == PF_UNSPEC)
480 pai->ai_family = ex->e_af;
481 if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
482 pai->ai_socktype = ex->e_socktype;
483 if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
484 pai->ai_protocol = ex->e_protocol;
486 error = explore_fqdn(pai, hostname, servname,
520 explore_fqdn(pai, hostname, servname, res) in explore_fqdn() argument
521 const struct addrinfo *pai; in explore_fqdn()
552 if (get_portmatch(pai, servname) != 0)
555 afd = find_afd(pai->ai_family);
563 hp = getipnodebyname(hostname, pai->ai_family, AI_ADDRCONFIG, &h_error);
566 hp = gethostbyname2(hostname, pai->ai_family);
568 if (pai->ai_family != AF_INET)
646 if (af != pai->ai_family)
649 if ((pai->ai_flags & AI_CANONNAME) == 0) {
664 ap, pai, servname);
694 explore_null(pai, hostname, servname, res) in explore_null() argument
695 const struct addrinfo *pai; in explore_null()
714 s = socket(pai->ai_family, SOCK_DGRAM, 0);
724 if (get_portmatch(pai, servname) != 0)
727 afd = find_afd(pai->ai_family);
729 if (pai->ai_flags & AI_PASSIVE) {
757 explore_numeric(pai, hostname, servname, res) in explore_numeric() argument
758 const struct addrinfo *pai; in explore_numeric()
777 if (get_portmatch(pai, servname) != 0)
780 afd = find_afd(pai->ai_family);
781 flags = pai->ai_flags;
807 if (pai->ai_family == afd->a_af ||
808 pai->ai_family == PF_UNSPEC /*?*/) {
824 pton, pai, servname);
846 explore_numeric_scope(pai, hostname, servname, res) in explore_numeric_scope() argument
847 const struct addrinfo *pai; in explore_numeric_scope()
853 return explore_numeric(pai, hostname, servname, res);
865 if (get_portmatch(pai, servname) != 0)
868 afd = find_afd(pai->ai_family);
870 return explore_numeric(pai, hostname, servname, res);
874 return explore_numeric(pai, hostname, servname, res);
886 switch (pai->ai_family) {
898 error = explore_numeric(pai, hostname2, servname, res);
917 get_name(addr, afd, res, numaddr, pai, servname) in get_name() argument
922 const struct addrinfo *pai;
986 get_canonname(pai, ai, str) in get_canonname() argument
987 const struct addrinfo *pai; in get_canonname()
991 if ((pai->ai_flags & AI_CANONNAME) != 0) {
1000 get_ai(pai, afd, addr) in get_ai() argument
1001 const struct addrinfo *pai; in get_ai()
1013 memcpy(ai, pai, sizeof(struct addrinfo));