prakticky uz 0.8.4 final
authorxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 1 Dec 2011 16:03:04 +0000 (16:03 +0000)
committerxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 1 Dec 2011 16:03:04 +0000 (16:03 +0000)
git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@157 251d49ef-1d17-4917-a970-b30cf55b089b

conf/prometheus.conf
prometheus.c

index 2160698b570a250b7034a36fdeb5a4915a09e11a..48ab0239e6150a3d8447cf961346205cbd8e18af 100644 (file)
@@ -137,7 +137,13 @@ credit-enable              1       #1=yes|0=no
 log-filename                   /var/log/prometheuslog
 log-traffic-directory          /var/www/logs/
 log-traffic-html-directory     /var/www/logs/html/
-log-traffic-url-path           logs/
+#==========================================================================
+#URLs of external resources
+#--------------------------------------------------------------------------
+log-traffic-url-path           logs/
+jquery-url             http://code.jquery.com/jquery-latest.js
+lms-url                        /lms/?m=customerinfo&amp;id=
+use-jquery-popups      1
 #==========================================================================
 #Hall of Fame - Greatest Suckers settings
 #--------------------------------------------------------------------------
index 09f547d216480303833d0774fc6f97fd2b2677eb..561e2bde85664d5afeb6bd525ac64a0af66a65f8 100644 (file)
@@ -62,6 +62,10 @@ char         *log_dir = "/var/www/logs/"; /* log directory pathname, ended with
 char         *log_url = "logs/"; /* log directory relative URI prefix (partial URL) */\r
 char    *html_log_dir = "/var/www/logs/html/";\r
 \r
+char      *jquery_url = "http://code.jquery.com/jquery-latest.js";\r
+char         *lms_url = "/lms/?m=customerinfo&amp;id=";\r
+int use_jquery_popups = 1;\r
+\r
 /* ======= Help screen is hopefuly self-documenting part of code :-) ======= */\r
 \r
 void help(void)\r
@@ -408,6 +412,9 @@ void get_config(char *config_filename)
   option("log-traffic-directory",log_dir);\r
   option("log-traffic-html-directory",html_log_dir);\r
   option("log-traffic-url-path",log_url);\r
+  option("jquery-url",jquery_url);\r
+  option("lms-url",lms_url);\r
+  ioption("use-jquery-popups",use_jquery_popups);\r
   option("qos-free-zone",qos_free_zone);\r
   ioption("qos-free-delay",qos_free_delay);\r
   ioption("qos-proxy-enable",qos_proxy);\r
