gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r26024 - in gnunet/src: include transport
Date: Tue, 5 Feb 2013 17:02:05 +0100

Author: wachs
Date: 2013-02-05 17:02:05 +0100 (Tue, 05 Feb 2013)
New Revision: 26024

Modified:
   gnunet/src/include/gnunet_transport_service.h
   gnunet/src/transport/transport_api.c
Log:
docu


Modified: gnunet/src/include/gnunet_transport_service.h
===================================================================
--- gnunet/src/include/gnunet_transport_service.h       2013-02-05 15:53:24 UTC 
(rev 26023)
+++ gnunet/src/include/gnunet_transport_service.h       2013-02-05 16:02:05 UTC 
(rev 26024)
@@ -289,6 +289,31 @@
                                                                const struct 
GNUNET_PeerIdentity *peer);
 
 
+/**
+ * Set transport metrics for a peer and a direction
+ *
+ * @param handle transport handle
+ * @param peer the peer to set the metric for
+ * @param direction can be: TM_SEND, TM_RECV, TM_BOTH
+ * @param ats the metric as ATS information
+ * @param ats_count the number of metrics
+ *
+ * Supported ATS values:
+ * GNUNET_ATS_QUALITY_NET_DELAY  (value in ms)
+ * GNUNET_ATS_QUALITY_NET_DISTANCE (value in #hops)
+ *
+ * Example
+ * To enforce a delay of 10 ms for peer p1 in sending direction use:
+ *
+ * struct GNUNET_ATS_Information ats;
+ * ats.type = ntohl (GNUNET_ATS_QUALITY_NET_DELAY);
+ * ats.value = ntohl (10);
+ * GNUNET_TRANSPORT_set_traffic_metric (th, p1, TM_SEND, &ats, 1);
+ *
+ * Note:
+ * Delay restrictions in receiving direction will be enforced with
+ * 1 message delay.
+ */
 void
 GNUNET_TRANSPORT_set_traffic_metric (struct GNUNET_TRANSPORT_Handle *handle,
                                                                                
                                                                const struct 
GNUNET_PeerIdentity *peer,

Modified: gnunet/src/transport/transport_api.c
===================================================================
--- gnunet/src/transport/transport_api.c        2013-02-05 15:53:24 UTC (rev 
26023)
+++ gnunet/src/transport/transport_api.c        2013-02-05 16:02:05 UTC (rev 
26024)
@@ -1207,6 +1207,32 @@
   return ssize;
 }
 
+
+/**
+ * Set transport metrics for a peer and a direction
+ *
+ * @param handle transport handle
+ * @param peer the peer to set the metric for
+ * @param direction can be: TM_SEND, TM_RECV, TM_BOTH
+ * @param ats the metric as ATS information
+ * @param ats_count the number of metrics
+ *
+ * Supported ATS values:
+ * GNUNET_ATS_QUALITY_NET_DELAY  (value in ms)
+ * GNUNET_ATS_QUALITY_NET_DISTANCE (value in #hops)
+ *
+ * Example
+ * To enforce a delay of 10 ms for peer p1 in sending direction use:
+ *
+ * struct GNUNET_ATS_Information ats;
+ * ats.type = ntohl (GNUNET_ATS_QUALITY_NET_DELAY);
+ * ats.value = ntohl (10);
+ * GNUNET_TRANSPORT_set_traffic_metric (th, p1, TM_SEND, &ats, 1);
+ *
+ * Note:
+ * Delay restrictions in receiving direction will be enforced with
+ * 1 message delay.
+ */
 void
 GNUNET_TRANSPORT_set_traffic_metric (struct GNUNET_TRANSPORT_Handle *handle,
                                                                                
                                                                const struct 
GNUNET_PeerIdentity *peer,




reply via email to

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