35 #define LOG(kind, ...) GNUNET_log_from (kind, "transport-api", __VA_ARGS__) 98 "Error receiving from transport service, disconnecting temporarily.\n");
121 "Connecting to transport service.\n");
185 if (NULL == handle->
mq)
216 "Connecting to transport service.\n");
struct GNUNET_PeerIdentity peer
The identity of the peer to look up.
static struct GNUNET_TIME_Relative delay_in
Inbound delay to apply to all peers.
struct GNUNET_MessageHeader * msg
common internal definitions for transport service
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
struct GNUNET_TIME_RelativeNBO delay_in
Fake delay to add on inbound traffic.
GNUNET_MQ_Error
Error codes for the queue.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_ATS_properties_hton(struct GNUNET_ATS_PropertiesNBO *nbo, const struct GNUNET_ATS_Properties *hbo)
Convert ATS properties from host to network byte order.
int reconnecting
Reconnect in progress.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_TRAFFIC_METRIC
Message containing traffic metrics for transport service.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for the transport service (includes all of the state for the transport service).
ATS performance characteristics for an address.
static void disconnect_and_schedule_reconnect(struct GNUNET_TRANSPORT_ManipulationHandle *h)
Function that will schedule the job that will try to connect us again to the client.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
struct GNUNET_TIME_Relative reconnect_delay
Delay until we try to reconnect.
struct GNUNET_TIME_RelativeNBO delay_out
Fake delay to add on outbound traffic.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
static void mq_error_handler(void *cls, enum GNUNET_MQ_Error error)
Generic error handler, called with the appropriate error code and the same closure specified at the c...
struct GNUNET_MQ_Handle * mq
My client connection to the transport service.
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
Message from the library to the transport service asking for binary addresses known for a peer...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_START
Message from the core saying that the transport server should start giving it messages.
Message handler for a specific message type.
const struct GNUNET_CONFIGURATION_Handle * cfg
My configuration.
Message from the transport service to the library asking to check if both processes agree about this ...
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
struct GNUNET_ATS_PropertiesNBO properties
Fake properties to generate.
struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton(struct GNUNET_TIME_Relative a)
Convert relative time to network byte order.
struct GNUNET_MQ_Envelope * env
#define GNUNET_TIME_STD_BACKOFF(r)
Perform our standard exponential back-off calculation, starting at 1 ms and then going by a factor of...
static struct GNUNET_TIME_Relative delay_out
Outbound delay to apply to all peers.
Handle to a message queue.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_TRANSPORT_ManipulationHandle * GNUNET_TRANSPORT_manipulation_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the transport service.
Entry in list of pending tasks.
void GNUNET_TRANSPORT_manipulation_disconnect(struct GNUNET_TRANSPORT_ManipulationHandle *handle)
Disconnect from the transport service.
static void reconnect(void *cls)
Try again to connect to transport service.
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
struct GNUNET_SCHEDULER_Task * reconnect_task
ID of the task trying to reconnect to the service.
void GNUNET_TRANSPORT_manipulation_set(struct GNUNET_TRANSPORT_ManipulationHandle *handle, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_ATS_Properties *prop, struct GNUNET_TIME_Relative delay_in, struct GNUNET_TIME_Relative delay_out)
Set transport metrics for a peer and a direction.
uint32_t reserved
Always zero.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_free(ptr)
Wrapper around free.
Time for relative time used by GNUnet, in microseconds.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.