![]() |
GNUnet
0.11.x
|
#include "platform.h"
#include "gnunet_signatures.h"
#include "gnunet_block_plugin.h"
#include "gnunet_block_group_lib.h"
#include "revocation.h"
#include "gnunet_revocation_service.h"
Go to the source code of this file.
Data Structures | |
struct | InternalContext |
Context used inside the plugin. More... | |
Macros | |
#define | DEBUG_REVOCATION GNUNET_EXTRA_LOGGING |
#define | BLOOMFILTER_K 16 |
Number of bits we set per entry in the bloomfilter. More... | |
#define | REVOCATION_BF_SIZE 8 |
How big is the BF we use for DHT blocks? More... | |
Functions | |
static struct GNUNET_BLOCK_Group * | block_plugin_revocation_create_group (void *cls, enum GNUNET_BLOCK_Type type, uint32_t nonce, const void *raw_data, size_t raw_data_size, va_list va) |
Create a new block group. More... | |
static enum GNUNET_BLOCK_EvaluationResult | block_plugin_revocation_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_revocation_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_revocation_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_block_revocation_done (void *cls) |
Exit point from the plugin. More... | |
#define DEBUG_REVOCATION GNUNET_EXTRA_LOGGING |
Definition at line 34 of file plugin_block_revocation.c.
#define BLOOMFILTER_K 16 |
Number of bits we set per entry in the bloomfilter.
Do not change!
Definition at line 40 of file plugin_block_revocation.c.
Referenced by block_plugin_revocation_create_group().
#define REVOCATION_BF_SIZE 8 |
How big is the BF we use for DHT blocks?
Definition at line 46 of file plugin_block_revocation.c.
Referenced by block_plugin_revocation_create_group().
|
static |
Create a new block group.
ctx | block context in which the block group is created |
type | type of the block for which we are creating the group |
nonce | random value used to seed the group creation |
raw_data | optional serialized prior state of the group, NULL if unavailable/fresh |
raw_data_size | number of bytes in raw_data, 0 if unavailable/fresh |
va | variable arguments specific to type |
Definition at line 72 of file plugin_block_revocation.c.
References BLOOMFILTER_K, GNUNET_BLOCK_GROUP_bf_create(), GNUNET_BLOCK_GROUP_compute_bloomfilter_size(), GNUNET_break, and REVOCATION_BF_SIZE.
Referenced by libgnunet_plugin_block_revocation_init().
|
static |
Function called to validate a reply or a request.
For request evaluation, simply pass "NULL" for the reply_block.
cls | our struct InternalContext |
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 124 of file plugin_block_revocation.c.
References InternalContext::epoch_duration, GNUNET_BLOCK_EVALUATION_OK_DUPLICATE, GNUNET_BLOCK_EVALUATION_REQUEST_VALID, GNUNET_BLOCK_EVALUATION_RESULT_INVALID, GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED, GNUNET_BLOCK_GROUP_bf_test_and_set(), GNUNET_break_op, GNUNET_CRYPTO_hash(), GNUNET_IDENTITY_key_get_length(), GNUNET_REVOCATION_check_pow(), GNUNET_YES, InternalContext::matching_bits, pk, and GNUNET_REVOCATION_PowP::pow.
Referenced by libgnunet_plugin_block_revocation_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 179 of file plugin_block_revocation.c.
References GNUNET_break_op, GNUNET_CRYPTO_hash(), GNUNET_IDENTITY_key_get_length(), GNUNET_OK, GNUNET_SYSERR, pk, and GNUNET_REVOCATION_PowP::pow.
Referenced by libgnunet_plugin_block_revocation_init().
void* libgnunet_plugin_block_revocation_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | the configuration to use |
Definition at line 208 of file plugin_block_revocation.c.
References block_plugin_revocation_create_group(), block_plugin_revocation_evaluate(), block_plugin_revocation_get_key(), cfg, GNUNET_BLOCK_PluginFunctions::cls, GNUNET_BLOCK_PluginFunctions::create_group, InternalContext::epoch_duration, GNUNET_BLOCK_PluginFunctions::evaluate, GNUNET_BLOCK_PluginFunctions::get_key, GNUNET_BLOCK_TYPE_ANY, GNUNET_BLOCK_TYPE_REVOCATION, GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_get_value_time(), GNUNET_new, GNUNET_OK, InternalContext::matching_bits, and GNUNET_BLOCK_PluginFunctions::types.
void* libgnunet_plugin_block_revocation_done | ( | void * | cls | ) |
Exit point from the plugin.
Definition at line 250 of file plugin_block_revocation.c.
References GNUNET_BLOCK_PluginFunctions::cls, and GNUNET_free.