implementation of the gnunet_transport_monitor_service.h API More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_transport_monitor_service.h"
#include "transport.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_TRANSPORT_MonitorContext |
Opaque handle to the transport service for monitors. More... | |
Functions | |
static void | reconnect (struct GNUNET_TRANSPORT_MonitorContext *mc) |
(re)connect our monitor to the transport service More... | |
static void | send_start_monitor (struct GNUNET_TRANSPORT_MonitorContext *mc) |
Send message to the transport service about our montoring desire. More... | |
static void | disconnect (struct GNUNET_TRANSPORT_MonitorContext *mc) |
Disconnect from the transport service. More... | |
static void | error_handler (void *cls, enum GNUNET_MQ_Error error) |
Function called on MQ errors. More... | |
static int | check_monitor_data (void *cls, const struct GNUNET_TRANSPORT_MonitorData *md) |
Transport service sends us information about what is going on. More... | |
static void | handle_monitor_data (void *cls, const struct GNUNET_TRANSPORT_MonitorData *md) |
Transport service sends us information about what is going on. More... | |
static void | handle_monitor_end (void *cls, const struct GNUNET_MessageHeader *me) |
One shot was requested, and transport service is done. More... | |
struct GNUNET_TRANSPORT_MonitorContext * | GNUNET_TRANSPORT_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_PeerIdentity *peer, int one_shot, GNUNET_TRANSPORT_MonitorCallback cb, void *cb_cls) |
Return information about a specific peer or all peers currently known to transport service once or in monitoring mode. More... | |
void | GNUNET_TRANSPORT_monitor_cancel (struct GNUNET_TRANSPORT_MonitorContext *mc) |
Cancel request to monitor peers. More... | |
implementation of the gnunet_transport_monitor_service.h API
Definition in file transport_api2_monitor.c.
|
static |
(re)connect our monitor to the transport service
mc | handle to reconnect |
Definition at line 206 of file transport_api2_monitor.c.
References error_handler(), GNUNET_CLIENT_connect(), GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_DATA, GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_END, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, handlers, mc, and send_start_monitor().
Referenced by error_handler(), GNUNET_TRANSPORT_monitor(), and handle_monitor_end().
|
static |
Send message to the transport service about our montoring desire.
ai | address to delete |
Definition at line 86 of file transport_api2_monitor.c.
References env, GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_START, GNUNET_MQ_msg, GNUNET_MQ_send(), mc, GNUNET_TRANSPORT_MonitorStart::one_shot, and GNUNET_TRANSPORT_MonitorStart::peer.
Referenced by reconnect().
|
static |
Disconnect from the transport service.
mc | service to disconnect from |
Definition at line 106 of file transport_api2_monitor.c.
References GNUNET_MQ_destroy(), and mc.
Referenced by error_handler(), GNUNET_TRANSPORT_monitor_cancel(), and handle_monitor_end().
|
static |
Function called on MQ errors.
Reconnects to the service.
cls | our struct GNUNET_TRANSPORT_MonitorContext * |
error | what error happened? |
Definition at line 122 of file transport_api2_monitor.c.
References disconnect(), GNUNET_ERROR_TYPE_INFO, GNUNET_log, mc, and reconnect().
Referenced by reconnect().
|
static |
Transport service sends us information about what is going on.
Check if md is well-formed.
cls | our struct GNUNET_TRANSPORT_MonitorContext * |
md | the monitor data we got |
Definition at line 144 of file transport_api2_monitor.c.
References GNUNET_MQ_check_zero_termination, and GNUNET_OK.
|
static |
Transport service sends us information about what is going on.
cls | our struct GNUNET_TRANSPORT_MonitorContext * |
md | monitor data |
Definition at line 159 of file transport_api2_monitor.c.
References GNUNET_TRANSPORT_MonitorInformation::address, GNUNET_TRANSPORT_MonitorInformation::cs, GNUNET_TRANSPORT_MonitorData::cs, GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_relative_ntoh(), GNUNET_TRANSPORT_MonitorInformation::last_validation, GNUNET_TRANSPORT_MonitorData::last_validation, mc, GNUNET_TRANSPORT_MonitorInformation::next_validation, GNUNET_TRANSPORT_MonitorData::next_validation, GNUNET_TRANSPORT_MonitorInformation::nt, GNUNET_TRANSPORT_MonitorData::nt, GNUNET_TRANSPORT_MonitorInformation::num_bytes_pending, GNUNET_TRANSPORT_MonitorData::num_bytes_pending, GNUNET_TRANSPORT_MonitorInformation::num_msg_pending, GNUNET_TRANSPORT_MonitorData::num_msg_pending, GNUNET_TRANSPORT_MonitorData::peer, GNUNET_TRANSPORT_MonitorInformation::rtt, GNUNET_TRANSPORT_MonitorData::rtt, GNUNET_TRANSPORT_MonitorInformation::valid_until, and GNUNET_TRANSPORT_MonitorData::valid_until.
|
static |
One shot was requested, and transport service is done.
cls | our struct GNUNET_TRANSPORT_MonitorContext * |
me | end message |
Definition at line 184 of file transport_api2_monitor.c.
References disconnect(), GNUNET_break, GNUNET_TRANSPORT_monitor_cancel(), GNUNET_YES, mc, and reconnect().