gnsrecord plugin to provide the API for fundamental GNS records This includes the VPN record because GNS resolution is expected to understand VPN records and (if needed) map the result to A/AAAA. More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_conversation_service.h"
#include "gnunet_gnsrecord_plugin.h"
Go to the source code of this file.
Functions | |
static char * | conversation_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 | conversation_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 | conversation_typename_to_number (void *cls, const char *gns_typename) |
Convert a type name (e.g. More... | |
static const char * | conversation_number_to_typename (void *cls, uint32_t type) |
Convert a type number to the corresponding type string (e.g. More... | |
void * | libgnunet_plugin_gnsrecord_conversation_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_gnsrecord_conversation_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 fundamental GNS records This includes the VPN record because GNS resolution is expected to understand VPN records and (if needed) map the result to A/AAAA.
Definition in file plugin_gnsrecord_conversation.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 47 of file plugin_gnsrecord_conversation.c.
References _, data, data_size, GNUNET_asprintf(), GNUNET_break_op, GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_TYPE_PHONE, GNUNET_log, GNUNET_STRINGS_data_to_string_alloc(), GNUNET_CONVERSATION_PhoneRecord::line_port, GNUNET_CONVERSATION_PhoneRecord::peer, pkey, GNUNET_PeerIdentity::public_key, ret, type, and GNUNET_CONVERSATION_PhoneRecord::version.
Referenced by libgnunet_plugin_gnsrecord_conversation_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 107 of file plugin_gnsrecord_conversation.c.
References _, data, data_size, GNUNET_break, GNUNET_CRYPTO_eddsa_public_key_from_string(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_TYPE_PHONE, GNUNET_log, GNUNET_new, GNUNET_OK, GNUNET_STRINGS_string_to_data(), GNUNET_SYSERR, GNUNET_CONVERSATION_PhoneRecord::line_port, GNUNET_CONVERSATION_PhoneRecord::peer, GNUNET_PeerIdentity::public_key, GNUNET_CONVERSATION_PhoneRecord::reserved, type, and GNUNET_CONVERSATION_PhoneRecord::version.
Referenced by libgnunet_plugin_gnsrecord_conversation_init().
|
static |
Convert a type name (e.g.
"AAAA") to the corresponding number.
cls | closure, unused |
gns_typename | name to convert |
Definition at line 189 of file plugin_gnsrecord_conversation.c.
References name, and name_map.
Referenced by libgnunet_plugin_gnsrecord_conversation_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 211 of file plugin_gnsrecord_conversation.c.
References name, name_map, and type.
Referenced by libgnunet_plugin_gnsrecord_conversation_init().
void * libgnunet_plugin_gnsrecord_conversation_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | NULL |
Definition at line 234 of file plugin_gnsrecord_conversation.c.
References GNUNET_GNSRECORD_PluginFunctions::cls, conversation_number_to_typename(), conversation_string_to_value(), conversation_typename_to_number(), conversation_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_conversation_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the return value from libgnunet_plugin_block_test_init |
Definition at line 257 of file plugin_gnsrecord_conversation.c.
References GNUNET_GNSRECORD_PluginFunctions::cls, and GNUNET_free.
const char* name |
Definition at line 173 of file plugin_gnsrecord_conversation.c.
Referenced by conversation_number_to_typename(), and conversation_typename_to_number().
uint32_t number |
Definition at line 174 of file plugin_gnsrecord_conversation.c.
struct { ... } name_map[] |
Mapping of record type numbers to human-readable record type names.
Referenced by conversation_number_to_typename(), and conversation_typename_to_number().