]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ipcache API shuffle
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 15 May 2011 08:42:17 +0000 (20:42 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 15 May 2011 08:42:17 +0000 (20:42 +1200)
18 files changed:
src/Makefile.am
src/acl/Asn.cc
src/acl/DestinationDomain.cc
src/acl/DestinationIp.h
src/client_side_reply.cc
src/comm/ConnOpener.cc
src/icmp/net_db.cc
src/icp_v2.cc
src/ipcache.cc
src/ipcache.h [new file with mode: 0644]
src/multicast.cc
src/neighbors.cc
src/peer_select.cc
src/protos.h
src/send-announce.cc
src/structs.h
src/tools.cc
src/typedefs.h

index 778c6345faba935b706fc3658e548d7d3f466afc..c8435a0fde55c435a1a8f38ef6d402c7a2e8bd01 100644 (file)
@@ -375,6 +375,7 @@ squid_SOURCES = \
        internal.cc \
        $(IPC_SOURCE) \
        ipcache.cc \
+       ipcache.h \
        $(LEAKFINDERSOURCE) \
        list.cc \
        lookup_t.h \
index f77fabf83f04ad01b6532947c72d1a77784d4424..83fe1b858c30e338456239ece6d2e5a196957ec5 100644 (file)
@@ -46,6 +46,7 @@
 #include "acl/DestinationAsn.h"
 #include "acl/DestinationIp.h"
 #include "HttpReply.h"
+#include "ipcache.h"
 #include "forward.h"
 #include "wordlist.h"
 
index 5d765343d196d5eff98319dbe7585f98bcfe81db..6527deb1bdc235f4a993c028bce5d82ebb9a6baa 100644 (file)
@@ -40,6 +40,7 @@
 #include "acl/RegexData.h"
 #include "acl/DomainData.h"
 #include "HttpRequest.h"
+#include "ipcache.h"
 
 DestinationDomainLookup DestinationDomainLookup::instance_;
 
index b25e532e27a947b49db95bcf788cf8cf177c5c6c..70377f55bc87636bf7b202a4509263448fa61042 100644 (file)
@@ -37,6 +37,7 @@
 #define SQUID_ACLDESTINATIONIP_H
 #include "acl/Checklist.h"
 #include "acl/Ip.h"
+#include "ipcache.h"
 
 class DestinationIPLookup : public ACLChecklist::AsyncState
 {
index c9a8a58aa9ea16aae3eb03d1e05dab8c41f9b568..a10ff3bff49c19dada4f0a05970179cdbf2d6d12 100644 (file)
@@ -58,6 +58,7 @@
 #include "HttpReply.h"
 #include "HttpRequest.h"
 #include "ip/QosConfig.h"
+#include "ipcache.h"
 #include "log/Tokens.h"
 #include "MemObject.h"
 #include "SquidTime.h"
index b3e952d9853065fd7001a755995a402fba13ff39..dd1b360f767348825e727966929694fb9183bd0e 100644 (file)
@@ -9,6 +9,7 @@
 #include "comm.h"
 #include "fde.h"
 #include "icmp/net_db.h"
+#include "ipcache.h"
 #include "SquidTime.h"
 
 namespace Comm {
index a64b96879c71e56c84aad10b56fa88a96860e80c..51a26f17ddf8aa744861564bb3d2a01a616457dd 100644 (file)
@@ -57,6 +57,7 @@
 
 #if USE_ICMP
 #include "icmp/IcmpSquid.h"
+#include "ipcache.h"
 #include "StoreClient.h"
 
 #define        NETDB_REQBUF_SZ 4096
index 2f0aa72daa073260ec172835604d495305e26ce9..d62baea373f4e8c5cecb7dd3fceedd45ab6c002c 100644 (file)
@@ -52,6 +52,7 @@
 #include "ip/Address.h"
 #include "ip/tools.h"
 #include "ipc/StartListening.h"
+#include "ipcache.h"
 #include "rfc1738.h"
 
 /// dials icpIncomingConnectionOpened call
index 9e2a660cefa0a53859fcfaf3fb54eff60ca695d7..46e16fc3d00260d4ac00d9ba7b219819cb0c707c 100644 (file)
@@ -37,6 +37,7 @@
 #include "event.h"
 #include "ip/Address.h"
 #include "ip/tools.h"
+#include "ipcache.h"
 #include "mgr/Registration.h"
 #include "SquidTime.h"
 #include "Store.h"
diff --git a/src/ipcache.h b/src/ipcache.h
new file mode 100644 (file)
index 0000000..e98e4d8
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef _SQUID_IPCACHE_H
+#define _SQUID_IPCACHE_H
+
+namespace Ip {
+class Address;
+}
+
+class DnsLookupDetails;
+
+typedef struct _ipcache_addrs {
+    Ip::Address *in_addrs;
+    unsigned char *bad_mask;
+    unsigned char count;
+    unsigned char cur;
+    unsigned char badcount;
+} ipcache_addrs;
+
+typedef void IPH(const ipcache_addrs *, const DnsLookupDetails &details, void *);
+
+extern void ipcache_purgelru(void *);
+extern void ipcache_nbgethostbyname(const char *name, IPH * handler, void *handlerData);
+extern const ipcache_addrs *ipcache_gethostbyname(const char *, int flags);
+extern void ipcacheInvalidate(const char *);
+extern void ipcacheInvalidateNegative(const char *);
+extern void ipcache_init(void);
+extern void ipcacheCycleAddr(const char *name, ipcache_addrs *);
+extern void ipcacheMarkBadAddr(const char *name, const Ip::Address &);
+extern void ipcacheMarkGoodAddr(const char *name, const Ip::Address &);
+extern void ipcacheMarkAllGood(const char *name);
+extern void ipcacheFreeMemory(void);
+extern ipcache_addrs *ipcacheCheckNumeric(const char *name);
+extern void ipcache_restart(void);
+extern int ipcacheAddEntryFromHosts(const char *name, const char *ipaddr);
+
+#endif /* _SQUID_IPCACHE_H */
index dcb30c55b218a205ae240b62e918fbf086d53166..0d999fe728e18b2954029432218606b0457c90e5 100644 (file)
@@ -37,6 +37,7 @@
 #include "comm/Connection.h"
 // XXX: for icpIncomingConn - need to pass it as a generic parameter.
 #include "ICP.h"
+#include "ipcache.h"
 
 int
 mcastSetTtl(int fd, int mcast_ttl)
index c43510928a3ab237aad5b9247674b554fa8ea418..4c3d1cb32f253b37eaab662a799e51453b322fd3 100644 (file)
@@ -40,6 +40,7 @@
 #include "HttpRequest.h"
 #include "ICP.h"
 #include "ip/tools.h"
+#include "ipcache.h"
 #include "MemObject.h"
 #include "PeerDigest.h"
 #include "PeerSelectState.h"
index a8200c304a74840beb2b78a8813cc9982b31aad6..71301da5233c1ca3c1c03adc3cc2523780fcc6c8 100644 (file)
@@ -45,6 +45,7 @@
 #include "forward.h"
 #include "SquidTime.h"
 #include "icmp/net_db.h"
+#include "ipcache.h"
 
 static struct {
     int timeouts;
index e4d457b1acf0961e6d76b1187ebf265e453533d9..c5a61794d550229df603b44bd51d220e78988af1 100644 (file)
@@ -323,23 +323,6 @@ extern void wccp2ConnectionOpen(void);
 extern void wccp2ConnectionClose(void);
 #endif /* USE_WCCPv2 */
 
-void ipcache_purgelru(void *);
-SQUIDCEXTERN void ipcache_nbgethostbyname(const char *name,
-        IPH * handler,
-        void *handlerData);
-SQUIDCEXTERN const ipcache_addrs *ipcache_gethostbyname(const char *, int flags);
-SQUIDCEXTERN void ipcacheInvalidate(const char *);
-SQUIDCEXTERN void ipcacheInvalidateNegative(const char *);
-SQUIDCEXTERN void ipcache_init(void);
-SQUIDCEXTERN void ipcacheCycleAddr(const char *name, ipcache_addrs *);
-SQUIDCEXTERN void ipcacheMarkBadAddr(const char *name, const Ip::Address &);
-SQUIDCEXTERN void ipcacheMarkGoodAddr(const char *name, const Ip::Address &);
-SQUIDCEXTERN void ipcacheMarkAllGood(const char *name);
-SQUIDCEXTERN void ipcacheFreeMemory(void);
-SQUIDCEXTERN ipcache_addrs *ipcacheCheckNumeric(const char *name);
-SQUIDCEXTERN void ipcache_restart(void);
-SQUIDCEXTERN int ipcacheAddEntryFromHosts(const char *name, const char *ipaddr);
-
 SQUIDCEXTERN char *mime_get_header(const char *mime, const char *header);
 SQUIDCEXTERN char *mime_get_header_field(const char *mime, const char *name, const char *prefix);
 SQUIDCEXTERN size_t headersEnd(const char *, size_t);
@@ -354,6 +337,7 @@ SQUIDCEXTERN char mimeGetTransferMode(const char *fn);
 SQUIDCEXTERN int mimeGetDownloadOption(const char *fn);
 SQUIDCEXTERN int mimeGetViewOption(const char *fn);
 
+#include "ipcache.h"
 SQUIDCEXTERN int mcastSetTtl(int, int);
 SQUIDCEXTERN IPH mcastJoinGroups;
 
index 34f3b2951649db2e44d1054742fb92ad723e3ae0..085203d523d4509c1e124f6f0ccbd70cc8d52de3 100644 (file)
@@ -38,6 +38,7 @@
 #include "event.h"
 #include "fde.h"
 #include "ICP.h"
+#include "ipcache.h"
 #include "SquidTime.h"
 
 static IPH send_announce;
index c0ed96b89d5477d6ade3959733217e31e277244e..1677ec5dd61e3b3c5ff8f051e9739b1161f2b7ea 100644 (file)
@@ -777,14 +777,6 @@ struct _http_state_flags {
     unsigned int sentLastChunk:1; ///< do not try to write last-chunk again
 };
 
-struct _ipcache_addrs {
-    Ip::Address *in_addrs;
-    unsigned char *bad_mask;
-    unsigned char count;
-    unsigned char cur;
-    unsigned char badcount;
-};
-
 struct _domain_ping {
     char *domain;
     int do_ping;               /* boolean */
index 878fbd97a5959511ec37058aca168976135e31b9..3ee13dea993bf0de566a5ac9dcec3440199a8f10 100644 (file)
@@ -44,6 +44,7 @@
 #include "SquidTime.h"
 #include "ipc/Kids.h"
 #include "ipc/Coordinator.h"
+#include "ipcache.h"
 #include "SwapDir.h"
 #include "wordlist.h"
 
index 9ffa37cec26dc3535e9493b1596ea112e385208e..8ef0b2bed5068f36b54646c77eac248fa5795a0e 100644 (file)
@@ -74,8 +74,6 @@ typedef struct _HttpBody HttpBody;
 
 typedef struct _ConnCloseHelperData ConnCloseHelperData;
 
-typedef struct _ipcache_addrs ipcache_addrs;
-
 typedef struct _domain_ping domain_ping;
 
 typedef struct _domain_type domain_type;
@@ -147,7 +145,6 @@ typedef void DTCB(int errflag, void *data); /* disk trunc CB */
 class DnsLookupDetails;
 typedef void FQDNH(const char *, const DnsLookupDetails &details, void *);
 typedef void IDCB(const char *ident, void *data);
-typedef void IPH(const ipcache_addrs *, const DnsLookupDetails &details, void *);
 
 #include "anyp/ProtocolType.h"
 typedef void IRCB(struct peer *, peer_t, AnyP::ProtocolType, void *, void *data);