From: xchaos Date: Thu, 24 Jan 2013 10:53:15 +0000 (+0000) Subject: IPv6 iptables exceptions (for OSPF) X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=0995c4adca9bd65afd16064d582ae8c404c2e8d5;p=svn%2FPrometheus-QoS%2F.git IPv6 iptables exceptions (for OSPF) git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@214 251d49ef-1d17-4917-a970-b30cf55b089b --- diff --git a/htmlandlogs.c b/htmlandlogs.c index e11af1a..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 diff --git a/prometheus.c b/prometheus.c index 1f2910f..fb8fa4a 100644 --- a/prometheus.c +++ b/prometheus.c @@ -83,7 +83,7 @@ char *mark = "MARK"; char *mark_iptables = "MARK --set-mark "; int dry_run = FALSE; /* preview - use puts() instead of system() */ char *iptablespreamble = "*mangle\n:PREROUTING ACCEPT [0:0]\n:POSTROUTING ACCEPT [0:0]\n:INPUT ACCEPT [0:0]\n:OUTPUT ACCEPT [0:0]\n:FORWARD ACCEPT [0:0]"; -char *ip6preamble = "-A FORWARD -p ipv6-icmp -j ACCEPT\n-A POSTROUTING -p ipv6-icmp -j ACCEPT"; +char *ip6preamble = "-A FORWARD -p ipv6-icmp -j ACCEPT\n-A POSTROUTING -p ipv6-icmp -j ACCEPT\n-A FORWARD -s fe80::/10 -j ACCEPT\n-A FORWARD -d ff00::/8 -j ACCEPT\n-A POSTROUTING -s fe80::/10 -j ACCEPT\n-A POSTROUTING -d ff00::/8 -j ACCEPT"; FILE *iptables_file = NULL; FILE *ip6tables_file = NULL; int enable_credit = TRUE; /* enable credit file */ @@ -1049,7 +1049,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); printf("%-22s %-15s mark\n","name","ip"); #endif - printf("Writing %s ... ", classmap); + printf("Writing %s ", classmap); f = fopen(classmap, "w"); if(f < 0) { @@ -1057,7 +1057,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); } /*-----------------------------------------------------------------*/ - puts(" + generating iptables and tc classes ... "); + printf(" + generating iptables and tc classes ... "); /*-----------------------------------------------------------------*/ for_each(ip, ips) if(ip->mark > 0) /* works only for IPv4 so far */