2 * SQUID Web Proxy Cache http://www.squid-cache.org/
3 * ----------------------------------------------------------
5 * Squid is the result of efforts by numerous individuals from
6 * the Internet community; see the CONTRIBUTORS file for full
7 * details. Many organizations have provided support for Squid's
8 * development; see the SPONSORS file for full details. Squid is
9 * Copyrighted (C) 2001 by the Regents of the University of
10 * California; see the COPYRIGHT file for full details. Squid
11 * incorporates software developed and/or copyrighted by other
12 * sources; see the CREDITS file for full details.
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
29 #ifndef SQUID_STRUCTS_H
30 #define SQUID_STRUCTS_H
32 #include "acl/AclNameList.h"
38 #include "ip/Address.h"
41 /* needed for the global config */
42 #include "HttpHeader.h"
43 #include "HttpHeaderTools.h"
46 #include "icp_opcode.h"
48 #define PEER_MULTICAST_SIBLINGS 1
54 #include "snmp_session.h"
55 struct _snmp_request_t
{
66 ACLChecklist
*acl_checklist
;
69 struct snmp_session session
;
109 #include "DelayConfig.h"
110 #include "ClientDelayConfig.h"
114 #include "icmp/IcmpConfig.h"
117 #include "HelperChildConfig.h"
119 /* forward decl for SquidConfig, see RemovalPolicy.h */
121 class CpuAffinityMap
;
122 class RemovalPolicySettings
;
126 class cachemgr_passwd
;
134 class close_handler
{
164 void *wrt_handle_data
;
166 dwrite_q
*write_q_tail
;
171 class http_state_flags
{
173 unsigned int proxying
:1;
174 unsigned int keepalive
:1;
175 unsigned int only_if_cached
:1;
176 unsigned int handling1xx
:1; ///< we are ignoring or forwarding 1xx response
177 unsigned int headers_parsed
:1;
178 unsigned int front_end_https
:2;
179 unsigned int originpeer
:1;
180 unsigned int keepalive_broken
:1;
181 unsigned int abuse_detected
:1;
182 unsigned int request_sent
:1;
183 unsigned int do_next_read
:1;
184 unsigned int consume_body_data
:1;
185 unsigned int chunked
:1; ///< reading a chunked response; TODO: rename
186 unsigned int chunked_request
:1; ///< writing a chunked request
187 unsigned int sentLastChunk
:1; ///< do not try to write last-chunk again
193 int do_ping
; /* boolean */
211 hash_link hash
; /* must be first */
213 netdbEntry
*net_db_entry
;
218 const char *peername
;
226 hash_link hash
; /* must be first */
227 char network
[MAX_IPSTRLEN
];
232 time_t next_ping_time
;
233 time_t last_use_time
;
243 static const int histSize
=16;
245 // enum { histSize = 16 };
250 int read_hist
[histSize
];
252 int write_hist
[histSize
];
258 struct request_flags
{
259 request_flags(): range(0),nocache(0),ims(0),auth(0),cachable(0),hierarchical(0),loopdetect(0),proxy_keepalive(0),proxying(0),refresh(0),redirected(0),need_validation(0),fail_on_validation_err(0),stale_if_hit(0),accelerated(0),ignore_cc(0),intercepted(0),hostVerified(0),spoof_client_ip(0),internal(0),internalclient(0),must_keepalive(0),pinned(0),canRePin(0),chunked_reply(0),stream_error(0),sslPeek(0),sslBumped(0),destinationIPLookedUp_(0) {
260 #if USE_HTTP_VIOLATIONS
263 #if FOLLOW_X_FORWARDED_FOR
264 done_follow_x_forwarded_for
= 0;
265 #endif /* FOLLOW_X_FORWARDED_FOR */
268 unsigned int range
:1;
269 unsigned int nocache
:1; ///< whether the response to this request may be READ from cache
272 unsigned int cachable
:1; ///< whether the response to thie request may be stored in the cache
273 unsigned int hierarchical
:1;
274 unsigned int loopdetect
:1;
275 unsigned int proxy_keepalive
:1;
276 unsigned int proxying
:
277 1; /* this should be killed, also in httpstateflags */
278 unsigned int refresh
:1;
279 unsigned int redirected
:1;
280 unsigned int need_validation
:1;
281 unsigned int fail_on_validation_err
:1; ///< whether we should fail if validation fails
282 unsigned int stale_if_hit
:1; ///< reply is stale if it is a hit
283 #if USE_HTTP_VIOLATIONS
284 unsigned int nocache_hack
:1; /* for changing/ignoring no-cache requests */
286 unsigned int accelerated
:1;
287 unsigned int ignore_cc
:1;
288 unsigned int intercepted
:1; ///< intercepted request
289 unsigned int hostVerified
:1; ///< whether the Host: header passed verification
290 unsigned int spoof_client_ip
:1; /**< spoof client ip if possible */
291 unsigned int internal
:1;
292 unsigned int internalclient
:1;
293 unsigned int must_keepalive
:1;
294 unsigned int connection_auth
:1; /** Request wants connection oriented auth */
295 unsigned int connection_auth_disabled
:1; /** Connection oriented auth can not be supported */
296 unsigned int connection_proxy_auth
:1; /** Request wants connection oriented auth */
297 unsigned int pinned
:1; /* Request sent on a pinned connection */
298 unsigned int canRePin
:1; ///< OK to reopen a failed pinned connection
299 unsigned int auth_sent
:1; /* Authentication forwarded */
300 unsigned int no_direct
:1; /* Deny direct forwarding unless overriden by always_direct. Used in accelerator mode */
301 unsigned int chunked_reply
:1; /**< Reply with chunked transfer encoding */
302 unsigned int stream_error
:1; /**< Whether stream error has occured */
303 unsigned int sslPeek
:1; ///< internal ssl-bump request to get server cert
304 unsigned int sslBumped
:1; /**< ssl-bumped request*/
306 // When adding new flags, please update cloneAdaptationImmune() as needed.
308 bool resetTCP() const;
310 void clearResetTCP();
311 void destinationIPLookupCompleted();
312 bool destinationIPLookedUp() const;
314 // returns a partial copy of the flags that includes only those flags
315 // that are safe for a related (e.g., ICAP-adapted) request to inherit
316 request_flags
cloneAdaptationImmune() const;
318 #if FOLLOW_X_FORWARDED_FOR
319 unsigned int done_follow_x_forwarded_for
;
320 #endif /* FOLLOW_X_FORWARDED_FOR */
323 unsigned int reset_tcp
:1;
324 unsigned int destinationIPLookedUp_
:1;
328 class cachemgr_passwd
{
332 cachemgr_passwd
*next
;
338 regex_t compiled_pattern
;
345 unsigned int icase
:1;
346 unsigned int refresh_ims
:1;
347 unsigned int store_stale
:1;
348 #if USE_HTTP_VIOLATIONS
349 unsigned int override_expire
:1;
350 unsigned int override_lastmod
:1;
351 unsigned int reload_into_ims
:1;
352 unsigned int ignore_reload
:1;
353 unsigned int ignore_no_cache
:1;
354 unsigned int ignore_no_store
:1;
355 unsigned int ignore_must_revalidate
:1;
356 unsigned int ignore_private
:1;
357 unsigned int ignore_auth
:1;
365 /* public, read-only */
366 char *mask
; /* bit mask */
367 int mask_size
; /* mask size in bytes */
368 int capacity
; /* expected maximum for .count, not a hard limit */
369 int bits_per_entry
; /* number of bits allocated for each entry from capacity */
370 int count
; /* number of digested entries */
371 int del_count
; /* number of deletions performed so far */
374 struct _store_rebuild_data
{
375 int objcount
; /* # objects successfully reloaded */
376 int expcount
; /* # objects expired */
377 int scancount
; /* # entries scanned or read from state file */
378 int clashcount
; /* # swapfile clashes avoided */
379 int dupcount
; /* # duplicates purged */
380 int cancelcount
; /* # SWAP_LOG_DEL objects purged */
381 int invalid
; /* # bad lines */
382 int badflags
; /* # bad e->flags */
388 struct _sslproxy_cert_sign
{
391 sslproxy_cert_sign
*next
;
394 struct _sslproxy_cert_adapt
{
398 sslproxy_cert_adapt
*next
;
404 #include "format/Format.h"
405 #include "log/Formats.h"
410 Format::Format
*logFormat
;
413 Log::Format::log_type type
;
416 #endif /* SQUID_STRUCTS_H */