3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2003, 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.
24 ***************************************************************************/
33 void Curl_global_host_cache_init(void);
34 void Curl_global_host_cache_dtor(void);
35 curl_hash *Curl_global_host_cache_get(void);
37 #define Curl_global_host_cache_use(__p) ((__p)->set.global_dns_cache)
39 struct Curl_dns_entry {
42 long inuse; /* use-counter, make very sure you decrease this
43 when you're done using the address you received */
50 * Curl_resolv() returns an entry with the info for the specified host
53 * The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after
54 * use, or we'll leak memory!
57 struct Curl_dns_entry *Curl_resolv(struct SessionHandle *data,
61 /* unlock a previously resolved dns entry */
62 void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns);
64 /* for debugging purposes only: */
65 void Curl_scan_cache_used(void *user, void *ptr);
68 void Curl_freeaddrinfo(Curl_addrinfo *freeaddr);
70 /* free cached name info */
71 void Curl_freednsinfo(void *freethis);
74 void curl_freeaddrinfo(struct addrinfo *freethis,
75 int line, const char *source);
76 int curl_getaddrinfo(char *hostname, char *service,
77 struct addrinfo *hints,
78 struct addrinfo **result,
79 int line, const char *source);
83 #define CURL_INADDR_NONE (in_addr_t) ~0
85 #define CURL_INADDR_NONE INADDR_NONE