From ff992f47e6528b00937c3951b812f6938e1ee21a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 12 Mar 2022 04:01:02 +0100 Subject: revise block API to match latest DHT specs --- src/set/plugin_block_set_test.c | 44 ++--------------------------------------- 1 file changed, 2 insertions(+), 42 deletions(-) (limited to 'src/set') diff --git a/src/set/plugin_block_set_test.c b/src/set/plugin_block_set_test.c index 3d66831bb..cb5cef5ad 100644 --- a/src/set/plugin_block_set_test.c +++ b/src/set/plugin_block_set_test.c @@ -29,47 +29,10 @@ #include "gnunet_block_group_lib.h" -/** - * Function called to validate a reply or a request. For - * request evaluation, simply pass "NULL" for the reply_block. - * - * @param cls closure - * @param ctx block context - * @param type block type - * @param group block group to use - * @param eo control flags - * @param query original query (hash) - * @param xquery extrended query data (can be NULL, depending on type) - * @param xquery_size number of bytes in xquery - * @param reply_block response to validate - * @param reply_block_size number of bytes in reply block - * @return characterization of result - */ -static enum GNUNET_BLOCK_EvaluationResult -block_plugin_set_test_evaluate (void *cls, - 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) -{ - if ((NULL == reply_block) || - (reply_block_size == 0) || - (0 != ((char *) reply_block)[0])) - return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; - return GNUNET_BLOCK_EVALUATION_OK_MORE; -} - - /** * Function called to validate a query. * * @param cls closure - * @param ctx block context * @param type block type * @param query original query (hash) * @param xquery extrended query data (can be NULL, depending on type) @@ -92,7 +55,6 @@ block_plugin_set_test_check_query (void *cls, * * @param cls closure * @param type block type - * @param query key for the block (hash), must match exactly * @param block block data to validate * @param block_size number of bytes in @a block * @return #GNUNET_OK if the block is fine, #GNUNET_NO if not @@ -100,7 +62,6 @@ block_plugin_set_test_check_query (void *cls, static enum GNUNET_GenericReturnValue block_plugin_set_test_check_block (void *cls, enum GNUNET_BLOCK_Type type, - const struct GNUNET_HashCode *query, const void *block, size_t block_size) { @@ -141,7 +102,7 @@ block_plugin_set_test_check_reply (void *cls, if ((NULL == reply_block) || (0 == reply_block_size) || (0 != ((char *) reply_block)[0])) - return GNUNET_BLOCK_REPLY_INVALID; + GNUNET_assert (0); return GNUNET_BLOCK_REPLY_OK_MORE; } @@ -164,7 +125,7 @@ block_plugin_set_test_get_key (void *cls, size_t block_size, struct GNUNET_HashCode *key) { - return GNUNET_SYSERR; + return GNUNET_NO; } @@ -181,7 +142,6 @@ libgnunet_plugin_block_set_test_init (void *cls) struct GNUNET_BLOCK_PluginFunctions *api; api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions); - api->evaluate = &block_plugin_set_test_evaluate; api->get_key = &block_plugin_set_test_get_key; api->check_query = &block_plugin_set_test_check_query; api->check_block = &block_plugin_set_test_check_block; -- cgit v1.2.3