first draft of prometheus manual page
[svn/Prometheus-QoS/.git] / prometheus.c
index 19f25ef..366608f 100644 (file)
@@ -31,7 +31,7 @@
 \r
 #include "cll1.h"\r
 \r
-const char *version="0.8.0";\r
+const char *version="0.7.7"; /*0.7.9 will be last development, 0.8.0 first stable */\r
 \r
 /* ======= Help screen is hopefuly self-documenting part of code :-) ======= */\r
 \r
@@ -109,10 +109,10 @@ FILE *log_file=NULL;
 \r
 char *kwd="via-prometheus";           /* /etc/hosts comment, eg. #qos-64-128 */\r
 \r
-const idxtable_treshold1=24;         /* this is no longer configurable */\r
-const idxtable_treshold2=12;         /* this is no longer configurable */\r
-const idxtable_bitmask1=3;           /* this is no longer configurable */\r
-const idxtable_bitmask2=3;           /* this is no longer configurable */\r
+const int idxtable_treshold1=24;         /* this is no longer configurable */\r
+const int idxtable_treshold2=12;         /* this is no longer configurable */\r
+const int idxtable_bitmask1=3;           /* this is no longer configurable */\r
+const int idxtable_bitmask2=3;           /* this is no longer configurable */\r
 \r
 \r
 /* not yet implemented:\r
@@ -486,7 +486,7 @@ void get_traffic_statistics(void)
            else\r
             sscanf(ptr,"%Lu",&traffic); traffic+=(1<<19); traffic>>=20;\r
            break;\r
-   case 3: if(strncmp(ptr,"post_",5) && strncmp(ptr,"forw_",5) || commonflag)\r
+   case 3: if((strncmp(ptr,"post_",5) && strncmp(ptr,"forw_",5)) || commonflag)\r
             accept=eq(ptr,mark);\r
             /*if (filter_type==1) accept=eq(ptr,"MARK"); else accept=eq(ptr,"CLASSIFY");*/\r
            break;\r
@@ -877,7 +877,7 @@ Credits: CZFree.Net, Martin Devera, Netdave, Aquarius\n\n",version);
   if(ip_count>idxtable_treshold1 && !just_flush)\r
   {\r
    int idxcount=0, bitmask=32-idxtable_bitmask1; /* default net mask: 255.255.255.240 */\r
-   char *subnet, *ptr, *buf;\r
+   char *subnet, *buf;\r
    /*-----------------------------------------------------------------*/\r
    printf("Detected %d addresses - indexing iptables rules to improve performance...\n",ip_count);\r
    /*-----------------------------------------------------------------*/\r
@@ -1150,7 +1150,7 @@ Credits: CZFree.Net, Martin Devera, Netdave, Aquarius\n\n",version);
 #ifdef DEBUG\r
    printf("Total groups: %d Total bandwidth requested: %d k\nAGGREGATION: 1/%d\n",count,i,i/line);\r
 #endif\r
-   fprintf(f,"<tr><th colspan=\"2\" align=\"left\">Line %d k</td>",line);\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
    every(keyword,keywords)\r
@@ -1259,15 +1259,15 @@ Credits: CZFree.Net, Martin Devera, Netdave, Aquarius\n\n",version);
    fputs("<a name=\"erp\"></a><p><table border><tr><th colspan=\"4\">Enterprise Research and Planning (ERP)</th></tr>\n",f);\r
    fputs("<tr><td colspan=\"2\">Active Classes</td><td colspan=\"2\">Data transfers</td></tr>\n",f);\r
    find (sum,sums,sum->l>=total/4)\r
-    fprintf(f,"<tr><td>Top %d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%d %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
+    fprintf(f,"<tr><td>Top %d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
    find (sum,sums,sum->i==10)\r
-    fprintf(f,"<tr><td>Top 10</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%d %%</td></tr>\n",(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
+    fprintf(f,"<tr><td>Top 10</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
    find (sum,sums,sum->l>=total/2)\r
-    fprintf(f,"<tr><td>Top %d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%d %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
+    fprintf(f,"<tr><td>Top %d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
    find (sum,sums,sum->i>=(active_classes+3)/4)\r
-    fprintf(f,"<tr><td>Top %d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%d %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
+    fprintf(f,"<tr><td>Top %d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
    find (sum,sums,sum->i>=(active_classes+1)/2)\r
-    fprintf(f,"<tr><td>Top %d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%d %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
+    fprintf(f,"<tr><td>Top %d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total);\r
    fprintf(f,"<tr><th align=\"left\">All %d</th><th align=\"right\">100 %%</th><th align=\"right\">%Lu M</th><th align=\"right\">100 %%</th></tr>\n",active_classes,total);\r
    fputs("</table>\n",f);\r
   }\r
This page took 0.156283 seconds and 4 git commands to generate.