Lines Matching defs:ai
125 #define GET_CANONNAME(ai, str) \
127 if (((ai)->ai_canonname = (char *)malloc(strlen(str) + 1)) != NULL) {\
128 strcpy((ai)->ai_canonname, (str));\
136 #define SET_AILEN(ai,l) (ai)->ai_addr->sa_len = (ai)->ai_addrlen = (l)
138 #define SET_AILEN(ai,l) (ai)->ai_addrlen = (l)
141 #define GET_AI(ai, afd, addr, port) {\
143 if (((ai) = (struct addrinfo *)malloc(sizeof(struct addrinfo) +\
149 memcpy(ai, pai, sizeof(struct addrinfo));\
150 (ai)->ai_addr = (struct sockaddr *)((ai) + 1);\
151 memset((ai)->ai_addr, 0, (afd)->a_socklen);\
152 SET_AILEN((ai), (afd)->a_socklen);\
153 (ai)->ai_addr->sa_family = (ai)->ai_family = (afd)->a_af;\
154 ((struct sockinet *)(ai)->ai_addr)->si_port = port;\
155 p = (char *)((ai)->ai_addr);\
171 freeaddrinfo(ai)
172 struct addrinfo *ai;
177 next = ai->ai_next;
178 if (ai->ai_canonname)
179 free(ai->ai_canonname);
180 /* no need to free(ai->ai_addr) */
181 free(ai);
182 } while ((ai = next) != NULL);
209 struct addrinfo ai;
216 pai = &ai;
406 * fail, return ai anyway to pacify