GNUnet  0.10.x
Data Structures | Typedefs
GNS Record plugin API

To be implemented by applications defining new record types. More...

Data Structures

struct  GNUNET_GNSRECORD_PluginFunctions
 Each plugin is required to return a pointer to a struct of this type as the return value from its entry point. More...
 

Typedefs

typedef char *(* GNUNET_GNSRECORD_ValueToStringFunction) (void *cls, uint32_t type, const void *data, size_t data_size)
 Function called to convert the binary value data of a record of type type to a human-readable string. More...
 
typedef int(* GNUNET_GNSRECORD_StringToValueFunction) (void *cls, uint32_t type, const char *s, void **data, size_t *data_size)
 Function called to convert human-readable version of the value s of a record of type type to the respective binary representation. More...
 
typedef uint32_t(* GNUNET_GNSRECORD_TypenameToNumberFunction) (void *cls, const char *dns_typename)
 Function called to convert a type name (i.e. More...
 
typedef const char *(* GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls, uint32_t type)
 Function called to convert a type number (i.e. More...
 

Detailed Description

To be implemented by applications defining new record types.

See also
Documentation

Typedef Documentation

◆ GNUNET_GNSRECORD_ValueToStringFunction

typedef char*(* GNUNET_GNSRECORD_ValueToStringFunction) (void *cls, uint32_t type, const void *data, size_t data_size)

Function called to convert the binary value data of a record of type type to a human-readable string.

Parameters
clsclosure
typetype of the record
datavalue in binary encoding
data_sizenumber of bytes in data
Returns
NULL on error, otherwise human-readable representation of the value

Definition at line 57 of file gnunet_gnsrecord_plugin.h.

◆ GNUNET_GNSRECORD_StringToValueFunction

typedef int(* GNUNET_GNSRECORD_StringToValueFunction) (void *cls, uint32_t type, const char *s, void **data, size_t *data_size)

Function called to convert human-readable version of the value s of a record of type type to the respective binary representation.

Parameters
clsclosure
typetype of the record
shuman-readable string
dataset to value in binary encoding (will be allocated)
data_sizeset to number of bytes in data
Returns
GNUNET_OK on success

Definition at line 76 of file gnunet_gnsrecord_plugin.h.

◆ GNUNET_GNSRECORD_TypenameToNumberFunction

typedef uint32_t(* GNUNET_GNSRECORD_TypenameToNumberFunction) (void *cls, const char *dns_typename)

Function called to convert a type name (i.e.

"AAAA") to the corresponding number.

Parameters
clsclosure
dns_typenamename to convert
Returns
corresponding number, UINT32_MAX on error

Definition at line 92 of file gnunet_gnsrecord_plugin.h.

◆ GNUNET_GNSRECORD_NumberToTypenameFunction

typedef const char*(* GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls, uint32_t type)

Function called to convert a type number (i.e.

1) to the corresponding type string (i.e. "A")

Parameters
clsclosure
typenumber of a type to convert
Returns
corresponding typestring, NULL on error

Definition at line 105 of file gnunet_gnsrecord_plugin.h.