cleanup
[linux-2.4.21-pre4.git] / include / net1 / qmgt_red.h
1 #ifndef __QMGT_RED__ //added by ARGAY\r
2 #define __QMGT_RED__ //added by ARGAY\r
3 \r
4 \r
5 typedef struct t_qmgt_RED\r
6 {\r
7 \r
8         /* RED parameters: unit= 1/1000000 */\r
9         u_int32_t wq;                           /* weighted average */\r
10         u_int32_t minthp;                       /* the proportion of minimum threshold to buf_len */\r
11         u_int32_t maxthp;                       /* the proportion of maximum threshold to buf_len */\r
12         u_int32_t maxp;                         /* maximum value of dropping probability */\r
13         \r
14         /* average queue size */\r
15         u_int64_t avg_qlen;                     /* average queue length */\r
16         u_int32_t minth;                        /* minimum threshold for queue */\r
17         u_int32_t maxth;                        /* maximum threshold for queue */\r
18         \r
19 }Qmgt_RED;\r
20 \r
21 \r
22 //Added by ARGAY\r
23 /******************************************************************************/\r
24 //set all members pf Qmgt_RED to 0\r
25 void RED_init(Qmgt_RED* x);\r
26 \r
27 \r
28 \r
29 //set RED parameters\r
30 //return value: 0 -- valid value        -1 -- invalid value\r
31 int RED_modparam(Qmgt_RED* x,int buf_len,int wq,int minthp,int maxthp,int maxp);\r
32 \r
33 \r
34 \r
35 //modify RED's minth and maxth according to the buf_len\r
36 //return value: 1 -- valid value        -1 -- invalid value\r
37 int RED_modbuflen(Qmgt_RED* x,int buf_len);\r
38 \r
39 \r
40 //RED algorithm\r
41 //return value: 0 -- pass the arriving packet   -1 -- drop the arriving packet\r
42 int RED(Qmgt_RED* x,int curr_qlen);\r
43 /******************************************************************************/\r
44 \r
45 \r
46 #endif //added by ARGAY\r