220 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 reconnect(void *cls)
Reconnect to the service and try again.
static void handle_channel_info_end(void *cls, const struct GNUNET_MessageHeader *message)
Process a local peer info reply, pass info to the user.
static void handle_channel_info(void *cls, const struct GNUNET_CADET_ChannelInfoMessage *message)
Process a local peer info reply, pass info to the user.
static int check_channel_info(void *cls, const struct GNUNET_CADET_ChannelInfoMessage *message)
Check that message received from CADET service is well-formed.
P2P messages used by CADET.
static int ret
Final status code.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
CADET service; establish channels to distant peers.
void * GNUNET_CADET_get_channel_cancel(struct GNUNET_CADET_ChannelMonitor *cm)
Cancel a channel monitor request.
struct GNUNET_CADET_ChannelMonitor * GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *peer, GNUNET_CADET_ChannelCB callback, void *callback_cls)
Request information about a specific channel of the running cadet peer.
void(* GNUNET_CADET_ChannelCB)(void *cls, const struct GNUNET_CADET_ChannelInternals *info)
Method called to retrieve information about a specific channel the cadet peer is aware of,...
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_var_size(name, code, str, ctx)
#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_CHANNEL_END
End of local information of service about channels.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL
Local information of service about a specific channel.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_CHANNEL
Local information about all channels 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.
Message to inform the client about channels in the service.
struct GNUNET_PeerIdentity dest
Destination of the channel.
struct GNUNET_PeerIdentity root
Root of the channel.
Internal details about a channel.
struct GNUNET_PeerIdentity dest
Destination of the channel.
struct GNUNET_PeerIdentity root
Root of the channel.
struct GNUNET_PeerIdentity peer
Peer we want information about.
void * channel_cb_cls
Info callback closure for channel_cb.
GNUNET_CADET_ChannelCB channel_cb
Channel callback.
struct GNUNET_MQ_Handle * mq
Message queue to talk to CADET service.
struct GNUNET_SCHEDULER_Task * reconnect_task
Task to reconnect.
struct GNUNET_TIME_Relative backoff
Backoff for reconnect attempts.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we use.
Message to as the service about information on a channel.
Handle to a message queue.
Message handler for a specific message type.
The identity of the host (wraps the signing key of the peer).
Entry in list of pending tasks.
Time for relative time used by GNUnet, in microseconds.