summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/captiveportal.inc42
-rw-r--r--etc/inc/filter.inc16
-rw-r--r--etc/inc/interfaces.inc15
-rw-r--r--etc/inc/rrd.inc459
-rw-r--r--etc/inc/services.inc2
-rw-r--r--etc/inc/shaper.inc123
-rw-r--r--etc/inc/system.inc18
-rw-r--r--etc/inc/upgrade_config.inc4
-rw-r--r--etc/inc/vpn.inc14
-rwxr-xr-xetc/rc5
-rwxr-xr-xetc/rc.linkup6
-rwxr-xr-xetc/rc.newipsecdns2
-rwxr-xr-xusr/local/www/carp_status.php2
-rwxr-xr-xusr/local/www/diag_logs_relayd.php2
-rwxr-xr-xusr/local/www/firewall_shaper.php10
-rwxr-xr-xusr/local/www/services_captiveportal_ip.php6
-rwxr-xr-xusr/local/www/services_captiveportal_ip_edit.php11
-rw-r--r--usr/local/www/services_rfc2136.php6
-rw-r--r--usr/local/www/services_rfc2136_edit.php2
-rwxr-xr-xusr/local/www/services_snmp.php2
-rwxr-xr-xusr/local/www/status_gateway_groups.php2
-rwxr-xr-xusr/local/www/status_gateways.php2
-rwxr-xr-xusr/local/www/status_lb_pool.php2
-rwxr-xr-xusr/local/www/status_lb_vs.php2
-rwxr-xr-xusr/local/www/status_rrd_graph.php157
-rw-r--r--usr/local/www/status_rrd_graph_img.php31
-rwxr-xr-xusr/local/www/status_rrd_graph_settings.php45
-rw-r--r--usr/local/www/status_upnp.php2
-rwxr-xr-xusr/local/www/system_gateway_groups.php2
-rwxr-xr-xusr/local/www/system_gateway_groups_edit.php2
-rwxr-xr-xusr/local/www/system_gateways.php2
-rwxr-xr-xusr/local/www/system_gateways_edit.php2
-rwxr-xr-xusr/local/www/themes/code-red/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/metallic/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/nervecenter/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/pfsense/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/pfsense_ng/rrdcolors.inc.php1
-rw-r--r--usr/local/www/themes/the_wall/rrdcolors.inc.php1
39 files changed, 576 insertions, 429 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 1e96b41..0d3853b 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -425,45 +425,14 @@ EOD;
foreach ($cpips as $cpip)
$ips .= "or {$cpip} ";
$ips = "{ {$ips} }";
- //# allow access to our DHCP server (which needs to be able to ping clients as well)
- $cprules .= "add {$rulenum} set 1 pass udp from any 68 to {$ips} 67 in \n";
+ $cprules .= "add {$rulenum} set 1 pass ip from any to {$ips} in\n";
$rulenum++;
- $cprules .= "add {$rulenum} set 1 pass udp from any 68 to {$ips} 67 in \n";
- $rulenum++;
- $cprules .= "add {$rulenum} set 1 pass udp from {$ips} 67 to any 68 out \n";
+ $cprules .= "add {$rulenum} set 1 pass ip from {$ips} to any out\n";
$rulenum++;
$cprules .= "add {$rulenum} set 1 pass icmp from {$ips} to any out icmptype 0\n";
$rulenum++;
$cprules .= "add {$rulenum} set 1 pass icmp from any to {$ips} in icmptype 8 \n";
$rulenum++;
- //# allow access to our DNS forwarder
- $cprules .= "add {$rulenum} set 1 pass udp from any to {$ips} 53 in \n";
- $rulenum++;
- $cprules .= "add {$rulenum} set 1 pass udp from {$ips} 53 to any out \n";
- $rulenum++;
- # allow access to our web server
- $cprules .= "add {$rulenum} set 1 pass tcp from any to {$ips} 8000 in \n";
- $rulenum++;
- $cprules .= "add {$rulenum} set 1 pass tcp from {$ips} 8000 to any out \n";
-
- if (isset($config['captiveportal']['httpslogin'])) {
- $rulenum++;
- $cprules .= "add {$rulenum} set 1 pass tcp from any to {$ips} 8001 in \n";
- $rulenum++;
- $cprules .= "add {$rulenum} set 1 pass tcp from {$ips} 8001 to any out \n";
- }
- if (!empty($config['system']['webgui']['port']))
- $port = $config['system']['webgui']['port'];
- else if ($config['system']['webgui']['proto'] == "http")
- $port = 80;
- else
- $port = 443;
- $rulenum++;
- $cprules .= "add {$rulenum} set 1 pass tcp from any to {$ips} {$port} in \n";
- $rulenum++;
- $cprules .= "add {$rulenum} set 1 pass tcp from {$ips} {$port} to any out \n";
- $rulenum++;
-
/* Allowed ips */
$cprules .= "add {$rulenum} allow ip from table(3) to any in\n";
$rulenum++;
@@ -917,14 +886,17 @@ function captiveportal_allowedip_configure_entry($ipent) {
$bw_up = $ruleno + 20000;
$rules .= "pipe {$bw_up} config bw {$ipent['bw_up']}Kbit/s queue 100\n";
}
+ $subnet = "";
+ if (!empty($ipent['sn']))
+ $subnet = "/{$ipent['sn']}";
foreach ($tablein as $table)
- $rules .= "table {$table} add {$ipent['ip']} {$bw_up}\n";
+ $rules .= "table {$table} add {$ipent['ip']}{$subnet} {$bw_up}\n";
if ($enBwdown) {
$bw_down = $ruleno + 20001;
$rules .= "pipe {$bw_down} config bw {$ipent['bw_down']}Kbit/s queue 100\n";
}
foreach ($tableout as $table)
- $rules .= "table {$table} add {$ipent['ip']} {$bw_down}\n";
+ $rules .= "table {$table} add {$ipent['ip']}{$subnet} {$bw_down}\n";
return $rules;
}
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index af4619d..c480381 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1396,18 +1396,10 @@ function filter_nat_rules_generate() {
else
sigkillbypid("/var/run/inetd.pid", "HUP");
- if($pptpdcfg['mode'] && $pptpdcfg['mode'] != "off") {
- if($pptpdcfg['mode'] == "server")
- $pptpdtarget = "127.0.0.1";
- else if($pptpdcfg['mode'] == "redir")
- $pptpdtarget = $pptpdcfg['redir'];
- if($pptpdcfg['mode'] == "redir" && is_array($FilterIflist['wan'])) {
- /*
- * NB: ermal -- the rdr rule below is commented out now that we have a solution
- * for PPTP passthrough. This unbreaks other GRE traffic passing
- * through pfSense.
- * After some more testing this will be removed compeletely.
- */
+ $pptpdcfg = $config['pptpd'];
+ if($pptpdcfg['mode'] && $pptpdcfg['mode'] == "redir") {
+ $pptpdtarget = $pptpdcfg['redir'];
+ if(is_ipaddr($pptpdtarget) && is_array($FilterIflist['wan'])) {
$natrules .= <<<EOD
# PPTP
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index dc4cbdf..73e5554 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -819,10 +819,11 @@ function interface_bring_down($interface = "wan", $destroy = false) {
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
if ($realif == $ppp['if']) {
- if (!isset($ppp['ondemand'])) {
- killbypid("{$g['varrun_path']}/{$ifcfg['ipaddr']}_{$interface}.pid");
- sleep(2);
- unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf");
+ killbypid("{$g['varrun_path']}/{$ifcfg['ipaddr']}_{$interface}.pid");
+ sleep(2);
+ unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf");
+ if (isset($ppp['ondemand']) && !$destroy) {
+ interface_configure("wan");
}
break;
}
@@ -2227,7 +2228,7 @@ function interface_configure($interface = "wan", $reloadall = false) {
if (!$g['booting']) {
/* remove all IPv4 addresses */
while (mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " -alias", true) == 0);
- interface_bring_down($interface);
+ interface_bring_down($interface, true);
}
/* wireless configuration? */
@@ -2764,7 +2765,7 @@ function find_carp_interface($ip) {
foreach ($config['virtualip']['vip'] as $vip) {
if ($vip['mode'] == "carp" || $vip['mode'] == "carpdev") {
$carp_ip = get_interface_ip($vip['interface']);
- $if = `ifconfig | grep '$ip' -B1 | head -n1 | cut -d: -f1`;
+ $if = `ifconfig | grep '$ip ' -B1 | head -n1 | cut -d: -f1`;
if ($if)
return $if;
}
@@ -3209,4 +3210,4 @@ function setup_pppoe_reset_file($pppif, $iface="") {
unlink_if_exists($cron_file);
}
-?>
+?> \ No newline at end of file
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc
index 98766e3..356037e 100644
--- a/etc/inc/rrd.inc
+++ b/etc/inc/rrd.inc
@@ -1,7 +1,7 @@
<?php
/* $Id$ */
/*
- Copyright (C) 2008 Seth Mos
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -174,6 +174,7 @@ function enable_rrd_graphing() {
$proc = "-processor.rrd";
$mem = "-memory.rrd";
$cellular = "-cellular.rrd";
+ $vpnusers = "-vpnusers.rrd";
$rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool";
$netstat = "/usr/bin/netstat";
@@ -197,6 +198,7 @@ function enable_rrd_graphing() {
$rrdprocinterval = 60;
$rrdmeminterval = 60;
$rrdcellularinterval = 60;
+ $rrdvpninterval = 60;
$trafficvalid = $rrdtrafficinterval * 2;
$wirelessvalid = $rrdwirelessinterval * 2;
@@ -209,6 +211,7 @@ function enable_rrd_graphing() {
$procvalid = $rrdlbpoolinterval * 2;
$memvalid = $rrdmeminterval * 2;
$cellularvalid = $rrdcellularinterval * 2;
+ $vpnvalid = $rrdvpninterval * 2;
/* Asume GigE for now */
$downstream = 125000000;
@@ -250,8 +253,17 @@ function enable_rrd_graphing() {
$i = 0;
$ifdescrs = get_configured_interface_with_descr();
+ /* IPsec counters */
$ifdescrs['ipsec'] = "IPsec";
+ /* OpenVPN server counters */
+ if(is_array($config['openvpn']['openvpn-server'])) {
+ foreach($config['openvpn']['openvpn-server'] as $server) {
+ $serverid = "ovpns" . $server['vpnid'];
+ $ifdescrs[$serverid] = "{$server['description']}";
+ }
+ }
+ /* process all real and pseudo interfaces */
foreach ($ifdescrs as $ifname => $ifdescr) {
$temp = get_real_interface($ifname);
if($temp <> "") {
@@ -336,190 +348,264 @@ function enable_rrd_graphing() {
$rrdupdatesh .= "`$ifconfig {$realif} list sta| $awk 'gsub(\"M\", \"\") {getline 2;print substr(\$5, 0, length(\$5)-2) \":\" $4 \":\" $3}'`\n";
}
- /* QUEUES, set up the queues databases */
- if ($altq_list_queues[$ifname]) {
- $altq =& $altq_list_queues[$ifname];
- /* NOTE: Is it worth as its own function?! */
- switch ($altq->GetBwscale()) {
- case "Gb":
- $factor = 1024 * 1024 * 1024;
- break;
- case "Mb":
- $factor = 1024 * 1024;
- break;
- case "Kb":
- $factor = 1024;
- break;
- case "b":
- default:
- $factor = 1;
- break;
- }
- $qbandwidth = $altq->GetBandwidth() * $factor;
- if ($qbandwidth <=0)
- $qbandwidth = 100 * 1000 * 1000; /* 100Mbit */
- $qlist =& $altq->get_queue_list($notused);
- if (!file_exists("$rrddbpath$ifname$queues")) {
- $rrdcreate = "$rrdtool create $rrddbpath$ifname$queues --step $rrdqueuesinterval ";
- /* loop list of shaper queues */
- $q = 0;
- foreach ($qlist as $qname => $q) {
- $rrdcreate .= "DS:$qname:COUNTER:$queuesvalid:0:$qbandwidth ";
- }
+ /* OpenVPN, set up the rrd file */
+ if(stristr($ifname, "ovpns")) {
+ if (!file_exists("$rrddbpath$ifname$vpnusers")) {
+ $rrdcreate = "$rrdtool create $rrddbpath$ifname$vpnusers --step $rrdvpninterval ";
+ $rrdcreate .= "DS:users:GAUGE:$vpnvalid:0:10000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+
+ create_new_rrd($rrdcreate);
+ }
- $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+ /* enter UNKNOWN values in the RRD so it knows we rebooted. */
+ if($g['booting']) {
+ mwexec("$rrdtool update $rrddbpath$ifname$vpnusers N:U");
+ }
- create_new_rrd($rrdcreate);
+ if(is_array($config['openvpn']['openvpn-server'])) {
+ foreach($config['openvpn']['openvpn-server'] as $server) {
+ if("ovpns{$server['vpnid']}" == $ifname) {
+ $port = $server['local_port'];
+ }
}
+ }
+ $rrdupdatesh .= "\n";
+ $rrdupdatesh .= "# polling vpn users for interface $ifname $realif port $port\n";
+ $rrdupdatesh .= "list_current_users() {\n";
+ $rrdupdatesh .= " sleep 0.2\n";
+ $rrdupdatesh .= " echo \"status 2\"\n";
+ $rrdupdatesh .= " sleep 0.2\n";
+ $rrdupdatesh .= " echo \"quit\"\n";
+ $rrdupdatesh .= "}\n";
+ $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$vpnusers N:\\\n";
+ $rrdupdatesh .= "`list_current_users | nc localhost {$port} | awk -F\",\" '/^CLIENT_LIST/ {print \$2}' | wc -l | awk '{print $1}'`\n";
+ }
- if (!file_exists("$rrddbpath$ifname$queuesdrop")) {
- $rrdcreate = "$rrdtool create $rrddbpath$ifname$queuesdrop --step $rrdqueuesdropinterval ";
- /* loop list of shaper queues */
- $q = 0;
- foreach ($qlist as $qname => $q) {
- $rrdcreate .= "DS:$qname:COUNTER:$queuesdropvalid:0:$qbandwidth ";
- }
+ /* QUEUES, set up the queues databases */
+ if ($altq_list_queues[$ifname]) {
+ $altq =& $altq_list_queues[$ifname];
+ /* NOTE: Is it worth as its own function?! */
+ switch ($altq->GetBwscale()) {
+ case "Gb":
+ $factor = 1024 * 1024 * 1024;
+ break;
+ case "Mb":
+ $factor = 1024 * 1024;
+ break;
+ case "Kb":
+ $factor = 1024;
+ break;
+ case "b":
+ default:
+ $factor = 1;
+ break;
+ }
+ $qbandwidth = $altq->GetBandwidth() * $factor;
+ if ($qbandwidth <=0) {
+ $qbandwidth = 100 * 1000 * 1000; /* 100Mbit */
+ }
+ $qlist =& $altq->get_queue_list($notused);
+ if (!file_exists("$rrddbpath$ifname$queues")) {
+ $rrdcreate = "$rrdtool create $rrddbpath$ifname$queues --step $rrdqueuesinterval ";
+ /* loop list of shaper queues */
+ $q = 0;
+ foreach ($qlist as $qname => $q) {
+ $rrdcreate .= "DS:$qname:COUNTER:$queuesvalid:0:$qbandwidth ";
+ }
- $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+
+ create_new_rrd($rrdcreate);
+ }
- create_new_rrd($rrdcreate);
+ if (!file_exists("$rrddbpath$ifname$queuesdrop")) {
+ $rrdcreate = "$rrdtool create $rrddbpath$ifname$queuesdrop --step $rrdqueuesdropinterval ";
+ /* loop list of shaper queues */
+ $q = 0;
+ foreach ($qlist as $qname => $q) {
+ $rrdcreate .= "DS:$qname:COUNTER:$queuesdropvalid:0:$qbandwidth ";
}
- if($g['booting']) {
- $rrdqcommand = "-t ";
- $rrducommand = "N";
- $q = 0;
- foreach ($qlist as $qname => $q) {
- if($q == 0) {
- $rrdqcommand .= "{$qname}";
- } else {
- $rrdqcommand .= ":{$qname}";
- }
- $q++;
- $rrducommand .= ":U";
+ $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+
+ create_new_rrd($rrdcreate);
+ }
+
+ if($g['booting']) {
+ $rrdqcommand = "-t ";
+ $rrducommand = "N";
+ $q = 0;
+ foreach ($qlist as $qname => $q) {
+ if($q == 0) {
+ $rrdqcommand .= "{$qname}";
+ } else {
+ $rrdqcommand .= ":{$qname}";
}
- mwexec("$rrdtool update $rrddbpath$ifname$queues $rrdqcommand $rrducommand");
- mwexec("$rrdtool update $rrddbpath$ifname$queuesdrop $rrdqcommand $rrducommand");
+ $q++;
+ $rrducommand .= ":U";
}
-
- /* awk function to gather shaper data */
- /* yes, it's special */
- $rrdupdatesh .= "` pfctl -vsq -i {$realif} | awk 'BEGIN {printf \"$rrdtool update $rrddbpath$ifname$queues \" } ";
- $rrdupdatesh .= "{ ";
- $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/ )) { ";
- $rrdupdatesh .= "dsname = dsname \":\" \$2 ; ";
- $rrdupdatesh .= "q=1; ";
- $rrdupdatesh .= "} ";
- $rrdupdatesh .= "else if ((\$4 == \"bytes:\") && ( q == 1 ) ) { ";
- $rrdupdatesh .= "dsdata = dsdata \":\" \$5 ; ";
- $rrdupdatesh .= "q=0; ";
- $rrdupdatesh .= "} ";
- $rrdupdatesh .= "} END { ";
- $rrdupdatesh .= "dsname = substr(dsname,2); ";
- $rrdupdatesh .= "dsdata = substr(dsdata,2); ";
- $rrdupdatesh .= "printf \"-t \" dsname \" N:\" dsdata }' ";
- $rrdupdatesh .= "dsname=\"\" dsdata=\"\"`\n\n";
-
- $rrdupdatesh .= "` pfctl -vsq -i {$realif} | awk 'BEGIN {printf \"$rrdtool update $rrddbpath$ifname$queuesdrop \" } ";
- $rrdupdatesh .= "{ ";
- $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/ )) { ";
- $rrdupdatesh .= "dsname = dsname \":\" \$2 ; ";
- $rrdupdatesh .= "q=1; ";
- $rrdupdatesh .= "} ";
- $rrdupdatesh .= "else if ((\$4 == \"bytes:\") && ( q == 1 ) ) { ";
- $rrdupdatesh .= "dsdata = dsdata \":\" \$8 ; ";
- $rrdupdatesh .= "q=0; ";
- $rrdupdatesh .= "} ";
- $rrdupdatesh .= "} END { ";
- $rrdupdatesh .= "dsname = substr(dsname,2); ";
- $rrdupdatesh .= "dsdata = substr(dsdata,2); ";
- $rrdupdatesh .= "printf \"-t \" dsname \" N:\" dsdata }' ";
- $rrdupdatesh .= "dsname=\"\" dsdata=\"\"`\n\n";
+ mwexec("$rrdtool update $rrddbpath$ifname$queues $rrdqcommand $rrducommand");
+ mwexec("$rrdtool update $rrddbpath$ifname$queuesdrop $rrdqcommand $rrducommand");
}
+
+ /* awk function to gather shaper data */
+ /* yes, it's special */
+ $rrdupdatesh .= "` pfctl -vsq -i {$realif} | awk 'BEGIN {printf \"$rrdtool update $rrddbpath$ifname$queues \" } ";
+ $rrdupdatesh .= "{ ";
+ $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/ )) { ";
+ $rrdupdatesh .= " dsname = dsname \":\" \$2 ; ";
+ $rrdupdatesh .= " q=1; ";
+ $rrdupdatesh .= "} ";
+ $rrdupdatesh .= " else if ((\$4 == \"bytes:\") && ( q == 1 ) ) { ";
+ $rrdupdatesh .= " dsdata = dsdata \":\" \$5 ; ";
+ $rrdupdatesh .= " q=0; ";
+ $rrdupdatesh .= "} ";
+ $rrdupdatesh .= "} END { ";
+ $rrdupdatesh .= " dsname = substr(dsname,2); ";
+ $rrdupdatesh .= " dsdata = substr(dsdata,2); ";
+ $rrdupdatesh .= " printf \"-t \" dsname \" N:\" dsdata }' ";
+ $rrdupdatesh .= " dsname=\"\" dsdata=\"\"`\n\n";
+
+ $rrdupdatesh .= "` pfctl -vsq -i {$realif} | awk 'BEGIN {printf \"$rrdtool update $rrddbpath$ifname$queuesdrop \" } ";
+ $rrdupdatesh .= "{ ";
+ $rrdupdatesh .= "if ((\$1 == \"queue\") && ( \$2 ~ /^q/ )) { ";
+ $rrdupdatesh .= " dsname = dsname \":\" \$2 ; ";
+ $rrdupdatesh .= " q=1; ";
+ $rrdupdatesh .= "} ";
+ $rrdupdatesh .= " else if ((\$4 == \"bytes:\") && ( q == 1 ) ) { ";
+ $rrdupdatesh .= " dsdata = dsdata \":\" \$8 ; ";
+ $rrdupdatesh .= " q=0; ";
+ $rrdupdatesh .= "} ";
+ $rrdupdatesh .= "} END { ";
+ $rrdupdatesh .= " dsname = substr(dsname,2); ";
+ $rrdupdatesh .= " dsdata = substr(dsdata,2); ";
+ $rrdupdatesh .= " printf \"-t \" dsname \" N:\" dsdata }' ";
+ $rrdupdatesh .= " dsname=\"\" dsdata=\"\"`\n\n";
+ }
}
$i++;
/* System only statistics */
$ifname = "system";
- /* STATES, create pf states database */
- if(! file_exists("$rrddbpath$ifname$states")) {
- $rrdcreate = "$rrdtool create $rrddbpath$ifname$states --step $rrdstatesinterval ";
- $rrdcreate .= "DS:pfrate:GAUGE:$statesvalid:0:10000000 ";
- $rrdcreate .= "DS:pfstates:GAUGE:$statesvalid:0:10000000 ";
- $rrdcreate .= "DS:pfnat:GAUGE:$statesvalid:0:10000000 ";
- $rrdcreate .= "DS:srcip:GAUGE:$statesvalid:0:10000000 ";
- $rrdcreate .= "DS:dstip:GAUGE:$statesvalid:0:10000000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+ /* STATES, create pf states database */
+ if(! file_exists("$rrddbpath$ifname$states")) {
+ $rrdcreate = "$rrdtool create $rrddbpath$ifname$states --step $rrdstatesinterval ";
+ $rrdcreate .= "DS:pfrate:GAUGE:$statesvalid:0:10000000 ";
+ $rrdcreate .= "DS:pfstates:GAUGE:$statesvalid:0:10000000 ";
+ $rrdcreate .= "DS:pfnat:GAUGE:$statesvalid:0:10000000 ";
+ $rrdcreate .= "DS:srcip:GAUGE:$statesvalid:0:10000000 ";
+ $rrdcreate .= "DS:dstip:GAUGE:$statesvalid:0:10000000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+
+ create_new_rrd($rrdcreate);
+ }
- create_new_rrd($rrdcreate);
- }
+ /* enter UNKNOWN values in the RRD so it knows we rebooted. */
+ if($g['booting']) {
+ mwexec("$rrdtool update $rrddbpath$ifname$states N:U:U:U:U:U");
+ }
- /* enter UNKNOWN values in the RRD so it knows we rebooted. */
- if($g['booting']) {
- mwexec("$rrdtool update $rrddbpath$ifname$states N:U:U:U:U:U");
- }
+ /* the pf states gathering function. */
+ $rrdupdatesh .= "\n";
+ $rrdupdatesh .= "pfctl_si_out=\"` $pfctl -si > /tmp/pfctl_si_out `\"\n";
+ $rrdupdatesh .= "pfctl_ss_out=\"` $pfctl -ss > /tmp/pfctl_ss_out`\"\n";
+ $rrdupdatesh .= "pfrate=\"` cat /tmp/pfctl_si_out | egrep \"inserts|removals\" | awk '{ pfrate = \$3 + pfrate } {print pfrate}'|tail -1 `\"\n";
+ $rrdupdatesh .= "pfstates=\"` cat /tmp/pfctl_ss_out | egrep -v \"<\\-.*?<\\-|\\->.*?\\->\" | wc -l|sed 's/ //g'`\"\n";
+ $rrdupdatesh .= "pfnat=\"` cat /tmp/pfctl_ss_out | egrep '<\\-.*?<\\-|\\->.*?\\->' | wc -l|sed 's/ //g' `\"\n";
+ $rrdupdatesh .= "srcip=\"` cat /tmp/pfctl_ss_out | egrep -v '<\\-.*?<\\-|\\->.*?\\->' | grep '\\->' | awk '{print \$3}' | awk -F: '{print \$1}' | sort -u|wc -l|sed 's/ //g' `\"\n";
+ $rrdupdatesh .= "dstip=\"` cat /tmp/pfctl_ss_out | egrep -v '<\\-.*?<\\-|\\->.*?\\->' | grep '<\\-' | awk '{print \$3}' | awk -F: '{print \$1}' | sort -u|wc -l|sed 's/ //g' `\"\n";
+ $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$states N:\$pfrate:\$pfstates:\$pfnat:\$srcip:\$dstip\n\n";
+
+ /* End pf states statistics */
+
+ /* CPU, create CPU statistics database */
+ if(! file_exists("$rrddbpath$ifname$proc")) {
+ $rrdcreate = "$rrdtool create $rrddbpath$ifname$proc --step $rrdprocinterval ";
+ $rrdcreate .= "DS:user:GAUGE:$procvalid:0:10000000 ";
+ $rrdcreate .= "DS:nice:GAUGE:$procvalid:0:10000000 ";
+ $rrdcreate .= "DS:system:GAUGE:$procvalid:0:10000000 ";
+ $rrdcreate .= "DS:interrupt:GAUGE:$procvalid:0:10000000 ";
+ $rrdcreate .= "DS:processes:GAUGE:$procvalid:0:10000000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+
+ create_new_rrd($rrdcreate);
+ }
- /* the pf states gathering function. */
- $rrdupdatesh .= "\n";
- $rrdupdatesh .= "pfctl_si_out=\"` $pfctl -si > /tmp/pfctl_si_out `\"\n";
- $rrdupdatesh .= "pfctl_ss_out=\"` $pfctl -ss > /tmp/pfctl_ss_out`\"\n";
- $rrdupdatesh .= "pfrate=\"` cat /tmp/pfctl_si_out | egrep \"inserts|removals\" | awk '{ pfrate = \$3 + pfrate } {print pfrate}'|tail -1 `\"\n";
- $rrdupdatesh .= "pfstates=\"` cat /tmp/pfctl_ss_out | egrep -v \"<\\-.*?<\\-|\\->.*?\\->\" | wc -l|sed 's/ //g'`\"\n";
- $rrdupdatesh .= "pfnat=\"` cat /tmp/pfctl_ss_out | egrep '<\\-.*?<\\-|\\->.*?\\->' | wc -l|sed 's/ //g' `\"\n";
- $rrdupdatesh .= "srcip=\"` cat /tmp/pfctl_ss_out | egrep -v '<\\-.*?<\\-|\\->.*?\\->' | grep '\\->' | awk '{print \$3}' | awk -F: '{print \$1}' | sort -u|wc -l|sed 's/ //g' `\"\n";
- $rrdupdatesh .= "dstip=\"` cat /tmp/pfctl_ss_out | egrep -v '<\\-.*?<\\-|\\->.*?\\->' | grep '<\\-' | awk '{print \$3}' | awk -F: '{print \$1}' | sort -u|wc -l|sed 's/ //g' `\"\n";
- $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$states N:\$pfrate:\$pfstates:\$pfnat:\$srcip:\$dstip\n\n";
-
- /* End pf states statistics */
-
- /* CPU, create CPU statistics database */
- if(! file_exists("$rrddbpath$ifname$proc")) {
- $rrdcreate = "$rrdtool create $rrddbpath$ifname$proc --step $rrdprocinterval ";
- $rrdcreate .= "DS:user:GAUGE:$procvalid:0:10000000 ";
- $rrdcreate .= "DS:nice:GAUGE:$procvalid:0:10000000 ";
- $rrdcreate .= "DS:system:GAUGE:$procvalid:0:10000000 ";
- $rrdcreate .= "DS:interrupt:GAUGE:$procvalid:0:10000000 ";
- $rrdcreate .= "DS:processes:GAUGE:$procvalid:0:10000000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+ /* enter UNKNOWN values in the RRD so it knows we rebooted. */
+ if($g['booting']) {
+ mwexec("$rrdtool update $rrddbpath$ifname$proc N:U:U:U:U:U");
+ }
- create_new_rrd($rrdcreate);
- }
+ /* the CPU stats gathering function. */
+ $rrdupdatesh .= "`$top -d 2 -s 1 0 | $awk '{gsub(/%/, \"\")} BEGIN { \\\n";
+ $rrdupdatesh .= "printf \"$rrdtool update $rrddbpath$ifname$proc \" } \\\n";
+ $rrdupdatesh .= "{ if ( \$2 == \"processes:\" ) { processes = \$1; } \\\n";
+ $rrdupdatesh .= "else if ( \$1 == \"CPU:\" ) { user = \$2; nice = \$4; sys = \$6; interrupt = \$8; } \\\n";
+ $rrdupdatesh .= "} END { printf \"N:\"user\":\"nice\":\"sys\":\"interrupt\":\"processes }'`\n\n";
+
+ /* End CPU statistics */
+
+ /* Memory, create Memory statistics database */
+ if(! file_exists("$rrddbpath$ifname$mem")) {
+ $rrdcreate = "$rrdtool create $rrddbpath$ifname$mem --step $rrdmeminterval ";
+ $rrdcreate .= "DS:active:GAUGE:$memvalid:0:10000000 ";
+ $rrdcreate .= "DS:inactive:GAUGE:$memvalid:0:10000000 ";
+ $rrdcreate .= "DS:free:GAUGE:$memvalid:0:10000000 ";
+ $rrdcreate .= "DS:cache:GAUGE:$memvalid:0:10000000 ";
+ $rrdcreate .= "DS:wire:GAUGE:$memvalid:0:10000000 ";
+ $rrdcreate .= "RRA:MIN:0.5:1:1000 ";
+ $rrdcreate .= "RRA:MIN:0.5:5:1000 ";
+ $rrdcreate .= "RRA:MIN:0.5:60:1000 ";
+ $rrdcreate .= "RRA:MIN:0.5:720:3000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+ $rrdcreate .= "RRA:MAX:0.5:1:1000 ";
+ $rrdcreate .= "RRA:MAX:0.5:5:1000 ";
+ $rrdcreate .= "RRA:MAX:0.5:60:1000 ";
+ $rrdcreate .= "RRA:MAX:0.5:720:3000";
+
+ create_new_rrd($rrdcreate);
+ }
- /* enter UNKNOWN values in the RRD so it knows we rebooted. */
- if($g['booting']) {
- mwexec("$rrdtool update $rrddbpath$ifname$proc N:U:U:U:U:U");
- }
+ /* enter UNKNOWN values in the RRD so it knows we rebooted. */
+ if($g['booting']) {
+ mwexec("$rrdtool update $rrddbpath$ifname$mem N:U:U:U:U:U");
+ }
- /* the CPU stats gathering function. */
- $rrdupdatesh .= "`$top -d 2 -s 1 0 | $awk '{gsub(/%/, \"\")} BEGIN { \\\n";
- $rrdupdatesh .= "printf \"$rrdtool update $rrddbpath$ifname$proc \" } \\\n";
- $rrdupdatesh .= "{ if ( \$2 == \"processes:\" ) { processes = \$1; } \\\n";
- $rrdupdatesh .= "else if ( \$1 == \"CPU:\" ) { user = \$2; nice = \$4; sys = \$6; interrupt = \$8; } \\\n";
- $rrdupdatesh .= "} END { printf \"N:\"user\":\"nice\":\"sys\":\"interrupt\":\"processes }'`\n\n";
-
- /* End CPU statistics */
-
- /* Memory, create Memory statistics database */
- if(! file_exists("$rrddbpath$ifname$mem")) {
- $rrdcreate = "$rrdtool create $rrddbpath$ifname$mem --step $rrdmeminterval ";
- $rrdcreate .= "DS:active:GAUGE:$memvalid:0:10000000 ";
- $rrdcreate .= "DS:inactive:GAUGE:$memvalid:0:10000000 ";
- $rrdcreate .= "DS:free:GAUGE:$memvalid:0:10000000 ";
- $rrdcreate .= "DS:cache:GAUGE:$memvalid:0:10000000 ";
- $rrdcreate .= "DS:wire:GAUGE:$memvalid:0:10000000 ";
+ /* the Memory stats gathering function. */
+ $rrdupdatesh .= "`$sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_free_count vm.stats.vm.v_cache_count vm.stats.vm.v_wire_count | ";
+ $rrdupdatesh .= " $awk '{getline active;getline inactive;getline free;getline cache;getline wire;printf \"$rrdtool update $rrddbpath$ifname$mem N:\"";
+ $rrdupdatesh .= "((active/$0) * 100)\":\"((inactive/$0) * 100)\":\"((free/$0) * 100)\":\"((cache/$0) * 100)\":\"(wire/$0 * 100)}'`\n\n";
+
+ /* End Memory statistics */
+
+ /* SPAMD, set up the spamd rrd file */
+ if (isset($config['installedpackages']['spamdsettings']) &&
+ isset ($config['installedpackages']['spamdsettings']['config'][0]['enablerrd'])) {
+ /* set up the spamd rrd file */
+ if (!file_exists("$rrddbpath$ifname$spamd")) {
+ $rrdcreate = "$rrdtool create $rrddbpath$ifname$spamd --step $rrdspamdinterval ";
+ $rrdcreate .= "DS:conn:GAUGE:$spamdvalid:0:10000 ";
+ $rrdcreate .= "DS:time:GAUGE:$spamdvalid:0:86400 ";
$rrdcreate .= "RRA:MIN:0.5:1:1000 ";
$rrdcreate .= "RRA:MIN:0.5:5:1000 ";
$rrdcreate .= "RRA:MIN:0.5:60:1000 ";
@@ -531,56 +617,21 @@ function enable_rrd_graphing() {
$rrdcreate .= "RRA:MAX:0.5:1:1000 ";
$rrdcreate .= "RRA:MAX:0.5:5:1000 ";
$rrdcreate .= "RRA:MAX:0.5:60:1000 ";
- $rrdcreate .= "RRA:MAX:0.5:720:3000";
+ $rrdcreate .= "RRA:MAX:0.5:720:3000 ";
create_new_rrd($rrdcreate);
}
- /* enter UNKNOWN values in the RRD so it knows we rebooted. */
- if($g['booting']) {
- mwexec("$rrdtool update $rrddbpath$ifname$mem N:U:U:U:U:U");
- }
-
- /* the Memory stats gathering function. */
- $rrdupdatesh .= "`$sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_free_count vm.stats.vm.v_cache_count vm.stats.vm.v_wire_count | ";
- $rrdupdatesh .= " $awk '{getline active;getline inactive;getline free;getline cache;getline wire;printf \"$rrdtool update $rrddbpath$ifname$mem N:\"";
- $rrdupdatesh .= "((active/$0) * 100)\":\"((inactive/$0) * 100)\":\"((free/$0) * 100)\":\"((cache/$0) * 100)\":\"(wire/$0 * 100)}'`\n\n";
-
- /* End Memory statistics */
-
- /* SPAMD, set up the spamd rrd file */
- if (isset($config['installedpackages']['spamdsettings']) &&
- isset ($config['installedpackages']['spamdsettings']['config'][0]['enablerrd'])) {
- /* set up the spamd rrd file */
- if (!file_exists("$rrddbpath$ifname$spamd")) {
- $rrdcreate = "$rrdtool create $rrddbpath$ifname$spamd --step $rrdspamdinterval ";
- $rrdcreate .= "DS:conn:GAUGE:$spamdvalid:0:10000 ";
- $rrdcreate .= "DS:time:GAUGE:$spamdvalid:0:86400 ";
- $rrdcreate .= "RRA:MIN:0.5:1:1000 ";
- $rrdcreate .= "RRA:MIN:0.5:5:1000 ";
- $rrdcreate .= "RRA:MIN:0.5:60:1000 ";
- $rrdcreate .= "RRA:MIN:0.5:720:3000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
- $rrdcreate .= "RRA:MAX:0.5:1:1000 ";
- $rrdcreate .= "RRA:MAX:0.5:5:1000 ";
- $rrdcreate .= "RRA:MAX:0.5:60:1000 ";
- $rrdcreate .= "RRA:MAX:0.5:720:3000 ";
-
- create_new_rrd($rrdcreate);
- }
-
- $rrdupdatesh .= "\n";
- $rrdupdatesh .= "# polling spamd for connections and tarpitness \n";
- $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$spamd \\\n";
- $rrdupdatesh .= "`$php -q $spamd_gather`\n";
+ $rrdupdatesh .= "\n";
+ $rrdupdatesh .= "# polling spamd for connections and tarpitness \n";
+ $rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$spamd \\\n";
+ $rrdupdatesh .= "`$php -q $spamd_gather`\n";
- }
+ }
/* End System statistics */
/* 3G WIRELESS, set up the rrd file */
+ /* XXX: Are multiple 3G interfaces not possible? smos@ */
if(isset($config['ppps']['ppp'])) {
$ifname = "ppp";
if (!file_exists("$rrddbpath$ifname$cellular")) {
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 8d591ad..5efd274 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -884,7 +884,7 @@ EOD;
fclose($fd);
/* invoke nsupdate */
- $cmd = "/usr/sbin/nsupdate -k {$g['varetc_path']}/K{$i}{$keyname}+157+00000.key";
+ $cmd = "/usr/bin/nsupdate -k {$g['varetc_path']}/K{$i}{$keyname}+157+00000.key";
if (isset($dnsupdate['usetcp']))
$cmd .= " -v";
$cmd .= " {$g['varetc_path']}/nsupdatecmds{$i}";
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index 4961a85..a9b9815 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -333,11 +333,9 @@ class altq_root_queue {
function ReadConfig(&$conf) {
if (isset($conf['tbrconfig']))
$this->SetTbrConfig($conf['tbrconfig']);
- if ($conf['bandwidth'] <> "") {
- $this->SetBandwidth($conf['bandwidth']);
- if ($conf['bandwidthtype'] <> "")
- $this->SetBwscale($conf['bandwidthtype']);
- }
+ $this->SetBandwidth($conf['bandwidth']);
+ if ($conf['bandwidthtype'] <> "")
+ $this->SetBwscale($conf['bandwidthtype']);
if (isset($conf['scheduler'])) {
if ($this->GetScheduler() != $conf['scheduler']) {
foreach ($this->queues as $q) {
@@ -517,10 +515,11 @@ class altq_root_queue {
$rules = " altq on " . get_real_interface($this->GetInterface());
if ($this->GetScheduler())
$rules .= " ".strtolower($this->GetScheduler());
- if ($this->GetBandwidth())
+ if ($this->GetBandwidth()) {
$rules .= " bandwidth ".trim($this->GetBandwidth());
- if ($this->GetBwscale())
- $rules .= $this->GetBwscale();
+ if ($this->GetBwscale())
+ $rules .= $this->GetBwscale();
+ }
if ($this->GetTbrConfig())
$rules .= " tbrsize ".$this->GetTbrConfig();
if (count($this->queues)) {
@@ -593,19 +592,19 @@ class altq_root_queue {
* to the user like the traffic wizard does.
*/
function build_form() {
- $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>";
+ $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
$form .= "Enable/Disable";
- $form .= "</td><td class=\"vncellreq\">";
+ $form .= "<br/></td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on")
$form .= " CHECKED";
$form .= " ><span class=\"vexpl\"> Enable/disable discipline and its children</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<strong>".$this->GetQname()."</strong>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Scheduler Type ";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Scheduler Type ";
$form .= "</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<select id=\"scheduler\" name=\"scheduler\" class=\"formselect\">";
@@ -631,7 +630,7 @@ class altq_root_queue {
$form .= " Beware you can lose information.";
$form .= "</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Bandwidth";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Bandwidth";
$form .= "</td><td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"bandwidth\" name=\"bandwidth\" value=\"";
$form .= $this->GetBandwidth() . "\">";
@@ -654,15 +653,15 @@ class altq_root_queue {
$form .= ">Bit/s</option>";
$form .= "</select>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Queue Limit</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Queue Limit</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"qlimit\" name=\"qlimit\" value=\"";
$form .= $this->GetQlimit();
$form .= "\">";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">TBR Size</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">TBR Size</td>";
$form .= "<td class=\"vncellreq\">";
- $form .= "<input type=\"text\" id=\"tbrconfig\" name=\"tbrconfig\" value=\"";
+ $form .= "<br /><input type=\"text\" id=\"tbrconfig\" name=\"tbrconfig\" value=\"";
$form .= $this->GetTbrConfig();
$form .= "\">";
$form .= "<br> <span class=\"vexpl\">";
@@ -956,11 +955,9 @@ class priq_queue {
$this->SetQname($q['name']);
if (isset($q['interface']))
$this->SetInterface($q['interface']);
- if ($q['bandwidth'] <> "") {
- $this->SetBandwidth($q['bandwidth']);
- if ($q['bandwidthtype'] <> "")
- $this->SetBwscale($q['bandwidthtype']);
- }
+ $this->SetBandwidth($q['bandwidth']);
+ if ($q['bandwidthtype'] <> "")
+ $this->SetBwscale($q['bandwidthtype']);
if (!empty($q['qlimit']))
$this->SetQlimit($q['qlimit']);
else
@@ -1075,38 +1072,38 @@ class priq_queue {
* need to update it.
*/
function build_form() {
- $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>";
+ $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
$form .= "Enable/Disable";
- $form .= "</td><td class=\"vncellreq\">";
+ $form .= "<br/></td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
if ($this->GetEnabled() == "on")
$form .= " CHECKED";
$form .= " ><span class=\"vexpl\"> Enable/Disable queue and its children</span>";
$form .= "</td></tr>";
$form .= "<tr>";
- $form .= "<td width=\"22%\" valign=\"top\" class=\"vncellreq\">";
+ $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">";
$form .= "Queue Name</td><td width=\"78%\" class=\"vtable\">";
$form .= "<input name=\"name\" type=\"text\" id=\"name\" class=\"formfld unknown\" size=\"15\" maxlength=\"15\" value=\"";
$form .= htmlspecialchars($this->GetQname());
$form .= "\">";
- $form .= "<br> <span class=\"vexpl\">Enter the name of the queue here. Do not use spaces and limit the size to 15 characters.";
- $form .= "</span></td>";
+ $form .= "<br /> <span class=\"vexpl\">Enter the name of the queue here. Do not use spaces and limit the size to 15 characters.";
+ $form .= "</span><br /></td>";
$form .= "</tr><tr>";
- $form .= "<td width=\"22%\" valign=\"top\" class=\"vncellreq\">Priority</td>";
+ $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">Priority</td>";
$form .= "<td width=\"78%\" class=\"vtable\"> <input name=\"priority\" type=\"text\" id=\"priority\" size=\"5\" value=\"";
$form .= htmlspecialchars($this->GetQpriority());
$form .= "\">";
$form .= "<br> <span class=\"vexpl\">For hfsc, the range is 0 to 7. The default is 1. Hfsc queues with a higher priority are preferred in the case of overload.</span></td>";
$form .= "</tr>";
- $form .= "</tr>";
- $form .= "<td width=\"22%\" valign=\"top\" class=\"vncellreq\">Queue limit</td>";
- $form .= "<td width=\"78%\" class=\"vtable\"> <input name=\"qlimit\" type=\"text\" id=\"qlimit\" size=\"5\" value=\"";
+ $form .= "<tr>";
+ $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">Queue limit</td>";
+ $form .= "<td width=\"78%\" class=\"vtable\"> <input name=\"qlimit\" type=\"text\" id=\"qlimit\" size=\"8\" value=\"";
$form .= htmlspecialchars($this->GetQlimit());
$form .= "\">";
$form .= "<br> <span class=\"vexpl\">Queue limit in packets per second.";
$form .= "</span></td>";
$form .= "<tr>";
- $form .= "<td width=\"22%\" valign=\"top\" class=\"vncell\">Scheduler options</td>";
+ $form .= "<td width=\"22%\" valign=\"center\" class=\"vncell\">Scheduler options</td>";
$form .= "<td width=\"78%\" class=\"vtable\">";
$tmpvalue = $this->GetDefault();
if (!empty($tmpvalue)) {
@@ -1793,7 +1790,7 @@ class hfsc_queue extends priq_queue {
function build_form() {
$form = parent::build_form();
$form .= "<tr>";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Bandwidth</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Bandwidth</td>";
$form .= "<td class=\"vtable\"> <input name=\"bandwidth\" id=\"bandwidth\" class=\"formfld unknown\" value=\"";
$form .= htmlspecialchars($this->GetBandwidth());
$form .= "\">";
@@ -1822,7 +1819,7 @@ class hfsc_queue extends priq_queue {
$form .= "<span class=\"vexpl\">Choose the amount of bandwidth for this queue";
$form .= "</span></td></tr>";
$form .= "<tr>";
- $form .= "<td width=\"22%\" valign=\"top\" class=\"vncellreq\">Service Curve (sc)</td>";
+ $form .= "<td width=\"22%\" valign=\"center\" class=\"vncellreq\">Service Curve (sc)</td>";
$form .= "<td width=\"78%\" class=\"vtable\">";
$form .= "<table>";
$form .= "<tr><td>&nbsp;</td><td><center>m1</center></td><td><center>d</center></td><td><center><b>m2</b></center></td></tr>";
@@ -2265,8 +2262,9 @@ class cbq_queue extends priq_queue {
}
function build_form() {
- $form = "<tr>";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Bandwidth</td>";
+ $form = parent::build_form();
+ $form .= "<tr>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Bandwidth</td>";
$form .= "<td class=\"vtable\"> <input name=\"bandwidth\" id=\"bandwidth\" class=\"formfld unknown\" value=\"";
if ($this->GetBandwidth() > 0)
$form .= htmlspecialchars($this->GetBandwidth());
@@ -2295,7 +2293,6 @@ class cbq_queue extends priq_queue {
$form .= "</select> <br>";
$form .= "<span class=\"vexpl\">Choose the amount of bandwidth for this queue";
$form .= "</span></td></tr>";
- $form .= parent::build_form();
$form .= "<tr><td class=\"vncellreq\">Scheduler specific options</td>";
$form .= "<td class=\"vtable\"><input type=\"checkbox\" id=\"borrow\" name=\"borrow\"";
if($this->GetBorrow() == "on")
@@ -2528,8 +2525,9 @@ class fairq_queue extends priq_queue {
}
function build_form() {
- $form = "<tr>";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Bandwidth</td>";
+ $form = parent::build_form();
+ $form .= "<tr>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Bandwidth</td>";
$form .= "<td class=\"vtable\"> <input name=\"bandwidth\" id=\"bandwidth\" class=\"formfld unknown\" value=\"";
if ($this->GetBandwidth() > 0)
$form .= htmlspecialchars($this->GetBandwidth());
@@ -2558,7 +2556,6 @@ class fairq_queue extends priq_queue {
$form .= "</select> <br>";
$form .= "<span class=\"vexpl\">Choose the amount of bandwidth for this queue";
$form .= "</span></td></tr>";
- $form .= parent::build_form();
$form .= "<tr><td class=\"vncellreq\">Scheduler specific options</td>";
$form .= "<td class=\"vtable\"><table><tr><td>";
$form .= "<input id=\"buckets\" name=\"buckets\" value=\"";
@@ -2923,7 +2920,7 @@ class dnpipe_class extends dummynet_class {
}
function build_form() {
- $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>";
+ $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
$form .= "Enable/Disable";
$form .= "</td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
@@ -2931,12 +2928,12 @@ class dnpipe_class extends dummynet_class {
$form .= " CHECKED";
$form .= " ><span class=\"vexpl\"> Enable/Disable limiter and its children</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"name\" name=\"name\" value=\"";
$form .= $this->GetQname()."\">";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Bandwidth";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Bandwidth";
$form .= "</td><td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"bandwidth\" name=\"bandwidth\" value=\"";
$form .= $this->GetBandwidth() . "\">";
@@ -2959,7 +2956,7 @@ class dnpipe_class extends dummynet_class {
$form .= ">Bit/s</option>";
$form .= "</select>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Mask</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Mask</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<select name=\"mask\" class=\"formselect\">";
$form .= "<option value=\"none\"";
@@ -2982,7 +2979,7 @@ class dnpipe_class extends dummynet_class {
$form .= "respectively. This makes it possible to easily specify bandwidth \n";
$form .= "limits per host.</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Description</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Description</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" class=\"formfld unknown\" size=\"50%\" id=\"description\" name=\"description\" value=\"";
$form .= $this->GetDescription();
@@ -2999,16 +2996,16 @@ class dnpipe_class extends dummynet_class {
$form .= "</div></td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable\" name=\"sprtable\">";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Delay</td>";
- $form .= "<td valign=\"top\" class=\"vncellreq\">";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Delay</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">";
$form .= "<input name=\"delay\" type=\"text\" id=\"delay\" size=\"5\" value=\"";
$form .= $this->GetDelay() . "\">";
$form .= "&nbsp;ms<br> <span class=\"vexpl\">Hint: in most cases, you ";
$form .= "should specify 0 here (or leave the field empty)</span>";
$form .= "</td></tr><br/>";
$form .= "<tr style=\"display:none\" id=\"sprtable1\" name=\"sprtable1\">";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Packet loss rate</td>";
- $form .= "<td valign=\"top\" class=\"vncellreq\">";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Packet loss rate</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">";
$form .= "<input name=\"plr\" type=\"text\" id=\"plr\" size=\"5\" value=\"";
$form .= $this->GetPlr() . "\">";
$form .= "&nbsp;<br> <span class=\"vexpl\">Hint: in most cases, you ";
@@ -3016,7 +3013,7 @@ class dnpipe_class extends dummynet_class {
$form .= "A value of 0.001 means one packet in 1000 gets dropped</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable2\" name=\"sprtable2\">";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Queue Size</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Queue Size</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"qlimit\" name=\"qlimit\" value=\"";
$form .= $this->GetQlimit() . "\">";
@@ -3027,7 +3024,7 @@ class dnpipe_class extends dummynet_class {
$form .= "are delivered to their destination.</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable5\" name=\"sprtable5\">";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Bucket Size</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Bucket Size</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"buckets\" name=\"buckets\" value=\"";
$form .= $this->GetBuckets() . "\">";
@@ -3166,7 +3163,7 @@ class dnqueue_class extends dummynet_class {
}
function build_form() {
- $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>";
+ $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
$form .= "Enable/Disable";
$form .= "</td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\"";
@@ -3174,12 +3171,12 @@ class dnqueue_class extends dummynet_class {
$form .= " CHECKED";
$form .= " ><span class=\"vexpl\"> Enable/Disable queue and its children</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"name\" name=\"name\" value=\"";
$form .= $this->GetQname()."\">";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Mask</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Mask</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<select name=\"mask\" class=\"formselect\">";
$form .= "<option value=\"none\"";
@@ -3202,7 +3199,7 @@ class dnqueue_class extends dummynet_class {
$form .= "respectively. This makes it possible to easily specify bandwidth \n";
$form .= "limits per host.</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Description</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Description</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"description\" class=\"formfld unknown\" size=\"50%\" name=\"description\" value=\"";
$form .= $this->GetDescription();
@@ -3218,16 +3215,16 @@ class dnqueue_class extends dummynet_class {
$form .= " value=\"Show advanced options\"></input></a>";
$form .= "</div></td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable\" name=\"sprtable\">";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Weight</td>";
- $form .= "<td valign=\"top\" class=\"vncellreq\">";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Weight</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">";
$form .= "<input name=\"weight\" type=\"text\" id=\"weight\" size=\"5\" value=\"";
$form .= $this->GetWeight() . "\">";
$form .= "&nbsp;ms<br> <span class=\"vexpl\">Hint: For queues under the same parent ";
$form .= "this specifies the share that a queue gets(values range from 1 to 100, you can leave it blank otherwise)</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable1\" name=\"sprtable1\">";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Packet loss rate</td>";
- $form .= "<td valign=\"top\" class=\"vncellreq\">";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Packet loss rate</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">";
$form .= "<input name=\"plr\" type=\"text\" id=\"plr\" size=\"5\" value=\"";
$form .= $this->GetPlr() . "\">";
$form .= "&nbsp;<br> <span class=\"vexpl\">Hint: in most cases, you ";
@@ -3235,7 +3232,7 @@ class dnqueue_class extends dummynet_class {
$form .= "A value of 0.001 means one packet in 1000 gets dropped</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable2\" name=\"sprtable2\">";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Queue Size</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Queue Size</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"qlimit\" name=\"qlimit\" value=\"";
$form .= $this->GetQlimit() . "\">";
@@ -3246,7 +3243,7 @@ class dnqueue_class extends dummynet_class {
$form .= "are delivered to their destination.</span>";
$form .= "</td></tr>";
$form .= "<tr style=\"display:none\" id=\"sprtable5\" name=\"sprtable5\">";
- $form .= "<td valign=\"top\" class=\"vncellreq\">Bucket Size</td>";
+ $form .= "<td valign=\"center\" class=\"vncellreq\">Bucket Size</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"buckets\" name=\"buckets\" value=\"";
$form .= $this->GetBuckets() . "\">";
@@ -3384,7 +3381,7 @@ class layer7 {
}
function build_form() {
- $form = "<tr><td valign=\"top\" class=\"vncellreq\"><br>";
+ $form = "<tr><td valign=\"center\" class=\"vncellreq\"><br>";
$form .= "Enable/Disable";
$form .= "</td><td class=\"vncellreq\">";
$form .= " <input type=\"checkbox\" id=\"enabled\" name=\"enabled\" value=\"on\" ";
@@ -3393,12 +3390,12 @@ class layer7 {
}
$form .= " ><span class=\"vexpl\"> Enable/Disable layer7 Container</span>";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\"><br><span class=\"vexpl\">Name</span></td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" id=\"container\" name=\"container\" value=\"";
$form .= $this->GetRName()."\">";
$form .= "</td></tr>";
- $form .= "<tr><td valign=\"top\" class=\"vncellreq\">Description</td>";
+ $form .= "<tr><td valign=\"center\" class=\"vncellreq\">Description</td>";
$form .= "<td class=\"vncellreq\">";
$form .= "<input type=\"text\" class=\"formfld unknown\" size=\"50%\" id=\"description\" name=\"description\" value=\"";
$form .= $this->GetRDescription();
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 41f3123..e7fc684 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -276,10 +276,10 @@ function system_routing_configure($interface = "") {
$gatewayip = "";
$interfacegw = "";
+ $foundgw = false;
/* tack on all the hard defined gateways as well */
if (is_array($config['gateways']['gateway_item'])) {
mwexec("/bin/rm {$g['tmp_path']}/*_defaultgw", true);
- $foundgw = false;
foreach ($config['gateways']['gateway_item'] as $gateway) {
if (isset($gateway['defaultgw'])) {
if ($gateway['gateway'] == "dynamic")
@@ -295,13 +295,13 @@ function system_routing_configure($interface = "") {
break;
}
}
- if ($foundgw == false) {
- $defaultif = get_real_interface("wan");
- $interfacegw = "wan";
- $gatewayip = get_interface_gateway("wan");
- @touch("{$g['tmp_path']}/{$defaultif}_defaultgw");
- }
}
+ if ($foundgw == false) {
+ $defaultif = get_real_interface("wan");
+ $interfacegw = "wan";
+ $gatewayip = get_interface_gateway("wan");
+ @touch("{$g['tmp_path']}/{$defaultif}_defaultgw");
+ }
$dont_add_route = false;
/* if OLSRD is enabled, allow WAN to house DHCP. */
if($config['installedpackages']['olsrd']) {
@@ -727,7 +727,7 @@ function system_generate_lighty_config($filename,
$cert_location = "cert.pem",
$ca_location = "ca.pem",
$max_procs = 1,
- $max_requests = "1",
+ $max_requests = "2",
$fast_cgi_enable = true,
$captive_portal = false) {
@@ -1451,4 +1451,4 @@ function system_get_dmesg_boot() {
return file_get_contents("{$g['varlog_path']}/dmesg.boot");
}
-?> \ No newline at end of file
+?>
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index fd4ad12..8f07a71 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -1696,8 +1696,8 @@ function upgrade_054_to_055() {
}
/* the roundtrip times need to be divided by 1000 to get seconds, really */
$databases = array();
- exec("cd $rrddbpath;/usr/bin/find *-quality.rrd", $databases);
- echo "done.\n";
+ chdir($rrddbpath);
+ $databases = glob("*-quality.rrd");
rsort($databases);
foreach($databases as $database) {
$xmldump = "{$database}.old.xml";
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index 8a2bb85..68e1064 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -103,21 +103,21 @@ function vpn_ipsec_configure($ipchg = false)
if (!isset($ipseccfg['enable'])) {
mwexec("/sbin/ifconfig enc0 down");
+ /* send a SIGKILL to be sure */
+ sigkillbypid("{$g['varrun_path']}/racoon.pid", "KILL");
+
/* kill racoon */
if(is_process_running("racoon"))
mwexec("/usr/bin/killall racoon", true);
killbypid("{$g['varrun_path']}/dnswatch-ipsec.pid");
-
+
/* wait for racoon process to die */
sleep(2);
- /* send a SIGKILL to be sure */
- sigkillbypid("{$g['varrun_path']}/racoon.pid", "KILL");
-
/* flush SPD and SAD */
- mwexec("/usr/local/sbin/setkey -FP");
mwexec("/usr/local/sbin/setkey -F");
-
+ mwexec("/usr/local/sbin/setkey -FP");
+
/* disallow IPSEC, it is off */
// exec("/sbin/sysctl net.inet.ip.ipsec_in_use=0");
@@ -162,7 +162,7 @@ function vpn_ipsec_configure($ipchg = false)
$rg = $ph1ent['remote-gateway'];
if (!is_ipaddr($rg)) {
- $dnswatch_list[] = $rg;
+ $dnswatch_list[] = "{$rg} = value";
add_hostname_to_watch($rg);
$rg = resolve_retry($rg);
if (!$rg)
diff --git a/etc/rc b/etc/rc
index c878145..6f3e28c 100755
--- a/etc/rc
+++ b/etc/rc
@@ -245,6 +245,7 @@ if [ "$DISABLESYSLOGCLOG" -gt "0" ]; then
touch /var/log/relayd.log
touch /var/log/lighttpd.log
touch /var/log/ntpd.log
+ touch /var/log/apinger.log
else
ENABLEFIFOLOG=`cat /cf/conf/config.xml | grep usefifolog | wc -l | awk '{ print $1 }'`
if [ "$ENABLEFIFOLOG" -gt "0" ]; then
@@ -263,6 +264,7 @@ else
/usr/sbin/fifolog_create -s 50688 /var/log/relayd.log
/usr/sbin/fifolog_create -s 50688 /var/log/lighttpd.log
/usr/sbin/fifolog_create -s 50688 /var/log/ntpd.log
+ /usr/sbin/fifolog_create -s 50688 /var/log/apinger.log
else
/usr/sbin/clog -i -s 512144 /var/log/system.log
/usr/sbin/clog -i -s 512144 /var/log/filter.log
@@ -278,7 +280,8 @@ else
/usr/sbin/clog -i -s 65535 /var/log/slbd.log
/usr/sbin/clog -i -s 65535 /var/log/lighttpd.log
/usr/sbin/clog -i -s 65535 /var/log/ntpd.log
- /usr/sbin/clog -i -s 65535 /var/log/relayd.log
+ /usr/sbin/clog -i -s 65535 /var/log/relayd.log
+ /usr/sbin/clog -i -s 65535 /var/log/apinger.log
fi
fi
# change permissions on newly created fifolog files.
diff --git a/etc/rc.linkup b/etc/rc.linkup
index 59c604e..682adb1 100755
--- a/etc/rc.linkup
+++ b/etc/rc.linkup
@@ -52,6 +52,12 @@ function handle_argument_group($iface, $argument2) {
interface_bring_down($iface);
break;
case "start":
+ log_error("DEVD Ethernet attached event for {$iface}");
+ $riface = get_real_interface($iface);
+ exec("/usr/sbin/arp -d -i {$riface} -a");
+ log_error("HOTPLUG: Configuring interface {$iface}");
+ interface_configure($iface);
+ break;
case "up":
log_error("DEVD Ethernet attached event for {$iface}");
$riface = get_real_interface($iface);
diff --git a/etc/rc.newipsecdns b/etc/rc.newipsecdns
index 18b3b5b..4bb247c 100755
--- a/etc/rc.newipsecdns
+++ b/etc/rc.newipsecdns
@@ -5,7 +5,7 @@
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2007 Manuel Kasper <mk@neon1.net>.
- Copyright (C) 2009 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2009 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php
index 793a9ae..44dee95 100755
--- a/usr/local/www/carp_status.php
+++ b/usr/local/www/carp_status.php
@@ -107,7 +107,7 @@ include("head.inc");
<p>
<table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td class="listhdrr"><b><center>Carp Interface</center></b></td>
+ <td class="listhdrr"><b><center>CARP Interface</center></b></td>
<td class="listhdrr"><b><center>Virtual IP</center></b></td>
<td class="listhdrr"><b><center>Status</center></b></td>
</tr>
diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php
index 8ce35b8..57df0e1 100755
--- a/usr/local/www/diag_logs_relayd.php
+++ b/usr/local/www/diag_logs_relayd.php
@@ -5,7 +5,7 @@
part of pfSense
Copyright (C) 2008 Bill Marquette <bill.marquette@gmail.com>.
- Copyright (C) 2008 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2008 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php
index 6618389..e456c61 100755
--- a/usr/local/www/firewall_shaper.php
+++ b/usr/local/www/firewall_shaper.php
@@ -341,9 +341,9 @@ $tree .= "</ul>";
if (!$dontshow || $newqueue) {
-$output_form .= "<tr><td width=\"22%\" valign=\"top\" class=\"vncellreq\">";
-$output_form .= "Queue Actions";
-$output_form .= "</td><td valign=\"top\" class=\"vncellreq\" width=\"78%\">";
+$output_form .= "<tr><td width=\"22%\" valign=\"center\" class=\"vncellreq\">";
+$output_form .= "<br />Queue Actions<br />";
+$output_form .= "</td><td valign=\"center\" class=\"vncellreq\" width=\"78%\"><br />";
$output_form .= "<input type=\"submit\" name=\"Submit\" value=\"" . gettext("Save") . "\" class=\"formbtn\" />";
if ($can_add || $addnewaltq) {
@@ -368,9 +368,9 @@ if ($can_add || $addnewaltq) {
$output_form .= " value=\"Disable shaper on interface\">";
$output_form .= "</a>";
}
-$output_form .= "</td></tr>";
+$output_form .= "<br /></td></tr>";
$output_form .= "</div>";
-}
+}
else
$output_form .= "</div>";
diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php
index 505169e..692ff3d 100755
--- a/usr/local/www/services_captiveportal_ip.php
+++ b/usr/local/www/services_captiveportal_ip.php
@@ -60,10 +60,16 @@ if ($_GET['act'] == "del") {
$ipent = $a_allowedips[$_GET['id']];
if (isset($config['captiveportal']['enable'])) {
+ if (!empty($ipent['sn']))
+ $ipent['ip'] .= "/{$ipent['sn']}";
mwexec("/sbin/ipfw table 3 delete " . $ipent['ip']);
mwexec("/sbin/ipfw table 4 delete " . $ipent['ip']);
mwexec("/sbin/ipfw table 5 delete " . $ipent['ip']);
mwexec("/sbin/ipfw table 6 delete " . $ipent['ip']);
+ mwexec("/sbin/ipfw table 7 delete " . $ipent['ip']);
+ mwexec("/sbin/ipfw table 8 delete " . $ipent['ip']);
+ mwexec("/sbin/ipfw table 9 delete " . $ipent['ip']);
+ mwexec("/sbin/ipfw table 10 delete " . $ipent['ip']);
}
unset($a_allowedips[$_GET['id']]);
diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php
index f630afa..fecaccb 100755
--- a/usr/local/www/services_captiveportal_ip_edit.php
+++ b/usr/local/www/services_captiveportal_ip_edit.php
@@ -71,6 +71,7 @@ if (isset($_POST['id']))
if (isset($id) && $a_allowedips[$id]) {
$pconfig['ip'] = $a_allowedips[$id]['ip'];
+ $pconfig['sn'] = $a_allowedips[$id]['sn'];
$pconfig['dir'] = $a_allowedips[$id]['dir'];
$pconfig['bw_up'] = $a_allowedips[$id]['bw_up'];
$pconfig['bw_down'] = $a_allowedips[$id]['bw_down'];
@@ -109,6 +110,7 @@ if ($_POST) {
if (!$input_errors) {
$ip = array();
$ip['ip'] = $_POST['ip'];
+ $ip['sn'] = $_POST['sn'];
$ip['dir'] = $_POST['dir'];
$ip['descr'] = $_POST['descr'];
if ($_POST['bw_up'])
@@ -117,9 +119,13 @@ if ($_POST) {
$ip['bw_down'] = $_POST['bw_down'];
if (isset($id) && $a_allowedips[$id]) {
$oldip = $a_allowedips[$id]['ip'];
+ if (!empty($a_allowedips[$id]['sn']))
+ $oldip .= "/{$a_allowedips[$id]['sn']}";
$a_allowedips[$id] = $ip;
} else {
$oldip = $ip['ip'];
+ if (!empty($$ip['sn']))
+ $oldip .= "/{$$ip['sn']}";
$a_allowedips[] = $ip;
}
allowedips_sort();
@@ -169,6 +175,11 @@ include("head.inc");
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP address"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="ip" type="text" class="formfld unknown" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>">
+ <select name='sn' class="formselect" id='sn'>
+ <?php for ($i = 32; $i >= 1; $i--): ?>
+ <option value="<?=$i;?>" <?php if ($i == $pconfig['sn']) echo "selected"; ?>><?=$i;?></option>
+ <?php endfor; ?>
+ </select>
<br>
<span class="vexpl"><?=gettext("IP address"); ?></span></td>
</tr>
diff --git a/usr/local/www/services_rfc2136.php b/usr/local/www/services_rfc2136.php
index f0eaabb..563ee26 100644
--- a/usr/local/www/services_rfc2136.php
+++ b/usr/local/www/services_rfc2136.php
@@ -48,7 +48,7 @@ if ($_GET['act'] == "del") {
write_config();
- header("Location: services_dyndns.php");
+ header("Location: services_rfc2136.php");
exit;
}
@@ -105,9 +105,9 @@ include("head.inc");
</tr>
<tr>
<td colspan="3" class="list"><p class="vexpl"><span class="red"><strong>
- <?=gettext("Note");?>:<br>
+ <br>
</strong></span>
- <?=gettext("Add something meaningful here.");?>
+
</td>
<td class="list">&nbsp;</td>
</tr>
diff --git a/usr/local/www/services_rfc2136_edit.php b/usr/local/www/services_rfc2136_edit.php
index 57dfdc6..f195786 100644
--- a/usr/local/www/services_rfc2136_edit.php
+++ b/usr/local/www/services_rfc2136_edit.php
@@ -81,7 +81,7 @@ if ($_POST) {
if (!$input_errors) {
$rfc2136 = array();
- $rfc2136['enable'] = $_POST['enable'] ? false : true;
+ $rfc2136['enable'] = $_POST['enable'] ? true : false;
$rfc2136['host'] = $_POST['host'];
$rfc2136['ttl'] = $_POST['ttl'];
$rfc2136['keyname'] = $_POST['keyname'];
diff --git a/usr/local/www/services_snmp.php b/usr/local/www/services_snmp.php
index 119be42..50f70d3 100755
--- a/usr/local/www/services_snmp.php
+++ b/usr/local/www/services_snmp.php
@@ -290,7 +290,7 @@ function enable_change(whichone) {
<td width="22%" valign="top" class="vncellreq"><?=gettext("Read Community String");?></td>
<td width="78%" class="vtable">
<input name="rocommunity" type="text" class="formfld unknown" id="rocommunity" size="40" value="<?=htmlspecialchars($pconfig['rocommunity']);?>">
- <br><?=gettext("In most cases"); ?>, &quot;<?=gettext("public"); ?>&quot; <?=gettext("is used here");?></br>
+ <br>The community string is like a password, restricting access to querying SNMP to hosts knowing the community string. Use a strong value here to protect from unauthorized information disclosure.</br>
</td>
</tr>
diff --git a/usr/local/www/status_gateway_groups.php b/usr/local/www/status_gateway_groups.php
index c282d36..f70f539 100755
--- a/usr/local/www/status_gateway_groups.php
+++ b/usr/local/www/status_gateway_groups.php
@@ -4,7 +4,7 @@
status_gateway_groups.php
part of pfSense (http://pfsense.com)
- Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php
index e2e5484..eac1b2f 100755
--- a/usr/local/www/status_gateways.php
+++ b/usr/local/www/status_gateways.php
@@ -4,7 +4,7 @@
status_gateways.php
part of pfSense (http://www.pfsense.com/)
- Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/status_lb_pool.php b/usr/local/www/status_lb_pool.php
index 19a7eb2..54f3398 100755
--- a/usr/local/www/status_lb_pool.php
+++ b/usr/local/www/status_lb_pool.php
@@ -4,7 +4,7 @@
status_lb_pool.php
part of pfSense (http://www.pfsense.com/)
- Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/status_lb_vs.php b/usr/local/www/status_lb_vs.php
index 83e7d44..91e89dd 100755
--- a/usr/local/www/status_lb_vs.php
+++ b/usr/local/www/status_lb_vs.php
@@ -4,7 +4,7 @@
status_lb_vs.php
part of pfSense (http://www.pfsense.com/)
- Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index a52cc86..2be04dc 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -3,7 +3,7 @@
/*
status_rrd_graph.php
Part of pfSense
- Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>
+ Copyright (C) 2007 Seth Mos <seth.mos@dds.nl>
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,9 @@ if(! isset($config['rrd']['enable'])) {
}
$rrddbpath = "/var/db/rrd/";
-$databases = glob("{$rrddbpath}*.rrd");
+chdir($rrddbpath);
+$databases = glob("*.rrd");
+
if ($_GET['cat']) {
$curcat = $_GET['cat'];
@@ -107,12 +109,22 @@ if ($_GET['option']) {
continue 2;
}
}
+ case "vpnusers":
+ foreach($databases as $database) {
+ if(preg_match("/[-]vpnusers\.rrd/i", $database)) {
+ /* pick off the 1st database we find that matches the VPN graphs */
+ $name = explode("-", $database);
+ $curoption = "$name[0]";
+ continue 2;
+ }
+ }
default:
$curoption = "wan";
break;
}
}
+$now = time();
if($curcat == "custom") {
if (is_numeric($_GET['start'])) {
if($start < ($now - (3600 * 24 * 365 * 5))) {
@@ -155,6 +167,7 @@ $dbheader = array("allgraphs-traffic.rrd",
"allgraphs-quality.rrd",
"allgraphs-wireless.rrd",
"allgraphs-cellular.rrd",
+ "allgraphs-vpnusers.rrd",
"allgraphs-packets.rrd",
"system-allgraphs.rrd",
"system-throughput.rrd",
@@ -163,15 +176,18 @@ $dbheader = array("allgraphs-traffic.rrd",
"outbound-traffic.rrd");
foreach($databases as $database) {
- if(stristr($database, "wireless")) {
+ if(stristr($database, "-wireless")) {
$wireless = true;
}
- if(stristr($database, "queues")) {
+ if(stristr($database, "-queues")) {
$queues = true;
}
- if(stristr($database, "cellular")) {
+ if(stristr($database, "-cellular")) {
$cellular = true;
}
+ if(stristr($database, "-vpnusers")) {
+ $vpnusers = true;
+ }
}
/* append the existing array to the header */
$ui_databases = array_merge($dbheader, $databases);
@@ -190,7 +206,7 @@ function get_dates($curperiod, $graph) {
$curyear = date('Y', $now);
$curmonth = date('m', $now);
$curweek = date('W', $now);
- $curweekday = date('w', $now);
+ $curweekday = date('N', $now) - 1; // We want to start on monday
$curday = date('d', $now);
switch($curperiod) {
@@ -206,8 +222,16 @@ function get_dates($curperiod, $graph) {
$end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear);
break;
case "week":
- $start = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) - $offset), $curyear);
- $end = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) + 7), $curyear);
+ switch($offset) {
+ case 0;
+ $weekoffset = 0;
+ break;
+ default:
+ $weekoffset = ($offset * 7) - 7;
+ break;
+ }
+ $start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear);
+ $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear);
break;
case "month":
$start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear);
@@ -254,9 +278,9 @@ function get_dates($curperiod, $graph) {
$tab_array[] = array(gettext("Quality"), $tabactive, "status_rrd_graph.php?cat=quality");
if($queues) {
if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; }
- $tab_array[] = array(gettext("Queues"), $tabactive, "status_rrd_graph.php?cat=queues");
+ $tab_array[] = array(gettext("Queues"), $tabactive, "status_rrd_graph.php?cat=queues");
if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; }
- $tab_array[] = array(gettext("QueueDrops"), $tabactive, "status_rrd_graph.php?cat=queuedrops");
+ $tab_array[] = array(gettext("QueueDrops"), $tabactive, "status_rrd_graph.php?cat=queuedrops");
}
if($wireless) {
if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; }
@@ -266,6 +290,10 @@ function get_dates($curperiod, $graph) {
if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array(gettext("Cellular"), $tabactive, "status_rrd_graph.php?cat=cellular");
}
+ if($vpnusers) {
+ if($curcat == "vpnusers") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpnusers");
+ }
if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array(gettext("Custom"), $tabactive, "status_rrd_graph.php?cat=custom");
if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; }
@@ -330,7 +358,6 @@ function get_dates($curperiod, $graph) {
echo " selected";
}
echo ">" . htmlspecialchars($prettyprint) . "</option>\n";
-
}
?>
@@ -360,59 +387,73 @@ function get_dates($curperiod, $graph) {
}
}
?>
-
</select>
-
<?php
if($curcat == "custom") {
-
-
- }
- foreach($graphs as $graph) {
- /* check which databases are valid for our category */
- foreach($ui_databases as $curdatabase) {
- if(! preg_match("/($curcat)/i", $curdatabase)) {
- continue;
- }
- $optionc = split("-", $curdatabase);
- $search = array("-", ".rrd", $optionc);
- $replace = array(" :: ", "", $friendly);
- switch($curoption) {
- case "outbound":
- /* only show interfaces with a gateway */
- $optionc = "$optionc[0]";
- if(!interface_has_gateway($optionc)) {
- if(!preg_match("/($optionc)-(quality)/", $curdatabase)) {
+ ?>
+ <?=gettext("Start:");?>
+ <input type="text" name="start" class="formfldunknown" length="32" value="<?php echo $start;?>">
+ <?=gettext("End:");?>
+ <input type="text" name="end" class="formfldunknown" length="32" value="<?php echo $now;?>">
+ <input type="submit" name="Submit" value="Go">
+ <?
+ $curdatabase = $curoption;
+ $graph = "custom-$curdatabase";
+ if(in_array($curdatabase, $databases)) {
+ echo "<tr><td colspan=2 class=\"list\">\n";
+ echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' ";
+ echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" ";
+ echo "SRC=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}\" />\n";
+ echo "<br /><hr><br />\n";
+ echo "</td></tr>\n";
+ }
+ } else {
+ foreach($graphs as $graph) {
+ /* check which databases are valid for our category */
+ foreach($ui_databases as $curdatabase) {
+ if(! preg_match("/($curcat)/i", $curdatabase)) {
+ continue;
+ }
+ $optionc = split("-", $curdatabase);
+ $search = array("-", ".rrd", $optionc);
+ $replace = array(" :: ", "", $friendly);
+ switch($curoption) {
+ case "outbound":
+ /* only show interfaces with a gateway */
+ $optionc = "$optionc[0]";
+ if(!interface_has_gateway($optionc)) {
+ if(!preg_match("/($optionc)-(quality)/", $curdatabase)) {
+ continue 2;
+ }
+ }
+ if(! preg_match("/($optionc)[-.]/i", $curdatabase)) {
continue 2;
}
- }
- if(! preg_match("/($optionc)[-.]/i", $curdatabase)) {
- continue 2;
- }
- break;
- case "allgraphs":
- /* make sure we do not show the placeholder databases in the all view */
- if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
- continue 2;
- }
- break;
- default:
- /* just use the name here */
- if(! preg_match("/($curoption)[-.]/i", $curdatabase)) {
- continue 2;
- }
- }
- if(in_array($curdatabase, $databases)) {
- $dates = get_dates($curperiod, $graph);
- $start = $dates['start'];
- $end = $dates['end'];
- echo "<tr><td colspan=2 class=\"list\">\n";
- echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' ";
- echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" ";
- echo "SRC=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}\" />\n";
- echo "<br /><hr><br />\n";
- echo "</td></tr>\n";
+ break;
+ case "allgraphs":
+ /* make sure we do not show the placeholder databases in the all view */
+ if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) {
+ continue 2;
+ }
+ break;
+ default:
+ /* just use the name here */
+ if(! preg_match("/($curoption)[-.]/i", $curdatabase)) {
+ continue 2;
+ }
+ }
+ if(in_array($curdatabase, $databases)) {
+ $dates = get_dates($curperiod, $graph);
+ $start = $dates['start'];
+ $end = $dates['end'];
+ echo "<tr><td colspan=2 class=\"list\">\n";
+ echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' ";
+ echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" ";
+ echo "SRC=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}\" />\n";
+ echo "<br /><hr><br />\n";
+ echo "</td></tr>\n";
+ }
}
}
}
diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php
index cd93550..bc974b1 100644
--- a/usr/local/www/status_rrd_graph_img.php
+++ b/usr/local/www/status_rrd_graph_img.php
@@ -3,7 +3,7 @@
/*
status_rrd_graph_img.php
Part of pfSense
- Copyright (C) 2009 Seth Mos <seth.mos@xs4all.nl>
+ Copyright (C) 2009 Seth Mos <seth.mos@dds.nl>
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/*
- pfSense_BUILDER_BINARIES: /usr/bin/find /bin/rm /usr/local/bin/rrdtool
+ pfSense_BUILDER_BINARIES: /bin/rm /usr/local/bin/rrdtool
pfSense_MODULE: system
*/
@@ -40,7 +40,7 @@ require_once("rrd.inc");
$pgtitle = array(gettext("System"),gettext("RRD Graphs"),gettext("Image viewer"));
if ($_GET['database']) {
- $curdatabase = $_GET['database'];
+ $curdatabase = basename($_GET['database']);
} else {
$curdatabase = "wan-traffic.rrd";
}
@@ -146,8 +146,9 @@ $havg = timeDiff($average, $defOptions);
$hperiod = timeDiff($seconds, $defOptions);
$data = true;
-/* XXX: (billm) do we have an exec() type function that does this type of thing? */
-exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases);
+$rrddbpath = "/var/db/rrd/";
+chdir($rrddbpath);
+$databases = glob("*.rrd");
rsort($databases);
/* compare bytes/sec counters, divide bps by 8 */
@@ -205,6 +206,7 @@ if(file_exists($rrdcolors)) {
$colorwireless = array('333333','a83c3c','999999');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+ $colorvpnusers = array('990000');
}
switch ($curstyle) {
@@ -570,6 +572,25 @@ elseif((strstr($curdatabase, "-wireless.rrd")) && (file_exists("$rrddbpath$curda
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
}
+elseif((strstr($curdatabase, "-vpnusers.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
+ /* define graphcmd for vpn users stats */
+ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
+ $graphcmd .= "--start $start --end $end ";
+ $graphcmd .= "--vertical-label \"users\" ";
+ $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
+ $graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" ";
+ $graphcmd .= "--height 200 --width 620 ";
+ $graphcmd .= "DEF:\"$curif-users=$rrddbpath$curdatabase:users:AVERAGE\" ";
+ $graphcmd .= "LINE2:\"$curif-users#{$colorvpnusers[0]}:$curif-users\" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t maximum\t\t average\t current\\n\" ";
+ $graphcmd .= "COMMENT:\"Users Online\t\" ";
+ $graphcmd .= "GPRINT:\"$curif-users:MAX:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-users:AVERAGE:%7.2lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-users:LAST:%7.2lf \" ";
+ $graphcmd .= "COMMENT:\"\\n\" ";
+ $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
+}
elseif((strstr($curdatabase, "-states.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
/* define graphcmd for states stats */
$graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php
index 7de6788..7d80ad2 100755
--- a/usr/local/www/status_rrd_graph_settings.php
+++ b/usr/local/www/status_rrd_graph_settings.php
@@ -3,7 +3,7 @@
/*
status_rrd_graph.php
Part of pfSense
- Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>
+ Copyright (C) 2007 Seth Mos <seth.mos@dds.nl>
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -77,9 +77,11 @@ if ($_POST) {
}
}
+
+
$rrddbpath = "/var/db/rrd/";
-/* XXX: (billm) do we have an exec() type function that does this type of thing? */
-exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases);
+chdir($rrddbpath);
+$databases = glob("*.rrd");
foreach($databases as $database) {
if(stristr($database, "wireless")) {
@@ -91,6 +93,9 @@ foreach($databases as $database) {
if(stristr($database, "cellular")) {
$cellular = true;
}
+ if(stristr($database, "-vpnusers")) {
+ $vpnusers = true;
+ }
}
$pgtitle = array(gettext("Status"),gettext("RRD Graphs"));
@@ -106,6 +111,7 @@ include("head.inc");
<tr>
<td>
<?php
+<<<<<<< HEAD
$tab_array = array();
if($curcat == "system") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array(gettext("System"), $tabactive, "status_rrd_graph.php?cat=system");
@@ -132,6 +138,39 @@ include("head.inc");
if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; }
$tab_array[] = array(gettext("Settings"), $tabactive, "status_rrd_graph_settings.php");
display_top_tabs($tab_array);
+ $tab_array = array();
+ if($curcat == "system") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("System", $tabactive, "status_rrd_graph.php?cat=system");
+ if($curcat == "traffic") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Traffic", $tabactive, "status_rrd_graph.php?cat=traffic");
+ if($curcat == "packets") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Packets", $tabactive, "status_rrd_graph.php?cat=packets");
+ if($curcat == "quality") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Quality", $tabactive, "status_rrd_graph.php?cat=quality");
+ if($queues) {
+ if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues");
+ if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops");
+ }
+ if($wireless) {
+ if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Wireless", $tabactive, "status_rrd_graph.php?cat=wireless");
+ }
+ if($cellular) {
+ if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular");
+ }
+ if($vpnusers) {
+ if($curcat == "vpnusers") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpnusers");
+ }
+ if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Custom", $tabactive, "status_rrd_graph.php?cat=custom");
+ if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; }
+ $tab_array[] = array("Settings", $tabactive, "status_rrd_graph_settings.php");
+
+ display_top_tabs($tab_array);
?>
</td>
</tr>
diff --git a/usr/local/www/status_upnp.php b/usr/local/www/status_upnp.php
index d2e0a88..7197a2c 100644
--- a/usr/local/www/status_upnp.php
+++ b/usr/local/www/status_upnp.php
@@ -4,7 +4,7 @@
status_upnp.php
part of pfSense (http://www.pfsense.com/)
- Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/system_gateway_groups.php b/usr/local/www/system_gateway_groups.php
index 43dfea7..f767aff 100755
--- a/usr/local/www/system_gateway_groups.php
+++ b/usr/local/www/system_gateway_groups.php
@@ -4,7 +4,7 @@
system_gateway_groups.php
part of pfSense (http://pfsense.com)
- Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/system_gateway_groups_edit.php b/usr/local/www/system_gateway_groups_edit.php
index 1a504c5..268a5da 100755
--- a/usr/local/www/system_gateway_groups_edit.php
+++ b/usr/local/www/system_gateway_groups_edit.php
@@ -4,7 +4,7 @@
system_gateway_groups_edit.php
part of pfSense (http://pfsense.com)
- Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php
index 82004a7..d789d76 100755
--- a/usr/local/www/system_gateways.php
+++ b/usr/local/www/system_gateways.php
@@ -4,7 +4,7 @@
system_gateways.php
part of pfSense (http://pfsense.com)
- Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 98d1e81..e679b90 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -4,7 +4,7 @@
system_gateways_edit.php
part of pfSense (http://pfsense.com)
- Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>.
+ Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/usr/local/www/themes/code-red/rrdcolors.inc.php b/usr/local/www/themes/code-red/rrdcolors.inc.php
index cbd6a8d..1ab0fd0 100755
--- a/usr/local/www/themes/code-red/rrdcolors.inc.php
+++ b/usr/local/www/themes/code-red/rrdcolors.inc.php
@@ -46,5 +46,6 @@ $colorqualityloss = "ee0000";
$colorwireless = array('990000','a83c3c','b36666');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
?>
diff --git a/usr/local/www/themes/metallic/rrdcolors.inc.php b/usr/local/www/themes/metallic/rrdcolors.inc.php
index e3153fd..8e74545 100644
--- a/usr/local/www/themes/metallic/rrdcolors.inc.php
+++ b/usr/local/www/themes/metallic/rrdcolors.inc.php
@@ -46,5 +46,6 @@ $colorqualityloss = "ee0000";
$colorwireless = array('333333','a83c3c','999999');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
?>
diff --git a/usr/local/www/themes/nervecenter/rrdcolors.inc.php b/usr/local/www/themes/nervecenter/rrdcolors.inc.php
index e3153fd..8e74545 100644
--- a/usr/local/www/themes/nervecenter/rrdcolors.inc.php
+++ b/usr/local/www/themes/nervecenter/rrdcolors.inc.php
@@ -46,5 +46,6 @@ $colorqualityloss = "ee0000";
$colorwireless = array('333333','a83c3c','999999');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
?>
diff --git a/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php b/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php
index e3153fd..8e74545 100644
--- a/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php
+++ b/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php
@@ -46,5 +46,6 @@ $colorqualityloss = "ee0000";
$colorwireless = array('333333','a83c3c','999999');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
?>
diff --git a/usr/local/www/themes/pfsense/rrdcolors.inc.php b/usr/local/www/themes/pfsense/rrdcolors.inc.php
index e3153fd..8e74545 100644
--- a/usr/local/www/themes/pfsense/rrdcolors.inc.php
+++ b/usr/local/www/themes/pfsense/rrdcolors.inc.php
@@ -46,5 +46,6 @@ $colorqualityloss = "ee0000";
$colorwireless = array('333333','a83c3c','999999');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
?>
diff --git a/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php b/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php
index e3153fd..8e74545 100644
--- a/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php
+++ b/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php
@@ -46,5 +46,6 @@ $colorqualityloss = "ee0000";
$colorwireless = array('333333','a83c3c','999999');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
?>
diff --git a/usr/local/www/themes/the_wall/rrdcolors.inc.php b/usr/local/www/themes/the_wall/rrdcolors.inc.php
index e3153fd..8e74545 100644
--- a/usr/local/www/themes/the_wall/rrdcolors.inc.php
+++ b/usr/local/www/themes/the_wall/rrdcolors.inc.php
@@ -46,5 +46,6 @@ $colorqualityloss = "ee0000";
$colorwireless = array('333333','a83c3c','999999');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
?>
OpenPOWER on IntegriCloud