aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_set_service.h
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-02-23 15:15:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-02-23 17:47:38 +0100
commitd5af1252b2a83d75fe4a8f6e48e1d01ab027b553 (patch)
tree3138f19a619c8b1730aafd6b31f041e64a4f2622 /src/include/gnunet_set_service.h
parent0581ec4f88a81894a17ef4619a8ac2a0c3c7d061 (diff)
downloadgnunet-d5af1252b2a83d75fe4a8f6e48e1d01ab027b553.tar.gz
gnunet-d5af1252b2a83d75fe4a8f6e48e1d01ab027b553.zip
add set operation options
Diffstat (limited to 'src/include/gnunet_set_service.h')
-rw-r--r--src/include/gnunet_set_service.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h
index 52613ad59..f9b477f47 100644
--- a/src/include/gnunet_set_service.h
+++ b/src/include/gnunet_set_service.h
@@ -153,6 +153,7 @@ enum GNUNET_SET_Status
153}; 153};
154 154
155 155
156
156/** 157/**
157 * The way results are given to the client. 158 * The way results are given to the client.
158 */ 159 */
@@ -212,6 +213,54 @@ struct GNUNET_SET_Element
212 213
213 214
214/** 215/**
216 * Possible options to pass to a set operation.
217 *
218 * Used as tag for struct #GNUNET_SET_Option.
219 */
220enum GNUNET_SET_OptionType
221{
222 /**
223 * Fail set operations when the other peer shows weird behavior
224 * that might by a Byzantine fault.
225 *
226 * For set union, 'v.num' is a lower bound on elements
227 * that the other peer must have in common with us.
228 */
229 GNUNET_SET_OPTION_BYZANTINE=1,
230 /**
231 * Do not use the optimized set operation, but send full sets.
232 * Might trigger Byzantine fault detection.
233 */
234 GNUNET_SET_OPTION_FORCE_FULL=2,
235 /**
236 * Only use optimized set operations, even though for this
237 * particular set operation they might be much slower.
238 * Might trigger Byzantine fault detection.
239 */
240 GNUNET_SET_OPTION_FORCE_DELTA=4,
241};
242
243
244/**
245 * Option for set operations.
246 */
247struct GNUNET_SET_Option
248{
249 /**
250 * Type of the option.
251 */
252 enum GNUNET_SET_OptionType type;
253
254 /**
255 * Value for the option, only used with some options.
256 */
257 union {
258 uint64_t num;
259 } v;
260};
261
262
263/**
215 * Continuation used for some of the set operations 264 * Continuation used for some of the set operations
216 * 265 *
217 * @param cls closure 266 * @param cls closure
@@ -367,6 +416,7 @@ GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer,
367 const struct GNUNET_HashCode *app_id, 416 const struct GNUNET_HashCode *app_id,
368 const struct GNUNET_MessageHeader *context_msg, 417 const struct GNUNET_MessageHeader *context_msg,
369 enum GNUNET_SET_ResultMode result_mode, 418 enum GNUNET_SET_ResultMode result_mode,
419 struct GNUNET_SET_Option options[],
370 GNUNET_SET_ResultIterator result_cb, 420 GNUNET_SET_ResultIterator result_cb,
371 void *result_cls); 421 void *result_cls);
372 422
@@ -420,6 +470,7 @@ GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh);
420struct GNUNET_SET_OperationHandle * 470struct GNUNET_SET_OperationHandle *
421GNUNET_SET_accept (struct GNUNET_SET_Request *request, 471GNUNET_SET_accept (struct GNUNET_SET_Request *request,
422 enum GNUNET_SET_ResultMode result_mode, 472 enum GNUNET_SET_ResultMode result_mode,
473 struct GNUNET_SET_Option options[],
423 GNUNET_SET_ResultIterator result_cb, 474 GNUNET_SET_ResultIterator result_cb,
424 void *result_cls); 475 void *result_cls);
425 476