1
#ifndef HEADER_CURL_ADDRINFO_H
2
#define HEADER_CURL_ADDRINFO_H
3
/***************************************************************************
5
* Project ___| | | | _ \| |
7
* | (__| |_| | _ <| |___
8
* \___|\___/|_| \_\_____|
10
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
12
* This software is licensed as described in the file COPYING, which
13
* you should have received as part of this distribution. The terms
14
* are also available at http://curl.haxx.se/docs/copyright.html.
16
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
17
* copies of the Software, and permit persons to whom the Software is
18
* furnished to do so, under the terms of the COPYING file.
20
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21
* KIND, either express or implied.
23
* $Id: curl_addrinfo.h,v 1.3 2008-11-06 17:19:57 yangtse Exp $
24
***************************************************************************/
28
#ifdef HAVE_SYS_SOCKET_H
29
# include <sys/socket.h>
31
#ifdef HAVE_NETINET_IN_H
32
# include <netinet/in.h>
37
#ifdef HAVE_ARPA_INET_H
38
# include <arpa/inet.h>
49
* Curl_addrinfo is our internal struct definition that we use to allow
50
* consistent internal handling of this data. We use this even when the
51
* system provides an addrinfo structure definition. And we use this for
52
* all sorts of IPv4 and IPV6 builds.
55
struct Curl_addrinfo {
60
socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
62
struct sockaddr *ai_addr;
63
struct Curl_addrinfo *ai_next;
65
typedef struct Curl_addrinfo Curl_addrinfo;
68
Curl_freeaddrinfo(Curl_addrinfo *cahead);
70
#ifdef HAVE_GETADDRINFO
72
Curl_getaddrinfo_ex(const char *nodename,
74
const struct addrinfo *hints,
75
Curl_addrinfo **result);
79
Curl_he2ai(const struct hostent *he, int port);
82
Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port);
84
#if defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO)
86
curl_dofreeaddrinfo(struct addrinfo *freethis,
87
int line, const char *source);
90
#if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO)
92
curl_dogetaddrinfo(const char *hostname,
94
const struct addrinfo *hints,
95
struct addrinfo **result,
96
int line, const char *source);
99
#endif /* HEADER_CURL_ADDRINFO_H */