summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-01-22 02:57:05 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-01-22 02:57:05 +0000
commit12bcdc89e94842ee2411661509f7627ff39f2367 (patch)
tree45111bbe7a398ab6004e5a1119227098fc6c4f4a /usr/local
parent44ce4df14a21aaf47569a1c2f3755713dcc45da1 (diff)
downloadpfsense-12bcdc89e94842ee2411661509f7627ff39f2367.zip
pfsense-12bcdc89e94842ee2411661509f7627ff39f2367.tar.gz
Commit what I have so far. Magic shaper now works 100% .. or atleast appears to!
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/firewall_shaper.php39
-rwxr-xr-xusr/local/www/firewall_shaper_edit.php29
-rwxr-xr-xusr/local/www/firewall_shaper_queues.php49
-rwxr-xr-xusr/local/www/firewall_shaper_queues_edit.php251
-rwxr-xr-xusr/local/www/system_advanced.php8
5 files changed, 145 insertions, 231 deletions
diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php
index 60e8963..5bb61e4 100755
--- a/usr/local/www/firewall_shaper.php
+++ b/usr/local/www/firewall_shaper.php
@@ -33,26 +33,25 @@
require("guiconfig.inc");
-if (!is_array($config['pfqueueing']['rule'])) {
- $config['pfqueueing']['rule'] = array();
+if (!is_array($config['shaper']['rule'])) {
+ $config['shaper']['rule'] = array();
}
-if (!is_array($config['pfqueueing']['pipe'])) {
- $config['pfqueueing']['pipe'] = array();
+if (!is_array($config['shaper']['pipe'])) {
+ $config['shaper']['pipe'] = array();
}
-if (!is_array($config['pfqueueing']['queue'])) {
- $config['pfqueueing']['queue'] = array();
+if (!is_array($config['shaper']['queue'])) {
+ $config['shaper']['queue'] = array();
}
-$a_shaper = &$config['pfqueueing']['rule'];
-$a_pipe = &$config['pfqueueing']['pipe'];
-$a_queue = &$config['pfqueueing']['queue'];
+$a_shaper = &$config['shaper']['rule'];
+$a_queue = &$config['shaper']['queue'];
-$pconfig['enable'] = isset($config['pfqueueing']['enable']);
+$pconfig['enable'] = isset($config['shaper']['enable']);
if ($_POST) {
if ($_POST['submit']) {
$pconfig = $_POST;
- $config['pfqueueing']['enable'] = $_POST['enable'] ? true : false;
+ $config['shaper']['enable'] = $_POST['enable'] ? true : false;
write_config();
}
@@ -199,22 +198,16 @@ if ($_GET['act'] == "del") {
</td>
<td class="listr"><?=$textss;?>
<?php
- if (isset($shaperent['targetpipe'])) {
- if ($a_pipe[$shaperent['targetpipe']]['descr'])
- $desc = htmlspecialchars($a_pipe[$shaperent['targetpipe']]['descr']);
+ if (isset($shaperent['targetqueue'])) {
+ if ($a_queue[$shaperent['targetqueue']]['name'])
+ $desc = htmlspecialchars($a_queue[$shaperent['targetqueue']]['name']);
else
- $desc = "Pipe " . ($shaperent['targetpipe']+1);
- echo "<a href=\"firewall_shaper_pipes_edit.php?id={$shaperent['targetpipe']}\">{$desc}</a>";
- } else if (isset($shaperent['targetqueue'])) {
- if ($a_queue[$shaperent['targetqueue']]['descr'])
- $desc = htmlspecialchars($a_queue[$shaperent['targetqueue']]['descr']);
- else
- $desc = "Queue " . ($shaperent['targetqueue']+1);
- echo "<a href=\"firewall_shaper_queues_edit.php?id={$shaperent['targetqueue']}\">{$desc}</a>";
+ $desc = "Queue " . ($shaperent['targetpipe']+1);
+ echo "<a href=\"firewall_shaper_pipes_edit.php?id={$shaperent['targetqueue']}\">{$desc}</a>";
}
?><?=$textse;?>
</td>
- <td class="listbg">
+ <td class="listbg"><font color="white">
<?=$textss;?><?=htmlspecialchars($shaperent['descr']);?><?=$textse;?>
&nbsp; </td>
<td valign="middle" nowrap class="list"> <a href="firewall_shaper_edit.php?id=<?=$i;?>"><img src="e.gif" title="edit rule" width="17" height="17" border="0"></a>
diff --git a/usr/local/www/firewall_shaper_edit.php b/usr/local/www/firewall_shaper_edit.php
index 0ff2781..3268048 100755
--- a/usr/local/www/firewall_shaper_edit.php
+++ b/usr/local/www/firewall_shaper_edit.php
@@ -129,11 +129,7 @@ if (isset($id) && $a_shaper[$id]) {
$pconfig['dstmask'], $pconfig['dstnot'],
$pconfig['dstbeginport'], $pconfig['dstendport']);
- if (isset($a_shaper[$id]['targetpipe'])) {
- $pconfig['target'] = "targetpipe:" . $a_shaper[$id]['targetpipe'];
- } else if (isset($a_shaper[$id]['targetqueue'])) {
- $pconfig['target'] = "targetqueue:" . $a_shaper[$id]['targetqueue'];
- }
+ $pconfig['target'] = $a_shaper[$id]['targetqueue'];
$pconfig['direction'] = $a_shaper[$id]['direction'];
$pconfig['iptos'] = $a_shaper[$id]['iptos'];
@@ -459,6 +455,7 @@ function dst_rep_change() {
<?php include("fbegin.inc"); ?>
<p class="pgtitle">Firewall: Traffic shaper: Edit rule</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
+<?php if (is_array($config['shaper']['queue']) > 0): ?>
<form action="firewall_shaper_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
@@ -466,21 +463,12 @@ function dst_rep_change() {
<td valign="top" class="vncellreq">Target</td>
<td class="vtable"> <select name="target" class="formfld">
<?php
- foreach ($config['shaper']['pipe'] as $pipei => $pipe): ?>
- <option value="<?="targetpipe:$pipei";?>" <?php if ("targetpipe:$pipei" == $pconfig['target']) echo "selected"; ?>>
- <?php
- echo htmlspecialchars("Pipe " . ($pipei + 1));
- if ($pipe['descr'])
- echo htmlspecialchars(" (" . $pipe['descr'] . ")");
- ?>
- </option>
- <?php endforeach;
foreach ($config['shaper']['queue'] as $queuei => $queue): ?>
- <option value="<?="targetqueue:$queuei";?>" <?php if ("targetqueue:$queuei" == $pconfig['target']) echo "selected"; ?>>
+ <option value="<?="$queuei";?>" <?php if ("$queuei" == $pconfig['target']) echo "selected"; ?>>
<?php
echo htmlspecialchars("Queue " . ($queuei + 1));
- if ($queue['descr'])
- echo htmlspecialchars(" (" . $queue['descr'] . ")");
+ if ($queue['name'])
+ echo htmlspecialchars(" (" . $queue['name'] . ")");
?>
</option>
<?php endforeach; ?>
@@ -694,8 +682,8 @@ function dst_rep_change() {
on the interface specified above (as seen from the firewall's
perspective). </td>
</tr>
-
-
+
+
<tr>
<td width="22%" valign="top" class="vncell">IP packet length</td>
<td width="78%" class="vtable"><input name="iplen" type="text" id="iplen" size="10" value="<?=htmlspecialchars($pconfig['iplen']);?>">
@@ -750,6 +738,9 @@ typesel_change();
proto_change();
//-->
</script>
+<?php else: ?>
+<p><strong>You need to create a queue before you can add a new rule.</strong></p>
+<?php endif; ?>
<?php include("fend.inc"); ?>
</body>
</html>
diff --git a/usr/local/www/firewall_shaper_queues.php b/usr/local/www/firewall_shaper_queues.php
index f7b7c19..94169d5 100755
--- a/usr/local/www/firewall_shaper_queues.php
+++ b/usr/local/www/firewall_shaper_queues.php
@@ -33,14 +33,14 @@
require("guiconfig.inc");
-if (!is_array($config['pfqueueing']['pipe'])) {
- $config['pfqueueing']['pipe'] = array();
+if (!is_array($config['shaper']['pipe'])) {
+ $config['shaper']['pipe'] = array();
}
-if (!is_array($config['pfqueueing']['queue'])) {
- $config['pfqueueing']['queue'] = array();
+if (!is_array($config['shaper']['queue'])) {
+ $config['shaper']['queue'] = array();
}
-$a_queues = &$config['pfqueueing']['queue'];
-$a_pipe = &$config['pfqueueing']['pipe'];
+$a_queues = &$config['shaper']['queue'];
+$a_pipe = &$config['shaper']['pipe'];
$iflist = array("lan" => "LAN", "wan" => "WAN");
@@ -51,8 +51,8 @@ for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
if ($_GET['act'] == "del") {
if ($a_queues[$_GET['id']]) {
/* check that no rule references this queue */
- if (is_array($config['pfqueueing']['rule'])) {
- foreach ($config['pfqueueing']['rule'] as $rule) {
+ if (is_array($config['shaper']['rule'])) {
+ foreach ($config['shaper']['rule'] as $rule) {
if (isset($rule['targetqueue']) && ($rule['targetqueue'] == $_GET['id'])) {
$input_errors[] = "This queue cannot be deleted because it is still referenced by a rule.";
break;
@@ -64,9 +64,9 @@ if ($_GET['act'] == "del") {
unset($a_queues[$_GET['id']]);
/* renumber all rules */
- if (is_array($config['pfqueueing']['rule'])) {
- for ($i = 0; isset($config['pfqueueing']['rule'][$i]); $i++) {
- $currule = &$config['pfqueueing']['rule'][$i];
+ if (is_array($config['shaper']['rule'])) {
+ for ($i = 0; isset($config['shaper']['rule'][$i]); $i++) {
+ $currule = &$config['shaper']['rule'][$i];
if (isset($currule['targetqueue']) && ($currule['targetqueue'] > $_GET['id']))
$currule['targetqueue']--;
}
@@ -112,24 +112,31 @@ if ($_GET['act'] == "del") {
<tr>
<td width="10%" class="listhdrr">No.</td>
<td width="5%" class="listhdrr">Priority</td>
- <td width="20%" class="listhdrr">Assigned Queue</td>
- <td width="30%" class="listhdr">Description</td>
+ <td width="5%" class="listhdr">Default</td>
+ <td width="30%" class="listhdr">Name</td>
<td width="10%" class="list"></td>
</tr>
<?php $i = 0; foreach ($a_queues as $queue): ?>
<tr valign="top">
<td class="listlr">
- <?=($i+1);?></td>
+ <?=($i+1);?>
+ </td>
<td class="listr">
- <?=$queue['priority'];?></td>
- <td class="listr">
- <?php echo $queue['options']['associatedrule']; ?>
-
-
- &nbsp; </td>
+ <?=$queue['priority'];?>
+ </td>
+ <td class="listr">
+ <?php
+ if($queue['default'] <> "") {
+ echo "Yes";
+ } else {
+ echo "No";
+ }
+ ?>
+ </td>
<td class="listbg">
<font color="#FFFFFF"><?=htmlspecialchars($queue['name']);?>
- &nbsp; </td>
+ &nbsp;
+ </td>
<td valign="middle" nowrap class="list"> <a href="firewall_shaper_queues_edit.php?id=<?=$i;?>"><img src="e.gif" width="17" height="17" border="0"></a>
&nbsp;<a href="firewall_shaper_queues.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this queue?')"><img src="x.gif" width="17" height="17" border="0"></a></td>
</tr>
diff --git a/usr/local/www/firewall_shaper_queues_edit.php b/usr/local/www/firewall_shaper_queues_edit.php
index 662505f..d247025 100755
--- a/usr/local/www/firewall_shaper_queues_edit.php
+++ b/usr/local/www/firewall_shaper_queues_edit.php
@@ -5,7 +5,7 @@
Copyright (C) 2004, 2005 Scott Ullrich
All rights reserved.
- originally part of m0n0wall (http://m0n0.ch/wall)
+ Originally part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
@@ -33,7 +33,7 @@
require("guiconfig.inc");
-$a_queues = &$config['pfqueueing']['queue'];
+$a_queues = &$config['shaper']['queue'];
$id = $_GET['id'];
if (isset($_POST['id']))
@@ -41,29 +41,30 @@ if (isset($_POST['id']))
$wan_sched = $config['interfaces']['wan']['schedulertype'];
$lan_sched = $config['interfaces']['lan']['schedulertype'];
+$pconfig['schedulertype'] = $config['system']['schedulertype'];
+$schedulertype = $pconfig['schedulertype'];
if (isset($id) && $a_queues[$id]) {
$pconfig['bandwidth'] = $a_queues[$id]['bandwidth'] . $a_queues[$id]['bandwidthtype'];
$pconfig['priority'] = $a_queues[$id]['priority'];
$pconfig['mask'] = $a_queues[$id]['mask'];
$pconfig['name'] = $a_queues[$id]['name'];
- $pconfig['options'] = $a_queues[$id]['options'];
- $pconfig['options']['red'] = $a_queues[$id]['options']['red'];
- $pconfig['options']['ecn'] = $a_queues[$id]['options']['ecn'];
- $pconfig['options']['rio'] = $a_queues[$id]['options']['rio'];
- $pconfig['options']['borrow'] = $a_queues[$id]['options']['borrow'];
- $pconfig['options']['defaultqueue'] = $a_queues[$id]['options']['defaultqueue'];
- $pconfig['options']['parentqueue'] = $a_queues[$id]['options']['parentqueue'];
- $pconfig['options']['upperlimit1'] = $a_queues[$id]['options']['upperlimit1'];
- $pconfig['options']['upperlimit2'] = $a_queues[$id]['options']['upperlimit2'];
- $pconfig['options']['upperlimit3'] = $a_queues[$id]['options']['upperlimit3'];
- $pconfig['options']['realtime1'] = $a_queues[$id]['options']['realtime1'];
- $pconfig['options']['realtime2'] = $a_queues[$id]['options']['realtime2'];
- $pconfig['options']['realtime3'] = $a_queues[$id]['options']['realtime3'];
- $pconfig['options']['linkshare1'] = $a_queues[$id]['options']['linkshare1'];
- $pconfig['options']['linkshare2'] = $a_queues[$id]['options']['linkshare2'];
- $pconfig['options']['linkshare3'] = $a_queues[$id]['options']['linkshare3'];
- $pconfig['schedulertype'] = $a_queues[$id]['schedulertype'];
+ $pconfig = $a_queues[$id];
+ $pconfig['red'] = $a_queues[$id]['red'];
+ $pconfig['ecn'] = $a_queues[$id]['ecn'];
+ $pconfig['rio'] = $a_queues[$id]['rio'];
+ $pconfig['borrow'] = $a_queues[$id]['borrow'];
+ $pconfig['defaultqueue'] = $a_queues[$id]['defaultqueue'];
+ $pconfig['parentqueue'] = $a_queues[$id]['parentqueue'];
+ $pconfig['upperlimit1'] = $a_queues[$id]['upperlimit1'];
+ $pconfig['upperlimit2'] = $a_queues[$id]['upperlimit2'];
+ $pconfig['upperlimit3'] = $a_queues[$id]['upperlimit3'];
+ $pconfig['realtime1'] = $a_queues[$id]['realtime1'];
+ $pconfig['realtime2'] = $a_queues[$id]['realtime2'];
+ $pconfig['realtime3'] = $a_queues[$id]['realtime3'];
+ $pconfig['linkshare1'] = $a_queues[$id]['linkshare1'];
+ $pconfig['linkshare2'] = $a_queues[$id]['linkshare2'];
+ $pconfig['linkshare3'] = $a_queues[$id]['linkshare3'];
$pconfig['bandwidth'] = $a_queues[$id]['bandwidth'];
$pconfig['bandwidthtype'] = $a_queues[$id]['bandwidthtype'];
$pconfig['associatedrule'] = $a_queues[$id]['associatedrule'];
@@ -87,32 +88,32 @@ if ($_POST) {
if (!$input_errors) {
$queue = array();
-
$queue['schedulertype'] = $_POST['schedulertype'];
$queue['bandwidth'] = $_POST['bandwidth'];
$queue['bandwidthtype'] = $_POST['bandwidthtype'];
$queue['priority'] = $_POST['priority'];
$queue['name'] = ereg_replace(" ", "", $_POST['name']);
- $queue['options']['borrow'] = $_POST['borrow'];
- $queue['options']['linkshare'] = $_POST['linkshare'];
- $queue['options']['linkshare3'] = $_POST['linkshare3'];
- $queue['options']['linkshare2'] = $_POST['linkshare2'];
- $queue['options']['linkshare1'] = $_POST['linkshare1'];
- $queue['options']['realtime'] = $_POST['realtime'];
- $queue['options']['realtime3'] = $_POST['realtime3'];
- $queue['options']['realtime2'] = $_POST['realtime2'];
- $queue['options']['realtime1'] = $_POST['realtime1'];
- $queue['options']['upperlimit'] = $_POST['upperlimit'];
- $queue['options']['upperlimit3'] = $_POST['upperlimit3'];
- $queue['options']['upperlimit2'] = $_POST['upperlimit2'];
- $queue['options']['upperlimit1'] = $_POST['upperlimit1'];
- $queue['options']['parentqueue'] = $_POST['parentqueue'];
- $queue['options']['associatedrule'] = $_POST['associatedrule'];
+ $queue['name'] = substr($queue['name'], 0, 14);
+ $queue['borrow'] = $_POST['borrow'];
+ $queue['linkshare'] = $_POST['linkshare'];
+ $queue['linkshare3'] = $_POST['linkshare3'];
+ $queue['linkshare2'] = $_POST['linkshare2'];
+ $queue['linkshare1'] = $_POST['linkshare1'];
+ $queue['realtime'] = $_POST['realtime'];
+ $queue['realtime3'] = $_POST['realtime3'];
+ $queue['realtime2'] = $_POST['realtime2'];
+ $queue['realtime1'] = $_POST['realtime1'];
+ $queue['upperlimit'] = $_POST['upperlimit'];
+ $queue['upperlimit3'] = $_POST['upperlimit3'];
+ $queue['upperlimit2'] = $_POST['upperlimit2'];
+ $queue['upperlimit1'] = $_POST['upperlimit1'];
+ $queue['parentqueue'] = $_POST['parentqueue'];
+ $queue['associatedrule'] = $_POST['associatedrule'];
$scheduleroptions="";
- $queue['options']['rio'] = $_POST['rio'];
- $queue['options']['red'] = $_POST['red'];
- $queue['options']['ecn'] = $_POST['ecn'];
- $queue['options']['defaultqueue'] = $_POST['defaultqueue'];
+ $queue['rio'] = $_POST['rio'];
+ $queue['red'] = $_POST['red'];
+ $queue['ecn'] = $_POST['ecn'];
+ $queue['defaultqueue'] = $_POST['defaultqueue'];
if (isset($id) && $a_queues[$id])
$a_queues[$id] = $queue;
else
@@ -141,117 +142,31 @@ if ($_POST) {
<title><?=gentitle("Firewall: Traffic shaper: Edit queue");?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="gui.css" rel="stylesheet" type="text/css">
-
-<script language="JavaScript">
-<!--
-function sync_scheduler_options() {
- var wan = '<?=$wan_sched?>';
- var lan = '<?=$lan_sched?>';
- var indexNum = document.forms[0].associatedrule.selectedIndex;
- var associatedrule = document.forms[0].associatedrule.options[indexNum].text;
- var tmp = associatedrule.split(" - ");
- var interface_type_a = '' + eval(tmp[0]) + '';
- var interface_type = String(interface_type_a);
- if(interface_type == 'priq') {
- document.forms[0].rio.disabled = 0;
- document.forms[0].bandwidth.disabled = 1;
- document.forms[0].bandwidthtype.disabled = 1;
- document.forms[0].bandwidth.value = "";
- document.forms[0].bandwidthtype.value = "";
- document.forms[0].defaultqueue.disabled = 0;
- document.forms[0].borrow.disabled = 1;
- document.forms[0].parentqueue.disabled = 1;
- document.forms[0].red.disabled = 0;
- document.forms[0].ecn.disabled = 0;
- document.forms[0].upperlimit.disabled = 1;
- document.forms[0].upperlimit1.disabled = 1;
- document.forms[0].upperlimit2.disabled = 1;
- document.forms[0].upperlimit3.disabled = 1;
- document.forms[0].realtime.disabled = 1;
- document.forms[0].realtime1.disabled = 1;
- document.forms[0].realtime2.disabled = 1;
- document.forms[0].realtime3.disabled = 1;
- document.forms[0].linkshare.disabled = 1;
- document.forms[0].linkshare1.disabled = 1;
- document.forms[0].linkshare2.disabled = 1;
- document.forms[0].linkshare3.disabled = 1;
- document.forms[0].childqueue.disabled = 1;
- document.forms[0].priority.disabled = 0;
- } else if(interface_type == 'cbq') {
- document.forms[0].rio.disabled = 0;
- document.forms[0].borrow.disabled = 0;
- document.forms[0].bandwidth.disabled = 0;
- document.forms[0].bandwidthtype.disabled = 0;
- document.forms[0].defaultqueue.disabled = 0;
- document.forms[0].parentqueue.disabled = 0;
- document.forms[0].red.disabled = 0;
- document.forms[0].ecn.disabled = 0;
- document.forms[0].upperlimit.disabled = 1;
- document.forms[0].upperlimit1.disabled = 1;
- document.forms[0].upperlimit2.disabled = 1;
- document.forms[0].upperlimit3.disabled = 1;
- document.forms[0].realtime.disabled = 1;
- document.forms[0].realtime1.disabled = 1;
- document.forms[0].realtime2.disabled = 1;
- document.forms[0].realtime3.disabled = 1;
- document.forms[0].linkshare.disabled = 1;
- document.forms[0].linkshare1.disabled = 1;
- document.forms[0].linkshare2.disabled = 1;
- document.forms[0].linkshare3.disabled = 1;
- document.forms[0].childqueue.disabled = 0;
- document.forms[0].priority.disabled = 0;
- } else if(interface_type == 'hfsc') {
- document.forms[0].rio.disabled = 0;
- document.forms[0].borrow.disabled = 0;
- document.forms[0].bandwidth.disabled = 0;
- document.forms[0].bandwidthtype.disabled = 0;
- document.forms[0].red.disabled = 0;
- document.forms[0].ecn.disabled = 0;
- document.forms[0].defaultqueue.disabled = 0;
- document.forms[0].parentqueue.disabled = 0;
- document.forms[0].upperlimit.disabled = 0;
- document.forms[0].upperlimit1.disabled = 0;
- document.forms[0].upperlimit2.disabled = 0;
- document.forms[0].upperlimit3.disabled = 0;
- document.forms[0].realtime.disabled = 0;
- document.forms[0].realtime1.disabled = 0;
- document.forms[0].realtime2.disabled = 0;
- document.forms[0].realtime3.disabled = 0;
- document.forms[0].linkshare.disabled = 0;
- document.forms[0].linkshare1.disabled = 0;
- document.forms[0].linkshare2.disabled = 0;
- document.forms[0].linkshare3.disabled = 0;
- document.forms[0].childqueue.disabled = 0;
- document.forms[0].priority.disabled = 0;
- }
-}
--->
-</script>
</head>
-<body onLoad="sync_scheduler_options();" link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<?php
- $red = $pconfig['options']["red"];
- $ecn = $pconfig['options']["ecn"];
- $rio = $pconfig['options']["rio"];
- $borrow = $pconfig['options']["borrow"];
- $upperlimit = $pconfig['options']["upperlimit"];
- $upperlimit1 = $pconfig['options']["upperlimit1"];
- $upperlimit2 = $pconfig['options']["upperlimit2"];
- $upperlimit3 = $pconfig['options']["upperlimit3"];
- $realtime = $pconfig['options']["realtime"];
- $realtime1 = $pconfig['options']["realtime1"];
- $realtime2 = $pconfig['options']["realtime2"];
- $realtime3 = $pconfig['options']["realtime3"];
- $linkshare = $pconfig['options']["linkshare"];
- $linkshare1 = $pconfig['options']["linkshare1"];
- $linkshare2 = $pconfig['options']["linkshare2"];
- $linkshare3 = $pconfig['options']["linkshare3"];
- $parentqueue = $pconfig['options']["parentqueue"];
- $defaultqueue = $pconfig['options']["defaultqueue"];
- $parent = $pconfig['options']["parent"];
+ $red = $pconfig["red"];
+ $ecn = $pconfig["ecn"];
+ $rio = $pconfig["rio"];
+ $borrow = $pconfig["borrow"];
+ $upperlimit = $pconfig["upperlimit"];
+ $upperlimit1 = $pconfig["upperlimit1"];
+ $upperlimit2 = $pconfig["upperlimit2"];
+ $upperlimit3 = $pconfig["upperlimit3"];
+ $realtime = $pconfig["realtime"];
+ $realtime1 = $pconfig["realtime1"];
+ $realtime2 = $pconfig["realtime2"];
+ $realtime3 = $pconfig["realtime3"];
+ $linkshare = $pconfig["linkshare"];
+ $linkshare1 = $pconfig["linkshare1"];
+ $linkshare2 = $pconfig["linkshare2"];
+ $linkshare3 = $pconfig["linkshare3"];
+ $parentqueue = $pconfig["parentqueue"];
+ $defaultqueue = $pconfig["defaultqueue"];
+ $parent = $pconfig["parent"];
$schedulertype = $pconfig["schedulertype"];
?>
<p class="pgtitle">Firewall: Traffic shaper: Edit queue</p>
@@ -259,22 +174,16 @@ function sync_scheduler_options() {
<form action="firewall_shaper_queues_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td valign="top" class="vncellreq">Associate with rule</td>
+ <td valign="top" class="vncellreq">Scheduler Type</td>
<td class="vtable">
- <select name="associatedrule" onChange="sync_scheduler_options();">
<?php
- if($pconfig['options']['associatedrule']) {
- echo "<option value=\"" . $pconfig['options']['associatedrule'] ."\">" . filter_get_rule_interface($pconfig['options']['associatedrule']) . " - " . filter_get_altq_queue_scheduler_type($pconfig['options']['associatedrule']) . " - " . $pconfig['options']['associatedrule'] . "</option>";
- }
- foreach ($config['filter']['rule'] as $rule) {
- echo "<option value=\"" . $rule['descr'] ."\">" . $rule['interface'] . " - " . filter_get_altq_queue_scheduler_type($rule['descr']) . " - " . $rule['descr'] . "</option>";
- }
+ if($schedulertype == "hfsc") echo "Hierarchical Fair Service Curve queueing";
+ else if($schedulertype == "priq") echo "Priority based queueing";
+ else if($schedulertype == "cbq") echo "Class based queueing";
?>
- </select>
- <br>
- <span class="vexpl">Choose which rule to attach this queue to.
- </span></td>
+ </td>
</tr>
+ <?php if ($schedulertype == "cbq"): ?>
<tr>
<td valign="top" class="vncellreq">Bandwidth</td>
<td class="vtable"> <input name="bandwidth" class="formfld" value="<?=htmlspecialchars($pconfig['bandwidth']);?>">
@@ -290,6 +199,7 @@ function sync_scheduler_options() {
<span class="vexpl">Choose the amount of bandwidth for this queue
</span></td>
</tr>
+ <? endif; ?>
<tr>
<td width="22%" valign="top" class="vncellreq">Priority</td>
<td width="78%" class="vtable"> <input name="priority" type="text" id="priority" size="5" value="<?=htmlspecialchars($pconfig['priority']);?>">
@@ -299,18 +209,31 @@ function sync_scheduler_options() {
<tr>
<td width="22%" valign="top" class="vncell"><b>Name</b></td>
<td width="78%" class="vtable"> <input name="name" type="text" class="formfld" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>">
- <br> <span class="vexpl">Enter the name of the queue here. Do not use spaces!
+ <br> <span class="vexpl">Enter the name of the queue here. Do not use spaces and limit the size to 15 characters.
</span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Scheduler options</td>
<td width="78%" class="vtable">
+ <?php
+ $isdefaultdefined = 0;
+ foreach($config['shaper'] as $queue) {
+ if(isset($queue["defaultqueue"])) $isdefaultdefined = 1;
+ }
+ ?>
+ <?php if ($isdefaultdefined == 0): ?>
<input type="checkbox" id="defaultqueue" name="defaultqueue" <?php if($defaultqueue) echo " CHECKED";?> > Default queue<br>
+ <? endif; ?>
+ <?php if ($schedulertype == "cbq"): ?>
<input type="checkbox" id="borrow" name="borrow" <?php if($borrow) echo " CHECKED";?> > Borrow from other queues when available<br>
+ <? endif; ?>
<input type="checkbox" id="red" name="red" <?php if($red) echo " CHECKED";?> > Random Early Detection<br>
<input type="checkbox" id="rio" name="rio" <?php if($rio) echo " CHECKED";?> > Random Early Detection In and Out<br>
<input type="checkbox" id="ecn" name="ecn" <?php if($ecn) echo " CHECKED";?> > Explicit Congestion Notification<br>
+ <?php if ($schedulertype == "hfsc" or $schedulertype == "cbq"): ?>
<input type="checkbox" id="parentqueue" name="parentqueue" <?php if($parentqueue) echo " CHECKED";?> > This is a parent queue of HFSC/CBQ<br>
+ <?php endif; ?>
+ <?php if ($schedulertype == "hfsc"): ?>
<input type="checkbox" id="upperlimit" name="upperlimit" <?php if($upperlimit) echo " CHECKED";?> > Upperlimit: <input size="3" value="<?=htmlspecialchars($upperlimit1);?>" name="upperlimit1"> <input size="3" value="<?=htmlspecialchars($upperlimit2);?>" name="upperlimit2"> <input size="3" value="<?=htmlspecialchars($upperlimit3);?>" name="upperlimit3"> <br>
<input type="checkbox" id="realtime" name="realtime" <?php if($realtime) echo " CHECKED";?> > Real time: <input size="3" value="<?=htmlspecialchars($realtime1);?>" name="realtime1"> <input size="3" value="<?=htmlspecialchars($realtime2); ?>" name="realtime2"> <input size="3" value="<?=htmlspecialchars($realtime3);?>" name="realtime3"><br>
<input type="checkbox" id="linkshare" id="linkshare" name="linkshare" <?php if($linkshare) echo " CHECKED";?> > Link share: <input size="3" value="<?=htmlspecialchars($linkshare1);?>" value="<?=htmlspecialchars($linkshare1);?>" id="linkshare1" name="linkshare1"> <input size="3" value="<?=htmlspecialchars($linkshare2);?>" id="linkshare2" name="linkshare2"> <input size="3" value="<?=htmlspecialchars($linkshare3);?>" id="linkshare3" name="linkshare3"><br>
@@ -322,12 +245,12 @@ function sync_scheduler_options() {
<td width="78%" class="vtable">
<select id="childqueue" name="childqueue">
<?php
- if(isset($pconfig['pfqueueing']['childqueue']))
- echo "<option value=\"" . $pconfig['pfqueueing']['childqueue'] . "\">" . $pconfig['pfqueueing']['childqueue'] . "</option>";
+ if(isset($pconfig['shaper']['childqueue']))
+ echo "<option value=\"" . $pconfig['shaper']['childqueue'] . "\">" . $pconfig['shaper']['childqueue'] . "</option>";
else
echo "<option value=\"\"></option>";
- if (is_array($config['pfqueueing']['queue'])) {
- foreach ($config['pfqueueing']['queue'] as $queue) {
+ if (is_array($config['shaper']['queue'])) {
+ foreach ($config['shaper']['queue'] as $queue) {
if(is_subqueue($queue['name']) == 0)
echo "<option value=\"" . $queue['name'] . "\">" . $queue['name'] . "</option>";
}
@@ -336,6 +259,7 @@ function sync_scheduler_options() {
</select>
</td>
</tr>
+ <?php endif; ?>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%"> <input name="Submit" type="submit" class="formbtn" value="Save">
@@ -347,8 +271,5 @@ function sync_scheduler_options() {
</table>
</form>
<?php include("fend.inc"); ?>
-<script language="JavaScript">
-sync_scheduler_options();
-</script>
</body>
</html>
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php
index ea1baf3..bdbac0a 100755
--- a/usr/local/www/system_advanced.php
+++ b/usr/local/www/system_advanced.php
@@ -90,7 +90,7 @@ if ($_POST) {
$config['system']['disableconsolemenu'] = $_POST['disableconsolemenu'] ? true : false;
$config['system']['disablefirmwarecheck'] = $_POST['disablefirmwarecheck'] ? true : false;
$config['system']['webgui']['expanddiags'] = $_POST['expanddiags'] ? true : false;
- $config['system']['schedulertype'] = $_POST['schedulertype'];
+
if ($g['platform'] == "generic-pc") {
$oldharddiskstandby = $config['system']['harddiskstandby'];
$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
@@ -98,6 +98,8 @@ if ($_POST) {
$config['system']['webgui']['noantilockout'] = $_POST['noantilockout'] ? true : false;
$config['filter']['tcpidletimeout'] = $_POST['tcpidletimeout'];
+ $config['system']['schedulertype'] = $_POST['schedulertype'];
+
write_config();
if (($config['system']['webgui']['certificate'] != $oldcert)
@@ -201,11 +203,11 @@ function enable_change(enable_over) {
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
</td>
- </tr>
+ </tr>
<tr>
<td colspan="2" class="list" height="12"></td>
</tr>
-
+
<tr>
<td colspan="2" valign="top" class="listtopic">Disable Firewalling</td>
</tr>
OpenPOWER on IntegriCloud