GNUnet  0.20.0
gnunet_block_group_lib.h
Go to the documentation of this file.
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 it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your 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  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
31 #ifndef GNUNET_BLOCK_GROUP_LIB_H
32 #define GNUNET_BLOCK_GROUP_LIB_H
33 
34 
35 #include "gnunet_util_lib.h"
36 #include "gnunet_block_lib.h"
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #if 0 /* keep Emacsens' auto-indent happy */
42 }
43 #endif
44 #endif
45 
46 
60 size_t
61 GNUNET_BLOCK_GROUP_compute_bloomfilter_size (unsigned int entry_count,
62  unsigned int k);
63 
64 
77 struct GNUNET_BLOCK_Group *
79  size_t bf_size,
80  unsigned int bf_k,
82  const void *raw_data,
83  size_t raw_data_size);
84 
85 
98  const struct GNUNET_HashCode *hc);
99 
100 
101 #if 0 /* keep Emacsens' auto-indent happy */
102 {
103 #endif
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 /* ifndef GNUNET_BLOCK_GROUP_LIB_H */
109 #endif
110  /* end of group */
112 
113 /* end of gnunet_block_group_lib.h */
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
Library for data block manipulation.
enum GNUNET_GenericReturnValue GNUNET_BLOCK_GROUP_bf_test_and_set(struct GNUNET_BLOCK_Group *bg, const struct GNUNET_HashCode *hc)
Test if hc is contained in the Bloom filter of bg.
Definition: bg_bf.c:232
size_t GNUNET_BLOCK_GROUP_compute_bloomfilter_size(unsigned int entry_count, unsigned int k)
How many bytes should a bloomfilter be if we have already seen entry_count responses?...
Definition: bg_bf.c:268
struct GNUNET_BLOCK_Group * GNUNET_BLOCK_GROUP_bf_create(void *cls, size_t bf_size, unsigned int bf_k, enum GNUNET_BLOCK_Type type, const void *raw_data, size_t raw_data_size)
Create a new block group that filters duplicates using a Bloom filter.
Definition: bg_bf.c:173
GNUNET_GenericReturnValue
Named constants for return values.
Block group data.
A 512-bit hashcode.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model