• Home
  • Raw
  • Download

Lines Matching refs:pai

216 	(ai) = get_ai(pai, (afd), (addr)); \
234 error = get_canonname(pai, (ai), (str)); \
299 struct addrinfo *pai; local
317 pai = &ai;
318 pai->ai_flags = 0;
319 pai->ai_family = PF_UNSPEC;
320 pai->ai_socktype = ANY;
321 pai->ai_protocol = ANY;
322 pai->ai_addrlen = 0;
323 pai->ai_canonname = NULL;
324 pai->ai_addr = NULL;
325 pai->ai_next = NULL;
346 memcpy(pai, hints, sizeof(*pai));
352 if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) {
354 if (pai->ai_family != ex->e_af)
360 if (pai->ai_socktype == ex->e_socktype
361 && pai->ai_protocol != ex->e_protocol) {
373 if (MATCH_FAMILY(pai->ai_family, PF_INET, 1)
375 || MATCH_FAMILY(pai->ai_family, PF_INET6, 1)
378 ai0 = *pai;
380 if (pai->ai_family == PF_UNSPEC) {
382 pai->ai_family = PF_INET6;
384 pai->ai_family = PF_INET;
387 error = get_portmatch(pai, servname);
391 *pai = ai0;
394 ai0 = *pai;
398 *pai = ai0;
400 if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
402 if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex)))
404 if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex)))
407 if (pai->ai_family == PF_UNSPEC)
408 pai->ai_family = ex->e_af;
409 if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
410 pai->ai_socktype = ex->e_socktype;
411 if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
412 pai->ai_protocol = ex->e_protocol;
415 error = explore_null(pai, hostname, servname, &cur->ai_next);
417 error = explore_numeric_scope(pai, hostname, servname, &cur->ai_next);
434 if (pai->ai_flags & AI_NUMERICHOST)
445 *pai = ai0;
447 if (!MATCH_FAMILY(pai->ai_family, afd->a_af, 1))
451 *pai = ai0;
453 if (pai->ai_family == PF_UNSPEC)
454 pai->ai_family = afd->a_af;
456 if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
458 if (!MATCH(pai->ai_socktype, ex->e_socktype,
462 if (!MATCH(pai->ai_protocol, ex->e_protocol,
467 if (pai->ai_family == PF_UNSPEC)
468 pai->ai_family = ex->e_af;
469 if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
470 pai->ai_socktype = ex->e_socktype;
471 if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
472 pai->ai_protocol = ex->e_protocol;
474 error = explore_fqdn(pai, hostname, servname,
508 explore_fqdn(pai, hostname, servname, res) in explore_fqdn() argument
509 const struct addrinfo *pai; in explore_fqdn()
540 if (get_portmatch(pai, servname) != 0)
543 afd = find_afd(pai->ai_family);
551 hp = getipnodebyname(hostname, pai->ai_family, AI_ADDRCONFIG, &h_error);
554 hp = gethostbyname2(hostname, pai->ai_family);
556 if (pai->ai_family != AF_INET)
634 if (af != pai->ai_family)
637 if ((pai->ai_flags & AI_CANONNAME) == 0) {
652 ap, pai, servname);
682 explore_null(pai, hostname, servname, res) in explore_null() argument
683 const struct addrinfo *pai; in explore_null()
702 s = socket(pai->ai_family, SOCK_DGRAM, 0);
712 if (get_portmatch(pai, servname) != 0)
715 afd = find_afd(pai->ai_family);
717 if (pai->ai_flags & AI_PASSIVE) {
745 explore_numeric(pai, hostname, servname, res) in explore_numeric() argument
746 const struct addrinfo *pai; in explore_numeric()
765 if (get_portmatch(pai, servname) != 0)
768 afd = find_afd(pai->ai_family);
769 flags = pai->ai_flags;
795 if (pai->ai_family == afd->a_af ||
796 pai->ai_family == PF_UNSPEC /*?*/) {
812 pton, pai, servname);
834 explore_numeric_scope(pai, hostname, servname, res) in explore_numeric_scope() argument
835 const struct addrinfo *pai; in explore_numeric_scope()
841 return explore_numeric(pai, hostname, servname, res);
853 if (get_portmatch(pai, servname) != 0)
856 afd = find_afd(pai->ai_family);
858 return explore_numeric(pai, hostname, servname, res);
862 return explore_numeric(pai, hostname, servname, res);
874 switch (pai->ai_family) {
886 error = explore_numeric(pai, hostname2, servname, res);
905 get_name(addr, afd, res, numaddr, pai, servname) in get_name() argument
910 const struct addrinfo *pai;
974 get_canonname(pai, ai, str) in get_canonname() argument
975 const struct addrinfo *pai; in get_canonname()
979 if ((pai->ai_flags & AI_CANONNAME) != 0) {
989 get_ai(pai, afd, addr) in get_ai() argument
990 const struct addrinfo *pai; in get_ai()
1002 memcpy(ai, pai, sizeof(struct addrinfo));