enable clients to ask ATS about establishing connections to peers More...
Go to the source code of this file.
Data Structures | |
struct | GNUNET_ATS_ConnectivitySuggestHandle |
Handle for ATS address suggestion requests. More... | |
struct | GNUNET_ATS_ConnectivityHandle |
Handle to the ATS subsystem for connectivity management. More... | |
Macros | |
#define | LOG(kind, ...) |
Functions | |
static void | reconnect (struct GNUNET_ATS_ConnectivityHandle *ch) |
Re-establish the connection to the ATS service. More... | |
static void | reconnect_task (void *cls) |
Re-establish the connection to the ATS service. More... | |
static void | force_reconnect (struct GNUNET_ATS_ConnectivityHandle *ch) |
Disconnect from ATS and then reconnect. More... | |
static void | error_handler (void *cls, enum GNUNET_MQ_Error error) |
We encountered an error handling the MQ to the ATS service. More... | |
static int | transmit_suggestion (void *cls, const struct GNUNET_PeerIdentity *peer, void *value) |
Transmit request for an address suggestion. More... | |
struct GNUNET_ATS_ConnectivityHandle * | GNUNET_ATS_connectivity_init (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Initialize the ATS connectivity suggestion client handle. More... | |
static int | free_sug_handle (void *cls, const struct GNUNET_PeerIdentity *key, void *value) |
Function called to free all struct GNUNET_ATS_ConnectivitySuggestHandle s in the map. More... | |
void | GNUNET_ATS_connectivity_done (struct GNUNET_ATS_ConnectivityHandle *ch) |
Client is done with ATS connectivity management, release resources. More... | |
struct GNUNET_ATS_ConnectivitySuggestHandle * | GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch, const struct GNUNET_PeerIdentity *peer, uint32_t strength) |
We would like to receive address suggestions for a peer. More... | |
void | GNUNET_ATS_connectivity_suggest_cancel (struct GNUNET_ATS_ConnectivitySuggestHandle *sh) |
We no longer care about being connected to a peer. More... | |
enable clients to ask ATS about establishing connections to peers
Definition in file ats_api_connectivity.c.
#define LOG | ( | kind, | |
... | |||
) |
Definition at line 31 of file ats_api_connectivity.c.
|
static |
Re-establish the connection to the ATS service.
ch | handle to use to re-connect. |
Definition at line 190 of file ats_api_connectivity.c.
References ch, error_handler(), force_reconnect(), GNUNET_assert, GNUNET_CLIENT_connect(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_MESSAGE_TYPE_ATS_START, GNUNET_MQ_msg, GNUNET_MQ_send(), handlers, init, GNUNET_CADET_Channel::mq, START_FLAG_CONNECTION_SUGGESTION, and transmit_suggestion().
Referenced by GNUNET_ATS_connectivity_init(), and reconnect_task().
|
static |
Re-establish the connection to the ATS service.
cls | handle to use to re-connect. |
Definition at line 106 of file ats_api_connectivity.c.
References ch, and reconnect().
Referenced by force_reconnect().
|
static |
Disconnect from ATS and then reconnect.
ch | our handle |
Definition at line 121 of file ats_api_connectivity.c.
References ch, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_STD_BACKOFF, GNUNET_CADET_Channel::mq, and reconnect_task().
Referenced by error_handler(), and reconnect().
|
static |
We encountered an error handling the MQ to the ATS service.
Reconnect.
cls | the struct GNUNET_ATS_ConnectivityHandle |
error | details about the error |
Definition at line 143 of file ats_api_connectivity.c.
References ch, force_reconnect(), GNUNET_ERROR_TYPE_DEBUG, and LOG.
Referenced by GNUNET_CLIENT_connect(), GNUNET_MQ_queue_for_callbacks(), and reconnect().
|
static |
Transmit request for an address suggestion.
cls | the struct GNUNET_ATS_ConnectivityHandle |
peer | peer to ask for an address suggestion for |
value | the struct GNUNET_ATS_SuggestHandle |
Definition at line 165 of file ats_api_connectivity.c.
References ch, GNUNET_MESSAGE_TYPE_ATS_REQUEST_ADDRESS, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_OK, GNUNET_SYSERR, m, GNUNET_CADET_Channel::mq, peer, sh, and value.
Referenced by GNUNET_ATS_connectivity_suggest(), and reconnect().
|
static |
Function called to free all struct GNUNET_ATS_ConnectivitySuggestHandle
s in the map.
cls | NULL |
key | the key |
value | the value to free |
Definition at line 250 of file ats_api_connectivity.c.
References GNUNET_free, GNUNET_OK, and value.
Referenced by GNUNET_ATS_connectivity_done().