gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r17433 - in gnunet/src: ats include
Date: Thu, 13 Oct 2011 10:28:16 +0200

Author: grothoff
Date: 2011-10-13 10:28:15 +0200 (Thu, 13 Oct 2011)
New Revision: 17433

Modified:
   gnunet/src/ats/ats_api.c
   gnunet/src/ats/ats_api.h
   gnunet/src/include/gnunet_ats_service.h
Log:
ATS API cleanup: remove 2nd callback type with virtually identical signature

Modified: gnunet/src/ats/ats_api.c
===================================================================
--- gnunet/src/ats/ats_api.c    2011-10-13 08:06:28 UTC (rev 17432)
+++ gnunet/src/ats/ats_api.c    2011-10-13 08:28:15 UTC (rev 17433)
@@ -152,9 +152,12 @@
     if (NULL != sbc->atc->alloc_cb)
       sbc->atc->alloc_cb (sbc->atc->alloc_cb_cls,
                           (const struct GNUNET_PeerIdentity *) key,
-                          ar->plugin_name, ar->session, ar->plugin_addr,
-                          ar->plugin_addr_len, ar->bandwidth_out,
-                          ar->bandwidth_in);
+                          ar->plugin_name, ar->plugin_addr,
+                          ar->plugin_addr_len, 
+                         ar->session,
+                         ar->bandwidth_out,
+                          ar->bandwidth_in,
+                         NULL, 0);
   }
   else if (ntohl (ar->bandwidth_out.value__) > 0)
   {
@@ -163,9 +166,9 @@
     if (NULL != sbc->atc->alloc_cb)
       sbc->atc->alloc_cb (sbc->atc->alloc_cb_cls,
                           (const struct GNUNET_PeerIdentity *) key,
-                          ar->plugin_name, ar->session, ar->plugin_addr,
-                          ar->plugin_addr_len, ar->bandwidth_out,
-                          ar->bandwidth_in);
+                          ar->plugin_name, ar->plugin_addr,
+                          ar->plugin_addr_len, ar->session, ar->bandwidth_out,
+                          ar->bandwidth_in, NULL, 0);
   }
   else
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -331,7 +334,7 @@
  */
 struct GNUNET_ATS_Handle *
 GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                 GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
+                 GNUNET_ATS_AddressSuggestionCallback alloc_cb,
                  void *alloc_cb_cls)
 {
   struct GNUNET_ATS_Handle *atc;

Modified: gnunet/src/ats/ats_api.h
===================================================================
--- gnunet/src/ats/ats_api.h    2011-10-13 08:06:28 UTC (rev 17432)
+++ gnunet/src/ats/ats_api.h    2011-10-13 08:28:15 UTC (rev 17433)
@@ -101,7 +101,7 @@
   /**
    * Function to call when the allocation changes.
    */
-  GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb;
+  GNUNET_ATS_AddressSuggestionCallback alloc_cb;
 
   /**
    * Closure for 'alloc_cb'.

Modified: gnunet/src/include/gnunet_ats_service.h
===================================================================
--- gnunet/src/include/gnunet_ats_service.h     2011-10-13 08:06:28 UTC (rev 
17432)
+++ gnunet/src/include/gnunet_ats_service.h     2011-10-13 08:28:15 UTC (rev 
17433)
@@ -44,65 +44,6 @@
 
 
 /**
- * Signature of a function called by ATS to notify the callee that the
- * assigned bandwidth or address for a given peer was changed.  If the
- * callback is called with address/bandwidth assignments of zero, the
- * ATS disconnect function will still be called once the disconnect
- * actually happened.
- *
- * @param cls closure
- * @param peer identity of the peer
- * @param plugin_name name of the transport plugin, NULL to disconnect
- * @param session session to use (if available)
- * @param plugin_addr address to use (if available)
- * @param plugin_addr_len number of bytes in addr
- * @param bandwidth_out assigned outbound bandwidth for the connection
- * @param bandwidth_in assigned inbound bandwidth for the connection
- */
-typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification) (void *cls,
-                                                             const struct
-                                                             
GNUNET_PeerIdentity
-                                                             * peer,
-                                                             const char
-                                                             *plugin_name,
-                                                             struct Session *
-                                                             session,
-                                                             const void
-                                                             *plugin_addr,
-                                                             size_t
-                                                             plugin_addr_len,
-                                                             struct
-                                                             
GNUNET_BANDWIDTH_Value32NBO
-                                                             bandwidth_out,
-                                                             struct
-                                                             
GNUNET_BANDWIDTH_Value32NBO
-                                                             bandwidth_in);
-
-
-/**
- * Initialize the ATS subsystem.
- *
- * @param cfg configuration to use
- * @param alloc_cb notification to call whenever the allocation changed
- * @param alloc_cb_cls closure for 'alloc_cb'
- * @return ats context
- */
-struct GNUNET_ATS_Handle *
-GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                 GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
-                 void *alloc_cb_cls);
-
-
-/**
- * Shutdown the ATS subsystem.
- *
- * @param atc handle
- */
-void
-GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc);
-
-
-/**
  * Signature of a function that takes an address suggestion
  *
  * @param cls closure
@@ -136,6 +77,29 @@
 
 
 /**
+ * Initialize the ATS subsystem.
+ *
+ * @param cfg configuration to use
+ * @param alloc_cb notification to call whenever the allocation changed
+ * @param alloc_cb_cls closure for 'alloc_cb'
+ * @return ats context
+ */
+struct GNUNET_ATS_Handle *
+GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                 GNUNET_ATS_AddressSuggestionCallback alloc_cb,
+                 void *alloc_cb_cls);
+
+
+/**
+ * Shutdown the ATS subsystem.
+ *
+ * @param atc handle
+ */
+void
+GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc);
+
+
+/**
  * Handle to cancel suggestion request.
  */
 struct GNUNET_ATS_SuggestionContext;




reply via email to

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