X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=prometheus.c;h=09f547d216480303833d0774fc6f97fd2b2677eb;hb=7642b2051bfc2266b789071d57d6e9f9c0061443;hp=5420588d352e8d6550e0c430305926ea2e33bfc2;hpb=b014f18189d582cd408e0c488ef734a070500e5b;p=svn%2FPrometheus-QoS%2F.git diff --git a/prometheus.c b/prometheus.c index 5420588..09f547d 100644 --- a/prometheus.c +++ b/prometheus.c @@ -7,7 +7,7 @@ /* Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -/* Modified by: xChaos, 20110428 +/* Modified by: xChaos, 20111130 ludva, 20080415 Prometheus QoS is free software; you can redistribute it and/or @@ -33,7 +33,7 @@ #include "cll1-0.6.2.h" -const char *version = "0.8.3"; +const char *version = "0.8.3-b"; /* Version numbers: 0.8.3 is development releases ("beta"), 0.8.4 will be "stable" */ /* Debian(RPM) package versions/patchlevels: 0.7.9-2, 0.8.0-1, 0.8.0-2, etc. */ @@ -1511,6 +1511,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); printf("Sorting data and generating statistics page %s ...\n",ptr); /*-----------------------------------------------------------------*/ + fputs("\n",f); fputs("\n\n",f); fprintf(f,"\n",keywordcount); fputs("\n",f); @@ -1525,7 +1526,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); for_each(keyword,keywords) { - fprintf(f,"",keyword->html_color,group->min*keyword->data_limit); + fprintf(f,"",keyword->html_color,group->min*keyword->data_limit); } i+=group->desired; total+=group->count; @@ -1554,11 +1555,12 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); { unsigned long long total_traffic=0, total_direct=0, total_proxy=0, total_upload=0, tmp_sum=0; int active_classes=0; - int colspan; + int colspan=11; FILE *iplog; struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums=NULL; + int limit_count=0, prio_count=0; + int popup_button=0; - colspan=11; if(qos_proxy) { colspan++; @@ -1594,19 +1596,38 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); char *f1="", *f2=""; if(ip->maxdesired) { - f1=""; - f2=""; + f1=""; + f2=""; + limit_count++; } else if(ip->prio>highest_priority+1) { - f1=""; - f2=""; + f1=""; + f2=""; + prio_count++; } #ifdef DEBUG printf("%03d. %-22s %10Lu (%d/%d)\n",i ,ip->name, ip->traffic, ip->min, ip->max); #endif - fprintf(f,"\n", ip->name, i, log_url, ip->name, ip->name); + /* hostnames -------------------------------------- */ + fprintf(f,"\n",f); + /* ----------------------------------------------- */ + if(found_lmsid) { fputs("\n",f); + fputs("\n",f); } fprintf(f,"\n", ip->credit); - fprintf(f,"", - ip->keyword->html_color, ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))); - fprintf(f,"\n", f1, ip->traffic, f2, ip->direct); + fprintf(f,"", + ip->keyword->html_color, + ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))); + fprintf(f,"\n",f); + /* ----------------------------------------------- */ + if(qos_proxy) { fprintf(f,"\n", ip->proxy); } - fprintf(f,"\n", ip->upload); + /* upload ---------------------------------------- */ + fprintf(f,"\n",f); + /* ----------------------------------------------- */ + fprintf(f,"\n", ip->min,ip->desired,f1,ip->max,f2,f1,ip->prio,f2); total_traffic+=ip->traffic; @@ -1661,14 +1703,13 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); } } fprintf(f,"\ - \n", total_traffic, total_direct); + fprintf(f,"\n", total_traffic, total_direct); if(qos_proxy) { fprintf(f,"\n", total_proxy); } fprintf(f,"", total_upload); - fputs("\n
#groupIPsrequesteddata limits
%d M%d M
%d%s
%d%s\n", ip->name, i, log_url, ip->name, ip->name); + fprintf(f,"",i); + popup_button=0; + for_selected(sharedip,ips,eq(ip->name,sharedip->sharing)) + { + fprintf(f,"
%s\n", log_url, sharedip->name, sharedip->name); + popup_button=1; + } + fputs("
\n",f); + if(popup_button) + { + fprintf(f,"[+]", + i, i, i); + } + fputs("
",f); @@ -1619,17 +1640,38 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); { fputs("-------",f); } - fputs("%Lu M%Lu M%s%Lu M%s%Lu M%Lu M%s%Lu M%s",f1, ip->traffic, f2); + + /* download --------------------------------------- */ + fprintf(f,"%Lu M", ip->direct); + fprintf(f,"",i); + for_selected(sharedip,ips,eq(ip->name,sharedip->sharing)) + { + fprintf(f,"
%Lu M", sharedip->direct); + } + fputs("
%Lu M%Lu M%Lu M", ip->upload); + fprintf(f,"",i); + for_selected(sharedip,ips,eq(ip->name,sharedip->sharing)) + { + fprintf(f,"
%Lu M", sharedip->upload); + } + fputs("
%d k%d k%s%d k%s%s%d%s
SUMMARY:",colspan-7); - fprintf(f,"%Lu M%Lu M%Lu M%Lu M%Lu M%Lu M
\n",f); + fprintf(f,"FUP-LIMIT %dx LOW-PRIO %dx\n\n",limit_count,prio_count); if(active_classes>10) { @@ -1743,8 +1784,9 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); iplog=fopen(str,"a"); if(iplog) { - fprintf(iplog,"%ld\t%d\t%d %%\t%Lu M\t%Ld %%\t%d\t%Lu M\t%d\t%s", - time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, active_classes, total_traffic, total, d); /* d = date*/ + fprintf(iplog,"%ld\t%d\t%d %%\t%Lu M\t%Ld %%\tACTIVE %d\tTRAFFIC %Lu M\tCLASSES %d\tFUP-LIMIT %d\tLOW-PRIO %d\t%s", + time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, + active_classes, total_traffic, total, limit_count, prio_count, d); /* d = date*/ fclose(iplog); } }