GNUnet 0.22.2
GNUNET_PEERSTORE_PluginFunctions Struct Reference

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

#include <gnunet_peerstore_plugin.h>

Data Fields

void * cls
 Closure to pass to all plugin functions. More...
 
int(* store_record )(void *cls, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, const void *value, size_t size, struct GNUNET_TIME_Absolute expiry, enum GNUNET_PEERSTORE_StoreOption options, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
 Store a record in the peerstore. More...
 
int(* iterate_records )(void *cls, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, uint64_t serial, uint64_t limit, GNUNET_PEERSTORE_PluginProcessor iter, void *iter_cls)
 Iterate over the records given an optional peer id and/or key. More...
 
int(* expire_records )(void *cls, struct GNUNET_TIME_Absolute now, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
 Delete expired records (expiry < now) More...
 

Detailed Description

struct returned by the initialization function of the plugin

Definition at line 66 of file gnunet_peerstore_plugin.h.

Field Documentation

◆ cls

void* GNUNET_PEERSTORE_PluginFunctions::cls

◆ store_record

int(* GNUNET_PEERSTORE_PluginFunctions::store_record) (void *cls, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, const void *value, size_t size, struct GNUNET_TIME_Absolute expiry, enum GNUNET_PEERSTORE_StoreOption options, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)

Store a record in the peerstore.

Key is the combination of sub system and peer identity. One key can store multiple values.

Parameters
clsclosure (internal context for the plugin)
sub_systemname of the GNUnet sub system responsible
peerpeer identity
valuevalue to be stored
sizesize of value to be stored
expiryabsolute time after which the record is (possibly) deleted
optionsoptions related to the store operation
contcontinuation called when record is stored
cont_clscontinuation closure
Returns
GNUNET_OK on success, else GNUNET_SYSERR and cont is not called

Definition at line 89 of file gnunet_peerstore_plugin.h.

Referenced by handle_store(), hosts_directory_scan_callback(), and libgnunet_plugin_peerstore_sqlite_init().

◆ iterate_records

int(* GNUNET_PEERSTORE_PluginFunctions::iterate_records) (void *cls, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, uint64_t serial, uint64_t limit, GNUNET_PEERSTORE_PluginProcessor iter, void *iter_cls)

Iterate over the records given an optional peer id and/or key.

Parameters
clsclosure (internal context for the plugin)
sub_systemname of sub system
peerPeer identity (can be NULL)
keyentry key string (can be NULL)
limitmax number of results to give
iterfunction to call asynchronously with the results, terminated by a NULL result
iter_clsclosure for iter
Returns
GNUNET_OK on success, GNUNET_SYSERR on error and iter is not called

Definition at line 116 of file gnunet_peerstore_plugin.h.

Referenced by libgnunet_plugin_peerstore_sqlite_init(), monitor_iteration_next(), and run_iteration_round().

◆ expire_records

int(* GNUNET_PEERSTORE_PluginFunctions::expire_records) (void *cls, struct GNUNET_TIME_Absolute now, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)

Delete expired records (expiry < now)

Parameters
clsclosure (internal context for the plugin)
nowtime to use as reference
contcontinuation called with the number of records expired
cont_clscontinuation closure
Returns
GNUNET_OK on success, GNUNET_SYSERR on error and cont is not called

Definition at line 136 of file gnunet_peerstore_plugin.h.

Referenced by cleanup_expired_records(), and libgnunet_plugin_peerstore_sqlite_init().


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