]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ipcache.h
Merged from trunk
[thirdparty/squid.git] / src / ipcache.h
1 /*
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef _SQUID_IPCACHE_H
10 #define _SQUID_IPCACHE_H
11
12 namespace Ip
13 {
14 class Address;
15 }
16
17 class DnsLookupDetails;
18
19 typedef struct _ipcache_addrs {
20 Ip::Address *in_addrs;
21 unsigned char *bad_mask;
22 unsigned char count;
23 unsigned char cur;
24 unsigned char badcount;
25 } ipcache_addrs;
26
27 typedef void IPH(const ipcache_addrs *, const DnsLookupDetails &details, void *);
28
29 void ipcache_purgelru(void *);
30 void ipcache_nbgethostbyname(const char *name, IPH * handler, void *handlerData);
31 const ipcache_addrs *ipcache_gethostbyname(const char *, int flags);
32 void ipcacheInvalidate(const char *);
33 void ipcacheInvalidateNegative(const char *);
34 void ipcache_init(void);
35 void ipcacheCycleAddr(const char *name, ipcache_addrs *);
36 void ipcacheMarkBadAddr(const char *name, const Ip::Address &);
37 void ipcacheMarkGoodAddr(const char *name, const Ip::Address &);
38 void ipcacheMarkAllGood(const char *name);
39 void ipcacheFreeMemory(void);
40 ipcache_addrs *ipcacheCheckNumeric(const char *name);
41 void ipcache_restart(void);
42 int ipcacheAddEntryFromHosts(const char *name, const char *ipaddr);
43
44 #endif /* _SQUID_IPCACHE_H */
45