set test block, recognizes elements with non-zero first byte as invalid More...
Go to the source code of this file.
Functions | |
static enum GNUNET_GenericReturnValue | block_plugin_setu_test_check_query (void *cls, enum GNUNET_BLOCK_Type type, const struct GNUNET_HashCode *query, const void *xquery, size_t xquery_size) |
Function called to validate a query. More... | |
static enum GNUNET_GenericReturnValue | block_plugin_setu_test_check_block (void *cls, enum GNUNET_BLOCK_Type type, const void *block, size_t block_size) |
Function called to validate a block for storage. More... | |
static enum GNUNET_BLOCK_ReplyEvaluationResult | block_plugin_setu_test_check_reply (void *cls, enum GNUNET_BLOCK_Type type, struct GNUNET_BLOCK_Group *group, const struct GNUNET_HashCode *query, const void *xquery, size_t xquery_size, const void *reply_block, size_t reply_block_size) |
Function called to validate a reply to a request. More... | |
static enum GNUNET_GenericReturnValue | block_plugin_setu_test_get_key (void *cls, enum GNUNET_BLOCK_Type type, const void *block, size_t block_size, struct GNUNET_HashCode *key) |
Function called to obtain the key for a block. More... | |
void * | libgnunet_plugin_block_setu_test_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_block_setu_test_done (void *cls) |
Exit point from the plugin. More... | |
set test block, recognizes elements with non-zero first byte as invalid
Definition in file plugin_block_setu_test.c.
|
static |
Function called to validate a query.
cls | closure |
ctx | block context |
type | block type |
query | original query (hash) |
xquery | extrended query data (can be NULL, depending on type) |
xquery_size | number of bytes in xquery |
Definition at line 43 of file plugin_block_setu_test.c.
References GNUNET_BLOCK_TYPE_SETU_TEST, GNUNET_break, GNUNET_break_op, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, and type.
Referenced by libgnunet_plugin_block_setu_test_init().
|
static |
Function called to validate a block for storage.
cls | closure |
type | block type |
block | block data to validate |
block_size | number of bytes in block |
Definition at line 73 of file plugin_block_setu_test.c.
References GNUNET_BLOCK_TYPE_SETU_TEST, GNUNET_break, GNUNET_NO, GNUNET_OK, GNUNET_SYSERR, and type.
Referenced by libgnunet_plugin_block_setu_test_init().
|
static |
Function called to validate a reply to a request.
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 GetKeyFunction and the BlockEvaluationFunction.
cls | closure |
type | block type |
group | which block group to use for evaluation |
query | original query (hash) |
xquery | extrended query data (can be NULL, depending on type) |
xquery_size | number of bytes in xquery |
reply_block | response to validate |
reply_block_size | number of bytes in reply_block |
Definition at line 108 of file plugin_block_setu_test.c.
References GNUNET_assert, GNUNET_BLOCK_REPLY_OK_MORE, GNUNET_BLOCK_REPLY_TYPE_NOT_SUPPORTED, GNUNET_BLOCK_TYPE_SETU_TEST, GNUNET_break, and type.
Referenced by libgnunet_plugin_block_setu_test_init().
|
static |
Function called to obtain the key for a block.
cls | closure |
type | block type |
block | block to get the key for |
block_size | number of bytes in block |
key | set to the key (query) for the given block |
Definition at line 145 of file plugin_block_setu_test.c.
References GNUNET_BLOCK_TYPE_SETU_TEST, GNUNET_break, GNUNET_NO, GNUNET_SYSERR, and type.
Referenced by libgnunet_plugin_block_setu_test_init().
void * libgnunet_plugin_block_setu_test_init | ( | void * | cls | ) |
Entry point for the plugin.
Definition at line 166 of file plugin_block_setu_test.c.
References block_plugin_setu_test_check_block(), block_plugin_setu_test_check_query(), block_plugin_setu_test_check_reply(), block_plugin_setu_test_get_key(), GNUNET_BLOCK_PluginFunctions::check_block, GNUNET_BLOCK_PluginFunctions::check_query, GNUNET_BLOCK_PluginFunctions::check_reply, GNUNET_BLOCK_PluginFunctions::get_key, GNUNET_BLOCK_TYPE_ANY, GNUNET_BLOCK_TYPE_SETU_TEST, GNUNET_new, and GNUNET_BLOCK_PluginFunctions::types.
void * libgnunet_plugin_block_setu_test_done | ( | void * | cls | ) |
Exit point from the plugin.
Definition at line 190 of file plugin_block_setu_test.c.
References GNUNET_BLOCK_PluginFunctions::cls, and GNUNET_free.