/* Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf */\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
\r
-/* Modified by: xChaos, 20200107\r
+/* Modified by: xChaos, 20220327\r
ludva, 20080415\r
\r
Prometheus QoS is free software; you can redistribute it and/or\r
#include "cll1-0.6.2.h"\r
#include "ipstruct.h"\r
\r
-const char *version = "1.0.0-a";\r
+const char *version = "1.0.0-b";\r
\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
/* Versions: 0.9.0 is development release, 1.0 will be "stable" */\r
int qos_free_delay = 0; /* seconds to sleep before applying new QoS rules */\r
int digital_divide = 2; /* controls digital divide weirdness ratio, 1...3 */ \r
int max_nesting = 5; /* /include/uapi/linux/pkt_sched.h: #define TC_HTB_MAXDEPTH 8 [... - 3 parent classes] */\r
-int htb_r2q = 256; /* should work for leaf values 512 kbps to 8 Mbps */\r
+//obsolete: int htb_r2q = 256; /* should work for leaf values 512 kbps to 8 Mbps */\r
+int htb_quantum = 1514; /* MTU + ethernet header */\r
int burst = 8; /* HTB burst (in kbits) */\r
int burst_main = 64;\r
int burst_group = 32;\r
ioption("htb-burst-main",burst_main);\r
ioption("htb-burst-group",burst_group);\r
ioption("htb-nesting-limit",max_nesting);\r
- ioption("htb-r2q",htb_r2q);\r
+ ioption("htb-quantum",htb_quantum);\r
ioption("magic-include-upload",include_upload);\r
ioption("magic-treshold",magic_treshold); \r
option("filter-type", cnf); \r
}\r
\r
\r
-/* ========== This function executes, logs OR ALSO prints command ========== */\r
+/* ========== This function executes, logs or also prints command ========== */\r
\r
void safe_run(char *cmd)\r
{\r
\r
for_each(interface, interfaces)\r
{\r
- sprintf(str, "%s qdisc add dev %s root handle 1: htb r2q %d default 1",\r
- tc, interface->name, htb_r2q);\r
+ sprintf(str, "%s qdisc add dev %s root handle 1: htb default 1",\r
+ tc, interface->name);\r
safe_run(str);\r
\r
- sprintf(str, "%s class add dev %s parent 1: classid 1:2 htb rate %s ceil %s burst %dk prio %d",\r
- tc, interface->name, medium, medium, burst_main, highest_priority);\r
+ sprintf(str, "%s class add dev %s parent 1: classid 1:2 htb rate %s ceil %s burst %dk prio %d quantum %d",\r
+ tc, interface->name, medium, medium, burst_main, highest_priority, htb_quantum);\r
safe_run(str);\r
\r
- sprintf(str, "%s class add dev %s parent 1:2 classid 1:1 htb rate %Ldkbit ceil %Ldkbit burst %dk prio %d",\r
- tc, interface->name, interface->speed, interface->speed, burst_main, highest_priority);\r
+ sprintf(str, "%s class add dev %s parent 1:2 classid 1:1 htb rate %Ldkbit ceil %Ldkbit burst %dk prio %d quantum %d",\r
+ tc, interface->name, interface->speed, interface->speed, burst_main, highest_priority, htb_quantum);\r
safe_run(str);\r
}\r
}\r
{\r
if(!just_preview)\r
{\r
- sprintf(str, "%s class add dev %s parent 1:%d classid 1:%d htb rate %Ldkbit ceil %Ldkbit burst %dk prio %d #down desired %d", \r
- tc, interface->name, parent, group->id, rate, max, burst_group, highest_priority+1, group->desired);\r
+ sprintf(str, "%s class add dev %s parent 1:%d classid 1:%d htb rate %Ldkbit ceil %Ldkbit burst %dk prio %d quantum %d #down desired %d", \r
+ tc, interface->name, parent, group->id, rate, max, burst_group, highest_priority+1, htb_quantum, group->desired);\r
safe_run(str);\r
}\r
\r
{\r
printf("[down %s: %dk-%dk wants %d]", interface->name, ip->min, ip->max, ip->desired);\r
}\r
- sprintf(str, "%s class change dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d", \r
- tc, interface->name, ip->group, ip->mark, ip->min, ip->max, burst, ip->prio);\r
+ sprintf(str, "%s class change dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d quantum %d", \r
+ tc, interface->name, ip->group, ip->mark, ip->min, ip->max, burst, ip->prio, htb_quantum);\r
safe_run(str);\r
}\r
else\r
(int)((ip->desired/ip->keyword->asymetry_ratio)-ip->keyword->asymetry_fixed),\r
(int)((ip->desired/ip->keyword->asymetry_ratio)-ip->keyword->asymetry_fixed));\r
}\r
- sprintf(str,"%s class change dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d",\r
+ sprintf(str,"%s class change dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d quantum %d",\r
tc, interface->name, ip->group, ip->mark,\r
(int)((ip->min/ip->keyword->asymetry_ratio)-ip->keyword->asymetry_fixed),\r
- (int)((ip->max/ip->keyword->asymetry_ratio)-ip->keyword->asymetry_fixed), burst, ip->prio);\r
+ (int)((ip->max/ip->keyword->asymetry_ratio)-ip->keyword->asymetry_fixed), burst, ip->prio, htb_quantum);\r
safe_run(str);\r
}\r
}\r
printf("[down: %dk-%dk]", ip->min, ip->max);\r
#endif\r
\r
- sprintf(str, "%s class add dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d", \r
- tc, interface->name, ip->group, ip->mark, ip->min, ip->max, burst, ip->prio);\r
+ sprintf(str, "%s class add dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d quantum %d", \r
+ tc, interface->name, ip->group, ip->mark, ip->min, ip->max, burst, ip->prio, htb_quantum);\r
safe_run(str);\r
\r
if(strcmpi(ip->keyword->leaf_discipline, "none"))\r
/*-----------------------------------------------------------------*/\r
puts("Generating free bandwith class ...");\r
/*-----------------------------------------------------------------*/\r
- sprintf(str, "%s class add dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d",\r
- tc, interface->name, parent, FREE_CLASS, free_min, free_max,burst, lowest_priority);\r
+ sprintf(str, "%s class add dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d quantum %d",\r
+ tc, interface->name, parent, FREE_CLASS, free_min, free_max,burst, lowest_priority, htb_quantum);\r
safe_run(str);\r
/* tc SFQ */\r
if(strcmpi(qos_leaf, "none"))\r
/*-----------------------------------------------------------------*/\r
puts("Generating bandwith class for overlimit packets...");\r
/*-----------------------------------------------------------------*/\r
- sprintf(str, "%s class add dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d",\r
- tc, interface->name, parent, OVERLIMIT_CLASS, overlimit_min, overlimit_max, burst, lowest_priority);\r
+ sprintf(str, "%s class add dev %s parent 1:%d classid 1:%d htb rate %dkbit ceil %dkbit burst %dk prio %d quantum %d",\r
+ tc, interface->name, parent, OVERLIMIT_CLASS, overlimit_min, overlimit_max, burst, lowest_priority, htb_quantum);\r
safe_run(str);\r
} \r
printf("Total IP count: %d\n", i);\r