diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-07-24 17:12:24 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-07-24 18:28:00 -0300 |
commit | c1d09bfe11ec41b4e1700c49a5b6f1e0eb6c0b10 (patch) | |
tree | 0dac390a92a1e392e014d85711779fa63d5223b6 /usr/local/www/wizards | |
parent | 71802285e56dfed514be715b4ab2d01a0b4363b8 (diff) | |
download | pfsense-c1d09bfe11ec41b4e1700c49a5b6f1e0eb6c0b10.zip pfsense-c1d09bfe11ec41b4e1700c49a5b6f1e0eb6c0b10.tar.gz |
Remove 'multi lan/single wan' and 'multi wan/single lan' traffic shaper wizards, multi lan/wan can be used to replace any of them
Diffstat (limited to 'usr/local/www/wizards')
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard.inc | 1553 | ||||
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard.xml | 1326 | ||||
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc | 1416 | ||||
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml | 1390 |
4 files changed, 0 insertions, 5685 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc deleted file mode 100644 index beb2219..0000000 --- a/usr/local/www/wizards/traffic_shaper_wizard.inc +++ /dev/null @@ -1,1553 +0,0 @@ -<?php -/* - traffic_shaper_wizard.inc - part of pfSense (https://www.pfsense.org/) - - Copyright (C) 2006 Bill Marquette - bill.marquette@gmail.com. - Copyright (C) 2006 Scott Ullrich - sullrich@pfsense.com. - Copyright (C) 2008-2010 Ermal Luçi - 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. -*/ - -function step1_submitphpaction() { - global $stepid, $savemsg; - - if (!isset($_POST['numberofconnections'])) { - $savemsg=gettext("You need to specify the number of connections."); - $stepid--; - return; - } - if (intval($_POST['numberofconnections']) < 1) { - $savemsg=gettext("The number of connections should be greater than 1."); - $stepid--; - return; - } -} - -function step2_stepbeforeformdisplay() { - global $config, $pkg; - global $stepid, $savemsg; - - $numberofinterfaces = 0; - $iflist = array(); - $iflisttmp = get_configured_interface_with_descr(); - foreach ($iflisttmp as $if => $ifdesc) { - if (!is_altq_capable(get_real_interface($if))) - continue; - $numberofinterfaces++; - $iflist[$if] = $ifdesc; - } - $numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']); - if ($numberofconnections > $numberofinterfaces) { - $savemsg=gettext("You have less interfaces than number of connections!"); - $stepid--; - return; - } - - $cfgname = "traffic_shaper_wizard.xml"; - - $fields =& $pkg['step'][1]['fields']['field']; - - /* - unset($config['ezshaper']['step2']); - $config['ezshaper']['step2'] = array(); - write_config(); - */ - $fields = array(); - - $field = array(); - $field['name'] = "Setup LAN scheduler"; - $field['type'] = "listtopic"; - $fields[] = $field; - $field = array(); - $field['displayname'] = "Download Scheduler"; - $field['name'] = "downloadscheduler"; - $field['type'] = "select"; - $field['typehint'] = "Queueing discipline to apply on the download of this connection."; - $field['options']['option'] = array(); - $opts = array(); - $opts['name'] = "HFSC"; - $opts['value'] = "HFSC"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "CBQ"; - $opts['value'] = "CBQ"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "PRIQ"; - $opts['value'] = "PRIQ"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->downloadscheduler"; - $fields[] = $field; - - for ($i = 0; $i < $numberofconnections; $i++) { - $field = array(); - $interface_friendly = $i+1; - $field['name'] = "Setup connection speed and scheduler information for WAN #{$interface_friendly}"; - $field['type'] = "listtopic"; - $fields[] = $field; - - $field = array(); - $field['displayname'] = "Interface"; - $field['name'] = "conn{$i}interface"; - $field['type'] = "select"; - $field['typehint'] = "Interface of connection."; - $field['options']['option'] = array(); - foreach ($iflist as $ifname => $ifdescr) { - $opts = array(); - $opts['displayname'] = $ifdescr; - $opts['name'] = $ifname; - $opts['value'] = $ifname; - $field['options']['option'][] = $opts; - } - $field['bindstofield'] = "ezshaper->step2->conn{$i}interface"; - $fields[] = $field; - - $field = array(); - $field['displayname'] = "Upload Scheduler"; - $field['name'] = "conn{$i}uploadscheduler"; - $field['type'] = "select"; - $field['typehint'] = "Queueing discipline to apply on the upload of this connection."; - $field['options']['option'] = array(); - $opts = array(); - $opts['name'] = "HFSC"; - $opts['value'] = "HFSC"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "CBQ"; - $opts['value'] = "CBQ"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "PRIQ"; - $opts['value'] = "PRIQ"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->conn{$i}uploadscheduler"; - $fields[] = $field; - - $field = array(); - $field['displayname'] = "Connection Upload"; - $field['name'] = "conn{$i}upload"; - $field['type'] = "input"; - $field['bindstofield'] = "ezshaper->step2->conn{$i}upload"; - $field['combinefieldsbegin'] = "true"; - $fields[] = $field; - - $field = array(); - $field['combinefieldsend'] = "true"; - $field['dontdisplayname'] = "true"; - $field['dontcombinecells'] = "true"; - $field['name'] = "conn{$i}uploadspeed"; - $field['typehint'] = "Upload bandwidth on this connection."; - $field['type'] = "select"; - $field['options']['option'] = array(); - $opts = array(); - $opts['value'] = "Kb"; - $opts['name'] = "Kbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Mb"; - $opts['name'] = "Mbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Gb"; - $opts['name'] = "Gbit/s"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->conn{$i}uploadspeed"; - $fields[] = $field; - - $field = array(); - $field['displayname'] = "Connection Download"; - $field['name'] = "conn{$i}download"; - $field['type'] = "input"; - $field['bindstofield'] = "ezshaper->step2->conn{$i}download"; - $field['combinefieldsbegin'] = "true"; - $fields[] = $field; - - $field = array(); - $field['combinefieldsend'] = "true"; - $field['dontdisplayname'] = "true"; - $field['dontcombinecells'] = "true"; - $field['name'] = "conn{$i}downloadspeed"; - $field['typehint'] = "Download bandwidth on this connection."; - $field['type'] = "select"; - $field['options']['option'] = array(); - $opts = array(); - $opts['value'] = "Kb"; - $opts['name'] = "Kbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Mb"; - $opts['name'] = "Mbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Gb"; - $opts['name'] = "Gbit/s"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->conn{$i}downloadspeed"; - $fields[] = $field; - } - $field = array(); - $field['name'] = "Next"; - $field['type'] = "submit"; - $fields[] = $field; -} - -function step2_stepsubmitphpaction() { - global $config; - global $stepid, $savemsg; - $sumdownloads = 0; - - /* Input Validation */ - $steps = intval($config['ezshaper']['step1']['numberofconnections']); - for ($i = 0; $i < $steps; $i++) { - for ($j = $i + 1; $j <= $steps; $j++) { - $wannum = $i+1; - if ($_POST["conn{$i}interface"] == $_POST["conn{$j}interface"]) { - $savemsg=gettext("You cannot select the same interface for WAN# {$wannum} and WAN #{$j}."); - $stepid--; - return; - } - if (!is_numeric($_POST["conn{$i}upload"])) { - $savemsg = gettext("WAN #{$wannum}: Upload bandwidth is not valid."); - $stepid--; - return; - } - if (!is_numeric($_POST["conn{$i}download"])) { - $savemsg = gettext("WAN #{$wannum}: Download bandwidth is not valid."); - $stepid--; - return; - } - $upbw = $_POST["conn{$i}upload"]; - $downbw = $_POST["conn{$i}download"]; - if ($upbw < 1 || $downbw < 1) { - $savemsg = gettext("WAN #{$wannum}: You cannot specify bandwidth less then 1!"); - $stepid--; - return; - } - if ($upbw < 128 && $_POST["conn{$i}uploadspeed"] == "Kb" && trim($_POST["conn{$i}scheduler"]) == "CBQ") { - $savemsg=gettext("WAN #{$wannum}: We do not support Bandwidths smaller than 128Kbit/s for CBQ scheduler."); - $stepid--; - return; - } - if ($downbw < 128 && $_POST["conn{$i}downloadspeed"] == "Kb" && trim($_POST["downloadscheduler"]) == "CBQ") { - $savemsg=gettext("WAN #{$wannum}: We do not support Bandwidths smaller than 128Kbit/s for CBQ scheduler."); - $stepid--; - return; - } - - } - } - /* This is necessary since the wizard expects predefined fields. */ - unset($config['ezshaper']['step2']); - $config['ezshaper']['step2'] = array(); - - $config['ezshaper']['step2']['downloadscheduler'] = $_POST['downloadscheduler']; - for ($i = 0; $i < $steps; $i++) { - $config['ezshaper']['step2']["conn{$i}uploadscheduler"] = $_POST["conn{$i}uploadscheduler"]; - $config['ezshaper']['step2']["conn{$i}upload"] = $_POST["conn{$i}upload"]; - $config['ezshaper']['step2']["conn{$i}uploadspeed"] = $_POST["conn{$i}uploadspeed"]; - $config['ezshaper']['step2']["conn{$i}download"] = $_POST["conn{$i}download"]; - $config['ezshaper']['step2']["conn{$i}downloadspeed"] = $_POST["conn{$i}downloadspeed"]; - $config['ezshaper']['step2']["conn${i}interface"] = $_POST["conn{$i}interface"]; - } -} - -function step3_stepbeforeformdisplay() { - global $config, $pkg; - global $stepid, $savemsg; - - $cfgname = "traffic_shaper_wizard.xml"; - - $numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']); - - $fields =& $pkg['step'][1]['fields']['field']; - - $voipfields =& $pkg['step'][2]['fields']['field']; - - $voipfields = array(); - $enablefields = array(); - - $field = array(); - $field['name'] = "enable"; - $field['type'] = "checkbox"; - $field['typehint'] = "Prioritize Voice over IP traffic."; - $field['bindstofield'] = "ezshaper->step3->enable"; - $field['descritpion'] = "This will raise the priority of VOIP traffic above all other traffic."; - $voipfields[] = $field; - - $field = array(); - $field['name'] = "Next"; - $field['type'] = "submit"; - $voipfields[] = $field; - - $field = array(); - $field['name'] = "VOIP specific settings"; - $field['type'] = "listtopic"; - $voipfields[] = $field; - - $field = array(); - $field['name'] = "Provider"; - $enablefields[] = "Provider"; - $field['type'] = "select"; - $field['description'] = "Choose Generic if your provider isn't listed."; - $field['options']['option'] = array(); - $opts = array(); - $opts['name'] = "Generic (lowdelay)"; - $opts['value'] = "Generic"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "VoicePulse"; - $opts['value'] = "VoicePulse"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "Asterisk/Vonage"; - $opts['value'] = "Asterisk"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "PanasonicTDA"; - $opts['value'] = "Panasonic"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step3->provider"; - $voipfields[] = $field; - - $field = array(); - $field['name'] = "Upstream SIP Server"; - $enablefields[] = "Upstream SIP Server"; - $field['type'] = "inputalias"; - $field['description'] = "(Optional) If this is chosen, the provider field will be overridden. This allows you to provide the IP address of the <strong>remote</strong> PBX or SIP Trunk to prioritize. <br />NOTE: You can also use a Firewall Alias in this location."; - $field['message'] = "IP Address field is non-blank and doesn't look like an IP address."; - $field['bindstofield'] = "ezshaper->step3->address"; - $voipfields[] = $field; - - $field = array(); - $interface_friendly = $i+1; - $field['name'] = "Upload bandwidth for each WAN(interface)"; - $field['type'] = "listtopic"; - $voipfields[] = $field; - - for ($i = 0; $i < $numberofconnections; $i++) { - $field = array(); - $wannum = $i+1; - $field['displayname'] = "WAN #{$wannum} upload"; - $field['name'] = "conn{$i}upload"; - $enablefields[] = "conn{$i}upload"; - $field['type'] = "input"; - $field['bindstofield'] = "ezshaper->step3->conn{$i}upload"; - $field['combinefieldsbegin'] = "true"; - $voipfields[] = $field; - - $field = array(); - $field['combinefieldsend'] = "true"; - $field['dontdisplayname'] = "true"; - $field['dontcombinecells'] = "true"; - $field['name'] = "conn{$i}uploadspeed"; - $enablefields[] = "conn{$i}uploadspeed"; - $friendly_interface = $i+1; - $field['typehint'] = "Upload bandwidth guarantee for VOIP phone(s) on connection #{$friendly_interface}."; - $field['type'] = "select"; - $field['options']['option'] = array(); - $opts = array(); - $opts['value'] = "Kb"; - $opts['name'] = "Kbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Mb"; - $opts['name'] = "Mbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Gb"; - $opts['name'] = "Gbit/s"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step3->conn{$i}uploadspeed"; - $voipfields[] = $field; - } - - $field = array(); - $interface_friendly = $i+1; - $field['name'] = "Download bandwidth(speed) for Voice over IP phones"; - $field['type'] = "listtopic"; - $voipfields[] = $field; - - $field = array(); - $field['name'] = "download"; - $field['displayname'] = "LAN download"; - $enablefields[] = "download"; - $field['type'] = "input"; - $field['bindstofield'] = "ezshaper->step3->download"; - $field['combinefieldsbegin'] = "true"; - $voipfields[] = $field; - - $field = array(); - $field['combinefieldsend'] = "true"; - $field['dontdisplayname'] = "true"; - $field['dontcombinecells'] = "true"; - $field['name'] = "downloadspeed"; - $enablefields[] = "downloadspeed"; - $field['typehint'] = "Download bandwidth guarantee for VOIP phone(s) on connections."; - $field['type'] = "select"; - $field['options']['option'] = array(); - $opts = array(); - $opts['value'] = "Kb"; - $opts['name'] = "Kbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Mb"; - $opts['name'] = "Mbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Gb"; - $opts['name'] = "Gbit/s"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step3->downloadspeed"; - $voipfields[] = $field; - - $field = array(); - $field['name'] = "Next"; - $field['type'] = "submit"; - $voipfields[] = $field; - - $voipfields[0]['enablefields'] = implode(",", $enablefields); -} - -function step3_stepsubmitphpaction() { - global $config; - global $stepid, $savemsg; - - if (!$_POST['enable']) - return; - - if($_POST['address']) { - if(!is_ipaddroralias($_POST['address'])) { - /* item is not an ip or alias. error out */ - $savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); - $stepid--; - return; - } - } - - $steps = intval($config['ezshaper']['step1']['numberofconnections']); - for ($i = 0; $i < $steps; $i++) { - if (!is_numeric($_POST["conn{$i}upload"])) { - $wannum = $i + 1; - $savemsg = gettext("Upload bandwidth of WAN #{$wannum} is not valid."); - $stepid--; - return; - } - if ($_POST["conn{$i}uploadspeed"] == "%") { - if (intval($_POST["conn{$i}upload"]) > 80) { - $friendly_interface = $i+1; - $savemsg=gettext("You cannot set the VoIP upload bandwidth on WAN #{$friendly_interface} higher than 80% of the connection."); - $stepid--; - return; - } - } else { - $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); - $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}upload"]); - $factor = wizard_get_bandwidthtype_scale($_POST["conn{$i}uploadspeed"]); - $input_bw = $factor * floatval($_POST["conn{$i}upload"]); - if ((0.8 * $ifbw) < $input_bw) { - $friendly_interface = $i+1; - $savemsg=gettext("You cannot set the VoIP upload bandwidth on WAN #{$friendly_interface} higher than 80% of the connection."); - $stepid--; - return; - } - } - } - - $config['ezshaper']['step3']['download'] = $_POST['download']; - $config['ezshaper']['step3']['downloadspeed'] = $_POST['downloadspeed']; - for ($i = 0; $i < $steps; $i++) { - $config['ezshaper']['step3']["conn{$i}upload"] = $_POST["conn{$i}upload"]; - $config['ezshaper']['step3']["conn{$i}uploadspeed"] = $_POST["conn{$i}uploadspeed"]; - } -} - -function step4_stepsubmitphpaction() { - global $config; - global $stepid, $savemsg; - - if ( $_POST['enable'] ) { - if(!$_POST['bandwidth']) { - $savemsg="You need to specify a value for bandwidth!"; - $stepid--; - return; - } - if(!is_numeric($_POST['bandwidth'])) { - $savemsg="The posted value is not a valid bandwidth."; - $stepid--; - return; - } - - if ($_POST['bandwidthspeed'] <> "%") { - $savemsg = gettext("Only percentage bandwidth specification is allowed."); - $stepid--; - return; - } - $bw = $_POST['bandwidth']; - if($bw > 15 || $bw < 2) { - $savemsg="Values should be between 2% and 15%!"; - $stepid--; - return; - } - - if($_POST['address'] <> "" && !is_ipaddroralias($_POST['address'])) { - /* item is not an ip or alias. error out */ - $savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); - $stepid--; - } - } -} - -function step5_stepsubmitphpaction() { - global $stepid, $savemsg; - - if ( $_POST['enable'] ) { - if ($_POST['p2pcatchall']) { - if(!is_numeric($_POST['bandwidth'])) { - $savemsg="Posted value is not a valid bandwidth."; - $stepid--; - return; - } - - if ($_POST['bandwidthspeed'] <> "%") { - $savemsg = gettext("Only percentage bandwidth specification is allowed."); - $stepid--; - return; - } - $bw = $_POST['bandwidth']; - if($bw > 15 || $bw < 2) { - $savemsg="Values should be between 2% and 15%!"; - $stepid--; - return; - } - } - } -} - -function step8_stepsubmitphpaction() { - global $g, $config; - - /* save the new configuration */ - apply_all_choosen_items(); - - /* reset rrd queues */ - system("rm -f /var/db/rrd/*queuedrops.rrd"); - system("rm -f /var/db/rrd/*queues.rrd"); - enable_rrd_graphing(); - - /* apply the new configuration to the system */ - filter_configure(); - - /* And we're no longer dirty! */ - clear_subsystem_dirty('shaper'); - - update_filter_reload_status("Initializing"); - header("Location: status_filter_reload.php"); - exit; -} - -function apply_all_choosen_items() { - global $config, $g, $altq_list_queues, $gamesplist, $voiplist, $othersplist, $p2plist; - - require_once("wizardapp.inc"); - - /* - * Wipe previous config. - * Doing it here makes sense since we can wipe the previous config only after - * the user decides to do so, finishing the wizard. - */ - if(isset($config['shaper']['queue'])) - unset($config['shaper']['queue']); - /* XXX: This is redundant, because this should be handled by converter at startup. */ - if(isset($config['shaper']['rule'])) - unset($config['shaper']['rule']); - foreach ($config['filter']['rule'] as $key => $rule) - if ($rule['wizard'] == "yes") - unset($config['filter']['rule'][$key]); - - /* restart the cached config */ - unset($altq_list_queues); - $altq_list_queues = array(); - - $steps = floatval($config['ezshaper']['step1']['numberofconnections']); - $lanbw = 0; - for ($i = 0; $i < $steps; $i++) { - $down = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}downloadspeed"]); - $input_bw = floatval($config['ezshaper']['step2']["conn{$i}download"]) * $down; - $lanbw += $input_bw; - } - - $interfacelist = array(); - - for ($i = 0; $i < $steps; $i++) { - - $altq =& new altq_root_queue(); - - $tmppath = array(); - $altq->SetInterface($config['ezshaper']['step2']["conn{$i}interface"]); - $interfacelist[] = $config['ezshaper']['step2']["conn{$i}interface"]; - $altq->SetScheduler($config['ezshaper']['step2']["conn{$i}uploadscheduler"]); - $altq->SetBandwidth(floatval($config['ezshaper']['step2']["conn{$i}upload"])); - $altq->SetBwscale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); - $altq->SetEnabled("on"); - $altq_list_queues[$altq->GetQname()] =& $altq; - array_push($tmppath, $config['ezshaper']['step2']["conn{$i}interface"]); - $altq->SetLink($tmppath); - $altq->wconfig(); - - $sched = $config['ezshaper']['step2']["conn{$i}uploadscheduler"]; - $voipbw =0; - $voipbwunit = "Kb"; - $voip = false; - $penalty = false; - $penaltybw = 0; - $penaltybwunit = "Kb"; - $p2p = false; - $p2pcatchall = false; - $p2pcatchbw = 0; - $p2pcatchbwunit = "%"; - $games = false; - $otherpriority = false; - $remainbw = 0; - $upfactor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); - $upbw = floatval($config['ezshaper']['step2']["conn{$i}upload"]) * $upfactor; - - if ($config['ezshaper']['step3']['enable']) { - $voip = true; - $voipbw = floatval($config['ezshaper']['step3']["conn{$i}upload"]); - $voipbwunit = $config['ezshaper']['step3']["conn{$i}uploadspeed"]; - if ($voipbwunit == "%") - $factor = $upbw/100; - else - $factor = wizard_get_bandwidthtype_scale($voipbwunit); - $remainbw += $voipbw * $factor; - } - if ($config['ezshaper']['step4']['enable']) { - $penalty = true; - $penaltybw = $config['ezshaper']['step4']['bandwidth']; - $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; - if ($penaltybwunit == "%") - $factor = $upbw/100; - else - $factor = wizard_get_bandwidthtype_scale($penaltybwunit); - $remainbw += $penaltybw * $factor; - } else { - $penalty = false; - $penaltybw = 0; - } - if ($config['ezshaper']['step5']['enable']) { - $p2p = true; - if ($config['ezshaper']['step5']['p2pcatchall']) { - $p2pcatchall = true; - $p2pcatchbw = $config['ezshaper']['step5']['bandwidth']; - $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit']; - if ($p2pcatchbwunit == "%") - $factor = $upbw/100; - else - $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit); - $remainbw += $p2pcatchbw * $factor; - } else { - $p2pcatchall = false; - $p2pcatchbw = 0; - } - } else { - $p2p = false; - $p2pcatchall = false; - $p2pcatchbw = 0; - } - if ($config['ezshaper']['step6']['enable']) { - $games = true; - } else { - $games = false; - } - - if ($config['ezshaper']['step7']['enable']) { - $otherpriority = true; - } else { - $otherpriority = false; - } - $remainbw = round($remainbw / $upbw * 100, 2); - - if ($remainbw > 0 && $remainbw > 30) { - $savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$savemsg}"); - exit; - } else { - $remainbw = 100 - $remainbw; - } - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qACK"; - $tmpcf['priority'] = 6; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - If ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.2; - $tmpcf['bandwidthtype'] = "%"; - } - else if ($sched == "HFSC") { - $lkbw = 0.20 * $remainbw; - $tmpcf['linkshare3'] = "{$lkbw}%"; - $tmpcf['linkshare'] = "on"; - $tmpcf['bandwidth'] = $lkbw; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qACK"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qACK <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - if ($p2pcatchall) - $tmpcf['name'] = "qOthersDefault"; - else - $tmpcf['name'] = "qDefault"; - $tmpcf['priority'] = 3; - $tmpcf['enabled'] = "on"; - if (!$p2pcatchall) - $tmpcf['default'] = "on"; - $tmpcf['ecn'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, $tmpcf['name']); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qDefault <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - - if ($p2p) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qP2P"; - $tmpcf['priority'] = 1; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($p2pcatchall) { - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $p2pcatchbw; - $tmpcf['bandwidthtype'] = $p2pcatchbwunit; - } else if ($sched == "HFSC") { - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$p2pcatchbw}{$p2pcatchbwunit}"; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = "{$p2pcatchbw}{$p2pcatchbwunit}"; - $tmpcf['bandwidth'] = $p2pcatchbw; - $tmpcf['bandwidthtype'] = $p2pcatchbwunit; - } - $tmpcf['default'] = "on"; - $tmpcf['qlimit'] = 500; - } else { - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpbw = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$tmpbw}%"; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = "{$tmpbw}%"; - $tmpcf['bandwidth'] = $tmpbw; - $tmpcf['bandwidthtype'] = "%"; - } - } - array_push($tmppath, "qP2P"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qP2P <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($voip) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qVoIP"; - $tmpcf['priority'] = 7; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - if ($voipbw > 0) { - $tmpcf['bandwidth'] = $voipbw; - $tmpcf['bandwidthtype'] = $voipbwunit; - } else { - $tmpcf['bandwidth'] = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } - } else if ($sched == "HFSC") { - if ($voipbw > 0) { - $tmpcf['realtime3'] = "{$voipbw}{$voipbwunit}"; - } else { - $voipbw = $remainbw * 0.20; /* 20% bandwidth */ - $tmpcf['realtime3'] = "{$voipbw}%"; - } - $tmpcf['realtime'] = "on"; - $tmpcf['bandwidth'] = 32; - $tmpcf['bandwidthtype'] = "Kb"; - } - array_push($tmppath, "qVoIP"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qVoIP <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($games) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qGames"; - $tmpcf['priority'] = 5; - $tmpcf['enabled'] = "on"; - $tmpcf['ecn'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $gamesbw = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$gamesbw}%"; - $tmpcf['bandwidth'] = "{$gamesbw}"; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qGames"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qGames <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($otherpriority) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qOthersHigh"; - $tmpcf['priority'] = 4; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpcf['linkshare'] = "on"; - $otherbw = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['linkshare3'] = "{$otherbw}%"; - $tmpcf['bandwidth'] = $otherbw; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qOthersHigh"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qHigh <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qOthersLow"; - $tmpcf['priority'] = 2; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - if ($penalty) - $tmpcf['bandwidth'] = $penaltybw; - else - $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - if ($penalty) { - $tmpcf['linkshare3'] = "{$penaltybw}{$penaltybwunit}"; - $tmpcf['bandwidth'] = $penaltybw; - $tmpcf['bandwidthtype'] = $penaltybwunit; - } else { - $lsbw = $remainbw * 0.05; - $tmpcf['linkshare3'] = "{$lsbw}%"; /* 5% bandwidth */ - $tmpcf['bandwidth'] = $lsbw; - $tmpcf['bandwidthtype'] = "%"; - } - $tmpcf['linkshare'] = "on"; - } - array_push($tmppath, "qOthersLow"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qLow <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - array_pop($tmppath); - } - - /* LAN bandwidth ----------------------------------------------------------------------------------------- */ - - $tmppath = array(); - $altq =& new altq_root_queue(); - - $altq->SetInterface('lan'); - $altq->SetScheduler($config['ezshaper']['step2']["downloadscheduler"]); - //$altq->SetBandwidth($lanbw/1000); - //$altq->SetBwscale("Kb"); - $altq->SetEnabled("on"); - $altq_list_queues[$altq->GetQname()] =& $altq; - array_push($tmppath, 'lan'); - $altq->SetLink($tmppath); - //var_dump($input_errors); - $altq->wconfig(); - - $sched = $config['ezshaper']['step2']["downloadscheduler"]; - $voipbw =0; - $voipbwunit = "%"; - $voip = false; - $penalty = false; - $penaltybw = 0; - $penaltybwunit = "%"; - $p2p = false; - $p2pcatchall = false; - $p2pcatchbw = 0; - $games = false; - $otherpriority = false; - $remainbw = 0; - - if ($config['ezshaper']['step3']['enable']) { - $voip = true; - $voipbw = $config['ezshaper']['step3']["download"]; - $voipbwunit = $config['ezshaper']['step3']["downloadspeed"]; - if ($sched != "HFSC") { - if ($voipbwunit == "%") - $factor = $lanbw/100; - else - $factor = wizard_get_bandwidthtype_scale($voipbwunit); - $remainbw += $voipbw * $factor; - } else - $remainbw += 32000; /* 32Kbit/s forHFSC linksharing */ - } - if ($config['ezshaper']['step4']['enable']) { - $penalty = true; - $penaltybw = $config['ezshaper']['step4']['bandwidth']; - $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; - if ($penaltybwunit == "%") - $factor = $lanbw/100; - else - $factor = wizard_get_bandwidthtype_scale($penaltybwunit); - $remainbw += $penaltybw * $factor; - } else { - $penalty = false; - $penaltybw = 0; - } - if ($config['ezshaper']['step5']['enable']) { - $p2p = true; - if ($config['ezshaper']['step5']['p2pcatchall']) { - $p2pcatchall = true; - $p2pcatchbw = $config['ezshaper']['step5']['bandwidth']; - $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit']; - if ($p2pcatchbwunit == "%") - $factor = $lanbw/100; - else - $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit); - $remainbw += $p2pcatchbw * $factor; - } else { - $p2pcatchall = false; - $p2pcatchbw = 0; - } - } else { - $p2p = false; - $p2pcatchall = false; - $p2pcatchbw = 0; - } - if ($config['ezshaper']['step6']['enable']) - $games = true; - else - $games = false; - - if ($config['ezshaper']['step7']['enable']) - $otherpriority = true; - else - $otherpriority = false; - $remainbw = round($remainbw / $lanbw * 100, 2); - - if ($remainbw > 0 && $remainbw > 30) { - $savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); - header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$savemsg}"); - exit; - } else - $remainbw = 100 - $remainbw; - - if (!$p2pcatchall) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qLink"; - $tmpcf['priority'] = 2; - $tmpcf['enabled'] = "on"; - $tmpcf['default'] = "on"; - $tmpcf['qlimit'] = 500; - $tmpcf['ecn'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = 20; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpcf['bandwidth'] = 20; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, $tmpcf['name']); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qDefault <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($sched != "PRIQ") { - if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qInternet"; - //$tmpcf['priority'] = 6; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - If ($sched == "CBQ") { - $tmpcf['bandwidth'] = $lanbw/1000; - $tmpcf['bandwidthtype'] = "Kb"; - } - else if ($sched == "HFSC") { - $tmpcf['linkshare3'] = $lanbw/1000 ."Kb"; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = $lanbw/1000 ."Kb"; - $tmpcf['linkshare'] = "on"; - $tmpcf['bandwidth'] = $lanbw/1000; - $tmpcf['bandwidthtype'] = "Kb"; - } - array_push($tmppath, "qInternet"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - //array_pop($tmppath); - //echo "qInternet <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - $altq =& $qtmp; - } - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qACK"; - $tmpcf['priority'] = 6; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - If ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.2; - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $lkbw = 0.20 * $remainbw; - $tmpcf['linkshare3'] = "{$lkbw}%"; - $tmpcf['linkshare'] = "on"; - $tmpcf['bandwidth'] = $lkbw; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qACK"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qACK <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - - if ($p2p) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qP2P"; - $tmpcf['priority'] = 1; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($p2pcatchall) { - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $p2pcatchbw; - $tmpcf['bandwidthtype'] = $p2pcatchbwunit; - } else if ($sched == "HFSC") { - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$p2pcatchbw}{$p2pcatchbwunit}"; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = "{$p2pcatchbw}{$p2pcatchbwunit}"; - $tmpcf['bandwidth'] = $p2pcatchbw; - $tmpcf['bandwidthtype'] = $p2pcatchbwunit; - } - $tmpcf['default'] = "on"; - } else { - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpbw = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$tmpbw}%"; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = "{$tmpbw}%"; - $tmpcf['bandwidth'] = $tmpbw; - $tmpcf['bandwidthtype'] = "%"; - } - } - array_push($tmppath, "qP2P"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qP2P <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($voip) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qVoIP"; - $tmpcf['priority'] = 7; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - if ($voipbw > 0) { - $tmpcf['bandwidth'] = $voipbw; - $tmpcf['bandwidthtype'] = $voipbwunit; - } else { - $tmpcf['bandwidth'] = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } - } else if ($sched == "HFSC") { - if ($voipbw > 0) { - $tmpcf['realtime3'] = "{$voipbw}{$voipbwunit}"; - } else { - $voipbw = $remainbw * 0.20; /* 20% bandwidth */ - $tmpcf['realtime3'] = "{$voipbw}%"; - } - $tmpcf['realtime'] = "on"; - $tmpcf['bandwidth'] = 32; - $tmpcf['bandwidthtype'] = "Kb"; - } - array_push($tmppath, "qVoIP"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qVoIP <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($games) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qGames"; - $tmpcf['priority'] = 5; - $tmpcf['enabled'] = "on"; - $tmpcf['ecn'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $gamesbw = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$gamesbw}%"; - $tmpcf['bandwidth'] = "{$gamesbw}"; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qGames"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qGames <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($otherpriority) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qOthersHigh"; - $tmpcf['priority'] = 4; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpcf['linkshare'] = "on"; - $otherbw = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['linkshare3'] = "{$otherbw}%"; - $tmpcf['bandwidth'] = $otherbw; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qOthersHigh"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qHigh <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qOthersLow"; - $tmpcf['priority'] = 3; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - if ($penalty) - $tmpcf['bandwidth'] = $penaltybw; - else - $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - if ($penalty) { - $tmpcf['linkshare3'] = "{$penaltybw}{$penaltybwunit}"; - $tmpcf['bandwidth'] = $penaltybw; - $tmpcf['bandwidthtype'] = $penaltybwunit; - } else { - $lsbw = $remainbw * 0.05; - $tmpcf['linkshare3'] = "{$lsbw}%"; /* 5% bandwidth */ - $tmpcf['bandwidth'] = $lsbw; - $tmpcf['bandwidthtype'] = "%"; - } - $tmpcf['linkshare'] = "on"; - } - array_push($tmppath, "qOthersLow"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qLow <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - array_pop($tmppath); - - /* End LAN bandwidth ------------------------------------------------------------------------------------- */ - - if (!is_array($config['filter']['rule'])) - $config['filter']['rule'] = array(); - - if (empty($interfacelist)) - $interfacelist = ""; - else - $interfacelist = implode(",", $interfacelist); - - /* Rules */ - if ($penalty) { - if( is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = $interfacelist; - $rule['descr'] = gettext("Penalty Box"); - $rule['defaultqueue'] = "qOthersLow"; - $rule['source']['address'] = $config['ezshaper']['step4']['address']; - $rule['destination']['any'] = TRUE; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - - } - } - - /* If user specifies an IP, we don't bother with providers */ - if ($voip) { - if( is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) { - /* create VOIP rules */ - $rule = array(); - $rule['type'] = "match"; - //$rule['interface'] = $interfacelist; - $rule['descr'] = gettext("Connections From Upstream SIP Server"); - $rule['protocol'] = "udp"; - $rule['defaultqueue'] = "qVoIP"; - $rule['source']['address'] = $config['ezshaper']['step3']['address']; - $rule['destination']['any'] = TRUE; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - - $rule = array(); - $rule['type'] = "match"; - //$rule['interface'] = $interfacelist; - $rule['descr'] = gettext("Connections To Upstream SIP Server"); - $rule['protocol'] = "udp"; - $rule['defaultqueue'] = "qVoIP"; - $rule['source']['any'] = TRUE; - $rule['destination']['address'] = $config['ezshaper']['step3']['address']; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - } elseif( $config['ezshaper']['step3']['provider'] == "Generic" ) { - /* create VOIP rules */ - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = $interfacelist; - $rule['descr'] = "DiffServ/Lowdelay/Upload"; - $rule['protocol'] = "udp"; - $rule['source']['any'] = TRUE; - $rule['defaultqueue'] = "qVoIP"; - $rule['destination']['any'] = TRUE; - $rule['iptos'] = "lowdelay"; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - - } else { - /* loop through voiplist[] */ - foreach ($voiplist[$config['ezshaper']['step3']['provider']] as $voip) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = $interfacelist; - $rule['defaultqueue'] = 'qVoIP'; - $rule['source']['any'] = TRUE; - $rule['destination']['any'] = TRUE; - $rule['descr'] = "m_voip {$voip[0]} outbound"; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['destination']['port'] = $voip[2]."-".$voip[3]; - if($voip[1] != '') - $rule['protocol'] = $voip[1]; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - } - } - } - - /* loop through p2plist[] */ - if ($p2p) { - foreach($config['ezshaper']['step5'] as $key => $val) { - if (!is_array($p2plist[$key])) - continue; - foreach ($p2plist[$key] as $p2pclient) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = $interfacelist; - $rule['defaultqueue'] = 'qP2P'; - $rule['source']['any'] = TRUE; - $rule['destination']['any'] = TRUE; - $rule['descr'] = "m_P2P {$p2pclient[0]} outbound"; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['destination']['port'] = $p2pclient[2]."-".$p2pclient[3]; - if($p2pclient[1] != '') - $rule['protocol'] = $p2pclient[1]; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - } - } - } - - /* loop through gamesplist[] */ - if ($games) { - foreach($config['ezshaper']['step6'] as $key => $val) { - if (!is_array($gamesplist[$key])) - continue; - foreach ($gamesplist[$key] as $Gameclient) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = $interfacelist; - $rule['defaultqueue'] = 'qGames'; - if ($Gameclient[1] == "tcp") - $rule['ackqueue'] = 'qACK'; - $rule['source']['any'] = TRUE; - $rule['destination']['any'] = TRUE; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['descr'] = "m_Game {$Gameclient[0]} outbound"; - $rule['destination']['port'] = $Gameclient[2]."-".$Gameclient[3]; - if($Gameclient[1] != '') - $rule['protocol'] = $Gameclient[1]; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - } - } - } - - /* loop through othersplist[] */ - if ($otherpriority) { - foreach($config['ezshaper']['step7'] as $key => $val) { - if (!is_array($othersplist[$key])) - continue; - foreach ($othersplist[$key] as $otherclient) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = $interfacelist; - switch ($val) { - case "H": - $rule['defaultqueue'] = 'qOthersHigh'; /* posted value H or L */ - if ($otherclient[1] == "tcp") - $rule['ackqueue'] = 'qACK'; - $loop = 0; - break; - case "L": - $rule['defaultqueue'] = 'qOthersLow'; /* posted value H or L */ - if ($otherclient[1] == "tcp") - $rule['ackqueue'] = 'qACK'; - $loop = 0; - break; - case "D": - if ($p2pcatchall) { - $loop = 0; - $rule['defaultqueue'] = 'qOthersDefault'; - if ($otherclient[1] == "tcp") - $rule['ackqueue'] = 'qACK'; - } else - $loop = 1; /* It automitaclly goes to default queue */ - break; - default: - $loop = 1; - } - if (!$loop) { - $rule['source']['any'] = TRUE; - $rule['destination']['any'] = TRUE; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['descr'] = "m_Other {$otherclient[0]} outbound"; - - if($otherclient[2] or $otherclient[3]) { - $rule['destination']['port'] = $otherclient[2]."-".$otherclient[3]; - } - if($otherclient[1] != '') - $rule['protocol'] = $otherclient[1]; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - } - } - } - } - write_config(); -} - -function wizard_get_bandwidthtype_scale($type = "b") { - switch ($type) { - case "Gb": - $factor = 1024 * 1024 * 1024; - break; - case "Mb": - $factor = 1024 * 1024; - break; - case "Kb": - $factor = 1024; - break; - case "b": - default: - $factor = 1; - break; - } - return intval($factor); -} - -?> diff --git a/usr/local/www/wizards/traffic_shaper_wizard.xml b/usr/local/www/wizards/traffic_shaper_wizard.xml deleted file mode 100644 index 01de4da..0000000 --- a/usr/local/www/wizards/traffic_shaper_wizard.xml +++ /dev/null @@ -1,1326 +0,0 @@ -<?xml version="1.0"?> -<pfsensewizard> - <copyright><![CDATA[ - /* - traffic_shaper_wizard.xml - part of pfSense (https://www.pfsense.org/) - - Copyright (C) 2005 Bill Marquette - bill.marquette@gmail.com. - Copyright (C) 2008-2010 Ermal Luci - 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. - */]]></copyright> - <totalsteps>9</totalsteps> - <step> - <id>1</id> - <title>pfSense Traffic Shaper Wizard</title> - <disableheader>true</disableheader> - <description>This wizard will guide you through setting up the pfSense traffic shaper. - Please be aware that Custom Bandwidths should not exceed 30% of the interface/link bandwidth. Keep this in mind during the wizard. - </description> - <fields> - <field> - <displayname>Enter number of WAN connections</displayname> - <name>numberofconnections</name> - <type>input</type> - <validate>^[0-9]+$</validate> - <description>Number of connections you have</description> - <bindstofield>ezshaper->step1->numberofconnections</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <stepsubmitphpaction>step1_submitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile> - </step> - <step> - <id>2</id> - <title>pfSense Traffic Shaper Wizard</title> - <description>Shaper configuration</description> - <javascriptafterformdisplay/> - <stepbeforeformdisplay>step2_stepbeforeformdisplay();</stepbeforeformdisplay> - <stepsubmitphpaction>step2_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile> - <fields> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - </step> - <step> - <id>3</id> - <title>pfSense Traffic Shaper Wizard</title> - <description>Voice over IP</description> - <fields> - <field> - <name>Enable</name> - <type>checkbox</type> - <typehint>Prioritize Voice over IP traffic</typehint> - <description>This will raise the priority of VOIP traffic above all other traffic.</description> - <bindstofield>ezshaper->step3->enable</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>VOIP specific settings</name> - <type>listtopic</type> - </field> - <field> - <name>Provider</name> - <type>select</type> - <description>Choose Generic if your provider isn't listed.</description> - <bindstofield>ezshaper->step3->provider</bindstofield> - <options> - <option> - <name>Generic (lowdelay)</name> - <value>Generic</value> - </option> - <option> - <name>VoicePulse</name> - <value>VoicePulse</value> - </option> - <option> - <name>Asterisk/Vonage</name> - <value>Asterisk</value> - </option> - <option> - <name>PanasonicTDA</name> - <value>Panasonic</value> - </option> - </options> - </field> - <field> - <name>Upstream SIP Server</name> - <type>inputalias</type> - <description>(Optional) If this is chosen, the provider field will be overridden. This allows you to provide the IP address of the <strong>remote</strong> PBX or SIP Trunk to prioritize. <br />NOTE: You can also use a Firewall Alias in this location.</description> - <bindstofield>ezshaper->step3->address</bindstofield> - <message>IP Address field is non-blank and doesn't look like an IP address.</message> - </field> - <field> - <name>Bandwidth</name> - <type>input</type> - <validate>^[0-9]*$</validate> - <typehint>Total bandwidth in percentage(%)(should be between 5 and 40) guarantee for VOIP traffic.</typehint> - <bindstofield>ezshaper->step3->bandwidth</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <stepbeforeformdisplay>step3_stepbeforeformdisplay();</stepbeforeformdisplay> - <stepsubmitphpaction>step3_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile> - </step> - <step> - <id>4</id> - <title>pfSense Traffic Shaper Wizard</title> - <description>Penalty Box</description> - <disableallfieldsbydefault>true</disableallfieldsbydefault> - <fields> - <field> - <donotdisable>true</donotdisable> - <name>Enable</name> - <type>checkbox</type> - <typehint>Penalize IP or Alias</typehint> - <description>This will lower the priority of traffic from this IP or alias.</description> - <enablefields>address,bandwidth,bandwidthspeed</enablefields> - <bindstofield>ezshaper->step4->enable</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>PenaltyBox specific settings</name> - <type>listtopic</type> - </field> - <field> - <name>Address</name> - <type>inputalias</type> - <description>This allows you to just provide the IP address of the computer(s) to Penalize. NOTE: You can also use a Firewall Alias in this location.</description> - <bindstofield>ezshaper->step4->address</bindstofield> - <message>IP Address field is non-blank and doesn't look like an IP address.</message> - </field> - <field> - <name>Bandwidth</name> - <type>input</type> - <validate>^[0-9]*$</validate> - <message>Speed must be numerical.</message> - <bindstofield>ezshaper->step4->bandwidth</bindstofield> - <combinefieldsbegin>true</combinefieldsbegin> - </field> - <field> - <combinefieldsend>true</combinefieldsend> - <dontdisplayname>true</dontdisplayname> - <dontcombinecells>true</dontcombinecells> - <donotdisable>true</donotdisable> - <name>BandwidthSpeed</name> - <description>The limit you want to apply.</description> - <type>select</type> - <options> - <option> - <name>%</name> - <value>%</value> - </option> - <option> - <name>bit/s</name> - <value>b</value> - </option> - <option> - <name>Kilobit/s</name> - <value>Kb</value> - </option> - <option> - <name>Megabit/s</name> - <value>Mb</value> - </option> - <option> - <name>Gigabit/s</name> - <value>Gb</value> - </option> - </options> - <bindstofield>ezshaper->step4->bandwidthunit</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <stepsubmitphpaction>step4_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile> - </step> - <step> - <id>5</id> - <title>pfSense Traffic Shaper Wizard</title> - <description>Peer to Peer networking</description> - <disableallfieldsbydefault>true</disableallfieldsbydefault> - <fields> - <field> - <donotdisable>true</donotdisable> - <name>Enable</name> - <type>checkbox</type> - <typehint>Lower priority of Peer-to-Peer traffic</typehint> - <description>This will lower the priority of P2P traffic below all other traffic. Please check the items that you would like to prioritize lower than normal traffic.</description> - <enablefields>p2pCatchAll,Bandwidth,BandwidthSpeed,Aimster,BitTorrent,BuddyShare,CuteMX,DCplusplus,dcc,DirectConnect,DirectFileExpress,EDonkey2000,FastTrack,Gnutella,grouper,hotComm,HotlineConnect,iMesh,Napster,OpenNap,Scour,Shareaza,SongSpy,WinMX</enablefields> - <bindstofield>ezshaper->step5->enable</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>p2p Catch all</name> - <type>listtopic</type> - </field> - <field> - <name>p2pCatchAll</name> - <type>checkbox</type> - <typehint>When enabled, all uncategorized traffic is fed to the p2p queue.</typehint> - <bindstofield>ezshaper->step5->p2pcatchall</bindstofield> - </field> - <field> - <name>Bandwidth</name> - <type>input</type> - <validate>^[0-9]*$</validate> - <message>Speed must be numerical.</message> - <bindstofield>ezshaper->step5->bandwidth</bindstofield> - <combinefieldsbegin>true</combinefieldsbegin> - </field> - <field> - <combinefieldsend>true</combinefieldsend> - <dontdisplayname>true</dontdisplayname> - <dontcombinecells>true</dontcombinecells> - <donotdisable>true</donotdisable> - <name>BandwidthSpeed</name> - <description>The limit you want to apply.</description> - <type>select</type> - <options> - <option> - <name>%</name> - <value>%</value> - </option> - <option> - <name>bit/s</name> - <value>b</value> - </option> - <option> - <name>Kilobit/s</name> - <value>Kb</value> - </option> - <option> - <name>Megabit/s</name> - <value>Mb</value> - </option> - <option> - <name>Gigabit/s</name> - <value>Gb</value> - </option> - </options> - <bindstofield>ezshaper->step5->bandwidthunit</bindstofield> - </field> - <field> - <name>Enable/Disable specific P2P protocols</name> - <type>listtopic</type> - </field> - <field> - <name>Aimster</name> - <type>checkbox</type> - <typehint>Aimster and other P2P using the Aimster protocol and ports</typehint> - <bindstofield>ezshaper->step5->aimster</bindstofield> - </field> - <field> - <name>BitTorrent</name> - <type>checkbox</type> - <typehint>Bittorrent and other P2P using the Torrent protocol and ports</typehint> - <bindstofield>ezshaper->step5->bittorrent</bindstofield> - </field> - <field> - <name>BuddyShare</name> - <type>checkbox</type> - <typehint>BuddyShare and other P2P using the BuddyShare protocol and ports</typehint> - <bindstofield>ezshaper->step5->buddyshare</bindstofield> - </field> - <field> - <name>CuteMX</name> - <type>checkbox</type> - <typehint>CuteMX and other P2P using the CuteMX protocol and ports</typehint> - <bindstofield>ezshaper->step5->cutemx</bindstofield> - </field> - <field> - <name>DCplusplus</name> - <type>checkbox</type> - <typehint>DC++ and other P2P using the DC++ protocol and ports</typehint> - <bindstofield>ezshaper->step5->dcplusplus</bindstofield> - </field> - <field> - <name>DCC</name> - <type>checkbox</type> - <typehint>irc DCC file transfers</typehint> - <bindstofield>ezshaper->step5->dcc</bindstofield> - </field> - <field> - <name>DirectConnect</name> - <type>checkbox</type> - <typehint>DirectConnect and other P2P using the DirectConnect protocol and ports</typehint> - <bindstofield>ezshaper->step5->directconnect</bindstofield> - </field> - <field> - <name>DirectFileExpress</name> - <type>checkbox</type> - <typehint>DirectFileExpress and other P2P using the DirectFileExpress protocol and ports</typehint> - <bindstofield>ezshaper->step5->directfileexpress</bindstofield> - </field> - <field> - <name>eDonkey2000</name> - <type>checkbox</type> - <typehint>eDonkey and other P2P using the eDonkey protocol and ports</typehint> - <bindstofield>ezshaper->step5->edonkey2000</bindstofield> - </field> - <field> - <name>FastTrack</name> - <type>checkbox</type> - <typehint>FastTrack and other P2P using the FastTrack protocol and ports</typehint> - <bindstofield>ezshaper->step5->fasttrack</bindstofield> - </field> - <field> - <name>Gnutella</name> - <type>checkbox</type> - <typehint>Gnutella and other P2P using the Gnutella protocol and ports</typehint> - <bindstofield>ezshaper->step5->gnutella</bindstofield> - </field> - <field> - <name>grouper</name> - <type>checkbox</type> - <typehint>grouper and other P2P using the grouper protocol and ports</typehint> - <bindstofield>ezshaper->step5->grouper</bindstofield> - </field> - <field> - <name>hotComm</name> - <type>checkbox</type> - <typehint>hotComm and other P2P using the hotComm protocol and ports</typehint> - <bindstofield>ezshaper->step5->hotcomm</bindstofield> - </field> - <field> - <name>HotlineConnect</name> - <type>checkbox</type> - <typehint>HotlineConnect and other P2P using the HotlineConnect protocol and ports</typehint> - <bindstofield>ezshaper->step5->hotlineconnect</bindstofield> - </field> - <field> - <name>iMesh</name> - <type>checkbox</type> - <typehint>iMesh and other P2P using the iMesh protocol and ports</typehint> - <bindstofield>ezshaper->step5->imesh</bindstofield> - </field> - <field> - <name>Napster</name> - <type>checkbox</type> - <typehint>Napster and other P2P using the Napster protocol and ports</typehint> - <bindstofield>ezshaper->step5->napster</bindstofield> - </field> - <field> - <name>OpenNap</name> - <type>checkbox</type> - <typehint>OpenNap and other P2P using the OpenNap protocol and ports</typehint> - <bindstofield>ezshaper->step5->opennap</bindstofield> - </field> - <field> - <name>Scour</name> - <type>checkbox</type> - <typehint>Scour and other P2P using the Scour protocol and ports</typehint> - <bindstofield>ezshaper->step5->scour</bindstofield> - </field> - <field> - <name>Shareaza</name> - <type>checkbox</type> - <typehint>Shareaza and other P2P using the Shareaza protocol and ports</typehint> - <bindstofield>ezshaper->step5->shareaza</bindstofield> - </field> - <field> - <name>SongSpy</name> - <type>checkbox</type> - <typehint>SongSpy and other P2P using the SongSpy protocol and ports</typehint> - <bindstofield>ezshaper->step5->songspy</bindstofield> - </field> - <field> - <name>WinMX</name> - <type>checkbox</type> - <typehint>WinMX and other P2P using the WinMX protocol and ports</typehint> - <bindstofield>ezshaper->step5->winmx</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <stepsubmitphpaction>step5_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile> - </step> - <step> - <id>6</id> - <title>pfSense Traffic Shaper Wizard</title> - <disableallfieldsbydefault>true</disableallfieldsbydefault> - <description>Network Games</description> - <fields> - <field> - <name>Enable</name> - <type>checkbox</type> - <typehint>Prioritize network gaming traffic</typehint> - <description>This will raise the priority of gaming traffic to higher than most traffic.</description> - <enablefields>ARMA2,BattleNET,Battlefield2,Battlefield3,BattlefieldBC2,Borderlands,CallOfDuty,Counterstrike,Crysis2,DeltaForce,Dirt3,DOOM3,EmpireEarth,EveOnline,Everquest,Everquest2,FarCry,FarCry2,FarCry3,GunZOnline,HalfLife,Halo2,LeagueofLegends,Lineage2,MechwarriorOnline,Minecraft,OperationFlashpointDR,PlanetSide,PlanetSide2,PlayStation3,QuakeIII,QuakeIV,Steam,StarWarsTOR,TigerWoods2004PS2,TribesAscend,UnrealTournament,WolfensteinEnemyTerritory,WorldOfWarcraft,XBox360</enablefields> - <donotdisable>true</donotdisable> - <bindstofield>ezshaper->step6->enable</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>Enable/Disable specific games</name> - <type>listtopic</type> - </field> - <field> - <name>ARMA2</name> - <type>checkbox</type> - <typehint>ARMA 2</typehint> - <bindstofield>ezshaper->step6->arma2</bindstofield> - </field> - <field> - <name>BattleNET</name> - <type>checkbox</type> - <typehint>Battle.net - Virtually every game from Blizzard publishing should match this. This includes the following game series: Starcraft, Diablo, Warcraft. Guild Wars also uses this port.</typehint> - <bindstofield>ezshaper->step6->battlenet</bindstofield> - </field> - <field> - <name>Battlefield2</name> - <type>checkbox</type> - <typehint>Battlefield 2 - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->battlefield2</bindstofield> - </field> - <field> - <name>Battlefield3</name> - <type>checkbox</type> - <typehint>Battlefield 3 - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->battlefield3</bindstofield> - </field> - <field> - <name>BattlefieldBC2</name> - <type>checkbox</type> - <typehint>Battlefield: Bad Company 2</typehint> - <bindstofield>ezshaper->step6->battlefieldbc2</bindstofield> - </field> - <field> - <name>Borderlands</name> - <type>checkbox</type> - <typehint>Borderlands</typehint> - <bindstofield>ezshaper->step6->borderlands</bindstofield> - </field> - <field> - <name>CallOfDuty</name> - <type>checkbox</type> - <typehint>Call Of Duty (United Offensive)</typehint> - <bindstofield>ezshaper->step6->callofduty</bindstofield> - </field> - <field> - <name>Counterstrike</name> - <type>checkbox</type> - <typehint>Counterstrike. The ultimate 1st person shooter.</typehint> - <bindstofield>ezshaper->step6->counterstrike</bindstofield> - </field> - <field> - <name>Crysis2</name> - <type>checkbox</type> - <typehint>Crysis 2</typehint> - <bindstofield>ezshaper->step6->crysis2</bindstofield> - </field> - <field> - <name>DeltaForce</name> - <type>checkbox</type> - <typehint>Delta Force</typehint> - <bindstofield>ezshaper->step6->deltaforce</bindstofield> - </field> - <field> - <name>Dirt3</name> - <type>checkbox</type> - <typehint>Dirt 3</typehint> - <bindstofield>ezshaper->step6->dirt3</bindstofield> - </field> - <field> - <name>DOOM3</name> - <type>checkbox</type> - <typehint>DOOM3</typehint> - <bindstofield>ezshaper->step6->doom3</bindstofield> - </field> - <field> - <name>EmpireEarth</name> - <type>checkbox</type> - <typehint>Empire Earth</typehint> - <bindstofield>ezshaper->step6->empireearth</bindstofield> - </field> - <field> - <name>EveOnline</name> - <type>checkbox</type> - <typehint>EVE Online</typehint> - <bindstofield>ezshaper->step6->eveonline</bindstofield> - </field> - <field> - <name>Everquest</name> - <type>checkbox</type> - <typehint>Everquest - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->everquest</bindstofield> - </field> - <field> - <name>Everquest2</name> - <type>checkbox</type> - <typehint>Everquest II</typehint> - <bindstofield>ezshaper->step6->everquest2</bindstofield> - </field> - <field> - <name>FarCry</name> - <type>checkbox</type> - <typehint>Far Cry</typehint> - <bindstofield>ezshaper->step6->farcry</bindstofield> - </field> - <field> - <name>FarCry2</name> - <type>checkbox</type> - <typehint>Far Cry 2</typehint> - <bindstofield>ezshaper->step6->farcry2</bindstofield> - </field> - <field> - <name>FarCry3</name> - <type>checkbox</type> - <typehint>Far Cry 3</typehint> - <bindstofield>ezshaper->step6->farcry3</bindstofield> - </field> - <field> - <name>GunZOnline</name> - <type>checkbox</type> - <typehint>GunZ Online</typehint> - <bindstofield>ezshaper->step6->gunzonline</bindstofield> - </field> - <field> - <name>HalfLife</name> - <type>checkbox</type> - <typehint>Half-Life</typehint> - <bindstofield>ezshaper->step6->halflife</bindstofield> - </field> - <field> - <name>Halo2</name> - <type>checkbox</type> - <typehint>Halo2 via Xbox live</typehint> - <bindstofield>ezshaper->step6->halo2xbox</bindstofield> - </field> - <field> - <name>LeagueofLegends</name> - <type>checkbox</type> - <typehint>League of Legends - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->leagueoflegends</bindstofield> - </field> - <field> - <name>Lineage2</name> - <type>checkbox</type> - <typehint>Lineage II</typehint> - <bindstofield>ezshaper->step6->lineage2</bindstofield> - </field> - <field> - <name>MechwarriorOnline</name> - <type>checkbox</type> - <typehint>MechWarrior: Online - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->mechwarrioronline</bindstofield> - </field> - <field> - <name>Minecraft</name> - <type>checkbox</type> - <typehint>Minecraft</typehint> - <bindstofield>ezshaper->step6->minecraft</bindstofield> - </field> - <field> - <name>OperationFlashpointDR</name> - <type>checkbox</type> - <typehint>Operation Flashpoint: Dragon Rising</typehint> - <bindstofield>ezshaper->step6->operationflashpoint-dr</bindstofield> - </field> - <field> - <name>PlanetSide</name> - <type>checkbox</type> - <typehint>PlanetSide</typehint> - <bindstofield>ezshaper->step6->planetside</bindstofield> - </field> - <field> - <name>PlanetSide2</name> - <type>checkbox</type> - <typehint>PlanetSide 2</typehint> - <bindstofield>ezshaper->step6->planetside2</bindstofield> - </field> - <field> - <name>PlayStation3</name> - <type>checkbox</type> - <typehint>PlayStation 3</typehint> - <bindstofield>ezshaper->step6->playstation3</bindstofield> - </field> - <field> - <name>QuakeIII</name> - <type>checkbox</type> - <typehint>Quake III</typehint> - <bindstofield>ezshaper->step6->quakeiii</bindstofield> - </field> - <field> - <name>QuakeIV</name> - <type>checkbox</type> - <typehint>Quake IV</typehint> - <bindstofield>ezshaper->step6->quakeiv</bindstofield> - </field> - <field> - <name>StarWarsTOR</name> - <type>checkbox</type> - <typehint>StarWars: The Old Republic - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->starwarstor</bindstofield> - </field> - <field> - <name>Steam</name> - <type>checkbox</type> - <typehint>Steam (Includes: America's Army 3, Counter-Strike: Source, Counter-Strike: Global Offensive, Half-Life 2, COD: Black Ops Series, Borderlands 2, Natural Selection 2, Left 4 Dead Series, Portal 2)</typehint> - <bindstofield>ezshaper->step6->steam</bindstofield> - </field> - <field> - <name>TigerWoods2004PS2</name> - <type>checkbox</type> - <typehint>Tiger Woods 2004 for PS2</typehint> - <bindstofield>ezshaper->step6->tigerwoods2004ps2</bindstofield> - </field> - <field> - <name>TribesAscend</name> - <type>checkbox</type> - <typehint>Tribes Ascend</typehint> - <bindstofield>ezshaper->step6->tribesascend</bindstofield> - </field> - <field> - <name>UnrealTournament</name> - <type>checkbox</type> - <typehint>Unreal Tournament Series</typehint> - <bindstofield>ezshaper->step6->unrealtournament</bindstofield> - </field> - <field> - <name>WolfensteinEnemyTerritory</name> - <type>checkbox</type> - <typehint>Wolfenstein Enemy Territory</typehint> - <bindstofield>ezshaper->step6->wolfet</bindstofield> - </field> - <field> - <name>WorldOfWarcraft</name> - <type>checkbox</type> - <typehint>World of Warcraft</typehint> - <bindstofield>ezshaper->step6->wow</bindstofield> - </field> - <field> - <name>Xbox360</name> - <type>checkbox</type> - <typehint>XBox 360 and Games for Windows Live</typehint> - <bindstofield>ezshaper->step6->xbox360</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile> - </step> - <step> - <id>7</id> - <title>pfSense Traffic Shaper Wizard</title> - <disableallfieldsbydefault>true</disableallfieldsbydefault> - <description>Raise or lower other Applications</description> - <fields> - <field> - <name>Enable</name> - <type>checkbox</type> - <typehint>Other networking protocols</typehint> - <description>This will help raise or lower the priority of other protocols higher than most traffic.</description> - <enablefields>AIM,AppleRemoteDesktop,DNS,HTTP,ICMP,ICQ,IMAP,IPSEC,IRC,Jabber,LotusNotes,MSN,MSRDP,MySqlServer,PCAnywhere,POP3,PPTP,RTSP,SMB,SMTP,SNMP,StreamingMP3,TeamSpeak,VNC,NNTP,CVSUP,Slingbox,HBCI</enablefields> - <donotdisable>true</donotdisable> - <bindstofield>ezshaper->step7->enable</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>Remote Service / Terminal emulation</name> - <type>listtopic</type> - </field> - <field> - <name>MSRDP</name> - <type>select</type> - <bindstofield>ezshaper->step7->msrdp</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Microsoft Remote Desktop Protocol</typehint> - </field> - <field> - <name>VNC</name> - <bindstofield>ezshaper->step7->vnc</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Virtual Network Computing</typehint> - </field> - <field> - <name>AppleRemoteDesktop</name> - <bindstofield>ezshaper->step7->appleremotedesktop</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Apple Remote Desktop</typehint> - </field> - <field> - <name>PCAnywhere</name> - <bindstofield>ezshaper->step7->pcanywhere</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Symantec PC Anywhere</typehint> - </field> - <field> - <name>Messengers</name> - <type>listtopic</type> - </field> - <field> - <name>IRC</name> - <type>select</type> - <bindstofield>ezshaper->step7->irc</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Internet Relay Chat</typehint> - </field> - <field> - <name>Jabber</name> - <type>select</type> - <bindstofield>ezshaper->step7->jabber</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Jabber instant messanger</typehint> - </field> - <field> - <name>ICQ</name> - <bindstofield>ezshaper->step7->icq</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>ICQ</typehint> - </field> - <field> - <name>AIM</name> - <bindstofield>ezshaper->step7->aolinstantmessenger</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>AOL Instant Messenger</typehint> - </field> - <field> - <name>MSN</name> - <bindstofield>ezshaper->step7->msnmessenger</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>MSN Messenger</typehint> - </field> - <field> - <name>Teamspeak</name> - <bindstofield>ezshaper->step7->teamspeak</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>TeamSpeak</typehint> - </field> - <field> - <name>VPN</name> - <type>listtopic</type> - </field> - <field> - <name>PPTP</name> - <type>select</type> - <bindstofield>ezshaper->step7->pptp</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Microsoft Point to Point tunneling protocol</typehint> - </field> - <field> - <name>IPSEC</name> - <type>select</type> - <bindstofield>ezshaper->step7->ipsec</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>IPSEC VPN traffic</typehint> - </field> - <field> - <name>Multimedia/Streaming</name> - <type>listtopic</type> - </field> - <field> - <name>StreamingMP3</name> - <type>select</type> - <bindstofield>ezshaper->step7->streamingmp3</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Streaming Media</typehint> - </field> - <field> - <name>RTSP</name> - <bindstofield>ezshaper->step7->rtsp</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>RealTime streaming protocol</typehint> - </field> - <field> - <name>Web</name> - <type>listtopic</type> - </field> - <field> - <name>HTTP</name> - <type>select</type> - <bindstofield>ezshaper->step7->http</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>HTTP and HTTPS aka Web Traffic</typehint> - </field> - <field> - <name>Mail</name> - <type>listtopic</type> - </field> - <field> - <name>SMTP</name> - <type>select</type> - <bindstofield>ezshaper->step7->smtp</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Mail Protocol</typehint> - </field> - <field> - <name>POP3</name> - <type>select</type> - <bindstofield>ezshaper->step7->pop3</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>POP3 Protocol</typehint> - </field> - <field> - <name>IMAP</name> - <bindstofield>ezshaper->step7->imap</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>IMAP Protocol</typehint> - </field> - <field> - <name>LotusNotes</name> - <bindstofield>ezshaper->step7->lotusnotes</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Lotus Notes</typehint> - </field> - <field> - <name>Miscellaneous</name> - <type>listtopic</type> - </field> - <field> - <name>DNS</name> - <type>select</type> - <bindstofield>ezshaper->step7->dns</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Domain Name Services</typehint> - </field> - <field> - <name>ICMP</name> - <bindstofield>ezshaper->step7->icmp</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>ICMP Protocol</typehint> - </field> - <field> - <name>SMB</name> - <bindstofield>ezshaper->step7->smb</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Microsoft SMB Protocol and friends</typehint> - </field> - <field> - <name>SNMP</name> - <bindstofield>ezshaper->step7->snmp</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Simple Network Management Protocol</typehint> - </field> - <field> - <name>MySQLServer</name> - <bindstofield>ezshaper->step7->mysqlserver</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>MySQL Server</typehint> - </field> - <field> - <name>NNTP</name> - <bindstofield>ezshaper->step7->nntp</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Internet News</typehint> - </field> - <field> - <name>CVSUP</name> - <bindstofield>ezshaper->step7->cvsup</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>CVSUP</typehint> - </field> - <field> - <name>Slingbox</name> - <bindstofield>ezshaper->step7->slingbox</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Slingbox</typehint> - </field> - <field> - <name>HBCI</name> - <bindstofield>ezshaper->step7->hbci</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>HBCI</typehint> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile> - </step> - <step> - <id>8</id> - <title>pfSense Traffic Shaper Wizard</title> - <field> - <name>Reload profile notice</name> - <type>listtopic</type> - </field> - <description> After pressing Finish the system will load the new profile.<br/> Please note that this may take a moment.<br/> Also note that the traffic shaper is stateful meaning that only new connections will be shaped.<br/> If this is an issue please reset the state table after loading the profile.<br/></description> - <fields> - <field> - <name>Finish</name> - <type>submit</type> - </field> - </fields> - <stepsubmitphpaction>step8_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile> - </step> -</pfsensewizard> diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc deleted file mode 100644 index 80403ef..0000000 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc +++ /dev/null @@ -1,1416 +0,0 @@ -<?php -/* - traffic_shaper_wizard_multi_lan.inc - part of pfSense (https://www.pfsense.org/) - - Copyright (C) 2006 Bill Marquette - bill.marquette@gmail.com. - Copyright (C) 2006 Scott Ullrich - sullrich@pfsense.com. - Copyright (C) 2008-2010 Ermal Luçi - 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. -*/ - -function step1_submitphpaction() { - global $stepid, $savemsg; - - if (!isset($_POST['numberofconnections'])) { - $savemsg=gettext("You need to specify the number of local interfaces connected."); - $stepid--; - } - if (intval($_POST['numberofconnections']) < 1) { - $savemsg=gettext("The number of local connection needs to be greater than 1."); - $stepid--; - } -} - -function step2_stepbeforeformdisplay() { - global $config, $pkg; - global $stepid, $savemsg; - - $numberofinterfaces = 0; - $iflist = array(); - $iflisttmp = get_configured_interface_with_descr(); - foreach ($iflisttmp as $if => $ifdesc) { - if (!is_altq_capable(get_real_interface($if))) - continue; - if ($if == "wan") - continue; - $numberofinterfaces++; - $iflist[$if] = $ifdesc; - } - $numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']); - if ($numberofconnections > $numberofinterfaces) { - $savemsg=gettext("You do not have {$numberofconnections} of local interfaces!"); - $stepid--; - return; - } - - $fields =& $pkg['step'][1]['fields']['field']; - - /* - unset($config['ezshaper']['step2']); - $config['ezshaper']['step2'] = array(); - write_config(); - */ - $fields = array(); - - $field = array(); - $field['name'] = "Setup WAN(upload) scheduler"; - $field['type'] = "listtopic"; - $fields[] = $field; - $field = array(); - $field['name'] = "Upload Scheduler"; - $field['type'] = "select"; - $field['typehint'] = "Queueing discipline to apply on the upload of this link."; - $field['options']['option'] = array(); - $opts = array(); - $opts['name'] = "HFSC"; - $opts['value'] = "HFSC"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "CBQ"; - $opts['value'] = "CBQ"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "PRIQ"; - $opts['value'] = "PRIQ"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->uploadscheduler"; - $fields[] = $field; - - $field = array(); - $field['name'] = "Setup link speed details"; - $field['type'] = "listtopic"; - $fields[] = $field; - $field = array(); - $field['name'] = "connupload"; - $field['displayname'] = "Link Upload"; - $field['type'] = "input"; - $field['bindstofield'] = "ezshaper->step2->connupload"; - $field['combinefieldsbegin'] = "true"; - $fields[] = $field; - - $field = array(); - $field['combinefieldsend'] = "true"; - $field['dontdisplayname'] = "true"; - $field['dontcombinecells'] = "true"; - $field['name'] = "connuploadspeed"; - $field['typehint'] = "Upload bandwidth on this connection."; - $field['type'] = "select"; - $field['options']['option'] = array(); - $opts = array(); - $opts['value'] = "Kb"; - $opts['name'] = "Kbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Mb"; - $opts['name'] = "Mbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Gb"; - $opts['name'] = "Gbit/s"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->connuploadspeed"; - $fields[] = $field; - - $field = array(); - $field['name'] = "conndownload"; - $field['displayname'] = "Link Download"; - $field['type'] = "input"; - $field['bindstofield'] = "ezshaper->step2->conndownload"; - $field['combinefieldsbegin'] = "true"; - $fields[] = $field; - - $field = array(); - $field['combinefieldsend'] = "true"; - $field['dontdisplayname'] = "true"; - $field['dontcombinecells'] = "true"; - $field['name'] = "conndownloadspeed"; - $field['typehint'] = "Download bandwidth on this connection."; - $field['type'] = "select"; - $field['options']['option'] = array(); - $opts = array(); - $opts['value'] = "Kb"; - $opts['name'] = "Kbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Mb"; - $opts['name'] = "Mbit/s"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['value'] = "Gb"; - $opts['name'] = "Gbit/s"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->conndownloadspeed"; - $fields[] = $field; - - for ($i = 0; $i < $numberofconnections; $i++) { - - $field = array(); - $interface_friendly = $i+1; - $field['name'] = "Setup connection speed and scheduler information for LAN interface #{$interface_friendly}"; - $field['type'] = "listtopic"; - $fields[] = $field; - - $field = array(); - $field['name'] = "conn{$i}interface"; - $field['displayname'] = "LAN interface"; - $field['type'] = "select"; - $field['typehint'] = "Interface of this connection."; - $field['options']['option'] = array(); - $ifselect = 0; - foreach ($iflist as $ifname => $ifdescr) { - if ($ifselect > 0 && $ifselect == ($i + 1)) - $field['value'] = $ifname; - $opts = array(); - $opts['displayname'] = $ifdescr; - $opts['name'] = $ifname; - $opts['value'] = $ifname; - $field['options']['option'][] = $opts; - $ifselect++; - } - $field['bindstofield'] = "ezshaper->step2->conn{$i}interface"; - $fields[] = $field; - - $field = array(); - $field['name'] = "conn{$i}downloadscheduler"; - $field['displayname'] = "LAN Scheduler"; - $field['type'] = "select"; - $field['typehint'] = "Queueing discipline to apply on the download of this connection."; - $field['options']['option'] = array(); - $opts = array(); - $opts['name'] = "HFSC"; - $opts['value'] = "HFSC"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "CBQ"; - $opts['value'] = "CBQ"; - $field['options']['option'][] = $opts; - $opts = array(); - $opts['name'] = "PRIQ"; - $opts['value'] = "PRIQ"; - $field['options']['option'][] = $opts; - $field['bindstofield'] = "ezshaper->step2->conn{$i}downloadscheduler"; - $fields[] = $field; - } - - $field = array(); - $field['name'] = "Next"; - $field['type'] = "submit"; - $fields[] = $field; -} - -function step2_stepsubmitphpaction() { - global $config; - global $stepid, $savemsg; - $sumdownloads = 0; - - /* Input Validation */ - $steps = intval($config['ezshaper']['step1']['numberofconnections']); - for ($i = 0; $i < $steps; $i++) { - for ($j = $i + 1; $j <= $steps; $j++) { - if ($_POST["conn{$i}interface"] == $_POST["conn{$j}interface"]) { - $savemsg=gettext("You cannot select the same interface for different LAN #{$i} and LAN #{$j}."); - $stepid--; - return; - } - } - } - if (!is_numeric($_POST["connupload"])) { - $savemsg= gettext("Upload bandwidth of connection is not valid."); - $stepid--; - return; - } - if (!is_numeric($_POST["conndownload"])) { - $savemsg= gettext("Download bandwidth of connection is not valid."); - $stepid--; - return; - } - $upbw = floatval($_POST["connupload"]); - $downbw = floatval($_POST["conndownload"]); - if ($upbw < 1 || $downbw < 1) { - $savemsg = gettext("You cannot specify bandwidth less than 1!"); - $stepid--; - return; - } - if (intval($upbw) < 128 && $_POST["connuploadspeed"] == "Kb" && trim($_POST["connscheduler"]) == "CBQ") { - $savemsg=gettext("We do not support Bandwidths smaller than 128Kbit/s for CBQ scheduler."); - $stepid--; - return; - } - if ($downbw < 128 && $_POST["conndownloadspeed"] == "Kb" && trim($_POST["downloadscheduler"]) == "CBQ") { - $savemsg=gettext("We do not support Bandwidths smaller than 128Kbit/s for CBQ scheduler."); - $stepid--; - return; - } - - /* This is necessary since the wizard expects pecnefined fields. */ - unset($config['ezshaper']['step2']); - $config['ezshaper']['step2'] = array(); - - $config['ezshaper']['step2']['uploadscheduler'] = $_POST['uploadscheduler']; - $config['ezshaper']['step2']["connupload"] = $_POST["connupload"]; - $config['ezshaper']['step2']["connuploadspeed"] = $_POST["connuploadspeed"]; - $config['ezshaper']['step2']["conndownload"] = $_POST["conndownload"]; - $config['ezshaper']['step2']["conndownloadspeed"] = $_POST["conndownloadspeed"]; - - for ($i = 0; $i < $steps; $i++) { - $config['ezshaper']['step2']["conn{$i}downloadscheduler"] = $_POST["conn{$i}downloadscheduler"]; - $config['ezshaper']['step2']["conn${i}interface"] = $_POST["conn{$i}interface"]; - } -} - -function step3_stepsubmitphpaction() { - global $config; - global $stepid, $savemsg; - - if (!$_POST['enable']) - return; - - if($_POST['address']) { - if(!is_ipaddroralias($_POST['address'])) { - /* item is not an ip or alias. error out */ - $savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); - $stepid--; - return; - } - } - - if (!is_numeric($_POST["connupload"]) || !is_numeric($_POST['conndownload'])) { - $savemsg = gettext("Upload or download bandwidth is not valid."); - $stepid--; - return; - } - - if ($_POST["connuploadspeed"] == "%") { - if (intval($_POST['connupload']) > 80) { - $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection."); - $stepid--; - return; - } - } else { - $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["connuploadspeed"]); - $ifbw = $factor * floatval($config['ezshaper']['step2']["connupload"]); - $factor = wizard_get_bandwidthtype_scale($_POST["connuploadspeed"]); - $input_bw = $factor * floatval($_POST["connupload"]); - if ((0.8 * $ifbw) < $input_bw) { - $savemsg=gettext("You cannot set the VoIP upload bandwidth on WAN connection higher than 80% of the connection."); - $stepid--; - return; - } - } - if ($_POST["conndownloadspeed"] == "%") { - if (intval($_POST['conndownload']) > 80) { - $savemsg=gettext("You cannot set the VoIP download bandwidth on connection higher than 80% of the connection."); - $stepid--; - return; - } - } else { - $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conndownloadspeed"]); - $ifbw = $factor * floatval($config['ezshaper']['step2']["conndownload"]); - $factor = wizard_get_bandwidthtype_scale($_POST["conndownloadspeed"]); - $input_bw = $factor * floatval($_POST["conndownload"]); - if ((0.8 * $ifbw) < $input_bw) { - $savemsg=gettext("You cannot set the VoIP download bandwidth on connection higher than 80% of the connection."); - $stepid--; - return; - } - } -} - -function step4_stepsubmitphpaction() { - global $config; - global $stepid, $savemsg; - - if ( $_POST['enable'] ) { - if(!$_POST['bandwidth']) { - $savemsg="You need to specify a value for bandwidth!"; - $stepid--; - return; - } - if(!is_numeric($_POST['bandwidth'])) { - $savemsg="The posted value is not a valid bandwidth."; - $stepid--; - return; - } - - if ($_POST['bandwidthspeed'] <> "%") { - $savemsg = gettext("Only percentage bandwidth specification is allowed."); - $stepid--; - return; - } - $bw = $_POST['bandwidth']; - if($bw > 15 || $bw < 2) { - $savemsg="Values should be between 2% and 15%!"; - $stepid--; - return; - } - - if($_POST['address']) { - if(!is_ipaddroralias($_POST['address'])) { - /* item is not an ip or alias. error out */ - $savemsg=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); - $stepid--; - return; - } - } - } -} - -function step5_stepsubmitphpaction() { - global $stepid, $savemsg; - - if ( $_POST['enable'] ) { - if ($_POST['p2pcatchall']) { - if(!is_numeric($_POST['bandwidth'])) { - $savemsg="Posted value is not a valid bandwidth."; - $stepid--; - return; - - } - if ($_POST['bandwidthspeed'] <> "%") { - $savemsg = gettext("Only percentage bandwidth specification is allowed."); - $stepid--; - return; - } - $bw = $_POST['bandwidth']; - if($bw > 15 || $bw < 2) { - $savemsg="Values should be between 2% and 15%!"; - $stepid--; - return; - } - } - } -} - -function step8_stepsubmitphpaction() { - global $g, $config; - - /* save the new configuration */ - apply_all_choosen_items(); - - /* reset rrd queues */ - system("rm -f /var/db/rrd/*queuedrops.rrd"); - system("rm -f /var/db/rrd/*queues.rrd"); - enable_rrd_graphing(); - - /* apply the new configuration to the system */ - filter_configure(); - - /* And we're no longer dirty! */ - clear_subsystem_dirty('shaper'); - - update_filter_reload_status("Initializing"); - header("Location: status_filter_reload.php"); - exit; -} - -function apply_all_choosen_items() { - global $config, $g, $altq_list_queues, $gamesplist, $voiplist, $othersplist, $p2plist; - - require_once("wizardapp.inc"); - - /* - * Wipe previous config. - * Doing it here makes sense since we can wipe the previous config only after - * the user decides to do so, finishing the wizard. - */ - if (isset($config['shaper']['queue'])) - unset($config['shaper']['queue']); - /* XXX: This is redundant, because this should be handled by converter at startup. */ - if(isset($config['shaper']['rule'])) - unset($config['shaper']['rule']); - foreach ($config['filter']['rule'] as $key => $rule) - if ($rule['wizard'] == "yes") - unset($config['filter']['rule'][$key]); - - /* restart the cached config */ - unset($altq_list_queues); - $altq_list_queues = array(); - - $steps = floatval($config['ezshaper']['step1']['numberofconnections']); - - for ($i = 0; $i < $steps; $i++) { - - $tmppath = array(); - $altq =& new altq_root_queue(); - - $altq->SetInterface($config['ezshaper']['step2']["conn{$i}interface"]); - $altq->SetScheduler($config['ezshaper']['step2']["conn{$i}downloadscheduler"]); - //$altq->SetBandwidth(floatval($config['ezshaper']['step2']["conndownload"])); - //$altq->SetBwscale($config['ezshaper']['step2']["conndownloadspeed"]); - $altq->SetEnabled("on"); - $altq_list_queues[$altq->GetQname()] =& $altq; - array_push($tmppath, $config['ezshaper']['step2']["conn{$i}interface"]); - $altq->SetLink($tmppath); - $altq->wconfig(); - - $sched = $config['ezshaper']['step2']["conn{$i}downloadscheduler"]; - $voipbw =0; - $voipbwunit = "Kb"; - $voip = false; - $penalty = false; - $penaltybw = 0; - $penaltybwunit = "Kb"; - $p2p = false; - $p2pcatchall = false; - $p2pcatchbw = 0; - $p2pcatchbwunit = "%"; - $games = false; - $otherpriority = false; - $remainbw = 0; - $upfactor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conndownloadspeed"]); - $upbw = floatval($config['ezshaper']['step2']["conndownload"]) * $upfactor; - - if ($config['ezshaper']['step3']['enable']) { - $voip = true; - $voipbw = $config['ezshaper']['step3']["conndownload"]; - $voipbwunit = $config['ezshaper']['step3']["conndownloadspeed"]; - if ($voipbwunit == "%") - $factor = $upbw/100; - else - $factor = wizard_get_bandwidthtype_scale($voipbwunit); - $remainbw += $voipbw * $factor; - } - if ($config['ezshaper']['step4']['enable']) { - $penalty = true; - $penaltybw = $config['ezshaper']['step4']['bandwidth']; - $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; - if ($penaltybwunit == "%") - $factor = $upbw/100; - else - $factor = wizard_get_bandwidthtype_scale($penaltybwunit); - $remainbw += $penaltybw * $factor; - } else { - $penalty = false; - $penaltybw = 0; - } - if ($config['ezshaper']['step5']['enable']) { - $p2p = true; - if ($config['ezshaper']['step5']['p2pcatchall']) { - $p2pcatchall = true; - $p2pcatchbw = $config['ezshaper']['step5']['bandwidth']; - $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit']; - if ($p2pcatchbwunit == "%") - $factor = $upbw/100; - else - $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit); - $remainbw += $p2pcatchbw * $factor; - } else { - $p2pcatchall = false; - $p2pcatchbw = 0; - } - } else { - $p2p = false; - $p2pcatchall = false; - $p2pcatchbw = 0; - } - if ($config['ezshaper']['step6']['enable']) { - $games = true; - } else { - $games = false; - } - - if ($config['ezshaper']['step7']['enable']) { - $otherpriority = true; - } else { - $otherpriority = false; - } - - $remainbw = round($remainbw / $upbw * 100, 2); - if ($remainbw > 0 && $remainbw > 30) { - $savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); - header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$savemsg}"); - exit; - } else { - $remainbw = 100 - $remainbw; - } - - if (!$p2pcatchall) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qLink"; - $tmpcf['priority'] = 2; - $tmpcf['enabled'] = "on"; - $tmpcf['default'] = "on"; - $tmpcf['qlimit'] = 500; - $tmpcf['ecn'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = 20; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpcf['bandwidth'] = 20; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, $tmpcf['name']); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qDefault <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($sched != "PRIQ") { - if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qInternet"; - //$tmpcf['priority'] = 6; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - If ($sched == "CBQ") { - $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conndownload"]); - $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conndownloadspeed"]; - } else if ($sched == "HFSC") { - $tmpcf['linkshare3'] = - floatval($config['ezshaper']['step2']["conndownload"]) . $config['ezshaper']['step2']["conndownloadspeed"]; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = - floatval($config['ezshaper']['step2']["conndownload"]) . $config['ezshaper']['step2']["conndownloadspeed"]; - - $tmpcf['linkshare'] = "on"; - $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conndownload"]); - $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conndownloadspeed"]; - } - array_push($tmppath, "qInternet"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - //array_pop($tmppath); - //echo "qInternet <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - $altq =& $qtmp; - } - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - - $tmpcf = array(); - $tmpcf['name'] = "qACK"; - $tmpcf['priority'] = 6; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - If ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.2; - $tmpcf['bandwidthtype'] = "%"; - } - else if ($sched == "HFSC") { - $lkbw = 0.20 * $remainbw; - $tmpcf['linkshare3'] = "{$lkbw}%"; - $tmpcf['linkshare'] = "on"; - $tmpcf['bandwidth'] = $lkbw; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qACK"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qACK <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - - if ($p2p) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qP2P"; - $tmpcf['priority'] = 1; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($p2pcatchall) { - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $p2pcatchbw; - $tmpcf['bandwidthtype'] = $p2pcatchbwunit; - } else if ($sched == "HFSC") { - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$p2pcatchbw}{$p2pcatchbwunit}"; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = "{$p2pcatchbw}{$p2pcatchbwunit}"; - $tmpcf['bandwidth'] = $p2pcatchbw; - $tmpcf['bandwidthtype'] = $p2pcatchbwunit; - } - $tmpcf['default'] = "on"; - $tmpcf['qlimit'] = 500; - } else { - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpbw = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$tmpbw}%"; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = "{$tmpbw}%"; - $tmpcf['bandwidth'] = $tmpbw; - $tmpcf['bandwidthtype'] = "%"; - } - } - array_push($tmppath, "qP2P"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qP2P <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($voip) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qVoIP"; - $tmpcf['priority'] = 7; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - if ($voipbw > 0) { - $tmpcf['bandwidth'] = $voipbw; - $tmpcf['bandwidthtype'] = $voipbwunit; - } else { - $tmpcf['bandwidth'] = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } - } else if ($sched == "HFSC") { - if ($voipbw > 0) { - $tmpcf['realtime3'] = "{$voipbw}{$voipbwunit}"; - } else { - $voipbw = $remainbw * 0.20; /* 20% bandwidth */ - $tmpcf['realtime3'] = "{$voipbw}%"; - } - $tmpcf['realtime'] = "on"; - $tmpcf['bandwidth'] = 32; - $tmpcf['bandwidthtype'] = "Kb"; - } - array_push($tmppath, "qVoIP"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qVoIP <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($games) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qGames"; - $tmpcf['priority'] = 5; - $tmpcf['enabled'] = "on"; - $tmpcf['ecn'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $gamesbw = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$gamesbw}%"; - $tmpcf['bandwidth'] = "{$gamesbw}"; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qGames"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qGames <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($otherpriority) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qOthersHigh"; - $tmpcf['priority'] = 4; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpcf['linkshare'] = "on"; - $otherbw = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['linkshare3'] = "{$otherbw}%"; - $tmpcf['bandwidth'] = $otherbw; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qOthersHigh"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qHigh <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qOthersLow"; - $tmpcf['priority'] = 3; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - if ($penalty) - $tmpcf['bandwidth'] = $penaltybw; - else - $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - if ($penalty) { - $tmpcf['linkshare3'] = "{$penaltybw}{$penaltybwunit}"; - $tmpcf['bandwidth'] = $penaltybw; - $tmpcf['bandwidthtype'] = $penaltybwunit; - } else { - $lsbw = $remainbw * 0.05; - $tmpcf['linkshare3'] = "{$lsbw}%"; /* 5% bandwidth */ - $tmpcf['bandwidth'] = $lsbw; - $tmpcf['bandwidthtype'] = "%"; - } - $tmpcf['linkshare'] = "on"; - } - array_push($tmppath, "qOthersLow"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qLow <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - array_pop($tmppath); - } - - /* WAN bandwidth ----------------------------------------------------------------------------------------- */ - - $tmppath = array(); - $altq =& new altq_root_queue(); - - $altq->SetInterface('wan'); - $altq->SetScheduler($config['ezshaper']['step2']["uploadscheduler"]); - $altq->SetBandwidth($config['ezshaper']['step2']['connupload']); - $altq->SetBwscale($config['ezshaper']['step2']['connuploadspeed']); - $altq->SetEnabled("on"); - $altq_list_queues[$altq->GetQname()] =& $altq; - array_push($tmppath, 'wan'); - $altq->SetLink($tmppath); - //var_dump($input_errors); - $altq->wconfig(); - - $sched = $config['ezshaper']['step2']["uploadscheduler"]; - $voipbw =0; - $voipbwunit = "%"; - $voip = false; - $penalty = false; - $penaltybw = 0; - $penaltybwunit = "%"; - $p2p = false; - $p2pcatchall = false; - $p2pcatchbw = 0; - $games = false; - $otherpriority = false; - $remainbw = 0; - $upfactor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["connuploadspeed"]); - $lanbw = floatval($config['ezshaper']['step2']["connupload"]) * $upfactor; - - if ($config['ezshaper']['step3']['enable']) { - $voip = true; - $voipbw = $config['ezshaper']['step3']["connupload"]; - $voipbwunit = $config['ezshaper']['step3']["connuploadspeed"]; - if ($sched != "HFSC") { - if ($voipbwunit == "%") - $factor = $lanbw/100; - else - $factor = wizard_get_bandwidthtype_scale($voipbwunit); - $remainbw += $voipbw * $factor; - } else - $remainbw += 32000; /* 32Kbit/s forHFSC linksharing */ - } - - if ($config['ezshaper']['step4']['enable']) { - $penalty = true; - $penaltybw = $config['ezshaper']['step4']['bandwidth']; - $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit']; - if ($penaltybwunit == "%") - $factor = $lanbw/100; - else - $factor = wizard_get_bandwidthtype_scale($penaltybwunit); - $remainbw += $penaltybw * $factor; - } else { - $penalty = false; - $penaltybw = 0; - } - - if ($config['ezshaper']['step5']['enable']) { - $p2p = true; - if ($config['ezshaper']['step5']['p2pcatchall']) { - $p2pcatchall = true; - $p2pcatchbw = $config['ezshaper']['step5']['bandwidth']; - $p2pcatchbwunit = $config['ezshaper']['step5']['bandwidthunit']; - if ($p2pcatchbwunit == "%") - $factor = $lanbw/100; - else - $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit); - $remainbw += $p2pcatchbw * $factor; - } else { - $p2pcatchall = false; - $p2pcatchbw = 0; - } - } else { - $p2p = false; - $p2pcatchall = false; - $p2pcatchbw = 0; - } - - if ($config['ezshaper']['step6']['enable']) { - $games = true; - } else { - $games = false; - } - - if ($config['ezshaper']['step7']['enable']) { - $otherpriority = true; - } else { - $otherpriority = false; - } - $remainbw = round($remainbw / $lanbw * 100, 2); - if ($remainbw > 0 && $remainbw > 30) { - $savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); - header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$savemsg}"); - exit; - } else { - $remainbw = 100 - $remainbw; - } - - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qACK"; - $tmpcf['priority'] = 6; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - If ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.2; - $tmpcf['bandwidthtype'] = "%"; - } - else if ($sched == "HFSC") { - $lkbw = 0.20 * $remainbw; - $tmpcf['linkshare3'] = "{$lkbw}%"; - $tmpcf['linkshare'] = "on"; - $tmpcf['bandwidth'] = $lkbw; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qACK"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "$lkbw $remainbw qACK <br />"; - //var_dump($input_errors); - //var_dump($qtmp); - $qtmp->wconfig(); - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - if ($p2pcatchall) - $tmpcf['name'] = "qOthersDefault"; - else - $tmpcf['name'] = "qDefault"; - $tmpcf['priority'] = 3; - $tmpcf['enabled'] = "on"; - if (!$p2pcatchall) - $tmpcf['default'] = "on"; - $tmpcf['ecn'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, $tmpcf['name']); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qDefault <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - - if ($p2p) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qP2P"; - $tmpcf['priority'] = 1; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($p2pcatchall) { - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $p2pcatchbw; - $tmpcf['bandwidthtype'] = $p2pcatchbwunit; - } else if ($sched == "HFSC") { - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$p2pcatchbw}{$p2pcatchbwunit}"; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = "{$p2pcatchbw}{$p2pcatchbwunit}"; - $tmpcf['bandwidth'] = $p2pcatchbw; - $tmpcf['bandwidthtype'] = $p2pcatchbwunit; - } - $tmpcf['default'] = "on"; - - } else { - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpbw = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$tmpbw}%"; - $tmpcf['upperlimit'] = "on"; - $tmpcf['upperlimit3'] = "{$tmpbw}%"; - $tmpcf['bandwidth'] = $tmpbw; - $tmpcf['bandwidthtype'] = "%"; - } - } - array_push($tmppath, "qP2P"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qP2P <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($voip) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qVoIP"; - $tmpcf['priority'] = 7; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - if ($voipbw > 0) { - $tmpcf['bandwidth'] = $voipbw; - $tmpcf['bandwidthtype'] = $voipbwunit; - } else { - $tmpcf['bandwidth'] = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } - } else if ($sched == "HFSC") { - if ($voipbw > 0) { - $tmpcf['realtime3'] = "{$voipbw}{$voipbwunit}"; - } else { - $voipbw = $remainbw * 0.20; /* 20% bandwidth */ - $tmpcf['realtime3'] = "{$voipbw}%"; - } - $tmpcf['realtime'] = "on"; - $tmpcf['bandwidth'] = 32; - $tmpcf['bandwidthtype'] = "Kb"; - } - array_push($tmppath, "qVoIP"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qVoIP <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($games) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qGames"; - $tmpcf['priority'] = 5; - $tmpcf['enabled'] = "on"; - $tmpcf['ecn'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $gamesbw = $remainbw * 0.2; /* 20% bandwidth */ - $tmpcf['linkshare'] = "on"; - $tmpcf['linkshare3'] = "{$gamesbw}%"; - $tmpcf['bandwidth'] = "{$gamesbw}"; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qGames"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qGames <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - - if ($otherpriority) { - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qOthersHigh"; - $tmpcf['priority'] = 4; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - $tmpcf['linkshare'] = "on"; - $otherbw = $remainbw * 0.1; /* 10% bandwidth */ - $tmpcf['linkshare3'] = "{$otherbw}%"; - $tmpcf['bandwidth'] = $otherbw; - $tmpcf['bandwidthtype'] = "%"; - } - array_push($tmppath, "qOthersHigh"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qHigh <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - - - if ($sched == "PRIQ") - $q =& new priq_queue(); - else if ($sched == "CBQ") - $q =& new cbq_queue(); - else if ($sched == "HFSC") - $q =& new hfsc_queue(); - $tmpcf = array(); - $tmpcf['name'] = "qOthersLow"; - $tmpcf['priority'] = 2; - $tmpcf['ecn'] = "on"; - $tmpcf['enabled'] = "on"; - if ($sched == "CBQ") { - $tmpcf['borrow'] = "on"; - if ($penalty) - $tmpcf['bandwidth'] = $penaltybw; - else - $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */ - $tmpcf['bandwidthtype'] = "%"; - } else if ($sched == "HFSC") { - if ($penalty) { - $tmpcf['linkshare3'] = "{$penaltybw}{$penaltybwunit}"; - $tmpcf['bandwidth'] = $penaltybw; - $tmpcf['bandwidthtype'] = $penaltybwunit; - } else { - $lsbw = $remainbw * 0.05; - $tmpcf['linkshare3'] = "{$lsbw}%"; /* 5% bandwidth */ - $tmpcf['bandwidth'] = $lsbw; - $tmpcf['bandwidthtype'] = "%"; - } - $tmpcf['linkshare'] = "on"; - } - array_push($tmppath, "qOthersLow"); - $qtmp =& $altq->add_queue($q, $tmpcf, $tmppath, $input_errors); - array_pop($tmppath); - //echo "qLow <br />"; - //var_dump($input_errors); - $qtmp->wconfig(); - } - array_pop($tmppath); - - /* End WAN bandwidth ------------------------------------------------------------------------------------- */ - - - - if (!is_array($config['filter']['rule'])) - $config['filter']['rule'] = array(); - - /* Rules */ - if ($penalty) { - if( is_ipaddr($config['ezshaper']['step4']['address']) || is_alias($config['ezshaper']['step4']['address'])) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = "wan"; - $rule['descr'] = gettext("Penalty Box"); - $rule['defaultqueue'] = "qOthersLow"; - $rule['source']['address'] = $config['ezshaper']['step4']['address']; - $rule['destination']['any'] = TRUE; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - - } - } - - /* If user specifies an IP, we don't bother with providers */ - if ($voip) { - if( is_ipaddr($config['ezshaper']['step3']['address']) || is_alias($config['ezshaper']['step3']['address'])) { - /* create VOIP rules */ - $rule = array(); - $rule['type'] = "match"; - //$rule['interface'] = "wan"; - $rule['descr'] = gettext("Connections From Upstream SIP Server"); - $rule['protocol'] = "udp"; - $rule['defaultqueue'] = "qVoIP"; - $rule['source']['address'] = $config['ezshaper']['step3']['address']; - $rule['destination']['any'] = TRUE; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - - $rule = array(); - $rule['type'] = "match"; - //$rule['interface'] = "wan"; - $rule['descr'] = gettext("Connections To Upstream SIP Server"); - $rule['protocol'] = "udp"; - $rule['defaultqueue'] = "qVoIP"; - $rule['source']['any'] = TRUE; - $rule['destination']['address'] = $config['ezshaper']['step3']['address']; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - - } elseif( $config['ezshaper']['step3']['provider'] == "Generic" ) { - /* create VOIP rules */ - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = "wan"; - $rule['descr'] = "DiffServ/Lowdelay/Upload"; - $rule['protocol'] = "udp"; - $rule['source']['any'] = TRUE; - $rule['defaultqueue'] = "qVoIP"; - $rule['destination']['any'] = TRUE; - $rule['iptos'] = "lowdelay"; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - - } else { - /* loop through voiplist[] */ - foreach ($voiplist[$config['ezshaper']['step3']['provider']] as $voip) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = "wan"; - $rule['defaultqueue'] = 'qVoIP'; - $rule['source']['any'] = TRUE; - $rule['destination']['any'] = TRUE; - $rule['descr'] = "m_voip {$voip[0]} outbound"; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['destination']['port'] = $voip[2]."-".$voip[3]; - if($voip[1] != '') - $rule['protocol'] = $voip[1]; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - } - } - } - - /* loop through p2plist[] */ - if ($p2p) { - foreach($config['ezshaper']['step5'] as $key => $val) { - if (!is_array($p2plist[$key])) - continue; - foreach ($p2plist[$key] as $p2pclient) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = "wan"; - $rule['defaultqueue'] = 'qP2P'; - $rule['source']['any'] = TRUE; - $rule['destination']['any'] = TRUE; - $rule['descr'] = "m_P2P {$p2pclient[0]} outbound"; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['destination']['port'] = $p2pclient[2]."-".$p2pclient[3]; - if($p2pclient[1] != '') - $rule['protocol'] = $p2pclient[1]; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - } - } - } - - /* loop through gamesplist[] */ - if ($games) { - foreach($config['ezshaper']['step6'] as $key => $val) { - if (!is_array($gamesplist[$key])) - continue; - foreach ($gamesplist[$key] as $Gameclient) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = "wan"; - $rule['defaultqueue'] = 'qGames'; - if ($Gameclient[1] == "tcp") - $rule['ackqueue'] = 'qACK'; - $rule['source']['any'] = TRUE; - $rule['destination']['any'] = TRUE; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['descr'] = "m_Game {$Gameclient[0]} outbound"; - $rule['destination']['port'] = $Gameclient[2]."-".$Gameclient[3]; - if($Gameclient[1] != '') - $rule['protocol'] = $Gameclient[1]; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - } - } - } - - /* loop through othersplist[] */ - if ($otherpriority) { - foreach($config['ezshaper']['step7'] as $key => $val) { - if (!is_array($othersplist[$key])) - continue; - foreach ($othersplist[$key] as $otherclient) { - $rule = array(); - $rule['type'] = "match"; - $rule['interface'] = "wan"; - switch ($val) { - case "H": - $rule['defaultqueue'] = 'qOthersHigh'; /* posted value H or L */ - if ($otherclient[1] == "tcp") - $rule['ackqueue'] = 'qACK'; - $loop = 0; - break; - case "L": - $rule['defaultqueue'] = 'qOthersLow'; /* posted value H or L */ - if ($otherclient[1] == "tcp") - $rule['ackqueue'] = 'qACK'; - $loop = 0; - break; - case "D": - if ($p2pcatchall) { - $loop = 0; - $rule['defaultqueue'] = 'qOthersDefault'; - if ($otherclient[1] == "tcp") - $rule['ackqueue'] = 'qACK'; - } else - $loop = 1; /* It automitaclly goes to default queue */ - break; - default: - $loop = 1; - } - if (!$loop) { - $rule['source']['any'] = TRUE; - $rule['destination']['any'] = TRUE; - $rule['floating'] = "yes"; - $rule['wizard'] = "yes"; - $rule['enabled'] = "on"; - $rule['descr'] = "m_Other {$otherclient[0]} outbound"; - - if($otherclient[2] or $otherclient[3]) { - $rule['destination']['port'] = $otherclient[2]."-".$otherclient[3]; - } - if($otherclient[1] != '') - $rule['protocol'] = $otherclient[1]; - $rule['created'] = make_config_revision_entry(null, gettext("Traffic Shaper Wizard")); - $config['filter']['rule'][] = $rule; - } - } - } - } - - write_config(); -} - -function wizard_get_bandwidthtype_scale($type = "b") { - switch ($type) { - case "Gb": - $factor = 1024 * 1024 * 1024; - break; - case "Mb": - $factor = 1024 * 1024; - break; - case "Kb": - $factor = 1024; - break; - case "b": - default: - $factor = 1; - break; - } - return intval($factor); -} - -?> diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml deleted file mode 100644 index 1609a4b..0000000 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml +++ /dev/null @@ -1,1390 +0,0 @@ -<?xml version="1.0"?> -<pfsensewizard> - <copyright><![CDATA[ - /* - traffic_shaper_wizard_multi_lan.xml - part of pfSense (https://www.pfsense.org/) - - Copyright (C) 2005 Bill Marquette - bill.marquette@gmail.com. - Copyright (C) 2008-2010 Ermal Luci - 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. - */]]></copyright> - - <totalsteps>9</totalsteps> - <step> - <id>1</id> - <title>pfSense Traffic Shaper Wizard</title> - <disableheader>true</disableheader> - <description>This wizard will guide you through setting up the pfSense traffic shaper for the situation where you have 1 WAN connection and multiple LAN connections. - Please be aware that Custom Bandwidths should not exceed 30% of the interface/link bandwidth. Keep this in mind during the wizard. - </description> - <fields> - <field> - <displayname>Enter number of LAN type connections</displayname> - <name>numberofconnections</name> - <type>input</type> - <validate>^[0-9]+$</validate> - <description>Number of local(LAN) interfaces you have</description> - <bindstofield>ezshaper->step1->numberofconnections</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <stepsubmitphpaction>step1_submitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile> - </step> - <step> - <id>2</id> - <title>pfSense Traffic Shaper Wizard</title> - <description>Shaper configuration</description> - <javascriptafterformdisplay/> - <stepbeforeformdisplay>step2_stepbeforeformdisplay();</stepbeforeformdisplay> - <stepsubmitphpaction>step2_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile> - <fields> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - </step> - <step> - <id>3</id> - <title>pfSense Traffic Shaper Wizard</title> - <description>Voice over IP</description> - <fields> - <field> - <name>Enable</name> - <type>checkbox</type> - <typehint>Prioritize Voice over IP traffic</typehint> - <description>This will raise the priority of VOIP traffic above all other traffic.</description> - <bindstofield>ezshaper->step3->enable</bindstofield> - <enablefields>provider,address,downloadspeed,downloadspeedunit,uploadspeed,uploadspeedunit</enablefields> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>VOIP specific settings</name> - <type>listtopic</type> - </field> - <field> - <name>Provider</name> - <type>select</type> - <description>Choose Generic if your provider isn't listed.</description> - <bindstofield>ezshaper->step3->provider</bindstofield> - <options> - <option> - <name>Generic (lowdelay)</name> - <value>Generic</value> - </option> - <option> - <name>VoicePulse</name> - <value>VoicePulse</value> - </option> - <option> - <name>Asterisk/Vonage</name> - <value>Asterisk</value> - </option> - <option> - <name>PanasonicTDA</name> - <value>Panasonic</value> - </option> - </options> - </field> - <field> - <name>Upstream SIP Server</name> - <type>inputalias</type> - <description>(Optional) If this is chosen, the provider field will be overridden. This allows you to provide the IP address of the <strong>remote</strong> PBX or SIP Trunk to prioritize. <br />NOTE: You can also use a Firewall Alias in this location.</description> - <bindstofield>ezshaper->step3->address</bindstofield> - <message>IP Address field is non-blank and doesn't look like an IP address.</message> - </field> - <field> - <displayname>Upload Speed</displayname> - <name>connupload</name> - <type>input</type> - <bindstofield>ezshaper->step3->connupload</bindstofield> - <combinefieldsbegin>true</combinefieldsbegin> - </field> - <field> - <combinefieldsend>true</combinefieldsend> - <dontdisplayname>true</dontdisplayname> - <dontcombinecells>true</dontcombinecells> - <donotdisable>true</donotdisable> - <name>connuploadspeed</name> - <description>The limit you want to apply.</description> - <type>select</type> - <options> - <option> - <name>%</name> - <value>%</value> - </option> - <option> - <name>Kilobit/s</name> - <value>Kb</value> - </option> - <option> - <name>Megabit/s</name> - <value>Mb</value> - </option> - <option> - <name>Gigabit/s</name> - <value>Gb</value> - </option> - </options> - <bindstofield>ezshaper->step3->connuploadspeed</bindstofield> - </field> - <field> - <displayname>Download Speed</displayname> - <name>conndownload</name> - <type>input</type> - <bindstofield>ezshaper->step3->conndownload</bindstofield> - <combinefieldsbegin>true</combinefieldsbegin> - </field> - <field> - <combinefieldsend>true</combinefieldsend> - <dontdisplayname>true</dontdisplayname> - <dontcombinecells>true</dontcombinecells> - <donotdisable>true</donotdisable> - <name>conndownloadspeed</name> - <description>The limit you want to apply.</description> - <type>select</type> - <options> - <option> - <name>%</name> - <value>%</value> - </option> - <option> - <name>Kilobit/s</name> - <value>Kb</value> - </option> - <option> - <name>Megabit/s</name> - <value>Mb</value> - </option> - <option> - <name>Gigabit/s</name> - <value>Gb</value> - </option> - </options> - <bindstofield>ezshaper->step3->conndownloadspeed</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <stepsubmitphpaction>step3_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile> - </step> - <step> - <id>4</id> - <title>pfSense Traffic Shaper Wizard</title> - <description>Penalty Box</description> - <disableallfieldsbydefault>true</disableallfieldsbydefault> - <fields> - <field> - <donotdisable>true</donotdisable> - <name>Enable</name> - <type>checkbox</type> - <typehint>Penalize IP or Alias</typehint> - <description>This will lower the priority of traffic from this IP or alias.</description> - <enablefields>address,bandwidth,bandwidthspeed</enablefields> - <bindstofield>ezshaper->step4->enable</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>PenaltyBox specific settings</name> - <type>listtopic</type> - </field> - <field> - <name>Address</name> - <type>inputalias</type> - <description>This allows you to just provide the IP address of the computer(s) to penalize. NOTE: You can also use a Firewall Alias in this location.</description> - <bindstofield>ezshaper->step4->address</bindstofield> - <message>IP Address field is non-blank and doesn't look like an IP address.</message> - </field> - <field> - <name>Bandwidth</name> - <type>input</type> - <validate>^[0-9]*$</validate> - <message>Speed must be numerical.</message> - <bindstofield>ezshaper->step4->bandwidth</bindstofield> - <combinefieldsbegin>true</combinefieldsbegin> - </field> - <field> - <combinefieldsend>true</combinefieldsend> - <dontdisplayname>true</dontdisplayname> - <dontcombinecells>true</dontcombinecells> - <donotdisable>true</donotdisable> - <name>BandwidthSpeed</name> - <description>The limit you want to apply.</description> - <type>select</type> - <options> - <option> - <name>%</name> - <value>%</value> - </option> - <option> - <name>bit/s</name> - <value>b</value> - </option> - <option> - <name>Kilobit/s</name> - <value>Kb</value> - </option> - <option> - <name>Megabit/s</name> - <value>Mb</value> - </option> - <option> - <name>Gigabit/s</name> - <value>Gb</value> - </option> - </options> - <bindstofield>ezshaper->step4->bandwidthunit</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <stepsubmitphpaction>step4_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile> - </step> - <step> - <id>5</id> - <title>pfSense Traffic Shaper Wizard</title> - <description>Peer to Peer networking</description> - <disableallfieldsbydefault>true</disableallfieldsbydefault> - <fields> - <field> - <donotdisable>true</donotdisable> - <name>Enable</name> - <type>checkbox</type> - <typehint>Lower priority of Peer-to-Peer traffic</typehint> - <description>This will lower the priority of P2P traffic below all other traffic. Please check the items that you would like to prioritize lower than normal traffic.</description> - <enablefields>p2pCatchAll,Bandwidth,BandwidthSpeed,Aimster,BitTorrent,BuddyShare,CuteMX,DCplusplus,dcc,DirectConnect,DirectFileExpress,EDonkey2000,FastTrack,Gnutella,grouper,hotComm,HotlineConnect,iMesh,Napster,OpenNap,Scour,Shareaza,SongSpy,WinMX</enablefields> - <bindstofield>ezshaper->step5->enable</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>p2p Catch all</name> - <type>listtopic</type> - </field> - <field> - <name>p2pCatchAll</name> - <type>checkbox</type> - <typehint>When enabled, all uncategorized traffic is fed to the p2p queue.</typehint> - <bindstofield>ezshaper->step5->p2pcatchall</bindstofield> - </field> - <field> - <name>Bandwidth</name> - <type>input</type> - <validate>^[0-9]*$</validate> - <message>Speed must be numerical.</message> - <bindstofield>ezshaper->step5->bandwidth</bindstofield> - <combinefieldsbegin>true</combinefieldsbegin> - </field> - <field> - <combinefieldsend>true</combinefieldsend> - <dontdisplayname>true</dontdisplayname> - <dontcombinecells>true</dontcombinecells> - <donotdisable>true</donotdisable> - <name>BandwidthSpeed</name> - <description>The limit you want to apply.</description> - <type>select</type> - <options> - <option> - <name>%</name> - <value>%</value> - </option> - <option> - <name>bit/s</name> - <value>b</value> - </option> - <option> - <name>Kilobit/s</name> - <value>Kb</value> - </option> - <option> - <name>Megabit/s</name> - <value>Mb</value> - </option> - <option> - <name>Gigabit/s</name> - <value>Gb</value> - </option> - </options> - <bindstofield>ezshaper->step5->bandwidthunit</bindstofield> - </field> - <field> - <name>Enable/Disable specific P2P protocols</name> - <type>listtopic</type> - </field> - <field> - <name>Aimster</name> - <type>checkbox</type> - <typehint>Aimster and other P2P using the Aimster protocol and ports</typehint> - <bindstofield>ezshaper->step5->aimster</bindstofield> - </field> - <field> - <name>BitTorrent</name> - <type>checkbox</type> - <typehint>Bittorrent and other P2P using the Torrent protocol and ports</typehint> - <bindstofield>ezshaper->step5->bittorrent</bindstofield> - </field> - <field> - <name>BuddyShare</name> - <type>checkbox</type> - <typehint>BuddyShare and other P2P using the BuddyShare protocol and ports</typehint> - <bindstofield>ezshaper->step5->buddyshare</bindstofield> - </field> - <field> - <name>CuteMX</name> - <type>checkbox</type> - <typehint>CuteMX and other P2P using the CuteMX protocol and ports</typehint> - <bindstofield>ezshaper->step5->cutemx</bindstofield> - </field> - <field> - <name>DCplusplus</name> - <type>checkbox</type> - <typehint>DC++ and other P2P using the DC++ protocol and ports</typehint> - <bindstofield>ezshaper->step5->dcplusplus</bindstofield> - </field> - <field> - <name>DCC</name> - <type>checkbox</type> - <typehint>irc DCC file transfers</typehint> - <bindstofield>ezshaper->step5->dcc</bindstofield> - </field> - <field> - <name>DirectConnect</name> - <type>checkbox</type> - <typehint>DirectConnect and other P2P using the DirectConnect protocol and ports</typehint> - <bindstofield>ezshaper->step5->directconnect</bindstofield> - </field> - <field> - <name>DirectFileExpress</name> - <type>checkbox</type> - <typehint>DirectFileExpress and other P2P using the DirectFileExpress protocol and ports</typehint> - <bindstofield>ezshaper->step5->directfileexpress</bindstofield> - </field> - <field> - <name>eDonkey2000</name> - <type>checkbox</type> - <typehint>eDonkey and other P2P using the eDonkey protocol and ports</typehint> - <bindstofield>ezshaper->step5->edonkey2000</bindstofield> - </field> - <field> - <name>FastTrack</name> - <type>checkbox</type> - <typehint>FastTrack and other P2P using the FastTrack protocol and ports</typehint> - <bindstofield>ezshaper->step5->fasttrack</bindstofield> - </field> - <field> - <name>Gnutella</name> - <type>checkbox</type> - <typehint>Gnutella and other P2P using the Gnutella protocol and ports</typehint> - <bindstofield>ezshaper->step5->gnutella</bindstofield> - </field> - <field> - <name>grouper</name> - <type>checkbox</type> - <typehint>grouper and other P2P using the grouper protocol and ports</typehint> - <bindstofield>ezshaper->step5->grouper</bindstofield> - </field> - <field> - <name>hotComm</name> - <type>checkbox</type> - <typehint>hotComm and other P2P using the hotComm protocol and ports</typehint> - <bindstofield>ezshaper->step5->hotcomm</bindstofield> - </field> - <field> - <name>HotlineConnect</name> - <type>checkbox</type> - <typehint>HotlineConnect and other P2P using the HotlineConnect protocol and ports</typehint> - <bindstofield>ezshaper->step5->hotlineconnect</bindstofield> - </field> - <field> - <name>iMesh</name> - <type>checkbox</type> - <typehint>iMesh and other P2P using the iMesh protocol and ports</typehint> - <bindstofield>ezshaper->step5->imesh</bindstofield> - </field> - <field> - <name>Napster</name> - <type>checkbox</type> - <typehint>Napster and other P2P using the Napster protocol and ports</typehint> - <bindstofield>ezshaper->step5->napster</bindstofield> - </field> - <field> - <name>OpenNap</name> - <type>checkbox</type> - <typehint>OpenNap and other P2P using the OpenNap protocol and ports</typehint> - <bindstofield>ezshaper->step5->opennap</bindstofield> - </field> - <field> - <name>Scour</name> - <type>checkbox</type> - <typehint>Scour and other P2P using the Scour protocol and ports</typehint> - <bindstofield>ezshaper->step5->scour</bindstofield> - </field> - <field> - <name>Shareaza</name> - <type>checkbox</type> - <typehint>Shareaza and other P2P using the Shareaza protocol and ports</typehint> - <bindstofield>ezshaper->step5->shareaza</bindstofield> - </field> - <field> - <name>SongSpy</name> - <type>checkbox</type> - <typehint>SongSpy and other P2P using the SongSpy protocol and ports</typehint> - <bindstofield>ezshaper->step5->songspy</bindstofield> - </field> - <field> - <name>WinMX</name> - <type>checkbox</type> - <typehint>WinMX and other P2P using the WinMX protocol and ports</typehint> - <bindstofield>ezshaper->step5->winmx</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <stepsubmitphpaction>step5_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile> - </step> - <step> - <id>6</id> - <title>pfSense Traffic Shaper Wizard</title> - <disableallfieldsbydefault>true</disableallfieldsbydefault> - <description>Network Games</description> - <fields> - <field> - <name>Enable</name> - <type>checkbox</type> - <typehint>Prioritize network gaming traffic</typehint> - <description>This will raise the priority of gaming traffic to higher than most traffic.</description> - <enablefields>ARMA2,BattleNET,Battlefield2,Battlefield3,BattlefieldBC2,Borderlands,CallOfDuty,Counterstrike,Crysis2,DeltaForce,Dirt3,DOOM3,EmpireEarth,EveOnline,Everquest,Everquest2,FarCry,FarCry2,FarCry3,GunZOnline,HalfLife,Halo2,LeagueofLegends,Lineage2,MechwarriorOnline,Minecraft,OperationFlashpointDR,PlanetSide,PlanetSide2,PlayStation3,QuakeIII,QuakeIV,Steam,StarWarsTOR,TigerWoods2004PS2,TribesAscend,UnrealTournament,WolfensteinEnemyTerritory,WorldOfWarcraft,XBox360</enablefields> - <donotdisable>true</donotdisable> - <bindstofield>ezshaper->step6->enable</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>Enable/Disable specific games</name> - <type>listtopic</type> - </field> - <field> - <name>ARMA2</name> - <type>checkbox</type> - <typehint>ARMA 2</typehint> - <bindstofield>ezshaper->step6->arma2</bindstofield> - </field> - <field> - <name>BattleNET</name> - <type>checkbox</type> - <typehint>Battle.net - Virtually every game from Blizzard publishing should match this. This includes the following game series: Starcraft, Diablo, Warcraft. Guild Wars also uses this port.</typehint> - <bindstofield>ezshaper->step6->battlenet</bindstofield> - </field> - <field> - <name>Battlefield2</name> - <type>checkbox</type> - <typehint>Battlefield 2 - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->battlefield2</bindstofield> - </field> - <field> - <name>Battlefield3</name> - <type>checkbox</type> - <typehint>Battlefield 3 - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->battlefield3</bindstofield> - </field> - <field> - <name>BattlefieldBC2</name> - <type>checkbox</type> - <typehint>Battlefield: Bad Company 2</typehint> - <bindstofield>ezshaper->step6->battlefieldbc2</bindstofield> - </field> - <field> - <name>Borderlands</name> - <type>checkbox</type> - <typehint>Borderlands</typehint> - <bindstofield>ezshaper->step6->borderlands</bindstofield> - </field> - <field> - <name>CallOfDuty</name> - <type>checkbox</type> - <typehint>Call Of Duty (United Offensive)</typehint> - <bindstofield>ezshaper->step6->callofduty</bindstofield> - </field> - <field> - <name>Counterstrike</name> - <type>checkbox</type> - <typehint>Counterstrike. The ultimate 1st person shooter.</typehint> - <bindstofield>ezshaper->step6->counterstrike</bindstofield> - </field> - <field> - <name>Crysis2</name> - <type>checkbox</type> - <typehint>Crysis 2</typehint> - <bindstofield>ezshaper->step6->crysis2</bindstofield> - </field> - <field> - <name>DeltaForce</name> - <type>checkbox</type> - <typehint>Delta Force</typehint> - <bindstofield>ezshaper->step6->deltaforce</bindstofield> - </field> - <field> - <name>Dirt3</name> - <type>checkbox</type> - <typehint>Dirt 3</typehint> - <bindstofield>ezshaper->step6->dirt3</bindstofield> - </field> - <field> - <name>DOOM3</name> - <type>checkbox</type> - <typehint>DOOM3</typehint> - <bindstofield>ezshaper->step6->doom3</bindstofield> - </field> - <field> - <name>EmpireEarth</name> - <type>checkbox</type> - <typehint>Empire Earth</typehint> - <bindstofield>ezshaper->step6->empireearth</bindstofield> - </field> - <field> - <name>EveOnline</name> - <type>checkbox</type> - <typehint>EVE Online</typehint> - <bindstofield>ezshaper->step6->eveonline</bindstofield> - </field> - <field> - <name>Everquest</name> - <type>checkbox</type> - <typehint>Everquest - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->everquest</bindstofield> - </field> - <field> - <name>Everquest2</name> - <type>checkbox</type> - <typehint>Everquest II</typehint> - <bindstofield>ezshaper->step6->everquest2</bindstofield> - </field> - <field> - <name>FarCry</name> - <type>checkbox</type> - <typehint>Far Cry</typehint> - <bindstofield>ezshaper->step6->farcry</bindstofield> - </field> - <field> - <name>FarCry2</name> - <type>checkbox</type> - <typehint>Far Cry 2</typehint> - <bindstofield>ezshaper->step6->farcry2</bindstofield> - </field> - <field> - <name>FarCry3</name> - <type>checkbox</type> - <typehint>Far Cry 3</typehint> - <bindstofield>ezshaper->step6->farcry3</bindstofield> - </field> - <field> - <name>GunZOnline</name> - <type>checkbox</type> - <typehint>GunZ Online</typehint> - <bindstofield>ezshaper->step6->gunzonline</bindstofield> - </field> - <field> - <name>HalfLife</name> - <type>checkbox</type> - <typehint>Half-Life</typehint> - <bindstofield>ezshaper->step6->halflife</bindstofield> - </field> - <field> - <name>Halo2</name> - <type>checkbox</type> - <typehint>Halo2 via Xbox live</typehint> - <bindstofield>ezshaper->step6->halo2xbox</bindstofield> - </field> - <field> - <name>LeagueofLegends</name> - <type>checkbox</type> - <typehint>League of Legends - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->leagueoflegends</bindstofield> - </field> - <field> - <name>Lineage2</name> - <type>checkbox</type> - <typehint>Lineage II</typehint> - <bindstofield>ezshaper->step6->lineage2</bindstofield> - </field> - <field> - <name>MechwarriorOnline</name> - <type>checkbox</type> - <typehint>MechWarrior: Online - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->mechwarrioronline</bindstofield> - </field> - <field> - <name>Minecraft</name> - <type>checkbox</type> - <typehint>Minecraft</typehint> - <bindstofield>ezshaper->step6->minecraft</bindstofield> - </field> - <field> - <name>PlanetSide</name> - <type>checkbox</type> - <typehint>PlanetSide</typehint> - <bindstofield>ezshaper->step6->planetside</bindstofield> - </field> - <field> - <name>PlanetSide2</name> - <type>checkbox</type> - <typehint>PlanetSide 2</typehint> - <bindstofield>ezshaper->step6->planetside2</bindstofield> - </field> - <field> - <name>PlayStation3</name> - <type>checkbox</type> - <typehint>PlayStation 3</typehint> - <bindstofield>ezshaper->step6->playstation3</bindstofield> - </field> - <field> - <name>OperationFlashpointDR</name> - <type>checkbox</type> - <typehint>Operation Flashpoint: Dragon Rising</typehint> - <bindstofield>ezshaper->step6->operationflashpoint-dr</bindstofield> - </field> - <field> - <name>QuakeIII</name> - <type>checkbox</type> - <typehint>Quake III</typehint> - <bindstofield>ezshaper->step6->quakeiii</bindstofield> - </field> - <field> - <name>QuakeIV</name> - <type>checkbox</type> - <typehint>Quake IV</typehint> - <bindstofield>ezshaper->step6->quakeiv</bindstofield> - </field> - <field> - <name>StarWarsTOR</name> - <type>checkbox</type> - <typehint>StarWars: The Old Republic - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint> - <bindstofield>ezshaper->step6->starwarstor</bindstofield> - </field> - <field> - <name>Steam</name> - <type>checkbox</type> - <typehint>Steam (Includes: America's Army 3, Counter-Strike: Source, Counter-Strike: Global Offensive, Half-Life 2, COD: Black Ops Series, Borderlands 2, Natural Selection 2, Left 4 Dead Series, Portal 2)</typehint> - <bindstofield>ezshaper->step6->steam</bindstofield> - </field> - <field> - <name>TigerWoods2004PS2</name> - <type>checkbox</type> - <typehint>Tiger Woods 2004 for PS2</typehint> - <bindstofield>ezshaper->step6->tigerwoods2004ps2</bindstofield> - </field> - <field> - <name>TribesAscend</name> - <type>checkbox</type> - <typehint>Tribes Ascend</typehint> - <bindstofield>ezshaper->step6->tribesascend</bindstofield> - </field> - <field> - <name>UnrealTournament</name> - <type>checkbox</type> - <typehint>Unreal Tournament Series</typehint> - <bindstofield>ezshaper->step6->unrealtournament</bindstofield> - </field> - <field> - <name>WolfensteinEnemyTerritory</name> - <type>checkbox</type> - <typehint>Wolfenstein Enemy Territory</typehint> - <bindstofield>ezshaper->step6->wolfet</bindstofield> - </field> - <field> - <name>WorldOfWarcraft</name> - <type>checkbox</type> - <typehint>World of Warcraft</typehint> - <bindstofield>ezshaper->step6->wow</bindstofield> - </field> - <field> - <name>Xbox360</name> - <type>checkbox</type> - <typehint>XBox 360 and Games for Windows Live</typehint> - <bindstofield>ezshaper->step6->xbox360</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile> - </step> - <step> - <id>7</id> - <title>pfSense Traffic Shaper Wizard</title> - <disableallfieldsbydefault>true</disableallfieldsbydefault> - <description>Raise or lower other Applications</description> - <fields> - <field> - <name>Enable</name> - <type>checkbox</type> - <typehint>Other networking protocols</typehint> - <description>This will help raise or lower the priority of other protocols higher than most traffic.</description> - <enablefields>AIM,AppleRemoteDesktop,DNS,HTTP,ICMP,ICQ,IMAP,IPSEC,IRC,Jabber,LotusNotes,MSN,MSRDP,MySqlServer,PCAnywhere,POP3,PPTP,RTSP,SMB,SMTP,SNMP,StreamingMP3,TeamSpeak,VNC,NNTP,CVSUP,Slingbox,HBCI</enablefields> - <donotdisable>true</donotdisable> - <bindstofield>ezshaper->step7->enable</bindstofield> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - <field> - <name>Remote Service / Terminal emulation</name> - <type>listtopic</type> - </field> - <field> - <name>MSRDP</name> - <type>select</type> - <bindstofield>ezshaper->step7->msrdp</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Microsoft Remote Desktop Protocol</typehint> - </field> - <field> - <name>VNC</name> - <bindstofield>ezshaper->step7->vnc</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Virtual Network Computing</typehint> - </field> - <field> - <name>AppleRemoteDesktop</name> - <bindstofield>ezshaper->step7->appleremotedesktop</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Apple Remote Desktop</typehint> - </field> - <field> - <name>PCAnywhere</name> - <bindstofield>ezshaper->step7->pcanywhere</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Symantec PC Anywhere</typehint> - </field> - <field> - <name>Messengers</name> - <type>listtopic</type> - </field> - <field> - <name>IRC</name> - <type>select</type> - <bindstofield>ezshaper->step7->irc</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Internet Relay Chat</typehint> - </field> - <field> - <name>Jabber</name> - <type>select</type> - <bindstofield>ezshaper->step7->jabber</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Jabber instant messenger</typehint> - </field> - <field> - <name>ICQ</name> - <bindstofield>ezshaper->step7->icq</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>ICQ</typehint> - </field> - <field> - <name>AIM</name> - <bindstofield>ezshaper->step7->aolinstantmessenger</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>AOL Instant Messenger</typehint> - </field> - <field> - <name>MSN</name> - <bindstofield>ezshaper->step7->msnmessenger</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>MSN Messenger</typehint> - </field> - <field> - <name>Teamspeak</name> - <bindstofield>ezshaper->step7->teamspeak</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>TeamSpeak</typehint> - </field> - <field> - <name>VPN</name> - <type>listtopic</type> - </field> - <field> - <name>PPTP</name> - <type>select</type> - <bindstofield>ezshaper->step7->pptp</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Microsoft Point to Point tunneling protocol</typehint> - </field> - <field> - <name>IPSEC</name> - <type>select</type> - <bindstofield>ezshaper->step7->ipsec</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>IPSEC VPN traffic</typehint> - </field> - <field> - <name>Multimedia/Streaming</name> - <type>listtopic</type> - </field> - <field> - <name>StreamingMP3</name> - <type>select</type> - <bindstofield>ezshaper->step7->streamingmp3</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Streaming Media</typehint> - </field> - <field> - <name>RTSP</name> - <bindstofield>ezshaper->step7->rtsp</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>RealTime streaming protocol</typehint> - </field> - <field> - <name>Web</name> - <type>listtopic</type> - </field> - <field> - <name>HTTP</name> - <type>select</type> - <bindstofield>ezshaper->step7->http</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>HTTP and HTTPS aka Web Traffic</typehint> - </field> - <field> - <name>Mail</name> - <type>listtopic</type> - </field> - <field> - <name>SMTP</name> - <type>select</type> - <bindstofield>ezshaper->step7->smtp</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Mail Protocol</typehint> - </field> - <field> - <name>POP3</name> - <type>select</type> - <bindstofield>ezshaper->step7->pop3</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>POP3 Protocol</typehint> - </field> - <field> - <name>IMAP</name> - <bindstofield>ezshaper->step7->imap</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>IMAP Protocol</typehint> - </field> - <field> - <name>LotusNotes</name> - <bindstofield>ezshaper->step7->lotusnotes</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Lotus Notes</typehint> - </field> - <field> - <name>Miscellaneous</name> - <type>listtopic</type> - </field> - <field> - <name>DNS</name> - <type>select</type> - <bindstofield>ezshaper->step7->dns</bindstofield> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Domain Name Services</typehint> - </field> - <field> - <name>ICMP</name> - <bindstofield>ezshaper->step7->icmp</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>ICMP Protocol</typehint> - </field> - <field> - <name>SMB</name> - <bindstofield>ezshaper->step7->smb</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Microsoft SMB Protocol and friends</typehint> - </field> - <field> - <name>SNMP</name> - <bindstofield>ezshaper->step7->snmp</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Simple Network Management Protocol</typehint> - </field> - <field> - <name>MySQLServer</name> - <bindstofield>ezshaper->step7->mysqlserver</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>MySQL Server</typehint> - </field> - <field> - <name>NNTP</name> - <bindstofield>ezshaper->step7->nntp</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Internet News</typehint> - </field> - <field> - <name>CVSUP</name> - <bindstofield>ezshaper->step7->cvsup</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>CVSUP</typehint> - </field> - <field> - <name>Slingbox</name> - <bindstofield>ezshaper->step7->slingbox</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Slingbox</typehint> - </field> - <field> - <name>HBCI</name> - <bindstofield>ezshaper->step7->hbci</bindstofield> - <type>select</type> - <options> - <option> - <name>Default priority</name> - <value>D</value> - </option> - <option> - <name>Higher priority</name> - <value>H</value> - </option> - <option> - <name>Lower priority</name> - <value>L</value> - </option> - </options> - <typehint>Home Banking Computer Interface, for communicating with your bank</typehint> - </field> - <field> - <name>Next</name> - <type>submit</type> - </field> - </fields> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile> - </step> - <step> - <id>8</id> - <title>pfSense Traffic Shaper Wizard</title> - <field> - <name>Reload profile notice</name> - <type>listtopic</type> - </field> - <description> After pressing Finish the system will load the new profile.<br/> Please note that this may take a moment.<br/> Also note that the traffic shaper is stateful meaning that only new connections will be shaped.<br/> If this is an issue please reset the state table after loading the profile.<br/></description> - <fields> - <field> - <name>Finish</name> - <type>submit</type> - </field> - </fields> - <stepsubmitphpaction>step8_stepsubmitphpaction();</stepsubmitphpaction> - <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile> - </step> -</pfsensewizard> |