/**
- * The key entry is used to associate an ibf key with
- * an element.
+ * The key entry is used to associate an ibf key with an element.
*/
struct KeyEntry
{
struct GNUNET_MQ_Envelope *ev;
struct GNUNET_SET_ResultMessage *msg;
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "union operation failed\n");
-
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "union operation failed\n");
ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_RESULT);
msg->result_status = htons (GNUNET_SET_STATUS_FAILURE);
msg->request_id = htonl (op->spec->client_request_id);
* @param cls closure
* @param key current key code
* @param value value in the hash map
- * @return #GNUNET_YES if we should continue to
- * iterate,
+ * @return #GNUNET_YES if we should continue to iterate,
* #GNUNET_NO if not.
*/
static int
* @param cls closure
* @param key current key code
* @param value value in the hash map
- * @return #GNUNET_YES if we should continue to
- * iterate,
- * #GNUNET_NO if not.
+ * @return #GNUNET_YES (we should continue to iterate)
*/
static int
op_has_element_iterator (void *cls,
GNUNET_assert (NULL != k);
while (NULL != k)
{
- if (0 == GNUNET_CRYPTO_hash_cmp (&k->element->element_hash, element_hash))
+ if (0 == GNUNET_CRYPTO_hash_cmp (&k->element->element_hash,
+ element_hash))
return GNUNET_NO;
k = k->next_colliding;
}
* Iterator for initializing the
* key-to-element mapping of a union operation
*
- * @param cls the union operation
- * @param key unised
- * @param value the element entry to insert
+ * @param cls the union operation `struct Operation *`
+ * @param key unused
+ * @param value the `struct ElementEntry *` to insert
* into the key-to-element mapping
- * @return GNUNET_YES to continue iterating,
- * GNUNET_NO to stop
+ * @return #GNUNET_YES (to continue iterating)
*/
static int
init_key_to_element_iterator (void *cls,
* @param size size of the ibf to create
*/
static void
-prepare_ibf (struct Operation *op, uint16_t size)
+prepare_ibf (struct Operation *op,
+ uint16_t size)
{
if (NULL == op->state->key_to_element)
{
ibf_destroy (op->state->local_ibf);
op->state->local_ibf = ibf_create (size, SE_IBF_HASH_NUM);
GNUNET_CONTAINER_multihashmap32_iterate (op->state->key_to_element,
- prepare_ibf_iterator, op->state->local_ibf);
+ &prepare_ibf_iterator,
+ op->state->local_ibf);
}
* @param ibf_order order of the ibf to send, size=2^order
*/
static void
-send_ibf (struct Operation *op, uint16_t ibf_order)
+send_ibf (struct Operation *op,
+ uint16_t ibf_order)
{
unsigned int buckets_sent = 0;
struct InvertibleBloomFilter *ibf;
unsigned int ibf_order;
ibf_order = 2;
- while ((1<<ibf_order) < (IBF_ALPHA * diff) || (1<<ibf_order) < SE_IBF_HASH_NUM)
+ while ( (1<<ibf_order) < (IBF_ALPHA * diff) ||
+ ((1<<ibf_order) < SE_IBF_HASH_NUM) )
ibf_order++;
if (ibf_order > MAX_IBF_ORDER)
ibf_order = MAX_IBF_ORDER;
* @param mh the message
*/
static void
-handle_p2p_strata_estimator (void *cls, const struct GNUNET_MessageHeader *mh)
+handle_p2p_strata_estimator (void *cls,
+ const struct GNUNET_MessageHeader *mh)
{
struct Operation *op = cls;
struct StrataEstimator *remote_se;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"transmitted all values, sending DONE\n");
- ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_P2P_DONE);
+ ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_DONE);
GNUNET_MQ_send (op->mq, ev);
break;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"got DONE, sending final DONE after elements\n");
op->state->phase = PHASE_FINISHED;
- ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_P2P_DONE);
+ ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_DONE);
GNUNET_MQ_send (op->mq, ev);
return;
}
}
msg->operation = htonl (GNUNET_SET_OPERATION_UNION);
msg->app_id = op->spec->app_id;
- msg->salt = htonl (op->spec->salt);
GNUNET_MQ_send (op->mq, ev);
if (NULL != opaque_context)
case GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENT_REQUESTS:
handle_p2p_element_requests (op, mh);
break;
- case GNUNET_MESSAGE_TYPE_SET_P2P_DONE:
+ case GNUNET_MESSAGE_TYPE_SET_UNION_P2P_DONE:
handle_p2p_done (op, mh);
break;
default: