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);
329 cb (cb_cls, NULL, NULL);
346 "Transport service disconnected while listing links (%d)\n",
364 const char *ccs = (
const char *) &resp[1];
365 uint16_t slen = ntohs (resp->
header.
size) -
sizeof (*resp);
368 if ((0 == slen) || (
'\0' != ccs[slen - 1]))
391 memset (&li, 0,
sizeof (li));
452 link_list_response_end,
struct GNUNET_MQ_MessageHandlers handlers[]
struct GNUNET_MessageHeader * msg
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.
static struct GNUNET_TRANSPORT_LinkListContext * llc
Handle to the running listing, NULL once it completed.
static int include_unconfirmed
Option -a: also show links that are not established yet.
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.
void(* GNUNET_TRANSPORT_LinkCallback)(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_TRANSPORT_LinkInformation *li)
Function called once per virtual link, and a final time with peer and li both NULL to signal the end ...
void GNUNET_TRANSPORT_links_list_cancel(struct GNUNET_TRANSPORT_LinkListContext *llc)
Cancel a request to list virtual links.
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...
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_monitor_cancel(struct GNUNET_TRANSPORT_MonitorContext *mc)
Cancel request to monitor peers.
GNUNET_TRANSPORT_LinkRoute
How is a virtual link routed?
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,...)
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
GNUNET_GenericReturnValue
Named constants for return values.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_WARNING
#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_LINK_LIST_RESPONSE
Information about a single virtual link, in response to a GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_REQ...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_DATA
Message sent to indicate to a monitor about events.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_REQUEST
Request a one-shot listing of the virtual links transport currently has, with their flow control stat...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_RESPONSE_END
End of the responses to a GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_REQUEST.
#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.
static void reconnect(void)
Adjust exponential back-off and reconnect to the service.
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 for a GNUNET_TRANSPORT_links_list() operation.
GNUNET_TRANSPORT_LinkCallback cb
Function to call with each link, and once with NULL at the end.
struct GNUNET_MQ_Handle * mq
Queue to talk to the transport service.
void * cb_cls
Closure for cb.
Request a one-shot listing of our virtual links.
struct GNUNET_PeerIdentity peer
Link to report on, all zeros for "all links".
uint32_t include_unconfirmed
GNUNET_YES to also report links that are not confirmed.
State of one virtual link.
uint32_t stalled
Number of messages whose flow control ACK we are withholding because core_recv_window is exhausted.
struct GNUNET_TIME_AbsoluteNBO last_fc_transmission
When did we last send a flow control message?
uint32_t fc_retransmit_count
Number of flow control retransmissions of the running task.
uint32_t num_queues
Number of queues to the neighbour, 0 if route is GNUNET_TRANSPORT_LINK_ROUTE_DV.
uint64_t incoming_fc_window_size_ram
RAM currently held for this link.
uint64_t incoming_fc_window_size_used
How much of incoming_fc_window_size the other peer used.
uint32_t pending
Number of messages queued for transmission to target.
int64_t incoming_fc_window_size_loss
Current estimate of the message loss rate for the sender.
struct GNUNET_TIME_RelativeNBO other_rtt
RTT over all DV paths, as calculated by the target.
uint64_t outbound_fc_window_size
Window the other peer granted us.
uint64_t outbound_fc_window_size_used
How much of outbound_fc_window_size we used.
uint64_t incoming_fc_window_size
Window we last granted the other peer.
uint32_t route
An ‘enum GNUNET_TRANSPORT_LinkRoute’ in NBO.
uint32_t distance
Distance of the DV path, 0 if route is GNUNET_TRANSPORT_LINK_ROUTE_DIRECT.
struct GNUNET_PeerIdentity target
Peer at the other end of the link.
struct GNUNET_TIME_RelativeNBO last_fc_rtt
RTT of the last flow control exchange.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_LINK_LIST_RESPONSE.
uint32_t confirmed
GNUNET_YES if the link is confirmed, i.e.
int32_t core_recv_window
How many more messages we may hand to CORE before it must acknowledge them.
uint64_t available_fc_window_size
RAM we are willing to spend on this link.
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 monitoring, 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 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_link_list_response_end(void *cls, const struct GNUNET_MessageHeader *msg)
Handle the end of a link listing.
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 link_list_error_handler(void *cls, enum GNUNET_MQ_Error error)
Function called on MQ errors.
static void handle_link_list_response(void *cls, const struct GNUNET_TRANSPORT_LinkListResponse *resp)
Handle a link listing response.
static void handle_monitor_end(void *cls, const struct GNUNET_MessageHeader *me)
One shot was requested, and transport service is done.
static void link_list_done(struct GNUNET_TRANSPORT_LinkListContext *llc)
Tell the caller we are done and tear the operation down.
static enum GNUNET_GenericReturnValue check_link_list_response(void *cls, const struct GNUNET_TRANSPORT_LinkListResponse *resp)
Validate a link listing response.
static void send_start_monitor(struct GNUNET_TRANSPORT_MonitorContext *mc)
Send message to the transport service about our monitoring desire.