debug version
[svn/Prometheus-QoS/.git] / parseiptables.c
index eca2ced6221c4af51d98be83b5a9c0adf9376c86..b44c7ad133008b5275d3e128449a0ff40d752deb 100644 (file)
@@ -13,12 +13,15 @@ extern int free_min;
 extern int free_max;\r
 extern int include_upload;\r
 \r
+int traffic_detected = 0;\r
+\r
 /* ===================== traffic analyser - uses iptables  ================ */ \r
 \r
 void get_traffic_statistics(const char *whichiptables, int ipv6)\r
 {\r
  char *str,*cmd;\r
- int downloadflag=0;\r
+ int downloadflag = 0;\r
+ traffic_detected = 0;\r
 \r
  textfile(Pipe,str) *line,*lines=NULL;\r
  string(str,STRLEN);\r
@@ -150,6 +153,7 @@ void get_traffic_statistics(const char *whichiptables, int ipv6)
     printf("(down) ");\r
    }\r
    \r
+   traffic_detected = 1;\r
    printf("%s %Lu MB (%ld pkts)\n", ipaddr, traffic, pkts);\r
 \r
    if_exists(ip, ips, eqi(ip->addr,ipaddr)); \r
@@ -178,6 +182,7 @@ void get_traffic_statistics(const char *whichiptables, int ipv6)
     else\r
     {*/\r
     ip->traffic += traffic;\r
+    ip->traffic_down += traffic;\r
 /*    } */\r
     ip->direct += traffic; /*-ip->proxy;*/\r
     ip->pktsdown += pkts;\r
@@ -185,6 +190,7 @@ void get_traffic_statistics(const char *whichiptables, int ipv6)
    else\r
    {\r
     ip->upload += traffic;\r
+    ip->traffic_up += traffic;\r
     ip->pktsup += pkts;\r
     if(include_upload)\r
     {\r
This page took 0.091707 seconds and 4 git commands to generate.