api to get information from the network size estimation service More...
#include "platform.h"
#include "gnunet_constants.h"
#include "gnunet_arm_service.h"
#include "gnunet_protocols.h"
#include "gnunet_util_lib.h"
#include "gnunet_nse_service.h"
#include "nse.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_NSE_Handle |
Handle for talking with the NSE service. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "nse-api", __VA_ARGS__) |
Functions | |
static void | reconnect (void *cls) |
Try again to connect to network size estimation service. More... | |
static void | mq_error_handler (void *cls, enum GNUNET_MQ_Error error) |
Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue. More... | |
static void | handle_estimate (void *cls, const struct GNUNET_NSE_ClientMessage *client_msg) |
Type of a function to call when we receive a message from the service. More... | |
struct GNUNET_NSE_Handle * | GNUNET_NSE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_NSE_Callback func, void *func_cls) |
Connect to the network size estimation service. More... | |
void | GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h) |
Disconnect from network size estimation service. More... | |
api to get information from the network size estimation service
Definition in file nse_api.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "nse-api", __VA_ARGS__) |
|
static |
Try again to connect to network size estimation service.
cls | closure with the struct GNUNET_NSE_Handle * |
cls | the struct GNUNET_NSE_Handle * |
Definition at line 131 of file nse_api.c.
References GNUNET_ARM_Handle::cfg, env, GNUNET_assert, GNUNET_CLIENT_connect(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_MESSAGE_TYPE_NSE_ESTIMATE, GNUNET_MESSAGE_TYPE_NSE_START, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_msg, GNUNET_MQ_send(), h, handlers, LOG, GNUNET_ARM_Handle::mq, mq_error_handler(), msg, and GNUNET_ARM_Handle::reconnect_task.
Referenced by GNUNET_NSE_connect(), and mq_error_handler().
|
static |
Generic error handler, called with the appropriate error code and the same closure specified at the creation of the message queue.
Not every message queue implementation supports an error handler.
cls | closure with the struct GNUNET_NSE_Handle * |
error | error code |
Definition at line 92 of file nse_api.c.
References GNUNET_MQ_destroy(), GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_STD_BACKOFF, h, GNUNET_ARM_Handle::mq, reconnect(), and GNUNET_ARM_Handle::reconnect_task.
Referenced by reconnect().
|
static |
Type of a function to call when we receive a message from the service.
cls | closure |
client_msg | message received |
Definition at line 113 of file nse_api.c.
References GNUNET_ntoh_double(), GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_UNIT_ZERO, h, GNUNET_NSE_ClientMessage::size_estimate, GNUNET_NSE_ClientMessage::std_deviation, and GNUNET_NSE_ClientMessage::timestamp.