&session->global_id,
&rcm.header,
GNUNET_SET_RESULT_SYMMETRIC,
+ (struct GNUNET_SET_Option[]) { 0 },
set_result_cb,
task);
task->cls.setop.op = GNUNET_SET_accept (request,
GNUNET_SET_RESULT_SYMMETRIC,
+ (struct GNUNET_SET_Option[]) { 0 },
set_result_cb,
task);
GNUNET_SET_OPERATION_UNION);
neighbor->set_op = GNUNET_SET_accept (request,
GNUNET_SET_RESULT_ADDED,
+ (struct GNUNET_SET_Option[]) { 0 },
&handle_set_union_result,
neighbor);
neighbor->consensus_insertion_offset = 0;
&neighbor->real_session_id,
NULL,
GNUNET_SET_RESULT_ADDED,
+ (struct GNUNET_SET_Option[]) { 0 },
&handle_set_union_result,
neighbor);
neighbor->consensus_insertion_offset = 0;
*/
#define GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_CONNECT 596
+/**
+ * Request all missing elements from the other peer,
+ * based on their sets and the elements we previously sent
+ * with #GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENTS.
+ */
+#define GNUNET_MESSAGE_TYPE_SET_UNION_P2P_GET_MISSING 597
+
/*******************************************************************************
* TESTBED LOGGER message types
};
+
/**
* The way results are given to the client.
*/
};
+/**
+ * Possible options to pass to a set operation.
+ *
+ * Used as tag for struct #GNUNET_SET_Option.
+ */
+enum GNUNET_SET_OptionType
+{
+ /**
+ * Fail set operations when the other peer shows weird behavior
+ * that might by a Byzantine fault.
+ *
+ * For set union, 'v.num' is a lower bound on elements
+ * that the other peer must have in common with us.
+ */
+ GNUNET_SET_OPTION_BYZANTINE=1,
+ /**
+ * Do not use the optimized set operation, but send full sets.
+ * Might trigger Byzantine fault detection.
+ */
+ GNUNET_SET_OPTION_FORCE_FULL=2,
+ /**
+ * Only use optimized set operations, even though for this
+ * particular set operation they might be much slower.
+ * Might trigger Byzantine fault detection.
+ */
+ GNUNET_SET_OPTION_FORCE_DELTA=4,
+};
+
+
+/**
+ * Option for set operations.
+ */
+struct GNUNET_SET_Option
+{
+ /**
+ * Type of the option.
+ */
+ enum GNUNET_SET_OptionType type;
+
+ /**
+ * Value for the option, only used with some options.
+ */
+ union {
+ uint64_t num;
+ } v;
+};
+
+
/**
* Continuation used for some of the set operations
*
const struct GNUNET_HashCode *app_id,
const struct GNUNET_MessageHeader *context_msg,
enum GNUNET_SET_ResultMode result_mode,
+ struct GNUNET_SET_Option options[],
GNUNET_SET_ResultIterator result_cb,
void *result_cls);
struct GNUNET_SET_OperationHandle *
GNUNET_SET_accept (struct GNUNET_SET_Request *request,
enum GNUNET_SET_ResultMode result_mode,
+ struct GNUNET_SET_Option options[],
GNUNET_SET_ResultIterator result_cb,
void *result_cls);
&revocation_set_union_app_id,
NULL,
GNUNET_SET_RESULT_ADDED,
+ (struct GNUNET_SET_Option[]) { 0 },
&add_revocation,
peer_entry);
if (GNUNET_OK !=
}
peer_entry->so = GNUNET_SET_accept (request,
GNUNET_SET_RESULT_ADDED,
+ (struct GNUNET_SET_Option[]) { 0 },
&add_revocation,
peer_entry);
if (GNUNET_OK !=
s->intersection_op
= GNUNET_SET_accept (request,
GNUNET_SET_RESULT_REMOVED,
+ (struct GNUNET_SET_Option[]) { 0 },
&cb_intersection_element_removed,
s);
if (NULL == s->intersection_op)
&set_sid,
NULL,
GNUNET_SET_RESULT_REMOVED,
+ (struct GNUNET_SET_Option[]) { 0 },
&cb_intersection_element_removed,
s);
if (GNUNET_OK !=
s->intersection_op
= GNUNET_SET_accept (request,
GNUNET_SET_RESULT_REMOVED,
+ (struct GNUNET_SET_Option[]) { 0 },
&cb_intersection_element_removed,
s);
if (NULL == s->intersection_op)
&s->session_id,
NULL,
GNUNET_SET_RESULT_REMOVED,
+ (struct GNUNET_SET_Option[]) { 0 },
&cb_intersection_element_removed,
s);
if (GNUNET_OK !=
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"set listen cb called\n");
info2.oh = GNUNET_SET_accept (request, GNUNET_SET_RESULT_SYMMETRIC,
- set_result_cb, &info2);
+ (struct GNUNET_SET_Option[]) { 0 },
+ set_result_cb, &info2);
GNUNET_SET_commit (info2.oh, info2.set);
}
info1.oh = GNUNET_SET_prepare (&local_peer, &app_id, NULL,
GNUNET_SET_RESULT_SYMMETRIC,
+ (struct GNUNET_SET_Option[]) { 0 },
set_result_cb, &info1);
GNUNET_SET_commit (info1.oh, info1.set);
GNUNET_SET_destroy (info1.set);
const struct GNUNET_HashCode *app_id,
const struct GNUNET_MessageHeader *context_msg,
enum GNUNET_SET_ResultMode result_mode,
+ struct GNUNET_SET_Option options[],
GNUNET_SET_ResultIterator result_cb,
void *result_cls)
{
struct GNUNET_SET_OperationHandle *
GNUNET_SET_accept (struct GNUNET_SET_Request *request,
enum GNUNET_SET_ResultMode result_mode,
+ struct GNUNET_SET_Option options[],
GNUNET_SET_ResultIterator result_cb,
void *result_cls)
{
listen_handle = NULL;
oh2 = GNUNET_SET_accept (request,
GNUNET_SET_RESULT_ADDED,
+ (struct GNUNET_SET_Option[]) { 0 },
&result_cb_set2,
NULL);
GNUNET_SET_commit (oh2,
&app_id,
&context_msg,
GNUNET_SET_RESULT_ADDED,
+ (struct GNUNET_SET_Option[]) { 0 },
&result_cb_set1,
NULL);
GNUNET_SET_commit (oh1,
&app_id,
NULL,
GNUNET_SET_RESULT_ADDED,
+ (struct GNUNET_SET_Option[]) { 0 },
NULL,
NULL);
listen_handle = NULL;
oh2 = GNUNET_SET_accept (request,
GNUNET_SET_RESULT_FULL,
+ (struct GNUNET_SET_Option[]) { 0 },
&result_cb_set2,
NULL);
GNUNET_SET_commit (oh2,
&app_id,
&context_msg,
GNUNET_SET_RESULT_FULL,
+ (struct GNUNET_SET_Option[]) { 0 },
&result_cb_set1,
NULL);
GNUNET_SET_commit (oh1,
listen_handle = NULL;
oh2 = GNUNET_SET_accept (request,
GNUNET_SET_RESULT_SYMMETRIC,
+ (struct GNUNET_SET_Option[]) { 0 },
&result_cb_set2,
NULL);
GNUNET_SET_commit (oh2,
&app_id,
&context_msg,
GNUNET_SET_RESULT_SYMMETRIC,
+ (struct GNUNET_SET_Option[]) { 0 },
&result_cb_set1, NULL);
GNUNET_SET_commit (oh1, set1);
}