max nesting limit according to include/uapi/linux/pkt_sched.h: #define TC_HTB_MAXDEPTH 8
[svn/Prometheus-QoS/.git] / htmlandlogs.c
index c0d564894684a645e37372c6b44ab3c93e850797..39a4286abd51192fbcfda7e3542588be5d66627d 100644 (file)
@@ -1,3 +1,5 @@
+/* Modified by: xChaos, 20131119 */\r
+\r
 #include "cll1-0.6.2.h"\r
 #include "ipstruct.h"\r
 #define STRLEN 512\r
@@ -20,6 +22,7 @@ extern char *log_url;
 extern int found_lmsid;\r
 extern char *lms_url;\r
 extern char *log_dir;\r
+extern char *ip6prefix;\r
 \r
 const char *tr_odd_even(void);\r
 /* implemented in prometheus.c, shared with parselogs.c */\r
@@ -89,8 +92,8 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
 \r
    for_each(keyword, keywords) if(keyword->ip_count)\r
    {\r
-    fprintf(f,"<td style=\"text-align: right\"><span style=\"color:#%s\">%d&nbsp;MB</span></td>",\r
-              keyword->html_color, group->min*keyword->data_limit);\r
+    fprintf(f, "<td style=\"text-align: right\"><span style=\"color:#%s\">%d&nbsp;MB</span></td>",\r
+               keyword->html_color, group->min*keyword->data_limit);\r
    }   \r
    i += group->desired; \r
    total += group->count;\r
