FILE *f; \r
\r
date(d); /* this is typical cll1.h macro - prints current date */ \r
FILE *f; \r
\r
date(d); /* this is typical cll1.h macro - prints current date */ \r
- string(str,STRLEN); \r
- sprintf(str,"%s/%s.log", log_dir, self->name);\r
- f=fopen(str,"a");\r
+ string(str, STRLEN); \r
+ sprintf(str, "%s/%s.log", log_dir, self->name);\r
+\r
+ /*-----------------------------------------------------------------*/\r
+ printf("Writing traffic log %s ...\n", str);\r
+ /*-----------------------------------------------------------------*/\r
+ f = fopen(str, "a");\r
- fprintf(f,"%ld\t%s\t%Lu\t%Lu\t%Lu\t%Lu\t%d\t%d\t%d\t%d\t%s",\r
- time(NULL), self->name, self->traffic, self->direct, self->proxy,\r
- self->upload, self->min, self->max, self->desired, self->lmsid, d); /* d = date*/\r
+ fprintf(f, "%ld\t%s\t%Lu\t%Lu\t%Lu\t%Lu\t%d\t%d\t%d\t%d\t%s",\r
+ time(NULL), self->name, self->traffic, self->direct, self->proxy,\r
+ self->upload, self->min, self->max, self->desired, self->lmsid, d); /* d = date*/\r
char *mark_iptables = "MARK --set-mark ";\r
int dry_run = FALSE; /* preview - use puts() instead of system() */\r
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]";\r
char *mark_iptables = "MARK --set-mark ";\r
int dry_run = FALSE; /* preview - use puts() instead of system() */\r
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]";\r
-char *ip6preamble = "-A FORWARD -p ipv6-icmp -j ACCEPT\n-A POSTROUTING -p ipv6-icmp -j ACCEPT";\r
+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";\r
FILE *iptables_file = NULL;\r
FILE *ip6tables_file = NULL;\r
int enable_credit = TRUE; /* enable credit file */\r
FILE *iptables_file = NULL;\r
FILE *ip6tables_file = NULL;\r
int enable_credit = TRUE; /* enable credit file */\r
printf("%-22s %-15s mark\n","name","ip");\r
#endif\r
\r
printf("%-22s %-15s mark\n","name","ip");\r
#endif\r
\r
- printf("Writing %s ... ", classmap); \r
+ printf("Writing %s ", classmap); \r
f = fopen(classmap, "w"); \r
if(f < 0)\r
{\r
f = fopen(classmap, "w"); \r
if(f < 0)\r
{\r
}\r
\r
/*-----------------------------------------------------------------*/\r
}\r
\r
/*-----------------------------------------------------------------*/\r
- puts(" + generating iptables and tc classes ... ");\r
+ printf(" + generating iptables and tc classes ... ");\r
/*-----------------------------------------------------------------*/\r
\r
for_each(ip, ips) if(ip->mark > 0) /* works only for IPv4 so far */\r
/*-----------------------------------------------------------------*/\r
\r
for_each(ip, ips) if(ip->mark > 0) /* works only for IPv4 so far */\r