GIT.Harvie.CZ
/
svn
/
Prometheus-QoS
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
final bug fix - works now
[svn/Prometheus-QoS/.git]
/
parseiptables.c
diff --git
a/parseiptables.c
b/parseiptables.c
index cad83642137ca3e86e8c266452b1120f5d634bc3..b44c7ad133008b5275d3e128449a0ff40d752deb 100644
(file)
--- a/
parseiptables.c
+++ b/
parseiptables.c
@@
-1,4
+1,4
@@
-/* Modified by: xChaos, 20131
029
*/
\r
+/* Modified by: xChaos, 20131
208
*/
\r
\r
#include "cll1-0.6.2.h"
\r
#include "ipstruct.h"
\r
\r
#include "cll1-0.6.2.h"
\r
#include "ipstruct.h"
\r
@@
-13,12
+13,15
@@
extern int free_min;
extern int free_max;
\r
extern int include_upload;
\r
\r
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
/* ===================== 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
\r
textfile(Pipe,str) *line,*lines=NULL;
\r
string(str,STRLEN);
\r
@@
-98,7
+101,6
@@
void get_traffic_statistics(const char *whichiptables, int ipv6)
}
\r
else if(!ipv6)
\r
{
\r
}
\r
else if(!ipv6)
\r
{
\r
-
\r
/* if(downloadflag)
\r
{
\r
if(strstr(proxy_ip,ptr))
\r
/* if(downloadflag)
\r
{
\r
if(strstr(proxy_ip,ptr))
\r
@@
-108,8
+110,7
@@
void get_traffic_statistics(const char *whichiptables, int ipv6)
\r
}
\r
else
\r
\r
}
\r
else
\r
- {
\r
-*/
\r
+ { */
\r
if(!downloadflag)
\r
{
\r
ipaddr = ptr;
\r
if(!downloadflag)
\r
{
\r
ipaddr = ptr;
\r
@@
-152,6
+153,7
@@
void get_traffic_statistics(const char *whichiptables, int ipv6)
printf("(down) ");
\r
}
\r
\r
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
printf("%s %Lu MB (%ld pkts)\n", ipaddr, traffic, pkts);
\r
\r
if_exists(ip, ips, eqi(ip->addr,ipaddr));
\r
@@
-179,14
+181,16
@@
void get_traffic_statistics(const char *whichiptables, int ipv6)
}
\r
else
\r
{*/
\r
}
\r
else
\r
{*/
\r
- ip->traffic += traffic;
\r
+ ip->traffic += traffic;
\r
+ ip->traffic_down += traffic;
\r
/* } */
\r
/* } */
\r
-
/* ip->direct += ip->traffic-ip->upload
; /*-ip->proxy;*/
\r
+
ip->direct += traffic
; /*-ip->proxy;*/
\r
ip->pktsdown += pkts;
\r
}
\r
else
\r
{
\r
ip->upload += traffic;
\r
ip->pktsdown += pkts;
\r
}
\r
else
\r
{
\r
ip->upload += traffic;
\r
+ ip->traffic_up += traffic;
\r
ip->pktsup += pkts;
\r
if(include_upload)
\r
{
\r
ip->pktsup += pkts;
\r
if(include_upload)
\r
{
\r
This page took
0.135568 seconds
and
4
git commands to generate.