@@ -122,30 +125,51 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
  i=0;\r
  if(f > 0)\r
  {\r
-  unsigned long long total_traffic=0, total_direct=0, total_proxy=0, total_upload=0, tmp_sum=0;\r
-  int active_classes=0;\r
-  int colspan=12;\r
-  struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums=NULL;\r
-  int limit_count=0, prio_count=0;\r
-  int popup_button=0;\r
-\r
+  unsigned long long total_traffic=0, total_direct=0, total_proxy=0, total_upload=0, tmp_sum = 0;\r
+  unsigned long long total_pktup = 0, total_pktdown = 0;\r
+  int active_classes = 0;\r
+//  int colspan = 14;\r
+  struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums = NULL;\r
+  int limit_count = 0, prio_count = 0;\r
+  int popup_button = 0;\r
+  /* IPv6 vs. IPv4 stats */\r
+  unsigned long long pkts4 =0, pkts6 = 0, bytes4 = 0, bytes6 = 0;\r
+  int count4 = 0, count6 = 0;\r
+  int mpkts;\r
+  double perc6;\r
+\r
+/*\r
   if(qos_proxy)\r
   {\r
    colspan++;\r
   }\r
-  \r
+*/  \r
+  if(use_jquery_popups)\r
+  {\r
+    fprintf(f,"<script type=\"text/javascript\">\\r
+function show_section(n) {\\r
+$(\'#sharing_\'+n).show();\\r
+$(\'#download_'+n).show();\\r
+$(\'#pktsdown_\'+n).show();\\r
+$(\'#upload_'+n).show();\\r
+$(\'#pktsup_\'+n).show();\\r
+} </script>");\r
+  }\r
+\r
   fprintf(f,"<p><table class=\"decorated last\">\n<caption>%s",title);\r
   fprintf(f," (%s)</caption>\n", d);\r
   fputs("<thead><tr>\n<th colspan=\"3\">&nbsp;</th>\n",f);\r
-  fputs("<th style=\"text-align: right\">credit</th>\n\\r
+  fputs("<th style=\"text-align: right\">cred.</th>\n\\r
 <th style=\"text-align: right\">FUP</th>\n\\r
 <th style=\"text-align: right\">total</th>\n\\r
-<th style=\"text-align: right\">down</th>\n",f);\r
+<th style=\"text-align: center\" colspan=\"2\">upload</th>\n",f);\r
+/*\r
   if(qos_proxy)\r
   {\r
    fputs("<th style=\"text-align: right\">proxy</th>\n",f);\r
   }\r
-  fputs("<th style=\"text-align: right\">up</th>\n\\r
+*/\r
+  fputs("<th style=\"text-align: center\" colspan=\"2\">download</th>\n\\r
 <th style=\"text-align: right\">min</th>\n\\r
 <th style=\"text-align: right\">max</th>\n\\r
 <th style=\"text-align: right\">limit</th>\n\\r
@@ -158,11 +182,13 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
 <th style=\"text-align: right\">MB</th>\n\\r
 <th style=\"text-align: right\">MB</th>\n\\r
 <th style=\"text-align: right\">MB</th>\n\\r
+<th style=\"text-align: right\">pkt</th>\n\\r
 <th style=\"text-align: right\">MB</th>\n\\r
+<th style=\"text-align: right\">pkt</th>\n\\r
 <th style=\"text-align: right\">kb/s</th>\n\\r
 <th style=\"text-align: right\">kb/s</th>\n\\r
 <th style=\"text-align: right\">kb/s</th>\n\\r
-<th>prio</th>\n\\r
+<th>!</th>\n\\r
 </tr></thead><tbody>\n",f);    \r
 \r
   row_odd_even = 0;\r
@@ -172,15 +198,15 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
    i++;\r
 \r
    if(ip->max < ip->desired) \r
-   { \r
-    f1 = "<span style=\"color:red\">"; \r
+   {\r
+    f1 = "<span style=\"color:red\">";\r
     f2 = "</span>"; \r
     limit_count++; \r
-   } \r
-   else if(ip->prio > highest_priority+1) \r
-   { \r
-    f1 = "<span style=\"color:brown\">"; \r
-    f2 = "</span>"; \r
+   }\r
+   else if(ip->prio > highest_priority+1)\r
+   {\r
+    f1 = "<span style=\"color:brown\">";\r
+    f2 = "</span>";\r
     prio_count++; \r
    }       \r
 \r
@@ -188,28 +214,36 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
    printf("%03d. %-22s %10Lu (%d/%d)\n",i ,ip->name, ip->traffic, ip->min, ip->max); \r
 #endif\r
    /* hostnames -------------------------------------- */\r
-   fprintf(f,"%s<td style=\"text-align: right\"><a name=\"%s\"></a>%d</td><td><a class=\"blue\" target=\"_blank\" href=\"%s%s.log\">%s</a>\n", \r
+   fprintf(f,"%s<td style=\"text-align: right\"><a name=\"%s\"></a>%d</td>\\r
+<td><a class=\"blue\" target=\"_blank\" href=\"%s%s.log\">%s</a>\n", \r
               tr_odd_even(), ip->name, i, log_url, ip->name, ip->name);\r
 \r
    if(use_jquery_popups)\r
    {\r
-     fprintf(f,"<span id=\"sharing_%d\" style=\"display:none\">",i);\r
+     fprintf(f, "<span id=\"sharing_%d\" style=\"display:none\">",i);\r
      popup_button=0;\r
+\r
      for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */\r
      {\r
-      fprintf(f,"<br /><a class=\"blue\" target=\"_blank\" href=\"%s%s.log\">%s</a>\n", log_url, sharedip->name, sharedip->name);\r
+      fprintf(f, "<br /><a class=\"blue\" target=\"_blank\" href=\"%s%s.log\">%s</a>\n", \r
+                 log_url, sharedip->name, sharedip->name);\r
       popup_button++;\r
      }\r
+\r
      for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */\r
      {\r
-      fprintf(f,"<br /><a class=\"blue\" target=\"_blank\" href=\"%s%s.log\">%s/64</a>\n", log_url, sharedip->addr, sharedip->addr);\r
+      fprintf(f, "<br /><a class=\"blue\" target=\"_blank\" href=\"%s%s.log\">%s/64</a>\n", \r
+                 log_url, sharedip->addr, sharedip->addr);\r
       popup_button++;\r
      }\r
+\r
      fputs("</span>\n",f);\r
      if(popup_button)\r
      {\r
-      fprintf(f,"<span>[<a class=\"blue\" href=\"#\" onClick=\"$(this).parent().hide();$(\'#sharing_%d\').show();$(\'#download_%d\').show();$(\'#upload_%d\').show();return(false);\" style=\"cursor: pointer;\">+%d</a>]</span>",\r
-                i, i, i, popup_button);\r
+      fprintf(f, "<span>[<a class=\"blue\" href=\"#\" \\r
+onClick=\"$(this).parent().hide();show_section(\'%d\');return(false);\" \\r
+style=\"cursor: pointer;\">+%d</a>]</span>",\r
+                 i, popup_button);\r
      }\r
    }\r
    fputs("</td>\n",f);\r
@@ -220,7 +254,8 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
     fputs("<td style=\"text-align: right\">",f);\r
     if(ip->lmsid > 0)\r
     {\r
-     fprintf(f,"<a class=\"blue\" target=\"_blank\" href=\"%s%d\">%04d</a>\n", lms_url, ip->lmsid, ip->lmsid);\r
+     fprintf(f, "<a class=\"blue\" target=\"_blank\" href=\"%s%d\">%04d</a>\n",\r
+                lms_url, ip->lmsid, ip->lmsid);\r
     }\r
     else if(ip->lmsid == 0)\r
     {\r
@@ -231,55 +266,122 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
    fprintf(f,"<td style=\"text-align: right\">%Lu</td>\n", ip->credit);\r
    fprintf(f,"<td style=\"text-align: right\"><span style=\"color:#%s\">%Lu</span></td>",\r
              ip->keyword->html_color, ip->realquota);\r
-   fprintf(f,"<td style=\"text-align: right\">%s%Lu%s", f1, ip->traffic, f2);\r
+   fprintf(f,"<td style=\"text-align: right\">%s%Lu%s</td>", f1, ip->traffic, f2);\r
 \r
-   /* download --------------------------------------- */\r
-   fprintf(f,"</td><td style=\"text-align: right\">%Lu", ip->direct);\r
+   /* upload --------------------------------------- */\r
+   fprintf(f,"<td style=\"text-align: right\">%Lu", ip->upload);\r
    if(use_jquery_popups)\r
    {\r
-     fprintf(f,"<span id=\"download_%d\" style=\"display:none\">",i);\r
+     fprintf(f,"<span id=\"upload_%d\" style=\"display:none\">", i);\r
      for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */\r
      {\r
-      fprintf(f,"<br />%Lu", sharedip->direct);\r
+      fprintf(f,"<br />%Lu", sharedip->upload);\r
      }\r
      for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */\r
      {\r
-      fprintf(f,"<br />%Lu", sharedip->direct);\r
+      fprintf(f,"<br />%Lu", sharedip->upload);\r
      }\r
      fputs("</span>\n",f);\r
    }\r
    fputs("</td>\n",f);\r
-   /* ----------------------------------------------- */\r
 \r
+   /* pkts up ----------------------------------- */\r
+   mpkts = ip->pktsup>>20;\r
+   total_pktup += mpkts;\r
+   if(mpkts == 0)\r
+   {\r
+    mpkts = 1; /* prevent divide by zero*/\r
+   }\r
+   fprintf(f,"<td style=\"text-align: right\"><span style=\"color: gray\">%d</span>", ip->upload/mpkts);\r
+   if(use_jquery_popups)\r
+   {\r
+     fprintf(f,"<span id=\"pktsup_%d\" style=\"display:none\">", i);\r
+     for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */\r
+     {\r
+      mpkts = sharedip->pktsup>>20;\r
+      if(mpkts == 0)\r
+      {\r
+       mpkts = 1; /* prevent divide by zero*/\r
+      }   \r
+      fprintf(f,"<br /><span style=\"color: gray\">%d</span>", sharedip->upload/mpkts);\r
+     }\r
+     for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */\r
+     {\r
+      mpkts = sharedip->pktsup>>20;\r
+      if(mpkts == 0)\r
+      {\r
+       mpkts = 1; /* prevent divide by zero*/\r
+      }   \r
+      fprintf(f,"<br /><span style=\"color: gray\">%d</span>", sharedip->upload/mpkts);\r
+     }\r
+     fputs("</span>\n",f);\r
+   }\r
+   fputs("</td>\n",f);\r
+\r
+/*\r
    if(qos_proxy)\r
    {\r
     fprintf(f,"<td style=\"text-align: right\">%Lu</td>\n", ip->proxy);\r
    }\r
-   /* upload ---------------------------------------- */\r
-   fprintf(f,"<td style=\"text-align: right\">%Lu", ip->upload);\r
+*/\r
+   /* download ---------------------------------------- */\r
+   fprintf(f,"<td style=\"text-align: right\">%Lu", ip->direct);\r
    if(use_jquery_popups)\r
    {\r
-     fprintf(f,"<span id=\"upload_%d\" style=\"display:none\">",i);\r
+     fprintf(f,"<span id=\"download_%d\" style=\"display:none\">", i);\r
      for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */\r
      {\r
-      fprintf(f,"<br />%Lu", sharedip->upload);\r
+      fprintf(f,"<br />%Lu", sharedip->direct);\r
      }\r
      for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */\r
      {\r
-      fprintf(f,"<br />%Lu", sharedip->upload);\r
+      fprintf(f,"<br />%Lu", sharedip->direct);\r
+     }\r
+     fputs("</span>\n",f);\r
+   }\r
+   fputs("</td>\n",f);\r
+\r
+   /* pkts down ---------------------------------------- */\r
+   mpkts = ip->pktsdown>>20;\r
+   total_pktdown += mpkts;\r
+   if(mpkts == 0)\r
+   {\r
+    mpkts = 1; /* prevent divide by zero*/\r
+   }\r
+   fprintf(f,"<td style=\"text-align: right\"><span style=\"color: gray\">%d</span>", ip->direct/mpkts);\r
+   if(use_jquery_popups)\r
+   {\r
+     fprintf(f,"<span id=\"pktsdown_%d\" style=\"display:none\">", i);\r
+     for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */\r
+     {\r
+      mpkts = sharedip->pktsdown>>20;\r
+      if(mpkts == 0)\r
+      {\r
+       mpkts = 1; /* prevent divide by zero*/\r
+      }   \r
+      fprintf(f,"<br /><span style=\"color: gray\">%d</span>", sharedip->direct/mpkts);\r
+     }\r
+     for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */\r
+     {\r
+      mpkts = sharedip->pktsdown>>20;\r
+      if(mpkts == 0)\r
+      {\r
+       mpkts = 1; /* prevent divide by zero*/\r
+      }   \r
+      fprintf(f,"<br /><span style=\"color: gray\">%d</span>", sharedip->direct/mpkts);\r
      }\r
      fputs("</span>\n",f);\r
    }\r
    fputs("</td>\n",f);\r
    /* ----------------------------------------------- */\r
 \r
-   fprintf(f,"<td style=\"text-align: right\">%d</td>\n\\r
+   fprintf(f, "<td style=\"text-align: right\">%d</td>\n\\r
 <td style=\"text-align: right\">%d</td>\n\\r
 <td style=\"text-align: right\">%s%d%s</td>\n\\r
 <td>%s%d%s</td></tr>\n",\r
-             ip->min, ip->desired, \r
-             f1, ip->max, f2, \r
-             f1, ip->prio, f2);\r
+              ip->min, ip->desired, \r
+              f1, ip->max, f2, \r
+              f1, ip->prio, f2);\r
 \r
    total_traffic+=ip->traffic;\r
    total_direct+=ip->direct;\r
@@ -304,15 +406,49 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
     }\r
    }\r
   }\r
-  fprintf(f,"</tbody><thead><tr>\n\\r
-<th colspan=\"%d\" style=\"text-align: left\">%d CLASSES</th>", colspan-7, i);\r
-  fprintf(f,"<th style=\"text-align: right\">%Lu</th><th style=\"text-align: right\">%Lu</th>\n", total_traffic, total_direct);\r
+  fprintf(f, "</tbody><thead><tr>\n\\r
+<th colspan=\"5\" style=\"text-align: left\">%d CLASSES</th>", i);\r
+  fprintf(f, "<th style=\"text-align: right\">%Lu</th><th style=\"text-align: right\">%Lu</th>\\r
+<th style=\"text-align: right\">%d</th>\n",\r
+             total_traffic, total_upload, total_pktup/i);\r
+/*\r
   if(qos_proxy)\r
   {\r
-   fprintf(f,"<th style=\"text-align: right\">%Lu</th>\n", total_proxy);\r
+   fprintf(f," <th style=\"text-align: right\">%Lu</th>\n", total_proxy);\r
+  }\r
+*/\r
+  fprintf(f, "<th style=\"text-align: right\">%Lu</th><th style=\"text-align: right\">%d</th>",\r
+             total_direct, total_pktdown/i);\r
+  fprintf(f, "<th colspan=\"6\"><span style=\"color:red\">LIMIT %dx</span> \\r
+<span style=\"color:brown\">LOW-PRIO %dx</span></th></tr>\n</thead></table>\n",\r
+             limit_count, prio_count);\r
+\r
+  if(ip6prefix)\r
+  { \r
+   for_each(ip, ips)\r
+   { \r
+    if(ip->v6)\r
+    {\r
+     bytes6 += ip->upload + ip->direct;\r
+     pkts6 += ip->pktsdown + ip->pktsup;\r
+     count6++;\r
+    }\r
+    else\r
+    {\r
+     bytes4 += ip->upload + ip->direct;\r
+     pkts4 += ip->pktsdown + ip->pktsup;\r
+     count4++;\r
+    }\r
+   }\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)(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
   }\r
-  fprintf(f,"<th style=\"text-align: right\">%Lu</th>", total_upload);\r
-  fprintf(f,"<th colspan=\"4\"><span style=\"color:red\">LIMIT %dx</span> <span style=\"color:brown\">LOW-PRIO %dx</span></th></tr>\n</thead></table>\n",limit_count,prio_count);\r
 \r
   row_odd_even = 0;\r
   if(active_classes>10)\r
@@ -328,7 +464,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
 <th colspan=\"2\" style=\"text-align: center\">Data transfers</th>\n\\r
 </tr></thead><tbody>\n",f);\r
 \r
-   if_exists(sum,sums,sum->l>=total_traffic/4)\r
+   if_exists(sum,sums,sum->l >= total_traffic/4)\r
    {\r
     fprintf(f,"%s<td>Top 25%% of traffic</td>\n", tr_odd_even());\r
     fprintf(f,"<td style=\"text-align: right\">%d</td>\n\\r
@@ -338,7 +474,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
               sum->i, (100*sum->i+50)/active_classes, sum->l, (100*sum->l+50)/total_traffic);\r
    }\r
    \r
-   if_exists(sum,sums,sum->i==10)\r
+   if_exists(sum,sums,sum->i == 10)\r
    {\r
     fprintf(f,"%s<td>Top 10 downloaders</td>\n", tr_odd_even());\r
     fprintf(f,"<td style=\"text-align: right\"><strong>10</strong></td>\n\\r
@@ -348,7 +484,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
               (100*sum->i+50)/active_classes, sum->l, (100*sum->l+50)/total_traffic);\r
    }\r
 \r
-   if_exists(sum,sums,sum->l>=total_traffic/2)\r
+   if_exists(sum,sums,sum->l >= total_traffic/2)\r
    {\r
     fprintf(f,"%s<td>Top 50%% of traffic</td>\n", tr_odd_even());\r
     fprintf(f,"<td style=\"text-align: right\">%d</td>\n\\r
@@ -358,7 +494,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
               sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
    }\r
 \r
-   if_exists(sum,sums,sum->l>=4*total_traffic/5)\r
+   if_exists(sum,sums,sum->l >= 4*total_traffic/5)\r
    {\r
     fprintf(f,"%s<td>Top 80%% of traffic</td>\n", tr_odd_even());\r
     fprintf(f,"<td style=\"text-align: right\">%d</td>\n\\r
@@ -368,7 +504,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
               sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
    }\r
 \r
-   if_exists(sum,sums,sum->i>=(active_classes+1)/5)\r
+   if_exists(sum,sums,sum->i >= (active_classes+1)/5)\r
    {\r
     fprintf(f,"%s<td>Top 20%% downloaders</td>\n", tr_odd_even());\r
     top20_count=sum->i;\r
@@ -382,7 +518,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
               top20_count,top20_perc1,top20_sum,top20_perc2);\r
    }\r
 \r
-   if_exists(sum,sums,sum->i>=(active_classes+1)/4)\r
+   if_exists(sum,sums,sum->i >= (active_classes+1)/4)\r
    {\r
     fprintf(f,"%s<td>Top 25%% downloaders</td>\n", tr_odd_even());\r
     fprintf(f,"<td style=\"text-align: right\">%d</td>\n\\r
@@ -402,7 +538,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
               sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
    }\r
 \r
-   if_exists(sum,sums,sum->i>=4*(active_classes+1)/5)\r
+   if_exists(sum,sums,sum->i >= 4*(active_classes+1)/5)\r
    {\r
     fprintf(f,"%s<td>Top 80%% downloaders</td>\n", tr_odd_even());\r
     fprintf(f,"<td style=\"text-align: right\">%d</td>\n\\r
@@ -417,7 +553,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
 <th style=\"text-align: right\">100 %%</th>\n\\r
 <th style=\"text-align: right\">%Lu MB</th>\n\\r
 <th style=\"text-align: right\">100 %%</th></tr>\n",active_classes,total_traffic);\r
-   fputs("</thead></table>\n", f);\r
+   fputs("</thead></table></p>\n", f);\r
 \r
    /* write basic ERP data to log directory */\r
    if(!just_preview)\r
@@ -427,9 +563,10 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
     iplog=fopen(str,"a");\r
     if(iplog)\r
     {\r
-     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",\r
-                   time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, \r
-                   active_classes, total_traffic, i, limit_count, prio_count, d); /* d = date*/\r
+     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\tIPv6 %Lu M\t%.2f %%\t%s",\r
+                    time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, \r
+                    active_classes, total_traffic, i, limit_count, prio_count,\r
+                    bytes6, perc6, d); /* d = date*/\r
      fclose(iplog);\r
     }\r
     else\r
This page took 0.23199 seconds and 4 git commands to generate.