25 #ifdef HAVE_NETINET_IN_H 26 #include <netinet/in.h> 31 #ifdef HAVE_ARPA_INET_H 32 #include <arpa/inet.h> 98 #ifdef CURL_DISABLE_VERBOSE_STRINGS 106 infof(conn->
data,
"Curl_ipv4_resolve_r failed for %s\n", hostname);
113 #if defined(CURLRES_IPV4) && !defined(CURLRES_ARES) 125 #if !defined(HAVE_GETADDRINFO_THREADSAFE) && defined(HAVE_GETHOSTBYNAME_R_3) 129 struct hostent *h = NULL;
131 struct hostent *
buf = NULL;
137 #if defined(HAVE_GETADDRINFO_THREADSAFE) 139 struct addrinfo hints;
141 char *sbufptr = NULL;
143 memset(&hints, 0,
sizeof(hints));
144 hints.ai_family = PF_INET;
145 hints.ai_socktype = SOCK_STREAM;
147 snprintf(sbuf,
sizeof(sbuf),
"%d", port);
151 (void)Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &ai);
153 #elif defined(HAVE_GETHOSTBYNAME_R) 171 #if defined(HAVE_GETHOSTBYNAME_R_5) 173 h = gethostbyname_r(hostname,
174 (
struct hostent *)buf,
175 (
char *)buf +
sizeof(
struct hostent),
189 #elif defined(HAVE_GETHOSTBYNAME_R_6) 192 (void)gethostbyname_r(hostname,
193 (
struct hostent *)
buf,
194 (
char *)buf +
sizeof(
struct hostent),
230 #elif defined(HAVE_GETHOSTBYNAME_R_3) 252 (
sizeof(
struct hostent) +
sizeof(
struct hostent_data))) {
259 res = gethostbyname_r(hostname,
260 (
struct hostent *)buf,
261 (
struct hostent_data *)((
char *)buf +
262 sizeof(
struct hostent)));
294 h = gethostbyname((
void *)hostname);
#define CURL_IPRESOLVE_V6
Curl_addrinfo * Curl_getaddrinfo(struct connectdata *conn, const char *hostname, int port, int *waitp)
#define CURL_HOSTENT_SIZE
Curl_addrinfo * Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port)
Curl_addrinfo * Curl_ipv4_resolve_r(const char *hostname, int port)
int Curl_inet_pton(int af, const char *src, void *dst)
static unsigned short port
bool Curl_ipvalid(struct connectdata *conn)
Curl_addrinfo * Curl_he2ai(const struct hostent *he, int port)
#define calloc(nbelem, size)