diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-02-23 02:22:30 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-02-23 02:22:30 +0000 |
commit | 21a0464c1a66792acd91e852c47d7838c49df303 (patch) | |
tree | d8d106d0dab053c921ab41a2a142faff0202648e /usr/local/www | |
parent | 8e2a7e8a28d893c287afc69538e7fdb30002ba86 (diff) | |
download | pfsense-21a0464c1a66792acd91e852c47d7838c49df303.zip pfsense-21a0464c1a66792acd91e852c47d7838c49df303.tar.gz |
* Unbreak rrd graphs for queues and make them multiinterface aware
* Add a new tab for queuedrops with multiinterface there is no way to have them in the same tab
* Remove $GLOBAL where used and use proper accessor functions
* Remove Manuel from copyright this file has been rewritten
* Some bugs fixes in general
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/firewall_rules_edit.php | 8 | ||||
-rwxr-xr-x | usr/local/www/firewall_shaper_queues.php | 20 | ||||
-rwxr-xr-x | usr/local/www/status_rrd_graph.php | 9 | ||||
-rw-r--r-- | usr/local/www/status_rrd_graph_img.php | 26 |
4 files changed, 23 insertions, 40 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 033d7ff..bc509d8 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -993,9 +993,11 @@ on another rule.")?> <td width="78%" class="vtable"> <select name="ackqueue"> <?php - if (!is_array($altq_list_queues)) read_altq_config(); /* XXX: */ - foreach ($GLOBALS['unique_qlist'] as $q) { + $qlist =& get_unique_queue_list(); + if (!is_array($qlist)) + $qlist = array(); + foreach ($qlist as $q => $qkey) { echo "<option value=\"$q\""; if ($q == $pconfig['ackqueue']) { $qselected = 1; @@ -1011,7 +1013,7 @@ on another rule.")?> <select name="defaultqueue"> <?php $qselected = 0; - foreach ($GLOBALS['unique_qlist'] as $q) { + foreach ($qlist as $q => $qkey) { echo "<option value=\"$q\""; if ($q == $pconfig['defaultqueue']) { $qselected = 1; diff --git a/usr/local/www/firewall_shaper_queues.php b/usr/local/www/firewall_shaper_queues.php index f65e61b..7b67df3 100755 --- a/usr/local/www/firewall_shaper_queues.php +++ b/usr/local/www/firewall_shaper_queues.php @@ -6,10 +6,6 @@ Copyright (C) 2008 Ermal Luçi All rights reserved. - Originally part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. - All rights reserved. - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -39,20 +35,14 @@ if($_GET['reset'] <> "") { exit; } -if (!is_array($config['shaper']['queue'])) { - $config['shaper']['queue'] = array(); -} - -/* on HEAD it has to use vc_* api on variable_cache.inc */ -if (!is_array($GLOBALS['allqueue_list'])) { - $GLOBALS['allqueue_list'] = array(); -} - -/* XXX: NOTE: When dummynet is implemented these will be moved from here */ read_altq_config(); +$qlist =& get_unique_queue_list(); + +if (!is_array($qlist)) + $qlist = array(); $tree = "<ul class=\"tree\" >"; -foreach ($GLOBALS['allqueue_list'] as $queue) { +foreach ($qlist as $queue => $qkey) { $tree .= "<li><a href=\"firewall_shaper_queues.php?queue={$queue}&action=show\" >{$queue}</a></li>"; } $tree .= "</ul>"; diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index c318421..aeb03d6 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -47,6 +47,8 @@ if ($_GET['option']) { $curoption = "processor"; } else if($curcat == "queues") { $curoption = "queues"; + } else if($curcat == "queuedrops") { + $curoption = "queuedrops"; } else { $curoption = "wan"; } @@ -111,6 +113,8 @@ include("head.inc"); $tab_array[] = array("Quality", $tabactive, "status_rrd_graph.php?cat=quality"); if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues"); + if($curcat == "queuesdrop") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops"); if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Wireless", $tabactive, "status_rrd_graph.php?cat=wireless"); if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } @@ -145,11 +149,6 @@ include("head.inc"); echo "<option value=\"$optionc\""; $prettyprint = ucwords(str_replace($search, $replace, $optionc)); break; - case "queues": - $optionc = str_replace($search, $replace, $optionc[1]); - echo "<option value=\"$optionc\""; - $prettyprint = ucwords(str_replace($search, $replace, $optionc)); - break; default: /* Deduce a interface if possible and use the description */ $optionc = "$optionc[0]"; diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php index 71c9a1d..77b9c1c 100644 --- a/usr/local/www/status_rrd_graph_img.php +++ b/usr/local/www/status_rrd_graph_img.php @@ -106,7 +106,7 @@ rsort($databases); /* compare bytes/sec counters, divide bps by 8 */ read_altq_config(); -if (is_array($altq_list_queues[$curif])) { +if ($altq_list_queues[$curif]) { $altq =& $altq_list_queues[$curif]; switch ($altq->GetBwscale()) { case "Gb": @@ -128,7 +128,7 @@ if (is_array($altq_list_queues[$curif])) { $upif = $curif; $downif = "lan"; /* XXX should this be set to something else?! */ } else { - $altq = array(); + $altq = null; $downstream = 12500000; $upstream = 12500000; $upif = "wan"; @@ -503,17 +503,13 @@ elseif((strstr($curdatabase, "-queues.rrd")) && (file_exists("$rrddbpath$curdata --color SHADEA#eeeeee --color SHADEB#eeeeee \\ --title \"`hostname` - $prettydb - $hperiod - $havg average\" \\ --height 200 --width 620 -x \"$scale\" \\"; - if (!is_array($config['shaper']['queue'])) { - $config['shaper']['queue'] = array(); - } - if (count($altq) > 0) - $a_queue =& $altq->get_queue_list($notused); + if ($altq) + $a_queues =& $altq->get_queue_list(); else $a_queues = array(); $i = 0; $t = 0; - foreach ($a_queues as $queue) { - $name = $queue->GetQname(); + foreach ($a_queues as $name => $q) { $color = "$colorqueuesup[$t]"; if($t > 0) { $stack = ":STACK"; } $graphcmd .= "DEF:$name=$rrddbpath$curdatabase:$name:AVERAGE \\ @@ -527,7 +523,7 @@ elseif((strstr($curdatabase, "-queues.rrd")) && (file_exists("$rrddbpath$curdata $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, "-queuesdrop.rrd")) && (file_exists("$rrddbpath$curdatabase"))) { +elseif((strstr($curdatabase, "-queuedrops.rrd")) && (file_exists("$rrddbpath$curdatabase"))) { /* define graphcmd for queuedrop stats */ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$interval.png \\ --start -$seconds -e -$average \\ @@ -535,17 +531,13 @@ elseif((strstr($curdatabase, "-queuesdrop.rrd")) && (file_exists("$rrddbpath$cur --color SHADEA#eeeeee --color SHADEB#eeeeee \\ --title \"`hostname` - $prettydb - $hperiod - $havg average\" \\ --height 200 --width 620 -x \"$scale\" \\"; - if (!is_array($config['shaper']['queue'])) { - $config['shaper']['queue'] = array(); - } - if (count($altq) > 0) - $a_queue =& $altq->get_queue_list($notused); + if ($altq) + $a_queues =& $altq->get_queue_list(); else $a_queues = array(); $i = 0; $t = 0; - foreach ($a_queues as $queue) { - $name = $queue->GetQname(); + foreach ($a_queues as $name => $q) { $color = "$colorqueuesdropup[$t]"; if($t > 0) { $stack = ":STACK"; } $graphcmd .= "DEF:$name=$rrddbpath$curdatabase:$name:AVERAGE \\ |