![]() |
GNUnet
0.11.x
|
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 (i.e. More... | |
static const char * | abd_number_to_typename (void *cls, uint32_t type) |
Convert a type number (i.e. 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 data, GNUNET_ABD_delegate_deserialize(), GNUNET_ABD_delegate_to_string(), GNUNET_ABD_delegation_set_deserialize(), GNUNET_asprintf(), GNUNET_CRYPTO_ecdsa_public_key_to_string(), GNUNET_free, GNUNET_GNSRECORD_TYPE_ATTRIBUTE, GNUNET_GNSRECORD_TYPE_DELEGATE, GNUNET_memcpy, GNUNET_ntohll(), GNUNET_OK, GNUNET_ABD_DelegationSet::subject_attribute, GNUNET_ABD_DelegationSet::subject_attribute_len, GNUNET_ABD_DelegationSet::subject_key, and subject_pkey.
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 _, entries, GNUNET_ABD_delegate_from_string(), GNUNET_ABD_delegate_serialize(), GNUNET_ABD_delegation_set_get_size(), GNUNET_ABD_delegation_set_serialize(), GNUNET_CRYPTO_ecdsa_public_key_from_string(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_TYPE_ATTRIBUTE, GNUNET_GNSRECORD_TYPE_DELEGATE, GNUNET_htonll(), GNUNET_log, GNUNET_malloc, GNUNET_OK, GNUNET_strdup, GNUNET_SYSERR, GNUNET_ABD_DelegationSet::subject_attribute, GNUNET_ABD_DelegationSet::subject_attribute_len, GNUNET_ABD_DelegationSet::subject_key, and subject_pkey.
Referenced by libgnunet_plugin_gnsrecord_abd_init().
|
static |
Convert a type name (i.e.
"AAAA") to the corresponding number.
cls | closure, unused |
gns_typename | name to convert |
Definition at line 283 of file plugin_gnsrecord_abd.c.
References name, and name_map.
Referenced by libgnunet_plugin_gnsrecord_abd_init().
|
static |
Convert a type number (i.e.
1) to the corresponding type string (i.e. "A")
cls | closure, unused |
type | number of a type to convert |
Definition at line 303 of file plugin_gnsrecord_abd.c.
References name, name_map, and number.
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 321 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 341 of file plugin_gnsrecord_abd.c.
References GNUNET_GNSRECORD_PluginFunctions::cls, and GNUNET_free.
const char* name |
Definition at line 268 of file plugin_gnsrecord_abd.c.
Referenced by abd_number_to_typename(), abd_typename_to_number(), check_barrier_status(), check_delete_message(), check_get(), check_get_default_message(), check_lookup_result(), check_monitor_notify(), check_record_result(), check_set(), check_ssl_certificate(), check_watch(), format_help(), GNS_get_tld(), gns_resolve_name(), GNUNET_DATACACHE_create(), GNUNET_DISK_directory_scan(), GNUNET_DNSPARSER_parse_query(), GNUNET_DNSPARSER_parse_record(), GNUNET_FS_GETOPT_KEYWORDS(), GNUNET_FS_GETOPT_METADATA(), GNUNET_GETOPT_option_absolute_time(), GNUNET_GETOPT_option_base32_fixed_size(), GNUNET_GETOPT_option_filename(), GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_increment_uint(), GNUNET_GETOPT_option_relative_time(), GNUNET_GETOPT_option_string(), GNUNET_GETOPT_option_uint(), GNUNET_GETOPT_option_uint16(), GNUNET_GETOPT_option_ulong(), GNUNET_JSON_getopt(), GNUNET_JSON_spec_absolute_time(), GNUNET_JSON_spec_absolute_time_nbo(), GNUNET_JSON_spec_boolean(), GNUNET_JSON_spec_fixed(), GNUNET_JSON_spec_json(), GNUNET_JSON_spec_relative_time(), GNUNET_JSON_spec_rsa_public_key(), GNUNET_JSON_spec_rsa_signature(), GNUNET_JSON_spec_string(), GNUNET_JSON_spec_uint16(), GNUNET_JSON_spec_uint32(), GNUNET_JSON_spec_uint64(), GNUNET_JSON_spec_uint8(), GNUNET_JSON_spec_varsize(), GNUNET_NETWORK_socket_accept(), GNUNET_PQ_connect(), GNUNET_PQ_make_prepare(), GNUNET_PQ_result_spec_absolute_time(), GNUNET_PQ_result_spec_uint16(), GNUNET_PQ_result_spec_uint32(), GNUNET_PQ_result_spec_uint64(), GNUNET_PQ_result_spec_variable_size(), GNUNET_PROGRAM_run2(), handle_arm_list_result(), handle_barrier_cancel(), handle_barrier_init(), handle_barrier_status(), handle_barrier_wait(), handle_delete_message(), handle_get(), handle_get_default_message(), handle_lookup(), handle_lookup_by_suffix_message(), handle_lookup_message(), handle_lookup_result(), handle_record_result(), handle_set(), handle_watch(), handle_zone_to_name_it(), list_callback(), plugin_session_info_cb(), print_entry(), process_lookup_result(), REGEX_TEST_automaton_save_graph_step(), run(), send_ibf(), stun_attr2str(), stun_msg2str(), and translate_dot_plus().
uint32_t number |
Definition at line 269 of file plugin_gnsrecord_abd.c.
Referenced by abd_number_to_typename(), event_cb(), and GNUNET_TESTBED_run().
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().