X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fats%2Fgnunet-service-ats_reservations.h;h=5ddec9bd67181cd61c25b7452b5b1c9ef1bfe25a;hb=f1ca38573f22205e28ac482efebe463696c9c2c7;hp=63b9a593699c29fc92214ddfe9baf0e6f6150738;hpb=d86cd012c0372c1746fed2a50b7cccca9de99be3;p=oweals%2Fgnunet.git diff --git a/src/ats/gnunet-service-ats_reservations.h b/src/ats/gnunet-service-ats_reservations.h index 63b9a5936..5ddec9bd6 100644 --- a/src/ats/gnunet-service-ats_reservations.h +++ b/src/ats/gnunet-service-ats_reservations.h @@ -29,9 +29,47 @@ #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); + int32_t amount); + +/** + * Initialize reservations subsystem. + */ +void +GAS_reservations_init (void); + + +/** + * Shutdown reservations subsystem. + */ +void +GAS_reservations_done (void); #endif