+GNUNET_BLOCK_group_serialize (struct GNUNET_BLOCK_Group *bg,
+ uint32_t *nonce,
+ void **raw_data,
+ size_t *raw_data_size);
+
+
+/**
+ * Destroy resources used by a block group.
+ *
+ * @param bg group to destroy, NULL is allowed
+ */
+void
+GNUNET_BLOCK_group_destroy (struct GNUNET_BLOCK_Group *bg);
+
+
+/**
+ * Function called to validate a reply or a request. For
+ * request evaluation, simply pass "NULL" for the @a reply_block.
+ * Note that it is assumed that the reply has already been
+ * matched to the key (and signatures checked) as it would
+ * be done with the #GNUNET_BLOCK_get_key() function.
+ *
+ * @param ctx block contxt
+ * @param type block type
+ * @param group block group to use for evaluation
+ * @param eo evaluation options to control evaluation
+ * @param query original query (hash)
+ * @param xquery extrended query data (can be NULL, depending on type)
+ * @param xquery_size number of bytes in @a xquery
+ * @param reply_block response to validate
+ * @param reply_block_size number of bytes in @a reply_block
+ * @return characterization of result
+ */
+enum GNUNET_BLOCK_EvaluationResult
+GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx,
+ enum GNUNET_BLOCK_Type type,
+ struct GNUNET_BLOCK_Group *group,
+ enum GNUNET_BLOCK_EvaluationOptions eo,
+ const struct GNUNET_HashCode *query,
+ const void *xquery,
+ size_t xquery_size,
+ const void *reply_block,
+ size_t reply_block_size);
+
+
+/**
+ * Function called to obtain the key for a block.
+ *
+ * @param ctx block context
+ * @param type block type
+ * @param block block to get the key for
+ * @param block_size number of bytes in @a block
+ * @param key set to the key (query) for the given block
+ * @return #GNUNET_YES on success,
+ * #GNUNET_NO if the block is malformed
+ * #GNUNET_SYSERR if type not supported
+ * (or if extracting a key from a block of this type does not work)
+ */
+int
+GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx,
+ enum GNUNET_BLOCK_Type type,
+ const void *block,
+ size_t block_size,
+ struct GNUNET_HashCode *key);
+
+
+/**
+ * Update block group to filter out the given results. Note that the
+ * use of a hash for seen results implies that the caller magically
+ * knows how the specific block engine hashes for filtering
+ * duplicates, so this API may not always apply.
+ *
+ * @param bf_mutator mutation value to use
+ * @param seen_results results already seen
+ * @param seen_results_count number of entries in @a seen_results
+ * @return #GNUNET_SYSERR if not supported, #GNUNET_OK on success
+ */
+int
+GNUNET_BLOCK_group_set_seen (struct GNUNET_BLOCK_Group *bg,
+ const struct GNUNET_HashCode *seen_results,
+ unsigned int seen_results_count);
+
+
+/**
+ * Try merging two block groups. Afterwards, @a bg1 should remain
+ * valid and contain the rules from both @a bg1 and @bg2, and
+ * @a bg2 should be destroyed (as part of this call). The latter
+ * should happen even if merging is not supported.
+ *
+ * @param[in,out] bg1 first group to merge, is updated
+ * @param bg2 second group to merge, is destroyed
+ * @return #GNUNET_OK on success,
+ * #GNUNET_NO if merge failed due to different nonce
+ * #GNUNET_SYSERR if merging is not supported
+ */
+int
+GNUNET_BLOCK_group_merge (struct GNUNET_BLOCK_Group *bg1,
+ struct GNUNET_BLOCK_Group *bg2);