GNUnet 0.21.1
GNUNET_NAMESTORE_PluginFunctions Struct Reference

struct returned by the initialization function of the plugin More...

#include <gnunet_namestore_plugin.h>

Data Fields

void * cls
 Closure to pass to all plugin functions. More...
 
enum GNUNET_GenericReturnValue(* store_records )(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
 Store a record in the datastore for which we are the authority. More...
 
enum GNUNET_GenericReturnValue(* lookup_records )(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 Lookup records in the datastore for which we are the authority. More...
 
enum GNUNET_GenericReturnValue(* iterate_records )(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, uint64_t serial, uint64_t limit, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 Iterate over the results for a particular zone in the datastore. More...
 
enum GNUNET_GenericReturnValue(* zone_to_name )(void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const struct GNUNET_CRYPTO_PublicKey *value_zone, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 Look for an existing PKEY delegation record for a given public key. More...
 
enum GNUNET_GenericReturnValue(* edit_records )(void *cls, const char *editor_hint, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
 Transaction-based API draft. More...
 
enum GNUNET_GenericReturnValue(* clear_editor_hint )(void *cls, const char *editor_hint, const char *editor_hint_replacement, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label)
 This clears the editor hint, unless it does not match the given editor hint, in which case this is a NOP. More...
 
enum GNUNET_GenericReturnValue(* create_tables )(void *cls)
 Setup the database. More...
 
enum GNUNET_GenericReturnValue(* drop_tables )(void *cls)
 Drop existing tables. More...
 

Detailed Description

struct returned by the initialization function of the plugin

Definition at line 76 of file gnunet_namestore_plugin.h.

Field Documentation

◆ cls

◆ store_records

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::store_records) (void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)

Store a record in the datastore for which we are the authority.

Removes any existing record in the same zone with the same name.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone
labelname of the record in the zone
rd_countnumber of entries in rd array, 0 to delete all records
rdarray of records with data to store
Returns
GNUNET_OK on success, else GNUNET_SYSERR

Definition at line 81 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_flat_init(), libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ lookup_records

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::lookup_records) (void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)

Lookup records in the datastore for which we are the authority.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone
labelname of the record in the zone
iterfunction to call with the result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_NO for no results, else GNUNET_SYSERR

Definition at line 81 of file gnunet_namestore_plugin.h.

Referenced by get_nick_record(), libgnunet_plugin_namestore_flat_init(), libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ iterate_records

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::iterate_records) (void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, uint64_t serial, uint64_t limit, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)

Iterate over the results for a particular zone in the datastore.

Will return at most limit results to the iterator.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone, NULL for all zones
serialserial (to exclude) in the list of matching records; 0 means to exclude nothing; results must be returned using the minimum possible sequence number first (ordered by serial)
limitmaximum number of results to return to iter
iterfunction to call with the result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_NO if there were no more results, GNUNET_SYSERR on error

Definition at line 81 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_flat_init(), libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ zone_to_name

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::zone_to_name) (void *cls, const struct GNUNET_CRYPTO_PrivateKey *zone, const struct GNUNET_CRYPTO_PublicKey *value_zone, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)

Look for an existing PKEY delegation record for a given public key.

Returns at most one result to the iterator.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone to look up in, never NULL
value_zonepublic key of the target zone (value), never NULL
iterfunction to call with the result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_NO if there were no results, GNUNET_SYSERR on error

Definition at line 81 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_flat_init(), libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ edit_records

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::edit_records) (void *cls, const char *editor_hint, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)

Transaction-based API draft.

Edit records in the namestore. This modifies the editor hint, an advisory lock entry. The record iterator will be called with the old editor hint (if any).

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone
editor_hintthe new value for the advisory lock field
labelname of the record in the zone
iterfunction to call with the result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_NO for no results, else GNUNET_SYSERR

Definition at line 81 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ clear_editor_hint

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::clear_editor_hint) (void *cls, const char *editor_hint, const char *editor_hint_replacement, const struct GNUNET_CRYPTO_PrivateKey *zone, const char *label)

This clears the editor hint, unless it does not match the given editor hint, in which case this is a NOP.

If a replacement hint is given, it hint is not cleared, but set to the replacement.

Parameters
clsclosure (internal context for the plugin)
zoneprivate key of the zone
editor_hintthe new value for the advisory lock field
editor_hint_replacementan optional value to use instead of a clear
labelname of the record in the zone
iterfunction to call with the result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_NO for no results, else GNUNET_SYSERR

Definition at line 81 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ create_tables

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::create_tables) (void *cls)

Setup the database.

Parameters
clsclosure (internal context for the plugin)
Returns
GNUNET_OK on success, else fails with GNUNET_SYSERR

Definition at line 81 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().

◆ drop_tables

enum GNUNET_GenericReturnValue(* GNUNET_NAMESTORE_PluginFunctions::drop_tables) (void *cls)

Drop existing tables.

DANGEROUS: All existing data in the dabase will be lost!

Parameters
clsclosure (internal context for the plugin)
Returns
GNUNET_OK on success, else fails with GNUNET_SYSERR

Definition at line 81 of file gnunet_namestore_plugin.h.

Referenced by libgnunet_plugin_namestore_postgres_init(), and libgnunet_plugin_namestore_sqlite_init().


The documentation for this struct was generated from the following file: