curl_addrinfo.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_ADDRINFO_H
00002 #define HEADER_CURL_ADDRINFO_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
00011  *
00012  * This software is licensed as described in the file COPYING, which
00013  * you should have received as part of this distribution. The terms
00014  * are also available at https://curl.haxx.se/docs/copyright.html.
00015  *
00016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00017  * copies of the Software, and permit persons to whom the Software is
00018  * furnished to do so, under the terms of the COPYING file.
00019  *
00020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00021  * KIND, either express or implied.
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  * Curl_addrinfo is our internal struct definition that we use to allow
00046  * consistent internal handling of this data. We use this even when the
00047  * system provides an addrinfo structure definition. And we use this for
00048  * all sorts of IPv4 and IPV6 builds.
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;   /* Follow rfc3493 struct addrinfo */
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 /* HEADER_CURL_ADDRINFO_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:02