From 78eb3927110c2928aaf796efe7b362163455d92a Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 27 Oct 2011 19:46:53 +0000 Subject: [PATCH] --- src/transport/gnunet-service-transport_3way.c | 2 +- .../gnunet-service-transport_neighbours.h | 54 ++++++++++++++++++- ...gnunet-service-transport_neighbours_3way.h | 7 +++ 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/transport/gnunet-service-transport_3way.c b/src/transport/gnunet-service-transport_3way.c index a24d6c1b1..5d8b5ccd0 100644 --- a/src/transport/gnunet-service-transport_3way.c +++ b/src/transport/gnunet-service-transport_3way.c @@ -403,7 +403,7 @@ ats_request_address_change (void *cls, const struct GNUNET_PeerIdentity *peer, return; } /* will never return GNUNET_YES since connection is to be established */ - GST_neighbours_switch_to_address (peer, plugin_name, plugin_addr, + GST_neighbours_switch_to_address_3way (peer, plugin_name, plugin_addr, plugin_addr_len, session, ats, ats_count, bandwidth_in, bandwidth_out); } diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index 09384bafd..272f059dd 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h @@ -210,6 +210,14 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, const struct GNUNET_ATS_Information *ats, uint32_t ats_count); +int +GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, + const char *plugin_name, const void *address, + size_t address_len, struct Session *session, + const struct GNUNET_ATS_Information + *ats, uint32_t ats_count, + struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, + struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out); /** * We received a 'SESSION_CONNECT' message from the other peer. @@ -223,7 +231,7 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, * @param address_len number of bytes in address * @param session session to use (or NULL) * @param ats performance data - * @param ats_count number of entries in ats (excluding 0-termination) + * @param ats_count number of entries in ats */ void GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, @@ -234,6 +242,50 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, const struct GNUNET_ATS_Information *ats, uint32_t ats_count); +/** + * We received a 'SESSION_CONNECT_ACK' message from the other peer. + * + * @param message possibly a 'struct SessionConnectMessage' (check format) + * @param peer identity of the peer to switch the address for + * @param plugin_name name of transport that delivered the PONG + * @param address address of the other peer, NULL if other peer + * connected to us + * @param address_len number of bytes in address + * @param session session to use (or NULL) + * @param ats performance data + * @param ats_count number of entries in ats + */ +void +GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, + const struct GNUNET_PeerIdentity *peer, + const char *plugin_name, + const char *sender_address, uint16_t sender_address_len, + struct Session *session, + const struct GNUNET_ATS_Information *ats, + uint32_t ats_count); + +/** + * We received a 'SESSION_ACK' message from the other peer. + * + * @param message possibly a 'struct SessionConnectMessage' (check format) + * @param peer identity of the peer to switch the address for + * @param plugin_name name of transport that delivered the PONG + * @param address address of the other peer, NULL if other peer + * connected to us + * @param address_len number of bytes in address + * @param session session to use (or NULL) + * @param ats performance data + * @param ats_count number of entries in ats + */ +void +GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, + const struct GNUNET_PeerIdentity *peer, + const char *plugin_name, + const char *sender_address, uint16_t sender_address_len, + struct Session *session, + const struct GNUNET_ATS_Information *ats, + uint32_t ats_count); + /** * We received a disconnect message from the given peer, * validate and process. diff --git a/src/transport/gnunet-service-transport_neighbours_3way.h b/src/transport/gnunet-service-transport_neighbours_3way.h index 88790449e..3868ef2cf 100644 --- a/src/transport/gnunet-service-transport_neighbours_3way.h +++ b/src/transport/gnunet-service-transport_neighbours_3way.h @@ -207,6 +207,13 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, */ int GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, + const char *plugin_name, const void *address, + size_t address_len, struct Session *session, + const struct GNUNET_ATS_Information + *ats, uint32_t ats_count); + +int +GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, const char *plugin_name, const void *address, size_t address_len, struct Session *session, const struct GNUNET_ATS_Information -- 2.25.1