char *macrosfile = "/etc/prometheus/prometheus.macros"; /* rewrite rules for most common tariffs */\r
char *upstreamfile = "/etc/prometheus/upstream.interfaces"; /* list of interfaces to manage */\r
char *downstreamfile = "/etc/prometheus/downstream.interfaces"; /* list of interfaces to manage */\r
+char *qosfreefile = "/etc/prometheus/qosfree.interfaces"; /* list of interfaces to manage */\r
char *iptablesfile = "/var/spool/prometheus.iptables"; /* temporary file for iptables-restore*/\r
char *ip6tablesfile = "/var/spool/prometheus.ip6tables"; /* temporary file for ip6tables-restore*/\r
char *credit = "/var/lib/misc/prometheus.credit"; /* credit log file */\r
struct Macro *macro, *macros = NULL;\r
struct Index *idxs = NULL, *idx, *metaindex;\r
struct Interface *interfaces = NULL, *interface;\r
+struct QosFreeInterface *qosfreeinterfaces = NULL, *qosfreeinterface;\r
\r
#define FREE_CLASS 3\r
#define OVERLIMIT_CLASS 4\r
option("hosts",hosts);\r
option("downstream-interfaces-list-filename",downstreamfile);\r
option("upstream-interfaces-list-filename",upstreamfile);\r
+ option("qos-free-interfaces-list-filename",qosfreefile);\r
option("macros-filename",macrosfile);\r
option("ip6-prefix",ip6prefix);\r
option("medium",medium);\r
}\r
}\r
done; /* ugly macro end */\r
-\r
\r
if(just_logs)\r
{\r
string(str, STRLEN); \r
string(limit_pkts, STRLEN);\r
\r
+ /*-----------------------------------------------------------------*/\r
+ printf("Parsing qos free interfaces file %s ...\n", qosfreefile);\r
+ /*-----------------------------------------------------------------*/\r
+ load(qosfreeinterface, qosfreeinterfaces,\r
+ qosfreefile, QosFreeInterface, name);\r
+\r
/*-----------------------------------------------------------------*/\r
printf("Parsing macro definition file %s ...\n", macrosfile);\r
/*-----------------------------------------------------------------*/\r
}\r
}\r
\r
+ for_each(qosfreeinterface, qosfreeinterfaces)\r
+ {\r
+ sprintf(str,"-A FORWARD -i %s -j ACCEPT", qosfreeinterface->name);\r
+ iptables_save_line(str, IPv4); \r
+ iptables_save_line(str, IPv6);\r
+ sprintf(str,"-A POSTROUTING -o %s -j ACCEPT", qosfreeinterface->name);\r
+ iptables_save_line(str, IPv4);\r
+ iptables_save_line(str, IPv6);\r
+ }\r
+ \r
if(ip_count > idxtable_treshold1 && !just_flush)\r
{\r
int idxcount=0, bitmask=32-idxtable_bitmask1;\r