@@ -839,24 +846,26 @@ void parse_ip_log(int argc, char **argv)
  f=fopen(str,"w");\r
  if(f)\r
  {\r
-  fprintf(f,"<table border><tr><th colspan=\"2\">%s %s</th><th align=\"right\">lms</th><th colspan=\"2\">Data transfers</th><th align=\"right\">Min.speed</th></tr>\n ",month,year);\r
+  fprintf(f, "<table border><tr><th colspan=\"2\">%s %s</th><th align=\"right\">lms</th><th colspan=\"2\">Data transfers</th><th align=\"right\">Min.speed</th></tr>\n ",\r
+             month, year);\r
 \r
-  for_each(iplog,iplogs)\r
+  for_each(iplog, iplogs)\r
   {\r
    if(iplog->traffic)\r
    {\r
-    fprintf(f,"<tr><td align=\"right\">%d</td><th align=\"left\">%s</td><td align=\"right\">", i++, iplog->name); \r
+    fprintf(f, "<tr><td align=\"right\">%d</td><th align=\"left\">%s</td><td align=\"right\">", \r
+               i++, iplog->name); \r
     if(iplog->lmsid > 0)\r
     {\r
      /*base URL will be configurable soon ... */\r
-     fprintf(f,"<a href=\"https://hermes.spoje.net/?m=customerinfo&amp;id=%d\">%04d</a>\n", iplog->lmsid, iplog->lmsid);\r
+     fprintf(f, "<a href=\"%s%d\">%04d</a>\n", lms_url, iplog->lmsid, iplog->lmsid);\r
     }\r
     else if(iplog->lmsid == 0)\r
     {\r
      fputs("-------",f);\r
     }    \r
-    fprintf(f,"<td align=\"right\">%ld M</td><th align=\"right\">%ld G</th><td align=\"right\">%ld kbps</th></tr>\n",\r
-              iplog->traffic, iplog->traffic>>10, iplog->guaranted);\r
+    fprintf(f, "<td align=\"right\">%ld M</td><th align=\"right\">%ld G</th><td align=\"right\">%ld kbps</th></tr>\n",\r
+               iplog->traffic, iplog->traffic>>10, iplog->guaranted);\r
     total+=iplog->traffic>>10;\r
     iplog->i=i;\r
     iplog->l=total;\r
@@ -1127,9 +1136,9 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
  /*-----------------------------------------------------------------*/\r
  puts("Resolving shared connections ...");\r
  /*-----------------------------------------------------------------*/\r
- for_selected(ip,ips,ip->sharing)\r
+ for_each(ip,ips) if(ip->sharing)\r
  {\r
-  for_selected(sharedip,ips,eq(sharedip->name,ip->sharing))\r
+  for_each(sharedip,ips) if(eq(sharedip->name,ip->sharing))\r
   {\r
    sharedip->traffic+=ip->traffic;\r
    ip->traffic=0;\r
@@ -1233,7 +1242,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
    save_line(":post_common - [0:0]");\r
    save_line(":forw_common - [0:0]");\r
 \r
-   for_selected(ip,ips,ip->addr && *(ip->addr) && !eq(ip->addr,"0.0.0.0/0"))\r
+   for_each(ip,ips) if (ip->addr && *(ip->addr) && !eq(ip->addr,"0.0.0.0/0"))\r
    {\r
     buf=hash_id(ip->addr,bitmask);\r
     if_exists(idx,idxs,eq(idx->id,buf))\r
@@ -1259,7 +1268,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     bitmask-=idxtable_bitmask2;\r
     idxcount=0;\r
 \r
-    for_selected(idx,idxs,idx->parent==NULL)\r
+    for_each(idx,idxs) if(idx->parent == NULL)\r
     {\r
      buf=hash_id(idx->addr,bitmask);\r
      if_exists(metaindex,idxs,eq(metaindex->id,buf))\r
@@ -1356,7 +1365,8 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
    sleep(qos_free_delay);\r
   }\r
 \r
-  sprintf(str,"%s qdisc add dev %s root handle 1: htb r2q %d default 1",tc,lan,htb_r2q);\r
+  sprintf(str,"%s qdisc add dev %s root handle 1: htb r2q %d default 1",\r
+              tc,lan,htb_r2q);\r
   safe_run(str);\r
 \r
   sprintf(str, "%s class add dev %s parent 1: classid 1:2 htb rate %s ceil %s burst %dk prio %d",\r
@@ -1387,14 +1397,14 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
  /*-----------------------------------------------------------------*/\r
  /* sub-scope - local variables */  \r
  {\r
-  long long int rate=line;\r
-  long long int max=line;\r
-  int group_count=0;\r
-  FILE *credit_file=NULL;\r
+  long long int rate = line;\r
+  long long int max = line;\r
+  int group_count = 0;\r
+  FILE *credit_file = NULL;\r
   \r
   if(!just_preview && !dry_run && enable_credit)\r
   {\r
-   credit_file=fopen(credit,"w");\r
+   credit_file = fopen(credit,"w");\r
   }\r
     \r
   for_each(group,groups)\r
@@ -1412,27 +1422,27 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     safe_run(str);\r
    }\r
    \r
-   if(group_count++<max_nesting)\r
+   if(group_count++ < max_nesting)\r
    {\r
-    parent=group->id;\r
+    parent = group->id;\r
    }\r
    \r
-   rate-=digital_divide*group->min;\r
-   if(rate<group->min)\r
+   rate -= digital_divide*group->min;\r
+   if(rate < group->min)\r
    {\r
-    rate=group->min;\r
+    rate = group->min;\r
    }\r
     \r
    /*shaping of aggresive downloaders, with credit file support */\r
    if(use_credit)\r
    {\r
-    int group_rate=group->min, priority_sequence=lowest_priority;\r
+    int group_rate = group->min, priority_sequence = lowest_priority;\r
     \r
-    for_selected(ip, ips, ip->min==group->min && ip->max>ip->min)\r
+    for_each(ip, ips) if(ip->min == group->min && ip->max > ip->min)\r
     {\r
-     if( ip->keyword->data_limit && !ip->fixedprio &&\r
-         ip->traffic>ip->credit+\r
-         (ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)) )\r
+     if(    ip->keyword->data_limit && !ip->fixedprio \r
+         && (   ip->traffic>ip->credit\r
+              + (ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))) )\r
      {\r
       if(group_rate<ip->max)\r
       {\r
@@ -1447,9 +1457,10 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
      }\r
      else\r
      {\r
-      if( ip->keyword->data_prio && !ip->fixedprio &&\r
-          ip->traffic>ip->credit+\r
-           (ip->min*ip->keyword->data_prio+(ip->keyword->fixed_prio<<20)) )\r
+      if(    ip->keyword->data_prio \r
+          && !ip->fixedprio \r
+          && (   ip->traffic>ip->credit\r
+               + (ip->min*ip->keyword->data_prio+(ip->keyword->fixed_prio<<20))) )\r
       {\r
        ip->prio=priority_sequence--;\r
        if(ip->prio<highest_priority+1)\r
@@ -1469,8 +1480,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
        fprintf(credit_file,"%s %Lu\n",ip->addr,lcredit);\r
       }\r
      }\r
-    }\r
-        \r
+    }        \r
    }\r
   }\r
   if(credit_file)\r
@@ -1492,8 +1502,11 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
   f=fopen("/var/run/prometheus.previous","w");\r
   if(f)\r
   {\r
-   for_selected(ip,ips,ip->traffic || ip->direct || ip->proxy ||ip->upload)\r
-    fprintf(f,"%s %Lu %Lu %Lu %Lu\n",ip->addr,ip->traffic,ip->direct,ip->proxy,ip->upload);\r
+   for_each(ip,ips) if(ip->traffic || ip->direct || ip->proxy || ip->upload)\r
+   {\r
+    fprintf(f,"%s %Lu %Lu %Lu %Lu\n",\r
+              ip->addr, ip->traffic, ip->direct, ip->proxy, ip->upload);\r
+   }\r
    fclose(f);\r
   }\r
 \r
@@ -1503,54 +1516,62 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
 \r
  if(f)\r
  {\r
-\r
   int count=1;\r
   i=0;\r
 \r
   /*-----------------------------------------------------------------*/\r
-  printf("Sorting data and generating statistics page %s ...\n",ptr);\r
+  printf("Sorting data and generating statistics page %s ...\n", ptr);\r
   /*-----------------------------------------------------------------*/\r
 \r
-  fputs("<script type=\"text/javascript\" src=\"/jquery.js\"></script>\n",f);\r
+  if(use_jquery_popups)\r
+  {\r
+   fprintf(f,"<script type=\"text/javascript\" src=\"%s\"></script>\n", jquery_url);\r
+  }\r
   fputs("<table border>\n<tr><th align=\"right\">#</th><th align=\"right\">group</th><th align=\"right\">IPs</th><th align=\"right\">requested</th>\n",f);\r
-  fprintf(f,"<th colspan=\"%d\">data limits</th>\n",keywordcount);\r
+  fprintf(f,"<th colspan=\"%d\">data limits</th>\n", keywordcount);\r
   fputs("</tr>\n",f);\r
 \r
-  for_each(group,groups) \r
+  for_each(group, groups) \r
   { \r
 #ifdef DEBUG\r
    printf("%d k group: %d bandwidth requested: %d k\n",group->min,group->count,group->desired);\r
 #endif\r
-   fprintf(f,"<tr><td align=\"right\">%d</td><td align=\"right\">%d k</td>",count,group->min);\r
-   fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d k</td>",group->count,group->desired);\r
+   fprintf(f,"<tr><td align=\"right\">%d</td><td align=\"right\">%d k</td>",\r
+             count, group->min);\r
+   fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d k</td>",\r
+             group->count, group->desired);\r
 \r
-   for_each(keyword,keywords)\r
+   for_each(keyword, keywords)\r
    {\r
-    fprintf(f,"<td align=\"right\"><span style=\"color:#%s\">%d M</span></td>",keyword->html_color,group->min*keyword->data_limit);\r
+    fprintf(f,"<td align=\"right\"><span style=\"color:#%s\">%d M</span></td>",\r
+              keyword->html_color, group->min*keyword->data_limit);\r
    }   \r
-   i+=group->desired; \r
-   total+=group->count;\r
+   i += group->desired; \r
+   total += group->count;\r
    count++; \r
   }\r
 #ifdef DEBUG\r
-   printf("Total groups: %d Total bandwidth requested: %d k\nAGGREGATION: 1/%d\n",count,i,i/line);\r
+   printf("Total groups: %d Total bandwidth requested: %d k\nAGGREGATION: 1/%d\n",\r
+          count, i, i/line);\r
 #endif\r
    fprintf(f,"<tr><th colspan=\"2\" align=\"left\">Line %Ld k</td>",line);\r
    fprintf(f,"<th align=\"right\">%d</td><th align=\"right\">%d k</td>",total,i);\r
 \r
-   for_each(keyword,keywords)\r
+   for_each(keyword, keywords)\r
    {\r
     fprintf(f,"<th align=\"right\">%d IPs</th>",keyword->ip_count);\r
    }\r
-   fprintf(f,"</tr><tr><th colspan=\"4\">Aggregation 1/%d</th>\n",(int)(0.5+i/line));\r
-   fprintf(f,"<th colspan=\"%d\">%d traffic classes</th></tr>\n",keywordcount,total);\r
+   fprintf(f,"</tr><tr><th colspan=\"4\">Aggregation 1/%d</th>\n", (int)(0.5+i/line));\r
+   fprintf(f,"<th colspan=\"%d\">%d traffic classes</th></tr>\n", keywordcount, total);\r
 \r
    fputs("</table>\n",f);\r
  }\r
- else if(!dry_run && !just_flush) \r
+ else if(!dry_run && !just_flush)\r
+ {\r
   perror(html);\r
+ }\r
 \r
- i=1;\r
+ i=0;\r
  if(f)\r
  {\r
   unsigned long long total_traffic=0, total_direct=0, total_proxy=0, total_upload=0, tmp_sum=0;\r
@@ -1591,16 +1612,18 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
 <td align=\"right\">maximum</td>\\r
 <td>prio</td></tr>\n",f);      \r
 \r
-  for_each(ip,ips)\r
+  for_each(ip,ips) if(!use_jquery_popups || !ip->sharing)\r
   {\r
    char *f1="", *f2="";\r
-   if(ip->max<ip->desired)\r
+   i++;\r
+      \r
+   if(ip->max < ip->desired)\r
    {\r
     f1="<span style=\"color:red\">";\r
     f2="</span>";\r
     limit_count++;\r
    }\r
-   else if(ip->prio>highest_priority+1)\r
+   else if(ip->prio > highest_priority+1)\r
    {\r
     f1="<span style=\"color:brown\">";\r
     f2="</span>";\r
@@ -1611,19 +1634,22 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
    printf("%03d. %-22s %10Lu (%d/%d)\n",i ,ip->name, ip->traffic, ip->min, ip->max); \r
 #endif\r
    /* hostnames -------------------------------------- */\r
-   fprintf(f,"<tr><td align=\"right\"><a name=\"%s\"></a>%d</td><td><a href=\"%s%s.log\">%s</a>\n", ip->name, i, log_url, ip->name, ip->name);   \r
-   fprintf(f,"<span id=\"sharing_%d\" style=\"display:none\">",i);\r
-   popup_button=0;\r
-   for_selected(sharedip,ips,eq(ip->name,sharedip->sharing))\r
-   {\r
-    fprintf(f,"<br /><a href=\"%s%s.log\">%s</a>\n", log_url, sharedip->name, sharedip->name);\r
-    popup_button=1;\r
-   }\r
-   fputs("</span>\n",f);\r
-   if(popup_button)\r
+   fprintf(f,"<tr><td align=\"right\"><a name=\"%s\"></a>%d</td><td><a href=\"%s%s.log\">%s</a>\n", ip->name, i, log_url, ip->name, ip->name);\r
+   if(use_jquery_popups)\r
    {\r
-    fprintf(f,"<span>[<a href=\"#\" onClick=\"$(this).parent().hide();$(\'#sharing_%d\').show();$(\'#download_%d\').show();$(\'#upload_%d\').show();return(false);\" style=\"cursor: pointer; text-decoration:none;\">+</a>]</span>",\r
-              i, i, i);\r
+     fprintf(f,"<span id=\"sharing_%d\" style=\"display:none\">",i);\r
+     popup_button=0;\r
+     for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing))\r
+     {\r
+      fprintf(f,"<br /><a href=\"%s%s.log\">%s</a>\n", log_url, sharedip->name, sharedip->name);\r
+      popup_button++;\r
+     }\r
+     fputs("</span>\n",f);\r
+     if(popup_button)\r
+     {\r
+      fprintf(f,"<span>[<a 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
+     }\r
    }\r
    fputs("</td>\n",f);\r
    /* ----------------------------------------------- */\r
@@ -1634,7 +1660,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     if(ip->lmsid > 0)\r
     {\r
      /*base URL will be configurable soon ... */\r
-     fprintf(f,"<a href=\"https://hermes.spoje.net/?m=customerinfo&amp;id=%d\">%04d</a>\n", ip->lmsid, ip->lmsid);\r
+     fprintf(f,"<a href=\"%s%d\">%04d</a>\n", lms_url, ip->lmsid, ip->lmsid);\r
     }\r
     else if(ip->lmsid == 0)\r
     {\r
@@ -1646,16 +1672,20 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
    fprintf(f,"<td align=\"right\"><span style=\"color:#%s\">%Lu M</span></td>",\r
              ip->keyword->html_color,\r
              ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)));\r
-   fprintf(f,"<td align=\"right\">%s%Lu M%s",f1, ip->traffic, f2);\r
+   fprintf(f,"<td align=\"right\">%s%Lu M%s", f1, ip->traffic, f2);\r
 \r
    /* download --------------------------------------- */\r
    fprintf(f,"</td><td align=\"right\">%Lu M", ip->direct);\r
-   fprintf(f,"<span id=\"download_%d\" style=\"display:none\">",i);\r
-   for_selected(sharedip,ips,eq(ip->name,sharedip->sharing))\r
+   if(use_jquery_popups)\r
    {\r
-    fprintf(f,"<br />%Lu M", sharedip->direct);\r
+     fprintf(f,"<span id=\"download_%d\" style=\"display:none\">",i);\r
+     for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing))\r
+     {\r
+      fprintf(f,"<br />%Lu M", sharedip->direct);\r
+     }\r
+     fputs("</span>\n",f);\r
    }\r
-   fputs("</span></td>\n",f);\r
+   fputs("</td>\n",f);\r
    /* ----------------------------------------------- */\r
 \r
    if(qos_proxy)\r
@@ -1664,16 +1694,21 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
    }\r
    /* upload ---------------------------------------- */\r
    fprintf(f,"<td align=\"right\">%Lu M", ip->upload);\r
-   fprintf(f,"<span id=\"upload_%d\" style=\"display:none\">",i);\r
-   for_selected(sharedip,ips,eq(ip->name,sharedip->sharing))\r
+   if(use_jquery_popups)\r
    {\r
-    fprintf(f,"<br />%Lu M", sharedip->upload);\r
+     fprintf(f,"<span id=\"upload_%d\" style=\"display:none\">",i);\r
+     for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing))\r
+     {\r
+      fprintf(f,"<br />%Lu M", sharedip->upload);\r
+     }\r
+     fputs("</span>\n",f);\r
    }\r
