diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-11-05 00:08:13 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-11-05 00:08:13 +0000 |
commit | ca2c7bdfa64a30c0013598f0718dcfe7e6d98b2a (patch) | |
tree | 3bedd0e18f88371c2e75bd1953e0bc321629c828 /src/set/ibf.h | |
parent | 6c3bf6b3486fd31402ab991f5ddef76bf9cd93c4 (diff) | |
download | gnunet-ca2c7bdfa64a30c0013598f0718dcfe7e6d98b2a.tar.gz gnunet-ca2c7bdfa64a30c0013598f0718dcfe7e6d98b2a.zip |
- implemented missing set functionality
- secretsharing api changes
Diffstat (limited to 'src/set/ibf.h')
-rw-r--r-- | src/set/ibf.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/set/ibf.h b/src/set/ibf.h index 407d14f64..c62ecac43 100644 --- a/src/set/ibf.h +++ b/src/set/ibf.h | |||
@@ -39,27 +39,40 @@ extern "C" | |||
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | 41 | ||
42 | /** | ||
43 | * Keys that can be inserted into and removed from an IBF. | ||
44 | */ | ||
42 | struct IBF_Key | 45 | struct IBF_Key |
43 | { | 46 | { |
44 | uint64_t key_val; | 47 | uint64_t key_val; |
45 | }; | 48 | }; |
46 | 49 | ||
50 | |||
51 | /** | ||
52 | * Hash of an IBF key. | ||
53 | */ | ||
47 | struct IBF_KeyHash | 54 | struct IBF_KeyHash |
48 | { | 55 | { |
49 | uint32_t key_hash_val; | 56 | uint32_t key_hash_val; |
50 | }; | 57 | }; |
51 | 58 | ||
59 | |||
60 | /** | ||
61 | * Type of the count field of IBF buckets. | ||
62 | */ | ||
52 | struct IBF_Count | 63 | struct IBF_Count |
53 | { | 64 | { |
54 | int8_t count_val; | 65 | int8_t count_val; |
55 | }; | 66 | }; |
56 | 67 | ||
68 | |||
57 | /** | 69 | /** |
58 | * Size of one ibf bucket in bytes | 70 | * Size of one ibf bucket in bytes |
59 | */ | 71 | */ |
60 | #define IBF_BUCKET_SIZE (sizeof (struct IBF_Count) + sizeof (struct IBF_Key) + \ | 72 | #define IBF_BUCKET_SIZE (sizeof (struct IBF_Count) + sizeof (struct IBF_Key) + \ |
61 | sizeof (struct IBF_KeyHash)) | 73 | sizeof (struct IBF_KeyHash)) |
62 | 74 | ||
75 | |||
63 | /** | 76 | /** |
64 | * Invertible bloom filter (IBF). | 77 | * Invertible bloom filter (IBF). |
65 | * | 78 | * |
@@ -212,6 +225,7 @@ ibf_decode (struct InvertibleBloomFilter *ibf, int *ret_side, struct IBF_Key *re | |||
212 | struct InvertibleBloomFilter * | 225 | struct InvertibleBloomFilter * |
213 | ibf_dup (const struct InvertibleBloomFilter *ibf); | 226 | ibf_dup (const struct InvertibleBloomFilter *ibf); |
214 | 227 | ||
228 | |||
215 | /** | 229 | /** |
216 | * Destroy all resources associated with the invertible bloom filter. | 230 | * Destroy all resources associated with the invertible bloom filter. |
217 | * No more ibf_*-functions may be called on ibf after calling destroy. | 231 | * No more ibf_*-functions may be called on ibf after calling destroy. |