GNUnet  0.18.1
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 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, struct GNUNET_DHTU_Target *target, const struct GNUNET_PeerIdentity *pid, 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 67 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 77 of file gnunet_dhtu_plugin.h.

Referenced by libgnunet_plugin_dhtu_gnunet_init(), libgnunet_plugin_dhtu_ip_init(), and load_underlay().

◆ address_add_cb

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

Function to call with new addresses of this peer.

Parameters
clsthe closure
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 88 of file gnunet_dhtu_plugin.h.

Referenced by load_underlay().

◆ 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 99 of file gnunet_dhtu_plugin.h.

Referenced by load_underlay().

◆ 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 110 of file gnunet_dhtu_plugin.h.

Referenced by load_underlay().

◆ connect_cb

void(* GNUNET_DHTU_PluginEnvironment::connect_cb) (void *cls, struct GNUNET_DHTU_Target *target, const struct GNUNET_PeerIdentity *pid, void **ctx)

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

Parameters
clsthe closure
targethandle to the target, pointer will remain valid until disconnect_cb is called
pidpeer identity, pointer will remain valid until disconnect_cb is called
[out]ctxstorage space for DHT to use in association with this target

Definition at line 127 of file gnunet_dhtu_plugin.h.

Referenced by load_underlay().

◆ 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 140 of file gnunet_dhtu_plugin.h.

Referenced by load_underlay().

◆ 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 153 of file gnunet_dhtu_plugin.h.

Referenced by load_underlay().


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