[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17479 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17479 - gnunet/src/ats |
Date: |
Fri, 14 Oct 2011 10:52:15 +0200 |
Author: grothoff
Date: 2011-10-14 10:52:15 +0200 (Fri, 14 Oct 2011)
New Revision: 17479
Modified:
gnunet/src/ats/gnunet-service-ats.c
gnunet/src/ats/gnunet-service-ats_reservations.c
gnunet/src/ats/gnunet-service-ats_reservations.h
Log:
complete reservations API
Modified: gnunet/src/ats/gnunet-service-ats.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats.c 2011-10-14 08:46:34 UTC (rev 17478)
+++ gnunet/src/ats/gnunet-service-ats.c 2011-10-14 08:52:15 UTC (rev 17479)
@@ -27,9 +27,10 @@
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_ats_service.h"
+#include "gnunet-service-ats_addresses.h"
#include "gnunet-service-ats_performance.h"
#include "gnunet-service-ats_scheduling.h"
-#include "gnunet-service-ats_addresses.h"
+#include "gnunet-service-ats_reservations.h"
#include "ats.h"
@@ -97,6 +98,8 @@
{
GAS_addresses_done ();
GAS_scheduling_done ();
+ GAS_performance_done ();
+ GAS_reservations_done ();
}
@@ -126,6 +129,8 @@
GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE, 0},
{NULL, NULL, 0, 0}
};
+ GAS_reservations_init ();
+ GAS_performance_init (server);
GAS_scheduling_init (server);
GAS_addresses_init ();
GNUNET_SERVER_disconnect_notify (server,
Modified: gnunet/src/ats/gnunet-service-ats_reservations.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_reservations.c 2011-10-14 08:46:34 UTC
(rev 17478)
+++ gnunet/src/ats/gnunet-service-ats_reservations.c 2011-10-14 08:52:15 UTC
(rev 17479)
@@ -27,6 +27,17 @@
#include "gnunet-service-ats_reservations.h"
+/**
+ * Reserve the given amount of incoming bandwidth (in bytes) from the
+ * given peer. If a reservation is not possible right now, return how
+ * long the client should wait before trying again.
+ *
+ * @param peer peer to reserve bandwidth from
+ * @param amount number of bytes to reserve
+ * @return 0 if the reservation was successful, FOREVER if the
+ * peer is not connected, otherwise the time to wait
+ * until the reservation might succeed
+ */
struct GNUNET_TIME_Relative
GAS_reservations_reserve (const struct GNUNET_PeerIdentity *peer,
int32_t amount)
@@ -36,4 +47,40 @@
return GNUNET_TIME_UNIT_ZERO;
}
+
+/**
+ * Set the amount of bandwidth the other peer could currently transmit
+ * to us (as far as we know) to the given value.
+ *
+ * @param peer identity of the peer
+ * @param bandwidth_in currently available bandwidth from that peer to
+ * this peer (estimate)
+ */
+void
+GAS_reservations_set_bandwidth (const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
+{
+}
+
+
+
+/**
+ * Initialize reservations subsystem.
+ */
+void
+GAS_reservations_init ()
+{
+}
+
+
+/**
+ * Shutdown reservations subsystem.
+ */
+void
+GAS_reservations_done ()
+{
+}
+
+
+
/* end of gnunet-service-ats_reservations.c */
Modified: gnunet/src/ats/gnunet-service-ats_reservations.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_reservations.h 2011-10-14 08:46:34 UTC
(rev 17478)
+++ gnunet/src/ats/gnunet-service-ats_reservations.h 2011-10-14 08:52:15 UTC
(rev 17479)
@@ -29,9 +29,46 @@
#include "gnunet_util_lib.h"
+/**
+ * Set the amount of bandwidth the other peer could currently transmit
+ * to us (as far as we know) to the given value.
+ *
+ * @param peer identity of the peer
+ * @param bandwidth_in currently available bandwidth from that peer to
+ * this peer (estimate)
+ */
+void
+GAS_reservations_set_bandwidth (const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_BANDWIDTH_Value32NBO
bandwidth_in);
+
+
+/**
+ * Reserve the given amount of incoming bandwidth (in bytes) from the
+ * given peer. If a reservation is not possible right now, return how
+ * long the client should wait before trying again.
+ *
+ * @param peer peer to reserve bandwidth from
+ * @param amount number of bytes to reserve
+ * @return 0 if the reservation was successful, FOREVER if the
+ * peer is not connected, otherwise the time to wait
+ * until the reservation might succeed
+ */
struct GNUNET_TIME_Relative
GAS_reservations_reserve (const struct GNUNET_PeerIdentity *peer,
int32_t amount);
+/**
+ * Initialize reservations subsystem.
+ */
+void
+GAS_reservations_init (void);
+
+
+/**
+ * Shutdown reservations subsystem.
+ */
+void
+GAS_reservations_done (void);
+
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17479 - gnunet/src/ats,
gnunet <=