63 &(
record->door.public_key));
86 &(
record->flags),
sizeof(uint32_t));
178 if ((NULL == (dash = strchr (s,
'-'))) ||
179 (1 != sscanf (s,
"%103s-",
key)) ||
181 dash + 1, strlen (dash + 1), &(door.
public_key))))
185 _ (
"Unable to parse MESSENGER_ROOM_ENTRY record `%s'\n"),
201 _ (
"Unable to parse MESSENGER_ROOM_ENTRY record `%s'\n"),
219 if ((NULL == (dash = strchr (s,
'-'))) ||
220 (1 != sscanf (s,
"%7s-", flags)) ||
221 (strlen (dash + 1) > 256))
225 _ (
"Unable to parse MESSENGER_ROOM_DETAILS record `%s'\n"),
237 &(
record->flags),
sizeof(uint32_t)))
241 _ (
"Unable to parse MESSENGER_ROOM_DETAILS record `%s'\n"),
260 char shared_key[104];
266 if ((NULL == (dash = strchr (s0,
'-'))) ||
267 (1 != sscanf (s0,
"%7s-",
flags)) ||
268 (strlen (dash + 1) > 104))
272 _ (
"Unable to parse MESSENGER_ROOM_EPOCH_KEY record `%s'\n"),
279 if ((NULL == (dash = strchr (s0,
'-'))) ||
280 (1 != sscanf (s0,
"%103s-", shared_key)) ||
281 (strlen (dash + 1) > 53))
285 _ (
"Unable to parse MESSENGER_ROOM_EPOCH_KEY record `%s'\n"),
292 if ((NULL == (dash = strchr (s0,
'-'))) ||
293 (1 != sscanf (s0,
"%52s-", identifier)) ||
294 (strlen (dash + 1) > 104))
298 _ (
"Unable to parse MESSENGER_ROOM_EPOCH_KEY record `%s'\n"),
305 if ((NULL == (dash = strchr (s0,
'-'))) ||
306 (1 != sscanf (s0,
"%103s-", hash)) ||
307 (strlen (dash + 1) > 103))
311 _ (
"Unable to parse MESSENGER_ROOM_EPOCH_KEY record `%s'\n"),
326 &(
record->flags),
sizeof(uint32_t))) ||
348 _ (
"Unable to parse MESSENGER_ROOM_EPOCH_KEY record `%s'\n"),
392 const char *gns_typename)
#define GNUNET_GNSRECORD_TYPE_MESSENGER_ROOM_EPOCH_KEY
Record type to store epoch keys from a messenger room.
#define GNUNET_GNSRECORD_TYPE_MESSENGER_ROOM_ENTRY
Record type to share an entry of a messenger room.
#define GNUNET_GNSRECORD_TYPE_MESSENGER_ROOM_DETAILS
Record type to store details about a messenger room.
static int ret
Final status code.
static void record(void *cls, size_t data_size, const void *data)
Process recorded audio data.
static char * data
The data to insert into the dht.
struct GNUNET_HashCode key
The key used in the DHT.
static uint32_t type
Type string converted to DNS type value.
static size_t data_size
Number of bytes in data.
Plugin API for GNS record types.
#define GNUNET_log(kind,...)
char * GNUNET_CRYPTO_eddsa_public_key_to_string(const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Convert a public key to a string.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_public_key_from_string(const char *enc, size_t enclen, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Convert a string representing a public key to a public key.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_ERROR
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_strndup(a, length)
Wrapper around GNUNET_xstrndup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
enum GNUNET_GenericReturnValue GNUNET_STRINGS_string_to_data(const char *enc, size_t enclen, void *out, size_t out_size)
Convert CrockfordBase32 encoding back to data.
void * libgnunet_plugin_gnsrecord_messenger_init(void *cls)
Entry point for the plugin.
void * libgnunet_plugin_gnsrecord_messenger_done(void *cls)
Exit point from the plugin.
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.
static struct @39 name_map[]
Mapping of record type numbers to human-readable record type names.
static const char * messenger_number_to_typename(void *cls, uint32_t type)
Convert a type number to the corresponding type string (e.g.
static uint32_t messenger_typename_to_number(void *cls, const char *gns_typename)
Convert a type name (e.g.
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.
Each plugin is required to return a pointer to a struct of this type as the return value from its ent...
GNUNET_GNSRECORD_TypenameToNumberFunction typename_to_number
Typename to number.
GNUNET_GNSRECORD_NumberToTypenameFunction number_to_typename
Number to typename.
GNUNET_GNSRECORD_ValueToStringFunction value_to_string
Conversion to string.
void * cls
Closure for all of the callbacks.
GNUNET_GNSRECORD_StringToValueFunction string_to_value
Conversion to binary.
A room details record specifies a custom name for a given room and some additional space for flags.
uint32_t flags
The flags of the room.
A room entry record specifies which peer is hosting a given room and may also specify the key to ente...
struct GNUNET_PeerIdentity door
The peer identity of an open door to a room.
A room epoch key record specifies an epoch key for a given room that can be identified via a given ke...
uint32_t flags
The flags of the epoch or group key.
struct GNUNET_ShortHashCode identifier
The short hash identifying the epoch or group key.
struct GNUNET_CRYPTO_SymmetricSessionKey shared_key
The shared epoch or group key in the room.
struct GNUNET_HashCode hash
The hash identifying the epoch.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key