GNUnet 0.21.1
GNS Record plugin API

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

Collaboration diagram for GNS Record plugin API:

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 (e.g. More...
 
typedef const char *(* GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls, uint32_t type)
 Function called to convert a type number to the corresponding type string (e.g. More...
 
typedef enum GNUNET_GenericReturnValue(* GNUNET_GNSRECORD_IsCriticalFunction) (void *cls, uint32_t type)
 Function called to check for critical records. 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 59 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 78 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 (e.g.

"AAAA") to the corresponding number.

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

Definition at line 94 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 to the corresponding type string (e.g.

1 to "A")

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

Definition at line 107 of file gnunet_gnsrecord_plugin.h.

◆ GNUNET_GNSRECORD_IsCriticalFunction

typedef enum GNUNET_GenericReturnValue(* GNUNET_GNSRECORD_IsCriticalFunction) (void *cls, uint32_t type)

Function called to check for critical records.

Parameters
clsclosure
typenumber of a type to check
Returns
GNUNET_YES if critical, otherwise GNUNET_NO

Definition at line 107 of file gnunet_gnsrecord_plugin.h.