]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/CacheDigest.h
2 * Copyright (C) 1996-2015 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_
14 #include "store_key_md5.h"
16 class CacheDigestGuessStats
;
23 /* public, read-only */
24 char *mask
; /* bit mask */
25 int mask_size
; /* mask size in bytes */
26 int capacity
; /* expected maximum for .count, not a hard limit */
27 int bits_per_entry
; /* number of bits allocated for each entry from capacity */
28 int count
; /* number of digested entries */
29 int del_count
; /* number of deletions performed so far */
32 CacheDigest
*cacheDigestCreate(int capacity
, int bpe
);
33 void cacheDigestDestroy(CacheDigest
* cd
);
34 CacheDigest
*cacheDigestClone(const CacheDigest
* cd
);
35 void cacheDigestClear(CacheDigest
* cd
);
36 void cacheDigestChangeCap(CacheDigest
* cd
, int new_cap
);
37 int cacheDigestTest(const CacheDigest
* cd
, const cache_key
* key
);
38 void cacheDigestAdd(CacheDigest
* cd
, const cache_key
* key
);
39 void cacheDigestDel(CacheDigest
* cd
, const cache_key
* key
);
40 size_t cacheDigestCalcMaskSize(int cap
, int bpe
);
41 int cacheDigestBitUtil(const CacheDigest
* cd
);
42 void cacheDigestGuessStatsUpdate(CacheDigestGuessStats
* stats
, int real_hit
, int guess_hit
);
43 void cacheDigestGuessStatsReport(const CacheDigestGuessStats
* stats
, StoreEntry
* sentry
, const char *label
);
44 void cacheDigestReport(CacheDigest
* cd
, const char *label
, StoreEntry
* e
);
46 #endif /* SQUID_CACHEDIGEST_H_ */