]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/CacheDigest.h
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 70 Cache Digest */
11 #ifndef SQUID_CACHEDIGEST_H_
12 #define SQUID_CACHEDIGEST_H_
17 class CacheDigestGuessStats
;
24 /* public, read-only */
25 char *mask
; /* bit mask */
26 int mask_size
; /* mask size in bytes */
27 int capacity
; /* expected maximum for .count, not a hard limit */
28 int bits_per_entry
; /* number of bits allocated for each entry from capacity */
29 int count
; /* number of digested entries */
30 int del_count
; /* number of deletions performed so far */
33 CacheDigest
*cacheDigestCreate(int capacity
, int bpe
);
34 void cacheDigestDestroy(CacheDigest
* cd
);
35 CacheDigest
*cacheDigestClone(const CacheDigest
* cd
);
36 void cacheDigestClear(CacheDigest
* cd
);
37 void cacheDigestChangeCap(CacheDigest
* cd
, int new_cap
);
38 int cacheDigestTest(const CacheDigest
* cd
, const cache_key
* key
);
39 void cacheDigestAdd(CacheDigest
* cd
, const cache_key
* key
);
40 void cacheDigestDel(CacheDigest
* cd
, const cache_key
* key
);
41 size_t cacheDigestCalcMaskSize(int cap
, int bpe
);
42 int cacheDigestBitUtil(const CacheDigest
* cd
);
43 void cacheDigestGuessStatsUpdate(CacheDigestGuessStats
* stats
, int real_hit
, int guess_hit
);
44 void cacheDigestGuessStatsReport(const CacheDigestGuessStats
* stats
, StoreEntry
* sentry
, const char *label
);
45 void cacheDigestReport(CacheDigest
* cd
, const char *label
, StoreEntry
* e
);
47 #endif /* SQUID_CACHEDIGEST_H_ */