library for data block manipulation More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_constants.h"
#include "gnunet_signatures.h"
#include "gnunet_block_lib.h"
#include "gnunet_block_plugin.h"
Go to the source code of this file.
Data Structures | |
struct | Plugin |
Handle for a plugin. More... | |
struct | GNUNET_BLOCK_Context |
Handle to an initialized block library. More... | |
struct | MinglePacker |
Serialization to use in GNUNET_BLOCK_mingle_hash. More... | |
Functions | |
GNUNET_NETWORK_STRUCT_END void | GNUNET_BLOCK_mingle_hash (const struct GNUNET_HashCode *in, uint32_t mingle_number, struct GNUNET_HashCode *hc) |
Mingle hash with the mingle_number to produce different bits. More... | |
static void | add_plugin (void *cls, const char *library_name, void *lib_ret) |
Add a plugin to the list managed by the block library. More... | |
struct GNUNET_BLOCK_Context * | GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Create a block context. More... | |
void | GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx) |
Destroy the block context. More... | |
enum GNUNET_GenericReturnValue | GNUNET_BLOCK_group_serialize (struct GNUNET_BLOCK_Group *bg, void **raw_data, size_t *raw_data_size) |
Serialize state of a block group. More... | |
void | GNUNET_BLOCK_group_destroy (struct GNUNET_BLOCK_Group *bg) |
Destroy resources used by a block group. More... | |
enum GNUNET_GenericReturnValue | GNUNET_BLOCK_group_merge (struct GNUNET_BLOCK_Group *bg1, struct GNUNET_BLOCK_Group *bg2) |
Try merging two block groups. More... | |
static struct GNUNET_BLOCK_PluginFunctions * | find_plugin (struct GNUNET_BLOCK_Context *ctx, enum GNUNET_BLOCK_Type type) |
Find a plugin for the given type. More... | |
struct GNUNET_BLOCK_Group * | GNUNET_BLOCK_group_create (struct GNUNET_BLOCK_Context *ctx, enum GNUNET_BLOCK_Type type, const void *raw_data, size_t raw_data_size,...) |
Create a new block group. More... | |
enum GNUNET_GenericReturnValue | GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, 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... | |
enum GNUNET_GenericReturnValue | GNUNET_BLOCK_check_query (struct GNUNET_BLOCK_Context *ctx, enum GNUNET_BLOCK_Type type, const struct GNUNET_HashCode *query, const void *xquery, size_t xquery_size) |
Function called to validate a request. More... | |
enum GNUNET_GenericReturnValue | GNUNET_BLOCK_check_block (struct GNUNET_BLOCK_Context *ctx, enum GNUNET_BLOCK_Type type, const void *block, size_t block_size) |
Function called to validate a block. More... | |
enum GNUNET_BLOCK_ReplyEvaluationResult | GNUNET_BLOCK_check_reply (struct GNUNET_BLOCK_Context *ctx, 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 if a reply is good for a particular query. More... | |
enum GNUNET_GenericReturnValue | GNUNET_BLOCK_group_set_seen (struct GNUNET_BLOCK_Group *bg, const struct GNUNET_HashCode *seen_results, unsigned int seen_results_count) |
Update block group to filter out the given results. More... | |
library for data block manipulation
Definition in file block.c.
|
static |
Add a plugin to the list managed by the block library.
cls | the block context |
library_name | name of the plugin |
lib_ret | the plugin API |
Definition at line 119 of file block.c.
References Plugin::api, ctx, GNUNET_array_append, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_new, GNUNET_strdup, Plugin::library_name, and plugin.
Referenced by GNUNET_BLOCK_context_create().
|
static |
Find a plugin for the given type.
ctx | context to search |
type | type to look for |
Definition at line 233 of file block.c.
References ctx, plugin, and type.
Referenced by GNUNET_BLOCK_check_block(), GNUNET_BLOCK_check_query(), GNUNET_BLOCK_check_reply(), GNUNET_BLOCK_get_key(), and GNUNET_BLOCK_group_create().