gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r16468 - in gnunet/src: ats include transport


From: gnunet
Subject: [GNUnet-SVN] r16468 - in gnunet/src: ats include transport
Date: Fri, 12 Aug 2011 13:09:57 +0200

Author: grothoff
Date: 2011-08-12 13:09:57 +0200 (Fri, 12 Aug 2011)
New Revision: 16468

Modified:
   gnunet/src/ats/ats_api.c
   gnunet/src/include/gnunet_ats_service.h
   gnunet/src/transport/gnunet-service-transport_validation.c
Log:
add address timeout

Modified: gnunet/src/ats/ats_api.c
===================================================================
--- gnunet/src/ats/ats_api.c    2011-08-12 10:54:46 UTC (rev 16467)
+++ gnunet/src/ats/ats_api.c    2011-08-12 11:09:57 UTC (rev 16468)
@@ -179,12 +179,24 @@
   return GNUNET_YES;
 }
 
+
+/**
+ * Closure for 'set_bw_connections'.
+ */
 struct SetBandwidthContext
 {
+  /**
+   * ATS handle.
+   */
   struct GNUNET_ATS_Handle *atc;
+
+  /**
+   * Bandwidth to assign.
+   */
   struct GNUNET_BANDWIDTH_Value32NBO bw;
 };
 
+
 /**
  * Set bandwidth based on record.
  *
@@ -303,9 +315,9 @@
  */
 struct GNUNET_ATS_SuggestionContext *
 GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc,
-                        const struct GNUNET_PeerIdentity *peer,
-                        GNUNET_ATS_AddressSuggestionCallback cb,
-                        void *cb_cls)
+                           const struct GNUNET_PeerIdentity *peer,
+                           GNUNET_ATS_AddressSuggestionCallback cb,
+                           void *cb_cls)
 {
   struct GNUNET_ATS_SuggestionContext *asc;
 
@@ -357,8 +369,8 @@
  */
 struct GNUNET_ATS_Handle *
 GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
-             GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
-             void *alloc_cb_cls)
+                GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
+                void *alloc_cb_cls)
 {
   struct GNUNET_ATS_Handle *atc;
 
@@ -690,8 +702,8 @@
  */
 void
 GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc,
-                          const struct GNUNET_PeerIdentity *peer,
-                          const struct Session *session)
+                             const struct GNUNET_PeerIdentity *peer,
+                             const struct Session *session)
 {
   struct SessionDestroyContext sdc;
 
@@ -741,6 +753,7 @@
  * @param atc handle
  * @param public_key public key of the peer
  * @param peer identity of the peer
+ * @param valid_until how long is the address valid?
  * @param plugin_name name of the transport plugin
  * @param session session handle (if available)
  * @param plugin_addr address  (if available)
@@ -752,6 +765,7 @@
 GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
                           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 
*public_key,
                           const struct GNUNET_PeerIdentity *peer,
+                          struct GNUNET_TIME_Absolute valid_until,
                           const char *plugin_name,
                           struct Session *session,
                           const void *plugin_addr,

Modified: gnunet/src/include/gnunet_ats_service.h
===================================================================
--- gnunet/src/include/gnunet_ats_service.h     2011-08-12 10:54:46 UTC (rev 
16467)
+++ gnunet/src/include/gnunet_ats_service.h     2011-08-12 11:09:57 UTC (rev 
16468)
@@ -207,6 +207,7 @@
  * @param atc handle
  * @param public_key public key of the peer
  * @param peer identity of the new peer
+ * @param valid_until how long is the address valid?
  * @param plugin_name name of the transport plugin
  * @param session session handle (if available)
  * @param plugin_addr address  (if available)
@@ -218,6 +219,7 @@
 GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
                           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 
*public_key,
                           const struct GNUNET_PeerIdentity *peer,
+                          struct GNUNET_TIME_Absolute valid_until,
                           const char *plugin_name,
                           struct Session *session,
                           const void *plugin_addr,

Modified: gnunet/src/transport/gnunet-service-transport_validation.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_validation.c  2011-08-12 
10:54:46 UTC (rev 16467)
+++ gnunet/src/transport/gnunet-service-transport_validation.c  2011-08-12 
11:09:57 UTC (rev 16468)
@@ -419,13 +419,14 @@
   ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until,
                                              expiration);
   GNUNET_ATS_address_update (GST_ats,
-                         &public_key,
-                         &pid,
-                         tname,
-                         NULL,
-                         addr,
-                         addrlen,
-                         NULL, 0);
+                            &public_key,
+                            &pid,
+                            ve->valid_until,
+                            tname,
+                            NULL,
+                            addr,
+                            addrlen,
+                            NULL, 0);
   return GNUNET_OK;
 }
 
@@ -1038,13 +1039,14 @@
   /* validity achieved, remember it! */
   ve->valid_until = GNUNET_TIME_relative_to_absolute 
(HELLO_ADDRESS_EXPIRATION);
   GNUNET_ATS_address_update (GST_ats,
-                         &ve->public_key,
-                         &ve->pid,
-                         ve->transport_name,
-                         NULL,
-                         ve->addr,
-                         ve->addrlen,
-                         NULL, 0); /* FIXME: compute and add latency here... */
+                            &ve->public_key,
+                            &ve->pid,
+                            ve->valid_until,
+                            ve->transport_name,
+                            NULL,
+                            ve->addr,
+                            ve->addrlen,
+                            NULL, 0); /* FIXME: compute and add latency 
here... */
 
   /* build HELLO to store in PEERINFO */
   hello = GNUNET_HELLO_create (&ve->public_key,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]