Lines Matching refs:ai
157 #define GET_CANONNAME(ai, str) \ argument
159 if (((ai)->ai_canonname = (char *)malloc(strlen(str) + 1)) != NULL) {\
160 strcpy((ai)->ai_canonname, (str));\
168 #define GET_AI(ai, gai_afd, addr, port) {\ argument
170 if (((ai) = (struct addrinfo *)malloc(sizeof(struct addrinfo) +\
173 memcpy(ai, pai, sizeof(struct addrinfo));\
174 (ai)->ai_addr = (struct sockaddr *)((ai) + 1);\
175 memset((ai)->ai_addr, 0, (gai_afd)->a_socklen);\
176 (ai)->ai_addr->sa_len = (ai)->ai_addrlen = (gai_afd)->a_socklen;\
177 (ai)->ai_addr->sa_family = (ai)->ai_family = (gai_afd)->a_af;\
178 ((struct sockinet *)(ai)->ai_addr)->si_port = port;\
179 p = (char *)((ai)->ai_addr);\
183 #define GET_AI(ai, gai_afd, addr, port) {\ argument
185 if (((ai) = (struct addrinfo *)malloc(sizeof(struct addrinfo) +\
188 memcpy(ai, pai, sizeof(struct addrinfo));\
189 (ai)->ai_addr = (struct sockaddr *)((ai) + 1);\
190 memset((ai)->ai_addr, 0, (gai_afd)->a_socklen);\
191 (ai)->ai_addrlen = (gai_afd)->a_socklen;\
192 (ai)->ai_addr->sa_family = (ai)->ai_family = (gai_afd)->a_af;\
193 ((struct sockinet *)(ai)->ai_addr)->si_port = port;\
194 p = (char *)((ai)->ai_addr);\
210 freeaddrinfo(struct addrinfo *ai) in freeaddrinfo() argument
215 next = ai->ai_next; in freeaddrinfo()
216 if (ai->ai_canonname) in freeaddrinfo()
217 free(ai->ai_canonname); in freeaddrinfo()
219 free(ai); in freeaddrinfo()
220 } while ((ai = next) != NULL); in freeaddrinfo()
244 struct addrinfo ai; in getaddrinfo() local
265 pai = &ai; in getaddrinfo()