94 smm->
one_shot = htonl ((uint32_t)
mc->one_shot);
127 "MQ failure %d, reconnecting to transport service.\n",
164 mi.
address = (
const char *) &md[1];
165 mi.
nt = ntohl (md->
nt);
166 mi.
cs = ntohl (md->
cs);
173 mc->cb (
mc->cb_cls, &md->
peer, &mi);
195 mc->cb (
mc->cb_cls, NULL, NULL);
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MQ_Envelope * env
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static GNUNET_NETWORK_STRUCT_END struct GNUNET_PeerIdentity me
Our own peer identity.
static struct GNUNET_TESTBED_Controller * mc
Handle to the master controller.
Constants for network protocols.
Monitoring / diagnostics API for the transport service.
void(* GNUNET_TRANSPORT_MonitorCallback)(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_TRANSPORT_MonitorInformation *mi)
Function to call with information about a peer.
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...
void GNUNET_TRANSPORT_monitor_cancel(struct GNUNET_TRANSPORT_MonitorContext *mc)
Cancel request to monitor peers.
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
#define GNUNET_log(kind,...)
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_MQ_Error
Error codes for the queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_check_zero_termination(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_DATA
Message sent to indicate to a monitor about events.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_START
Message sent to indicate to the transport that a monitor wants to observe certain events.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_END
Message sent to indicate to a monitor that a one-shot iteration over events is done.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a)
Convert relative time from network byte order.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
Handle to a message queue.
Message handler for a specific message type.
The identity of the host (wraps the signing key of the peer).
Opaque handle to the transport service for monitors.
GNUNET_TRANSPORT_MonitorCallback cb
Function to call with monitor data.
struct GNUNET_MQ_Handle * mq
Queue to talk to the transport service.
void * cb_cls
Closure for cb.
int one_shot
GNUNET_YES to return the current state and then end.
struct GNUNET_PeerIdentity peer
Peer we monitor, all zeros for "all".
const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
uint32_t num_msg_pending
Messages pending (in NBO).
struct GNUNET_PeerIdentity peer
Target identifier.
struct GNUNET_TIME_AbsoluteNBO valid_until
struct GNUNET_TIME_AbsoluteNBO last_validation
uint32_t num_bytes_pending
Bytes pending (in NBO).
struct GNUNET_TIME_AbsoluteNBO next_validation
uint32_t nt
Network type (an enum GNUNET_NetworkType in NBO).
struct GNUNET_TIME_RelativeNBO rtt
Current round-trip time estimate.
uint32_t cs
Connection status (in NBO).
Request to start monitoring.
uint32_t one_shot
GNUNET_YES for one-shot montoring, GNUNET_NO for continuous monitoring.
struct GNUNET_PeerIdentity peer
Target identifier to monitor, all zeros for "all peers".
common internal definitions for transport service
static void disconnect(struct GNUNET_TRANSPORT_MonitorContext *mc)
Disconnect from the transport service.
static void reconnect(struct GNUNET_TRANSPORT_MonitorContext *mc)
(re)connect our monitor to the transport service
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 error_handler(void *cls, enum GNUNET_MQ_Error error)
Function called on MQ errors.
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.
static void send_start_monitor(struct GNUNET_TRANSPORT_MonitorContext *mc)
Send message to the transport service about our montoring desire.