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_ChannelMonitor |
| Operation handle. More... | |
Functions | |
| static int | check_channel_info (void *cls, const struct GNUNET_CADET_ChannelInfoMessage *message) |
| Check that message received from CADET service is well-formed. | |
| 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 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 | reconnect (void *cls) |
| Reconnect to the service and try again. | |
| static void | error_handler (void *cls, enum GNUNET_MQ_Error error) |
| Function called on connection trouble. | |
| 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_get_channel_cancel (struct GNUNET_CADET_ChannelMonitor *cm) |
| Cancel a channel monitor request. | |
cadet api: client implementation of cadet service
Definition in file cadet_api_get_channel.c.
|
static |
Check that message received from CADET service is well-formed.
| cls | unused |
| message | the message we got |
Definition at line 85 of file cadet_api_get_channel.c.
References GNUNET_OK.
|
static |
Process a local peer info reply, pass info to the user.
| cls | Closure |
| message | Message itself. |
Definition at line 101 of file cadet_api_get_channel.c.
References GNUNET_CADET_ChannelMonitor::channel_cb, GNUNET_CADET_ChannelMonitor::channel_cb_cls, GNUNET_CADET_ChannelInternals::dest, GNUNET_CADET_ChannelInfoMessage::dest, GNUNET_CADET_get_channel_cancel(), GNUNET_CADET_ChannelInternals::root, and GNUNET_CADET_ChannelInfoMessage::root.
|
static |
Process a local peer info reply, pass info to the user.
| cls | Closure |
| message | Message itself. |
Definition at line 122 of file cadet_api_get_channel.c.
References GNUNET_CADET_ChannelMonitor::channel_cb, GNUNET_CADET_ChannelMonitor::channel_cb_cls, and GNUNET_CADET_get_channel_cancel().
|
static |
Reconnect to the service and try again.
| cls | a struct GNUNET_CADET_ChannelMonitor operation |
Definition at line 170 of file cadet_api_get_channel.c.
References GNUNET_CADET_ChannelMonitor::cfg, env, error_handler(), GNUNET_CLIENT_connect(), GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL, GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL_END, GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_CHANNEL, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg, GNUNET_MQ_send(), handlers, GNUNET_CADET_ChannelMonitor::mq, msg, GNUNET_CADET_ChannelMonitor::peer, and GNUNET_CADET_ChannelMonitor::reconnect_task.
|
static |
Function called on connection trouble.
Reconnects.
| cls | a struct GNUNET_CADET_ChannelMonitor` |
| error | error code from MQ |
Definition at line 149 of file cadet_api_get_channel.c.
References GNUNET_CADET_ChannelMonitor::backoff, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_randomized_backoff(), GNUNET_TIME_UNIT_MINUTES, GNUNET_CADET_ChannelMonitor::mq, reconnect(), and GNUNET_CADET_ChannelMonitor::reconnect_task.
Referenced by GNUNET_CLIENT_connect(), GNUNET_MQ_queue_for_callbacks(), and reconnect().