]> git.ipfire.org Git - thirdparty/squid.git/blame - src/CachePeer.h
Moved CachePeer to own header file.
[thirdparty/squid.git] / src / CachePeer.h
CommitLineData
a011edee
FC
1#ifndef SQUID_CACHEPEER_H_
2#define SQUID_CACHEPEER_H_
3/*
4 * SQUID Web Proxy Cache http://www.squid-cache.org/
5 * ----------------------------------------------------------
6 *
7 * Squid is the result of efforts by numerous individuals from
8 * the Internet community; see the CONTRIBUTORS file for full
9 * details. Many organizations have provided support for Squid's
10 * development; see the SPONSORS file for full details. Squid is
11 * Copyrighted (C) 2001 by the Regents of the University of
12 * California; see the COPYRIGHT file for full details. Squid
13 * incorporates software developed and/or copyrighted by other
14 * sources; see the CREDITS file for full details.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
29 *
30 */
31
32#include "enums.h"
33#include "icp_opcode.h"
34#include "ip/Address.h"
35
36#if USE_SSL
37#include <openssl/ssl.h>
38#endif
39
40class domain_ping;
41class domain_type;
42class acl_access;
43class PeerDigest;
44
45class CachePeer {
46public:
47 u_int index;
48 char *name;
49 char *host;
50 peer_t type;
51
52 Ip::Address in_addr;
53
54 struct {
55 int pings_sent;
56 int pings_acked;
57 int fetches;
58 int rtt;
59 int ignored_replies;
60 int n_keepalives_sent;
61 int n_keepalives_recv;
62 time_t probe_start;
63 time_t last_query;
64 time_t last_reply;
65 time_t last_connect_failure;
66 time_t last_connect_probe;
67 int logged_state; /* so we can print dead/revived msgs */
68 int conn_open; /* current opened connections */
69 } stats;
70
71 struct {
72 int version;
73 int counts[ICP_END+1];
74 unsigned short port;
75 } icp;
76
77#if USE_HTCP
78 struct {
79 double version;
80 int counts[2];
81 unsigned short port;
82 } htcp;
83#endif
84
85 unsigned short http_port;
86 domain_ping *peer_domain;
87 domain_type *typelist;
88 acl_access *access;
89
90 struct {
91 unsigned int proxy_only:1;
92 unsigned int no_query:1;
93 unsigned int background_ping:1;
94 unsigned int no_digest:1;
95 unsigned int default_parent:1;
96 unsigned int roundrobin:1;
97 unsigned int weighted_roundrobin:1;
98 unsigned int mcast_responder:1;
99 unsigned int closest_only:1;
100#if USE_HTCP
101 unsigned int htcp:1;
102 unsigned int htcp_oldsquid:1;
103 unsigned int htcp_no_clr:1;
104 unsigned int htcp_no_purge_clr:1;
105 unsigned int htcp_only_clr:1;
106 unsigned int htcp_forward_clr:1;
107#endif
108 unsigned int no_netdb_exchange:1;
109#if USE_DELAY_POOLS
110 unsigned int no_delay:1;
111#endif
112 unsigned int allow_miss:1;
113 unsigned int carp:1;
114 struct {
115 unsigned int set:1; //If false, whole url is to be used. Overrides others
116 unsigned int scheme:1;
117 unsigned int host:1;
118 unsigned int port:1;
119 unsigned int path:1;
120 unsigned int params:1;
121 } carp_key;
122#if USE_AUTH
123 unsigned int userhash:1;
124#endif
125 unsigned int sourcehash:1;
126 unsigned int originserver:1;
127 unsigned int no_tproxy:1;
128#if PEER_MULTICAST_SIBLINGS
129 unsigned int mcast_siblings:1;
130#endif
131 } options;
132
133 int weight;
134 int basetime;
135
136 struct {
137 double avg_n_members;
138 int n_times_counted;
139 int n_replies_expected;
140 int ttl;
141 int id;
142
143 struct {
144 unsigned int count_event_pending:1;
145 unsigned int counting:1;
146 } flags;
147 } mcast;
148#if USE_CACHE_DIGESTS
149
150 PeerDigest *digest;
151 char *digest_url;
152#endif
153
154 int tcp_up; /* 0 if a connect() fails */
155
156 Ip::Address addresses[10];
157 int n_addresses;
158 int rr_count;
159 CachePeer *next;
160 int testing_now;
161
162 struct {
163 unsigned int hash;
164 double load_multiplier;
165 double load_factor; /* normalized weight value */
166 } carp;
167#if USE_AUTH
168 struct {
169 unsigned int hash;
170 double load_multiplier;
171 double load_factor; /* normalized weight value */
172 } userhash;
173#endif
174 struct {
175 unsigned int hash;
176 double load_multiplier;
177 double load_factor; /* normalized weight value */
178 } sourcehash;
179
180 char *login; /* Proxy authorization */
181 time_t connect_timeout;
182 int connect_fail_limit;
183 int max_conn;
184 char *domain; /* Forced domain */
185#if USE_SSL
186
187 int use_ssl;
188 char *sslcert;
189 char *sslkey;
190 int sslversion;
191 char *ssloptions;
192 char *sslcipher;
193 char *sslcafile;
194 char *sslcapath;
195 char *sslcrlfile;
196 char *sslflags;
197 char *ssldomain;
198 SSL_CTX *sslContext;
199 SSL_SESSION *sslSession;
200#endif
201
202 int front_end_https;
203 int connection_auth;
204};
205
206#endif /* SQUID_CACHEPEER_H_ */