enable clients to ask TRANSPORT about establishing connections to peers More...
#include "platform.h"
#include "gnunet_transport_application_service.h"
#include "gnunet_transport_core_service.h"
#include "transport.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_TRANSPORT_ApplicationSuggestHandle |
Handle for TRANSPORT address suggestion requests. More... | |
struct | GNUNET_TRANSPORT_ApplicationHandle |
Handle to the TRANSPORT subsystem for application management. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "transport-application-api", __VA_ARGS__) |
Functions | |
static void | reconnect (struct GNUNET_TRANSPORT_ApplicationHandle *ch) |
Re-establish the connection to the TRANSPORT service. More... | |
static void | reconnect_task (void *cls) |
Re-establish the connection to the TRANSPORT service. More... | |
static void | force_reconnect (struct GNUNET_TRANSPORT_ApplicationHandle *ch) |
Disconnect from TRANSPORT and then reconnect. More... | |
static void | error_handler (void *cls, enum GNUNET_MQ_Error error) |
We encountered an error handling the MQ to the TRANSPORT service. More... | |
static int | transmit_suggestion (void *cls, const struct GNUNET_PeerIdentity *peer, void *value) |
Transmit request for an address suggestion. More... | |
struct GNUNET_TRANSPORT_ApplicationHandle * | GNUNET_TRANSPORT_application_init (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Initialize the TRANSPORT application 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_TRANSPORT_ApplicationSuggestHandle s in the map. More... | |
void | GNUNET_TRANSPORT_application_done (struct GNUNET_TRANSPORT_ApplicationHandle *ch) |
Client is done with TRANSPORT application management, release resources. More... | |
struct GNUNET_TRANSPORT_ApplicationSuggestHandle * | GNUNET_TRANSPORT_application_suggest (struct GNUNET_TRANSPORT_ApplicationHandle *ch, const struct GNUNET_PeerIdentity *peer, enum GNUNET_MQ_PriorityPreferences pk, struct GNUNET_BANDWIDTH_Value32NBO bw) |
An application would like TRANSPORT to connect to a peer. More... | |
void | GNUNET_TRANSPORT_application_suggest_cancel (struct GNUNET_TRANSPORT_ApplicationSuggestHandle *sh) |
We no longer care about being connected to a peer. More... | |
void | GNUNET_TRANSPORT_application_validate (struct GNUNET_TRANSPORT_ApplicationHandle *ch, const struct GNUNET_PeerIdentity *peer, enum GNUNET_NetworkType nt, const char *addr) |
An application (or a communicator) has received a HELLO (or other address data of another peer) and wants TRANSPORT to validate that the address is correct. More... | |
enable clients to ask TRANSPORT about establishing connections to peers
Definition in file transport_api2_application.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "transport-application-api", __VA_ARGS__) |
Definition at line 32 of file transport_api2_application.c.
|
static |
Re-establish the connection to the TRANSPORT service.
ch | handle to use to re-connect. |
Definition at line 194 of file transport_api2_application.c.
References ch, error_handler(), force_reconnect(), GNUNET_assert, GNUNET_CLIENT_connect(), GNUNET_CONTAINER_multipeermap_iterate(), handlers, GNUNET_CADET_Channel::mq, and transmit_suggestion().
Referenced by GNUNET_TRANSPORT_application_init(), and reconnect_task().
|
static |
Re-establish the connection to the TRANSPORT service.
cls | handle to use to re-connect. |
Definition at line 112 of file transport_api2_application.c.
References ch, and reconnect().
Referenced by force_reconnect().
|
static |
Disconnect from TRANSPORT and then reconnect.
ch | our handle |
Definition at line 127 of file transport_api2_application.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 TRANSPORT service.
Reconnect.
cls | the struct GNUNET_TRANSPORT_ApplicationHandle |
error | details about the error |
Definition at line 147 of file transport_api2_application.c.
References ch, force_reconnect(), GNUNET_ERROR_TYPE_DEBUG, and LOG.
Referenced by reconnect().
|
static |
Transmit request for an address suggestion.
cls | the struct GNUNET_TRANSPORT_ApplicationHandle |
peer | peer to ask for an address suggestion for |
value | the struct GNUNET_TRANSPORT_SuggestHandle |
Definition at line 168 of file transport_api2_application.c.
References ch, GNUNET_MESSAGE_TYPE_TRANSPORT_SUGGEST, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_OK, GNUNET_SYSERR, m, GNUNET_CADET_Channel::mq, ExpressPreferenceMessage::peer, sh, and value.
Referenced by GNUNET_TRANSPORT_application_suggest(), and reconnect().
|
static |
Function called to free all struct GNUNET_TRANSPORT_ApplicationSuggestHandle
s in the map.
cls | NULL |
key | the key |
value | the value to free |
Definition at line 242 of file transport_api2_application.c.
References GNUNET_free, GNUNET_OK, and value.
Referenced by GNUNET_TRANSPORT_application_done().