X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=parseiptables.c;h=b44c7ad133008b5275d3e128449a0ff40d752deb;hb=7449b3ede09ef8690b073f73d7732e0e9d532090;hp=eca2ced6221c4af51d98be83b5a9c0adf9376c86;hpb=21c4f9f3d7fd2c08978d591e8f98a35f50bdfaca;p=svn%2FPrometheus-QoS%2F.git diff --git a/parseiptables.c b/parseiptables.c index eca2ced..b44c7ad 100644 --- a/parseiptables.c +++ b/parseiptables.c @@ -13,12 +13,15 @@ extern int free_min; extern int free_max; extern int include_upload; +int traffic_detected = 0; + /* ===================== traffic analyser - uses iptables ================ */ void get_traffic_statistics(const char *whichiptables, int ipv6) { char *str,*cmd; - int downloadflag=0; + int downloadflag = 0; + traffic_detected = 0; textfile(Pipe,str) *line,*lines=NULL; string(str,STRLEN); @@ -150,6 +153,7 @@ void get_traffic_statistics(const char *whichiptables, int ipv6) printf("(down) "); } + traffic_detected = 1; printf("%s %Lu MB (%ld pkts)\n", ipaddr, traffic, pkts); if_exists(ip, ips, eqi(ip->addr,ipaddr)); @@ -178,6 +182,7 @@ void get_traffic_statistics(const char *whichiptables, int ipv6) else {*/ ip->traffic += traffic; + ip->traffic_down += traffic; /* } */ ip->direct += traffic; /*-ip->proxy;*/ ip->pktsdown += pkts; @@ -185,6 +190,7 @@ void get_traffic_statistics(const char *whichiptables, int ipv6) else { ip->upload += traffic; + ip->traffic_up += traffic; ip->pktsup += pkts; if(include_upload) {