]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved fqdncache prototypes from protos.h to fqdncache.h
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 17 Aug 2012 09:17:46 +0000 (11:17 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 17 Aug 2012 09:17:46 +0000 (11:17 +0200)
17 files changed:
src/Makefile.am
src/acl/DestinationDomain.cc
src/acl/MaxConnection.cc
src/acl/SourceDomain.cc
src/client_db.cc
src/client_db.h [new file with mode: 0644]
src/client_side.cc
src/comm/TcpAcceptor.cc
src/format/Format.cc
src/fqdncache.cc
src/fqdncache.h [new file with mode: 0644]
src/icp_v2.cc
src/log/FormatSquidIcap.cc
src/main.cc
src/protos.h
src/redirect.cc
src/tools.cc

index 56a2de0f6bf5609b1d98d9ed75dbd98f5c38ac57..f832fdf261e2480087f0959dff227a2d58e6248d 100644 (file)
@@ -272,6 +272,7 @@ squid_SOURCES = \
        cbdata.h \
        ChunkedCodingParser.cc \
        ChunkedCodingParser.h \
+       client_db.h \
        client_db.cc \
        client_side.cc \
        client_side.h \
@@ -1296,6 +1297,7 @@ tests_testCacheManager_SOURCES = \
        carp.cc \
        cbdata.cc \
        ChunkedCodingParser.cc \
+       client_db.h \
        client_db.cc \
        client_side.cc \
        client_side_reply.cc \
@@ -1464,6 +1466,7 @@ tests_testCacheManager_DEPENDENCIES = \
 tests_testDiskIO_SOURCES = \
        CacheDigest.cc \
        cbdata.cc \
+       client_db.h \
        ClientInfo.h \
        ConfigOption.cc \
        ConfigParser.cc \
@@ -1618,6 +1621,7 @@ tests_testEvent_SOURCES = \
        carp.cc \
        cbdata.cc \
        ChunkedCodingParser.cc \
+       client_db.h \
        client_db.cc \
        client_side.cc \
        client_side_reply.cc \
@@ -1810,6 +1814,7 @@ tests_testEventLoop_SOURCES = \
        carp.cc \
        cbdata.cc \
        ChunkedCodingParser.cc \
+       client_db.h \
        client_db.cc \
        client_side.cc \
        client_side_reply.cc \
@@ -2000,6 +2005,7 @@ tests_test_http_range_SOURCES = \
        carp.cc \
        cbdata.cc \
        ChunkedCodingParser.cc \
+       client_db.h \
        client_db.cc \
        client_side.cc \
        client_side_reply.cc \
@@ -2238,6 +2244,7 @@ tests_testHttpRequest_SOURCES = \
        carp.cc \
        cbdata.cc \
        ChunkedCodingParser.cc \
+       client_db.h \
        client_db.cc \
        client_side.cc \
        client_side_reply.cc \
@@ -2609,6 +2616,7 @@ tests_testUfs_SOURCES = \
        tests/stub_store_rebuild.cc \
        tests/stub_store_stats.cc \
        fd.cc \
+       client_db.h \
        disk.cc \
        FileMap.h \
        filemap.cc \
@@ -2799,6 +2807,7 @@ tests_testRock_SOURCES = \
        tests/stub_access_log.cc \
        tests/stub_cache_cf.cc \
        tests/stub_cache_manager.cc \
+       client_db.h \
        tests/stub_client_db.cc \
        tests/stub_client_side_request.cc \
        tests/stub_debug.cc \
@@ -2868,6 +2877,7 @@ tests_testCoss_SOURCES = \
        tests/testMain.cc \
        tests/testCoss.h \
        tests/stub_cache_manager.cc \
+       client_db.h \
        tests/stub_client_db.cc \
        tests/stub_debug.cc \
        tests/stub_HelperChildConfig.cc \
@@ -3137,6 +3147,7 @@ tests_testURL_SOURCES = \
        carp.cc \
        cbdata.cc \
        ChunkedCodingParser.cc \
+       client_db.h \
        client_db.cc \
        client_side.cc \
        client_side_reply.cc \
index db961d09b62974c65f1a346d88443e29f0357c19..9c2e916ff26bb224c16060d5539157bf4418f558 100644 (file)
@@ -39,6 +39,7 @@
 #include "acl/Checklist.h"
 #include "acl/RegexData.h"
 #include "acl/DomainData.h"
+#include "fqdncache.h"
 #include "HttpRequest.h"
 #include "ipcache.h"
 #include "protos.h"
index 05fc0be9cb52dd34be451466030c7e6828bdad3e..c4b33239cacde74e43e6b6187f9e673f07e45d16 100644 (file)
@@ -37,6 +37,7 @@
 #include "squid.h"
 #include "acl/FilledChecklist.h"
 #include "acl/MaxConnection.h"
+#include "client_db.h"
 #include "Debug.h"
 #include "protos.h"
 #include "wordlist.h"
index 61ff7fb1744128641bf409043ff219cbe3910fe0..5a0f95e059ce98e90ec17ee4280690e5fe8a4195 100644 (file)
@@ -39,6 +39,7 @@
 #include "acl/Checklist.h"
 #include "acl/RegexData.h"
 #include "acl/DomainData.h"
+#include "fqdncache.h"
 #include "HttpRequest.h"
 #include "protos.h"
 
index 362c310aa46244e713c0ac92901aacf72287669f..5a92bab76f7242cb9f375625ad430ded1c945fd9 100644 (file)
  */
 
 #include "squid.h"
+#include "client_db.h"
 #include "event.h"
 #include "format/Token.h"
 #include "ClientInfo.h"
+#include "fqdncache.h"
 #include "ip/Address.h"
 #include "mgr/Registration.h"
 #include "protos.h"
diff --git a/src/client_db.h b/src/client_db.h
new file mode 100644 (file)
index 0000000..dab0b3b
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * DEBUG: section 
+ * AUTHOR: 
+ *
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+
+#ifndef SQUID_CLIENT_DB_H_
+#define SQUID_CLIENT_DB_H_
+
+#include "anyp/ProtocolType.h"
+#include "enums.h"
+#include "ip/Address.h"
+
+class StoreEntry;
+class ClientInfo;
+
+extern void clientdbInit(void);
+extern void clientdbUpdate(const Ip::Address &, log_type, AnyP::ProtocolType, size_t);
+extern int clientdbCutoffDenied(const Ip::Address &);
+extern void clientdbDump(StoreEntry *);
+extern void clientdbFreeMemory(void);
+extern int clientdbEstablished(const Ip::Address &, int);
+
+#if USE_DELAY_POOLS
+extern void clientdbSetWriteLimiter(ClientInfo * info, const int writeSpeedLimit,const double initialBurst,const double highWatermark);
+extern ClientInfo * clientdbGetInfo(const Ip::Address &addr);
+#endif
+
+
+#endif /* SQUID_CLIENT_DB_H_ */
index 0e6c8c75b035352f2e40a8b47889cf7d5677baf5..656e8d36f2c1443b940795c32c83552f518ae2b4 100644 (file)
@@ -88,6 +88,7 @@
 #include "base/Subscription.h"
 #include "base/TextException.h"
 #include "ChunkedCodingParser.h"
+#include "client_db.h"
 #include "client_side_reply.h"
 #include "client_side_request.h"
 #include "client_side.h"
 #include "eui/Config.h"
 #include "fde.h"
 #include "forward.h"
+#include "fqdncache.h"
 #include "HttpHdrContRange.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
index 1ba79a603639248b9249823040406cec323a55ba..e7c362ea712c6aaf2ab97032ce07cd0098cf1eb0 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "squid.h"
 #include "base/TextException.h"
+#include "client_db.h"
 #include "comm/AcceptLimiter.h"
 #include "CommCalls.h"
 #include "comm/comm_internal.h"
index efb187397be0b38ea835edfcf26ca1b6d60f5817..abe8e5749f5b623274ee9a4df7cb2d7d79303fdd 100644 (file)
@@ -8,6 +8,7 @@
 #include "format/Format.h"
 #include "format/Quoting.h"
 #include "format/Token.h"
+#include "fqdncache.h"
 #include "HttpRequest.h"
 #include "MemBuf.h"
 #include "protos.h"
index 42e80aca19339926b5f09d437459a0e19e095615..a1bf77f31eb068693340df5a9aa748bc0da9a78a 100644 (file)
@@ -588,50 +588,6 @@ fqdncache_nbgethostbyaddr(const Ip::Address &addr, FQDNH * handler, void *handle
 #endif
 }
 
-/// \ingroup FQDNCacheInternal
-static void
-fqdncacheRegisterWithCacheManager(void)
-{
-    Mgr::RegisterAction("fqdncache", "FQDN Cache Stats and Contents",
-                        fqdnStats, 0, 1);
-
-}
-
-/**
- \ingroup FQDNCacheAPI
- *
- * Initialize the fqdncache.
- * Called after IP cache initialization.
- */
-void
-fqdncache_init(void)
-{
-    int n;
-
-    fqdncacheRegisterWithCacheManager();
-
-    if (fqdn_table)
-        return;
-
-    debugs(35, 3, "Initializing FQDN Cache...");
-
-    memset(&FqdncacheStats, '\0', sizeof(FqdncacheStats));
-
-    memset(&lru_list, '\0', sizeof(lru_list));
-
-    fqdncache_high = (long) (((float) Config.fqdncache.size *
-                              (float) FQDN_HIGH_WATER) / (float) 100);
-
-    fqdncache_low = (long) (((float) Config.fqdncache.size *
-                             (float) FQDN_LOW_WATER) / (float) 100);
-
-    n = hashPrime(fqdncache_high / 4);
-
-    fqdn_table = hash_create((HASHCMP *) strcmp, n, hash4);
-
-    memDataInit(MEM_FQDNCACHE_ENTRY, "fqdncache_entry",
-                sizeof(fqdncache_entry), 0);
-}
 
 /**
  \ingroup FQDNCacheAPI
@@ -746,6 +702,7 @@ fqdnStats(StoreEntry * sentry)
 }
 
 /// \ingroup FQDNCacheAPI
+#if 0
 const char *
 fqdnFromAddr(const Ip::Address &addr)
 {
@@ -761,6 +718,7 @@ fqdnFromAddr(const Ip::Address &addr)
 
     return buf;
 }
+#endif
 
 /// \ingroup FQDNCacheInternal
 static void
@@ -873,6 +831,50 @@ fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames)
     fqdncacheLockEntry(fce);
 }
 
+/// \ingroup FQDNCacheInternal
+static void
+fqdncacheRegisterWithCacheManager(void)
+{
+    Mgr::RegisterAction("fqdncache", "FQDN Cache Stats and Contents",
+                        fqdnStats, 0, 1);
+
+}
+
+/**
+ \ingroup FQDNCacheAPI
+ *
+ * Initialize the fqdncache.
+ * Called after IP cache initialization.
+ */
+void
+fqdncache_init(void)
+{
+    int n;
+
+    fqdncacheRegisterWithCacheManager();
+
+    if (fqdn_table)
+        return;
+
+    debugs(35, 3, "Initializing FQDN Cache...");
+
+    memset(&FqdncacheStats, '\0', sizeof(FqdncacheStats));
+
+    memset(&lru_list, '\0', sizeof(lru_list));
+
+    fqdncache_high = (long) (((float) Config.fqdncache.size *
+                              (float) FQDN_HIGH_WATER) / (float) 100);
+
+    fqdncache_low = (long) (((float) Config.fqdncache.size *
+                             (float) FQDN_LOW_WATER) / (float) 100);
+
+    n = hashPrime(fqdncache_high / 4);
+
+    fqdn_table = hash_create((HASHCMP *) strcmp, n, hash4);
+
+    memDataInit(MEM_FQDNCACHE_ENTRY, "fqdncache_entry",
+                sizeof(fqdncache_entry), 0);
+}
 
 #if SQUID_SNMP
 /**
diff --git a/src/fqdncache.h b/src/fqdncache.h
new file mode 100644 (file)
index 0000000..e6d916c
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * DEBUG: section 
+ * AUTHOR: 
+ *
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+
+#ifndef SQUID_FQDNCACHE_H_
+#define SQUID_FQDNCACHE_H_
+
+#include "ip/Address.h"
+#include "typedefs.h"
+
+class StoreEntry;
+class wordlist;
+
+extern void fqdncache_init(void);
+void fqdnStats(StoreEntry *);
+//extern void fqdncacheReleaseInvalid(const char *);
+//extern int fqdncacheQueueDrain(void);
+extern void fqdncacheFreeMemory(void);
+extern void fqdncache_restart(void);
+extern void fqdncache_purgelru(void *);
+extern void fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames);
+
+extern const char *fqdncache_gethostbyaddr(const Ip::Address &, int flags);
+//extern const char *fqdnFromAddr(const Ip::Address &);
+extern void fqdncache_nbgethostbyaddr(const Ip::Address &, FQDNH *, void *);
+
+
+
+
+#endif /* SQUID_FQDNCACHE_H_ */
index ee6ef69490178278e12c5bacb426936b5eddc61f..6ff79657c2d85d3e282423a04f91b13aa47f9b79 100644 (file)
@@ -39,6 +39,7 @@
 #include "AccessLogEntry.h"
 #include "acl/Acl.h"
 #include "acl/FilledChecklist.h"
+#include "client_db.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "comm/Loops.h"
index 1c8c6086f3cee1361376129911bc2bc16142dbee..3574fa8180d7ce628cee99744209420fef2de599 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "AccessLogEntry.h"
 #include "format/Quoting.h"
+#include "fqdncache.h"
 #include "HttpRequest.h"
 #include "log/File.h"
 #include "log/Formats.h"
index 35a2ed257b626f6c5978cb4539a87bc832d01e97..1eb95962380d8d4958fde07760be364c21febcb5 100644 (file)
@@ -39,6 +39,7 @@
 #include "base/RunnersRegistry.h"
 #include "base/Subscription.h"
 #include "base/TextException.h"
+#include "client_db.h"
 #include "comm.h"
 #include "ConfigParser.h"
 #include "CpuAffinity.h"
@@ -50,7 +51,7 @@
 #include "format/Token.h"
 #include "forward.h"
 #include "fs/Module.h"
-#include "fs/Module.h"
+#include "fqdncache.h"
 #include "htcp.h"
 #include "HttpReply.h"
 #include "icmp/IcmpSquid.h"
index 40e7fb8f13be70d222fae35a7f178186b5ba72d5..2512eb57c5afcc04f523b467c12d90df01cde376 100644 (file)
@@ -81,20 +81,7 @@ SQUIDCEXTERN void parse_time_t(time_t * var);
 
 /* client_side.c - FD related client side routines */
 
-SQUIDCEXTERN void clientdbInit(void);
-
 #include "anyp/ProtocolType.h"
-SQUIDCEXTERN void clientdbUpdate(const Ip::Address &, log_type, AnyP::ProtocolType, size_t);
-
-SQUIDCEXTERN int clientdbCutoffDenied(const Ip::Address &);
-void clientdbDump(StoreEntry *);
-SQUIDCEXTERN void clientdbFreeMemory(void);
-
-SQUIDCEXTERN int clientdbEstablished(const Ip::Address &, int);
-#if USE_DELAY_POOLS
-SQUIDCEXTERN void clientdbSetWriteLimiter(ClientInfo * info, const int writeSpeedLimit,const double initialBurst,const double highWatermark);
-SQUIDCEXTERN ClientInfo * clientdbGetInfo(const Ip::Address &addr);
-#endif
 SQUIDCEXTERN void clientOpenListenSockets(void);
 SQUIDCEXTERN void clientHttpConnectionsClose(void);
 SQUIDCEXTERN void httpRequestFree(void *);
@@ -132,20 +119,6 @@ extern void fdDumpOpen(void);
 extern int fdUsageHigh(void);
 extern void fdAdjustReserved(void);
 
-SQUIDCEXTERN void fqdncache_nbgethostbyaddr(const Ip::Address &, FQDNH *, void *);
-
-SQUIDCEXTERN const char *fqdncache_gethostbyaddr(const Ip::Address &, int flags);
-SQUIDCEXTERN void fqdncache_init(void);
-void fqdnStats(StoreEntry *);
-SQUIDCEXTERN void fqdncacheReleaseInvalid(const char *);
-
-SQUIDCEXTERN const char *fqdnFromAddr(const Ip::Address &);
-SQUIDCEXTERN int fqdncacheQueueDrain(void);
-SQUIDCEXTERN void fqdncacheFreeMemory(void);
-SQUIDCEXTERN void fqdncache_restart(void);
-extern void fqdncache_purgelru(void *);
-SQUIDCEXTERN void fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames);
-
 class FwdState;
 
 /**
index 5751ad4c8316efbd2bbe792d2f5f332008cc74cc..621a8ee0f7b6627f215fee5401d45b104600ba94 100644 (file)
@@ -40,6 +40,7 @@
 #include "client_side_request.h"
 #include "comm/Connection.h"
 #include "fde.h"
+#include "fqdncache.h"
 #include "globals.h"
 #include "HttpRequest.h"
 #include "helper.h"
index 3bea878a804e9eb50337f6ce3f257cd9230cc882..25080c00d199b256a4ee3d7516961b0fd46de05e 100644 (file)
@@ -35,6 +35,7 @@
 #include "squid.h"
 #include "base/Subscription.h"
 #include "fde.h"
+#include "fqdncache.h"
 #include "htcp.h"
 #include "ICP.h"
 #include "ip/Intercept.h"