#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... | |
| struct | GNUNET_TRANSPORT_LinkListContext |
| Opaque handle for a GNUNET_TRANSPORT_links_list() operation. More... | |
Functions | |
| static void | reconnect (struct GNUNET_TRANSPORT_MonitorContext *mc) |
| (re)connect our monitor to the transport service | |
| static void | send_start_monitor (struct GNUNET_TRANSPORT_MonitorContext *mc) |
| Send message to the transport service about our monitoring desire. | |
| static void | disconnect (struct GNUNET_TRANSPORT_MonitorContext *mc) |
| Disconnect from the transport service. | |
| static void | error_handler (void *cls, enum GNUNET_MQ_Error error) |
| Function called on MQ errors. | |
| static int | check_monitor_data (void *cls, const struct GNUNET_TRANSPORT_MonitorData *md) |
| Transport service sends us information about what is going on. | |
| static void | handle_monitor_data (void *cls, const struct GNUNET_TRANSPORT_MonitorData *md) |
| Transport service sends us information about what is going on. | |
| static void | handle_monitor_end (void *cls, const struct GNUNET_MessageHeader *me) |
| One shot was requested, and transport service is done. | |
| 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. | |
| void | GNUNET_TRANSPORT_monitor_cancel (struct GNUNET_TRANSPORT_MonitorContext *mc) |
| Cancel request to monitor peers. | |
| static void | link_list_done (struct GNUNET_TRANSPORT_LinkListContext *llc) |
| Tell the caller we are done and tear the operation down. | |
| static void | link_list_error_handler (void *cls, enum GNUNET_MQ_Error error) |
| Function called on MQ errors. | |
| static enum GNUNET_GenericReturnValue | check_link_list_response (void *cls, const struct GNUNET_TRANSPORT_LinkListResponse *resp) |
| Validate a link listing response. | |
| static void | handle_link_list_response (void *cls, const struct GNUNET_TRANSPORT_LinkListResponse *resp) |
| Handle a link listing response. | |
| static void | handle_link_list_response_end (void *cls, const struct GNUNET_MessageHeader *msg) |
| Handle the end of a link listing. | |
| struct GNUNET_TRANSPORT_LinkListContext * | GNUNET_TRANSPORT_links_list (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_PeerIdentity *peer, int include_unconfirmed, GNUNET_TRANSPORT_LinkCallback cb, void *cb_cls) |
| Ask the transport service for the virtual links it currently has. | |
| void | GNUNET_TRANSPORT_links_list_cancel (struct GNUNET_TRANSPORT_LinkListContext *llc) |
| Cancel a request to list virtual links. | |
|
static |
(re)connect our monitor to the transport service
| mc | handle to reconnect |
Definition at line 206 of file transport_api_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().
|
static |
Send message to the transport service about our monitoring desire.
| ai | address to delete |
Definition at line 86 of file transport_api_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_api_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_api_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_api_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_api_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_api_monitor.c.
References disconnect(), GNUNET_break, GNUNET_TRANSPORT_monitor_cancel(), GNUNET_YES, mc, and reconnect().
|
static |
Tell the caller we are done and tear the operation down.
| llc | operation that finished |
Definition at line 323 of file transport_api_monitor.c.
References GNUNET_TRANSPORT_LinkListContext::cb, GNUNET_TRANSPORT_LinkListContext::cb_cls, GNUNET_TRANSPORT_links_list_cancel(), and llc.
Referenced by handle_link_list_response_end(), and link_list_error_handler().
|
static |
Function called on MQ errors.
There is nothing to retry – this is a one-shot request – so report the end of the listing.
| cls | our struct GNUNET_TRANSPORT_LinkListContext * |
| error | what error happened? |
Definition at line 341 of file transport_api_monitor.c.
References GNUNET_ERROR_TYPE_WARNING, GNUNET_log, link_list_done(), and llc.
Referenced by GNUNET_TRANSPORT_links_list().
|
static |
Validate a link listing response.
| cls | our struct GNUNET_TRANSPORT_LinkListContext * |
| resp | the response to check |
Definition at line 360 of file transport_api_monitor.c.
References GNUNET_break, GNUNET_OK, GNUNET_SYSERR, GNUNET_TRANSPORT_LinkListResponse::header, and GNUNET_MessageHeader::size.
|
static |
Handle a link listing response.
| cls | our struct GNUNET_TRANSPORT_LinkListContext * |
| resp | the response |
Definition at line 384 of file transport_api_monitor.c.
References GNUNET_TRANSPORT_LinkInformation::available_fc_window_size, GNUNET_TRANSPORT_LinkListResponse::available_fc_window_size, GNUNET_TRANSPORT_LinkListContext::cb, GNUNET_TRANSPORT_LinkListContext::cb_cls, GNUNET_TRANSPORT_LinkInformation::communicators, GNUNET_TRANSPORT_LinkInformation::confirmed, GNUNET_TRANSPORT_LinkListResponse::confirmed, GNUNET_TRANSPORT_LinkInformation::core_recv_window, GNUNET_TRANSPORT_LinkListResponse::core_recv_window, GNUNET_TRANSPORT_LinkInformation::distance, GNUNET_TRANSPORT_LinkListResponse::distance, GNUNET_TRANSPORT_LinkInformation::fc_retransmit_count, GNUNET_TRANSPORT_LinkListResponse::fc_retransmit_count, GNUNET_ntohll(), GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_relative_ntoh(), GNUNET_TRANSPORT_LinkInformation::incoming_fc_window_size, GNUNET_TRANSPORT_LinkListResponse::incoming_fc_window_size, GNUNET_TRANSPORT_LinkInformation::incoming_fc_window_size_loss, GNUNET_TRANSPORT_LinkListResponse::incoming_fc_window_size_loss, GNUNET_TRANSPORT_LinkInformation::incoming_fc_window_size_ram, GNUNET_TRANSPORT_LinkListResponse::incoming_fc_window_size_ram, GNUNET_TRANSPORT_LinkInformation::incoming_fc_window_size_used, GNUNET_TRANSPORT_LinkListResponse::incoming_fc_window_size_used, GNUNET_TRANSPORT_LinkInformation::last_fc_rtt, GNUNET_TRANSPORT_LinkListResponse::last_fc_rtt, GNUNET_TRANSPORT_LinkInformation::last_fc_transmission, GNUNET_TRANSPORT_LinkListResponse::last_fc_transmission, llc, GNUNET_TRANSPORT_LinkInformation::num_queues, GNUNET_TRANSPORT_LinkListResponse::num_queues, GNUNET_TRANSPORT_LinkInformation::other_rtt, GNUNET_TRANSPORT_LinkListResponse::other_rtt, GNUNET_TRANSPORT_LinkInformation::outbound_fc_window_size, GNUNET_TRANSPORT_LinkListResponse::outbound_fc_window_size, GNUNET_TRANSPORT_LinkInformation::outbound_fc_window_size_used, GNUNET_TRANSPORT_LinkListResponse::outbound_fc_window_size_used, GNUNET_TRANSPORT_LinkInformation::pending, GNUNET_TRANSPORT_LinkListResponse::pending, GNUNET_TRANSPORT_LinkInformation::route, GNUNET_TRANSPORT_LinkListResponse::route, GNUNET_TRANSPORT_LinkInformation::stalled, GNUNET_TRANSPORT_LinkListResponse::stalled, and GNUNET_TRANSPORT_LinkListResponse::target.
|
static |
Handle the end of a link listing.
| cls | our struct GNUNET_TRANSPORT_LinkListContext * |
| msg | the end message |
Definition at line 427 of file transport_api_monitor.c.
References link_list_done(), llc, and msg.