Struct to track available bandwidth. More...
#include <gnunet_bandwidth_lib.h>
Data Fields | |
void * | update_cb_cls |
Closure for update_cb. More... | |
GNUNET_BANDWIDTH_TrackerUpdateCallback | update_cb |
Function we call if the tracker's bandwidth is increased and a previously returned timeout might now expire earlier. More... | |
void * | excess_cb_cls |
Closure for excess_cb. More... | |
GNUNET_BANDWIDTH_ExcessNotificationCallback | excess_cb |
Function we call if the tracker is about to throw away bandwidth due to excess (max carry exceeded). More... | |
int64_t | consumption_since_last_update__ |
Number of bytes consumed since we last updated the tracker. More... | |
struct GNUNET_SCHEDULER_Task * | excess_task |
Task scheduled to call the excess_cb once we have reached the maximum bandwidth the tracker can hold. More... | |
struct GNUNET_TIME_Absolute | last_update__ |
Time when we last updated the tracker. More... | |
uint32_t | available_bytes_per_s__ |
Bandwidth limit to enforce in bytes per second. More... | |
uint32_t | max_carry_s__ |
Maximum number of seconds over which bandwidth may "accumulate". More... | |
Struct to track available bandwidth.
Combines a time stamp with a number of bytes transmitted, a quota and a maximum amount that carries over. Not opaque so that it can be inlined into data structures (reducing malloc-ing); however, values should not be accessed directly by clients (hence the '__').
Definition at line 94 of file gnunet_bandwidth_lib.h.
void* GNUNET_BANDWIDTH_Tracker::update_cb_cls |
Closure for update_cb.
Definition at line 99 of file gnunet_bandwidth_lib.h.
Referenced by GNUNET_BANDWIDTH_tracker_init2(), GNUNET_BANDWIDTH_tracker_notification_stop(), and GNUNET_BANDWIDTH_tracker_update_quota().
GNUNET_BANDWIDTH_TrackerUpdateCallback GNUNET_BANDWIDTH_Tracker::update_cb |
Function we call if the tracker's bandwidth is increased and a previously returned timeout might now expire earlier.
Definition at line 105 of file gnunet_bandwidth_lib.h.
Referenced by GNUNET_BANDWIDTH_tracker_init2(), GNUNET_BANDWIDTH_tracker_notification_stop(), and GNUNET_BANDWIDTH_tracker_update_quota().
void* GNUNET_BANDWIDTH_Tracker::excess_cb_cls |
Closure for excess_cb.
Definition at line 110 of file gnunet_bandwidth_lib.h.
Referenced by excess_trigger(), GNUNET_BANDWIDTH_tracker_init2(), and GNUNET_BANDWIDTH_tracker_notification_stop().
GNUNET_BANDWIDTH_ExcessNotificationCallback GNUNET_BANDWIDTH_Tracker::excess_cb |
Function we call if the tracker is about to throw away bandwidth due to excess (max carry exceeded).
Definition at line 116 of file gnunet_bandwidth_lib.h.
Referenced by excess_trigger(), GNUNET_BANDWIDTH_tracker_init2(), GNUNET_BANDWIDTH_tracker_notification_stop(), and update_excess().
int64_t GNUNET_BANDWIDTH_Tracker::consumption_since_last_update__ |
Number of bytes consumed since we last updated the tracker.
Definition at line 121 of file gnunet_bandwidth_lib.h.
Referenced by GNUNET_BANDWIDTH_tracker_consume(), GNUNET_BANDWIDTH_tracker_get_available(), GNUNET_BANDWIDTH_tracker_init2(), update_excess(), and update_tracker().
struct GNUNET_SCHEDULER_Task* GNUNET_BANDWIDTH_Tracker::excess_task |
Task scheduled to call the excess_cb once we have reached the maximum bandwidth the tracker can hold.
Definition at line 127 of file gnunet_bandwidth_lib.h.
Referenced by excess_trigger(), GNUNET_BANDWIDTH_tracker_notification_stop(), and update_excess().
struct GNUNET_TIME_Absolute GNUNET_BANDWIDTH_Tracker::last_update__ |
Time when we last updated the tracker.
Definition at line 132 of file gnunet_bandwidth_lib.h.
Referenced by GNUNET_BANDWIDTH_tracker_get_available(), GNUNET_BANDWIDTH_tracker_init2(), update_excess(), and update_tracker().
uint32_t GNUNET_BANDWIDTH_Tracker::available_bytes_per_s__ |
Bandwidth limit to enforce in bytes per second.
Definition at line 137 of file gnunet_bandwidth_lib.h.
Referenced by GNUNET_BANDWIDTH_tracker_get_available(), GNUNET_BANDWIDTH_tracker_init2(), GNUNET_BANDWIDTH_tracker_update_quota(), update_excess(), and update_tracker().
uint32_t GNUNET_BANDWIDTH_Tracker::max_carry_s__ |
Maximum number of seconds over which bandwidth may "accumulate".
Note that additionally, we also always allow at least GNUNET_MAX_MESSAGE_SIZE to accumulate.
Definition at line 144 of file gnunet_bandwidth_lib.h.
Referenced by GNUNET_BANDWIDTH_tracker_init2(), update_excess(), and update_tracker().