cadet api: client implementation of cadet service More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_constants.h"
#include "gnunet_cadet_service.h"
#include "cadet.h"
#include "cadet_protocol.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_CADET_PeersLister |
Operation handle. More... | |
Functions | |
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. More... | |
static void | handle_get_peers_end (void *cls, const struct GNUNET_MessageHeader *msg) |
Process a end of list reply about info on all peers. More... | |
static void | reconnect (void *cls) |
Reconnect to the service and try again. More... | |
static void | error_handler (void *cls, enum GNUNET_MQ_Error error) |
Function called on connection trouble. More... | |
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. More... | |
void * | GNUNET_CADET_list_peers_cancel (struct GNUNET_CADET_PeersLister *pl) |
Cancel a peer info request. More... | |
cadet api: client implementation of cadet service
Definition in file cadet_api_list_peers.c.
|
static |
Process a local reply about info on all tunnels, pass info to the user.
cls | a struct GNUNET_CADET_PeersLister |
info | Message itself. |
Definition at line 78 of file cadet_api_list_peers.c.
References GNUNET_CADET_PeerListEntry::best_path_length, GNUNET_CADET_PeerListEntry::have_tunnel, info, consensus-simulation::int, GNUNET_CADET_PeerListEntry::n_paths, GNUNET_CADET_PeerListEntry::peer, GNUNET_CADET_PeersLister::peers_cb, and GNUNET_CADET_PeersLister::peers_cb_cls.
|
static |
Process a end of list reply about info on all peers.
cls | a struct GNUNET_CADET_PeersLister |
msg | Message itself. |
Definition at line 100 of file cadet_api_list_peers.c.
References GNUNET_CADET_list_peers_cancel(), msg, GNUNET_CADET_PeersLister::peers_cb, and GNUNET_CADET_PeersLister::peers_cb_cls.
|
static |
Reconnect to the service and try again.
cls | a struct GNUNET_CADET_PeersLister operation |
Definition at line 150 of file cadet_api_list_peers.c.
References GNUNET_CADET_PeersLister::cfg, env, error_handler(), get_peers(), GNUNET_CLIENT_connect(), GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS, GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS_END, GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PEERS, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_msg, GNUNET_MQ_send(), handlers, GNUNET_CADET_PeersLister::mq, msg, and GNUNET_CADET_PeersLister::reconnect_task.
Referenced by error_handler(), and GNUNET_CADET_list_peers().
|
static |
Function called on connection trouble.
Reconnects.
cls | a struct GNUNET_CADET_PeersLister |
error | error code from MQ |
Definition at line 129 of file cadet_api_list_peers.c.
References GNUNET_CADET_PeersLister::backoff, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_randomized_backoff(), GNUNET_TIME_UNIT_MINUTES, GNUNET_CADET_PeersLister::mq, reconnect(), and GNUNET_CADET_PeersLister::reconnect_task.
Referenced by reconnect().