int asymetry_ratio; /* ratio for ADSL-like upload */\r
int asymetry_fixed; /* fixed treshold for ADSL-like upload */\r
int data_limit; /* hard shaping: apply magic_treshold if max*data_limit MB exceeded */\r
- int prio_limit; /* soft shaping (qos): reduce HTB prio if max*prio_limit MB exceeded */\r
+ int data_prio; /* soft shaping (qos): reduce HTB prio if max*data_prio MB exceeded */\r
long fixed_limit; /* fixed data limit for setting lower HTB ceil */\r
long fixed_prio; /* fixed data lmit for setting lower HTB prio */\r
int reserve_min; /* bonus for nominal HTB rate bandwidth (in kbps) */\r
keyword->asymetry_ratio=1; /* ratio for ADSL-like upload */\r
keyword->asymetry_fixed=0; /* fixed treshold for ADSL-like upload */\r
keyword->data_limit=8; /* hard shaping: apply magic_treshold if max*data_limit MB exceeded */\r
- keyword->prio_limit=4; /* soft shaping (qos): reduce HTB prio if max*prio_limit MB exceeded */\r
+ keyword->data_prio=4; /* soft shaping (qos): reduce HTB prio if max*data_prio MB exceeded */\r
keyword->fixed_limit=0; /* fixed data limit for setting lower HTB ceil */\r
keyword->fixed_prio=0; /* fixed data limit for setting lower HTB prio */\r
keyword->reserve_min=8; /* bonus for nominal HTB rate bandwidth (in kbps) */\r
ioption("asymetry-ratio",keyword->asymetry_ratio);\r
ioption("asymetry-treshold",keyword->asymetry_fixed);\r
ioption("magic-relative-limit",keyword->data_limit);\r
- ioption("magic-relative-prio",keyword->prio_limit);\r
+ ioption("magic-relative-prio",keyword->data_prio);\r
loption("magic-fixed-limit",keyword->fixed_limit);\r
loption("magic-fixed-prio",keyword->fixed_prio);\r
ioption("htb-default-prio",keyword->default_prio);\r
_=tmptr;\r
\r
if(keyword->data_limit || keyword->fixed_limit || \r
- keyword->prio_limit || keyword->fixed_prio)\r
+ keyword->data_prio || keyword->fixed_prio)\r
use_credit=1;\r
\r
\r
\r
search(ip, ips, ip->min==group->min && ip->max>ip->min)\r
{\r
- if(ip->keyword->data_limit>0 &&\r
+ if( ip->keyword->data_limit && !ip->fixedprio &&\r
ip->traffic>ip->credit+\r
- (ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)) \r
- && !ip->fixedprio)\r
+ (ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)) )\r
{\r
if(group_rate<ip->max) ip->max=group_rate;\r
group_rate+=magic_treshold;\r
}\r
else\r
{\r
- if(ip->traffic>ip->credit+\r
- (ip->min*ip->keyword->prio_limit+(ip->keyword->fixed_prio<<20)) && \r
- !ip->fixedprio)\r
+ if( keyword->data_prio && !ip->fixedprio &&\r
+ ip->traffic>ip->credit+\r
+ (ip->min*ip->keyword->data_prio+(ip->keyword->fixed_prio<<20)) )\r
{\r
ip->prio=priority_sequence--;\r
if(ip->prio<2) ip->prio=2;\r
if(credit_file)\r
{\r
unsigned long long lcredit=0;\r
+ \r
if((ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))>ip->traffic) \r
lcredit=(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))-ip->traffic;\r
fprintf(credit_file,"%s %Lu\n",ip->addr,lcredit);\r