42 #define IGNORE_INBOUND_QUOTA GNUNET_YES
47 #define NEIGHBOUR_TABLE_SIZE 256
53 #define DISCONNECT_SENT_TIMEOUT GNUNET_TIME_relative_multiply ( \
54 GNUNET_TIME_UNIT_MILLISECONDS, 500)
60 #define QUOTA_VIOLATION_DROP_THRESHOLD 10
65 #define ATS_RESPONSE_TIMEOUT GNUNET_TIME_relative_multiply ( \
66 GNUNET_TIME_UNIT_SECONDS, 5)
72 #define SETUP_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply ( \
73 GNUNET_TIME_UNIT_SECONDS, 15)
81 #define FAST_RECONNECT_TIMEOUT GNUNET_TIME_UNIT_SECONDS
86 #define UTIL_TRANSMISSION_INTERVAL GNUNET_TIME_UNIT_SECONDS
505 return "SEND_SYN_ACK";
532 #if IGNORE_INBOUND_QUOTA
540 "Sending outbound quota of %u Bps for peer `%s' to all clients\n",
545 q_msg.
quota = bandwidth_min;
565 #if IGNORE_INBOUND_QUOTA
572 "We are now connected to peer `%s'\n",
576 connect_msg->
id = n->
id;
593 "Peer `%s' disconnected\n",
622 (void) bandwidth_out;
624 "Notifying about change for peer `%s' with address `%s' in state `%s' timing out at %s\n",
748 "Neighbour `%s' changed state to %s with timeout %s\n",
795 "Replacing existing alternative address with another one\n");
804 "Failed to obtain new session for peer `%s' and address '%s'\n",
816 "Neighbour `%s' configured alternative address %s\n",
854 unsigned
int use_keepalive_timeout,
863 n->primary_address.address->transport_name))) ||
865 n->primary_address.session,
874 query_keepalive_factor (papi->
cls))),
884 n->primary_address.session,
904 "Disabling primary address\n");
926 "Freeing neighbour state of peer `%s'\n",
936 if (NULL !=
mq->cont)
937 mq->cont (
mq->cont_cls,
939 mq->message_buf_size,
953 "Cleaning up alternative address\n");
1014 if (NULL != n->
task)
1031 "Sending DISCONNECT message to peer `%4s'\n",
1033 disconnect_msg.
header.
size = htons (
sizeof(
struct
1037 disconnect_msg.
reserved = htonl (0);
1054 sizeof(disconnect_msg),
1076 "Disconnecting from peer %s in state %s\n",
1137 "Unhandled state `%s'\n",
1143 if (NULL != n->
task)
1166 "Setting inbound quota of %u Bps for peer `%s' to all clients\n",
1170 if (0 != ntohl (
quota.value__))
1188 "Disconnecting peer `%s' due to SET_QUOTA\n",
1243 if (NULL == session)
1253 "Replacing existing primary address with another one\n");
1273 "Neighbour `%s' switched to address `%s'\n",
1299 size_t size_payload,
1307 if (NULL !=
mq->cont)
1308 mq->cont (
mq->cont_cls,
1320 if (NULL != n->
task)
1325 if (bytes_in_send_queue < mq->message_buf_size)
1328 "Bytes_in_send_queue `%llu', Message_size %u, result: %s, payload %u, on wire %u\n",
1330 (
unsigned int)
mq->message_buf_size,
1332 (
unsigned int) size_payload,
1333 (
unsigned int) physical);
1341 "# bytes in message queue for other peers"),
1347 "# messages transmitted to other peers"),
1354 "# transmission failures for messages to other peers"),
1357 "Sending message to `%s' of type %u with %u bytes was a %s\n",
1360 (
unsigned int)
mq->message_buf_size,
1361 (success ==
GNUNET_OK) ?
"success" :
"FAILURE");
1362 if (NULL !=
mq->cont)
1363 mq->cont (
mq->cont_cls,
1415 "# messages timed out while in transport queue"),
1425 mq->message_buf_size,
1444 "Giving message with %u bytes to plugin session %p\n",
1445 (
unsigned int)
mq->message_buf_size,
1449 mq->message_buf_size,
1484 "Sending KEEPALIVE to peer `%s' with nonce %u\n",
1489 m.nonce = htonl (nonce);
1535 (
"# KEEPALIVE messages discarded (peer unknown)"),
1543 (
"# KEEPALIVE messages discarded (no session)"),
1549 "Received KEEPALIVE request from peer `%s' with nonce %u\n",
1551 ntohl (msg_in->
nonce));
1554 "# KEEPALIVES received in good order"),
1601 "# KEEPALIVE_RESPONSEs discarded (not connected)"),
1611 "# KEEPALIVE_RESPONSEs discarded (not expected)"),
1620 "# KEEPALIVE_RESPONSEs discarded (address changed)"),
1630 "# KEEPALIVE_RESPONSEs discarded (no nonce)"),
1636 "# KEEPALIVE_RESPONSEs discarded (bad nonce)"),
1643 "# KEEPALIVE_RESPONSEs received (OK)"),
1653 "Updating session for peer `%s' for session %p\n",
1674 "Received KEEPALIVE_RESPONSE from peer `%s', latency is %s\n",
1714 "# messages discarded due to lack of neighbour record"),
1729 "Bandwidth quota (%u b/s) violation detected (total of %u).\n",
1748 (
"# bandwidth quota violations by other peers"),
1755 if (
ret.rel_value_us > 0)
1758 "Throttling read (%lld bytes excess at %u b/s), waiting %s before reading more.\n",
1764 (int64_t)
ret.rel_value_us / 1000LL,
1807 (
"# bytes in message queue for other peers"),
1813 mq->message_buf = (
const char *) &
mq[1];
1814 mq->message_buf_size = msg_size;
1818 "Enqueueing %u bytes to send to peer %s\n",
1819 (
unsigned int) msg_size,
1824 if (NULL != n->
task)
1846 size_t size_payload,
1847 size_t size_on_wire)
1852 (void) size_payload;
1853 (void) size_on_wire;
1876 _ (
"Failed to send SYN message to peer `%s'\n"),
1902 "# Failed attempts to switch addresses (failed to send SYN CONT)"),
1906 "Switch failed, cleaning up alternative address\n");
1935 "Sending SYN message to peer `%s' at %s\n",
1943 (
"# SYN messages sent"),
1953 (
const char *) &connect_msg,
1960 _ (
"Failed to transmit SYN message to %s\n"),
1996 "# Failed attempts to switch addresses (failed to send SYN)"),
2001 "Switch failed, cleaning up alternative address\n");
2038 size_t size_payload,
2039 size_t size_on_wire)
2044 (void) size_payload;
2045 (void) size_on_wire;
2067 "Failed to send SYN_ACK message to peer `%s' using address `%s'\n"),
2102 "Sending SYN_ACK to peer `%s'\n",
2110 if (NULL == session)
2113 if (NULL == session)
2122 (
"# SYN_ACK messages sent"),
2133 (
const char *) &connect_msg,
2140 _ (
"Failed to transmit SYN_ACK message to %s\n"),
2187 "New inbound delay for peer `%s' is %llu ms\n",
2216 "Cowardly refusing to consider myself my neighbour!\n");
2220 "Creating new neighbour entry for `%s'\n",
2304 (
"# SYN messages received"),
2310 "SYN request from peer `%s' ignored due impending shutdown\n"),
2338 "Received SYN for peer `%s' in state %s/%s\n",
2428 "Unhandled state `%s'\n",
2532 "Blacklist denied to switch to suggested address `%s' session %p for peer `%s'\n",
2537 "# ATS suggestions ignored (blacklist denied)",
2540 if (NULL != session)
2552 if (NULL == session)
2558 "Obtained new session for peer `%s' and address '%s': %p\n",
2562 if (NULL != session)
2566 if (NULL == session)
2570 "# ATS suggestions ignored (failed to create session)",
2575 "Failed to obtain new session for peer `%s' and address '%s'\n",
2607 "Peer `%s' switches to address `%s'\n",
2769 "ATS double-switched, cleaning up alternative address\n");
2792 "# ATS suggestion ignored (disconnecting)",
2803 "Unhandled state `%s'\n",
2861 if ((NULL == session) &&
2873 "ATS suggests address '%s' for peer `%s' at %u/%u speed\n",
2932 "`%s' total: received %u Bytes/s, sent %u Bytes/s\n",
3021 "Master task runs for neighbour `%s' in state %s with timeout in %s\n",
3038 "Connection to `%s' timed out waiting for ATS to provide address\n",
3049 "Connection to `%s' timed out waiting for other peer to send SYN_ACK\n",
3065 "Connection to `%s' timed out waiting ATS to provide address to use for SYN_ACK\n",
3076 "Connection to `%s' timed out waiting for other peer to send ACK\n",
3087 "Connection to `%s' timed out, missing KEEPALIVE_RESPONSEs\n",
3100 "Connection to `%s' timed out, waiting for ATS replacement address\n",
3111 "Connection to `%s' timed out, waiting for other peer to SYN_ACK replacement address\n",
3122 "Switch failed, cleaning up alternative address\n");
3135 "Cleaning up connection to `%s' after sending DISCONNECT\n",
3147 "Unhandled state `%s'\n",
3163 if (NULL == n->
task)
3182 "Sending ACK message to peer `%s'\n",
3227 (
"# SYN_ACK messages received"),
3235 (
"# unexpected SYN_ACK messages (no peer)"),
3240 "Received SYN_ACK message from peer `%s' in state %s/%s\n",
3255 "# unexpected SYN_ACK messages (not ready)"),
3264 "SYN_ACK ignored as the timestamp does not match our SYN request\n");
3283 "# unexpected SYN_ACK messages (not ready)"),
3298 "# unexpected SYN_ACK messages (waiting on ATS)"),
3328 "# Successful attempts to switch addresses"),
3342 (
"# unexpected SYN_ACK messages (disconnecting)"),
3352 "Unhandled state `%s'\n",
3388 "Session died, cleaning up alternative address\n");
3412 "Failed to send SYN in CONNECT_SENT with `%s' %p: session terminated\n",
3446 "Failed to send SYN in RECONNECT_SENT with `%s' %p: session terminated\n",
3462 "Connection `%s' %p to peer `%s' was terminated while switching, "
3463 "switching to alternative address `%s' %p\n",
3495 "Unhandled state `%s'\n",
3500 if (NULL != n->
task)
3540 "Received ACK for peer `%s' in state %s/%s\n",
3559 "Received unexpected ACK message from peer `%s' in state %s/%s\n",
3626 "Disconnecting by request from peer %s\n",
3641 "Received QUOTA message from peer `%s'\n",
3648 "# quota messages ignored (malformed)"),
3655 (
"# QUOTA messages received"),
3691 "Received DISCONNECT message from peer `%s'\n",
3698 (
"# disconnect messages ignored (malformed)"),
3705 (
"# DISCONNECT messages received"),
3718 "# disconnect messages ignored (timestamp)"),
3723 if (0 != memcmp (
peer,
3736 "DISCONNECT message from peer `%s' has invalid size\n",
3749 "DISCONNECT message from peer `%s' cannot be verified \n",
3813 bandwidth_in, bandwidth_out);
3855 "# disconnected from peer upon explicit request"),
3859 "Forced disconnect from peer %s\n",
3919 "Disconnecting peer `%4s' during shutdown\n",
struct GNUNET_MQ_Handle * mq
struct GNUNET_MessageHeader * msg
#define gettext_noop(String)
static int ret
Return value of the commandline.
static struct GNUNET_TIME_Relative timeout
Desired timeout for the lookup (default is no timeout).
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
static char * address
GNS address for this phone.
static void cleanup(void *cls)
Function scheduled as very last function, cleans up after us.
struct GNUNET_HashCode key
The key used in the DHT.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
static char * value
Value of the record to add/remove.
enum State state
current state of profiling
static int result
Global testing status.
static struct GNUNET_TIME_Relative delay
When should dkg communication start?
#define MAX_BANDWIDTH_CARRY_S
Number of seconds that available bandwidth carries over (can accumulate).
static unsigned long long payload
How much data are we currently storing in the database?
static unsigned long long quota
How much space are we allowed to use?
static struct GNUNET_PeerIdentity GST_my_identity
Our public key.
static struct GNUNET_CRYPTO_EddsaPrivateKey * GST_my_private_key
Our private key.
static struct GNUNET_STATISTICS_Handle * GST_stats
Statistics handle.
struct GNUNET_ATS_ConnectivityHandle * GST_ats_connect
ATS connectivity handle.
struct GST_BlacklistCheck * GST_blacklist_test_allowed(const struct GNUNET_PeerIdentity *peer, const char *transport_name, GST_BlacklistTestContinuation cont, void *cont_cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Test if a peer/transport combination is blacklisted.
void GST_clients_broadcast(const struct GNUNET_MessageHeader *msg, int may_drop)
Broadcast the given message to all of our clients.
void GST_clients_broadcast_disconnect(const struct GNUNET_PeerIdentity *peer)
Notify all clients about a disconnect, and cancel pending SEND_OK messages for this peer.
void GST_clients_broadcast_peer_notification(const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, enum GNUNET_TRANSPORT_PeerState state, struct GNUNET_TIME_Absolute state_timeout)
Broadcast the new active address to all clients monitoring the peer.
void GST_ats_block_address(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Temporarily block a valid address for use by ATS for address suggestions.
int GST_ats_is_known(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Test if ATS knows about this address and session.
void GST_ats_new_session(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Notify ATS about a new session now existing for the given address.
void GST_ats_block_reset(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Reset address blocking time.
void GST_ats_update_delay(const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Relative delay)
Notify ATS about delay changes to properties of an address.
void GST_ats_update_utilization(const struct GNUNET_HELLO_Address *address, uint32_t bps_in, uint32_t bps_out)
Notify ATS about utilization changes to an address.
interfacing between transport and ATS service
void GST_manipulation_peer_disconnect(const struct GNUNET_PeerIdentity *peer)
Notify manipulation about disconnect so it can discard queued messages.
static void master_task(void *cls)
Master task run for every neighbour.
#define NEIGHBOUR_TABLE_SIZE
Size of the neighbour hash map.
static void transmit_send_continuation(void *cls, const struct GNUNET_PeerIdentity *receiver, int success, size_t size_payload, size_t physical)
We're done with our transmission attempt, continue processing.
static void unset_primary_address(struct NeighbourMapEntry *n)
Clear the primary address of a neighbour since this address is not valid anymore and notify monitorin...
void GST_neighbours_switch_to_address(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
For the given peer, switch to this address.
#define SETUP_CONNECTION_TIMEOUT
How long are we willing to wait for an ACK from the other peer before giving up on our connect operat...
static void utilization_transmission(void *cls)
Task transmitting utilization in a regular interval.
static void neighbours_connect_notification(struct NeighbourMapEntry *n)
Notify our clients that another peer connected to us.
void GST_neighbours_notify_data_recv(const struct GNUNET_HELLO_Address *address, const struct GNUNET_MessageHeader *message)
Track information about data we received from the given address (used to notify ATS about our utiliza...
void GST_neighbours_keepalive_response(const struct GNUNET_PeerIdentity *neighbour, const struct GNUNET_MessageHeader *m)
We received a KEEP_ALIVE_RESPONSE message and use this to calculate latency to this peer.
const struct GNUNET_HELLO_Address * GST_neighbour_get_current_address(const struct GNUNET_PeerIdentity *peer)
Obtain current address information for the given neighbour.
static void send_syn(struct NeighbourAddress *na)
Send a SYN message via the given address.
void GST_neighbours_handle_disconnect_message(const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *msg)
We received a disconnect message from the given peer, validate and process.
static void send_disconnect(struct NeighbourMapEntry *n)
Transmit a DISCONNECT message to the other peer.
int GST_neighbours_handle_session_syn(const struct GNUNET_MessageHeader *message, const struct GNUNET_PeerIdentity *peer)
We received a 'SYN' message from the other peer.
static void neighbours_changed_notification(const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, enum GNUNET_TRANSPORT_PeerState state, struct GNUNET_TIME_Absolute state_timeout, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
Notify transport clients that a neighbour peer changed its active address.
static void try_transmission_to_peer(struct NeighbourMapEntry *n)
Check the message list for the given neighbour and if we can send a message, do so.
static void send_session_syn_ack_cont(void *cls, const struct GNUNET_PeerIdentity *target, int result, size_t size_payload, size_t size_on_wire)
Continuation called from our attempt to transmitted our GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_SYN_ACK...
static void delayed_disconnect(void *cls)
Task to asynchronously run free_neighbour().
static int test_connected(struct NeighbourMapEntry *n)
Test if we're connected to the given peer.
static unsigned int neighbours_connected
counter for connected neighbours
static void set_state_and_timeout(struct NeighbourMapEntry *n, enum GNUNET_TRANSPORT_PeerState s, struct GNUNET_TIME_Absolute timeout)
Set net state and state timeout for this neighbour and notify monitoring.
static void send_session_syn_cont(void *cls, const struct GNUNET_PeerIdentity *target, int result, size_t size_payload, size_t size_on_wire)
Continuation called from our attempt to transmitted our GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_SYN to ...
struct GNUNET_TIME_Relative GST_neighbours_calculate_receive_delay(const struct GNUNET_PeerIdentity *sender, ssize_t size, int *do_forward)
We have received a message from the given sender.
static void send_outbound_quota_to_clients(struct NeighbourMapEntry *n)
Send information about a new outbound quota to our clients.
static void send_disconnect_cont(void *cls, const struct GNUNET_PeerIdentity *target, int result, size_t payload, size_t physical)
Function called when the 'DISCONNECT' message has been sent by the plugin.
int GST_neighbours_handle_session_ack(const struct GNUNET_MessageHeader *message, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
We received a 'ACK' message from the other peer.
int GST_neighbours_handle_session_syn_ack(const struct GNUNET_MessageHeader *message, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
We received a 'SESSION_SYN_ACK' message from the other peer.
static struct BlacklistCheckSwitchContext * pending_bc_head
List of pending blacklist checks: head.
int GST_neighbours_session_terminated(const struct GNUNET_PeerIdentity *peer, struct GNUNET_ATS_Session *session)
A session was terminated.
static struct BlacklistCheckSwitchContext * pending_bc_tail
List of pending blacklist checks: tail.
void GST_neighbours_keepalive(const struct GNUNET_PeerIdentity *neighbour, const struct GNUNET_MessageHeader *m)
Keep the connection to the given neighbour alive longer, we received a KEEPALIVE (or equivalent); sen...
static struct GNUNET_TIME_Relative send_with_session(struct NeighbourMapEntry *n, const void *msgbuf, size_t msgbuf_size, uint32_t priority, struct GNUNET_TIME_Relative timeout, unsigned int use_keepalive_timeout, GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls)
Transmit a message using the current session of the given neighbour.
static void send_session_ack_message(struct NeighbourMapEntry *n)
Send a ACK message to the neighbour to confirm that we got its SYN_ACK.
static void send_syn_ack_message(struct NeighbourAddress *na, struct GNUNET_TIME_Absolute timestamp)
Send a SYN_ACK message via the given address.
static void free_address(struct NeighbourAddress *na)
We don't need a given neighbour address any more.
#define ATS_RESPONSE_TIMEOUT
How long are we willing to wait for a response from ATS before timing out?
static int send_utilization_data(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Function called to send network utilization data to ATS for each active connection.
static int disconnect_all_neighbours(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Disconnect from the given neighbour.
static struct GNUNET_CONTAINER_MultiPeerMap * neighbours
Hash map from peer identities to the respective struct NeighbourMapEntry.
void GST_neighbours_force_disconnect(const struct GNUNET_PeerIdentity *target)
If we have an active connection to the given target, it must be shutdown.
static void switch_address_bl_check_cont(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, int result)
We've been asked to switch addresses, and just now got the result from the blacklist check to see if ...
static void set_alternative_address(struct NeighbourMapEntry *n, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
Initialize the alternative address of a neighbour.
static int try_run_fast_ats_update(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
Check if the given address is the same that we are already using for the respective neighbour.
void GST_neighbours_send(const struct GNUNET_PeerIdentity *target, const void *msg, size_t msg_size, struct GNUNET_TIME_Relative timeout, GST_NeighbourSendContinuation cont, void *cont_cls)
Transmit a message to the given target using the active connection.
#define QUOTA_VIOLATION_DROP_THRESHOLD
How often must a peer violate bandwidth quotas before we start to simply drop its messages?
static struct NeighbourMapEntry * setup_neighbour(const struct GNUNET_PeerIdentity *peer)
Create a fresh entry in the neighbour map for the given peer.
static void set_primary_address(struct NeighbourMapEntry *n, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
Initialize the primary address of a neighbour.
static void neighbours_disconnect_notification(struct NeighbourMapEntry *n)
Notify our clients (and manipulation) that a peer disconnected from us.
static void disconnect_neighbour(struct NeighbourMapEntry *n)
Disconnect from the given neighbour, clean up the record.
#define DISCONNECT_SENT_TIMEOUT
Time we give plugin to transmit DISCONNECT message before the neighbour entry self-destructs.
static void inbound_bw_tracker_update(void *cls)
Function called by the bandwidth tracker for a peer whenever the tracker's state changed such that we...
void GST_neighbours_stop()
Cleanup the neighbours subsystem.
static void free_neighbour(struct NeighbourMapEntry *n)
Free a neighbour map entry.
GST_ACK_State
State describing which kind a reply this neighbour should send.
@ ACK_SEND_SYN_ACK
The neighbour received a SYN message and has to send a SYN_ACK as reply.
@ ACK_SEND_ACK
The neighbour sent a SYN_ACK message and has to send a ACK as reply.
@ ACK_UNDEFINED
We did not receive a SYN message for this neighbour.
static struct NeighbourMapEntry * lookup_neighbour(const struct GNUNET_PeerIdentity *pid)
Lookup a neighbour entry in the neighbours hash map.
int GST_neighbours_test_connected(const struct GNUNET_PeerIdentity *target)
Test if we're connected to the given peer.
static void send_keepalive(struct NeighbourMapEntry *n)
Send keepalive message to the neighbour.
static int set_incoming_quota(struct NeighbourMapEntry *n, struct GNUNET_BANDWIDTH_Value32NBO quota)
Change the incoming quota for the given peer.
void GST_neighbours_iterate(GST_NeighbourIterator cb, void *cb_cls)
Iterate over all connected neighbours.
static char * print_ack_state(enum GST_ACK_State s)
Convert the given ACK state to a string.
#define FAST_RECONNECT_TIMEOUT
How long are we willing to wait for a successful reconnect if an existing connection went down?...
void GST_neighbours_start(unsigned int max_fds)
Initialize the neighbours subsystem.
static struct GNUNET_SCHEDULER_Task * util_transmission_tk
Task transmitting utilization data.
void GST_neighbours_notify_data_sent(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, size_t size)
Track information about data we transmitted using the given address and session (used to notify ATS a...
static unsigned long long bytes_in_send_queue
Number of bytes we have currently queued for transmission.
void GST_neighbours_handle_quota_message(const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *msg)
We received a quota message from the given peer, validate and process.
static int neighbours_iterate(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Call the callback from the closure for each neighbour.
#define UTIL_TRANSMISSION_INTERVAL
Interval to send utilization data.
neighbour manipulation API, allows manipulation of performance metrics (delay and towards ATS)
void(* GST_NeighbourSendContinuation)(void *cls, int success, size_t bytes_payload, size_t bytes_on_wire)
Function called after the transmission is done.
void(* GST_NeighbourIterator)(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, enum GNUNET_TRANSPORT_PeerState state, struct GNUNET_TIME_Absolute state_timeout, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
Function called for each neighbour.
struct GNUNET_TRANSPORT_PluginFunctions * GST_plugins_find(const char *name)
Obtain the plugin API based on a plugin name.
const char * GST_plugins_a2s(const struct GNUNET_HELLO_Address *address)
Convert a given address to a human-readable format.
void GST_validation_set_address_use(const struct GNUNET_HELLO_Address *address, int in_use)
Update if we are using an address for a connection actively right now.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
Automatic transport selection and outbound bandwidth determination.
Maintain the list of currently known hosts.
struct GNUNET_ATS_ConnectivitySuggestHandle * GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch, const struct GNUNET_PeerIdentity *peer, uint32_t strength)
We would like to receive address suggestions for a peer.
void GNUNET_ATS_connectivity_suggest_cancel(struct GNUNET_ATS_ConnectivitySuggestHandle *sh)
We no longer care about being connected to a peer.
int GNUNET_BANDWIDTH_tracker_consume(struct GNUNET_BANDWIDTH_Tracker *av, ssize_t size)
Notify the tracker that a certain number of bytes of bandwidth have been consumed.
void GNUNET_BANDWIDTH_tracker_update_quota(struct GNUNET_BANDWIDTH_Tracker *av, struct GNUNET_BANDWIDTH_Value32NBO bytes_per_second_limit)
Update quota of bandwidth tracker.
struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init(uint32_t bytes_per_second)
Create a new bandwidth value.
struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_max(struct GNUNET_BANDWIDTH_Value32NBO b1, struct GNUNET_BANDWIDTH_Value32NBO b2)
Compute the MAX of two bandwidth values.
void GNUNET_BANDWIDTH_tracker_init(struct GNUNET_BANDWIDTH_Tracker *av, GNUNET_BANDWIDTH_TrackerUpdateCallback update_cb, void *update_cb_cls, struct GNUNET_BANDWIDTH_Value32NBO bytes_per_second_limit, uint32_t max_carry_s)
Initialize bandwidth tracker.
struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min(struct GNUNET_BANDWIDTH_Value32NBO b1, struct GNUNET_BANDWIDTH_Value32NBO b2)
Compute the MIN of two bandwidth values.
struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay(struct GNUNET_BANDWIDTH_Tracker *av, size_t size)
Compute how long we should wait until consuming size bytes of bandwidth in order to stay within the g...
#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT
Bandwidth (in/out) to assume initially (before either peer has communicated any particular preference...
#define GNUNET_CONSTANTS_QUOTA_VIOLATION_TIMEOUT
How long do we delay reading more from a peer after a quota violation?
#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT
After how long do we consider a connection to a peer dead if we don't receive messages from the peer?
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_sign_(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig)
EdDSA sign a given block.
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_verify_(uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_EddsaSignature *sig, const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Verify EdDSA signature.
@ GNUNET_CRYPTO_QUALITY_NONCE
Randomness for IVs etc.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Remove the given key-value pair from the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY
There must only be one value per key; storing a value should fail if a value under the same key alrea...
#define GNUNET_HELLO_address_free(addr)
Free an address.
struct GNUNET_HELLO_Address * GNUNET_HELLO_address_copy(const struct GNUNET_HELLO_Address *address)
Copy an address struct.
int GNUNET_HELLO_address_check_option(const struct GNUNET_HELLO_Address *address, enum GNUNET_HELLO_AddressInfo option)
Check if an address has a local option set.
int GNUNET_HELLO_address_cmp(const struct GNUNET_HELLO_Address *a1, const struct GNUNET_HELLO_Address *a2)
Compare two addresses.
@ GNUNET_HELLO_ADDRESS_INFO_INBOUND
This is an inbound address and cannot be used to initiate an outbound connection to another peer.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_log(kind,...)
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_ALIGN
gcc-ism to force alignment; we use this to align char-arrays that may then be cast to 'struct's.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_PACKED
gcc-ism to get packed structs.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#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
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT
Message from TRANSPORT notifying about a client that connected to us.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_QUOTA
Message exchanged between transport services to indicate that the sender should limit its transmissio...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE
Message send by a peer to notify the other to keep the session alive and measure latency in a regular...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE_RESPONSE
Response to a GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE message to measure latency in a regular...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_ACK
Transport ACK message exchanged between transport services to indicate that a SYN_ACK message was acc...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT
Transport DISCONNECT message exchanged between transport services to indicate that a connection shoul...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_SYN
Transport SYN message exchanged between transport services to indicate that a session should be marke...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_SYN_ACK
Transport SYN_ACK message exchanged between transport services to indicate that a SYN message was acc...
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA
Message telling transport to limit its receive rate.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_at(struct GNUNET_TIME_Absolute at, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run at the specified time.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the minimum of two relative time values.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
const char * GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Divide relative time by a given factor.
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute end)
Compute the time difference between the given start and end times.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
void(* GNUNET_TRANSPORT_TransmitContinuation)(void *cls, const struct GNUNET_PeerIdentity *target, int result, size_t size_payload, size_t size_on_wire)
Function called by the GNUNET_TRANSPORT_TransmitFunction upon "completion".
const char * GNUNET_TRANSPORT_ps2s(enum GNUNET_TRANSPORT_PeerState state)
Convert a transport state to a human readable string.
GNUNET_TRANSPORT_PeerState
Possible state of a neighbour.
int GNUNET_TRANSPORT_is_connected(enum GNUNET_TRANSPORT_PeerState state)
Check if a state is defined as connected.
@ GNUNET_TRANSPORT_PS_DISCONNECT_FINISHED
We're finished with the disconnect; and are cleaning up the state now! We put the struct into this st...
@ GNUNET_TRANSPORT_PS_NOT_CONNECTED
Fresh peer or completely disconnected.
@ GNUNET_TRANSPORT_PS_INIT_ATS
Asked to initiate connection, trying to get address from ATS.
@ GNUNET_TRANSPORT_PS_SYN_RECV_ATS
Received a SYN, asking ATS about address suggestions.
@ GNUNET_TRANSPORT_PS_SYN_RECV_ACK
SYN request from other peer was SYN_ACK'ed, waiting for ACK.
@ GNUNET_TRANSPORT_PS_RECONNECT_SENT
Sent SYN over new address (either by ATS telling us to switch addresses or from RECONNECT_ATS); if th...
@ GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT
We have some primary connection, but ATS suggested we switch to some alternative; we now sent a SYN m...
@ GNUNET_TRANSPORT_PS_CONNECTED
Got our SYN_ACK/ACK, connection is up.
@ GNUNET_TRANSPORT_PS_SYN_SENT
Sent SYN message to other peer, waiting for SYN_ACK.
@ GNUNET_TRANSPORT_PS_RECONNECT_ATS
Connection got into trouble, rest of the system still believes it to be up, but we're getting a new a...
@ GNUNET_TRANSPORT_PS_DISCONNECT
Disconnect in progress (we're sending the DISCONNECT message to the other peer; after that is finishe...
static unsigned int size
Size of the "table".
void receiver(void *cls, const void *buf, size_t available, const struct sockaddr *addr, socklen_t addrlen, int errCode)
Callback to read from the SOCKS5 proxy.
static struct GNUNET_TIME_Relative delta
Entry in a DLL we use to keep track of pending blacklist checks.
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in
Inbound bandwidth that was assigned to address.
struct BlacklistCheckSwitchContext * prev
DLL prev pointer.
struct BlacklistCheckSwitchContext * next
DLL next pointer.
struct GST_BlacklistCheck * blc
Handle to the blacklist check we are performing.
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out
Outbound bandwidth that was assigned to address.
Message from the transport service to the library informing about neighbors.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT.
struct GNUNET_PeerIdentity id
Identity of the new neighbour.
struct GNUNET_BANDWIDTH_Value32NBO quota_out
Current outbound quota for this peer.
Handle for ATS address suggestion requests.
Message we send to the other peer to notify it that we intentionally are disconnecting (to reduce tim...
uint32_t reserved
Always zero.
struct GNUNET_TIME_AbsoluteNBO timestamp
Absolute time at the sender.
struct GNUNET_MessageHeader header
Header of type GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT.
struct GNUNET_CRYPTO_EccSignaturePurpose purpose
Purpose of the signature.
struct GNUNET_CRYPTO_EddsaSignature signature
Signature of the peer that sends us the disconnect.
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Public key of the sender.
Message a peer sends to another when connected to indicate that a session is in use and the peer is s...
uint32_t nonce
A nonce to identify the session the keep alive is used for.
struct GNUNET_MessageHeader header
Header of type GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE or GNUNET_MESSAGE_TYPE_TRANSPORT_SESSI...
Message a peer sends to another when connected to indicate that the other peer should limit transmiss...
uint32_t quota
Quota to use (for sending), in bytes per second.
struct GNUNET_MessageHeader header
Header of type GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_QUOTA.
Session handle for connections.
Struct to track available bandwidth.
int64_t consumption_since_last_update__
Number of bytes consumed since we last updated the tracker.
uint32_t available_bytes_per_s__
Bandwidth limit to enforce in bytes per second.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
uint32_t value__
The actual value (bytes per second).
Internal representation of the hash map.
header of what an ECC signature signs this must be followed by "size - 8" bytes of the actual signed ...
uint32_t size
How many bytes does this signature sign? (including this purpose header); in network byte order (!...
uint32_t purpose
What does this signature vouch for? This must contain a GNUNET_SIGNATURE_PURPOSE_XXX constant (from g...
Public ECC key (always for curve Ed25519) encoded in a format suitable for network transmission and E...
an ECC signature using EdDSA.
An address for communicating with a peer.
const char * transport_name
Name of the transport plugin enabling the communication using this address.
size_t address_length
Number of bytes in address.
struct GNUNET_PeerIdentity peer
For which peer is this an address?
The identity of the host (wraps the signing key of the peer).
struct GNUNET_CRYPTO_EddsaPublicKey public_key
Entry in list of pending tasks.
Time for absolute time used by GNUnet, in microseconds and in network byte order.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
Each plugin is required to return a pointer to a struct of this type as the return value from its ent...
void * cls
Closure for all of the callbacks.
GNUNET_TRANSPORT_TransmitFunction send
Function that the transport service will use to transmit data to another peer.
GNUNET_TRANSPORT_UpdateInboundDelay update_inbound_delay
Function that will be called whenever the transport service wants to notify the plugin that the inbou...
GNUNET_TRANSPORT_DisconnectSessionFunction disconnect_session
Function that can be used to force the plugin to disconnect from the given peer and cancel all previo...
GNUNET_TRANSPORT_CreateSession get_session
Function that will be called tell the plugin to create a session object.
GNUNET_TRANSPORT_UpdateSessionTimeout update_session_timeout
Function that will be called whenever the transport service wants to notify the plugin that a session...
Context we use when performing a blacklist check.
Closure for the neighbours_iterate() function.
void * cb_cls
Closure for cb.
GST_NeighbourIterator cb
Function to call on each connected neighbour.
For each neighbour we keep a list of messages that we still want to transmit to the neighbour.
void * cont_cls
Closure for cont.
struct MessageQueue * prev
This is a doubly linked list.
const char * message_buf
The message(s) we want to transmit, GNUNET_MessageHeader(s) stuck together in memory.
struct MessageQueue * next
This is a doubly linked list.
GST_NeighbourSendContinuation cont
Function to call once we're done.
size_t message_buf_size
Size of the message buf.
struct GNUNET_TIME_Absolute timeout
At what time should we fail?
A possible address we could use to communicate with a neighbour.
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in
Inbound bandwidth from ATS for this address.
struct GNUNET_TIME_Absolute connect_timestamp
Timestamp of the 'SESSION_CONNECT' message we sent to the other peer for this address.
uint32_t keep_alive_nonce
The current nonce sent in the last keep alive messages.
struct GNUNET_HELLO_Address * address
Network-level address information.
struct GNUNET_ATS_Session * session
Active session for this address.
int ats_active
Did we tell ATS that this is our 'active' address?
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out
Outbound bandwidth from ATS for this address.
int expect_latency_response
Did we sent an KEEP_ALIVE message and are we expecting a response?
uint32_t util_total_bytes_sent
Tracking utilization of outbound bandwidth.
struct NeighbourAddress primary_address
Primary address we currently use to communicate with the neighbour.
enum GNUNET_TRANSPORT_PeerState state
The current state of the peer.
struct GNUNET_TIME_Absolute connect_ack_timestamp
Timestamp we should include in our next SYN_ACK message.
unsigned int quota_violation_count
How often has the other peer (recently) violated the inbound traffic limit? Incremented by 10 per vio...
struct MessageQueue * messages_head
Head of list of messages we would like to send to this peer; must contain at most one message per cli...
struct GNUNET_TIME_Absolute last_util_transmission
Date of last utilization transmission.
struct NeighbourAddress alternative_address
Alternative address currently under consideration for communicating with the neighbour.
struct GNUNET_TIME_Absolute keep_alive_time
At what time should we sent the next keep-alive message?
struct GNUNET_BANDWIDTH_Tracker in_tracker
Tracker for inbound bandwidth.
struct GNUNET_BANDWIDTH_Value32NBO neighbour_receive_quota
Latest quota the other peer send us in bytes per second.
enum GST_ACK_State ack_state
When a peer wants to connect we have to reply to the 1st SYN message with a SYN_ACK message.
struct GNUNET_TIME_Absolute timeout
Time where we should cut the connection (timeout) if we don't make progress in the state machine (or ...
struct GNUNET_TIME_Absolute last_keep_alive_time
At what time did we sent the last keep-alive message? Used to calculate round-trip time ("latency").
struct GNUNET_SCHEDULER_Task * task
Main task that drives this peer (timeouts, keepalives, etc.).
struct GNUNET_ATS_ConnectivitySuggestHandle * suggest_handle
ATS address suggest handle.
struct MessageQueue * is_active
Are we currently trying to send a message? If so, which one?
uint32_t util_total_bytes_recv
Tracking utilization of inbound bandwidth.
struct GNUNET_PeerIdentity id
Identity of this neighbour.
struct MessageQueue * messages_tail
Tail of list of messages we would like to send to this peer; must contain at most one message per cli...
struct GNUNET_SCHEDULER_Task * delayed_disconnect_task
Task to disconnect neighbour after we received a DISCONNECT message.
Message used to set a particular bandwidth quota.
struct GNUNET_MessageHeader header
Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA.
struct GNUNET_BANDWIDTH_Value32NBO quota
Quota.
struct GNUNET_PeerIdentity peer
About which peer are we talking here?
Message a peer sends to another to indicate that it intends to setup a connection/session for data ex...
uint32_t reserved
Always zero.
struct GNUNET_TIME_AbsoluteNBO timestamp
Absolute time at the sender.
struct GNUNET_MessageHeader header
Header of type GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_SYN or GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_SYN...
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
common internal definitions for transport service