gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13086 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r13086 - gnunet/src/transport
Date: Tue, 28 Sep 2010 17:53:26 +0200

Author: wachs
Date: 2010-09-28 17:53:26 +0200 (Tue, 28 Sep 2010)
New Revision: 13086

Modified:
   gnunet/src/transport/plugin_transport.h
Log:
Added cost_report to plugin environment for ATS


Modified: gnunet/src/transport/plugin_transport.h
===================================================================
--- gnunet/src/transport/plugin_transport.h     2010-09-28 15:50:32 UTC (rev 
13085)
+++ gnunet/src/transport/plugin_transport.h     2010-09-28 15:53:26 UTC (rev 
13086)
@@ -35,7 +35,9 @@
 #include "gnunet_scheduler_lib.h"
 #include "gnunet_statistics_service.h"
 #include "gnunet_transport_service.h"
+#include "transport_selection.h"
 
+
 /**
  * Opaque pointer that plugins can use to distinguish specific
  * connections to a given peer.  Typically used by stateful plugins to
@@ -159,6 +161,23 @@
 
 
 /**
+ * Function called whenever the plugin has to notify ATS about costs for using 
this transport
+ *
+ * The cost will be passed as struct GNUNET_ATS_Cost_Information[]
+ * This array is 0-terminated, so the last element will be a pair:
+ * ((cost->cost_type==GNUNET_ATS_ARRAY_TERMINATOR) && cost->cost_value==0))
+ *
+ * @param cls closure
+ * @param peer peer
+ * @param cost pointer to the first element of struct 
GNUNET_ATS_Cost_Information[]
+ */
+typedef void (*GNUNET_TRANSPORT_CostReport) (void *cls,
+                                                                               
         const struct GNUNET_PeerIdentity *peer,
+                                             const void *addr,
+                                             uint16_t addrlen,
+                                                                               
         struct GNUNET_ATS_Cost_Information * cost);
+
+/**
  * The transport service will pass a pointer to a struct
  * of this type as the first and only argument to the
  * entry point of each transport plugin.
@@ -222,6 +241,11 @@
   GNUNET_TRANSPORT_SessionEnd session_end;
 
   /**
+   * Inform service about costs for using this transport plugin
+   */
+  GNUNET_TRANSPORT_CostReport cost_report;
+
+  /**
    * What is the maximum number of connections that this transport
    * should allow?  Transports that do not have sessions (such as
    * UDP) can ignore this value.




reply via email to

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