summaryrefslogtreecommitdiff
path: root/accel-pppd/shaper/shaper.h
blob: 41e6e4370f0d43b02bf2820af854b8453d9d3341 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef __SHAPER_H
#define __SHAPER_H

#define LIM_POLICE 0
#define LIM_TBF 1
#define LIM_HTB 2

#define LEAF_QDISC_SFQ 1

struct rtnl_handle;
struct nlmsghdr;

struct qdisc_opt
{
	char *kind;
	int handle;
	int parent;
	double latency;
	int rate;
	int buffer;
	int quantum;
	int defcls;
	int (*qdisc)(struct qdisc_opt *opt, struct nlmsghdr *n);
};	

extern int conf_up_limiter;
extern int conf_down_limiter;

extern double conf_down_burst_factor;
extern double conf_up_burst_factor;
extern double conf_latency;
extern int conf_mpu;
extern int conf_quantum;
extern int conf_r2q;
extern int conf_cburst;
extern int conf_ifb_ifindex;
extern int conf_leaf_qdisc;
extern int conf_lq_arg1;
extern int conf_lq_arg2;
extern int conf_lq_arg3;

int install_limiter(struct ppp_t *ppp, int down_speed, int down_burst, int up_speed, int up_burst);
int remove_limiter(struct ppp_t *ppp);
int install_leaf_qdisc(struct rtnl_handle *rth, int ifindex, int parent, int handle);
int init_ifb(const char *);

void leaf_qdisc_parse(const char *);

int tc_qdisc_modify(struct rtnl_handle *rth, int ifindex, int cmd, unsigned flags, struct qdisc_opt *opt);

#endif