GNUnet  0.11.x
Data Fields
GNUNET_DHTU_PluginFunctions Struct Reference

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

#include <gnunet_dhtu_plugin.h>

Collaboration diagram for GNUNET_DHTU_PluginFunctions:
[legend]

Data Fields

void * cls
 Closure to pass to all plugin functions. More...
 
ssize_t(* sign )(void *cls, const struct GNUNET_DHTU_PrivateKey *pk, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, void **sig)
 Use our private key to sign a message. More...
 
enum GNUNET_GenericReturnValue(* verify )(void *cls, const struct GNUNET_DHTU_PublicKey *pk, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, const void *sig, size_t sig_size)
 Verify signature in sig over purpose. More...
 
void(* try_connect )(void *cls, const char *address)
 Request creation of a session with a peer at the given address. More...
 
struct GNUNET_DHTU_PreferenceHandle *(* hold )(void *cls, struct GNUNET_DHTU_Target *target)
 Request underlay to keep the connection to target alive if possible. More...
 
void(* drop )(struct GNUNET_DHTU_PreferenceHandle *ph)
 Do no long request underlay to keep the connection alive. More...
 
void(* send )(void *cls, struct GNUNET_DHTU_Target *target, const void *msg, size_t msg_size, GNUNET_SCHEDULER_TaskCallback finished_cb, void *finished_cb_cls)
 Send message to some other participant over the network. More...
 

Detailed Description

struct returned by the initialization function of the plugin

Definition at line 204 of file gnunet_dhtu_plugin.h.

Field Documentation

◆ cls

void* GNUNET_DHTU_PluginFunctions::cls

Closure to pass to all plugin functions.

Definition at line 209 of file gnunet_dhtu_plugin.h.

Referenced by libgnunet_plugin_dhtu_gnunet_done(), libgnunet_plugin_dhtu_ip_done(), and libgnunet_plugin_dhtu_ip_init().

◆ sign

ssize_t(* GNUNET_DHTU_PluginFunctions::sign) (void *cls, const struct GNUNET_DHTU_PrivateKey *pk, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, void **sig)

Use our private key to sign a message.

Parameters
clsclosure
pkour private key to sign with
purposewhat to sign
[out]signature,allocatedon heap and returned
Returns
-1 on error, otherwise number of bytes in sig

Definition at line 220 of file gnunet_dhtu_plugin.h.

Referenced by libgnunet_plugin_dhtu_ip_init().

◆ verify

enum GNUNET_GenericReturnValue(* GNUNET_DHTU_PluginFunctions::verify) (void *cls, const struct GNUNET_DHTU_PublicKey *pk, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, const void *sig, size_t sig_size)

Verify signature in sig over purpose.

Parameters
clsclosure
pkpublic key to verify signature of
purposewhat was being signed
sigsignature data
sig_sizenumber of bytes in sig
Returns
GNUNET_OK if signature is valid GNUNET_NO if signatures are not supported GNUNET_SYSERR if signature is invalid

Definition at line 220 of file gnunet_dhtu_plugin.h.

Referenced by libgnunet_plugin_dhtu_ip_init().

◆ try_connect

void(* GNUNET_DHTU_PluginFunctions::try_connect) (void *cls, const char *address)

Request creation of a session with a peer at the given address.

Parameters
clsclosure (internal context for the plugin)
addresstarget address to connect to

Definition at line 252 of file gnunet_dhtu_plugin.h.

Referenced by libgnunet_plugin_dhtu_ip_init().

◆ hold

struct GNUNET_DHTU_PreferenceHandle*(* GNUNET_DHTU_PluginFunctions::hold) (void *cls, struct GNUNET_DHTU_Target *target)

Request underlay to keep the connection to target alive if possible.

Hold may be called multiple times to express a strong preference to keep a connection, say because a target is in multiple tables.

Parameters
clsclosure
targetconnection to keep alive

Definition at line 252 of file gnunet_dhtu_plugin.h.

Referenced by libgnunet_plugin_dhtu_ip_init().

◆ drop

void(* GNUNET_DHTU_PluginFunctions::drop) (struct GNUNET_DHTU_PreferenceHandle *ph)

Do no long request underlay to keep the connection alive.

Parameters
clsclosure
targetconnection to keep alive

Definition at line 274 of file gnunet_dhtu_plugin.h.

Referenced by libgnunet_plugin_dhtu_ip_init().

◆ send

void(* GNUNET_DHTU_PluginFunctions::send) (void *cls, struct GNUNET_DHTU_Target *target, const void *msg, size_t msg_size, GNUNET_SCHEDULER_TaskCallback finished_cb, void *finished_cb_cls)

Send message to some other participant over the network.

Note that sending is not guaranteeing that the other peer actually received the message. For any given target, the DHT must wait for the finished_cb to be called before calling send() again.

Parameters
clsclosure (internal context for the plugin)
targetreceiver identification
msgmessage
msg_sizenumber of bytes in msg
finished_cbfunction called once transmission is done (not called if target disconnects, then only the disconnect_cb is called).
finished_cb_clsclosure for finished_cb

Definition at line 292 of file gnunet_dhtu_plugin.h.

Referenced by libgnunet_plugin_dhtu_ip_init().


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