Lines Matching refs:ai
111 const struct addrinfo *ai; in Curl_getaddrinfo_ex() local
127 for(ai = aihead; ai != NULL; ai = ai->ai_next) { in Curl_getaddrinfo_ex()
128 size_t namelen = ai->ai_canonname ? strlen(ai->ai_canonname) + 1 : 0; in Curl_getaddrinfo_ex()
131 if(ai->ai_family == AF_INET) in Curl_getaddrinfo_ex()
134 else if(ai->ai_family == AF_INET6) in Curl_getaddrinfo_ex()
141 if(!ai->ai_addr || !(ai->ai_addrlen > 0)) in Curl_getaddrinfo_ex()
145 if((size_t)ai->ai_addrlen < ss_size) in Curl_getaddrinfo_ex()
157 ca->ai_flags = ai->ai_flags; in Curl_getaddrinfo_ex()
158 ca->ai_family = ai->ai_family; in Curl_getaddrinfo_ex()
159 ca->ai_socktype = ai->ai_socktype; in Curl_getaddrinfo_ex()
160 ca->ai_protocol = ai->ai_protocol; in Curl_getaddrinfo_ex()
167 memcpy(ca->ai_addr, ai->ai_addr, ss_size); in Curl_getaddrinfo_ex()
171 memcpy(ca->ai_canonname, ai->ai_canonname, namelen); in Curl_getaddrinfo_ex()
259 struct Curl_addrinfo *ai; in Curl_he2ai() local
287 ai = calloc(1, sizeof(struct Curl_addrinfo) + ss_size + namelen); in Curl_he2ai()
288 if(!ai) { in Curl_he2ai()
293 ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo)); in Curl_he2ai()
295 ai->ai_canonname = (char *)ai->ai_addr + ss_size; in Curl_he2ai()
296 memcpy(ai->ai_canonname, he->h_name, namelen); in Curl_he2ai()
300 firstai = ai; in Curl_he2ai()
304 prevai->ai_next = ai; in Curl_he2ai()
306 ai->ai_family = he->h_addrtype; in Curl_he2ai()
310 ai->ai_socktype = SOCK_STREAM; in Curl_he2ai()
312 ai->ai_addrlen = (curl_socklen_t)ss_size; in Curl_he2ai()
316 switch(ai->ai_family) { in Curl_he2ai()
318 addr = (void *)ai->ai_addr; /* storage area for this info */ in Curl_he2ai()
331 addr6 = (void *)ai->ai_addr; /* storage area for this info */ in Curl_he2ai()
344 prevai = ai; in Curl_he2ai()
368 struct Curl_addrinfo *ai; in Curl_ip2addr() local
390 ai = calloc(1, sizeof(struct Curl_addrinfo) + addrsize + namelen); in Curl_ip2addr()
391 if(!ai) in Curl_ip2addr()
394 ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo)); in Curl_ip2addr()
396 ai->ai_canonname = (char *)ai->ai_addr + addrsize; in Curl_ip2addr()
397 memcpy(ai->ai_canonname, hostname, namelen); in Curl_ip2addr()
398 ai->ai_family = af; in Curl_ip2addr()
399 ai->ai_socktype = SOCK_STREAM; in Curl_ip2addr()
400 ai->ai_addrlen = (curl_socklen_t)addrsize; in Curl_ip2addr()
405 addr = (void *)ai->ai_addr; /* storage area for this info */ in Curl_ip2addr()
418 addr6 = (void *)ai->ai_addr; /* storage area for this info */ in Curl_ip2addr()
431 return ai; in Curl_ip2addr()
464 struct Curl_addrinfo *ai; in Curl_unix2addr() local
470 ai = calloc(1, sizeof(struct Curl_addrinfo) + sizeof(struct sockaddr_un)); in Curl_unix2addr()
471 if(!ai) in Curl_unix2addr()
473 ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo)); in Curl_unix2addr()
475 sa_un = (void *) ai->ai_addr; in Curl_unix2addr()
481 free(ai); in Curl_unix2addr()
486 ai->ai_family = AF_UNIX; in Curl_unix2addr()
487 ai->ai_socktype = SOCK_STREAM; /* assume reliable transport for HTTP */ in Curl_unix2addr()
488 ai->ai_addrlen = (curl_socklen_t) in Curl_unix2addr()
497 return ai; in Curl_unix2addr()