diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-02-26 22:42:40 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-02-26 22:42:40 +0100 |
commit | 8d7c29c4684f807d5e9a3004bbbab132b158c5aa (patch) | |
tree | 9eca177e00a387d0c18395fde7dbf91289272d98 /src/include | |
parent | e87663cf00dd102e8bb60f400db4bad6d82b3b6c (diff) | |
download | gnunet-8d7c29c4684f807d5e9a3004bbbab132b158c5aa.tar.gz gnunet-8d7c29c4684f807d5e9a3004bbbab132b158c5aa.zip |
ensure all plugins properly use BF, move shared logic to shared library
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_block_group_lib.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/gnunet_block_group_lib.h b/src/include/gnunet_block_group_lib.h index a1ea807f6..3a3dfb2e2 100644 --- a/src/include/gnunet_block_group_lib.h +++ b/src/include/gnunet_block_group_lib.h | |||
@@ -44,6 +44,24 @@ extern "C" | |||
44 | 44 | ||
45 | 45 | ||
46 | /** | 46 | /** |
47 | * How many bytes should a bloomfilter be if we have already seen | ||
48 | * entry_count responses? Sized so that do not have to | ||
49 | * re-size the filter too often (to keep it cheap). | ||
50 | * | ||
51 | * Since other peers will also add entries but not resize the filter, | ||
52 | * we should generally pick a slightly larger size than what the | ||
53 | * strict math would suggest. | ||
54 | * | ||
55 | * @param entry_count expected number of entries in the Bloom filter | ||
56 | * @param k number of bits set per entry | ||
57 | * @return must be a power of two and smaller or equal to 2^15. | ||
58 | */ | ||
59 | size_t | ||
60 | GNUNET_BLOCK_GROUP_compute_bloomfilter_size (unsigned int entry_count, | ||
61 | unsigned int k); | ||
62 | |||
63 | |||
64 | /** | ||
47 | * Create a new block group that filters duplicates using a Bloom filter. | 65 | * Create a new block group that filters duplicates using a Bloom filter. |
48 | * | 66 | * |
49 | * @param ctx block context in which the block group is created | 67 | * @param ctx block context in which the block group is created |