X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=htmlandlogs.c;h=798544db52b6e0480dbe4166625c5cb3228057fb;hb=dba7666bdacf8846560e5414b6c9535434e98f8b;hp=39a4286abd51192fbcfda7e3542588be5d66627d;hpb=8e7aa99528485133231579d5933643eecfe0e0af;p=svn%2FPrometheus-QoS%2F.git
diff --git a/htmlandlogs.c b/htmlandlogs.c
index 39a4286..798544d 100644
--- a/htmlandlogs.c
+++ b/htmlandlogs.c
@@ -14,7 +14,6 @@ extern const char *version;
extern const char *stats_html_signature;
extern char *jquery_url;
extern int keywordcount;
-extern long long int line;
extern int dry_run;
extern int qos_proxy;
extern char *title;
@@ -23,6 +22,7 @@ extern int found_lmsid;
extern char *lms_url;
extern char *log_dir;
extern char *ip6prefix;
+extern int traffic_detected;
const char *tr_odd_even(void);
/* implemented in prometheus.c, shared with parselogs.c */
@@ -100,19 +100,19 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
count++;
}
#ifdef DEBUG
- printf("Total groups: %d Total bandwidth requested: %d kb/s\nAGGREGATION: 1/%d\n",
- count, i, i/line);
+ printf("Total groups: %d Total bandwidth requested: %d kb/s\n",
+ count, i, i);
#endif
fprintf(f,"\n\
\n\
- Line %Ld kb/s",line);
+ ");
fprintf(f," %d %d kb/s",total,i);
for_each(keyword, keywords) if(keyword->ip_count)
{
fprintf(f," %d IPs ",keyword->ip_count);
}
- fprintf(f,"Aggregation 1/%d \n", (int)(0.5+i/line));
+ fprintf(f," \n", keywordcount, total);
fputs("\n",f);
@@ -130,7 +130,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
int active_classes = 0;
// int colspan = 14;
struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums = NULL;
- int limit_count = 0, prio_count = 0;
+ int agreg_count = 0, limit_count = 0, prio_count = 0;
int popup_button = 0;
/* IPv6 vs. IPv4 stats */
unsigned long long pkts4 =0, pkts6 = 0, bytes4 = 0, bytes6 = 0;
@@ -197,7 +197,13 @@ $(\'#pktsup_\'+n).show();\
char *f1="", *f2="";
i++;
- if(ip->max < ip->desired)
+ if(ip->aggregated > 1)
+ {
+ f1 = "";
+ f2 = "";
+ agreg_count++;
+ }
+ else if(ip->max < ip->desired)
{
f1 = "";
f2 = "";
@@ -232,8 +238,8 @@ $(\'#pktsup_\'+n).show();\
for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */
{
- fprintf(f, "\n");
fprintf(f," %d traffic classes
%s/64\n",
- log_url, sharedip->addr, sharedip->addr);
+ fprintf(f, "
%s/%d\n",
+ log_url, sharedip->addr, sharedip->addr, sharedip->mask);
popup_button++;
}
@@ -259,7 +265,7 @@ style=\"cursor: pointer;\">+%d]",
}
else if(ip->lmsid == 0)
{
- fputs("-------",f);
+ fputs("------",f);
}
fputs("\n",f);
}
@@ -397,7 +403,7 @@ style=\"cursor: pointer;\">+%d]",
insert(sum,sums,order_by,i);
}
- if(!just_preview)
+ if(!just_preview && traffic_detected)
{
append_log(ip);
for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing))
@@ -405,6 +411,10 @@ style=\"cursor: pointer;\">+%d]",
append_log(sharedip);
}
}
+ else
+ {
+ printf(".");
+ }
}
fprintf(f, "\n\
\n\n",
- limit_count, prio_count);
+ fprintf(f, "%d CLASSES ", i);
@@ -419,9 +429,11 @@ style=\"cursor: pointer;\">+%d]",
*/
fprintf(f, "%Lu %d ",
total_direct, total_pktdown/i);
- fprintf(f, "LIMIT %dx \
-LOW-PRIO %dx