limit_count, prio_count);\r
\r
if(ip6prefix)\r
- {\r
- \r
+ { \r
for_each(ip, ips)\r
{ \r
if(ip->v6)\r
{\r
- bytes6 += ip->traffic;\r
- pkts6 += ip->pktsdown+ip->pktsup;\r
+ bytes6 += ip->upload + ip->direct;\r
+ pkts6 += ip->pktsdown + ip->pktsup;\r
count6++;\r
}\r
else\r
{\r
- bytes4 += ip->traffic;\r
- pkts4 += ip->pktsdown+ip->pktsup;\r
+ bytes4 += ip->upload + ip->direct;\r
+ pkts4 += ip->pktsdown + ip->pktsup;\r
count4++;\r
}\r
}\r
- perc6=(double)(100*bytes6)/(bytes4+bytes6);\r
\r
+ perc6=(double)(bytes6)/(bytes4+bytes6)*100;\r
fputs("<p><table class=\"decorated last\"><caption>IP protocols usage</caption>\n",f);\r
fprintf(f, "%s<td>Total %d IPv4 (addreses)</td><td style=\"text-align: right\">%Lu MB (%.2f %%)</td><td style=\"text-align: right\">%Lu packets (%.2f %%)</td></tr>\n",\r
- tr_odd_even(), count4, bytes4, (double)(100*bytes4)/(bytes4+bytes6), pkts4, (float)(100*pkts4)/(pkts4+pkts6));\r
+ tr_odd_even(), count4, bytes4, (double)(bytes4)/(bytes4+bytes6)*100, pkts4, (float)(100*pkts4)/(pkts4+pkts6));\r
fprintf(f, "%s<td>Total %d IPv6 (/64 ranges)</td><td style=\"text-align: right\">%Lu MB (%.2f %%)</td><td style=\"text-align: right\">%Lu packets (%.2f %%)</td></tr>\n",\r
tr_odd_even(), count6, bytes6, perc6, pkts6, (float)(100*pkts6)/(pkts4+pkts6));\r
fputs("</table></p>\n", f);\r