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