GNUnet 0.22.2
gnunet-service-setu_protocol.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2013, 2014 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 */
26#ifndef SET_PROTOCOL_H
27#define SET_PROTOCOL_H
28
29#include "platform.h"
30#include "gnunet_common.h"
31
32
34
36{
41
46
51
52 /* rest: optional message */
53};
54
55
62struct IBFMessage
63{
68
72 uint32_t ibf_size;
73
77 uint32_t offset GNUNET_PACKED;
78
83
88 /* rest: buckets */
89};
90
91
101struct InquiryMessage
102{
107
111 uint32_t salt GNUNET_PACKED;
112
113 /* rest: inquiry IBF keys */
114};
115
116
123{
128
133};
134
135
139struct BFMessage
140{
145
150
156
161
166
171
175};
176
177
185{
190
195
200};
201
202
207{
212
216 uint8_t se_count;
217
221 uint64_t set_size GNUNET_PACKED;
222};
223
224
230{
235
240
245
250
251};
252
253
255
256#endif
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
Bloom filter messages exchanged for set intersection calculation.
struct GNUNET_HashCode element_xor_hash
XOR of all hashes over all elements remaining in the set.
uint32_t bits_per_element
Number of bits (k-value) used in encoding the bloomfilter.
uint32_t sender_element_count
Number of elements the sender still has in the set.
uint32_t bloomfilter_total_length
Total length of the bloomfilter data.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF.
uint32_t sender_mutator
Mutator used with this bloomfilter.
A 512-bit hashcode.
Header for all communications.
Message containing buckets of an invertible bloom filter.
uint32_t offset
Offset of the strata in the rest of the message.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF.
uint32_t ibf_size
Size of the whole ibf (number of buckets)
uint16_t ibf_counter_bit_length
The bit length of the counter.
uint32_t salt
Salt used when hashing elements for this IBF.
estimate_best_mode_of_operation (uint64_t avg_element_size, uint64_t local_set_size,...
uint32_t salt
Salt used when hashing elements for this inquiry.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF.
Last message, send to confirm the final set.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_DONE.
uint32_t final_element_count
Final number of elements in intersection.
struct GNUNET_HashCode element_xor_hash
XOR of all hashes over all elements remaining in the set.
During intersection, the first (and possibly second) message send it the number of elements in the se...
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_ELEMENT_INFO.
uint32_t sender_element_count
mutator used with this bloomfilter.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST.
uint32_t element_count
For Intersection: my element count.
struct GNUNET_HashCode app_idX
Application-specific identifier of the request.
Strata estimator together with the peer's overall set size.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SE(C)
uint64_t set_size
Size of the local set.
uint8_t se_count
The number of ses transmitted.
Message which signals to other peer that we are sending full set.
uint32_t local_set_difference
Local set difference calculated with strata estimator.
uint32_t remote_set_difference
Remote set difference calculated with strata estimator.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_SETU_P2P_SEND_FULL.
uint32_t remote_set_size
Total remote set size.