/* 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-2012 Michael Polak, Arachne Labs */\r
+/* Copyright(C) 2005-2013 Michael Polak, Arachne Labs */\r
/* iptables-restore support Copyright(C) 2007-2008 ludva */\r
/* Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf */\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
\r
-/* Modified by: xChaos, 20121011\r
+/* Modified by: xChaos, 20130107\r
ludva, 20080415\r
\r
Prometheus QoS is free software; you can redistribute it and/or\r
/* C source code development versions ("beta"): 0.7.9-a, 0.8.1-b, etc. */\r
/* C source code release versions: 0.8.0, 0.8.2, 0.8.4, etc. */\r
\r
-const char *stats_html_signature = "<span class=\"small\">Statistics generated by Prometheus QoS version %s<br />GPL+Copyright(C)2005-2012 Michael Polak, <a target=\"_blank\" href=\"http://www.arachne.cz/\">Arachne Labs</a></span>\n";\r
+const char *stats_html_signature = "<span class=\"small\">Statistics generated by Prometheus QoS version %s<br />GPL+Copyright(C)2005-2013 Michael Polak, <a target=\"_blank\" href=\"http://www.arachne.cz/\">Arachne Labs</a></span>\n";\r
\r
/* ======= Help screen is hopefuly self-documenting part of code :-) ======= */\r
\r
keyword->leaf_discipline="";\r
\r
push(keyword,keywords);\r
- if(!defaultkeyword) defaultkeyword=keyword;\r
+ if(!defaultkeyword)\r
+ {\r
+ defaultkeyword=keyword;\r
+ }\r
keywordcount++;\r
\r
kwd=NULL;\r
else \r
{\r
TheIP();\r
- ip->addr=ipaddr;\r
+ ip->addr = ipaddr;\r
if(eq(ip->addr,"0.0.0.0/0"))\r
{\r
- ip->name="(unregistered)";\r
- ip->min=free_min;\r
- ip->max=ip->desired=free_max;\r
+ ip->name = "(unregistered)";\r
+ ip->min = free_min;\r
+ ip->max = ip->desired=free_max;\r
+ }\r
+ else\r
+ {\r
+ ip->name = ipaddr;\r
}\r
}\r
\r
\r
for_each(ip, ips) if(ip->min == group->min && ip->max > ip->min)\r
{\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->realquota=ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20));\r
+ if( ip->keyword->data_limit \r
+ and not ip->fixedprio \r
+ and ip->traffic > ip->realquota )\r
{\r
- if(group_rate<ip->max)\r
+ if(group_rate < ip->max)\r
{\r
- ip->max=group_rate;\r
+ ip->max = group_rate;\r
}\r
group_rate+=magic_treshold;\r
ip->prio=lowest_priority;\r
/*-----------------------------------------------------------------*/\r
printf("Writing statistics into HTML page %s ...\n", html);\r
/*-----------------------------------------------------------------*/\r
- write_htmlandlogs(json_traffic,d,total, just_preview);\r
+ write_htmlandlogs(html, d,total, just_preview);\r
\r
if(just_preview)\r
{\r