• Home
  • Raw
  • Download

Lines Matching refs:pai

143 static int dns_getaddrinfo(const char* name, const addrinfo* pai,
150 static bool files_getaddrinfo(const size_t netid, const char* name, const addrinfo* pai,
183 (ai) = get_ai(pai, (afd), (addr)); \
461 static int explore_fqdn(const addrinfo* pai, const char* hostname, const char* servname, in explore_fqdn() argument
464 assert(pai != nullptr); in explore_fqdn()
473 if ((error = get_portmatch(pai, servname))) return error; in explore_fqdn()
475 if (!files_getaddrinfo(netcontext->dns_netid, hostname, pai, &result)) { in explore_fqdn()
476 error = dns_getaddrinfo(hostname, pai, netcontext, &result, event); in explore_fqdn()
499 static int explore_null(const struct addrinfo* pai, const char* servname, struct addrinfo** res) { in explore_null() argument
508 assert(pai != NULL); in explore_null()
520 s = socket(pai->ai_family, SOCK_DGRAM | SOCK_CLOEXEC, 0); in explore_null()
529 if (get_portmatch(pai, servname) != 0) return 0; in explore_null()
531 afd = find_afd(pai->ai_family); in explore_null()
534 if (pai->ai_flags & AI_PASSIVE) { in explore_null()
554 static int explore_numeric(const struct addrinfo* pai, const char* hostname, const char* servname, in explore_numeric() argument
562 assert(pai != NULL); in explore_numeric()
574 if (get_portmatch(pai, servname) != 0) return 0; in explore_numeric()
576 afd = find_afd(pai->ai_family); in explore_numeric()
580 if (pai->ai_family == afd->a_af || pai->ai_family == PF_UNSPEC /*?*/) { in explore_numeric()
583 if ((pai->ai_flags & AI_CANONNAME)) { in explore_numeric()
589 error = get_canonname(pai, cur->ai_next, canonname); in explore_numeric()
611 static int explore_numeric_scope(const struct addrinfo* pai, const char* hostname, in explore_numeric_scope() argument
621 assert(pai != NULL); in explore_numeric_scope()
629 if (get_portmatch(pai, servname) != 0) return 0; in explore_numeric_scope()
631 afd = find_afd(pai->ai_family); in explore_numeric_scope()
634 if (!afd->a_scoped) return explore_numeric(pai, hostname, servname, res, hostname); in explore_numeric_scope()
637 if (cp == NULL) return explore_numeric(pai, hostname, servname, res, hostname); in explore_numeric_scope()
649 error = explore_numeric(pai, addr, servname, res, hostname); in explore_numeric_scope()
669 static int get_canonname(const struct addrinfo* pai, struct addrinfo* ai, const char* str) { in get_canonname() argument
670 assert(pai != NULL); in get_canonname()
674 if ((pai->ai_flags & AI_CANONNAME) != 0) { in get_canonname()
681 static struct addrinfo* get_ai(const struct addrinfo* pai, const struct afd* afd, in get_ai() argument
686 assert(pai != NULL); in get_ai()
693 memcpy(ai, pai, sizeof(struct addrinfo)); in get_ai()
841 int qtype, const struct addrinfo* pai, int* herrno) { in getanswer() argument
858 assert(pai != NULL); in getanswer()
996 ai = *pai; in getanswer()
1015 (void) get_canonname(pai, sentinel.ai_next, qname); in getanswer()
1017 (void) get_canonname(pai, sentinel.ai_next, canonname); in getanswer()
1393 static int dns_getaddrinfo(const char* name, const addrinfo* pai, in dns_getaddrinfo() argument
1399 switch (pai->ai_family) { in dns_getaddrinfo()
1405 if (pai->ai_flags & AI_ADDRCONFIG) { in dns_getaddrinfo()
1450 addrinfo* ai = getanswer(q.answer, q.n, q.name, q.qtype, pai, &he); in dns_getaddrinfo()
1456 ai = getanswer(q2.answer, q2.n, q2.name, q2.qtype, pai, &he); in dns_getaddrinfo()
1485 static struct addrinfo* _gethtent(FILE** hostf, const char* name, const struct addrinfo* pai) { in _gethtent() argument
1494 assert(pai != NULL); in _gethtent()
1520 error = getaddrinfo_numeric(addr, nullptr, *pai, &res0); in _gethtent()
1524 res->ai_flags = pai->ai_flags; in _gethtent()
1526 if (pai->ai_flags & AI_CANONNAME) { in _gethtent()
1527 if (get_canonname(pai, res, cname) != 0) { in _gethtent()
1537 const struct addrinfo* _Nonnull pai) { in getCustomHosts() argument
1543 int error = getaddrinfo_numeric(host.c_str(), nullptr, *pai, &res0); in getCustomHosts()
1553 static bool files_getaddrinfo(const size_t netid, const char* name, const addrinfo* pai, in files_getaddrinfo() argument
1561 while ((p = _gethtent(&hostf, name, pai)) != nullptr) { in files_getaddrinfo()
1567 if ((p = getCustomHosts(netid, name, pai)) != nullptr) { in files_getaddrinfo()