diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-02-20 15:09:00 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-02-20 15:09:19 +0100 |
commit | a3882b58f1c5976677aa65b0af8a48e8e946b06e (patch) | |
tree | bd841d8e78052a05821e194d002ca843693fb2c9 /src/include/gnunet_block_group_lib.h | |
parent | f0149c5430f42a8bad422e9c51754af59c7bfa2f (diff) | |
download | gnunet-a3882b58f1c5976677aa65b0af8a48e8e946b06e.tar.gz gnunet-a3882b58f1c5976677aa65b0af8a48e8e946b06e.zip |
first half of new BLOCK API to generalize duplicate detection beyond BFs
Diffstat (limited to 'src/include/gnunet_block_group_lib.h')
-rw-r--r-- | src/include/gnunet_block_group_lib.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/include/gnunet_block_group_lib.h b/src/include/gnunet_block_group_lib.h new file mode 100644 index 000000000..5fa14ce00 --- /dev/null +++ b/src/include/gnunet_block_group_lib.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2010 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @author Christian Grothoff | ||
23 | * | ||
24 | * @file | ||
25 | * Library for creating block groups (to be used by block plugins) | ||
26 | * | ||
27 | * @defgroup block Block group library | ||
28 | * Library for data group management | ||
29 | * @{ | ||
30 | */ | ||
31 | #ifndef GNUNET_BLOCK_GROUP_LIB_H | ||
32 | #define GNUNET_BLOCK_GROUP_LIB_H | ||
33 | |||
34 | #include "gnunet_util_lib.h" | ||
35 | #include "gnunet_block_lib.h" | ||
36 | |||
37 | #ifdef __cplusplus | ||
38 | extern "C" | ||
39 | { | ||
40 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
41 | } | ||
42 | #endif | ||
43 | #endif | ||
44 | |||
45 | |||
46 | /** | ||
47 | * Create a new block group that filters duplicates using a Bloom filter. | ||
48 | * | ||
49 | * @param ctx block context in which the block group is created | ||
50 | * @param bf_size size of the Bloom filter | ||
51 | * @param bf_k K-value for the Bloom filter | ||
52 | * @param type block type | ||
53 | * @param nonce random value used to seed the group creation | ||
54 | * @param raw_data optional serialized prior state of the group, NULL if unavailable/fresh | ||
55 | * @param raw_data_size number of bytes in @a raw_data, 0 if unavailable/fresh | ||
56 | * @return block group handle, NULL if block groups are not supported | ||
57 | * by this @a type of block (this is not an error) | ||
58 | */ | ||
59 | struct GNUNET_BLOCK_Group * | ||
60 | GNUNET_BLOCK_GROUP_bf_create (void *cls, | ||
61 | size_t bf_size, | ||
62 | unsigned int bf_k, | ||
63 | enum GNUNET_BLOCK_Type type, | ||
64 | uint32_t nonce, | ||
65 | const void *raw_data, | ||
66 | size_t raw_data_size); | ||
67 | |||
68 | |||
69 | |||
70 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
71 | { | ||
72 | #endif | ||
73 | #ifdef __cplusplus | ||
74 | } | ||
75 | #endif | ||
76 | |||
77 | /* ifndef GNUNET_BLOCK_GROUP_LIB_H */ | ||
78 | #endif | ||
79 | |||
80 | /** @} */ /* end of group */ | ||
81 | |||
82 | /* end of gnunet_block_group_lib.h */ | ||