-   fputs("</span></td>\n",f);\r
+   fputs("</td>\n",f);\r
    /* ----------------------------------------------- */\r
 \r
    fprintf(f,"<td align=\"right\">%d k</td><td align=\"right\">%d k</td><td align=\"right\">%s%d k%s</td><td>%s%d%s</td></tr>\n",\r
              ip->min,ip->desired,f1,ip->max,f2,f1,ip->prio,f2);\r
+\r
    total_traffic+=ip->traffic;\r
    total_direct+=ip->direct;\r
    total_proxy+=ip->proxy;\r
@@ -1687,9 +1722,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     sum->i=active_classes;\r
     insert(sum,sums,order_by,i);\r
    }\r
-   \r
-   i++;\r
-   \r
+\r
    if(!just_preview)\r
    {\r
     sprintf(str,"%s/%s.log",log_dir,ip->name);\r
@@ -1697,12 +1730,13 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     if(iplog)\r
     {\r
      fprintf(iplog,"%ld\t%s\t%Lu\t%Lu\t%Lu\t%Lu\t%d\t%d\t%d\t%d\t%s",\r
-                    time(NULL),ip->name,ip->traffic,ip->direct,ip->proxy,ip->upload,ip->min,ip->max,ip->desired,ip->lmsid,d); /* d = date*/\r
+                    time(NULL), ip->name, ip->traffic, ip->direct, ip->proxy,\r
+                    ip->upload, ip->min, ip->max, ip->desired, ip->lmsid, d); /* d = date*/\r
      fclose(iplog);\r
     }\r
    }\r
   }\r
-  fprintf(f,"<tr><th colspan=\"%d\" align=\"left\">SUMMARY:</td>",colspan-7);\r
+  fprintf(f,"<tr><th colspan=\"%d\" align=\"left\">%d CLASSES</th>", colspan-7, i);\r
   fprintf(f,"<th align=\"right\">%Lu M</th><th align=\"right\">%Lu M</th>\n", total_traffic, total_direct);\r
   if(qos_proxy)\r
   {\r
@@ -1786,7 +1820,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     {\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, total, limit_count, prio_count, d); /* d = date*/\r
+                   active_classes, total_traffic, i, limit_count, prio_count, d); /* d = date*/\r
      fclose(iplog);\r
     }\r
    }\r
@@ -1809,9 +1843,8 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
  i=0;\r
  printf("%-22s %-15s mark\n","name","ip");\r
 \r
- for_selected(ip,ips,ip->mark>0)\r
+ for_each(ip,ips) if(ip->mark>0)\r
  { \r
-  \r
   if(idxs)\r
   {\r
    char *buf;\r
This page took 0.357574 seconds and 4 git commands to generate.