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_GetPath |
| Operation handle. More... | |
Functions | |
| 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 (void *cls, const struct GNUNET_CADET_LocalInfoPath *message) |
| Process a local peer info reply, pass info to the user. | |
| static void | handle_get_path_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_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. | |
| void * | GNUNET_CADET_get_path_cancel (struct GNUNET_CADET_GetPath *gp) |
| Cancel gp operation. | |
cadet api: client implementation of cadet service
Definition in file cadet_api_get_path.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_path.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, GNUNET_CADET_LocalInfoPath::header, GNUNET_CADET_LocalInfoPath::off, and GNUNET_MessageHeader::size.
|
static |
Process a local peer info reply, pass info to the user.
| cls | Closure |
| message | Message itself. |
Definition at line 114 of file cadet_api_get_path.c.
References GNUNET_CADET_LocalInfoPath::header, GNUNET_CADET_GetPath::id, GNUNET_CADET_LocalInfoPath::off, GNUNET_CADET_PeerPathDetail::path, GNUNET_CADET_GetPath::path_cb, GNUNET_CADET_GetPath::path_cb_cls, GNUNET_CADET_PeerPathDetail::path_length, GNUNET_CADET_PeerPathDetail::peer, GNUNET_MessageHeader::size, and GNUNET_CADET_PeerPathDetail::target_offset.
|
static |
Process a local peer info reply, pass info to the user.
| cls | Closure |
| message | Message itself. |
Definition at line 137 of file cadet_api_get_path.c.
References GNUNET_CADET_get_path_cancel(), GNUNET_CADET_GetPath::path_cb, and GNUNET_CADET_GetPath::path_cb_cls.
|
static |
Reconnect to the service and try again.
| cls | a struct GNUNET_CADET_GetPath operation |
Definition at line 186 of file cadet_api_get_path.c.
References GNUNET_CADET_GetPath::cfg, env, error_handler(), GNUNET_CLIENT_connect(), GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PATH, GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PATH_END, GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg, GNUNET_MQ_send(), handlers, GNUNET_CADET_GetPath::id, GNUNET_CADET_GetPath::mq, msg, and GNUNET_CADET_GetPath::reconnect_task.
|
static |
Function called on connection trouble.
Reconnects.
| cls | a struct GNUNET_CADET_GetPath |
| error | error code from MQ |
Definition at line 165 of file cadet_api_get_path.c.
References GNUNET_CADET_GetPath::backoff, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_randomized_backoff(), GNUNET_TIME_UNIT_MINUTES, GNUNET_CADET_GetPath::mq, reconnect(), and GNUNET_CADET_GetPath::reconnect_task.
Referenced by reconnect().