GNUnet 0.22.2
gnunet-service-transport.h File Reference

globals More...

#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_ats_service.h"
#include "gnunet_transport_service.h"
Include dependency graph for gnunet-service-transport.h:

Go to the source code of this file.

Macros

#define VERBOSE_VALIDATION   GNUNET_YES
 

Typedefs

typedef void(* GNUNET_TRANSPORT_NeighbourChangeCallback) (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, enum GNUNET_TRANSPORT_PeerState state, struct GNUNET_TIME_Absolute state_timeout, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
 Function to call when a peer's address has changed. More...
 
typedef void(* GST_BlacklistTestContinuation) (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, int result)
 Continuation called from a blacklist test. More...
 

Functions

void GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer, const char *transport_name)
 Add the given peer to the blacklist (for the given transport). More...
 
struct GST_BlacklistCheck * GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer, const char *transport_name, GST_BlacklistTestContinuation cont, void *cont_cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
 Test if a peer/transport combination is blacklisted. More...
 
void GST_blacklist_abort_matching (const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
 Abort blacklist if address and session match. More...
 
void GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc)
 Cancel a blacklist check. More...
 
struct GNUNET_TIME_Relative GST_receive_callback (void *cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, const struct GNUNET_MessageHeader *message)
 Function called by the transport for each received message. More...
 
void GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, int may_drop)
 Broadcast the given message to all of our clients. More...
 
void GST_clients_broadcast_peer_notification (const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, enum GNUNET_TRANSPORT_PeerState state, struct GNUNET_TIME_Absolute state_timeout)
 Broadcast the new active address to all clients monitoring the peer. More...
 
void GST_clients_broadcast_disconnect (const struct GNUNET_PeerIdentity *peer)
 Notify all clients about a disconnect, and cancel pending SEND_OK messages for this peer. More...
 

Variables

struct GNUNET_STATISTICS_HandleGST_stats
 Statistics handle. More...
 
const struct GNUNET_CONFIGURATION_HandleGST_cfg
 Configuration handle. More...
 
struct GNUNET_PeerIdentity GST_my_identity
 Configuration handle. More...
 
struct GNUNET_PEERINFO_Handle * GST_peerinfo
 Handle to peerinfo service. More...
 
struct GNUNET_CRYPTO_EddsaPrivateKey GST_my_private_key
 Our private key. More...
 
struct GNUNET_ATS_SchedulingHandle * GST_ats
 ATS handle. More...
 
struct GNUNET_ATS_ConnectivityHandle * GST_ats_connect
 ATS connectivity handle. More...
 
struct GNUNET_NT_InterfaceScannerGST_is
 Interface scanner determines our LAN address range(s). More...
 

Detailed Description

globals

Author
Christian Grothoff

Definition in file gnunet-service-transport.h.

Macro Definition Documentation

◆ VERBOSE_VALIDATION

#define VERBOSE_VALIDATION   GNUNET_YES

Definition at line 34 of file gnunet-service-transport.h.

Typedef Documentation

◆ GNUNET_TRANSPORT_NeighbourChangeCallback

typedef void(* GNUNET_TRANSPORT_NeighbourChangeCallback) (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, enum GNUNET_TRANSPORT_PeerState state, struct GNUNET_TIME_Absolute state_timeout, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)

Function to call when a peer's address has changed.

Parameters
clsclosure
peerpeer this update is about,
addressaddress, NULL for disconnect notification

Definition at line 84 of file gnunet-service-transport.h.

◆ GST_BlacklistTestContinuation

typedef void(* GST_BlacklistTestContinuation) (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, int result)

Continuation called from a blacklist test.

Parameters
clsclosure
peeridentity of peer that was tested
addressaddress associated with the request
sessionsession associated with the request
resultGNUNET_OK if the connection is allowed, GNUNET_NO if not, GNUNET_SYSERR if operation was aborted

Definition at line 111 of file gnunet-service-transport.h.

Function Documentation

◆ GST_blacklist_add_peer()

void GST_blacklist_add_peer ( const struct GNUNET_PeerIdentity peer,
const char *  transport_name 
)

Add the given peer to the blacklist (for the given transport).

