200 if (NULL == callback)
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env
static void error_handler(void *cls, enum GNUNET_MQ_Error error)
Function called on connection trouble.
static void handle_get_tunnels(void *cls, const struct GNUNET_CADET_LocalInfoTunnel *info)
Process a local reply about info on all tunnels, pass info to the user.
static void reconnect(void *cls)
Reconnect to the service and try again.
static void handle_get_tunnels_end(void *cls, const struct GNUNET_MessageHeader *msg)
Process a local reply about info on all tunnels, pass info to the user.
P2P messages used by CADET.
static int ret
Final status code.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static void get_tunnels(void *cls)
Call CADET's meta API, get all tunnels known to a peer.
CADET service; establish channels to distant peers.
struct GNUNET_CADET_ListTunnels * GNUNET_CADET_list_tunnels(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CADET_TunnelsCB callback, void *callback_cls)
Request information about tunnels of the running cadet peer.
void * GNUNET_CADET_list_tunnels_cancel(struct GNUNET_CADET_ListTunnels *lt)
Cancel a monitor request.
void(* GNUNET_CADET_TunnelsCB)(void *cls, const struct GNUNET_CADET_TunnelDetails *td)
Method called to retrieve information about all tunnels in CADET, called once per tunnel.
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.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_MQ_Error
Error codes for the queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS
Local information about all tunnels of service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS_END
End of local information about all tunnels of service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS
Request local information about all tunnels of service.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
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.
struct GNUNET_TIME_Relative GNUNET_TIME_randomized_backoff(struct GNUNET_TIME_Relative rt, struct GNUNET_TIME_Relative threshold)
Randomized exponential back-off, starting at 1 ms and going up by a factor of 2+r,...
#define GNUNET_TIME_UNIT_MINUTES
One minute.
struct GNUNET_MQ_Handle * mq
Message queue to talk to CADET service.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we use.
void * tunnels_cb_cls
Info callback closure for tunnels_cb.
GNUNET_CADET_TunnelsCB tunnels_cb
Monitor callback.
struct GNUNET_TIME_Relative backoff
Backoff for reconnect attempts.
struct GNUNET_SCHEDULER_Task * reconnect_task
Task to reconnect.
Message to inform the client about one of the tunnels in the service.
Details about a tunnel managed by CADET.
uint16_t cstate
What is our connectivity state?
uint32_t channels
How many channels use the tunnel.
uint16_t estate
What is our encryption state?
struct GNUNET_PeerIdentity peer
Target of the tunnel.
uint32_t connections
How many connections support the tunnel.
Handle to a message queue.
Message handler for a specific message type.
Entry in list of pending tasks.
Time for relative time used by GNUnet, in microseconds.