some doxygen + refactoring of GST_validation_set_address_use
authorMatthias Wachs <wachs@net.in.tum.de>
Wed, 30 Nov 2011 14:45:27 +0000 (14:45 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Wed, 30 Nov 2011 14:45:27 +0000 (14:45 +0000)
src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport_neighbours.c
src/transport/gnunet-service-transport_validation.c
src/transport/gnunet-service-transport_validation.h

index d4d8828d0c9ed1a1855682aaecffde8a1ebbfa60..6c068bec9a6e2f3115cdbe826e543c27da5a6ff2 100644 (file)
@@ -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,
index a0f6e2e42022fdafa948f738c6b4ff7ded3013b8..348378bc8b153bada0f6dfdd2d5f928337e66717 100644 (file)
@@ -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;
   }
index 641214b39eaca29e96a77f3ff124f03f9b00463d..559589576b9e514b43814a90f4a4d6432773490a 100644 (file)
@@ -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;
index f5282d4e9e8de02146883c6cb428a41bfba05eb3..9b1063be3740d3d05f432c3f1387ada27300e8eb 100644 (file)
@@ -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);