GNUnet  0.11.x
Data Fields
GNUNET_DHTU_PluginEnvironment Struct Reference

The datastore service will pass a pointer to a struct of this type as the first and only argument to the entry point of each datastore plugin. More...

#include <gnunet_dhtu_plugin.h>

Collaboration diagram for GNUNET_DHTU_PluginEnvironment:
[legend]

Data Fields

const struct GNUNET_CONFIGURATION_Handlecfg
 Configuration to use. More...
 
void * cls
 Closure to use for callbacks. More...
 
void(* address_add_cb )(void *cls, const struct GNUNET_DHTU_Hash *my_id, const struct GNUNET_DHTU_PrivateKey *pk, const char *address, struct GNUNET_DHTU_Source *source, void **ctx)
 Function to call with new addresses of this peer. More...
 
void(* address_del_cb )(void *ctx)
 Function to call with expired addresses of this peer. More...
 
void(* network_size_cb )(void *cls, struct GNUNET_TIME_Absolute timestamp, double logestimate, double std_dev)
 We have a new estimate on the size of the underlay. More...
 
void(* connect_cb )(void *cls, const struct GNUNET_DHTU_PublicKey *pk, const struct GNUNET_DHTU_Hash *peer_id, struct GNUNET_DHTU_Target *target, void **ctx)
 Function to call when we connect to a peer and can henceforth transmit to that peer. More...
 
void(* disconnect_cb )(void *ctx)
 Function to call when we disconnected from a peer and can henceforth cannot transmit to that peer anymore. More...
 
void(* receive_cb )(void *cls, void **tctx, void **sctx, const void *message, size_t message_size)
 Function to call when we receive a message. More...
 

Detailed Description

The datastore service will pass a pointer to a struct of this type as the first and only argument to the entry point of each datastore plugin.

Definition at line 98 of file gnunet_dhtu_plugin.h.

Field Documentation

◆ cfg

const struct GNUNET_CONFIGURATION_Handle* GNUNET_DHTU_PluginEnvironment::cfg

◆ cls

void* GNUNET_DHTU_PluginEnvironment::cls

Closure to use for callbacks.

Definition at line 108 of file gnunet_dhtu_plugin.h.

Referenced by libgnunet_plugin_dhtu_ip_init().

◆ address_add_cb

void(* GNUNET_DHTU_PluginEnvironment::address_add_cb) (void *cls, const struct GNUNET_DHTU_Hash *my_id, const struct GNUNET_DHTU_PrivateKey *pk, const char *address, struct GNUNET_DHTU_Source *source, void **ctx)

Function to call with new addresses of this peer.

Parameters
clsthe closure
my_idhash position of this address in the DHT
pkprivate key of this peer used at address, pointer will remain valid until address_del_cb is called
addressaddress under which we are likely reachable, pointer will remain valid until address_del_cb is called; to be used for HELLOs. Example: "ip+udp://1.1.1.1:2086/"
sourcehandle for sending from this address, NULL if we can only receive
[out]ctxstorage space for DHT to use in association with this address

Definition at line 122 of file gnunet_dhtu_plugin.h.

◆ address_del_cb

void(* GNUNET_DHTU_PluginEnvironment::address_del_cb) (void *ctx)

Function to call with expired addresses of this peer.

Parameters
[in]ctxstorage space used by the DHT in association with this address

Definition at line 135 of file gnunet_dhtu_plugin.h.

◆ network_size_cb

void(* GNUNET_DHTU_PluginEnvironment::network_size_cb) (void *cls, struct GNUNET_TIME_Absolute timestamp, double logestimate, double std_dev)

We have a new estimate on the size of the underlay.

Parameters
clsclosure
timestamptime when the estimate was received from the server (or created by the server)
logestimatethe log(Base 2) value of the current network size estimate
std_devstandard deviation for the estimate, negative if unavailable

Definition at line 146 of file gnunet_dhtu_plugin.h.

◆ connect_cb

void(* GNUNET_DHTU_PluginEnvironment::connect_cb) (void *cls, const struct GNUNET_DHTU_PublicKey *pk, const struct GNUNET_DHTU_Hash *peer_id, struct GNUNET_DHTU_Target *target, void **ctx)

Function to call when we connect to a peer and can henceforth transmit to that peer.

Parameters
clsthe closure
pkpublic key of the target, pointer will remain valid until disconnect_cb is called @para peer_id hash position of the peer, pointer will remain valid until disconnect_cb is called
targethandle to the target, pointer will remain valid until disconnect_cb is called
[out]ctxstorage space for DHT to use in association with this target

Definition at line 165 of file gnunet_dhtu_plugin.h.

◆ disconnect_cb

void(* GNUNET_DHTU_PluginEnvironment::disconnect_cb) (void *ctx)

Function to call when we disconnected from a peer and can henceforth cannot transmit to that peer anymore.

Parameters
[in]ctxstorage space used by the DHT in association with this target

Definition at line 178 of file gnunet_dhtu_plugin.h.

◆ receive_cb

void(* GNUNET_DHTU_PluginEnvironment::receive_cb) (void *cls, void **tctx, void **sctx, const void *message, size_t message_size)

Function to call when we receive a message.

Parameters
clsthe closure
originwhere the message originated from
[in,out]tctxctx of target address where we received the message from
[in,out]sctxctx of our own source address at which we received the message
messagethe message we received
message_sizenumber of bytes in message

Definition at line 191 of file gnunet_dhtu_plugin.h.


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