From e295675f8ff89e9555722b8825282972e1a72e74 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 26 Feb 2006 00:27:08 +0000 Subject: MFC Shaper fixes from BillM --- usr/local/www/firewall_shaper.php | 3 +- usr/local/www/firewall_shaper_edit.php | 30 +++- usr/local/www/firewall_shaper_queues_edit.php | 93 ++++++++-- usr/local/www/wizards/traffic_shaper_wizard.xml | 219 +++++------------------- 4 files changed, 153 insertions(+), 192 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php index 6c14c8f..60e8363 100755 --- a/usr/local/www/firewall_shaper.php +++ b/usr/local/www/firewall_shaper.php @@ -259,7 +259,8 @@ include("head.inc"); $iflabels = array('lan' => 'LAN', 'wan' => 'WAN', 'pptp' => 'PPTP'); for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) $iflabels['opt' . $j] = $config['interfaces']['opt' . $j]['descr']; - echo $textss . htmlspecialchars($iflabels[$shaperent['interface']]); + echo $textss . htmlspecialchars($iflabels[$shaperent['in-interface']]) . "->" . htmlspecialchars($iflabels[$shaperent['out-interface']]); + echo "
"; echo ""; if ($shaperent['direction'] == "in") diff --git a/usr/local/www/firewall_shaper_edit.php b/usr/local/www/firewall_shaper_edit.php index 2fbd8a1..9fb0777 100755 --- a/usr/local/www/firewall_shaper_edit.php +++ b/usr/local/www/firewall_shaper_edit.php @@ -60,7 +60,8 @@ if (isset($_GET['dup'])) { } if (isset($id) && $a_shaper[$id]) { - $pconfig['interface'] = $a_shaper[$id]['interface']; + $pconfig['in-interface'] = $a_shaper[$id]['in-interface']; + $pconfig['out-interface'] = $a_shaper[$id]['out-interface']; if (isset($a_shaper[$id]['protocol'])) $pconfig['proto'] = $a_shaper[$id]['protocol']; @@ -245,7 +246,8 @@ if ($_POST) { if (!$input_errors) { $shaperent = array(); - $shaperent['interface'] = $_POST['interface']; + $shaperent['in-interface'] = $_POST['in-interface']; + $shaperent['out-interface'] = $_POST['out-interface']; if ($_POST['proto'] != "any") $shaperent['protocol'] = $_POST['proto']; @@ -433,20 +435,34 @@ function dst_rep_change() { Set this option to disable this rule without removing it from the list. - Interface - 'LAN', 'wan' => 'WAN', 'pptp' => 'PPTP'); for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr']; } foreach ($interfaces as $iface => $ifacename): ?> -
- Choose which interface packets must pass - through to match this rule. + Choose which interface packets must pass in to match this rule. + + + Out Interface +
+ Choose which interface packets must pass out to match this rule. Protocol diff --git a/usr/local/www/firewall_shaper_queues_edit.php b/usr/local/www/firewall_shaper_queues_edit.php index 301d048..5e82456 100755 --- a/usr/local/www/firewall_shaper_queues_edit.php +++ b/usr/local/www/firewall_shaper_queues_edit.php @@ -105,6 +105,28 @@ if ($_POST) { $input_errors[] = "The priority must be an integer between 1 and 100."; } + switch($config['shaper']['schedulertype']) { + case 'hfsc': + /* HFSC validation */ + if ($_POST['upperlimit1'] <> "" && $_POST['upperlimit2'] == "") + $input_errors[] = "upperlimit service curve defined but missing burst (d) value"; + if ($_POST['upperlimit2'] <> "" && $_POST['upperlimit1'] == "") + $input_errors[] = "upperlimit service curve defined but missing initial bandwidth (m1) value"; + if ($_POST['linkshare1'] <> "" && $_POST['linkshare2'] == "") + $input_errors[] = "linkshare service curve defined but missing burst (d) value"; + if ($_POST['linkshare2'] <> "" && $_POST['linkshare1'] == "") + $input_errors[] = "linkshare service curve defined but missing initial bandwidth (m1) value"; + if ($_POST['realtime1'] <> "" && $_POST['realtime2'] == "") + $input_errors[] = "realtime service curve defined but missing burst (d) value"; + if ($_POST['realtime2'] <> "" && $_POST['realtime1'] == "") + $input_errors[] = "realtime service curve defined but missing initial bandwidth (m1) value"; + break; + case 'cbq': + break; + case 'priq': + break; + } + if (!$input_errors) { $queue = array(); $queue['schedulertype'] = $_POST['schedulertype']; @@ -115,8 +137,7 @@ if ($_POST) { if($_POST['bandwidthtype'] == "") unset($queue['bandwidth']); $queue['priority'] = $_POST['priority']; - $queue['name'] = ereg_replace(" ", "", $_POST['name']); - $queue['name'] = substr($queue['name'], 0, 15); + $queue['name'] = substr(ereg_replace(" ", "", $_POST['name']), 0, 15); $queue['borrow'] = $_POST['borrow']; $queue['linkshare'] = $_POST['linkshare']; $queue['linkshare3'] = $_POST['linkshare3']; @@ -189,6 +210,52 @@ include("head.inc"); ?> + +

@@ -229,7 +296,7 @@ include("head.inc"); - Name + Name
Enter the name of the queue here. Do not use spaces and limit the size to 15 characters. @@ -246,20 +313,20 @@ include("head.inc"); >
Random Early Detection In and Out
> Explicit Congestion Notification
- > This is a parent queue
+ onChange="enable_attachtoqueue()" > This is a parent queue

Select options for this queue - Service Curve (sc) + Service Curve (sc) - - - - + + + +
 
m1
d
m2
> Upperlimit:The maximum allowed bandwidth for the queue.
> Real time:The minimum required bandwidth for the queue.
> Link share:The bandwidth share of a backlogged queue.
 
m1
d
m2
onChange="enable_upperlimit()"> Upperlimit:The maximum allowed bandwidth for the queue.
onChange="enable_realtime()"> Real time:The minimum required bandwidth for the queue.
onChange="enable_linkshare()"> Link share:The bandwidth share of a backlogged queue - this overrides priority.

The format for service curve specifications is (m1, d, m2). m2 controls the bandwidth assigned to the queue. m1 and d are optional and can be @@ -273,7 +340,7 @@ include("head.inc"); - Parent queue: + Parent queue: