X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=htmlandlogs.c;h=c6d16120dd6da25646555ddcdd2f7e0a1eb295a4;hb=9694a8ec9258e894c4001b076a6c7f6c0e5a46f4;hp=0443c7b94085e7c3b40626a539506e309ea8e1ce;hpb=b1a5c8838af8aab2c376bec78cc8a736a9f9c101;p=svn%2FPrometheus-QoS%2F.git diff --git a/htmlandlogs.c b/htmlandlogs.c index 0443c7b..c6d1612 100644 --- a/htmlandlogs.c +++ b/htmlandlogs.c @@ -327,29 +327,28 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview) limit_count, prio_count); if(ip6prefix) - { - + { for_each(ip, ips) { if(ip->v6) { - bytes6 += ip->traffic; - pkts6 += ip->pktsdown+ip->pktsup; + bytes6 += ip->upload + ip->direct; + pkts6 += ip->pktsdown + ip->pktsup; count6++; } else { - bytes4 += ip->traffic; - pkts4 += ip->pktsdown+ip->pktsup; + bytes4 += ip->upload + ip->direct; + pkts4 += ip->pktsdown + ip->pktsup; count4++; } } - perc6=(double)(100*bytes6)/(bytes4+bytes6); + perc6=(double)(bytes6)/(bytes4+bytes6)*100; fputs("
Total %d IPv4 (addreses) | %Lu MB (%.2f %%) | %Lu packets (%.2f %%) | \n", - tr_odd_even(), count4, bytes4, (double)(100*bytes4)/(bytes4+bytes6), pkts4, (float)(100*pkts4)/(pkts4+pkts6)); - fprintf(f, "%sTotal %d IPv6 (/64 ranges) | %Lu MB (%.2f %%) | %Lu packets (%.2f %%) | \n", + fprintf(f, "%sTotal %d IPv4 addreses | %Lu MB (%.2f %%) | %Lu packets (%.2f %%) | \n", + tr_odd_even(), count4, bytes4, (double)(bytes4)/(bytes4+bytes6)*100, pkts4, (float)(100*pkts4)/(pkts4+pkts6)); + fprintf(f, "%sTotal %d IPv6 /64 ranges | %Lu MB (%.2f %%) | %Lu packets (%.2f %%) | \n", tr_odd_even(), count6, bytes6, perc6, pkts6, (float)(100*pkts6)/(pkts4+pkts6)); fputs("