227 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_get_path(void *cls, const struct GNUNET_CADET_LocalInfoPath *message)
Process a local peer info reply, pass info to the user.
static int check_get_path(void *cls, const struct GNUNET_CADET_LocalInfoPath *message)
Check that message received from CADET service is well-formed.
static void handle_get_path_end(void *cls, const struct GNUNET_MessageHeader *message)
Process a local peer info reply, 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 struct GNUNET_IDENTITY_Handle * id
Handle to IDENTITY.
CADET service; establish channels to distant peers.
void(* GNUNET_CADET_PathCB)(void *cls, const struct GNUNET_CADET_PeerPathDetail *ppd)
Method called to retrieve information about a specific path known to the service.
void * GNUNET_CADET_get_path_cancel(struct GNUNET_CADET_GetPath *gp)
Cancel gp operation.
struct GNUNET_CADET_GetPath * GNUNET_CADET_get_path(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_PeerIdentity *id, GNUNET_CADET_PathCB callback, void *callback_cls)
Request information about a peer known to the running cadet peer.
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.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#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_PATH_END
End of local information of service about a specific path.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH
Request local information of service about paths to specific peer.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PATH
Local information of service about a specific path.
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_TIME_Relative backoff
Backoff for reconnect attempts.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we use.
struct GNUNET_SCHEDULER_Task * reconnect_task
Task to reconnect.
GNUNET_CADET_PathCB path_cb
Monitor callback.
struct GNUNET_MQ_Handle * mq
Message queue to talk to CADET service.
void * path_cb_cls
Closure for path_cb.
struct GNUNET_PeerIdentity id
Peer we want information about.
Message to inform the client about one of the paths known to the service.
uint32_t off
Offset of the peer that was requested.
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PATH.
Detailed information we return per peer.
unsigned int path_length
Number of entries on the path.
const struct GNUNET_PeerIdentity * path
Array of PEER_IDs representing all paths to reach the peer.
unsigned int target_offset
Offset of the target peer on the path.
struct GNUNET_PeerIdentity peer
Peer this is about.
Message to inform the client about channels in the service.
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.