From 2d1141371d8f714276b8b17ff3d55a5dfc91b900 Mon Sep 17 00:00:00 2001 From: xchaos Date: Sun, 4 May 2008 10:04:04 +0000 Subject: [PATCH] ahem git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@85 251d49ef-1d17-4917-a970-b30cf55b089b --- prometheus.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/prometheus.c b/prometheus.c index 8a567a1..5b90528 100644 --- a/prometheus.c +++ b/prometheus.c @@ -33,32 +33,34 @@ #include "cll1-0.6.h" -const char *version="0.7.9-c"; +const char *version = "0.7.9-c"; /* Version numbers: 0.7.9 will be last development ("beta"), 0.8.0 first stable */ /* Debian(RPM) package versions/patchlevels: 0.7.9-2, 0.8.0-1, 0.8.0-2, etc. */ /* C source code development versions ("beta"): 0.7.9-a, 0.8.1-b, etc. */ /* C source code release versions: 0.8.0, 0.8.2, 0.8.4, etc. */ +const char *stats_html_signature = "Statistics generated by Prometheus QoS version %s
GPL+Copyright(C)2005-2008 Michael Polak, Arachne Labs
\n"; + /* ======= All path names are defined here (for RPM patch) ======= */ -char *tc = "/sbin/tc"; /* requires tc with HTB support */ -char *iptables = "/sbin/iptables"; /* requires iptables utility */ -char *iptablessave = "/sbin/iptables-save"; /* not yet required */ +char *tc = "/sbin/tc"; /* requires tc with HTB support */ +char *iptables = "/sbin/iptables"; /* requires iptables utility */ +char *iptablessave = "/sbin/iptables-save"; /* not yet required */ char *iptablesrestore = "/sbin/iptables-restore"; /* requires iptables-restore */ -char *ls = "/bin/ls"; /* this is not user configurable :-) */ +char *ls = "/bin/ls"; /* this is not user configurable :-) */ -char *config = "/etc/prometheus/prometheus.conf"; /* main configuration file */ -char *hosts = "/etc/prometheus/hosts"; /* per-IP bandwidth definition file */ +char *config = "/etc/prometheus/prometheus.conf"; /* main configuration file */ +char *hosts = "/etc/prometheus/hosts"; /* per-IP bandwidth definition file */ -char *iptablesfile = "/var/spool/prometheus.iptables"; /* temporary file for iptables-restore*/ -char *credit = "/var/lib/misc/prometheus.credit"; /* credit log file */ -char *html = "/var/www/traffic.html"; /* hall of fame filename */ -char *preview = "/var/www/preview.html"; /* hall of fame preview */ -char *cmdlog = "/var/log/prometheuslog"; /* command log filename */ -char *log_dir = "/var/www/logs/"; /* log directory pathname, ended with slash */ -char *log_url = "logs/"; /* log directory relative URI prefix (partial URL) */ -char *html_log_dir = "/var/www/logs/html/"; +char *iptablesfile = "/var/spool/prometheus.iptables"; /* temporary file for iptables-restore*/ +char *credit = "/var/lib/misc/prometheus.credit"; /* credit log file */ +char *html = "/var/www/traffic.html"; /* hall of fame filename */ +char *preview = "/var/www/preview.html"; /* hall of fame preview */ +char *cmdlog = "/var/log/prometheuslog"; /* command log filename */ +char *log_dir = "/var/www/logs/"; /* log directory pathname, ended with slash */ +char *log_url = "logs/"; /* log directory relative URI prefix (partial URL) */ +char *html_log_dir = "/var/www/logs/html/"; /* ======= Help screen is hopefuly self-documenting part of code :-) ======= */ @@ -707,7 +709,7 @@ void parse_ip_log(int argc, char **argv) case 7: case 8: case 9: - case 10: if (isalnum(*ptr)) /* alphanumeric string = date, just one*/ + case 10: if (isalpha(*ptr)) /* character, not numeric string = date, just one*/ { valid_columns(ptr2,ptr,' ',col2) switch(col2) { @@ -755,7 +757,8 @@ void parse_ip_log(int argc, char **argv) total+=iplog->traffic>>10; } fprintf(f,"Total:%ld GB%Ld kbps\n", total, line); - fputs("\n",f); + fputs("\n", f); + fprintf(f, stats_html_signature, version); fclose(f); puts(" done."); } @@ -1467,9 +1470,9 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); fprintf(f,"All users, all traffic\n"); fprintf(f,"%d100 %%%Lu M100 %%\n",active_classes,total); - fputs("\n",f); + fputs("\n", f); } - fprintf(f,"Statistics generated by Prometheus QoS version %s
GPL+Copyright(C)2005-2008 Michael Polak, Arachne Labs
\n",version); + fprintf(f, stats_html_signature, version); fclose(f); } -- 2.30.2