From b7fd524b858f2ab3af9183c1ead1bf54e44b312a Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 30 Nov 2011 14:45:27 +0000 Subject: [PATCH] some doxygen + refactoring of GST_validation_set_address_use --- src/transport/gnunet-service-transport.c | 6 +++++- .../gnunet-service-transport_neighbours.c | 14 +++++++------- .../gnunet-service-transport_validation.c | 13 ++++++------- .../gnunet-service-transport_validation.h | 4 +--- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index d4d8828d0..6c068bec9 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -118,7 +118,9 @@ process_hello_update (void *cls, const struct GNUNET_MessageHeader *hello) * We received some payload. Prepare to pass it on to our clients. * * @param peer (claimed) identity of the other peer - * @param message the message, never NULL + * @param address the address + * @param session session used + * @param msg the message to process * @param ats performance information * @param ats_count number of records in ats * @return how long the plugin should wait until receiving more data @@ -369,6 +371,8 @@ plugin_env_session_end (void *cls, const struct GNUNET_PeerIdentity *peer, * @param session session to use (if available) * @param bandwidth_out assigned outbound bandwidth for the connection, 0 to disconnect from peer * @param bandwidth_in assigned inbound bandwidth for the connection, 0 to disconnect from peer + * @param ats ATS information + * @param number of ATS elements */ static void ats_request_address_change (void *cls, diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index a0f6e2e42..348378bc8 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -894,7 +894,7 @@ disconnect_neighbour (struct NeighbourMapEntry *n) GNUNET_assert (NULL != n->address); if (n->address_state == USED) { - GST_validation_set_address_use (&n->id, n->address, n->session, + GST_validation_set_address_use (n->address, n->session, GNUNET_NO); GNUNET_ATS_address_in_use (GST_ats, n->address, n->session, GNUNET_NO); @@ -1245,7 +1245,7 @@ send_switch_address_continuation (void *cls, case S_CONNECTED: if (n->address_state == FRESH) { - GST_validation_set_address_use (&n->id, cc->address, cc->session, + GST_validation_set_address_use (cc->address, cc->session, GNUNET_YES); GNUNET_ATS_address_update (GST_ats, cc->address, cc->session, NULL, 0); GNUNET_ATS_address_in_use (GST_ats, cc->address, cc->session, GNUNET_YES); @@ -1265,7 +1265,7 @@ send_switch_address_continuation (void *cls, if (n->address_state == FRESH) { - GST_validation_set_address_use (&n->id, cc->address, cc->session, + GST_validation_set_address_use (cc->address, cc->session, GNUNET_YES); GNUNET_ATS_address_update (GST_ats, cc->address, cc->session, NULL, 0); GNUNET_ATS_address_in_use (GST_ats, cc->address, cc->session, GNUNET_YES); @@ -1431,7 +1431,7 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, GNUNET_assert (NULL != n->address); if (n->address_state == USED) { - GST_validation_set_address_use (&n->id, n->address, n->session, + GST_validation_set_address_use (n->address, n->session, GNUNET_NO); GNUNET_ATS_address_in_use (GST_ats, n->address, n->session, GNUNET_NO); n->address_state = UNUSED; @@ -1698,7 +1698,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, { if (n->address_state == USED) { - GST_validation_set_address_use (&n->id, n->address, n->session, + GST_validation_set_address_use (n->address, n->session, GNUNET_NO); GNUNET_ATS_address_in_use (GST_ats, n->address, n->session, GNUNET_NO); n->address_state = UNUSED; @@ -2334,7 +2334,7 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, GNUNET_assert (NULL != n->address); if (n->address_state == FRESH) { - GST_validation_set_address_use (&n->id, n->address, n->session, GNUNET_YES); + GST_validation_set_address_use (n->address, n->session, GNUNET_YES); GNUNET_ATS_address_in_use (GST_ats, n->address, n->session, GNUNET_YES); n->address_state = USED; } @@ -2421,7 +2421,7 @@ GST_neighbours_handle_ack (const struct GNUNET_MessageHeader *message, GNUNET_assert (n->address != NULL); if (n->address_state == FRESH) { - GST_validation_set_address_use (&n->id, n->address, n->session, GNUNET_YES); + GST_validation_set_address_use (n->address, n->session, GNUNET_YES); GNUNET_ATS_address_in_use (GST_ats, n->address, n->session, GNUNET_YES); n->address_state = USED; } diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 641214b39..559589576 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c @@ -705,13 +705,12 @@ GST_validation_stop () * * @param cls the PONG message * @param public_key public key for the peer, never NULL - * @param target peer this change is about, never NULL * @param valid_until is ZERO if we never validated the address, * otherwise a time up to when we consider it (or was) valid * @param validation_block is FOREVER if the address is for an unsupported plugin (from PEERINFO) * is ZERO if the address is considered valid (no validation needed) * otherwise a time in the future if we're currently denying re-validation - * @param adress target address + * @param address target address */ static void multicast_pong (void *cls, @@ -1165,15 +1164,15 @@ GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, * Based on this, the validation module will measure latency for the * address more or less often. * - * @param sender peer FIXME: redundant! * @param address the address + * @param session the session * @param in_use GNUNET_YES if we are now using the address for a connection, * GNUNET_NO if we are no longer using the address for a connection */ void -GST_validation_set_address_use (const struct GNUNET_PeerIdentity *sender, - const struct GNUNET_HELLO_Address *address, - struct Session *session, int in_use) +GST_validation_set_address_use (const struct GNUNET_HELLO_Address *address, + struct Session *session, + int in_use) { struct ValidationEntry *ve; @@ -1189,7 +1188,7 @@ GST_validation_set_address_use (const struct GNUNET_PeerIdentity *sender, if (ve->in_use == in_use) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "GST_validation_set_address_use: %s %s: ve->in_use %i <-> in_use %i\n", - GNUNET_i2s (sender), GST_plugins_a2s (address), ve->in_use, + GNUNET_i2s (&address->peer), GST_plugins_a2s (address), ve->in_use, in_use); GNUNET_break (ve->in_use != in_use); /* should be different... */ ve->in_use = in_use; diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h index f5282d4e9..9b1063be3 100644 --- a/src/transport/gnunet-service-transport_validation.h +++ b/src/transport/gnunet-service-transport_validation.h @@ -51,15 +51,13 @@ GST_validation_stop (void); * Based on this, the validation module will measure latency for the * address more or less often. * - * @param sender peer FIXME: redundant! * @param address the address * @param session session * @param in_use GNUNET_YES if we are now using the address for a connection, * GNUNET_NO if we are no longer using the address for a connection */ void -GST_validation_set_address_use (const struct GNUNET_PeerIdentity *sender, - const struct GNUNET_HELLO_Address *address, +GST_validation_set_address_use (const struct GNUNET_HELLO_Address *address, struct Session *session, int in_use); -- 2.25.1