PeerDigest.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 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_PEERDIGEST_H
10#define SQUID_PEERDIGEST_H
11
12#if USE_CACHE_DIGESTS
13
14#include "cbdata.h"
15#include "StatCounters.h"
16
18{
19public:
20 short int current; /* current version */
21 short int required; /* minimal version that can safely handle current version */
22};
23
24/* digest control block; used for transmission and storage */
25
27{
28public:
31 int count;
34 unsigned char bits_per_entry;
35 unsigned char hash_func_count;
36 short int reserved_short;
37 int reserved[32 - 6];
38};
39
40class HttpRequest;
41class PeerDigest;
42class store_client;
43
45{
47
48public:
51
58 int offset;
59 uint32_t mask_offset;
60 time_t start_time;
61 time_t resp_time;
62 time_t expires;
63
64 struct {
65 int msg;
66 int bytes;
68
70 ssize_t bufofs;
72};
73
75{
77
78public:
81
82 CachePeer *peer = nullptr;
83 CacheDigest *cd = nullptr;
85 const char *req_result = nullptr;
87 struct {
88 bool needed = false;
89 bool usable = false;
90 bool requested = false;
92
93 struct {
94 /* all times are absolute unless augmented with _delay */
95 time_t initialized = 0; /* creation */
96 time_t needed = 0; /* first lookup/use by a peer */
97 time_t next_check = 0; /* next scheduled check/refresh event */
98 time_t retry_delay = 0; /* delay before re-checking _invalid_ digest */
99 time_t requested = 0; /* requested a fresh copy of a digest */
100 time_t req_delay = 0; /* last request response time */
101 time_t received = 0; /* received the current copy of a digest */
102 time_t disabled = 0; /* disabled for good */
104
105 struct {
107 int used_count = 0;
108
109 struct {
110 int msgs = 0;
114};
115
116extern const Version CacheDigestVer;
117
121void peerDigestStatsReport(const PeerDigest * pd, StoreEntry * e);
122
123#endif /* USE_CACHE_DIGESTS */
124
125#endif /* SQUID_PEERDIGEST_H */
126
void peerDigestStatsReport(const PeerDigest *pd, StoreEntry *e)
void peerDigestCreate(CachePeer *p)
Definition: peer_digest.cc:129
void peerDigestNotePeerGone(PeerDigest *pd)
Definition: peer_digest.cc:223
void peerDigestNeeded(PeerDigest *pd)
Definition: peer_digest.cc:176
const Version CacheDigestVer
Definition: peer_digest.cc:55
#define CBDATA_CLASS(type)
Definition: cbdata.h:302
counter for accumulating byte values
Definition: ByteCounter.h:14
struct DigestFetchState::@88 recv
store_client * sc
Definition: PeerDigest.h:55
StoreEntry * entry
Definition: PeerDigest.h:53
PeerDigest * pd
Definition: PeerDigest.h:52
HttpRequest * request
Definition: PeerDigest.h:57
struct DigestFetchState::@88 sent
char buf[SM_PAGE_SIZE]
Definition: PeerDigest.h:69
store_client * old_sc
Definition: PeerDigest.h:56
ssize_t bufofs
Definition: PeerDigest.h:70
time_t resp_time
Definition: PeerDigest.h:61
time_t start_time
Definition: PeerDigest.h:60
DigestFetchState(PeerDigest *, HttpRequest *)
Definition: peer_digest.cc:88
digest_read_state_t state
Definition: PeerDigest.h:71
uint32_t mask_offset
Definition: PeerDigest.h:59
StoreEntry * old_entry
Definition: PeerDigest.h:54
time_t retry_delay
Definition: PeerDigest.h:98
ByteCounter kbytes
Definition: PeerDigest.h:111
bool requested
Definition: PeerDigest.h:90
CacheDigestGuessStats guess
Definition: PeerDigest.h:106
CachePeer * peer
Definition: PeerDigest.h:82
bool usable
Definition: PeerDigest.h:89
struct PeerDigest::@91::@92 recv
time_t next_check
Definition: PeerDigest.h:97
SBuf host
copy of peer->host
Definition: PeerDigest.h:84
time_t initialized
Definition: PeerDigest.h:95
struct PeerDigest::@90 times
struct PeerDigest::@91::@92 sent
time_t received
Definition: PeerDigest.h:101
struct PeerDigest::@91 stats
int used_count
Definition: PeerDigest.h:107
PeerDigest(CachePeer *)
Definition: peer_digest.cc:68
bool needed
Definition: PeerDigest.h:88
time_t disabled
Definition: PeerDigest.h:102
CacheDigest * cd
Definition: PeerDigest.h:83
time_t req_delay
Definition: PeerDigest.h:100
const char * req_result
Definition: PeerDigest.h:85
struct PeerDigest::@89 flags
Definition: SBuf.h:94
unsigned char bits_per_entry
Definition: PeerDigest.h:34
int reserved[32 - 6]
Definition: PeerDigest.h:37
unsigned char hash_func_count
Definition: PeerDigest.h:35
short int reserved_short
Definition: PeerDigest.h:36
short int required
Definition: PeerDigest.h:21
short int current
Definition: PeerDigest.h:20
#define SM_PAGE_SIZE
Definition: defines.h:65
digest_read_state_t
Definition: enums.h:202

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors