#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnu_name_system_record_types.h"
#include "gnunet_messenger_service.h"
#include "gnunet_gnsrecord_plugin.h"
Go to the source code of this file.
Functions | |
static char * | messenger_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 | messenger_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 | messenger_typename_to_number (void *cls, const char *gns_typename) |
Convert a type name (e.g. More... | |
static const char * | messenger_number_to_typename (void *cls, uint32_t type) |
Convert a type number to the corresponding type string (e.g. More... | |
void * | libgnunet_plugin_gnsrecord_messenger_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_gnsrecord_messenger_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... | |
|
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 44 of file plugin_gnsrecord_messenger.c.
References data, data_size, GNUNET_MESSENGER_RoomEntryRecord::door, GNUNET_MESSENGER_RoomDetailsRecord::flags, GNUNET_asprintf(), GNUNET_break_op, GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_free, GNUNET_GNSRECORD_TYPE_MESSENGER_ROOM_DETAILS, GNUNET_GNSRECORD_TYPE_MESSENGER_ROOM_ENTRY, GNUNET_STRINGS_data_to_string_alloc(), GNUNET_strndup, key, name, record(), ret, and type.
Referenced by libgnunet_plugin_gnsrecord_messenger_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 115 of file plugin_gnsrecord_messenger.c.
References _, data, data_size, GNUNET_MESSENGER_RoomEntryRecord::door, GNUNET_MESSENGER_RoomDetailsRecord::flags, GNUNET_break, GNUNET_CRYPTO_eddsa_public_key_from_string(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_GNSRECORD_TYPE_MESSENGER_ROOM_DETAILS, GNUNET_GNSRECORD_TYPE_MESSENGER_ROOM_ENTRY, GNUNET_log, GNUNET_memcpy, GNUNET_new, GNUNET_OK, GNUNET_STRINGS_string_to_data(), GNUNET_SYSERR, key, GNUNET_PeerIdentity::public_key, record(), and type.
Referenced by libgnunet_plugin_gnsrecord_messenger_init().
|
static |
Convert a type name (e.g.
"AAAA") to the corresponding number.
cls | closure, unused |
gns_typename | name to convert |
Definition at line 242 of file plugin_gnsrecord_messenger.c.
References name, and name_map.
Referenced by libgnunet_plugin_gnsrecord_messenger_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 264 of file plugin_gnsrecord_messenger.c.
References name, name_map, and type.
Referenced by libgnunet_plugin_gnsrecord_messenger_init().
void * libgnunet_plugin_gnsrecord_messenger_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | NULL |
Definition at line 288 of file plugin_gnsrecord_messenger.c.
References GNUNET_GNSRECORD_PluginFunctions::cls, GNUNET_new, messenger_number_to_typename(), messenger_string_to_value(), messenger_typename_to_number(), messenger_value_to_string(), 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_messenger_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the return value from libgnunet_plugin_block_test_init |
Definition at line 312 of file plugin_gnsrecord_messenger.c.
References GNUNET_GNSRECORD_PluginFunctions::cls, and GNUNET_free.
const char* name |
Definition at line 225 of file plugin_gnsrecord_messenger.c.
Referenced by messenger_number_to_typename(), messenger_typename_to_number(), and messenger_value_to_string().
uint32_t number |
Definition at line 226 of file plugin_gnsrecord_messenger.c.
struct { ... } name_map[] |
Mapping of record type numbers to human-readable record type names.
Referenced by messenger_number_to_typename(), and messenger_typename_to_number().