-int filter_type=1; /*1 mark, 2 classify*/\r
-char *mark="MARK";\r
-char *mark_iptables="MARK --set-mark ";\r
-int dry_run=0; /* preview - use puts() instead of system() */\r
-char *config="/etc/prometheus/prometheus.conf"; /* main configuration file */\r
-char *hosts="/etc/prometheus/hosts"; /* line bandwidth definition file */\r
-char *tc="/sbin/tc"; /* requires tc with HTB support */\r
-char *iptables="/sbin/iptables"; /* requires iptables utility */\r
-char *iptablessave="/sbin/iptables-save"; /* new */\r
-char *iptablesrestore="/sbin/iptables-restore"; /* new */\r
-char *iptablesfile="/var/spool/prometheus.iptables"; /* new; file for iptables-restore*/\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
-FILE *iptables_file=NULL;\r
-char *html="/var/www/traffic.html"; /* hall of fame filename */\r
-char *preview="/var/www/preview.html"; /* hall of fame preview */\r
-char *cmdlog="/var/log/prometheus"; /* command log filename */\r
-char *credit="/var/run/prometheus.credit"; /* credit log file */\r
-int enable_credit=1; /* enable credit file */\r
-int use_credit=0; /* use credit file (if enabled)*/\r
-char *log_dir="/var/www/logs/"; /* log directory pathname */\r
-char *log_url="logs/"; /* log directory URL prefix */\r
-char *title="Hall of Fame - Greatest Suckers"; /* hall of fame title */\r
-int hall_of_fame=1; /* enable hall of fame */\r
-char *lan="eth0"; /* LAN interface */\r
-char *lan_medium="100Mbit"; /* 10Mbit/100Mbit ethernet */\r
-char *wan="eth1"; /* WAN/ISP interface */\r
-char *wan_medium="100Mbit"; /* 10Mbit/100Mbit ethernet */\r
-char *qos_leaf="sfq perturb 5"; /* leaf discipline */\r
-char *qos_free_zone=NULL; /* QoS free zone */\r
-int qos_proxy=1; /* include proxy port to QoS */\r
-int include_upload=1; /* upload+download=total traffic */\r
-char *proxy_ip="192.168.1.1/32"; /* our IP with proxy port */\r
-int proxy_port=3128; /* proxy port number */\r
-long long int line=1024; /* WAN/ISP download in kbps */\r
-long long int up=1024; /* WAN/ISP upload in kbps */\r
-int free_min=32; /* minimum guaranted bandwidth for all undefined hosts */\r
-int free_max=64; /* maximum allowed bandwidth for all undefined hosts */\r
-int qos_free_delay=0; /* seconds to sleep before applying new QoS rules */\r
-int digital_divide=2; /* controls digital divide weirdness ratio, 1...3 */ \r
-int max_nesting=3; /* maximum nesting of HTB clases, built-in maximum seems to be 4 */\r
-int htb_r2q=1; \r
-int burst=8; /* HTB burst (in kbits) */\r
-int burst_main=64;\r
-int burst_group=32;\r
-int magic_priorities=8; /* number of priority levels (soft shaping) */\r
-int magic_treshold=8; /* reduce ceil by X*magic_treshhold kbps (hard shaping) */\r
-int keywordcount=0;\r
-\r
-/* not yet implemented:\r
- int fixed_packets=0; maximum number of pps per IP address (not class!) \r
- int packet_limit=5; maximum number of pps to htn CEIL, not rate !!! \r
-*/\r
-FILE *log_file=NULL;\r
-\r
-char *kwd="via-prometheus"; /* /etc/hosts comment, eg. #qos-64-128 */\r
-\r
-const int idxtable_treshold1=24; /* this is no longer configurable */\r
-const int idxtable_treshold2=12; /* this is no longer configurable */\r
-const int idxtable_bitmask1=3; /* this is no longer configurable */\r
-const int idxtable_bitmask2=3; /* this is no longer configurable */\r
-\r
-\r
-/* not yet implemented:\r
--s start shaping! (keep data transfer statistics - but apply shaping)\n\\r
--r just reload configuration (...and keep data transfer statistics)\n\\r
-*/\r
-\r
-/* ==== This is C<<1 stuff - learn C<<1 first! http://cll1.arachne.cz ==== */\r
-\r
-struct IP\r
+int filter_type = 1; /*1 mark, 2 classify*/\r
+char *final_chain = "DROP"; /* REJECT would be better, but it is impossible in mangle */\r
+char *mark = "MARK";\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\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
+int use_credit = FALSE; /* use credit file (if enabled)*/\r
+char *title = "Hall of Fame - Greatest Suckers"; /* hall of fame title */\r
+int hall_of_fame = TRUE; /* enable hall of fame */\r
+char *lan = "eth0"; /* LAN interface */\r
+char *lan_medium = "100Mbit"; /* 10Mbit/100Mbit ethernet */\r
+char *wan = "eth1"; /* WAN/ISP interface */\r
+char *ip6prefix = NULL; /* Prefix for global /48 IPv6 subnet */\r
+char *wan_medium = "100Mbit"; /* 10Mbit/100Mbit ethernet */\r
+char *qos_leaf = "sfq perturb 5"; /* leaf discipline */\r
+char *qos_free_zone = NULL; /* QoS free zone */\r
+int qos_proxy = TRUE; /* include proxy port to QoS */\r
+int found_lmsid = FALSE; /* show links to users in LMS information system */\r
+int include_upload = TRUE; /* upload+download=total traffic */\r
+char *proxy_ip = "192.168.1.1/32"; /* our IP with proxy port */\r
+int proxy_port = 3128; /* proxy port number */\r
+long long int line = 1024; /* WAN/ISP download in kbps */\r
+long long int up = 1024; /* WAN/ISP upload in kbps */\r
+int free_min = 256; /* minimum guaranted bandwidth for all undefined hosts */\r
+int free_max = 512; /* maximum allowed bandwidth for all undefined hosts */\r
+int qos_free_delay = 0; /* seconds to sleep before applying new QoS rules */\r
+int digital_divide = 2; /* controls digital divide weirdness ratio, 1...3 */ \r
+int max_nesting = 3; /* maximum nesting of HTB clases, built-in maximum seems to be 4 */\r
+int htb_r2q = 256; /* should work for leaf values 512 kbps to 8 Mbps */\r
+int burst = 8; /* HTB burst (in kbits) */\r
+int burst_main = 64;\r
+int burst_group = 32;\r
+int magic_treshold = 8; /* reduce ceil by X*magic_treshhold kbps (hard shaping) */\r
+int keywordcount = 0;\r
+int class_count = 0;\r
+int ip_count = 0;\r
+FILE *log_file = NULL;\r
+char *kwd = "via-prometheus"; /* /etc/hosts comment, eg. #qos-64-128 */\r
+\r
+const int highest_priority = 0; /* highest HTB priority (HTB built-in value is 0) */\r
+const int lowest_priority = 7; /* lowest HTB priority (HTB built-in value is 7) */\r
+const int idxtable_treshold1 = 24; /* this is no longer configurable */\r
+const int idxtable_treshold2 = 12; /* this is no longer configurable */\r
+const int idxtable_bitmask1 = 3; /* this is no longer configurable */\r
+const int idxtable_bitmask2 = 3; /* this is no longer configurable */\r
+\r
+struct IP *ips = NULL, *networks = NULL, *ip, *sharedip;\r
+struct Group *groups = NULL, *group;\r
+struct Keyword *keyword, *defaultkeyword=NULL, *keywords=NULL;\r
+\r
+void help(void);\r
+/* implemented in help.c */
+\r
+void get_traffic_statistics(const char *whichiptables, int ipv6);\r
+/* implemented in parseiptables.c */\r
+\r
+void parse_ip_log(int argc, char **argv);\r
+/* implemented in parselog.c */\r
+\r
+void parse_hosts(char *hosts);\r
+/* implemented in parsehosts.c */\r
+\r
+void write_json_traffic(char *json);\r
+/* implemented in json.c */\r
+\r
+void write_htmlandlogs(char *html, char *d, int total, int just_preview);\r
+/* implemented in htmlandlogs.c */\r
+\r
+void analyse_topology(char *traceroute);\r
+/* implemented in networks.c */\r
+\r
+\r
+const char *tr_odd_even(void)\r