X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=htmlandlogs.c;h=c0d564894684a645e37372c6b44ab3c93e850797;hb=0995c4adca9bd65afd16064d582ae8c404c2e8d5;hp=98af96c4a3fb22b34208d9e0bd8b5c3c9450beb8;hpb=0db8e99319ee2e9798ba7fb58a7666791cf81414;p=svn%2FPrometheus-QoS%2F.git
diff --git a/htmlandlogs.c b/htmlandlogs.c
index 98af96c..c0d5648 100644
--- a/htmlandlogs.c
+++ b/htmlandlogs.c
@@ -30,14 +30,18 @@ void append_log(struct IP *self) /*using global variables*/
FILE *f;
date(d); /* this is typical cll1.h macro - prints current date */
- string(str,STRLEN);
- sprintf(str,"%s/%s.log", log_dir, self->name);
- f=fopen(str,"a");
+ string(str, STRLEN);
+ sprintf(str, "%s/%s.log", log_dir, self->name);
+
+ /*-----------------------------------------------------------------*/
+ printf("Writing traffic log %s ...\n", str);
+ /*-----------------------------------------------------------------*/
+ f = fopen(str, "a");
if(f > 0)
{
- fprintf(f,"%ld\t%s\t%Lu\t%Lu\t%Lu\t%Lu\t%d\t%d\t%d\t%d\t%s",
- time(NULL), self->name, self->traffic, self->direct, self->proxy,
- self->upload, self->min, self->max, self->desired, self->lmsid, d); /* d = date*/
+ fprintf(f, "%ld\t%s\t%Lu\t%Lu\t%Lu\t%Lu\t%d\t%d\t%d\t%d\t%s",
+ time(NULL), self->name, self->traffic, self->direct, self->proxy,
+ self->upload, self->min, self->max, self->desired, self->lmsid, d); /* d = date*/
fclose(f);
}
else
@@ -191,11 +195,16 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
{
fprintf(f,"",i);
popup_button=0;
- for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing))
+ for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */
{
fprintf(f,"
%s\n", log_url, sharedip->name, sharedip->name);
popup_button++;
}
+ for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */
+ {
+ fprintf(f,"
%s/64\n", log_url, sharedip->addr, sharedip->addr);
+ popup_button++;
+ }
fputs("\n",f);
if(popup_button)
{
@@ -229,7 +238,11 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
if(use_jquery_popups)
{
fprintf(f,"",i);
- for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing))
+ for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */
+ {
+ fprintf(f,"
%Lu", sharedip->direct);
+ }
+ for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */
{
fprintf(f,"
%Lu", sharedip->direct);
}
@@ -247,7 +260,11 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
if(use_jquery_popups)
{
fprintf(f,"",i);
- for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing))
+ for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */
+ {
+ fprintf(f,"
%Lu", sharedip->upload);
+ }
+ for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */
{
fprintf(f,"
%Lu", sharedip->upload);
}