#!/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. */ $pgtitle = array("Firewall", "Traffic shaper", "Edit queue"); require("guiconfig.inc"); $a_queues = &$config['shaper']['queue']; $id = $_GET['id']; if (isset($_POST['id'])) $id = $_POST['id']; if (isset($id) && $a_queues[$id]) { $pconfig['targetpipe'] = $a_queues[$id]['targetpipe']; $pconfig['weight'] = $a_queues[$id]['weight']; $pconfig['mask'] = $a_queues[$id]['mask']; $pconfig['descr'] = $a_queues[$id]['descr']; } if ($_POST) { unset($input_errors); $pconfig = $_POST; /* input validation */ $reqdfields = explode(" ", "weight"); $reqdfieldsn = explode(",", "Weight"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if ($_POST['weight'] && (!is_numericint($_POST['weight']) || ($_POST['weight'] < 1) || ($_POST['weight'] > 100))) { $input_errors[] = "The weight must be an integer between 1 and 100."; } if (!$input_errors) { $queue = array(); $queue['targetpipe'] = $_POST['targetpipe']; $queue['weight'] = $_POST['weight']; if ($_POST['mask']) $queue['mask'] = $_POST['mask']; $queue['descr'] = $_POST['descr']; if (isset($id) && $a_queues[$id]) { // Scheduler: update matching jobs croen_update_job('shaper-set_queue_weight', $a_queues[$id]['descr'], ($queue['descr'] != '' ? $queue['descr'] : FALSE)); $a_queues[$id] = $queue; } else $a_queues[] = $queue; write_config(); touch($d_shaperconfdirty_path); header("Location: firewall_shaper_queues.php"); exit; } } ?> 0)): ?>
Pipe
Choose the pipe that this queue is linked to.
Weight
Valid range: 1..100.
All backlogged (i.e., with packets queued) queues linked to the same pipe share the pipe's bandwidth proportionally to their weights (higher weight = higher share of bandwidth). Note that weights are not priorities; a queue with a lower weight is still guaranteed to get its fraction of the bandwidth even if a queue with a higher weight is permanently backlogged.
Mask
If 'source' or 'destination' is chosen, a dynamic queue associated with the pipe and with the weight given above will be created for each source/destination IP address encountered, respectively.
Description
You may enter a description here for your reference (not parsed).
 

You need to create a pipe before you can add a new queue.