]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved CachePeer to own header file.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 4 Sep 2012 15:15:51 +0000 (17:15 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 4 Sep 2012 15:15:51 +0000 (17:15 +0200)
27 files changed:
src/CachePeer.h [new file with mode: 0644]
src/SquidConfig.h
src/acl/FilledChecklist.h
src/acl/PeerName.cc
src/cache_cf.cc
src/carp.cc
src/client_side.cc
src/comm/ConnOpener.cc
src/comm/Connection.cc
src/fde.h
src/forward.cc
src/htcp.cc
src/http.cc
src/icmp/net_db.cc
src/log/access_log.cc
src/neighbors.cc
src/peer_digest.cc
src/peer_select.cc
src/peer_sourcehash.cc
src/peer_userhash.cc
src/snmp_agent.cc
src/snmp_core.cc
src/ssl/context_storage.cc
src/ssl/context_storage.h
src/stat.cc
src/structs.h
src/tunnel.cc

diff --git a/src/CachePeer.h b/src/CachePeer.h
new file mode 100644 (file)
index 0000000..e4ff4d2
--- /dev/null
@@ -0,0 +1,206 @@
+#ifndef SQUID_CACHEPEER_H_
+#define SQUID_CACHEPEER_H_
+/*
+ * 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.
+ *
+ */
+
+#include "enums.h"
+#include "icp_opcode.h"
+#include "ip/Address.h"
+
+#if USE_SSL
+#include <openssl/ssl.h>
+#endif
+
+class domain_ping;
+class domain_type;
+class acl_access;
+class PeerDigest;
+
+class CachePeer {
+public:
+    u_int index;
+    char *name;
+    char *host;
+    peer_t type;
+
+    Ip::Address in_addr;
+
+    struct {
+        int pings_sent;
+        int pings_acked;
+        int fetches;
+        int rtt;
+        int ignored_replies;
+        int n_keepalives_sent;
+        int n_keepalives_recv;
+        time_t probe_start;
+        time_t last_query;
+        time_t last_reply;
+        time_t last_connect_failure;
+        time_t last_connect_probe;
+        int logged_state;   /* so we can print dead/revived msgs */
+        int conn_open;      /* current opened connections */
+    } stats;
+
+    struct {
+        int version;
+        int counts[ICP_END+1];
+        unsigned short port;
+    } icp;
+
+#if USE_HTCP
+    struct {
+        double version;
+        int counts[2];
+        unsigned short port;
+    } htcp;
+#endif
+
+    unsigned short http_port;
+    domain_ping *peer_domain;
+    domain_type *typelist;
+    acl_access *access;
+
+    struct {
+        unsigned int proxy_only:1;
+        unsigned int no_query:1;
+        unsigned int background_ping:1;
+        unsigned int no_digest:1;
+        unsigned int default_parent:1;
+        unsigned int roundrobin:1;
+        unsigned int weighted_roundrobin:1;
+        unsigned int mcast_responder:1;
+        unsigned int closest_only:1;
+#if USE_HTCP
+        unsigned int htcp:1;
+        unsigned int htcp_oldsquid:1;
+        unsigned int htcp_no_clr:1;
+        unsigned int htcp_no_purge_clr:1;
+        unsigned int htcp_only_clr:1;
+        unsigned int htcp_forward_clr:1;
+#endif
+        unsigned int no_netdb_exchange:1;
+#if USE_DELAY_POOLS
+        unsigned int no_delay:1;
+#endif
+        unsigned int allow_miss:1;
+        unsigned int carp:1;
+        struct {
+            unsigned int set:1; //If false, whole url is to be used. Overrides others
+            unsigned int scheme:1;
+            unsigned int host:1;
+            unsigned int port:1;
+            unsigned int path:1;
+            unsigned int params:1;
+        } carp_key;
+#if USE_AUTH
+        unsigned int userhash:1;
+#endif
+        unsigned int sourcehash:1;
+        unsigned int originserver:1;
+        unsigned int no_tproxy:1;
+#if PEER_MULTICAST_SIBLINGS
+        unsigned int mcast_siblings:1;
+#endif
+    } options;
+
+    int weight;
+    int basetime;
+
+    struct {
+        double avg_n_members;
+        int n_times_counted;
+        int n_replies_expected;
+        int ttl;
+        int id;
+
+        struct {
+            unsigned int count_event_pending:1;
+            unsigned int counting:1;
+        } flags;
+    } mcast;
+#if USE_CACHE_DIGESTS
+
+    PeerDigest *digest;
+    char *digest_url;
+#endif
+
+    int tcp_up;         /* 0 if a connect() fails */
+
+    Ip::Address addresses[10];
+    int n_addresses;
+    int rr_count;
+    CachePeer *next;
+    int testing_now;
+
+    struct {
+        unsigned int hash;
+        double load_multiplier;
+        double load_factor; /* normalized weight value */
+    } carp;
+#if USE_AUTH
+    struct {
+        unsigned int hash;
+        double load_multiplier;
+        double load_factor; /* normalized weight value */
+    } userhash;
+#endif
+    struct {
+        unsigned int hash;
+        double load_multiplier;
+        double load_factor; /* normalized weight value */
+    } sourcehash;
+
+    char *login;        /* Proxy authorization */
+    time_t connect_timeout;
+    int connect_fail_limit;
+    int max_conn;
+    char *domain;       /* Forced domain */
+#if USE_SSL
+
+    int use_ssl;
+    char *sslcert;
+    char *sslkey;
+    int sslversion;
+    char *ssloptions;
+    char *sslcipher;
+    char *sslcafile;
+    char *sslcapath;
+    char *sslcrlfile;
+    char *sslflags;
+    char *ssldomain;
+    SSL_CTX *sslContext;
+    SSL_SESSION *sslSession;
+#endif
+
+    int front_end_https;
+    int connection_auth;
+};
+
+#endif /* SQUID_CACHEPEER_H_ */
index 247223fe6ef1a4e3adccd19d62fb2f2992061684..835cc3e4f9f8f3c219538e14658b1d3f3f7fff28 100644 (file)
 #include "structs.h"
 #include "YesNoNone.h"
 
+#if USE_SSL
+#include <openssl/ssl.h>
+#endif
+
 class acl_access;
 class acl_deny_info_list;
 class acl_size_t;
index fef5bc1d6801512e9a1da91b8660d35a053cec87..bdc6c4a97811c0339aa7c0c077ae2e92be5b3f32 100644 (file)
@@ -9,8 +9,9 @@
 #include "ssl/support.h"
 #endif
 
-class ExternalACLEntry;
+class CachePeer;
 class ConnStateData;
+class ExternalACLEntry;
 class HttpRequest;
 
 /** \ingroup ACLAPI
index 0d7b584823e86b7d2c43b7501e55753a69c59331..52eed518891484e9c4fac1b62fe7c3816e828daa 100644 (file)
@@ -3,6 +3,7 @@
 #include "acl/RegexData.h"
 #include "acl/StringData.h"
 #include "acl/Checklist.h"
+#include "CachePeer.h"
 
 int
 ACLPeerNameStrategy::match (ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
index 0c094891a101790b1be7ab29e7c355fe741135d6..60fd38f8490dd318f00963362f3ba68722d6fe8b 100644 (file)
@@ -37,6 +37,7 @@
 #include "anyp/PortCfg.h"
 #include "AuthReg.h"
 #include "base/RunnersRegistry.h"
+#include "CachePeer.h"
 #include "cache_cf.h"
 #include "ConfigParser.h"
 #include "CpuAffinityMap.h"
index 32ef25a5e4cfe7b17bc843f8a989e3e7218cf331..37e916c1b59d0f8f49c534da3acab33c0f7f71ec 100644 (file)
@@ -33,6 +33,7 @@
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "HttpRequest.h"
 #include "mgr/Registration.h"
 #include "neighbors.h"
index 4be187455ab90b11e44967e1c8c1666146518f1a..61c85f1e2d990083ef110191885866e89b755e76 100644 (file)
@@ -83,6 +83,7 @@
 #include "anyp/PortCfg.h"
 #include "base/Subscription.h"
 #include "base/TextException.h"
+#include "CachePeer.h"
 #include "ChunkedCodingParser.h"
 #include "client_db.h"
 #include "client_side_reply.h"
index 080e7f1ca32af01dfce728ca62c74f7206dab52a..d0272af30555a114aff2b0e578837024157c71a8 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "comm/ConnOpener.h"
 #include "comm/Connection.h"
 #include "comm/Loops.h"
@@ -19,6 +20,8 @@
 #include <errno.h>
 #endif
 
+class CachePeer;
+
 CBDATA_NAMESPACED_CLASS_INIT(Comm, ConnOpener);
 
 Comm::ConnOpener::ConnOpener(Comm::ConnectionPointer &c, AsyncCall::Pointer &handler, time_t ctimeout) :
index 50eaa814f4ae4d7695c0175e551af7cb7917cfbb..e73923285f30ded2e457b05604f4d436f1036efa 100644 (file)
@@ -1,10 +1,12 @@
 #include "squid.h"
+#include "CachePeer.h"
 #include "cbdata.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "fde.h"
 #include "SquidTime.h"
 
+class CachePeer;
 bool
 Comm::IsConnOpen(const Comm::ConnectionPointer &conn)
 {
index a78cff4cd3c7a610a25b5e5718c456c1dd720aee..b0f2ee17d40827fb20bb9c5b0874453924a2a8d7 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
 #include "ip/Address.h"
 #include "structs.h"
 
+#if USE_SSL
+#include <openssl/ssl.h>
+#endif
+
 #if USE_DELAY_POOLS
 class ClientInfo;
 #endif
index e287cbfe92d35071df234614ad2255a0872fe45e..471f5be26ce6344163745eb6271bf6e35f7b01cc 100644 (file)
@@ -35,6 +35,7 @@
 #include "acl/FilledChecklist.h"
 #include "acl/Gadgets.h"
 #include "anyp/PortCfg.h"
+#include "CachePeer.h"
 #include "CacheManager.h"
 #include "client_side.h"
 #include "comm/Connection.h"
index 7a5f2baacf37e84b81f4c6fcb4843d1e11066893..43e7720798286a2c8488c45bf1e7ecb423a91f01 100644 (file)
@@ -35,6 +35,7 @@
 #include "AccessLogEntry.h"
 #include "acl/Acl.h"
 #include "acl/FilledChecklist.h"
+#include "CachePeer.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "comm/Loops.h"
index 959d439a661dd12ef5d189c64eb1a3afcd25ef0e..2fbdbd76b440e318e96ad635b1bd26ac7fbe2b5a 100644 (file)
@@ -39,6 +39,7 @@
 #include "base64.h"
 #include "base/AsyncJobCalls.h"
 #include "base/TextException.h"
+#include "CachePeer.h"
 #include "client_side.h"
 #include "comm/Connection.h"
 #include "comm/Write.h"
index c0b1c5281608e0385654ea888126090093c66100..f0b0c3b30a9868d96b95a318b7d2435b893f1a18 100644 (file)
@@ -39,6 +39,7 @@
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "cbdata.h"
 #include "disk.h"
 #include "event.h"
index 6822faa86c216478cbe80b02de11b676e33beb0b..019c3ca2a611c9e8278d0a5e2e7d37cf5c4699f4 100644 (file)
 
 #include "squid.h"
 #include "AccessLogEntry.h"
-#include "Store.h"
-#include "errorpage.h"
-#include "err_detail_type.h"
 #include "acl/Checklist.h"
+#include "CachePeer.h"
+#include "err_detail_type.h"
+#include "errorpage.h"
 #include "errorpage.h"
 #include "format/Token.h"
 #include "globals.h"
@@ -51,6 +51,7 @@
 #include "rfc1738.h"
 #include "SquidConfig.h"
 #include "SquidTime.h"
+#include "Store.h"
 
 #if USE_SQUID_EUI
 #include "eui/Eui48.h"
index eadbdfe637570749e36a31a8d773ae53c6c6d21b..a2a1bb41a1f6e5d412ae57a3432e3a43b273cb75 100644 (file)
@@ -34,6 +34,7 @@
 #include "acl/FilledChecklist.h"
 #include "anyp/PortCfg.h"
 #include "CacheDigest.h"
+#include "CachePeer.h"
 #include "comm/Connection.h"
 #include "comm/ConnOpener.h"
 #include "event.h"
index 6810276103be8e2cb12322b9f5fc77ca8393ba31..e399c3c4d693ac519869804cd41840bfdcbbeaa2 100644 (file)
@@ -34,6 +34,7 @@
 #include "squid.h"
 #if USE_CACHE_DIGESTS
 #include "CacheDigest.h"
+#include "CachePeer.h"
 #include "event.h"
 #include "forward.h"
 #include "globals.h"
index c2df90d8f7e121ff5a8bb45dae11a8d510b5ee19..ae61be4fafc08905605f21f481a9d595df9446b2 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "squid.h"
 #include "acl/FilledChecklist.h"
+#include "CachePeer.h"
 #include "carp.h"
 #include "client_side.h"
 #include "DnsLookupDetails.h"
index 86a9b0b108ece8426052665527374313a7591546..53b78611c4b21e89b523e5388c6dfeffde5b2d04 100644 (file)
@@ -33,6 +33,7 @@
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "HttpRequest.h"
 #include "mgr/Registration.h"
 #include "neighbors.h"
index ac3fd05ca986e3c48d2623b24c21609d1c0e48eb..7345199a9aef53500469c8fc94acf3603d171cfe 100644 (file)
@@ -37,6 +37,7 @@
 #if USE_AUTH
 
 #include "auth/UserRequest.h"
+#include "CachePeer.h"
 #include "globals.h"
 #include "HttpRequest.h"
 #include "mgr/Registration.h"
index 45d9c1fe59b919150337b0264dae285b6ecbef12..632d3f2d6acdee1cb138ea634130eb549ce159d6 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include "squid.h"
+#include "CachePeer.h"
 #include "cache_snmp.h"
 #include "globals.h"
 #include "mem_node.h"
index ef10fdec06867096660bf351f4a561571db5a13f..8e187c6e607e3dad9eaee5bb31cfac85157e0d89 100644 (file)
@@ -32,6 +32,7 @@
 #include "squid.h"
 #include "acl/FilledChecklist.h"
 #include "base/CbcPointer.h"
+#include "CachePeer.h"
 #include "client_db.h"
 #include "comm.h"
 #include "comm/Connection.h"
index a1ffb0f3e53b7a4ca9d889455d6da7a458c7fe9f..6237a264d1dc2b330e42c4cd5e5da410c5ef7319 100644 (file)
@@ -9,6 +9,9 @@
 #if HAVE_LIMITS
 #include <limits>
 #endif
+#if USE_SSL
+#include <openssl/ssl.h>
+#endif
 
 Ssl::CertificateStorageAction::CertificateStorageAction(const Mgr::Command::Pointer &cmd)
         :   Mgr::Action(cmd)
index 6aa01c9ae08f879e605480a470283718033b2e3c..07a16376520b4480985f46568aec79f9712faee6 100644 (file)
@@ -17,6 +17,8 @@
 #if HAVE_LIST
 #include <list>
 #endif
+#include <openssl/ssl.h>
+
 
 /// TODO: Replace on real size.
 #define SSL_CTX_SIZE 1024
index e1daab5e4200e7d3072b20cd8106f2346725e423..c78cf1b0038f48e4f99e393c5b630b6072349b03 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "squid.h"
 #include "CacheDigest.h"
+#include "CachePeer.h"
 #include "client_side_request.h"
 #include "client_side.h"
 #include "comm/Connection.h"
index c02b2ed82eb9efecbfdb16d26dc93f7e6d0d1d52..375ac0791f8cda829efc12dee2f265262eacae4c 100644 (file)
 /* for ICP_END */
 #include "icp_opcode.h"
 
-#if USE_SSL
-#include <openssl/ssl.h>
-#endif
-
 #define PEER_MULTICAST_SIBLINGS 1
 
 struct acl_name_list {
@@ -218,166 +214,6 @@ public:
 
 class PeerDigest;
 
-class CachePeer {
-public:
-    u_int index;
-    char *name;
-    char *host;
-    peer_t type;
-
-    Ip::Address in_addr;
-
-    struct {
-        int pings_sent;
-        int pings_acked;
-        int fetches;
-        int rtt;
-        int ignored_replies;
-        int n_keepalives_sent;
-        int n_keepalives_recv;
-        time_t probe_start;
-        time_t last_query;
-        time_t last_reply;
-        time_t last_connect_failure;
-        time_t last_connect_probe;
-        int logged_state;      /* so we can print dead/revived msgs */
-        int conn_open;         /* current opened connections */
-    } stats;
-
-    struct {
-        int version;
-        int counts[ICP_END+1];
-        unsigned short port;
-    } icp;
-
-#if USE_HTCP
-    struct {
-        double version;
-        int counts[2];
-        unsigned short port;
-    } htcp;
-#endif
-
-    unsigned short http_port;
-    domain_ping *peer_domain;
-    domain_type *typelist;
-    acl_access *access;
-
-    struct {
-        unsigned int proxy_only:1;
-        unsigned int no_query:1;
-        unsigned int background_ping:1;
-        unsigned int no_digest:1;
-        unsigned int default_parent:1;
-        unsigned int roundrobin:1;
-        unsigned int weighted_roundrobin:1;
-        unsigned int mcast_responder:1;
-        unsigned int closest_only:1;
-#if USE_HTCP
-        unsigned int htcp:1;
-        unsigned int htcp_oldsquid:1;
-        unsigned int htcp_no_clr:1;
-        unsigned int htcp_no_purge_clr:1;
-        unsigned int htcp_only_clr:1;
-        unsigned int htcp_forward_clr:1;
-#endif
-        unsigned int no_netdb_exchange:1;
-#if USE_DELAY_POOLS
-        unsigned int no_delay:1;
-#endif
-        unsigned int allow_miss:1;
-        unsigned int carp:1;
-        struct {
-            unsigned int set:1; //If false, whole url is to be used. Overrides others
-            unsigned int scheme:1;
-            unsigned int host:1;
-            unsigned int port:1;
-            unsigned int path:1;
-            unsigned int params:1;
-        } carp_key;
-#if USE_AUTH
-        unsigned int userhash:1;
-#endif
-        unsigned int sourcehash:1;
-        unsigned int originserver:1;
-        unsigned int no_tproxy:1;
-#if PEER_MULTICAST_SIBLINGS
-        unsigned int mcast_siblings:1;
-#endif
-    } options;
-
-    int weight;
-    int basetime;
-
-    struct {
-        double avg_n_members;
-        int n_times_counted;
-        int n_replies_expected;
-        int ttl;
-        int id;
-
-        struct {
-            unsigned int count_event_pending:1;
-            unsigned int counting:1;
-        } flags;
-    } mcast;
-#if USE_CACHE_DIGESTS
-
-    PeerDigest *digest;
-    char *digest_url;
-#endif
-
-    int tcp_up;                        /* 0 if a connect() fails */
-
-    Ip::Address addresses[10];
-    int n_addresses;
-    int rr_count;
-    CachePeer *next;
-    int testing_now;
-
-    struct {
-        unsigned int hash;
-        double load_multiplier;
-        double load_factor;    /* normalized weight value */
-    } carp;
-#if USE_AUTH
-    struct {
-        unsigned int hash;
-        double load_multiplier;
-        double load_factor;    /* normalized weight value */
-    } userhash;
-#endif
-    struct {
-        unsigned int hash;
-        double load_multiplier;
-        double load_factor;    /* normalized weight value */
-    } sourcehash;
-
-    char *login;               /* Proxy authorization */
-    time_t connect_timeout;
-    int connect_fail_limit;
-    int max_conn;
-    char *domain;              /* Forced domain */
-#if USE_SSL
-
-    int use_ssl;
-    char *sslcert;
-    char *sslkey;
-    int sslversion;
-    char *ssloptions;
-    char *sslcipher;
-    char *sslcafile;
-    char *sslcapath;
-    char *sslcrlfile;
-    char *sslflags;
-    char *ssldomain;
-    SSL_CTX *sslContext;
-    SSL_SESSION *sslSession;
-#endif
-
-    int front_end_https;
-    int connection_auth;
-};
 
 class netdbEntry;
 
index b1ed03c7b8bc5888b7743b2b0946960580e92e14..7ddf0df8f81b035a3269636d63f9fcdd9755cac3 100644 (file)
  */
 
 #include "squid.h"
-#include "errorpage.h"
-#include "HttpRequest.h"
-#include "fde.h"
+#include "acl/FilledChecklist.h"
 #include "Array.h"
+#include "CachePeer.h"
+#include "client_side_request.h"
+#include "client_side.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "comm/ConnOpener.h"
 #include "comm/Write.h"
-#include "client_side_request.h"
-#include "acl/FilledChecklist.h"
-#include "client_side.h"
-#include "MemBuf.h"
+#include "errorpage.h"
+#include "fde.h"
 #include "http.h"
+#include "HttpRequest.h"
+#include "MemBuf.h"
 #include "PeerSelectState.h"
 #include "SquidConfig.h"
 #include "StatCounters.h"
 #include "tools.h"
-
 #if USE_DELAY_POOLS
 #include "DelayId.h"
 #endif