![]() |
GNUnet
0.11.x
|
consensus block, either nested block or marker More...
#include "platform.h"
#include "consensus_protocol.h"
#include "gnunet_block_plugin.h"
#include "gnunet_block_group_lib.h"
Go to the source code of this file.
Functions | |
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, 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 or a request. More... | |
static int | block_plugin_consensus_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_consensus_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_block_consensus_done (void *cls) |
Exit point from the plugin. More... | |
consensus block, either nested block or marker
Definition in file plugin_block_consensus.c.
|
static |
Function called to validate a reply or a request.
For request evaluation, simply pass "NULL" for the reply_block.
cls | closure |
ctx | context |
type | block type |
group | block group to use |
eo | control flags |
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 50 of file plugin_block_consensus.c.
References GNUNET_BLOCK_evaluate(), GNUNET_BLOCK_EVALUATION_OK_MORE, GNUNET_BLOCK_EVALUATION_RESULT_INVALID, ConsensusElement::marker, and ConsensusElement::payload_type.
Referenced by libgnunet_plugin_block_consensus_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 94 of file plugin_block_consensus.c.
References GNUNET_SYSERR.
Referenced by libgnunet_plugin_block_consensus_init().
void* libgnunet_plugin_block_consensus_init | ( | void * | cls | ) |
Entry point for the plugin.
Definition at line 108 of file plugin_block_consensus.c.
References block_plugin_consensus_evaluate(), block_plugin_consensus_get_key(), GNUNET_BLOCK_PluginFunctions::evaluate, GNUNET_BLOCK_PluginFunctions::get_key, GNUNET_BLOCK_TYPE_ANY, GNUNET_BLOCK_TYPE_CONSENSUS_ELEMENT, GNUNET_new, and GNUNET_BLOCK_PluginFunctions::types.
void* libgnunet_plugin_block_consensus_done | ( | void * | cls | ) |
Exit point from the plugin.
Definition at line 128 of file plugin_block_consensus.c.
References GNUNET_BLOCK_PluginFunctions::cls, and GNUNET_free.