Go to the documentation of this file.00001 #ifndef HEADER_CURL_ADDRINFO_H
00002 #define HEADER_CURL_ADDRINFO_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "curl_setup.h"
00026
00027 #ifdef HAVE_NETINET_IN_H
00028 # include <netinet/in.h>
00029 #endif
00030 #ifdef HAVE_NETDB_H
00031 # include <netdb.h>
00032 #endif
00033 #ifdef HAVE_ARPA_INET_H
00034 # include <arpa/inet.h>
00035 #endif
00036
00037 #ifdef __VMS
00038 # include <in.h>
00039 # include <inet.h>
00040 # include <stdlib.h>
00041 #endif
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 struct Curl_addrinfo {
00052 int ai_flags;
00053 int ai_family;
00054 int ai_socktype;
00055 int ai_protocol;
00056 curl_socklen_t ai_addrlen;
00057 char *ai_canonname;
00058 struct sockaddr *ai_addr;
00059 struct Curl_addrinfo *ai_next;
00060 };
00061 typedef struct Curl_addrinfo Curl_addrinfo;
00062
00063 void
00064 Curl_freeaddrinfo(Curl_addrinfo *cahead);
00065
00066 #ifdef HAVE_GETADDRINFO
00067 int
00068 Curl_getaddrinfo_ex(const char *nodename,
00069 const char *servname,
00070 const struct addrinfo *hints,
00071 Curl_addrinfo **result);
00072 #endif
00073
00074 Curl_addrinfo *
00075 Curl_he2ai(const struct hostent *he, int port);
00076
00077 Curl_addrinfo *
00078 Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port);
00079
00080 Curl_addrinfo *Curl_str2addr(char *dotted, int port);
00081
00082 #ifdef USE_UNIX_SOCKETS
00083 Curl_addrinfo *Curl_unix2addr(const char *path, int *longpath);
00084 #endif
00085
00086 #if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) && \
00087 defined(HAVE_FREEADDRINFO)
00088 void
00089 curl_dofreeaddrinfo(struct addrinfo *freethis,
00090 int line, const char *source);
00091 #endif
00092
00093 #if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO)
00094 int
00095 curl_dogetaddrinfo(const char *hostname,
00096 const char *service,
00097 const struct addrinfo *hints,
00098 struct addrinfo **result,
00099 int line, const char *source);
00100 #endif
00101
00102 #ifdef HAVE_GETADDRINFO
00103 #ifdef USE_RESOLVE_ON_IPS
00104 void Curl_addrinfo_set_port(Curl_addrinfo *addrinfo, int port);
00105 #else
00106 #define Curl_addrinfo_set_port(x,y)
00107 #endif
00108 #endif
00109
00110 #endif