OpenVPN
Data Structures | Macros | Functions
shaper.h File Reference
#include "basic.h"
#include "integer.h"
#include "misc.h"
#include "error.h"
#include "interval.h"
Include dependency graph for shaper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  shaper
 

Macros

#define SHAPER_MIN   100 /* bytes per second */
 
#define SHAPER_MAX   100000000
 
#define SHAPER_MAX_TIMEOUT   10 /* seconds */
 
#define SHAPER_USE_FP
 

Functions

void shaper_msg (struct shaper *s)
 
void shaper_reset_wakeup (struct shaper *s)
 
bool shaper_soonest_event (struct timeval *tv, int delay)
 
static void shaper_reset (struct shaper *s, int bytes_per_second)
 
static void shaper_init (struct shaper *s, int bytes_per_second)
 
static int shaper_current_bandwidth (struct shaper *s)
 
static int shaper_delay (struct shaper *s)
 
static void shaper_wrote_bytes (struct shaper *s, int nbytes)
 

Macro Definition Documentation

◆ SHAPER_MAX

#define SHAPER_MAX   100000000

Definition at line 41 of file shaper.h.

Referenced by add_option(), and shaper_reset().

◆ SHAPER_MAX_TIMEOUT

#define SHAPER_MAX_TIMEOUT   10 /* seconds */

Definition at line 43 of file shaper.h.

Referenced by shaper_delay(), and shaper_wrote_bytes().

◆ SHAPER_MIN

#define SHAPER_MIN   100 /* bytes per second */

Definition at line 40 of file shaper.h.

Referenced by add_option(), and shaper_reset().

◆ SHAPER_USE_FP

#define SHAPER_USE_FP

Definition at line 45 of file shaper.h.

Function Documentation

◆ shaper_current_bandwidth()

static int shaper_current_bandwidth ( struct shaper s)
inlinestatic

Definition at line 93 of file shaper.h.

References shaper::bytes_per_second.

◆ shaper_delay()

static int shaper_delay ( struct shaper s)
inlinestatic

◆ shaper_init()

static void shaper_init ( struct shaper s,
int  bytes_per_second 
)
inlinestatic

Definition at line 86 of file shaper.h.

References shaper_reset(), and shaper_reset_wakeup().

Referenced by do_init_traffic_shaper().

◆ shaper_msg()

void shaper_msg ( struct shaper s)

Definition at line 90 of file shaper.c.

References shaper::bytes_per_second, M_INFO, and msg.

Referenced by do_init_traffic_shaper().

◆ shaper_reset()

static void shaper_reset ( struct shaper s,
int  bytes_per_second 
)
inlinestatic

Definition at line 74 of file shaper.h.

References shaper::bytes_per_second, constrain_int(), shaper::factor, SHAPER_MAX, and SHAPER_MIN.

Referenced by shaper_init(), and shaper_wrote_bytes().

◆ shaper_reset_wakeup()

void shaper_reset_wakeup ( struct shaper s)

Definition at line 84 of file shaper.c.

References CLEAR, and shaper::wakeup.

Referenced by shaper_init().

◆ shaper_soonest_event()

bool shaper_soonest_event ( struct timeval *  tv,
int  delay 
)

Definition at line 39 of file shaper.c.

References D_SHAPER_DEBUG, and dmsg.

Referenced by io_wait_dowork().

◆ shaper_wrote_bytes()

static void shaper_wrote_bytes ( struct shaper s,
int  nbytes 
)
inlinestatic