CachePeer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2018 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_CACHEPEER_H_
10 #define SQUID_CACHEPEER_H_
11 
12 #include "acl/forward.h"
13 #include "base/CbcPointer.h"
14 #include "enums.h"
15 #include "icp_opcode.h"
16 #include "ip/Address.h"
17 #include "security/PeerOptions.h"
18 
19 //TODO: remove, it is unconditionally defined and always used.
20 #define PEER_MULTICAST_SIBLINGS 1
21 
23 class PconnPool;
24 class PeerDigest;
25 class PeerPoolMgr;
26 
27 class CachePeer
28 {
30 
31 public:
32  CachePeer() = default;
33  ~CachePeer();
34 
35  u_int index = 0;
36  char *name = nullptr;
37  char *host = nullptr;
39 
41 
42  struct {
43  int pings_sent = 0;
44  int pings_acked = 0;
45  int fetches = 0;
46  int rtt = 0;
47  int ignored_replies = 0;
50  time_t probe_start = 0;
51  time_t last_query = 0;
52  time_t last_reply = 0;
54  time_t last_connect_probe = 0;
56  int conn_open = 0;
57  } stats;
58 
59  struct icp_ {
60  icp_() { memset(&counts, 0, sizeof(counts)); }
62  int counts[ICP_END+1];
63  unsigned short port = CACHE_ICP_PORT;
64  } icp;
65 
66 #if USE_HTCP
67  struct {
68  double version = 0.0;
69  int counts[2] = {0, 0};
70  unsigned short port = 0;
71  } htcp;
72 #endif
73 
74  unsigned short http_port = CACHE_HTTP_PORT;
76  acl_access *access = nullptr;
77 
78  struct {
79  bool proxy_only = false;
80  bool no_query = false;
81  bool background_ping = false;
82  bool no_digest = false;
83  bool default_parent = false;
84  bool roundrobin = false;
85  bool weighted_roundrobin = false;
86  bool mcast_responder = false;
87  bool closest_only = false;
88 #if USE_HTCP
89  bool htcp = false;
90  bool htcp_oldsquid = false;
91  bool htcp_no_clr = false;
92  bool htcp_no_purge_clr = false;
93  bool htcp_only_clr = false;
94  bool htcp_forward_clr = false;
95 #endif
96  bool no_netdb_exchange = false;
97 #if USE_DELAY_POOLS
98  bool no_delay = false;
99 #endif
100  bool allow_miss = false;
101  bool carp = false;
102  struct {
103  bool set = false; //If false, whole url is to be used. Overrides others
104  bool scheme = false;
105  bool host = false;
106  bool port = false;
107  bool path = false;
108  bool params = false;
109  } carp_key;
110 #if USE_AUTH
111  bool userhash = false;
112 #endif
113  bool sourcehash = false;
114  bool originserver = false;
115  bool no_tproxy = false;
116 #if PEER_MULTICAST_SIBLINGS
117  bool mcast_siblings = false;
118 #endif
119  bool auth_no_keytab = false;
120  } options;
121 
122  int weight = 1;
123  int basetime = 0;
124 
125  struct {
126  double avg_n_members = 0.0;
129  int ttl = 0;
130  int id = 0;
131 
132  struct {
133  bool count_event_pending = false;
134  bool counting = false;
135  } flags;
136  } mcast;
137 
138 #if USE_CACHE_DIGESTS
139  PeerDigest *digest = nullptr;
140  char *digest_url = nullptr;
141 #endif
142 
143  int tcp_up = 0; /* 0 if a connect() fails */
145  bool reprobe = false;
146 
148  int n_addresses = 0;
149  int rr_count = 0;
150  CachePeer *next = nullptr;
151  int testing_now = 0;
152 
153  struct {
154  unsigned int hash = 0;
155  double load_multiplier = 0.0;
156  double load_factor = 0.0;
157  } carp;
158 #if USE_AUTH
159  struct {
160  unsigned int hash = 0;
161  double load_multiplier = 0.0;
162  double load_factor = 0.0;
163  } userhash;
164 #endif
165  struct {
166  unsigned int hash = 0;
167  double load_multiplier = 0.0;
168  double load_factor = 0.0;
169  } sourcehash;
170 
171  char *login = nullptr; /* Proxy authorization */
172  time_t connect_timeout_raw = 0;
174  int max_conn = 0;
175 
177  struct {
178  PconnPool *pool = nullptr;
180  int limit = 0;
181  bool waitingForClose = false;
182  } standby;
183 
184  char *domain = nullptr;
185 
190 
191  int front_end_https = 0;
192  int connection_auth = 2;
193 };
194 
195 #endif /* SQUID_CACHEPEER_H_ */
196 
int n_addresses
Definition: CachePeer.h:148
bool background_ping
Definition: CachePeer.h:81
~CachePeer()
Definition: CachePeer.cc:19
bool mcast_responder
Definition: CachePeer.h:86
PeerDigest * digest
Definition: CachePeer.h:139
struct CachePeer::icp_ icp
unsigned short port
Definition: CachePeer.h:63
double load_factor
normalized weight value
Definition: CachePeer.h:156
char * login
Definition: CachePeer.h:171
bool mcast_siblings
Definition: CachePeer.h:117
bool htcp_no_clr
Definition: CachePeer.h:91
bool waitingForClose
a conn must close before we open a standby conn
Definition: CachePeer.h:181
unsigned short port
Definition: CachePeer.h:70
CachePeer * next
Definition: CachePeer.h:150
char * domain
Forced domain.
Definition: CachePeer.h:184
bool counting
Definition: CachePeer.h:134
bool htcp_forward_clr
Definition: CachePeer.h:94
struct CachePeer::@30 htcp
std::unique_ptr< SSL_SESSION, HardFun< void, SSL_SESSION *,&SSL_SESSION_free > > SessionStatePointer
Definition: Session.h:44
double load_multiplier
Definition: CachePeer.h:155
int n_keepalives_recv
Definition: CachePeer.h:49
struct CachePeer::@29 stats
bool htcp_oldsquid
Definition: CachePeer.h:90
char * name
Definition: CachePeer.h:36
time_t last_connect_probe
Definition: CachePeer.h:54
time_t probe_start
Definition: CachePeer.h:50
int pings_sent
Definition: CachePeer.h:43
representation of a neighbor_type_domain configuration directive. A POD
TLS squid.conf settings for a remote server peer.
Definition: PeerOptions.h:22
bool auth_no_keytab
Definition: CachePeer.h:119
CbcPointer< PeerPoolMgr > mgr
pool manager
Definition: CachePeer.h:179
int conn_open
current opened connections
Definition: CachePeer.h:56
int ignored_replies
Definition: CachePeer.h:47
int rr_count
Definition: CachePeer.h:149
NeighborTypeDomainList * typelist
Definition: CachePeer.h:75
Security::ContextPointer sslContext
Definition: CachePeer.h:188
struct CachePeer::@36 standby
optional &quot;cache_peer standby=limit&quot; feature
bool sourcehash
Definition: CachePeer.h:113
bool htcp_no_purge_clr
Definition: CachePeer.h:92
time_t last_query
Definition: CachePeer.h:51
bool weighted_roundrobin
Definition: CachePeer.h:85
bool scheme
Definition: CachePeer.h:104
acl_access * access
Definition: CachePeer.h:76
CachePeer()=default
bool default_parent
Definition: CachePeer.h:83
double avg_n_members
Definition: CachePeer.h:126
#define ICP_VERSION_CURRENT
Definition: defines.h:78
int max_conn
Definition: CachePeer.h:174
PconnPool * pool
idle connection pool for this peer
Definition: CachePeer.h:178
Security::PeerOptions secure
security settings for peer connection
Definition: CachePeer.h:187
int counts[2]
Definition: CachePeer.h:69
int pings_acked
Definition: CachePeer.h:44
Ip::Address in_addr
Definition: CachePeer.h:40
std::shared_ptr< SSL_CTX > ContextPointer
Definition: Context.h:29
bool set
Definition: CachePeer.h:103
int n_replies_expected
Definition: CachePeer.h:128
u_int index
Definition: CachePeer.h:35
bool allow_miss
Definition: CachePeer.h:100
peer_t type
Definition: CachePeer.h:38
int fetches
Definition: CachePeer.h:45
bool no_digest
Definition: CachePeer.h:82
bool userhash
Definition: CachePeer.h:111
int connection_auth
0 - off, 1 - on, 2 - auto
Definition: CachePeer.h:192
unsigned int hash
Definition: CachePeer.h:154
#define CACHE_HTTP_PORT
Definition: squid.h:21
bool htcp_only_clr
Definition: CachePeer.h:93
struct CachePeer::@32::@38 flags
int n_keepalives_sent
Definition: CachePeer.h:48
int front_end_https
0 - off, 1 - on, 2 - auto
Definition: CachePeer.h:191
Ip::Address addresses[10]
Definition: CachePeer.h:147
int tcp_up
Definition: CachePeer.h:143
#define CACHE_ICP_PORT
Definition: squid.h:22
time_t last_reply
Definition: CachePeer.h:52
bool no_query
Definition: CachePeer.h:80
bool path
Definition: CachePeer.h:107
char * digest_url
Definition: CachePeer.h:140
int counts[ICP_END+1]
Definition: CachePeer.h:62
bool reprobe
whether to do another TCP probe after current TCP probes
Definition: CachePeer.h:145
time_t connect_timeout_raw
connect_timeout; use peerConnectTimeout() instead!
Definition: CachePeer.h:172
int n_times_counted
Definition: CachePeer.h:127
#define PEER_ALIVE
Definition: defines.h:126
bool no_delay
Definition: CachePeer.h:98
bool params
Definition: CachePeer.h:108
int limit
the limit itself
Definition: CachePeer.h:180
int weight
Definition: CachePeer.h:122
peer_t
Definition: enums.h:27
struct CachePeer::@31 options
double version
Definition: CachePeer.h:68
unsigned short http_port
Definition: CachePeer.h:74
bool closest_only
Definition: CachePeer.h:87
Maintains an fixed-size &quot;standby&quot; PconnPool for a single CachePeer.
Definition: PeerPoolMgr.h:21
struct CachePeer::@31::@37 carp_key
int rtt
Definition: CachePeer.h:46
bool no_tproxy
Definition: CachePeer.h:115
int connect_fail_limit
Definition: CachePeer.h:173
bool count_event_pending
Definition: CachePeer.h:133
bool carp
Definition: CachePeer.h:101
CBDATA_CLASS(CachePeer)
#define acl_access
Definition: forward.h:44
struct CachePeer::@32 mcast
Security::SessionStatePointer sslSession
Definition: CachePeer.h:189
time_t last_connect_failure
Definition: CachePeer.h:53
bool originserver
Definition: CachePeer.h:114
int testing_now
Definition: CachePeer.h:151
bool roundrobin
Definition: CachePeer.h:84
int logged_state
so we can print dead/revived msgs
Definition: CachePeer.h:55
char * host
Definition: CachePeer.h:37
int basetime
Definition: CachePeer.h:123
bool no_netdb_exchange
Definition: CachePeer.h:96
bool proxy_only
Definition: CachePeer.h:79

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors