Go to the documentation of this file.
40 #define SHAPER_MIN 100
41 #define SHAPER_MAX 100000000
43 #define SHAPER_MAX_TIMEOUT 10
117 return delay > 0 ? delay : 0;
148 dmsg(
D_SHAPER_DEBUG,
"SHAPER shaper_wrote_bytes bytes=%d delay=%ld sec=%" PRIi64
" usec=%ld",
151 (int64_t)s->
wakeup.tv_sec,
164 shaper_change_pct(
struct shaper *s,
int pct)
167 const int new_bandwidth = orig_bandwidth + (orig_bandwidth * pct / 100);
static int tv_subtract(const struct timeval *tv1, const struct timeval *tv2, const unsigned int max_seconds)
static int shaper_current_bandwidth(struct shaper *s)
static void shaper_wrote_bytes(struct shaper *s, int nbytes)
bool shaper_soonest_event(struct timeval *tv, int delay)
void shaper_reset_wakeup(struct shaper *s)
static void tv_add(struct timeval *dest, const struct timeval *src)
#define SHAPER_MAX_TIMEOUT
static int max_int(int x, int y)
void shaper_msg(struct shaper *s)
static int openvpn_gettimeofday(struct timeval *tv, void *tz)
static int min_int(int x, int y)
static void shaper_reset(struct shaper *s, int bytes_per_second)
static int shaper_delay(struct shaper *s)
static int constrain_int(int x, int min, int max)
static void shaper_init(struct shaper *s, int bytes_per_second)
static bool tv_defined(const struct timeval *tv)