if (NULL == plugin)
return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED;
return plugin->evaluate (plugin->cls,
+ ctx,
type,
group,
eo,
* request evaluation, simply pass "NULL" for the reply_block.
*
* @param cls closure
+ * @param ctx context
* @param type block type
* @param group block group to use
* @param eo control flags
*/
static enum GNUNET_BLOCK_EvaluationResult
block_plugin_template_evaluate (void *cls,
+ struct GNUNET_BLOCK_Context *ctx,
enum GNUNET_BLOCK_Type type,
struct GNUNET_BLOCK_Group *group,
enum GNUNET_BLOCK_EvaluationOptions eo,
* request evaluation, simply pass "NULL" for the reply_block.
*
* @param cls closure
+ * @param ctx block context
* @param type block type
* @param group group to check against
* @param eo control flags
*/
static enum GNUNET_BLOCK_EvaluationResult
block_plugin_test_evaluate (void *cls,
+ struct GNUNET_BLOCK_Context *ctx,
enum GNUNET_BLOCK_Type type,
struct GNUNET_BLOCK_Group *group,
enum GNUNET_BLOCK_EvaluationOptions eo,
* request evaluation, simply pass "NULL" for the reply_block.
*
* @param cls closure
+ * @param ctx context
* @param type block type
* @param group block group to use
* @param eo control flags
*/
static enum GNUNET_BLOCK_EvaluationResult
block_plugin_consensus_evaluate (void *cls,
+ struct GNUNET_BLOCK_Context *ctx,
enum GNUNET_BLOCK_Type type,
struct GNUNET_BLOCK_Group *group,
enum GNUNET_BLOCK_EvaluationOptions eo,
size_t reply_block_size)
{
if (reply_block_size < sizeof (struct ConsensusElement))
- {
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
- }
- return GNUNET_BLOCK_EVALUATION_OK_MORE;
+
+ const struct ConsensusElement *ce = reply_block;
+
+ if ( (GNUNET_YES == ce->is_contested_marker) ||
+ (0 == ce->payload_type ) )
+ return GNUNET_BLOCK_EVALUATION_OK_MORE;
+
+ return GNUNET_BLOCK_evaluate (ctx,
+ type,
+ group,
+ eo,
+ query,
+ xquery,
+ xquery_size,
+ &ce[1],
+ reply_block_size - sizeof (struct ConsensusElement));
}
* request evaluation, simply pass "NULL" for the @a reply_block.
*
* @param cls closure
+ * @param ctx context
* @param type block type
* @param group block group to check against
* @param eo control flags
*/
static enum GNUNET_BLOCK_EvaluationResult
block_plugin_dht_evaluate (void *cls,
+ struct GNUNET_BLOCK_Context *ctx,
enum GNUNET_BLOCK_Type type,
struct GNUNET_BLOCK_Group *group,
enum GNUNET_BLOCK_EvaluationOptions eo,
* request evaluation, simply pass "NULL" for the reply_block.
*
* @param cls closure
+ * @param ctx block context
* @param type block type
* @param bg group to evaluate against
* @param eo control flags
*/
static enum GNUNET_BLOCK_EvaluationResult
block_plugin_dns_evaluate (void *cls,
+ struct GNUNET_BLOCK_Context *ctx,
enum GNUNET_BLOCK_Type type,
struct GNUNET_BLOCK_Group *bg,
enum GNUNET_BLOCK_EvaluationOptions eo,
* be done with the #GNUNET_BLOCK_get_key() function.
*
* @param cls closure
+ * @param ctx block context
* @param type block type
* @param bg group to use for evaluation
* @param eo control flags
*/
static enum GNUNET_BLOCK_EvaluationResult
block_plugin_fs_evaluate (void *cls,
+ struct GNUNET_BLOCK_Context *ctx,
enum GNUNET_BLOCK_Type type,
struct GNUNET_BLOCK_Group *bg,
enum GNUNET_BLOCK_EvaluationOptions eo,
* be done with the "get_key" function.
*
* @param cls closure
+ * @param ctx block context
* @param type block type
* @param bg block group to use for evaluation
* @param eo control flags
*/
static enum GNUNET_BLOCK_EvaluationResult
block_plugin_gns_evaluate (void *cls,
+ struct GNUNET_BLOCK_Context *ctx,
enum GNUNET_BLOCK_Type type,
struct GNUNET_BLOCK_Group *bg,
enum GNUNET_BLOCK_EvaluationOptions eo,
* be done with the "get_key" function.
*
* @param cls closure
+ * @param ctx block context
* @param type block type
* @param group which block group to use for evaluation
* @param eo evaluation options to control evaluation
*/
typedef enum GNUNET_BLOCK_EvaluationResult
(*GNUNET_BLOCK_EvaluationFunction) (void *cls,
+ struct GNUNET_BLOCK_Context *ctx,
enum GNUNET_BLOCK_Type type,
struct GNUNET_BLOCK_Group *group,
enum GNUNET_BLOCK_EvaluationOptions eo,
* be done with the #GNUNET_BLOCK_get_key() function.
*
* @param cls closure
+ * @param ctx block context
* @param type block type
* @param bg group to evaluate against
* @param eo control flags
*/
static enum GNUNET_BLOCK_EvaluationResult
block_plugin_regex_evaluate (void *cls,
+ struct GNUNET_BLOCK_Context *ctx,
enum GNUNET_BLOCK_Type type,
struct GNUNET_BLOCK_Group *bg,
enum GNUNET_BLOCK_EvaluationOptions eo,
libexecdir= $(pkglibdir)/libexec/
+plugindir = $(libdir)/gnunet
+
pkgcfg_DATA = \
set.conf
$(top_builddir)/src/testing/libgnunettesting.la \
libgnunetset.la
+plugin_LTLIBRARIES = \
+ libgnunet_plugin_block_set_test.la
+
+libgnunet_plugin_block_set_test_la_SOURCES = \
+ plugin_block_set_test.c
+libgnunet_plugin_block_set_test_la_LIBADD = \
+ $(top_builddir)/src/block/libgnunetblock.la \
+ $(top_builddir)/src/block/libgnunetblockgroup.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(LTLIBINTL)
+libgnunet_plugin_block_set_test_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+
EXTRA_DIST = \
test_set.conf