proxy taffic shaping will be obsolete feature in 0.8.4
[svn/Prometheus-QoS/.git] / parseiptables.c
index cc2daacc5df3db6810a4657837ec4c4b17e9977e..cfd1add8018f5c711974c435df0b078e45bb11a0 100644 (file)
@@ -1,4 +1,4 @@
-/* Modified by: xChaos, 20130115 */\r
+/* Modified by: xChaos, 20131029 */\r
 \r
 #include "cll1-0.6.2.h"\r
 #include "ipstruct.h"\r
@@ -41,7 +41,7 @@ void get_traffic_statistics(const char *whichiptables, int ipv6)
   unsigned long pkts = 0;\r
   char *ipaddr = NULL,*ptr;\r
   \r
-  valid_columns(ptr, line->str, ' ', col) \r
+  valid_columns(ptr, line->str, ' ', col)\r
   if(valid) switch(col)\r
   { \r
    case 1: if(eq(ptr,"Chain"))\r
@@ -125,7 +125,11 @@ void get_traffic_statistics(const char *whichiptables, int ipv6)
    if(ipv6 && isipv6)\r
    {\r
     *isipv6=0;\r
-    printf("(IPv6) ");   \r
+    printf("(IPv6) ");\r
+   }\r
+   else\r
+   {\r
+    printf("(IPv4) ");\r
    }\r
    \r
    if(proxyflag)\r
@@ -141,12 +145,12 @@ void get_traffic_statistics(const char *whichiptables, int ipv6)
     printf("(down) ");\r
    }\r
    \r
-   printf("IP %s: %Lu MB (%ld pkts)\n", ipaddr, traffic, pkts);\r
+   printf("%s %Lu MB (%ld pkts)\n", ipaddr, traffic, pkts);\r
 \r
    if_exists(ip, ips, eqi(ip->addr,ipaddr)); \r
    else \r
    {\r
-    TheIP(ipaddr);\r
+    TheIP(ipaddr, FALSE);\r
     if(eq(ip->addr,"0.0.0.0/0"))\r
     {\r
      ip->name = "(unregistered)";\r
@@ -169,22 +173,22 @@ void get_traffic_statistics(const char *whichiptables, int ipv6)
     {\r
      ip->traffic += traffic;\r
     }\r
-    ip->direct = ip->traffic-ip->upload-ip->proxy;\r
-    ip->pktsdown = pkts;\r
+    ip->direct += ip->traffic-ip->upload-ip->proxy;\r
+    ip->pktsdown += pkts;\r
    }\r
    else\r
    {\r
-    ip->upload = traffic;\r
-    ip->pktsup = pkts;\r
+    ip->upload += traffic;\r
+    ip->pktsup += pkts;\r
     if(include_upload)\r
     {\r
      ip->traffic += traffic;\r
     }\r
     else \r
     {\r
-     if(traffic > ip->traffic)\r
+     if(ip->upload > ip->traffic)\r
      {\r
-      ip->traffic = traffic;     \r
+      ip->traffic = ip->upload;\r
      }\r
     }\r
    }\r
This page took 0.11345 seconds and 4 git commands to generate.