6 * SQUID Web Proxy Cache http://www.squid-cache.org/
7 * ----------------------------------------------------------
9 * Squid is the result of efforts by numerous individuals from
10 * the Internet community; see the CONTRIBUTORS file for full
11 * details. Many organizations have provided support for Squid's
12 * development; see the SPONSORS file for full details. Squid is
13 * Copyrighted (C) 2001 by the Regents of the University of
14 * California; see the COPYRIGHT file for full details. Squid
15 * incorporates software developed and/or copyrighted by other
16 * sources; see the CREDITS file for full details.
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
34 #ifndef SQUID_PEERDIGEST_H
35 #define SQUID_PEERDIGEST_H
43 /* for CacheDigestGuessStats */
44 #include "StatCounters.h"
47 short int current
; /* current version */
48 short int required
; /* minimal version that can safely handle current version */
51 /* digest control block; used for transmission and storage */
53 class StoreDigestCBlock
61 unsigned char bits_per_entry
;
62 unsigned char hash_func_count
;
63 short int reserved_short
;
67 struct _DigestFetchState
{
70 StoreEntry
*old_entry
;
86 char buf
[SM_PAGE_SIZE
];
88 digest_read_state_t state
;
95 void *operator new (size_t);
96 void operator delete(void *);
98 struct peer
*peer
; /**< pointer back to peer structure, argh */
99 CacheDigest
*cd
; /**< actual digest structure */
100 String host
; /**< copy of peer->host */
101 const char *req_result
; /**< text status of the last request */
104 unsigned int needed
:1; /**< there were requests for this digest */
105 unsigned int usable
:1; /**< can be used for lookups */
106 unsigned int requested
:1; /**< in process of receiving [fresh] digest */
110 /* all times are absolute unless augmented with _delay */
111 time_t initialized
; /* creation */
112 time_t needed
; /* first lookup/use by a peer */
113 time_t next_check
; /* next scheduled check/refresh event */
114 time_t retry_delay
; /* delay before re-checking _invalid_ digest */
115 time_t requested
; /* requested a fresh copy of a digest */
116 time_t req_delay
; /* last request response time */
117 time_t received
; /* received the current copy of a digest */
118 time_t disabled
; /* disabled for good */
122 CacheDigestGuessStats guess
;
132 CBDATA_CLASS(PeerDigest
);
135 extern const Version CacheDigestVer
;
137 #endif /* USE_CACHE_DIGESTS */
139 #endif /* SQUID_PEERDIGEST_H */