3
/***************************************************************************
5
* Project ___| | | | _ \| |
7
* | (__| |_| | _ <| |___
8
* \___|\___/|_| \_\_____|
10
* Copyright (C) 1998 - 2002, 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: hostip.h,v 1.4 2003/08/07 21:47:53 andy Exp $
24
***************************************************************************/
32
void Curl_global_host_cache_init(void);
33
void Curl_global_host_cache_dtor(void);
34
curl_hash *Curl_global_host_cache_get(void);
36
#define Curl_global_host_cache_use(__p) ((__p)->set.global_dns_cache)
38
struct Curl_dns_entry {
41
long inuse; /* use-counter, make very sure you decrease this
42
when you're done using the address you received */
49
* Curl_resolv() returns an entry with the info for the specified host
52
* The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after
53
* use, or we'll leak memory!
56
struct Curl_dns_entry *Curl_resolv(struct SessionHandle *data,
60
/* unlock a previously resolved dns entry */
61
#define Curl_resolv_unlock(dns) dns->inuse--
63
/* for debugging purposes only: */
64
void Curl_scan_cache_used(void *user, void *ptr);
67
void Curl_freeaddrinfo(Curl_addrinfo *freeaddr);
69
/* free cached name info */
70
void Curl_freednsinfo(void *freethis);
73
void curl_freeaddrinfo(struct addrinfo *freethis,
74
int line, const char *source);
75
int curl_getaddrinfo(char *hostname, char *service,
76
struct addrinfo *hints,
77
struct addrinfo **result,
78
int line, const char *source);