globals More...
#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_ats_service.h"
#include "gnunet_transport_service.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_Handle * | GST_stats |
Statistics handle. More... | |
const struct GNUNET_CONFIGURATION_Handle * | GST_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_InterfaceScanner * | GST_is |
Interface scanner determines our LAN address range(s). More... | |
globals
Definition in file gnunet-service-transport.h.
#define VERBOSE_VALIDATION GNUNET_YES |
Definition at line 34 of file gnunet-service-transport.h.
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.
cls | closure |
peer | peer this update is about, |
address | address, NULL for disconnect notification |
Definition at line 84 of file gnunet-service-transport.h.
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.
cls | closure |
peer | identity of peer that was tested |
address | address associated with the request |
session | session associated with the request |
result | GNUNET_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.
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).
peer | peer to blacklist |
transport_name | transport to blacklist for this peer, NULL for all |
Definition at line 2307 of file gnunet-service-transport.c.
References blacklist, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multipeermap_create(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_strdup, peer, transport, and TRANSPORT_BLACKLIST_HT_SIZE.
Referenced by blacklist_cfg_iter(), and run().
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.
peer | the identity of the peer to test |
transport_name | name of the transport to test, never NULL |
cont | function to call with result |
cont_cls | closure for cont |
address | address to pass back to cont, can be NULL |
session | session to pass back to cont, can be NULL |
Definition at line 2421 of file gnunet-service-transport.c.
References _, address, GST_BlacklistCheck::address, TransportClient::bc, bc_head, bc_tail, GST_BlacklistCheck::bl_pos, blacklist, clients_head, GST_BlacklistCheck::cont, GST_BlacklistCheck::cont_cls, CT_BLACKLIST, do_blacklist_check(), gettext_noop, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_multipeermap_get_multiple(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_HELLO_address_copy(), GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_STATISTICS_update(), GNUNET_SYSERR, GST_stats, peer, GST_BlacklistCheck::peer, GST_BlacklistCheck::session, GST_BlacklistCheck::task, tc, and test_blacklisted().
Referenced by GST_neighbours_switch_to_address(), plugin_env_session_start(), and revalidate_address().
void GST_blacklist_abort_matching | ( | const struct GNUNET_HELLO_Address * | address, |
struct GNUNET_ATS_Session * | session | ||
) |
Abort blacklist if address and session match.
address | address used to abort matching checks |
session | session used to abort matching checks |
Definition at line 2343 of file gnunet-service-transport.c.
References address, GST_BlacklistCheck::address, bc_head, GST_BlacklistCheck::cont, GST_BlacklistCheck::cont_cls, GNUNET_HELLO_address_cmp(), GNUNET_SYSERR, GST_blacklist_test_cancel(), GST_BlacklistCheck::next, GST_BlacklistCheck::peer, and GST_BlacklistCheck::session.
Referenced by connect_bl_check_cont(), and plugin_env_session_end().
void GST_blacklist_test_cancel | ( | struct GST_BlacklistCheck * | bc | ) |
Cancel a blacklist check.
bc | check to cancel |
Definition at line 2490 of file gnunet-service-transport.c.
References GST_BlacklistCheck::address, TransportClient::bc, bc_head, bc_tail, GST_BlacklistCheck::bl_pos, TransportClient::blacklist, CT_BLACKLIST, TransportClient::details, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_SCHEDULER_cancel(), GST_BlacklistCheck::task, and TransportClient::type.
Referenced by cleanup_validation_entry(), do_blacklist_check(), GST_blacklist_abort_matching(), handle_client_blacklist_reply(), and revalidate_address().
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.
cls | closure, const char* with the name of the plugin we received the message from |
address | address and (claimed) identity of the other peer |
session | identifier used for this session (NULL for plugins that do not offer bi-directional communication to the sender using the same "connection") |
message | the message, NULL if we only care about learning about the delay until we should receive again |
cls | closure, const char* with the name of the plugin we received the message from |
address | address and (claimed) identity of the other peer |
message | the message, NULL if we only care about learning about the delay until we should receive again |
session | identifier used for this session (NULL for plugins that do not offer bi-directional communication to the sender using the same "connection") |
Definition at line 1557 of file gnunet-service-transport.c.
void GST_clients_broadcast | ( | const struct GNUNET_MessageHeader * | msg, |
int | may_drop | ||
) |
Broadcast the given message to all of our clients.
msg | message to broadcast |
may_drop | GNUNET_YES if the message can be dropped / is payload |
Definition at line 1286 of file gnunet-service-transport.c.
References clients_head, CT_CORE, CT_NONE, done(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_YES, msg, GNUNET_MessageHeader::size, tc, GNUNET_MessageHeader::type, and unicast().
Referenced by GST_clients_broadcast_disconnect(), neighbours_connect_notification(), process_hello_update(), and send_outbound_quota_to_clients().
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.
peer | peer this update is about (never NULL) |
address | address, NULL on disconnect |
state | the current state of the peer |
state_timeout | the time out for the state |
Definition at line 1320 of file gnunet-service-transport.c.
References address, all_zeros, clients_head, compose_address_iterate_response_message(), CT_MONITOR, env, GNUNET_free, GNUNET_MQ_msg_copy(), GNUNET_MQ_send(), GNUNET_TIME_absolute_hton(), msg, peer, state, PeerIterateResponseMessage::state_timeout, and tc.
Referenced by neighbours_changed_notification().
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.
peer | peer that disconnected |
Definition at line 1377 of file gnunet-service-transport.c.
References active_stccs, GNUNET_CONTAINER_multipeermap_get_multiple(), GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT, GNUNET_NO, GST_clients_broadcast(), DisconnectInfoMessage::header, mark_peer_down(), peer, DisconnectInfoMessage::peer, DisconnectInfoMessage::reserved, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by neighbours_disconnect_notification().
|
extern |
Statistics handle.
Definition at line 367 of file gnunet-service-transport.c.
Referenced by ats_request_address_change(), confirm_or_drop_neighbour(), GST_blacklist_test_allowed(), handle_client_send(), plugin_env_address_change_notification(), run(), shutdown_task(), and unicast().
|
extern |
Configuration handle.
Definition at line 372 of file gnunet-service-transport.c.
Referenced by run().
|
extern |
Configuration handle.
Definition at line 372 of file gnunet-service-transport.c.
Referenced by handle_client_start(), run(), and transmit_our_hello().
|
extern |
Handle to peerinfo service.
Definition at line 382 of file gnunet-service-transport.c.
Referenced by GST_validation_handle_pong(), refresh_hello_task(), run(), and shutdown_task().
|
extern |
|
extern |
ATS handle.
ATS handle.
Definition at line 392 of file gnunet-service-transport.c.
Referenced by GST_ats_add_address(), GST_ats_add_inbound_address(), run(), shutdown_task(), and unblock_address().
|
extern |
ATS connectivity handle.
Definition at line 397 of file gnunet-service-transport.c.
Referenced by run(), setup_neighbour(), and shutdown_task().
|
extern |
Interface scanner determines our LAN address range(s).
Definition at line 417 of file gnunet-service-transport.c.
Referenced by run(), and shutdown_task().