doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hostip.h
Go to the documentation of this file.
1 #ifndef __HOSTIP_H
2 #define __HOSTIP_H
3 /***************************************************************************
4  * _ _ ____ _
5  * Project ___| | | | _ \| |
6  * / __| | | | |_) | |
7  * | (__| |_| | _ <| |___
8  * \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
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.
15  *
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.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * $Id: hostip.h,v 1.28 2004/01/07 09:19:35 bagder Exp $
24  ***************************************************************************/
25 
26 #include "setup.h"
27 #include "hash.h"
28 
29 struct addrinfo;
30 struct hostent;
31 struct SessionHandle;
32 struct connectdata;
33 
37 
38 #define Curl_global_host_cache_use(__p) ((__p)->set.global_dns_cache)
39 
42  time_t timestamp;
43  long inuse; /* use-counter, make very sure you decrease this
44  when you're done using the address you received */
45 };
46 
47 /*
48  * Curl_resolv() returns an entry with the info for the specified host
49  * and port.
50  *
51  * The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after
52  * use, or we'll leak memory!
53  */
54 
55 int Curl_resolv(struct connectdata *conn,
56  char *hostname,
57  int port,
58  struct Curl_dns_entry **dnsentry);
59 
61  struct Curl_dns_entry **dns);
63  struct Curl_dns_entry **dnsentry);
65  fd_set *read_fd_set,
66  fd_set *write_fd_set,
67  int *max_fdp);
68 /* unlock a previously resolved dns entry */
69 void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns);
70 
71 /* for debugging purposes only: */
72 void Curl_scan_cache_used(void *user, void *ptr);
73 
74 /* free name info */
75 void Curl_freeaddrinfo(Curl_addrinfo *freeaddr);
76 
77 /* free cached name info */
78 void Curl_freednsinfo(void *freethis);
79 
80 /* prune old entries from the DNS cache */
82 
83 #ifdef CURLDEBUG
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);
90 #endif
91 
92 #ifndef INADDR_NONE
93 #define CURL_INADDR_NONE (in_addr_t) ~0
94 #else
95 #define CURL_INADDR_NONE INADDR_NONE
96 #endif
97 
98 
99 #endif
time_t timestamp
Definition: hostip.h:42
void Curl_freeaddrinfo(Curl_addrinfo *freeaddr)
Definition: hostip.c:431
CURLcode Curl_wait_for_resolv(struct connectdata *conn, struct Curl_dns_entry **dnsentry)
Definition: hostip.c:676
CURLcode
Definition: curl.h:209
int Curl_resolv(struct connectdata *conn, char *hostname, int port, struct Curl_dns_entry **dnsentry)
Definition: hostip.c:315
void Curl_hostcache_prune(struct SessionHandle *data)
Definition: hostip.c:225
Boolean result
GLsizei GLsizei GLcharARB * source
Definition: glext.h:3633
void Curl_global_host_cache_init(void)
Definition: hostip.c:126
Curl_addrinfo * addr
Definition: hostip.h:41
void Curl_global_host_cache_dtor(void)
Definition: hostip.c:139
Definition: hostip.h:40
CURLcode Curl_is_resolved(struct connectdata *conn, struct Curl_dns_entry **dns)
Definition: hostip.c:684
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:2853
void Curl_freednsinfo(void *freethis)
Definition: hostip.c:443
void Curl_scan_cache_used(void *user, void *ptr)
struct hostent Curl_addrinfo
Definition: setup.h:275
long inuse
Definition: hostip.h:43
CURLcode Curl_multi_ares_fdset(struct connectdata *conn, fd_set *read_fd_set, fd_set *write_fd_set, int *max_fdp)
Definition: hostip.c:695
void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns)
Definition: hostip.c:408
curl_hash * Curl_global_host_cache_get(void)
Definition: hostip.c:134