3 This file is part of GNUnet
4 Copyright (C) 2013-2017 GNUnet e.V.
6 GNUnet is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published
8 by the Free Software Foundation; either version 3, or (at your
9 option) any later version.
11 GNUnet is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNUnet; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 * @file set/gnunet-service-set_union.h
23 * @brief two-peer set operations
24 * @author Florian Dold
25 * @author Christian Grothoff
27 #ifndef GNUNET_SERVICE_SET_UNION_H
28 #define GNUNET_SERVICE_SET_UNION_H
30 #include "gnunet-service-set.h"
31 #include "gnunet-service-set_protocol.h"
35 * Handle a strata estimator from a remote peer
37 * @param cls the union operation
38 * @param msg the message
41 check_union_p2p_strata_estimator (void *cls,
42 const struct StrataEstimatorMessage *msg);
46 * Handle a strata estimator from a remote peer
48 * @param cls the union operation
49 * @param msg the message
52 handle_union_p2p_strata_estimator (void *cls,
53 const struct StrataEstimatorMessage *msg);
57 * Check an IBF message from a remote peer.
59 * Reassemble the IBF from multiple pieces, and
60 * process the whole IBF once possible.
62 * @param cls the union operation
63 * @param msg the header of the message
64 * @return #GNUNET_OK if @a msg is well-formed
67 check_union_p2p_ibf (void *cls,
68 const struct IBFMessage *msg);
72 * Handle an IBF message from a remote peer.
74 * Reassemble the IBF from multiple pieces, and
75 * process the whole IBF once possible.
77 * @param cls the union operation
78 * @param msg the header of the message
81 handle_union_p2p_ibf (void *cls,
82 const struct IBFMessage *msg);
86 * Check an element message from a remote peer.
88 * @param cls the union operation
89 * @param emsg the message
92 check_union_p2p_elements (void *cls,
93 const struct GNUNET_SET_ElementMessage *emsg);
97 * Handle an element message from a remote peer.
98 * Sent by the other peer either because we decoded an IBF and placed a demand,
99 * or because the other peer switched to full set transmission.
101 * @param cls the union operation
102 * @param emsg the message
105 handle_union_p2p_elements (void *cls,
106 const struct GNUNET_SET_ElementMessage *emsg);
110 * Check a full element message from a remote peer.
112 * @param cls the union operation
113 * @param emsg the message
116 check_union_p2p_full_element (void *cls,
117 const struct GNUNET_SET_ElementMessage *emsg);
121 * Handle an element message from a remote peer.
123 * @param cls the union operation
124 * @param emsg the message
127 handle_union_p2p_full_element (void *cls,
128 const struct GNUNET_SET_ElementMessage *emsg);
132 * Send offers (for GNUNET_Hash-es) in response
133 * to inquiries (for IBF_Key-s).
135 * @param cls the union operation
136 * @param msg the message
139 check_union_p2p_inquiry (void *cls,
140 const struct InquiryMessage *msg);
144 * Send offers (for GNUNET_Hash-es) in response
145 * to inquiries (for IBF_Key-s).
147 * @param cls the union operation
148 * @param msg the message
151 handle_union_p2p_inquiry (void *cls,
152 const struct InquiryMessage *msg);
157 * Handle a request for full set transmission.
159 * @parem cls closure, a set union operation
160 * @param mh the demand message
163 handle_union_p2p_request_full (void *cls,
164 const struct GNUNET_MessageHeader *mh);
169 * Handle a "full done" message.
171 * @parem cls closure, a set union operation
172 * @param mh the demand message
175 handle_union_p2p_full_done (void *cls,
176 const struct GNUNET_MessageHeader *mh);
180 * Check a demand by the other peer for elements based on a list
181 * of `struct GNUNET_HashCode`s.
183 * @parem cls closure, a set union operation
184 * @param mh the demand message
185 * @return #GNUNET_OK if @a mh is well-formed
188 check_union_p2p_demand (void *cls,
189 const struct GNUNET_MessageHeader *mh);
193 * Handle a demand by the other peer for elements based on a list
194 * of `struct GNUNET_HashCode`s.
196 * @parem cls closure, a set union operation
197 * @param mh the demand message
200 handle_union_p2p_demand (void *cls,
201 const struct GNUNET_MessageHeader *mh);
205 * Check offer (of `struct GNUNET_HashCode`s).
207 * @param cls the union operation
208 * @param mh the message
209 * @return #GNUNET_OK if @a mh is well-formed
212 check_union_p2p_offer (void *cls,
213 const struct GNUNET_MessageHeader *mh);
217 * Handle offers (of `struct GNUNET_HashCode`s) and
218 * respond with demands (of `struct GNUNET_HashCode`s).
220 * @param cls the union operation
221 * @param mh the message
224 handle_union_p2p_offer (void *cls,
225 const struct GNUNET_MessageHeader *mh);
229 * Handle a done message from a remote peer
231 * @param cls the union operation
232 * @param mh the message
235 handle_union_p2p_done (void *cls,
236 const struct GNUNET_MessageHeader *mh);