199 if (NULL == callback)
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MessageHeader * msg
struct GNUNET_MQ_Envelope * env
static void handle_get_peers(void *cls, const struct GNUNET_CADET_LocalInfoPeers *info)
Process a local reply about info on all tunnels, pass info to the user.
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_peers_end(void *cls, const struct GNUNET_MessageHeader *msg)
Process a end of list reply about info on all peers.
P2P messages used by CADET.
static int ret
Final status code.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static void get_peers(void *cls)
Call CADET's meta API, get all peers known to a peer.
CADET service; establish channels to distant peers.
void(* GNUNET_CADET_PeersCB)(void *cls, const struct GNUNET_CADET_PeerListEntry *ple)
Method called to retrieve information about all peers in CADET, called once per peer.
struct GNUNET_CADET_PeersLister * GNUNET_CADET_list_peers(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CADET_PeersCB callback, void *callback_cls)
Request information about peers known to the running cadet service.
void * GNUNET_CADET_list_peers_cancel(struct GNUNET_CADET_PeersLister *pl)
Cancel a peer info request.
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_REQUEST_INFO_PEERS
Request local information about all peers known to the service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS
Local information about all peers known to the service.
#define GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS_END
End of local information about all peers known to the 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 one of the peers in the service.
Information we return per peer.
unsigned int best_path_length
Length of the shortest path (0 = unknown, 1 = ourselves, 2 = direct neighbour).
unsigned int n_paths
Number of disjoint known paths to peer.
struct GNUNET_PeerIdentity peer
Which peer is the information about?
int have_tunnel
Do we have a tunnel to this peer?
void * peers_cb_cls
Info callback closure for info_cb.
struct GNUNET_MQ_Handle * mq
Message queue to talk to CADET service.
struct GNUNET_SCHEDULER_Task * reconnect_task
Task to reconnect.
GNUNET_CADET_PeersCB peers_cb
Monitor callback.
struct GNUNET_TIME_Relative backoff
Backoff for reconnect attempts.
const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we use.
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.