Parameters
peerpeer to blacklist
transport_nametransport to blacklist for this peer, NULL for all

◆ GST_blacklist_test_allowed()

struct GST_BlacklistCheck * GST_blacklist_test_allowed ( const struct GNUNET_PeerIdentity peer,
const char *  transport_name,
GST_BlacklistTestContinuation  cont,
void *  cont_cls,
const struct GNUNET_HELLO_Address *  address,
struct GNUNET_ATS_Session *  session 
)

Test if a peer/transport combination is blacklisted.

Parameters
peerthe identity of the peer to test
transport_namename of the transport to test, never NULL
contfunction to call with result
cont_clsclosure for cont
addressaddress to pass back to cont, can be NULL
sessionsession to pass back to cont, can be NULL
Returns
handle to the blacklist check, NULL if the decision was made instantly and cont was already called

◆ GST_blacklist_abort_matching()

void GST_blacklist_abort_matching ( const struct GNUNET_HELLO_Address *  address,
struct GNUNET_ATS_Session *  session 
)

Abort blacklist if address and session match.

Parameters
addressaddress used to abort matching checks
sessionsession used to abort matching checks

◆ GST_blacklist_test_cancel()

void GST_blacklist_test_cancel ( struct GST_BlacklistCheck *  bc)

Cancel a blacklist check.

Parameters
bccheck to cancel

◆ GST_receive_callback()

struct GNUNET_TIME_Relative GST_receive_callback ( void *  cls,
const struct GNUNET_HELLO_Address *  address,
struct GNUNET_ATS_Session *  session,
const struct GNUNET_MessageHeader message 
)

Function called by the transport for each received message.

Parameters
clsclosure, const char* with the name of the plugin we received the message from
addressaddress and (claimed) identity of the other peer
sessionidentifier used for this session (NULL for plugins that do not offer bi-directional communication to the sender using the same "connection")
messagethe message, NULL if we only care about learning about the delay until we should receive again
Returns
how long the plugin should wait until receiving more data (plugins that do not support this, can ignore the return value)

◆ GST_clients_broadcast()

void GST_clients_broadcast ( const struct GNUNET_MessageHeader msg,
int  may_drop 
)

Broadcast the given message to all of our clients.

Parameters
msgmessage to broadcast
may_dropGNUNET_YES if the message can be dropped / is payload

◆ GST_clients_broadcast_peer_notification()

void GST_clients_broadcast_peer_notification ( const struct GNUNET_PeerIdentity peer,
const struct GNUNET_HELLO_Address *  address,
enum GNUNET_TRANSPORT_PeerState  state,
struct GNUNET_TIME_Absolute  state_timeout 
)

Broadcast the new active address to all clients monitoring the peer.

Parameters
peerpeer this update is about (never NULL)
addressaddress, NULL on disconnect
statethe current state of the peer
state_timeoutthe time out for the state

◆ GST_clients_broadcast_disconnect()

void GST_clients_broadcast_disconnect ( const struct GNUNET_PeerIdentity peer)

Notify all clients about a disconnect, and cancel pending SEND_OK messages for this peer.

Parameters
peerpeer that disconnected

Variable Documentation

◆ GST_stats

struct GNUNET_STATISTICS_Handle* GST_stats
extern

Statistics handle.

◆ GST_cfg

const struct GNUNET_CONFIGURATION_Handle* GST_cfg
extern

Configuration handle.

◆ GST_my_identity

struct GNUNET_PeerIdentity GST_my_identity
extern

Configuration handle.

◆ GST_peerinfo

struct GNUNET_PEERINFO_Handle* GST_peerinfo
extern

Handle to peerinfo service.

◆ GST_my_private_key

struct GNUNET_CRYPTO_EddsaPrivateKey GST_my_private_key
extern

Our private key.

◆ GST_ats

struct GNUNET_ATS_SchedulingHandle* GST_ats
extern

ATS handle.

◆ GST_ats_connect

struct GNUNET_ATS_ConnectivityHandle* GST_ats_connect
extern

ATS connectivity handle.

◆ GST_is

struct GNUNET_NT_InterfaceScanner* GST_is
extern

Interface scanner determines our LAN address range(s).