#!/usr/local/bin/php . All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ require("guiconfig.inc"); $a_queues = &$config['shaper']['queue']; $id = $_GET['id']; if (isset($_POST['id'])) $id = $_POST['id']; $pconfig['schedulertype'] = $config['system']['schedulertype']; $schedulertype = $config['system']['schedulertype']; if (isset($id)) { if (!is_numeric($id)) { $i = 0; foreach($config['shaper']['queue'] as $queue) { if ($queue['name'] == $id) { $id = $i; break; } else $i++; } } if ($a_queues[$id]) { $pconfig['priority'] = $a_queues[$id]['priority']; $pconfig['mask'] = $a_queues[$id]['mask']; $pconfig['name'] = $a_queues[$id]['name']; $pconfig = $a_queues[$id]; $pconfig['ack'] = $a_queues[$id]['ack']; $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']; $pconfig['attachtoqueue'] = $a_queues[$id]['attachtoqueue']; } } if ($_POST) { unset($input_errors); $pconfig = $_POST; /* input validation */ //$reqdfields = explode(" ", "priority"); //$reqdfieldsn = explode(",", "Priority"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if ($_POST['priority'] && (!is_numericint($_POST['priority']) || ($_POST['priority'] < 1) || ($_POST['priority'] > 100))) { $input_errors[] = "The priority must be an integer between 1 and 100."; } if (!$input_errors) { $queue = array(); $queue['schedulertype'] = $_POST['schedulertype']; $queue['bandwidth'] = $_POST['bandwidth']; $queue['bandwidthtype'] = $_POST['bandwidthtype']; if($_POST['bandwidth'] == "") unset($queue['bandwidthtype']); if($_POST['bandwidthtype'] == "") unset($queue['bandwidth']); $queue['priority'] = $_POST['priority']; $queue['name'] = ereg_replace(" ", "", $_POST['name']); $queue['name'] = substr($queue['name'], 0, 15); $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['attachtoqueue'] = $_POST['attachtoqueue']; $queue['associatedrule'] = $_POST['associatedrule']; $scheduleroptions=""; $queue['ack'] = $_POST['ack']; $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 $a_queues[] = $queue; write_config(); foreach($config['filter']['rule'] as $rule) { if($rule['descr'] == $_POST['associatedrule']) { $rule['queue'] = $_POST['associatedrule']; } } write_config(); touch($d_shaperconfdirty_path); header("Location: firewall_shaper_queues.php"); exit; } } $ack = $pconfig["ack"]; $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"]; $attachtoqueue = $pconfig['attachtoqueue']; $parent = $pconfig["parent"]; $pgtitle = "Firewall: Shaper: Queues: Edit"; include("head.inc"); ?>

Scheduler Type Priority based queueing"; else if($schedulertype == "cbq") echo "Class based queueing"; ?>
Bandwidth
Choose the amount of bandwidth for this queue
Priority
The priority of the queue. For class based queueing the priority range is 0 to 7 and for priority based queueing the range is 0 to 15. Priority 0 is the lowest priority. When not specified, a default of 1 is used.
Name
Enter the name of the queue here. Do not use spaces and limit the size to 15 characters.
Scheduler options > Default queue
> Borrow from other queues when available
> ACK/low-delay queue. At least one queue per interface should have this checked.
> Random Early Detection
> Random Early Detection In and Out
> Explicit Congestion Notification
> This is a parent queue of HFSC/CBQ
> Upperlimit:
> Real time:
> Link share:

Select options for this queue
Parent queue (CBQ or HFSC only):