Lines Matching refs:afd
71 const struct afd { struct
135 static struct addrinfo* get_ai(const struct addrinfo*, const struct afd*, const char*);
138 static const struct afd* find_afd(int);
177 #define GET_AI(ai, afd, addr) \ argument
180 (ai) = get_ai(pai, (afd), (addr)); \
478 const struct afd* afd; in explore_null() local
508 afd = find_afd(pai->ai_family); in explore_null()
509 if (afd == NULL) return 0; in explore_null()
512 GET_AI(cur->ai_next, afd, afd->a_addrany); in explore_null()
515 GET_AI(cur->ai_next, afd, afd->a_loopback); in explore_null()
533 const struct afd* afd; in explore_numeric() local
553 afd = find_afd(pai->ai_family); in explore_numeric()
554 if (afd == NULL) return 0; in explore_numeric()
556 if (inet_pton(afd->a_af, hostname, pton) == 1) { in explore_numeric()
557 if (pai->ai_family == afd->a_af || pai->ai_family == PF_UNSPEC /*?*/) { in explore_numeric()
558 GET_AI(cur->ai_next, afd, pton); in explore_numeric()
590 const struct afd* afd; in explore_numeric_scope() local
608 afd = find_afd(pai->ai_family); in explore_numeric_scope()
609 if (afd == NULL) return 0; in explore_numeric_scope()
611 if (!afd->a_scoped) return explore_numeric(pai, hostname, servname, res, hostname); in explore_numeric_scope()
658 static struct addrinfo* get_ai(const struct addrinfo* pai, const struct afd* afd, in get_ai() argument
664 assert(afd != NULL); in get_ai()
674 ai->ai_addrlen = afd->a_socklen; in get_ai()
675 ai->ai_addr->sa_family = ai->ai_family = afd->a_af; in get_ai()
677 memcpy(p + afd->a_off, addr, (size_t) afd->a_addrlen); in get_ai()
758 static const struct afd* find_afd(int af) { in find_afd()
759 const struct afd* afd; in find_afd() local
762 for (afd = afdl; afd->a_af; afd++) { in find_afd()
763 if (afd->a_af == af) return afd; in find_afd()
833 const struct afd* afd; in getanswer() local
986 afd = find_afd(ai.ai_family); in getanswer()
987 if (afd == NULL) { in getanswer()
991 cur->ai_next = get_ai(&ai, afd, (const char*) cp); in getanswer()