neighbour manipulation API, allows manipulation of performance metrics (delay and towards ATS) More...
#include "gnunet_statistics_service.h"
#include "gnunet_transport_service.h"
#include "gnunet_transport_plugin.h"
#include "gnunet-service-transport.h"
#include "transport.h"
#include "gnunet_util_lib.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | GST_NeighbourSendContinuation) (void *cls, int success, size_t bytes_payload, size_t bytes_on_wire) |
Function called after the transmission is done. More... | |
typedef 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. More... | |
Functions | |
void | GST_neighbours_start (unsigned int max_fds) |
Initialize the neighbours subsystem. More... | |
void | GST_neighbours_stop (void) |
Cleanup the neighbours subsystem. More... | |
int | GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target) |
Test if we're connected to the given peer. More... | |
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. More... | |
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. More... | |
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); send a response. More... | |
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. More... | |
void | GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target) |
If we have an active connection to the given target, it must be shutdown. More... | |
void | GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls) |
Iterate over all connected neighbours. More... | |
int | GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, struct GNUNET_ATS_Session *session) |
A session was terminated. More... | |
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 utilization of allocated resources). More... | |
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 about our utilization of allocated resources). More... | |
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 an existing neighbour record, set the active connection to use the given address. More... | |
int | GST_neighbours_handle_session_syn (const struct GNUNET_MessageHeader *message, const struct GNUNET_PeerIdentity *peer) |
We received a 'SESSION_CONNECT' message from the other peer. More... | |
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_CONNECT_ACK' message from the other peer. More... | |
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 'SESSION_ACK' message from the other peer. More... | |
const struct GNUNET_HELLO_Address * | GST_neighbour_get_current_address (const struct GNUNET_PeerIdentity *peer) |
Obtain current address information for the given neighbour. More... | |
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. More... | |
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. More... | |
neighbour manipulation API, allows manipulation of performance metrics (delay and towards ATS)
neighbour management API
Definition in file gnunet-service-transport_neighbours.h.
typedef void(* GST_NeighbourSendContinuation) (void *cls, int success, size_t bytes_payload, size_t bytes_on_wire) |
Function called after the transmission is done.
cls | closure |
success | GNUNET_OK on success, GNUNET_NO on failure, GNUNET_SYSERR if we're not connected |
bytes_payload | how much payload was transmitted |
bytes_on_wire | how many bytes were used on the wire |
Definition at line 71 of file gnunet-service-transport_neighbours.h.
typedef 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.
cls | closure |
peer | identity of the neighbour |
address | the address of the neighbour |
state | current state the peer is in |
state_timeout | timeout for this state |
bandwidth_in | inbound quota in NBO |
bandwidth_out | outbound quota in NBO |
Definition at line 159 of file gnunet-service-transport_neighbours.h.
void GST_neighbours_start | ( | unsigned int | max_fds | ) |
Initialize the neighbours subsystem.
max_fds | maximum number of fds to use |
Definition at line 3889 of file gnunet-service-transport_neighbours.c.
References GNUNET_CONTAINER_multipeermap_create(), GNUNET_NO, GNUNET_SCHEDULER_add_delayed(), NEIGHBOUR_TABLE_SIZE, neighbours, UTIL_TRANSMISSION_INTERVAL, util_transmission_tk, and utilization_transmission().
Referenced by run().
void GST_neighbours_stop | ( | void | ) |
Cleanup the neighbours subsystem.
Definition at line 3930 of file gnunet-service-transport_neighbours.c.
Referenced by shutdown_task().
int GST_neighbours_test_connected | ( | const struct GNUNET_PeerIdentity * | target | ) |
Test if we're connected to the given peer.
target | peer to test |
Definition at line 3608 of file gnunet-service-transport_neighbours.c.
References lookup_neighbour(), and test_connected().
Referenced by handle_client_send(), notify_client_about_neighbour(), send_delayed(), and transmit_our_hello().
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.
target | destination |
msg | message to send |
msg_size | number of bytes in msg |
timeout | when to fail with timeout |
cont | function to call when done |
cont_cls | closure for cont |
Definition at line 1772 of file gnunet-service-transport_neighbours.c.
References bytes_in_send_queue, MessageQueue::cont, MessageQueue::cont_cls, gettext_noop, GNUNET_break, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_STATISTICS_set(), GNUNET_SYSERR, GNUNET_TIME_relative_to_absolute(), GNUNET_YES, GST_stats, lookup_neighbour(), master_task(), NeighbourMapEntry::messages_head, NeighbourMapEntry::messages_tail, mq, msg, NeighbourMapEntry::task, test_connected(), and timeout.
Referenced by GST_manipulation_send(), send_delayed(), and transmit_our_hello().
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.
How long should we delay before receiving more? (Also used to keep the peer marked as live).
sender | sender of the message |
size | size of the message |
do_forward | set to GNUNET_YES if the message should be forwarded to clients GNUNET_NO if the neighbour is not connected or violates the quota |
How long should we delay before receiving more? (Also used to keep the peer marked as live).
sender | sender of the message |
size | size of the message |
do_forward | set to GNUNET_YES if the message should be forwarded to clients GNUNET_NO if the neighbour is not connected or violates the quota, GNUNET_SYSERR if the connection is not fully up yet |
Definition at line 1582 of file gnunet-service-transport_neighbours.c.
References NeighbourAddress::address, GNUNET_TRANSPORT_PluginFunctions::cls, NeighbourMapEntry::expect_latency_response, gettext_noop, GNUNET_break, GNUNET_break_op, GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get_duration(), GNUNET_TIME_relative_divide(), GNUNET_TIME_relative_to_absolute(), GNUNET_TRANSPORT_PS_CONNECTED, GNUNET_YES, GST_ats_update_delay(), GST_plugins_find(), GST_stats, NeighbourMapEntry::id, NeighbourAddress::keep_alive_nonce, NeighbourMapEntry::last_keep_alive_time, lookup_neighbour(), m, msg, NeighbourMapEntry::primary_address, NeighbourAddress::session, set_state_and_timeout(), NeighbourMapEntry::state, GNUNET_HELLO_Address::transport_name, and GNUNET_TRANSPORT_PluginFunctions::update_session_timeout.
Referenced by inbound_bw_tracker_update().
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); send a response.
neighbour | neighbour to keep alive (by sending keep alive response) |
m | the keep alive message containing the nonce to respond to |
Definition at line 1517 of file gnunet-service-transport_neighbours.c.
References gettext_noop, GNUNET_break_op, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE_RESPONSE, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, GST_stats, NeighbourMapEntry::id, lookup_neighbour(), m, msg, GNUNET_ATS_SessionKeepAliveMessage::nonce, NeighbourMapEntry::primary_address, send_with_session(), NeighbourAddress::session, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
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.
Pass the updated information (existing ats plus calculated latency) to ATS.
neighbour | neighbour to keep alive |
m | the message containing the keep alive response |
Definition at line 1582 of file gnunet-service-transport_neighbours.c.
void GST_neighbours_force_disconnect | ( | const struct GNUNET_PeerIdentity * | target | ) |
If we have an active connection to the given target, it must be shutdown.
target | peer to disconnect from |
Definition at line 3846 of file gnunet-service-transport_neighbours.c.
References disconnect_neighbour(), gettext_noop, GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GNUNET_YES, GST_stats, lookup_neighbour(), and test_connected().
Referenced by ats_request_address_change(), and confirm_or_drop_neighbour().
void GST_neighbours_iterate | ( | GST_NeighbourIterator | cb, |
void * | cb_cls | ||
) |
Iterate over all connected neighbours.
cb | function to call |
cb_cls | closure for cb |
Definition at line 3825 of file gnunet-service-transport_neighbours.c.
References IteratorContext::cb, IteratorContext::cb_cls, GNUNET_CONTAINER_multipeermap_iterate(), neighbours, and neighbours_iterate().
Referenced by handle_client_blacklist_init(), handle_client_monitor_peers(), handle_client_start(), and process_hello_update().
int GST_neighbours_session_terminated | ( | const struct GNUNET_PeerIdentity * | peer, |
struct GNUNET_ATS_Session * | session | ||
) |
A session was terminated.
Take note.
peer | identity of the peer where the session died |
session | session that is gone |
Take note; if needed, try to get an alternative address from ATS.
peer | identity of the peer where the session died |
session | session that is gone |
Definition at line 3371 of file gnunet-service-transport_neighbours.c.
References NeighbourAddress::address, NeighbourMapEntry::alternative_address, ATS_RESPONSE_TIMEOUT, NeighbourMapEntry::expect_latency_response, FAST_RECONNECT_TIMEOUT, free_address(), free_neighbour(), GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_cancel(), GNUNET_TIME_relative_to_absolute(), GNUNET_TRANSPORT_ps2s(), GNUNET_TRANSPORT_PS_CONNECTED, GNUNET_TRANSPORT_PS_DISCONNECT, GNUNET_TRANSPORT_PS_DISCONNECT_FINISHED, GNUNET_TRANSPORT_PS_INIT_ATS, GNUNET_TRANSPORT_PS_NOT_CONNECTED, GNUNET_TRANSPORT_PS_RECONNECT_ATS, GNUNET_TRANSPORT_PS_RECONNECT_SENT, GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT, GNUNET_TRANSPORT_PS_SYN_RECV_ACK, GNUNET_TRANSPORT_PS_SYN_RECV_ATS, GNUNET_TRANSPORT_PS_SYN_SENT, GNUNET_YES, GST_ats_is_known(), GST_plugins_a2s(), lookup_neighbour(), master_task(), peer, NeighbourMapEntry::primary_address, NeighbourAddress::session, set_state_and_timeout(), NeighbourMapEntry::state, NeighbourMapEntry::task, NeighbourMapEntry::timeout, and unset_primary_address().
Referenced by plugin_env_session_end().
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 utilization of allocated resources).
address | the address we got data from |
message | the message we received (really only the size is used) |
Definition at line 2975 of file gnunet-service-transport_neighbours.c.
References address, lookup_neighbour(), GNUNET_MessageHeader::size, and NeighbourMapEntry::util_total_bytes_recv.
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 about our utilization of allocated resources).
address | the address we transmitted data to |
session | session we used to transmit data |
message | the message we sent (really only the size is used) |
Definition at line 2997 of file gnunet-service-transport_neighbours.c.
References address, lookup_neighbour(), NeighbourMapEntry::primary_address, NeighbourAddress::session, size, and NeighbourMapEntry::util_total_bytes_sent.
Referenced by GST_validation_handle_ping(), multicast_pong(), send_syn(), and transmit_ping_if_allowed().
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 an existing neighbour record, set the active connection to use the given address.
address | address of the other peer to start using |
session | session to use (or NULL) |
bandwidth_in | inbound quota to be used when connection is up |
bandwidth_out | outbound quota to be used when connection is up |
For an existing neighbour record, set the active connection to use the given address.
Before accepting this addresses and actively using it, a blacklist check is performed.
If any check fails or the suggestion can somehow not be followed, we MUST call GST_ats_block_address() to tell ATS that the suggestion could not be satisfied and force ATS to do something else.
address | address of the other peer, |
session | session to use or NULL if transport should initiate a session |
bandwidth_in | inbound quota to be used when connection is up, 0 to disconnect from peer |
bandwidth_out | outbound quota to be used when connection is up, 0 to disconnect from peer |
Definition at line 2834 of file gnunet-service-transport_neighbours.c.
References address, BlacklistCheckSwitchContext::bandwidth_in, BlacklistCheckSwitchContext::bandwidth_out, BlacklistCheckSwitchContext::blc, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_HELLO_address_check_option(), GNUNET_HELLO_ADDRESS_INFO_INBOUND, GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_OK, GST_ats_block_address(), GST_blacklist_test_allowed(), GST_plugins_a2s(), GST_plugins_find(), pending_bc_head, pending_bc_tail, switch_address_bl_check_cont(), try_run_fast_ats_update(), and GNUNET_BANDWIDTH_Value32NBO::value__.
Referenced by ats_request_address_change().
int GST_neighbours_handle_session_syn | ( | const struct GNUNET_MessageHeader * | message, |
const struct GNUNET_PeerIdentity * | peer | ||
) |
We received a 'SESSION_CONNECT' message from the other peer.
Consider switching to it.
message | possibly a 'struct GNUNET_ATS_SessionConnectMessage' (check format) |
peer | identity of the peer to switch the address for |
We received a 'SESSION_CONNECT' message from the other peer.
Consider switching to it.
message | possibly a struct TransportSynMessage (check format) |
peer | identity of the peer to switch the address for |
Definition at line 2290 of file gnunet-service-transport_neighbours.c.
References _, ACK_SEND_ACK, ACK_SEND_SYN_ACK, NeighbourMapEntry::ack_state, NeighbourAddress::address, ATS_RESPONSE_TIMEOUT, NeighbourMapEntry::connect_ack_timestamp, free_neighbour(), gettext_noop, GNUNET_assert, GNUNET_break, GNUNET_break_op, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_relative_to_absolute(), GNUNET_TRANSPORT_ps2s(), GNUNET_TRANSPORT_PS_CONNECTED, GNUNET_TRANSPORT_PS_DISCONNECT, GNUNET_TRANSPORT_PS_DISCONNECT_FINISHED, GNUNET_TRANSPORT_PS_INIT_ATS, GNUNET_TRANSPORT_PS_NOT_CONNECTED, GNUNET_TRANSPORT_PS_RECONNECT_ATS, GNUNET_TRANSPORT_PS_RECONNECT_SENT, GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT, GNUNET_TRANSPORT_PS_SYN_RECV_ACK, GNUNET_TRANSPORT_PS_SYN_RECV_ATS, GNUNET_TRANSPORT_PS_SYN_SENT, GST_my_identity, GST_stats, lookup_neighbour(), neighbours, peer, NeighbourMapEntry::primary_address, print_ack_state(), TransportSynMessage::reserved, send_syn_ack_message(), NeighbourAddress::session, set_state_and_timeout(), setup_neighbour(), GNUNET_MessageHeader::size, NeighbourMapEntry::state, and TransportSynMessage::timestamp.
Referenced by connect_bl_check_cont().
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_CONNECT_ACK' message from the other peer.
Consider switching to it.
message | possibly a struct GNUNET_ATS_SessionConnectMessage (check format) |
address | address of the other peer |
session | session to use (or NULL) |
We received a 'SESSION_CONNECT_ACK' message from the other peer.
Consider switching to it.
message | possibly a struct GNUNET_ATS_SessionConnectMessage (check format) |
peer | identity of the peer to switch the address for |
address | address of the other peer, NULL if other peer connected to us |
session | session to use (or NULL) |
Definition at line 3209 of file gnunet-service-transport_neighbours.c.
References GNUNET_TIME_Absolute::abs_value_us, NeighbourMapEntry::ack_state, address, NeighbourAddress::address, NeighbourMapEntry::alternative_address, NeighbourAddress::ats_active, NeighbourAddress::bandwidth_in, NeighbourAddress::bandwidth_out, NeighbourAddress::connect_timestamp, free_neighbour(), gettext_noop, GNUNET_assert, GNUNET_break, GNUNET_break_op, GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_HELLO_address_free, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_TIME_absolute_ntoh(), GNUNET_TIME_relative_to_absolute(), GNUNET_TRANSPORT_ps2s(), GNUNET_TRANSPORT_PS_CONNECTED, GNUNET_TRANSPORT_PS_DISCONNECT, GNUNET_TRANSPORT_PS_DISCONNECT_FINISHED, GNUNET_TRANSPORT_PS_INIT_ATS, GNUNET_TRANSPORT_PS_NOT_CONNECTED, GNUNET_TRANSPORT_PS_RECONNECT_ATS, GNUNET_TRANSPORT_PS_RECONNECT_SENT, GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT, GNUNET_TRANSPORT_PS_SYN_RECV_ACK, GNUNET_TRANSPORT_PS_SYN_RECV_ATS, GNUNET_TRANSPORT_PS_SYN_SENT, GST_stats, lookup_neighbour(), NeighbourMapEntry::primary_address, print_ack_state(), TransportSynMessage::reserved, send_session_ack_message(), NeighbourAddress::session, set_primary_address(), set_state_and_timeout(), GNUNET_MessageHeader::size, NeighbourMapEntry::state, and TransportSynMessage::timestamp.
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 'SESSION_ACK' message from the other peer.
If we sent a 'CONNECT_ACK' last, this means we are now connected. Otherwise, do nothing.
message | possibly a 'struct GNUNET_ATS_SessionConnectMessage' (check format) |
address | address of the other peer |
session | session to use (or NULL) |
We received a 'SESSION_ACK' message from the other peer.
If we sent a 'SYN_ACK' last, this means we are now connected. Otherwise, do nothing.
message | possibly a 'struct GNUNET_ATS_SessionConnectMessage' (check format) |
address | address of the other peer |
session | session to use (or NULL) |
Definition at line 3518 of file gnunet-service-transport_neighbours.c.
References ACK_SEND_ACK, NeighbourMapEntry::ack_state, address, NeighbourAddress::address, gettext_noop, GNUNET_break, GNUNET_break_op, GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_STATISTICS_update(), GNUNET_SYSERR, GNUNET_TIME_relative_to_absolute(), GNUNET_TRANSPORT_ps2s(), GNUNET_TRANSPORT_PS_CONNECTED, GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT, GNUNET_TRANSPORT_PS_SYN_RECV_ACK, GST_ats_block_reset(), GST_stats, lookup_neighbour(), NeighbourMapEntry::primary_address, print_ack_state(), NeighbourAddress::session, set_state_and_timeout(), GNUNET_MessageHeader::size, and NeighbourMapEntry::state.
const struct GNUNET_HELLO_Address* GST_neighbour_get_current_address | ( | const struct GNUNET_PeerIdentity * | peer | ) |
Obtain current address information for the given neighbour.
peer |
Definition at line 3872 of file gnunet-service-transport_neighbours.c.
References NeighbourAddress::address, lookup_neighbour(), peer, and NeighbourMapEntry::primary_address.
Referenced by handle_send_transmit_continuation().
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.
peer | sender of the message |
msg | the quota message |
Definition at line 3633 of file gnunet-service-transport_neighbours.c.
References gettext_noop, GNUNET_BANDWIDTH_value_init(), GNUNET_BANDWIDTH_value_max(), GNUNET_break_op, GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT, GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_NO, GNUNET_STATISTICS_update(), GST_stats, lookup_neighbour(), msg, NeighbourMapEntry::neighbour_receive_quota, peer, GNUNET_ATS_SessionQuotaMessage::quota, send_outbound_quota_to_clients(), GNUNET_MessageHeader::size, and GNUNET_BANDWIDTH_Value32NBO::value__.
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.
peer | sender of the message |
msg | the disconnect message |
Definition at line 3682 of file gnunet-service-transport_neighbours.c.
References GNUNET_TIME_Absolute::abs_value_us, NeighbourMapEntry::connect_ack_timestamp, delayed_disconnect(), NeighbourMapEntry::delayed_disconnect_task, gettext_noop, GNUNET_break_op, GNUNET_CRYPTO_eddsa_verify_(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_STATISTICS_update(), GNUNET_TIME_absolute_ntoh(), GST_stats, lookup_neighbour(), msg, peer, GNUNET_ATS_SessionDisconnectMessage::public_key, GNUNET_ATS_SessionDisconnectMessage::purpose, GNUNET_ATS_SessionDisconnectMessage::signature, GNUNET_MessageHeader::size, GNUNET_CRYPTO_EccSignaturePurpose::size, and GNUNET_ATS_SessionDisconnectMessage::timestamp.