3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2004, 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 ***************************************************************************/
34 void Curl_global_host_cache_init(void);
35 void Curl_global_host_cache_dtor(void);
36 curl_hash *Curl_global_host_cache_get(void);
38 #define Curl_global_host_cache_use(__p) ((__p)->set.global_dns_cache)
40 struct Curl_dns_entry {
43 long inuse; /* use-counter, make very sure you decrease this
44 when you're done using the address you received */
48 * Curl_resolv() returns an entry with the info for the specified host
51 * The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after
52 * use, or we'll leak memory!
55 int Curl_resolv(struct connectdata *conn,
58 struct Curl_dns_entry **dnsentry);
60 CURLcode Curl_is_resolved(struct connectdata *conn,
61 struct Curl_dns_entry **dns);
62 CURLcode Curl_wait_for_resolv(struct connectdata *conn,
63 struct Curl_dns_entry **dnsentry);
64 CURLcode Curl_multi_ares_fdset(struct connectdata *conn,
68 /* unlock a previously resolved dns entry */
69 void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns);
71 /* for debugging purposes only: */
72 void Curl_scan_cache_used(void *user, void *ptr);
75 void Curl_freeaddrinfo(Curl_addrinfo *freeaddr);
77 /* free cached name info */
78 void Curl_freednsinfo(void *freethis);
80 /* prune old entries from the DNS cache */
81 void Curl_hostcache_prune(struct SessionHandle *data);
84 void curl_freeaddrinfo(struct addrinfo *freethis,
85 int line, const char *source);
86 int curl_getaddrinfo(char *hostname, char *service,
87 struct addrinfo *hints,
88 struct addrinfo **result,
89 int line, const char *source);
93 #define CURL_INADDR_NONE (in_addr_t) ~0
95 #define CURL_INADDR_NONE INADDR_NONE