X-Git-Url: http://git.harvie.cz/?p=svn%2FPrometheus-QoS%2F.git;a=blobdiff_plain;f=parseiptables.c;fp=parseiptables.c;h=5a2043f714f55025d92cc300b937f830baee59f8;hp=8544df788461c6a0aa29d6a83a89b7e68876a8d0;hb=139fc8a0a7c49580783fb3c4b8050761e8bf021a;hpb=56f6397ec3e60052dce31b6417ff64572b880897 diff --git a/parseiptables.c b/parseiptables.c index 8544df7..5a2043f 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); @@ -78,6 +81,10 @@ void get_traffic_statistics(const char *whichiptables, int ipv6) else { sscanf(ptr,"%Lu",&traffic); + if(traffic) + { + traffic_detected = 1; + } traffic += (1<<19); traffic >>= 20; }