proxy taffic shaping will be obsolete feature in 0.8.4
[svn/Prometheus-QoS/.git] / parseiptables.c
index 1f22d132226dcfefc637f6ba8cc02b890c81282f..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
@@ -150,7 +150,7 @@ void get_traffic_statistics(const char *whichiptables, int ipv6)
    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
@@ -173,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.120522 seconds and 4 git commands to generate.