gnsrecord plugin to provide the API for ABD records More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "delegate_misc.h"
#include "abd_serialization.h"
#include "gnunet_abd_service.h"
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_gnsrecord_plugin.h"
#include "gnunet_signatures.h"
Go to the source code of this file.
Functions | |
static char * | abd_value_to_string (void *cls, uint32_t type, const void *data, size_t data_size) |
Convert the 'value' of a record to a string. More... | |
static int | abd_string_to_value (void *cls, uint32_t type, const char *s, void **data, size_t *data_size) |
Convert human-readable version of a 'value' of a record to the binary representation. More... | |
static uint32_t | abd_typename_to_number (void *cls, const char *gns_typename) |
Convert a type name (e.g. More... | |
static const char * | abd_number_to_typename (void *cls, uint32_t type) |
Convert a type number to the corresponding type string (e.g. More... | |
void * | libgnunet_plugin_gnsrecord_abd_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_gnsrecord_abd_done (void *cls) |
Exit point from the plugin. More... | |
Variables | |
struct { | |
const char * name | |
uint32_t number | |
} | name_map [] |
Mapping of record type numbers to human-readable record type names. More... | |
gnsrecord plugin to provide the API for ABD records
Definition in file plugin_gnsrecord_abd.c.
|
static |
Convert the 'value' of a record to a string.
cls | closure, unused |
type | type of the record |
data | value in binary encoding |
data_size | number of bytes in data |
Definition at line 46 of file plugin_gnsrecord_abd.c.
References cred, data, data_size, GNUNET_ABD_DelegationRecord::data_size, GNUNET_ABD_delegate_deserialize(), GNUNET_ABD_delegate_to_string(), GNUNET_ABD_delegation_set_deserialize(), GNUNET_asprintf(), GNUNET_CRYPTO_public_key_to_string(), GNUNET_free, GNUNET_GNSRECORD_TYPE_ATTRIBUTE, GNUNET_GNSRECORD_TYPE_DELEGATE, GNUNET_memcpy, GNUNET_ntohll(), GNUNET_OK, GNUNET_ABD_DelegationRecord::set_count, GNUNET_ABD_DelegationSet::subject_attribute, GNUNET_ABD_DelegationSet::subject_attribute_len, GNUNET_ABD_DelegationSet::subject_key, subject_pkey, and type.
Referenced by libgnunet_plugin_gnsrecord_abd_init().
|
static |
Convert human-readable version of a 'value' of a record to the binary representation.
cls | closure, unused |
type | type of the record |
s | human-readable string |
data | set to value in binary encoding (will be allocated) |
data_size | set to number of bytes in data |
Definition at line 147 of file plugin_gnsrecord_abd.c.
References _, cred, data, data_size, GNUNET_ABD_DelegationRecord::data_size, GNUNET_ABD_delegate_from_string(), GNUNET_ABD_delegate_serialize(), GNUNET_ABD_delegation_set_get_size(), GNUNET_ABD_delegation_set_serialize(), GNUNET_CRYPTO_public_key_from_string(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_free_nz, GNUNET_GNSRECORD_TYPE_ATTRIBUTE, GNUNET_GNSRECORD_TYPE_DELEGATE, GNUNET_htonll(), GNUNET_log, GNUNET_malloc, GNUNET_OK, GNUNET_strdup, GNUNET_SYSERR, warningfilter::matches, GNUNET_ABD_DelegationRecord::set_count, GNUNET_ABD_DelegationSet::subject_attribute, GNUNET_ABD_DelegationSet::subject_attribute_len, GNUNET_ABD_DelegationSet::subject_key, subject_pkey, and type.
Referenced by libgnunet_plugin_gnsrecord_abd_init().
|
static |
Convert a type name (e.g.
"AAAA") to the corresponding number.
cls | closure, unused |
gns_typename | name to convert |
Definition at line 290 of file plugin_gnsrecord_abd.c.
References name, and name_map.
Referenced by libgnunet_plugin_gnsrecord_abd_init().
|
static |
Convert a type number to the corresponding type string (e.g.
1 to "A")
cls | closure, unused |
type | number of a type to convert |
Definition at line 310 of file plugin_gnsrecord_abd.c.
References name, name_map, number, and type.
Referenced by libgnunet_plugin_gnsrecord_abd_init().
void * libgnunet_plugin_gnsrecord_abd_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | NULL |
Definition at line 328 of file plugin_gnsrecord_abd.c.
References abd_number_to_typename(), abd_string_to_value(), abd_typename_to_number(), abd_value_to_string(), GNUNET_new, GNUNET_GNSRECORD_PluginFunctions::number_to_typename, GNUNET_GNSRECORD_PluginFunctions::string_to_value, GNUNET_GNSRECORD_PluginFunctions::typename_to_number, and GNUNET_GNSRECORD_PluginFunctions::value_to_string.
void * libgnunet_plugin_gnsrecord_abd_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the return value from libgnunet_plugin_block_test_init |
Definition at line 348 of file plugin_gnsrecord_abd.c.
References GNUNET_GNSRECORD_PluginFunctions::cls, and GNUNET_free.
const char* name |
Definition at line 275 of file plugin_gnsrecord_abd.c.
Referenced by abd_number_to_typename(), and abd_typename_to_number().
uint32_t number |
Definition at line 276 of file plugin_gnsrecord_abd.c.
Referenced by abd_number_to_typename(), decode_bytes(), encode_bytes(), GNUNET_CONFIGURATION_get_value_float(), GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_set_value_number(), GNUNET_GNS_protocol_number_to_name(), and least_square_root().
struct { ... } name_map[] |
Mapping of record type numbers to human-readable record type names.
Referenced by abd_number_to_typename(), and abd_typename_to_number().