Lines Matching refs:ai
218 #define GET_AI(ai, afd, addr) \ argument
221 (ai) = get_ai(pai, (afd), (addr)); \
222 if ((ai) == NULL) { \
228 #define GET_PORT(ai, serv) \ argument
231 error = get_port((ai), (serv), 0); \
236 #define GET_CANONNAME(ai, str) \ argument
239 error = get_canonname(pai, (ai), (str)); \
268 freeaddrinfo(ai) in freeaddrinfo() argument
269 struct addrinfo *ai; in freeaddrinfo()
274 next = ai->ai_next;
275 if (ai->ai_canonname)
276 free(ai->ai_canonname);
278 free(ai);
279 } while ((ai = next) != NULL);
304 struct addrinfo ai; local
324 pai = &ai;
981 get_canonname(pai, ai, str) in get_canonname() argument
983 struct addrinfo *ai;
987 ai->ai_canonname = strdup(str);
988 if (ai->ai_canonname == NULL)
1001 struct addrinfo *ai; local
1003 ai = (struct addrinfo *)malloc(sizeof(struct addrinfo)
1005 if (ai == NULL)
1008 memcpy(ai, pai, sizeof(struct addrinfo));
1009 ai->ai_addr = (struct sockaddr *)(ai + 1);
1010 memset(ai->ai_addr, 0, afd->a_socklen);
1012 ai->ai_addr->sa_len = afd->a_socklen;
1014 ai->ai_addrlen = afd->a_socklen;
1015 ai->ai_addr->sa_family = ai->ai_family = afd->a_af;
1016 p = (char *)(ai->ai_addr);
1018 return ai;
1022 get_portmatch(ai, servname) in get_portmatch() argument
1023 const struct addrinfo *ai; in get_portmatch()
1028 return get_port((struct addrinfo *)ai, servname, 1);
1032 get_port(ai, servname, matchonly) in get_port() argument
1033 struct addrinfo *ai; in get_port()
1044 switch (ai->ai_family) {
1054 switch (ai->ai_socktype) {
1075 switch (ai->ai_socktype) {
1093 switch (ai->ai_family) {
1095 ((struct sockaddr_in *)ai->ai_addr)->sin_port = port;
1099 ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port = port;