25 #ifdef HAVE_NETINET_IN_H 26 #include <netinet/in.h> 31 #ifdef HAVE_ARPA_INET_H 32 #include <arpa/inet.h> 62 #if defined(CURLDEBUG) && defined(HAVE_GETNAMEINFO) 78 int line,
const char *source)
86 curl_memlog(
"GETNAME %s:%d getnameinfo()\n",
89 curl_memlog(
"GETNAME %s:%d getnameinfo() failed = %d\n",
103 static int ipv6_works = -1;
104 if(-1 == ipv6_works) {
130 #if defined(CURLRES_SYNCH) 132 #ifdef DEBUG_ADDRINFO 135 printf(
"dump_addrinfo:\n");
137 char buf[INET6_ADDRSTRLEN];
139 printf(
" fam %2d, CNAME %s, ",
148 #define dump_addrinfo(x,y) Curl_nop_stmt 165 struct addrinfo hints;
169 char *sbufptr = NULL;
170 #ifndef USE_RESOLVE_ON_IPS 174 #if !defined(CURL_DISABLE_VERBOSE_STRINGS) 197 memset(&hints, 0,
sizeof(hints));
198 hints.ai_family = pf;
201 #ifndef USE_RESOLVE_ON_IPS 209 hints.ai_flags = AI_NUMERICHOST;
214 snprintf(sbuf,
sizeof(sbuf),
"%d", port);
218 error = Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &res);
220 infof(data,
"getaddrinfo(3) failed for %s:%d\n", hostname, port);
225 Curl_addrinfo_set_port(res, port);
228 dump_addrinfo(conn, res);
#define CURL_IPRESOLVE_V6
#define GETNAMEINFO_TYPE_ARG7
#define GETNAMEINFO_TYPE_ARG2
#define CURL_IPRESOLVE_V4
int Curl_closesocket(struct connectdata *conn, curl_socket_t sock)
#define GETNAMEINFO_TYPE_ARG1
bool Curl_ipvalid(struct connectdata *conn)
const char * Curl_strerror(struct connectdata *conn, int err)
const char * Curl_printable_address(const Curl_addrinfo *ai, char *buf, size_t bufsize)
int Curl_inet_pton(int af, const char *src, void *dst)
static unsigned short port
struct Curl_addrinfo * ai_next
#define GETNAMEINFO_TYPE_ARG46
#define GETNAMEINFO_QUAL_ARG1
Curl_addrinfo * Curl_getaddrinfo(struct connectdata *conn, const char *hostname, int port, int *waitp)