/* Prometheus QoS - you can "steal fire" from your ISP */\r
/* "fair-per-IP" quality of service (QoS) utility */\r
/* requires Linux 2.4.x or 2.6.x with HTB support */\r
-/* Copyright(C) 2005-2015 Michael Polak, Arachne Aerospace */\r
+/* Copyright(C) 2005-2017 Michael Polak, Arachne Aerospace */\r
/* iptables-restore support Copyright(C) 2007-2008 ludva */\r
/* Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf */\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
option("hosts",hosts);\r
option("downstream-interfaces-list-filename",downstreamfile);\r
option("upstream-interfaces-list-filename",upstreamfile);\r
- option("macros-filename",upstreamfile);\r
+ option("macros-filename",macrosfile);\r
option("ip6-prefix",ip6prefix);\r
option("medium",medium);\r
ioption("hall-of-fame-enable",hall_of_fame);\r
\r
printf("\n\\r
Prometheus QoS - \"fair-per-IP\" Quality of Service setup utility.\n\\r
-Version %s - Copyright (C)2005-2015 Michael Polak, Arachne Labs\n\\r
+Version %s - Copyright (C)2005-2017 Michael Polak, Arachne Labs\n\\r
iptables-restore & burst tunning & classify modification by Ludva\n\\r
Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);\r
\r
/*-----------------------------------------------------------------*/\r
printf("Parsing downstream interfaces list %s ...\n", downstreamfile);\r
/*-----------------------------------------------------------------*/\r
- parse(upstreamfile)\r
+ parse(downstreamfile)\r
{\r
ptr = parse_datafile_line(_);\r
if(ptr)\r
interface->chain = "POSTROUTING";\r
interface->idxprefix = "post";\r
push(interface, interfaces);\r
- printf("Upstream interface %s: medium %s capacity %ld kbps\n", interface->name, medium, interface->speed);\r
+ printf("Downstream interface %s: medium %s capacity %ld kbps\n", interface->name, medium, interface->speed);\r
}\r
}\r
done; /* ugly macro end */\r
chain, ip->addr, ip->mask, interface->name, limit_pkts);\r
iptables_save_line(str, ip->v6);\r
\r
- /* classify overlimit packets to separate overlimit class */\r
- sprintf(str, "-A %s -d %s/%d -o %s -j %s%d",\r
- chain, ip->addr, ip->mask,\r
- interface->name, mark_iptables, OVERLIMIT_CLASS);\r
- iptables_save_line(str, ip->v6);\r
-\r
- sprintf(str, "-A %s -d %s/%d -o %s -j ACCEPT",\r
- chain, ip->addr, ip->mask, interface->name);\r
- iptables_save_line(str, ip->v6);\r
+ if(limit_pkts)\r
+ {\r
+ /* classify overlimit packets to separate overlimit class */\r
+ sprintf(str, "-A %s -d %s/%d -o %s -j %s%d",\r
+ chain, ip->addr, ip->mask,\r
+ interface->name, mark_iptables, OVERLIMIT_CLASS);\r
+ iptables_save_line(str, ip->v6);\r
+\r
+ sprintf(str, "-A %s -d %s/%d -o %s -j ACCEPT",\r
+ chain, ip->addr, ip->mask, interface->name);\r
+ iptables_save_line(str, ip->v6);\r
+ }\r
\r
if(ip->min)\r
{\r
/* tc handle 1 fw flowid */\r
sprintf(str,"%s filter add dev %s parent 1:0 protocol ip handle %d fw flowid 1:%d", tc, interface->name, FREE_CLASS, FREE_CLASS);\r
safe_run(str);\r
-\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
- safe_run(str);\r
}\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
+ safe_run(str);\r
} \r
printf("Total IP count: %d\n", i);\r
run_iptables_restore();\r