summaryrefslogtreecommitdiffstats
path: root/usr/local/www/wizards
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/wizards')
-rw-r--r--usr/local/www/wizards/openvpn_wizard.inc676
-rw-r--r--usr/local/www/wizards/openvpn_wizard.xml987
-rw-r--r--usr/local/www/wizards/setup_wizard.xml703
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc1664
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_dedicated.xml1649
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc1741
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_multi_all.xml1657
7 files changed, 0 insertions, 9077 deletions
diff --git a/usr/local/www/wizards/openvpn_wizard.inc b/usr/local/www/wizards/openvpn_wizard.inc
deleted file mode 100644
index ee530a2..0000000
--- a/usr/local/www/wizards/openvpn_wizard.inc
+++ /dev/null
@@ -1,676 +0,0 @@
-<?php
-/*
- Copyright (C) 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.
-
- pfSense_MODULE: openvpn
-*/
-require_once("openvpn.inc");
-
-function has_special_chars($text) {
- return preg_match('/[^A-Za-z0-9 _-]/', $text);
-}
-
-function step1_submitphpaction() {
- global $stepid, $config;
- if ($_POST['authtype'] == "local") {
- $stepid = 4;
- $config['ovpnserver']['step1']['type'] = "local";
- } else if ($_POST['authtype'] == "ldap") {
- $stepid = 0;
- } else if ($_POST['authtype'] == "radius") {
- $stepid = 2;
- $config['ovpnserver']['step1']['type'] = "radius";
- unset($config['ovpnserver']['step1']['uselist']);
- }
-}
-
-function step2_stepbeforeformdisplay() {
- global $pkg, $stepid;
-
- $fields =& $pkg['step'][1]['fields']['field'];
-
- $found = false;
- $authlist = auth_get_authserver_list();
- $fields[1]['options']['option'] = array();
- foreach ($authlist as $i => $auth) {
- if ($auth['type'] != "ldap")
- continue;
- $found = true;
- $opts = array();
- $opts['name'] = $auth['name'];
- $opts['value'] = $auth['name'];
- $fields[1]['options']['option'][] = $opts;
- }
- if ($found == false) {
- $stepid = 2;
- }
-}
-
-function step2_submitphpaction() {
- global $stepid;
-
- if (isset($_POST['next'])) {
- $_POST['uselist'] = "";
- $stepid +=3;
- }
-}
-
-function step3_submitphpaction() {
- global $stepid, $savemsg, $config;
-
- /* Default LDAP port is 389 for TCP and 636 for SSL */
- if (empty($_POST['port'])) {
- if ($_POST['transport'] == "tcp")
- $config['ovpnserver']['step2']['port'] = 389;
- elseif ($_POST['transport'] == "ssl")
- $config['ovpnserver']['step2']['port'] = 636;
- } elseif (!is_port($_POST['port'])) {
- $stepid--;
- $savemsg = "Please enter a valid port number.";
- }
-
- if (empty($_POST['name']) || empty($_POST['ip']) ||empty($_POST['transport']) ||
- empty($_POST['scope']) || empty($_POST['basedn']) || empty($_POST['authscope']) || empty($_POST['nameattr'])) {
- $stepid--;
- $savemsg = "Please enter all information for authentication server.";
- } else if (count(($authcfg = auth_get_authserver($_POST['name']))) > 0) {
- $stepid--;
- $savemsg = "Please choose a different name because an authentication server with this name already exists.";
- } elseif (!is_fqdn($_POST['ip']) && !is_ipaddr($_POST['ip'])) {
- $stepid--;
- $savemsg = "Please enter a valid IP address or hostname for the authentication server.";
- } else {
- $config['ovpnserver']['step2']['uselist'] = "on";
- $_POST['uselist'] = "on";
- $stepid += 2;
- }
-}
-
-function step4_stepbeforeformdisplay() {
- global $pkg, $stepid;
-
- $fields =& $pkg['step'][3]['fields']['field'];
-
- $found = false;
- $authlist = auth_get_authserver_list();
- $fields[1]['options']['option'] = array();
- foreach ($authlist as $i => $auth) {
- if ($auth['type'] != "radius")
- continue;
- $found = true;
- $opts = array();
- $opts['name'] = $auth['name'];
- $opts['value'] = $auth['name'];
- $fields[1]['options']['option'][] = $opts;
- }
- if ($found == false)
- $stepid = 4;
-}
-
-function step4_submitphpaction() {
- global $stepid;
-
- if (isset($_POST['next'])) {
- $_POST['uselist'] = "";
- $stepid++;
- }
-}
-
-function step5_submitphpaction() {
- global $stepid, $savemsg, $config;
-
- /* Default RADIUS Auth port = 1812 */
- if (empty($_POST['port'])) {
- $config['ovpnserver']['step2']['port'] = 1812;
- } elseif (!is_port($_POST['port'])) {
- $stepid--;
- $savemsg = "Please enter a valid port number.";
- }
-
- if (empty($_POST['name']) || empty($_POST['ip']) || empty($_POST['secret'])) {
- $stepid--;
- $savemsg = "Please enter all information for authentication server.";
- } else if (count(($authcfg = auth_get_authserver($_POST['name']))) > 0) {
- $stepid--;
- $savemsg = "Please choose a different name because an authentication server with this name already exists.";
- } elseif (!is_fqdn($_POST['ip']) && !is_ipaddr($_POST['ip'])) {
- $stepid--;
- $savemsg = "Please enter a valid IP address or hostname for the authentication server.";
- } else {
- $config['ovpnserver']['step2']['uselist'] = "on";
- $_POST['uselist'] = "on";
- }
-}
-
-function step6_stepbeforeformdisplay() {
- global $stepid, $config;
-
- if (count($config['ca']) < 1) {
- $stepid++;
- }
-}
-
-function step6_submitphpaction() {
- global $stepid, $config;
-
- if (isset($_POST['next'])) {
- $_POST['uselist'] = "";
- unset($config['ovpnserver']['step6']['uselist']);
- $stepid++;
- } else {
- $config['ovpnserver']['step6']['uselist'] = "on";
- $_POST['uselist'] = "on";
- }
-}
-
-function step7_submitphpaction() {
- global $input_errors, $stepid, $savemsg, $_POST, $config;
-
- $canames = array();
- $cacns = array();
- if (is_array($config['ca'])) {
- foreach($config['ca'] as $ca) {
- $canames[] = $ca['descr'];
- $cainfo = cert_get_subject_hash($ca['crt']);
- $cacns[] = $cainfo["CN"];
- }
- }
-
- if (preg_match("/[\?\>\<\&\/\\\"\']/", $_POST['descr'])) {
- $input_errors[] = "The field 'Descriptive Name' contains invalid characters.";
- }
-
- if (empty($_POST['descr']) || empty($_POST['keylength']) || empty($_POST['lifetime']) ||
- empty($_POST['country']) || empty($_POST['state']) || empty($_POST['city']) ||
- empty($_POST['organization']) || empty($_POST['email'])) {
- $stepid--;
- $savemsg = "Please enter all information for the new Certificate Authority.";
- } elseif (has_special_chars($_POST['country']) || has_special_chars($_POST['state']) ||
- has_special_chars($_POST['city']) || has_special_chars($_POST['organization'])) {
- $stepid--;
- $input_errors[] = "Please do not use special characters in Certificate field names.";
- } elseif (in_array($_POST['descr'], $canames) || in_array($_POST['descr'], $cacns)) {
- $stepid--;
- $savemsg = "Please enter a different name for the Certificate Authority. A Certificate Authority with that name already exists.";
- } elseif (strlen($_POST['country']) != 2) {
- $stepid--;
- $savemsg = "Please enter only a two-letter ISO country code";
- } else {
- $config['ovpnserver']['step6']['uselist'] = "on";
- $_POST['uselist'] = "on";
- }
-}
-
-function step8_stepbeforeformdisplay() {
- global $stepid, $config;
-
- if (count($config['cert']) < 1 ||
- (count($config['cert']) == 1 && stristr($config['cert'][0]['descr'], "webconf"))) {
- $stepid++;
- }
-}
-
-function step8_submitphpaction() {
- global $stepid, $config, $_POST;
-
- if (isset($_POST['next'])) {
- $_POST['uselist'] = "";
- unset($config['ovpnserver']['step9']['uselist']);
- $stepid++;
- } else {
- $config['ovpnserver']['step6']['uselist'] = "on";
- $_POST['uselist'] = "on";
- }
-}
-
-function step9_stepbeforeformdisplay() {
- global $config, $pkg, $stepid;
-
- $pconfig = $config['ovpnserver'];
-
- if (isset($pconfig['step6']['uselist'])) {
- $country = $pconfig['step6']['country'];
- $state = $pconfig['step6']['state'];
- $city = $pconfig['step6']['city'];
- $org = $pconfig['step6']['organization'];
- $email = $pconfig['step6']['email'];
- } else {
- $ca = lookup_ca($pconfig['step6']['authcertca']);
- $cavl = cert_get_subject_array($ca['crt']);
- $country = $cavl[0]['v'];
- $state = $cavl[1]['v'];
- $city = $cavl[2]['v'];
- $org = $cavl[3]['v'];
- $email = $cavl[4]['v'];
- }
- $fields =& $pkg['step'][$stepid]['fields']['field'];
-
- foreach ($fields as $idx => $field) {
- switch ($field['name']) {
- case 'country':
- $fields[$idx]['value'] = $country;
- break;
- case 'state':
- $fields[$idx]['value'] = $state;
- break;
- case 'city':
- $fields[$idx]['value'] = $city;
- break;
- case 'organization':
- $fields[$idx]['value'] = $org;
- break;
- case 'email':
- $fields[$idx]['value'] = $email;
- break;
- }
- }
-}
-
-function step9_submitphpaction() {
- global $input_errors, $stepid, $savemsg, $_POST, $config;
-
- $certnames = array();
- $certcns = array();
- if (is_array($config['cert'])) {
- foreach($config['cert'] as $cert) {
- $certnames[] = $cert['descr'];
- $certinfo = cert_get_subject_hash($cert['crt']);
- $certcns[] = $certinfo["CN"];
- }
- }
-
- if (preg_match("/[\?\>\<\&\/\\\"\']/", $_POST['descr'])) {
- $input_errors[] = "The field 'Descriptive Name' contains invalid characters.";
- }
-
- if (empty($_POST['descr']) || empty($_POST['keylength']) || empty($_POST['lifetime']) ||
- empty($_POST['country']) || empty($_POST['state']) || empty($_POST['city']) ||
- empty($_POST['organization']) || empty($_POST['email'])) {
- $stepid--;
- $savemsg = "Please enter all information for the new certificate.";
- } elseif (has_special_chars($_POST['country']) || has_special_chars($_POST['state']) ||
- has_special_chars($_POST['city']) || has_special_chars($_POST['organization'])) {
- $stepid--;
- $input_errors[] = "Please do not use special characters in Certificate field names.";
- } elseif (in_array($_POST['descr'], $certnames) || in_array($_POST['descr'], $certcns)) {
- $stepid--;
- $savemsg = "Please enter a different name for the Certificate. A Certificate with that name/common name already exists.";
- } elseif (strlen($_POST['country']) != 2) {
- $stepid--;
- $savemsg = "Please enter only a two-letter ISO country code";
- } else {
- $config['ovpnserver']['step9']['uselist'] = "on";
- $_POST['uselist'] = "on";
- }
-}
-
-function step10_stepbeforeformdisplay() {
- global $pkg, $stepid, $netbios_nodetypes;
-
- foreach ($pkg['step'][$stepid]['fields']['field'] as $idx => $field) {
- if ($field['name'] == "crypto") {
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'] = array();
- $cipherlist = openvpn_get_cipherlist();
- foreach ($cipherlist as $name => $desc) {
- $opt = array();
- $opt['name'] = $desc;
- $opt['value'] = $name;
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'][] = $opt;
- }
- } else if ($field['name'] == "digest") {
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'] = array();
- $digestlist = openvpn_get_digestlist();
- foreach ($digestlist as $name => $desc) {
- $opt = array();
- $opt['name'] = $desc;
- $opt['value'] = $name;
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'][] = $opt;
- }
- } else if ($field['name'] == "compression") {
- global $openvpn_compression_modes;
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'] = array();
- foreach ($openvpn_compression_modes as $name => $desc) {
- $opt = array();
- $opt['name'] = $desc;
- $opt['value'] = $name;
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'][] = $opt;
- }
- } else if ($field['name'] == "engine") {
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'] = array();
- $engines = openvpn_get_engines();
- foreach ($engines as $name => $desc) {
- $opt = array();
- $opt['name'] = $desc;
- $opt['value'] = $name;
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'][] = $opt;
- }
- } else if ($field['name'] == "nbttype") {
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'] = array();
- foreach ($netbios_nodetypes as $type => $name) {
- $opt = array();
- $opt['name'] = $name;
- $opt['value'] = $type;
- $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'][] = $opt;
- }
- } else if ($field['name'] == "localport") {
- $pkg['step'][$stepid]['fields']['field'][$idx]['value'] = openvpn_port_next('UDP');
- }
- }
-}
-
-function step10_submitphpaction() {
- global $savemsg, $stepid;
-
- /* Default OpenVPN port to next available port if left empty. */
- if (empty($_POST['localport']))
- $pconfig["step10"]["localport"] = openvpn_port_next('UDP');
-
- /* input validation */
- if ($result = openvpn_validate_port($_POST['localport'], 'Local port'))
- $input_errors[] = $result;
-
- if ($result = openvpn_validate_cidr($_POST['tunnelnet'], 'Tunnel Network', false, "ipv4"))
- $input_errors[] = $result;
-
- if ($result = openvpn_validate_cidr($_POST['localnet'], 'Local Network', true, "ipv4"))
- $input_errors[] = $result;
-
- $portused = openvpn_port_used($_POST['protocol'], $_POST['interface'], $_POST['localport']);
- if ($portused != 0)
- $input_errors[] = "The specified 'Local port' is in use. Please enter a port not already in use.";
-
- if (!isset($_POST['generatetlskey']) && isset($_POST['tlsauthentication']))
- if (!strstr($_POST['tlssharedkey'], "-----BEGIN OpenVPN Static key V1-----") ||
- !strstr($_POST['tlssharedkey'], "-----END OpenVPN Static key V1-----"))
- $input_errors[] = "The field 'TLS Authentication Key' does not appear to be valid";
-
- if (!empty($_POST['dnsserver1']) && !is_ipaddr(trim($_POST['dnsserver1'])))
- $input_errors[] = "The field 'DNS Server #1' must contain a valid IP address";
- if (!empty($_POST['dnsserver2']) && !is_ipaddr(trim($_POST['dnsserver2'])))
- $input_errors[] = "The field 'DNS Server #2' must contain a valid IP address";
- if (!empty($_POST['dnsserver3']) && !is_ipaddr(trim($_POST['dnsserver3'])))
- $input_errors[] = "The field 'DNS Server #3' must contain a valid IP address";
- if (!empty($_POST['dnsserver4']) && !is_ipaddr(trim($_POST['dnsserver4'])))
- $input_errors[] = "The field 'DNS Server #4' must contain a valid IP address";
-
- if (!empty($_POST['ntpserver1']) && !is_ipaddr(trim($_POST['ntpserver1'])))
- $input_errors[] = "The field 'NTP Server #1' must contain a valid IP address";
- if (!empty($_POST['ntpserver2']) && !is_ipaddr(trim($_POST['ntpserver2'])))
- $input_errors[] = "The field 'NTP Server #2' must contain a valid IP address";
-
- if (!empty($_POST['winsserver1']) && !is_ipaddr(trim($_POST['winsserver1'])))
- $input_errors[] = "The field 'WINS Server #1' must contain a valid IP address";
- if (!empty($_POST['winsserver2']) && !is_ipaddr(trim($_POST['winsserver2'])))
- $input_errors[] = "The field 'WINS Server #2' must contain a valid IP address";
-
- if ($_POST['concurrentcon'] && !is_numeric($_POST['concurrentcon']))
- $input_errors[] = "The field 'Concurrent connections' must be numeric.";
-
- if (empty($_POST['tunnelnet']))
- $input_errors[] = "You must specify a 'Tunnel network'.";
-
- if (count($input_errors) > 0) {
- $savemsg = $input_errors[0];
- $stepid = $stepid - 1;
- }
-}
-
-function step12_submitphpaction() {
- global $config;
-
- $pconfig = $config['ovpnserver'];
-
- if (!is_array($config['ovpnserver'])) {
- $message = "No configuration found, please try again.";
- header("Location:wizard.php?xml=openvpn_wizard.xml&stepid=1&message={$message}");
- exit;
- }
-
- if ($pconfig['step1']['type'] == "local") {
- $auth = array();
- $auth['name'] = "Local Database";
- $auth['type'] = "local";
- } else if (isset($pconfig['step2']['uselist'])) {
- $auth = array();
- $auth['type'] = $pconfig['step1']['type'];
- $auth['refid'] = uniqid();
- $auth['name'] = $pconfig['step2']['authtype'];
-
- if ($auth['type'] == "ldap") {
- $auth['host'] = $pconfig['step2']['ip'];
- $auth['ldap_port'] = $pconfig['step2']['port'];
- if ($pconfig['step1']['transport'] == "tcp")
- $auth['ldap_urltype'] = 'TCP - Standard';
- else
- $auth['ldap_urltype'] = 'SSL - Encrypted';
- $auth['ldap_protver'] = 3;
- $auth['ldap_scope'] = $pconfig['step2']['scope'];
- $auth['ldap_basedn'] = $pconfig['step2']['basedn'];
- $auth['ldap_authcn'] = $pconfig['step2']['authscope'];
- $auth['ldap_binddn'] = $pconfig['step2']['userdn'];
- $auth['ldap_bindpw'] = $pconfig['step2']['passdn'];
- $auth['ldap_attr_user'] = $pconfig['step1']['nameattr'];
- $auth['ldap_attr_member'] = $pconfig['step1']['memberattr'];
- $auth['ldap_attr_group'] = $pconfig['step1']['groupattr'];
- } else if ($auth['type'] == "radius") {
- $auth['host'] = $pconfig['step2']['ip'];
- $auth['radius_auth_port'] = $pconfig['step2']['port'];
- $auth['radius_secret'] = $pconfig['step2']['password'];
- $auth['radius_srvcs'] = "auth";
- }
- if (!is_array($config['system']['authserver']))
- $config['system']['authserver'] = array();
-
- $config['system']['authserver'][] = $auth;
- } else if (!isset($pconfig['step2']['uselist']) && empty($pconfig['step2']['authserv'])) {
- $message = "Please choose an authentication server .";
- header("Location:wizard.php?xml=openvpn_wizard.xml&stepid=1&message={$message}");
- exit;
- } else if (!($auth = auth_get_authserver($pconfig['step2']['authserv']))) {
- $message = "An invalid authentication server has been specified.";
- header("Location:wizard.php?xml=openvpn_wizard.xml&stepid=1&message={$message}");
- exit;
- }
-
- if (isset($pconfig['step6']['uselist']) && !empty($pconfig['step6']['certca'])) {
- $ca = array();
- $ca['refid'] = uniqid();
- $ca['descr'] = $pconfig['step6']['certca'];
- $dn = array(
- 'countryName' => $pconfig['step6']['country'],
- 'stateOrProvinceName' => $pconfig['step6']['state'],
- 'localityName' => $pconfig['step6']['city'],
- 'organizationName' => $pconfig['step6']['organization'],
- 'emailAddress' => $pconfig['step6']['email'],
- 'commonName' => $pconfig['step6']['certca']);
-
- ca_create($ca, $pconfig['step6']['keylength'], $pconfig['step6']['lifetime'], $dn, "sha256");
- if (!is_array($config['ca']))
- $config['ca'] = array();
-
- $config['ca'][] = $ca;
- } else if (!isset($pconfig['step6']['uselist']) && empty($pconfig['step6']['authcertca'])) {
- $message = "Please choose a Certificate Authority.";
- header("Location:wizard.php?xml=openvpn_wizard.xml&stepid=5&message={$message}");
- exit;
- } else if (!($ca = lookup_ca($pconfig['step6']['authcertca']))) {
- $message = "An invalid Certificate Authority has been specified.";
- header("Location:wizard.php?xml=openvpn_wizard.xml&stepid=5&message={$message}");
- exit;
- }
-
- if (isset($pconfig['step9']['uselist'])) {
- $cert = array();
- $cert['refid'] = uniqid();
- $cert['descr'] = $pconfig['step9']['certname'];
- $dn = array(
- 'countryName' => $pconfig['step9']['country'],
- 'stateOrProvinceName' => $pconfig['step9']['state'],
- 'localityName' => $pconfig['step9']['city'],
- 'organizationName' => $pconfig['step9']['organization'],
- 'emailAddress' => $pconfig['step9']['email'],
- 'commonName' => $pconfig['step9']['certname']);
-
- cert_create($cert, $ca['refid'], $pconfig['step9']['keylength'], $pconfig['step9']['lifetime'], $dn, 'server', "sha256");
- if (!is_array($config['cert']))
- $config['cert'] = array();
-
- $config['cert'][] = $cert;
- } else if (!isset($pconfig['step9']['uselist']) && empty($pconfig['step9']['authcertname'])) {
- $message = "Please choose a Certificate.";
- header("Location:wizard.php?xml=openvpn_wizard.xml&stepid=7&message={$message}");
- exit;
- } else if (!($cert = lookup_cert($pconfig['step9']['authcertname']))) {
- $message = "An invalid Certificate has been specified.";
- header("Location:wizard.php?xml=openvpn_wizard.xml&stepid=7&message={$message}");
- exit;
- }
- $server = array();
- $server['vpnid'] = openvpn_vpnid_next();
- switch ($auth['type']) {
- case "ldap":
- $server['authmode'] = $auth['name'];
- $server['mode'] = "server_user";
- break;
- case "radius":
- $server['authmode'] = $auth['name'];
- $server['mode'] = "server_user";
- break;
- default:
- $server['authmode'] = "Local Database";
- $server['mode'] = "server_tls_user";
- break;
- }
- $server['caref'] = $ca['refid'];
- $server['certref'] = $cert['refid'];
- $server['protocol'] = $pconfig['step10']['protocol'];
- $server['interface'] = $pconfig['step10']['interface'];
- if (isset($pconfig['step10']['localport']))
- $server['local_port'] = $pconfig['step10']['localport'];
-
- if (strlen($pconfig['step10']['descr']) > 30)
- $pconfig['step10']['descr'] = substr($pconfig['step10']['descr'], 0, 30);
- $server['description'] = $pconfig['step10']['descr'];
- $server['custom_options'] = $pconfig['step10']['advanced'];
- if (isset($pconfig['step10']['tlsauth'])) {
- if (isset($pconfig['step10']['gentlskey']))
- $tlskey = openvpn_create_key();
- else
- $tlskey = $pconfig['step10']['tlskey'];
- $server['tls'] = base64_encode($tlskey);
- }
- $server['dh_length'] = $pconfig['step10']['dhkey'];
- $server['tunnel_network'] = $pconfig['step10']['tunnelnet'];
- if (isset($pconfig['step10']['rdrgw']))
- $server['gwredir'] = $pconfig['step10']['rdrgw'];
- if (isset($pconfig['step10']['localnet']))
- $server['local_network'] = $pconfig['step10']['localnet'];
- if (isset($pconfig['step10']['concurrentcon']))
- $server['maxclients'] = $pconfig['step10']['concurrentcon'];
- if (isset($pconfig['step10']['compression']))
- $server['compression'] = $pconfig['step10']['compression'];
- if (isset($pconfig['step10']['tos']))
- $server['passtos'] = $pconfig['step10']['tos'];
- if (isset($pconfig['step10']['interclient']))
- $server['client2client'] = $pconfig['step10']['interclient'];
- if (isset($pconfig['step10']['duplicate_cn']))
- $server['duplicate_cn'] = $pconfig['step10']['duplicate_cn'];
- if (isset($pconfig['step10']['dynip']))
- $server['dynamic_ip'] = $pconfig['step10']['dynip'];
- if (isset($pconfig['step10']['addrpool']))
- $server['pool_enable'] = $pconfig['step10']['addrpool'];
- if (isset($pconfig['step10']['defaultdomain']))
- $server['dns_domain'] = $pconfig['step10']['defaultdomain'];
- if (isset($pconfig['step10']['dns1']))
- $server['dns_server1'] = $pconfig['step10']['dns1'];
- if (isset($pconfig['step10']['dns2']))
- $server['dns_server2'] = $pconfig['step10']['dns2'];
- if (isset($pconfig['step10']['dns3']))
- $server['dns_server3'] = $pconfig['step10']['dns3'];
- if (isset($pconfig['step10']['dns4']))
- $server['dns_server4'] = $pconfig['step10']['dns4'];
- if (isset($pconfig['step10']['ntp1']))
- $server['ntp_server1'] = $pconfig['step10']['ntp1'];
- if (isset($pconfig['step10']['ntp2']))
- $server['ntp_server2'] = $pconfig['step10']['ntp2'];
- if (isset($pconfig['step10']['wins1']))
- $server['wins_server1'] = $pconfig['step10']['wins1'];
- if (isset($pconfig['step10']['wins2']))
- $server['wins_server2'] = $pconfig['step10']['wins2'];
- if (isset($pconfig['step10']['nbtenable'])) {
- $server['netbios_ntype'] = $pconfig['step10']['nbttype'];
- if (isset($pconfig['step10']['nbtscope']))
- $server['netbios_scope'] = $pconfig['step10']['nbtscope'];
- $server['netbios_enable'] = $pconfig['step10']['nbtenable'];
- }
- $server['crypto'] = $pconfig['step10']['crypto'];
- $server['digest'] = $pconfig['step10']['digest'];
- $server['engine'] = $pconfig['step10']['engine'];
-
- if (isset($pconfig['step11']['ovpnrule'])) {
- $rule = array();
- $rule['descr'] = sprintf(gettext("OpenVPN %s wizard"),$server['description']);
- /* Ensure the rule descr is not too long for pf to handle */
- if (strlen($rule['descr']) > 52)
- $rule['descr'] = substr($rule['descr'], 0, 52);
- $rule['direction'] = "in";
- $rule['source']['any'] = TRUE;
- $rule['destination']['network'] = $server['interface'] . "ip";
- $rule['destination']['port'] = $server['local_port'];
- $rule['interface'] = $server['interface'];
- $rule['protocol'] = strtolower($server['protocol']);
- $rule['type'] = "pass";
- $rule['enabled'] = "on";
- $rule['created'] = make_config_revision_entry(null, gettext("OpenVPN Wizard"));
- $config['filter']['rule'][] = $rule;
- }
- if (isset($pconfig['step11']['ovpnallow'])) {
- $rule = array();
- $rule['descr'] = sprintf(gettext("OpenVPN %s wizard"),$server['description']);
- /* Ensure the rule descr is not too long for pf to handle */
- if (strlen($rule['descr']) > 52)
- $rule['descr'] = substr($rule['descr'], 0, 52);
- $rule['source']['any'] = TRUE;
- $rule['destination']['any'] = TRUE;
- $rule['interface'] = "openvpn";
- //$rule['protocol'] = $server['protocol'];
- $rule['type'] = "pass";
- $rule['enabled'] = "on";
- $rule['created'] = make_config_revision_entry(null, gettext("OpenVPN Wizard"));
- $config['filter']['rule'][] = $rule;
- }
-
- if (!is_array($config['openvpn']['openvpn-server']))
- $config['openvpn']['openvpn-server'] = array();
-
- $config['openvpn']['openvpn-server'][] = $server;
-
- openvpn_resync('server', $server);
- write_config();
- header("Location: vpn_openvpn_server.php");
- exit;
-}
-
-?>
diff --git a/usr/local/www/wizards/openvpn_wizard.xml b/usr/local/www/wizards/openvpn_wizard.xml
deleted file mode 100644
index 6aea7fd..0000000
--- a/usr/local/www/wizards/openvpn_wizard.xml
+++ /dev/null
@@ -1,987 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<pfsensewizard>
-<copyright>
-/*
- part of pfSense (https://www.pfsense.org/)
-
- Copyright (C) 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.
-*/
-</copyright>
-<totalsteps>12</totalsteps>
-<step>
- <id>1</id>
- <title>OpenVPN Wizard: Authentication Type Selection</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <type>listtopic</type>
- <name>Select an Authentication Backend Type</name>
- </field>
- <field>
- <type>select</type>
- <displayname>Type of Server</displayname>
- <name>authtype</name>
- <description>&lt;br/&gt;&lt;b&gt;NOTE:&lt;/b&gt; If you are unsure, leave this set to "Local User Access."</description>
- <bindstofield>ovpnserver->step1->type</bindstofield>
- <options>
- <option>
- <name>Local User Access</name>
- <value>local</value>
- </option>
- <option>
- <name>LDAP</name>
- <value>ldap</value>
- </option>
- <option>
- <name>Radius</name>
- <value>radius</value>
- </option>
- </options>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>step1_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-<step>
- <id>2</id>
- <title>OpenVPN Wizard: LDAP Server Selection</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <type>listtopic</type>
- <name>LDAP Authentication Server List</name>
- </field>
- <field>
- <name>authserv</name>
- <displayname>LDAP servers</displayname>
- <type>select</type>
- <bindstofield>ovpnserver->step2->authserv</bindstofield>
- <options>
- <option>
- <name>dummy</name>
- <value>dummy</value>
- </option>
- </options>
- </field>
- <field>
- <type>submit</type>
- <name>Add new LDAP server</name>
- </field>
- <field>
- <type>submit</type>
- <name>Next</name>
- </field>
- </fields>
- <stepbeforeformdisplay>step2_stepbeforeformdisplay();</stepbeforeformdisplay>
- <stepsubmitphpaction>step2_submitphpaction();</stepsubmitphpaction>
- <javascriptafterformdisplay>enablechange();</javascriptafterformdisplay>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-<step>
- <id>3</id>
- <title>OpenVPN Wizard: Add LDAP Server</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <type>listtopic</type>
- <name>LDAP Authentication Server Parameters</name>
- </field>
- <field>
- <name>name</name>
- <displayname>Name</displayname>
- <type>input</type>
- <bindstofield>ovpnserver->step2->authtype</bindstofield>
- <size>30</size>
- <description>Descriptive server name, for your own reference.</description>
- </field>
- <field>
- <name>ip</name>
- <displayname>Hostname or IP address</displayname>
- <type>input</type>
- <bindstofield>ovpnserver->step2->ip</bindstofield>
- <description>Address of the LDAP server.</description>
- </field>
- <field>
- <name>port</name>
- <displayname>Port</displayname>
- <type>input</type>
- <size>8</size>
- <bindstofield>ovpnserver->step2->port</bindstofield>
- <description>LDAP Server port, leave blank for the default (389 for TCP, 636 for SSL).</description>
- </field>
- <field>
- <name>transport</name>
- <displayname>Transport</displayname>
- <type>select</type>
- <bindstofield>ovpnserver->step2->transport</bindstofield>
- <options>
- <option>
- <name>TCP - Standard</name>
- <value>tcp</value>
- </option>
- <option>
- <name>SSL - Encrypted</name>
- <value>ssl</value>
- </option>
- </options>
- <description>&lt;br/&gt;The protocol used by your LDAP server. It can either be standard TCP or SSL encrypted.</description>
- </field>
- <field>
- <name>scope</name>
- <displayname>Search Scope Level</displayname>
- <type>select</type>
- <options>
- <option>
- <name>One Level</name>
- <value>one</value>
- </option>
- <option>
- <name>Entire Subtree</name>
- <value>subtree</value>
- </option>
- </options>
- <bindstofield>ovpnserver->step2->scope</bindstofield>
- </field>
- <field>
- <name>basedn</name>
- <displayname>Search Scope Base DN</displayname>
- <type>input</type>
- <size>40</size>
- <bindstofield>ovpnserver->step2->basedn</bindstofield>
- </field>
- <field>
- <name>authscope</name>
- <displayname>Authentication Containers</displayname>
- <type>input</type>
- <size>40</size>
- <bindstofield>ovpnserver->step2->authscope</bindstofield>
- <description>Semi-Colon separated. This will be prepended to the search base dn above or you can specify full container path.&lt;br/&gt;EXAMPLE: CN=Users;DC=example&lt;br/&gt;EXAMPLE: CN=Users,DC=example,DC=com;OU=OtherUsers,DC=example,DC=com </description>
- </field>
- <field>
- <name>userdn</name>
- <displayname>LDAP Bind User DN</displayname>
- <type>input</type>
- <size>20</size>
- <description>If left blank, an anonymous bind will be done.</description>
- <bindstofield>ovpnserver->step2->userdn</bindstofield>
- </field>
- <field>
- <name>passdn</name>
- <displayname>LDAP Bind Password</displayname>
- <type>password</type>
- <size>20</size>
- <bindstofield>ovpnserver->step2->passdn</bindstofield>
- <description>If a user DN was supplied above, this password will also be used when performing a bind operation.</description>
- </field>
- <field>
- <name>nameattr</name>
- <displayname>User Naming Attribute</displayname>
- <type>input</type>
- <bindstofield>ovpnserver->step2->nameattr</bindstofield>
- <description>Typically "cn" (OpenLDAP, Novell eDirectory), "samAccountName" (Microsoft AD)</description>
- </field>
- <field>
- <name>groupattr</name>
- <displayname>Group Naming Attribute</displayname>
- <type>input</type>
- <bindstofield>ovpnserver->step2->groupattr</bindstofield>
- <description>Typically "cn" (OpenLDAP, Microsoft AD, and Novell eDirectory)</description>
- </field>
- <field>
- <name>memberattr</name>
- <displayname>Member Naming Attribute</displayname>
- <type>input</type>
- <bindstofield>ovpnserver->step2->memberattr</bindstofield>
- <description>Typically "member" (OpenLDAP), "memberOf" (Microsoft AD), "uniqueMember" (Novell eDirectory)</description>
- </field>
- <field>
- <type>submit</type>
- <name>Add new Server</name>
- </field>
- </fields>
- <stepsubmitphpaction>step3_submitphpaction();</stepsubmitphpaction>
- <javascriptafterformdisplay>enablechange();</javascriptafterformdisplay>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-<step>
- <id>4</id>
- <title>OpenVPN Wizard: RADIUS Server Selection</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <type>listtopic</type>
- <name>RADIUS Authentication Server List</name>
- </field>
- <field>
- <name>authserv</name>
- <displayname>RADIUS servers</displayname>
- <type>select</type>
- <bindstofield>ovpnserver->step2->authserv</bindstofield>
- <options>
- <option>
- <name>dummy</name>
- <value>dummy</value>
- </option>
- </options>
- </field>
- <field>
- <type>submit</type>
- <name>Add new RADIUS server</name>
- </field>
- <field>
- <type>submit</type>
- <name>Next</name>
- </field>
- </fields>
- <stepbeforeformdisplay>step4_stepbeforeformdisplay();</stepbeforeformdisplay>
- <stepsubmitphpaction>step4_submitphpaction();</stepsubmitphpaction>
- <javascriptafterformdisplay>enablechange();</javascriptafterformdisplay>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-<step>
- <id>5</id>
- <title>OpenVPN Wizard: Add RADIUS Server</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <type>listtopic</type>
- <name>RADIUS Authentication Server Parameters</name>
- </field>
- <field>
- <name>name</name>
- <displayname>Name</displayname>
- <type>input</type>
- <bindstofield>ovpnserver->step2->authtype</bindstofield>
- <size>20</size>
- <description>Descriptive name for the RADIUS server, for your reference.</description>
- </field>
- <field>
- <name>ip</name>
- <displayname>Hostname or IP address</displayname>
- <type>input</type>
- <bindstofield>ovpnserver->step2->ip</bindstofield>
- <description>Address of the RADIUS server.</description>
- </field>
- <field>
- <name>port</name>
- <displayname>Authentication Port</displayname>
- <type>input</type>
- <size>8</size>
- <bindstofield>ovpnserver->step2->port</bindstofield>
- <description>Port used by the RADIUS server for accepting Authentication requests, typically 1812.</description>
- </field>
- <field>
- <name>secret</name>
- <displayname>Shared Secret</displayname>
- <type>password</type>
- <size>20</size>
- <bindstofield>ovpnserver->step2->password</bindstofield>
- <description></description>
- </field>
- <field>
- <name>Add new Server</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>step5_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-<step>
- <id>6</id>
- <title>OpenVPN Wizard: Certificate Authority Selection</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <name>Choose a Certificate Authority (CA)</name>
- <type>listtopic</type>
- </field>
- <field>
- <type>certca_selection</type>
- <name>certca</name>
- <displayname>Certificate Authority</displayname>
- <bindstofield>ovpnserver->step6->authcertca</bindstofield>
- </field>
- <field>
- <type>submit</type>
- <name>Add new CA</name>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepbeforeformdisplay>step6_stepbeforeformdisplay();</stepbeforeformdisplay>
- <stepsubmitphpaction>step6_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-<step>
- <id>7</id>
- <title>OpenVPN Wizard: Add Certificate Authority</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <name>Create a New Certificate Authority (CA) Certificate</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>descr</name>
- <displayname>Descriptive name</displayname>
- <description>A name for your reference, to identify this certificate. This is the same as common-name field for other Certificates.</description>
- <type>input</type>
- <size>20</size>
- <bindstofield>ovpnserver->step6->certca</bindstofield>
- </field>
- <field>
- <name>keylength</name>
- <displayname>Key length</displayname>
- <description>&lt;br/&gt;Size of the key which will be generated. The larger the key, the more security it offers, but larger keys are generally slower to use.</description>
- <type>select</type>
- <value>2048</value>
- <bindstofield>ovpnserver->step6->keylength</bindstofield>
- <options>
- <option>
- <name>512 bit</name>
- <value>512</value>
- </option>
- <option>
- <name>1024 bit</name>
- <value>1024</value>
- </option>
- <option>
- <name>2048 bit</name>
- <value>2048</value>
- </option>
- <option>
- <name>4096 bit</name>
- <value>4096</value>
- </option>
- </options>
- </field>
- <field>
- <name>lifetime</name>
- <displayname>Lifetime</displayname>
- <type>input</type>
- <size>10</size>
- <value>3650</value>
- <description>Lifetime in days. This is commonly set to 3650 (Approximately 10 years.)</description>
- <bindstofield>ovpnserver->step6->lifetime</bindstofield>
- </field>
- <field>
- <name>country</name>
- <displayname>Country Code</displayname>
- <description>Two-letter ISO country code (e.g. US, AU, CA) </description>
- <type>input</type>
- <size>5</size>
- <bindstofield>ovpnserver->step6->country</bindstofield>
- </field>
- <field>
- <name>state</name>
- <displayname>State or Province</displayname>
- <description>Full State or Province name, not abbreviated (e.g. Kentucky, Indiana, Ontario).</description>
- <type>input</type>
- <size>30</size>
- <bindstofield>ovpnserver->step6->state</bindstofield>
- </field>
- <field>
- <name>city</name>
- <displayname>City</displayname>
- <description>City or other Locality name (e.g. Louisville, Indianapolis, Toronto).</description>
- <type>input</type>
- <size>30</size>
- <bindstofield>ovpnserver->step6->city</bindstofield>
- </field>
- <field>
- <name>organization</name>
- <displayname>Organization</displayname>
- <description>Organization name, often the Company or Group name.</description>
- <type>input</type>
- <size>30</size>
- <bindstofield>ovpnserver->step6->organization</bindstofield>
- </field>
- <field>
- <name>email</name>
- <displayname>E-mail</displayname>
- <description>E-mail address for the Certificate contact. Often the e-mail of the person generating the certificate (i.e. You.)</description>
- <type>input</type>
- <size>30</size>
- <bindstofield>ovpnserver->step6->email</bindstofield>
- </field>
- <field>
- <name>Add new CA</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>step7_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
- <javascriptafterformdisplay>enablechange();</javascriptafterformdisplay>
-</step>
-<step>
- <id>8</id>
- <title>OpenVPN Wizard: Server Certificate Selection</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <name>Choose a Server Certificate</name>
- <type>listtopic</type>
- </field>
- <field>
- <type>cert_selection</type>
- <name>certname</name>
- <displayname>Certificate</displayname>
- <bindstofield>ovpnserver->step9->authcertname</bindstofield>
- </field>
- <field>
- <type>submit</type>
- <name>Add new Certificate</name>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepbeforeformdisplay>step8_stepbeforeformdisplay();</stepbeforeformdisplay>
- <stepsubmitphpaction>step8_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-<step>
- <id>9</id>
- <title>OpenVPN Wizard: Add a Server Certificate</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <name>Create a New Server Certificate</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>descr</name>
- <displayname>Descriptive name</displayname>
- <description>A name for your reference, to identify this certificate. This is also known as the certificate's "Common Name."</description>
- <type>input</type>
- <size>20</size>
- <bindstofield>ovpnserver->step9->certname</bindstofield>
- </field>
- <field>
- <name>keylength</name>
- <displayname>Key length</displayname>
- <description>&lt;br/&gt;Size of the key which will be generated. The larger the key, the more security it offers, but larger keys are generally slower to use.</description>
- <type>select</type>
- <value>2048</value>
- <bindstofield>ovpnserver->step9->keylength</bindstofield>
- <options>
- <option>
- <name>512 bits</name>
- <value>512</value>
- </option>
- <option>
- <name>1024 bits</name>
- <value>1024</value>
- </option>
- <option>
- <name>2048 bits</name>
- <value>2048</value>
- </option>
- <option>
- <name>4096 bits</name>
- <value>4096</value>
- </option>
- </options>
- </field>
- <field>
- <name>lifetime</name>
- <displayname>Lifetime</displayname>
- <description>Lifetime in days. This is commonly set to 3650 (Approximately 10 years.)</description>
- <type>input</type>
- <size>10</size>
- <value>3650</value>
- <bindstofield>ovpnserver->step9->lifetime</bindstofield>
- </field>
- <field>
- <name>country</name>
- <displayname>Country Code</displayname>
- <description>Two-letter ISO country code (e.g. US, AU, CA) </description>
- <type>input</type>
- <size>5</size>
- <bindstofield>ovpnserver->step9->country</bindstofield>
- </field>
- <field>
- <name>state</name>
- <displayname>State or Province</displayname>
- <description>Full State of Province name, not abbreviated (e.g. Kentucky, Indiana, Ontario).</description>
- <type>input</type>
- <size>30</size>
- <bindstofield>ovpnserver->step9->state</bindstofield>
- </field>
- <field>
- <name>city</name>
- <displayname>City</displayname>
- <description>City or other Locality name (e.g. Louisville, Indianapolis, Toronto).</description>
- <type>input</type>
- <size>30</size>
- <bindstofield>ovpnserver->step9->city</bindstofield>
- </field>
- <field>
- <name>organization</name>
- <displayname>Organization</displayname>
- <description>Organization name, often the Company or Group name.</description>
- <type>input</type>
- <size>30</size>
- <bindstofield>ovpnserver->step9->organization</bindstofield>
- </field>
- <field>
- <name>email</name>
- <displayname>E-mail</displayname>
- <description>E-mail address for the Certificate contact. Often the e-mail of the person generating the certificate (i.e. You.)</description>
- <type>input</type>
- <size>30</size>
- <bindstofield>ovpnserver->step9->email</bindstofield>
- </field>
- <field>
- <name>Create new Certificate</name>
- <type>submit</type>
- </field>
- </fields>
- <stepbeforeformdisplay>step9_stepbeforeformdisplay();</stepbeforeformdisplay>
- <stepsubmitphpaction>step9_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-<step>
- <id>10</id>
- <title>OpenVPN Wizard: Server Setup</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <type>listtopic</type>
- <name>General OpenVPN Server Information</name>
- </field>
- <field>
- <name>interface</name>
- <type>interfaces_selection</type>
- <description>The interface where OpenVPN will listen for incoming connections (typically WAN.)</description>
- <displayname>Interface</displayname>
- <bindstofield>ovpnserver->step10->interface</bindstofield>
- </field>
- <field>
- <name>Protocol</name>
- <type>select</type>
- <bindstofield>ovpnserver->step10->protocol</bindstofield>
- <options>
- <option>
- <name>UDP</name>
- <value>UDP</value>
- </option>
- <option>
- <name>TCP</name>
- <value>TCP</value>
- </option>
- </options>
- <description>&lt;br/&gt;Protocol to use for OpenVPN connections. If you are unsure, leave this set to UDP.</description>
- </field>
- <field>
- <name>localport</name>
- <displayname>Local Port</displayname>
- <description>Local port upon which OpenVPN will listen for connections. The default port is 1194. This can be left at its default unless you need to use a different port.</description>
- <type>input</type>
- <size>10</size>
- <bindstofield>ovpnserver->step10->localport</bindstofield>
- </field>
- <field>
- <name>description</name>
- <displayname>Description</displayname>
- <description>A name for this OpenVPN instance, for your reference. It can be set however you like, but is often used to distinguish the purpose of the service (e.g. "Remote Technical Staff"). It is also used by OpenVPN Client Export to identify this VPN on clients.</description>
- <type>input</type>
- <size>30</size>
- <bindstofield>ovpnserver->step10->descr</bindstofield>
- </field>
- <field>
- <type>listtopic</type>
- <name>Cryptographic Settings</name>
- </field>
- <field>
- <name>TLS Authentication</name>
- <type>checkbox</type>
- <value>on</value>
- <description>Enable authentication of TLS packets.</description>
- <bindstofield>ovpnserver->step10->tlsauth</bindstofield>
- </field>
- <field>
- <displayname>Generate TLS Key</displayname>
- <name>generatetlskey</name>
- <disablefields>tlssharedkey</disablefields>
- <value>on</value>
- <type>checkbox</type>
- <description>Automatically generate a shared TLS authentication key.</description>
- <bindstofield>ovpnserver->step10->gentlskey</bindstofield>
- </field>
- <field>
- <displayname>TLS Shared Key</displayname>
- <name>tlssharedkey</name>
- <description>Paste in a shared TLS key if one has already been generated.</description>
- <type>textarea</type>
- <cols>30</cols>
- <rows>5</rows>
- <bindstofield>ovpnserver->step10->tlskey</bindstofield>
- </field>
- <field>
- <displayname>DH Parameters Length</displayname>
- <name>dhparameters</name>
- <type>select</type>
- <value>2048</value>
- <bindstofield>ovpnserver->step10->dhkey</bindstofield>
- <options>
- <option>
- <name>1024 bit</name>
- <value>1024</value>
- </option>
- <option>
- <name>2048 bit</name>
- <value>2048</value>
- </option>
- <option>
- <name>4096 bit</name>
- <value>4096</value>
- </option>
- </options>
- <description>&lt;br/&gt;Length of Diffie-Hellman (DH) key exchange parameters, used for establishing a secure communications channel. As with other such settings, the larger values are more secure, but may be slower in operation.</description>
- </field>
- <field>
- <name>crypto</name>
- <type>select</type>
- <displayname>Encryption Algorithm</displayname>
- <bindstofield>ovpnserver->step10->crypto</bindstofield>
- <value>AES-256-CBC</value>
- <options>
- <option>
- <name>dummy</name>
- <value>dummy</value>
- </option>
- </options>
- <description>&lt;br/&gt;The algorithm used to encrypt traffic between endpoints. This setting must match on the client and server side, but is otherwise set however you like. Certain algorithms will perform better on different hardware, depending on the availability of supported VPN accelerator chips.</description>
- </field>
- <field>
- <name>digest</name>
- <type>select</type>
- <displayname>Auth Digest Algorithm</displayname>
- <bindstofield>ovpnserver->step10->digest</bindstofield>
- <options>
- <option>
- <name>dummy</name>
- <value>dummy</value>
- </option>
- </options>
- <value>SHA1</value>
- <description>&lt;br/&gt;The method used to authenticate traffic between endpoints. This setting must match on the client and server side, but is otherwise set however you like.</description>
- </field>
- <field>
- <name>engine</name>
- <type>select</type>
- <displayname>Hardware Crypto</displayname>
- <bindstofield>ovpnserver->step10->engine</bindstofield>
- <options>
- <option>
- <name>dummy</name>
- <value>dummy</value>
- </option>
- </options>
- <description>&lt;br/&gt;The hardware cryptographic accelerator to use for this VPN connection, if any.</description>
- </field>
- <field>
- <type>listtopic</type>
- <name>Tunnel Settings</name>
- </field>
- <field>
- <displayname>Tunnel Network</displayname>
- <name>tunnelnet</name>
- <type>input</type>
- <size>20</size>
- <bindstofield>ovpnserver->step10->tunnelnet</bindstofield>
- <description>This is the virtual network used for private communications between this server and client hosts expressed using CIDR notation (eg. 10.0.8.0/24). The first network address will be assigned to the server virtual interface. The remaining network addresses can optionally be assigned to connecting clients. (see Address Pool)</description>
- </field>
- <field>
- <displayname>Redirect Gateway</displayname>
- <name>redirectgw</name>
- <type>checkbox</type>
- <description>Force all client generated traffic through the tunnel.</description>
- <bindstofield>ovpnserver->step10->rdrgw</bindstofield>
- </field>
- <field>
- <displayname>Local Network</displayname>
- <name>localnet</name>
- <type>input</type>
- <size>20</size>
- <bindstofield>ovpnserver->step10->localnet</bindstofield>
- <description>This is the network that will be accessible from the remote endpoint, expressed as a CIDR range. You may leave this blank if you don't want to add a route to the local network through this tunnel on the remote machine. This is generally set to your LAN network.</description>
- </field>
- <field>
- <displayname>Concurrent Connections</displayname>
- <name>concurrentcon</name>
- <description>Specify the maximum number of clients allowed to concurrently connect to this server.</description>
- <type>input</type>
- <size>10</size>
- <bindstofield>ovpnserver->step10->concurrentcon</bindstofield>
- </field>
- <field>
- <displayname>Compression</displayname>
- <name>compression</name>
- <description>&lt;br/&gt;Compress tunnel packets using the LZO algorithm. Adaptive compression will dynamically disable compression for a period of time if OpenVPN detects that the data in the packets is not being compressed efficiently.</description>
- <bindstofield>ovpnserver->step10->compression</bindstofield>
- <type>select</type>
- <options>
- <option>
- <name>dummy</name>
- <value>dummy</value>
- </option>
- </options>
- </field>
- <field>
- <displayname>Type-of-Service</displayname>
- <name>tos</name>
- <type>checkbox</type>
- <description>Set the TOS IP header value of tunnel packets to match the encapsulated packet's TOS value.</description>
- <bindstofield>ovpnserver->step10->tos</bindstofield>
- </field>
- <field>
- <displayname>Inter-Client Communication</displayname>
- <name>interclient</name>
- <type>checkbox</type>
- <description>Allow communication between clients connected to this server.</description>
- <bindstofield>ovpnserver->step10->interclient</bindstofield>
- </field>
- <field>
- <displayname>Duplicate Connections</displayname>
- <name>duplicate_cn</name>
- <type>checkbox</type>
- <description>Allow multiple concurrent connections from clients using the same Common Name.&lt;br/&gt;NOTE: This is not generally recommended, but may be needed for some scenarios.</description>
- <bindstofield>ovpnserver->step10->duplicate_cn</bindstofield>
- </field>
- <field>
- <type>listtopic</type>
- <name>Client Settings</name>
- </field>
- <field>
- <displayname>Dynamic IP</displayname>
- <name>dynip</name>
- <type>checkbox</type>
- <value>on</value>
- <description>Allow connected clients to retain their connections if their IP address changes.</description>
- <bindstofield>ovpnserver->step10->dynip</bindstofield>
- </field>
- <field>
- <displayname>Address Pool</displayname>
- <name>addrpool</name>
- <type>checkbox</type>
- <value>on</value>
- <description>Provide a virtual adapter IP address to clients (see Tunnel Network).</description>
- <bindstofield>ovpnserver->step10->addrpool</bindstofield>
- </field>
- <field>
- <displayname>DNS Default Domain</displayname>
- <name>defaultdomain</name>
- <type>input</type>
- <description>Provide a default domain name to clients.</description>
- <bindstofield>ovpnserver->step10->defaultdomain</bindstofield>
- </field>
- <field>
- <displayname>DNS Server 1</displayname>
- <name>dnsserver1</name>
- <type>input</type>
- <bindstofield>ovpnserver->step10->dns1</bindstofield>
- <description>DNS server IP to provide to connecting clients.</description>
- </field>
- <field>
- <displayname>DNS Server 2</displayname>
- <name>dnserver2</name>
- <type>input</type>
- <bindstofield>ovpnserver->step10->dns2</bindstofield>
- <description>DNS server IP to provide to connecting clients.</description>
- </field>
- <field>
- <displayname>DNS Server 3</displayname>
- <name>dnserver3</name>
- <type>input</type>
- <bindstofield>ovpnserver->step10->dns3</bindstofield>
- <description>DNS server IP to provide to connecting clients.</description>
- </field>
- <field>
- <displayname>DNS Server 4</displayname>
- <name>dnserver4</name>
- <type>input</type>
- <bindstofield>ovpnserver->step10->dns4</bindstofield>
- <description>DNS server IP to provide to connecting clients.</description>
- </field>
- <field>
- <displayname>NTP Server</displayname>
- <name>ntpserver1</name>
- <type>input</type>
- <bindstofield>ovpnserver->step10->ntp1</bindstofield>
- <description>Network Time Protocol server to provide to connecting clients.</description>
- </field>
- <field>
- <displayname>NTP Server 2</displayname>
- <name>ntpserver2</name>
- <type>input</type>
- <bindstofield>ovpnserver->step10->ntp2</bindstofield>
- <description>Network Time Protocol server to provide to connecting clients.</description>
- </field>
- <field>
- <name>nbtenable</name>
- <type>checkbox</type>
- <displayname>NetBIOS Options</displayname>
- <bindstofield>ovpnserver->step10->nbtenable</bindstofield>
- <description>Enable NetBIOS over TCP/IP. &lt;br/&gt;If this option is not set, all NetBIOS-over-TCP/IP options (including WINS) will be disabled. </description>
- </field>
- <field>
- <displayname>NetBIOS Node Type</displayname>
- <name>nbttype</name>
- <type>select</type>
- <bindstofield>ovpnserver->step10->nbttype</bindstofield>
- <options>
- <option>
- <name>dummy</name>
- <value>dummy</value>
- </option>
- </options>
- <description>&lt;br/&gt;Possible options: b-node (broadcasts), p-node (point-to-point name queries to a WINS server), m-node (broadcast then query name server), and h-node (query name server, then broadcast).</description>
- </field>
- <field>
- <displayname>NetBIOS Scope ID</displayname>
- <name>nbtscope</name>
- <type>input</type>
- <bindstofield>ovpnserver->step10->nbtscope</bindstofield>
- <description>A NetBIOS Scope ID provides an extended naming service for NetBIOS over TCP/IP. The NetBIOS scope ID isolates NetBIOS traffic on a single network to only those nodes with the same NetBIOS scope ID.</description>
- </field>
- <field>
- <displayname>WINS Server 1</displayname>
- <name>winsserver1</name>
- <type>input</type>
- <bindstofield>ovpnserver->step10->wins1</bindstofield>
- <description>A Windows Internet Name Service (WINS) server IP to provide to connecting clients. Not desirable in most all modern networks.</description>
- </field>
- <field>
- <displayname>WINS Server 2</displayname>
- <name>winsserver2</name>
- <type>input</type>
- <bindstofield>ovpnserver->step10->wins2</bindstofield>
- <description>A Windows Internet Name Service (WINS) server IP to provide to connecting clients. Not desirable in most all modern networks.</description>
- </field>
- <field>
- <name>Advanced</name>
- <type>textarea</type>
- <cols>30</cols>
- <rows>5</rows>
- <description>Enter any additional options you would like to add to the OpenVPN server configuration here, separated by a semicolon. EXAMPLE: push "route 10.0.0.0 255.255.255.0"</description>
- <bindstofield>ovpnserver->step10->advanced</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepbeforeformdisplay>step10_stepbeforeformdisplay();</stepbeforeformdisplay>
- <stepsubmitphpaction>step10_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-<step>
- <id>11</id>
- <title>OpenVPN Wizard: Firewall Rule Configuration</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <type>listtopic</type>
- <name>Firewall Rule Configuration</name>
- </field>
- <field>
- <type>text</type>
- <description>Firewall rules control what network traffic is permitted. You must add rules to allow traffic to the OpenVPN server's IP and port, as well as allowing traffic from connected clients through the tunnel. These rules can be automatically added here, or configured manually after completing the wizard.</description>
- </field>
- <field>
- <type>listtopic</type>
- <name>Traffic from clients to server</name>
- </field>
- <field>
- <name>ovpnrule</name>
- <displayname>Firewall Rule</displayname>
- <description>Add a rule to permit connections to this OpenVPN server process from clients anywhere on the Internet.</description>
- <type>checkbox</type>
- <bindstofield>ovpnserver->step11->ovpnrule</bindstofield>
- </field>
- <field>
- <type>listtopic</type>
- <name>Traffic from clients through VPN</name>
- </field>
- <field>
- <name>ovpnallow</name>
- <displayname>OpenVPN rule</displayname>
- <description>Add a rule to allow all traffic from connected clients to pass inside the VPN tunnel.</description>
- <type>checkbox</type>
- <bindstofield>ovpnserver->step11->ovpnallow</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>12</id>
- <title>OpenVPN Wizard: Finished!</title>
- <description>OpenVPN Remote Access Server Setup Wizard</description>
- <disableheader>on</disableheader>
- <fields>
- <field>
- <type>listtopic</type>
- <name>Configuration Complete!</name>
- </field>
- <field>
- <type>text</type>
- <description>Your configuration is now complete.</description>
- </field>
- <field>
- <type>text</type>
- <description>To be able to export client configurations, browse to System->Packages and install the OpenVPN Client Export package.</description>
- </field>
- <field>
- <type>submit</type>
- <name>Finish</name>
- </field>
- </fields>
- <stepsubmitphpaction>step12_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/openvpn_wizard.inc</includefile>
-</step>
-</pfsensewizard> \ No newline at end of file
diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml
deleted file mode 100644
index 9da0509..0000000
--- a/usr/local/www/wizards/setup_wizard.xml
+++ /dev/null
@@ -1,703 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<pfsensewizard>
-<copyright>
-/* $Id$ */
-/*
- setup_wizard.xml
- part of pfSense (https://www.pfsense.org/)
-
- Copyright (C) 2004, 2005 Scott Ullrich
- 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>10</totalsteps>
-<step>
- <id>1</id>
- <title>pfSense Setup Wizard</title>
- <disableheader>true</disableheader>
- <description>This wizard will guide you through the initial configuration of pfSense.&lt;br/&gt;&lt;br/&gt; The wizard may be stopped at any time by clicking the logo image at the top of the screen.</description>
- <fields>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepbeforeformdisplay>
- conf_mount_rw();
- unlink_if_exists('/conf/trigger_initial_wizard');
- conf_mount_ro();
- </stepbeforeformdisplay>
-</step>
-<step>
- <id>2</id>
- <title>Bling your pfSense with pfSense Gold</title>
- <disableheader>true</disableheader>
- <description>Feel the power of a pfSense Gold subscription. Receive special benefits while supporting ongoing development of the Open Source pfSense project.&lt;br/&gt; &lt;br/&gt; Benefits include access to our AutoConfigBackup secure cloud based backup service for up to 10 hosts, pre-publication access to the updated pfSense: The Definitive Guide book in PDF, fully updated for the pfSense 2.1 release, and a monthly online MeetUp! Video conference to discuss and demonstrate advanced features and architectures using pfSense. &lt;br/&gt; &lt;br/&gt; Go to &lt;a href="https://www.pfsense.org/gold" target="_blank"&gt; pfSense Gold Subscriptions&lt;/a&gt; to sign up now &lt;br/&gt; &lt;br/&gt; </description>
- <fields>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>3</id>
- <title>General Information</title>
- <description>On this screen you will set the general pfSense parameters.</description>
- <fields>
- <field>
- <name>Hostname</name>
- <type>input</type>
- <bindstofield>wizardtemp->system->hostname</bindstofield>
- <description>EXAMPLE: myserver</description>
- <validate>^[a-zA-Z0-9-]+$</validate>
- <message>Invalid Hostname</message>
- </field>
- <field>
- <name>Domain</name>
- <type>input</type>
- <bindstofield>wizardtemp->system->domain</bindstofield>
- <description>EXAMPLE: mydomain.com</description>
- <validate>^[a-zA-Z0-9.-]+$</validate>
- <message>Domain name field is invalid</message>
- </field>
- <field>
- <name>DNS Resolver Behavior</name>
- <type>text</type>
- <description>The default behavior of the DNS Resolver will ignore manually configured DNS servers for client queries and query root DNS servers directly. To use the manually configured DNS servers below for client queries, visit Services &gt; DNS Resolver and enable DNS Query Forwarding after completing the wizard.</description>
- </field>
- <field>
- <name>Primary DNS Server</name>
- <type>input</type>
- <bindstofield>system->dnsserver</bindstofield>
- <!-- we must unset the fields because this is an array. -->
- <unsetfield>yes</unsetfield>
- <arraynum>0</arraynum>
- <validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
- <message>Primary DNS Server field is invalid</message>
- </field>
- <field>
- <name>Secondary DNS Server</name>
- <type>input</type>
- <bindstofield>system->dnsserver</bindstofield>
- <arraynum>1</arraynum>
- <validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
- <message>Secondary DNS Server field is invalid</message>
- </field>
- <field>
- <name>Override DNS</name>
- <description>Allow DNS servers to be overridden by DHCP/PPP on WAN</description>
- <type>checkbox</type>
- <bindstofield>system->dnsallowoverride</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepbeforeformdisplay>
- <![CDATA[
- $config['wizardtemp'] = array();
- $config['wizardtemp']['system'] = array();
- $config['wizardtemp']['system']['hostname'] = $config['system']['hostname'];
- $config['wizardtemp']['system']['domain'] = $config['system']['domain'];
- ]]>
- </stepbeforeformdisplay>
- <stepsubmitphpaction>
- <![CDATA[
- if(empty($_POST['hostname']) || !is_unqualified_hostname($_POST['hostname'])) {
- print_info_box_np("Hostname is invalid. Please press back in your browser window and correct.");
- die;
- }
- if(empty($_POST['domain']) || !is_domain($_POST['domain'])) {
- print_info_box_np("Domain is invalid. Please press back in your browser window and correct.");
- die;
- }
- if(!empty($_POST['primarydnsserver']) && !is_ipaddr($_POST['primarydnsserver'])) {
- print_info_box_np("Primary DNS server is invalid. Please press back in your browser window and correct.");
- die;
- }
- if(!empty($_POST['secondarydnsserver']) && !is_ipaddr($_POST['secondarydnsserver'])) {
- print_info_box_np("Second DNS server is invalid. Please press back in your browser window and correct.");
- die;
- }
- ]]>
- </stepsubmitphpaction>
-</step>
-<step>
- <id>4</id>
- <title>Time Server Information</title>
- <description>Please enter the time, date and time zone.</description>
- <fields>
- <field>
- <name>Time server hostname</name>
- <description>Enter the hostname (FQDN) of the time server.</description>
- <type>input</type>
- <bindstofield>system->timeservers</bindstofield>
- </field>
- <field>
- <name>Timezone</name>
- <type>timezone_select</type>
- <bindstofield>system->timezone</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>
- <![CDATA[
- foreach (explode(' ', $_POST['timeserverhostname']) as $ts) {
- if (!is_domain($ts)) {
- print_info_box_np(gettext("NTP Time Server names may only contain the characters a-z, 0-9, '-' and '.'. Entries may be separated by spaces. Please press back in your browser window and correct."));
- die;
- }
- }
- ]]>
- </stepsubmitphpaction>
-</step>
-<step>
- <id>5</id>
- <disableallfieldsbydefault>true</disableallfieldsbydefault>
- <title>Configure WAN Interface</title>
- <description>On this screen we will configure the Wide Area Network information.</description>
- <javascriptafterformdisplay>
- var selectedItem = 0;
- if(document.forms[0].ipaddress.value == 'dhcp') {
- selectedItem = 1;
- document.forms[0].ipaddress.value = '';
- } else if(document.forms[0].ipaddress.value == 'pppoe') {
- selectedItem = 2;
- document.forms[0].ipaddress.value = '';
- } else if(document.forms[0].ipaddress.value == 'pptp') {
- selectedItem = 3;
- document.forms[0].ipaddress.value = '';
- } else if(document.forms[0].ipaddress.value == 'ppp' || document.forms[0].ipaddress.value == 'l2tp') {
- document.forms[0].ipaddress.value = '';
- } else {
- selectedItem = 0;
- }
- document.forms[0].selectedtype.selectedIndex = selectedItem;
- enableitems(selectedItem);
- </javascriptafterformdisplay>
- <fields>
- <field>
- <name>SelectedType</name>
- <type>select</type>
- <donotdisable>true</donotdisable>
- <options>
- <option>
- <name>Static</name>
- <value>Static</value>
- <enablefields>ipaddress,subnetmask,upstreamgateway</enablefields>
- </option>
- <option>
- <name>DHCP</name>
- <value>dhcp</value>
- <enablefields>dhcphostname</enablefields>
- </option>
- <option>
- <name>PPPoE</name>
- <value>pppoe</value>
- <enablefields>pppoeusername,pppoepassword,pppoeservicename,pppoedialondemand,pppoeidletimeout</enablefields>
- </option>
- <option>
- <name>PPTP</name>
- <value>pptp</value>
- <enablefields>pptpusername,pptppassword,pptplocalipaddress,pptplocalsubnet,pptpremoteipaddress,pptpdialondemand,pptpidletimeout
- </enablefields>
- </option>
- </options>
- </field>
- <field>
- <name>General configuration</name>
- <type>listtopic</type>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>MAC Address</name>
- <bindstofield>interfaces->wan->spoofmac</bindstofield>
- <type>input</type>
- <description> This field can be used to modify ("spoof") the MAC address of the WAN interface (may be required with some cable connections). Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx or leave blank.</description>
- <validate>^([0-9a-f]{2}([:-]||$)){6}$</validate>
- <message>MAC Address field is invalid</message>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>MTU</name>
- <type>input</type>
- <bindstofield>interfaces->wan->mtu</bindstofield>
- <description> Set the MTU of the WAN interface. If you leave this field blank, an MTU of 1492 bytes for PPPoE and 1500 bytes for all other connection types will be assumed.</description>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>MSS</name>
- <type>input</type>
- <bindstofield>interfaces->wan->mss</bindstofield>
- <description> If you enter a value in this field, then MSS clamping for TCP connections to the value entered above minus 40 (TCP/IP header size) will be in effect. If you leave this field blank, an MSS of 1492 bytes for PPPoE and 1500 bytes for all other connection types will be assumed. This should match the above MTU value in most all cases.</description>
- </field>
- <field>
- <name>Static IP Configuration</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>IP Address</name>
- <bindstofield>interfaces->wan->ipaddr</bindstofield>
- <type>input</type>
- <typehint> / </typehint>
- <combinefieldsbegin>true</combinefieldsbegin>
- <validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
- <message>IP Address field is invalid</message>
- </field>
- <field>
- <combinefieldsend>true</combinefieldsend>
- <dontdisplayname>true</dontdisplayname>
- <dontcombinecells>true</dontcombinecells>
- <name>Subnet Mask</name>
- <bindstofield>interfaces->wan->subnet</bindstofield>
- <type>subnet_select</type>
- </field>
- <field>
- <name>Upstream Gateway</name>
- <bindstofield>wizardtemp->wangateway</bindstofield>
- <type>input</type>
- <validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
- <message>Gateway IP Address field is invalid</message>
- </field>
- <field>
- <name>DHCP client configuration</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>DHCP Hostname</name>
- <type>input</type>
- <bindstofield>interfaces->wan->dhcphostname</bindstofield>
- <description> The value in this field is sent as the DHCP client identifier and hostname when requesting a DHCP lease. Some ISPs may require this (for client identification).</description>
- </field>
- <field>
- <name>PPPoE configuration</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>PPPoE Username</name>
- <type>input</type>
- <bindstofield>wizardtemp->wan->username</bindstofield>
- </field>
- <field>
- <name>PPPoE Password</name>
- <type>input</type>
- <bindstofield>wizardtemp->wan->password</bindstofield>
- </field>
- <field>
- <name>PPPoE Service name</name>
- <type>input</type>
- <description>Hint: this field can usually be left empty</description>
- <bindstofield>wizardtemp->wan->provider</bindstofield>
- </field>
- <field>
- <name>PPPoE Dial on demand</name>
- <typehint>Enable Dial-On-Demand mode</typehint>
- <type>checkbox</type>
- <description>This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.</description>
- <bindstofield>wizardtemp->wan->ondemand</bindstofield>
- </field>
- <field>
- <name>PPPoE Idle timeout</name>
- <type>input</type>
- <description>If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.</description>
- <bindstofield>wizardtemp->wan->idletimeout</bindstofield>
- </field>
- <field>
- <name>PPTP configuration</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>PPTP Username</name>
- <type>input</type>
- <bindstofield>wizardtemp->wan->pptpusername</bindstofield>
- </field>
- <field>
- <name>PPTP Password</name>
- <type>input</type>
- <bindstofield>wizardtemp->wan->pptppassword</bindstofield>
- </field>
- <field>
- <combinefieldsbegin>true</combinefieldsbegin>
- <name>PPTP Local IP Address</name>
- <type>input</type>
- <typehint> / </typehint>
- <bindstofield>wizardtemp->wan->localip</bindstofield>
- <validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
- <message>PPTP Local IP Address field is invalid</message>
- </field>
- <field>
- <combinefieldsend>true</combinefieldsend>
- <dontdisplayname>true</dontdisplayname>
- <dontcombinecells>true</dontcombinecells>
- <name>pptplocalsubnet</name>
- <bindstofield>wizardtemp->wan->subnet</bindstofield>
- <type>subnet_select</type>
- </field>
- <field>
- <name>PPTP Remote IP Address</name>
- <bindstofield>wizardtemp->wan->gateway</bindstofield>
- <type>input</type>
- <validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
- <message>PPTP Remote IP Address field is invalid</message>
- </field>
- <field>
- <name>PPTP Dial on demand</name>
- <typehint>Enable Dial-On-Demand mode</typehint>
- <type>checkbox</type>
- <bindstofield>wizardtemp->wan->pptpondemand</bindstofield>
- <description>This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.</description>
- </field>
- <field>
- <name>PPTP Idle timeout</name>
- <type>input</type>
- <bindstofield>wizardtemp->wan->pptpidletimeout</bindstofield>
- <description>If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.</description>
- </field>
- <field>
- <name>RFC1918 Networks</name>
- <type>listtopic</type>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>Block RFC1918 Private Networks</name>
- <description> When set, this option blocks traffic from IP addresses that are reserved for private networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as well as loopback addresses (127/8). You should generally leave this option turned on, unless your WAN network lies in such a private address space, too.</description>
- <type>checkbox</type>
- <bindstofield>interfaces->wan->blockpriv</bindstofield>
- <typehint>Block private networks from entering via WAN</typehint>
- </field>
- <field>
- <name>Block bogon networks</name>
- <type>listtopic</type>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>Block bogon networks</name>
- <description>When set, this option blocks traffic from IP addresses that are reserved (but not RFC 1918) or not yet assigned by IANA. Bogons are prefixes that should never appear in the Internet routing table, and obviously should not appear as the source address in any packets you receive.</description>
- <type>checkbox</type>
- <bindstofield>interfaces->wan->blockbogons</bindstofield>
- <typehint>Block non-Internet routed networks from entering via WAN</typehint>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepbeforeformdisplay>
- <![CDATA[
- if (empty($config['interfaces']['wan']['gateway'])) {
- $wangw_name = "WANGW";
- } else {
- $wangw_name = $config['interfaces']['wan']['gateway'];
- }
- if (is_array($config['gateways']['gateway_item']))
- foreach ($config['gateways']['gateway_item'] as $gw)
- if ($gw['name'] == $wangw_name || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway']))
- $config['wizardtemp']['wangateway'] = $gw['gateway'];
- ]]>
- </stepbeforeformdisplay>
- <stepsubmitphpaction>
- <![CDATA[
- if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
- print_info_box_np("MTU Must be at least 576 (Per RFC 791). Please press back in your browser window and correct.");
- die;
- }
- if(!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) {
- print_info_box_np("Invalid MAC Address. Please press back in your browser window and correct.");
- die;
- }
- if(!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static")) {
- if (!is_ipaddr($_POST['ipaddress'])) {
- print_info_box_np("Invalid WAN IP Address. Please press back in your browser window and correct.");
- die;
- }
- if ($_POST['subnetmask'] < 31 &&
- ($_POST['ipaddress'] == gen_subnet($_POST['ipaddress'], $_POST['subnetmask']) ||
- $_POST['ipaddress'] == gen_subnet_max($_POST['ipaddress'], $_POST['subnetmask']))) {
- print_info_box_np("Invalid WAN IP Address. Please press back in your browser window and correct.");
- die;
- }
- }
- if(!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) {
- print_info_box_np("Invalid DHCP Hostname. Please press back in your browser window and correct.");
- die;
- }
- if(!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) {
- print_info_box_np("Invalid PPTP Local IP Address. Please press back in your browser window and correct.");
- die;
- }
- if(!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) {
- print_info_box_np("Invalid PPTP Remote IP Address. Please press back in your browser window and correct.");
- die;
- }
- $type = $_POST['selectedtype'];
-
- if (!is_array($config['ppps']['ppp']))
- $config['ppps']['ppp'] = array();
- if (count($config['ppps']['ppp'])) {
- foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
- if ($ppp['ptpid'] == "0") {
- if ((substr($config['interfaces']['wan']['if'],0,5) == "pppoe") || (substr($config['interfaces']['wan']['if'],0,4) == "pptp")) {
- $oldif = explode(",", $ppp['ports']);
- $config['interfaces']['wan']['if'] = $oldif[0];
- }
- if ($type == "pppoe" || $type == "pptp")
- unset($config['ppps']['ppp'][$pppid]);
- }
- }
- }
-
- if ($type == "pppoe" || $type == "pptp") {
- if ($type == "pptp") {
- $config['wizardtemp']['wan']['username'] = $config['wizardtemp']['wan']['pptpusername'];
- $config['wizardtemp']['wan']['password'] = $config['wizardtemp']['wan']['pptppassword'];
- $config['wizardtemp']['wan']['ondemand'] = $config['wizardtemp']['wan']['pptpondemand'];
- $config['wizardtemp']['wan']['idletimeout'] = $config['wizardtemp']['wan']['pptpidletimeout'];
- unset($config['wizardtemp']['wan']['pptpusername']);
- unset($config['wizardtemp']['wan']['pptppassword']);
- unset($config['wizardtemp']['wan']['pptpondemand']);
- unset($config['wizardtemp']['wan']['pptpidletimeout']);
- }
- $config['wizardtemp']['wan']['password'] = base64_encode($config['wizardtemp']['wan']['password']);
- $tmp = array();
- $tmp['ptpid'] = "0";
- $tmp['type'] = $type;
- $tmp['if'] = $type . "0";
- $tmp['ports'] = $config['interfaces']['wan']['if'];
- $config['ppps']['ppp'][] = array_merge($tmp, $config['wizardtemp']['wan']);
- unset($tmp);
- $config['interfaces']['wan']['if'] = $type."0";
- }
- unset($config['wizardtemp']['wan']);
- ]]>
- </stepsubmitphpaction>
- <stepsubmitbeforesave>
- <![CDATA[
- if($_POST['selectedtype'] == "Static") {
-
- } else {
- $_POST['ipaddress'] = $_POST['selectedtype'];
- $config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype'];
- write_config();
- if(!$config['interfaces']['lan'])
- header("Location: /wizard.php?xml=setup_wizard.xml&stepid=6&next=Next");
- }
- ]]>
- </stepsubmitbeforesave>
-</step>
-<step>
- <id>6</id>
- <title>Configure LAN Interface</title>
- <description>On this screen we will configure the Local Area Network information.</description>
- <fields>
- <field>
- <name>LAN IP Address</name>
- <type>input</type>
- <bindstofield>interfaces->lan->ipaddr</bindstofield>
- <description>Type dhcp if this interface uses DHCP to obtain its IP address.</description>
- <validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
- <message>LAN IP Address field is invalid</message>
- </field>
- <field>
- <name>Subnet Mask</name>
- <type>subnet_select</type>
- <bindstofield>interfaces->lan->subnet</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>
- <![CDATA[
- if(empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) {
- print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
- die;
- }
-
- $lowestip = gen_subnet($_POST['lanipaddress'], $_POST['subnetmask']);
- $highestip = gen_subnet_max($_POST['lanipaddress'], $_POST['subnetmask']);
-
- if ($_POST['subnetmask'] < 31) {
- if ($_POST['lanipaddress'] == $lowestip) {
- print_info_box_np("LAN IP Address equals subnet network address. This is not allowed. Please press back in your browser window and correct.");
- die;
- }
- if ($_POST['lanipaddress'] == $highestip) {
- print_info_box_np("LAN IP Address equals subnet broadcast address. This is not allowed. Please press back in your browser window and correct.");
- die;
- }
- } else {
- print_info_box_np("Invalid subnet mask, choose a mask less than 31. Please press back in your browser window and correct.");
- die;
- }
-
- $ipaddresses_before = ip_range_size_v4($lowestip, $_POST['lanipaddress']);
- $ipaddresses_after = ip_range_size_v4($_POST['lanipaddress'], $highestip);
-
- if ($ipaddresses_after >= $ipaddresses_before) {
- // The LAN IP is in the 1st half of the subnet, so put DHCP in the 2nd half.
- if ($ipaddresses_after > 30) {
- // There is reasonable space in the subnet, use a smaller chunk of the space for DHCP
- // This case will work out like the old defaults if the user has specified the ".1" address.
- // The range will be something like ".10" to ".245"
- $config['dhcpd']['lan']['range']['from'] = ip_after($_POST['lanipaddress'], 9);
- $config['dhcpd']['lan']['range']['to'] = ip_before($highestip, 10);
- } else {
- // There is not much space in the subnet, so allocate everything above the LAN IP to DHCP.
- $config['dhcpd']['lan']['range']['from'] = ip_after($_POST['lanipaddress']);
- $config['dhcpd']['lan']['range']['to'] = ip_before($highestip);
- }
- } else {
- // The LAN IP is in the 2nd half of the subnet, so put DHCP in the 1st half.
- if ($ipaddresses_before > 30) {
- // There is reasonable space in the subnet, use a smaller chunk of the space for DHCP
- $config['dhcpd']['lan']['range']['from'] = ip_after($lowestip, 10);
- $config['dhcpd']['lan']['range']['to'] = ip_before($_POST['lanipaddress'], 9);
- } else {
- // There is not much space in the subnet, so allocate everything below the LAN IP to DHCP.
- $config['dhcpd']['lan']['range']['from'] = ip_after($lowestip);
- $config['dhcpd']['lan']['range']['to'] = ip_before($_POST['lanipaddress']);
- }
- }
- ]]>
- </stepsubmitphpaction>
-</step>
-<step>
- <id>7</id>
- <title>Set Admin WebGUI Password</title>
- <description>On this screen we will set the admin password, which is used to access the WebGUI and also SSH services if you wish to enable them.</description>
- <fields>
- <field>
- <name>Admin Password</name>
- <type>password</type>
- </field>
- <field>
- <name>Admin Password AGAIN</name>
- <type>password</type>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>
- if($_POST['adminpassword'] != "") {
- if($_POST['adminpassword'] == $_POST['adminpasswordagain']) {
- $admin_user =&amp; getUserEntryByUID(0);
- local_user_set_password($admin_user, $_POST['adminpassword']);
- local_user_set($admin_user);
- write_config();
- } else {
- print_info_box_np("Passwords do not match! Please press back in your browser window and correct.");
- die;
- }
- }
- </stepsubmitphpaction>
-</step>
-<step>
- <id>8</id>
- <title>Reload configuration</title>
- <disableheader>true</disableheader>
- <description>Click 'Reload' to reload pfSense with new changes.</description>
- <fields>
- <field>
- <name>Reload</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>9</id>
- <title>Reload in progress</title>
- <description>
- A reload is now in progress. Please wait. &lt;p&gt;
- &lt;meta http-equiv="refresh" content="5; url=wizard.php?xml=setup_wizard.xml&amp;stepid=9" &gt;
- &lt;p&gt;
- The wizard will redirect to the next step once the reload is completed.
- </description>
- <stepafterformdisplay>
- <![CDATA[
- $config['system']['hostname'] = $config['wizardtemp']['system']['hostname'];
- $config['system']['domain'] = $config['wizardtemp']['system']['domain'];
- if (!empty($config['wizardtemp']['wangateway'])) {
- if (!is_array($config['gateways']['gateway_item']))
- $config['gateways']['gateway_item'] = array();
- $found = false;
- $defaultgw_found = false;
- foreach ($config['gateways']['gateway_item'] as & $gw) {
- if ($gw['interface'] != "wan")
- continue;
- if (isset($gw['defaultgw']))
- $defaultgw_found = true;
- if ($gw['name'] == 'WANGW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway'])) {
- $found = true;
- $gw['gateway'] = $config['wizardtemp']['wangateway'];
- $config['interfaces']['wan']['gateway'] = $gw['name'];
- }
- }
- if (!$found) {
- $newgw = array();
- $newgw['interface'] = "wan";
- $newgw['gateway'] = $config['wizardtemp']['wangateway'];
- $newgw['name'] = "WANGW";
- $newgw['weight'] = 1;
- $newgw['descr'] = "WAN Gateway";
- $newgw['defaultgw'] = !$defaultgw_found;
- $config['gateways']['gateway_item'][] = $newgw;
- $config['interfaces']['wan']['gateway'] = "WANGW";
- }
- }
- unset($config['wizardtemp']);
- write_config();
- reload_all();
- mwexec_bg("/etc/rc.update_bogons.sh now");
- ]]>
- </stepafterformdisplay>
-</step>
-<step>
- <id>10</id>
- <title>Wizard completed.</title>
- <stepbeforeformdisplay>
- <![CDATA[
- if($g['product_name'] <> 'pfSense') {
- header("Location: " . fixup_string("\$myurl"));
- exit;
- }
- ]]>
- </stepbeforeformdisplay>
- <description>
- <![CDATA[
- Congratulations! pfSense is now configured.<p/>
- Please consider contributing back to the project!<p/>
- Click <a target='_new' href='https://www.pfsense.org/get-involved/index.html'>here</a> to purchase services offered by the pfSense team and find other ways to contribute.<p/>
- Click <a href='$myurl'>here</a> to continue on to pfSense webConfigurator.
- ]]>
- </description>
-</step>
-</pfsensewizard>
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
deleted file mode 100644
index d984fed..0000000
--- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
+++ /dev/null
@@ -1,1664 +0,0 @@
-<?php
-/*
- traffic_shaper_wizard_dedicated.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_stepbeforeformdisplay() {
- global $stepid, $savemsg, $pkg;
-
- $fields =& $pkg['step'][0]['fields']['field'];
-
- $wans = 0;
- $lans = 0;
-
- $iflisttmp = get_configured_interface_with_descr();
- foreach ($iflisttmp as $if => $ifdesc) {
- if (!is_altq_capable(get_real_interface($if)))
- continue;
- if (interface_has_gateway($if) || interface_has_gatewayv6($if))
- $wans++;
- else
- $lans++;
- }
-
- foreach ($fields as &$field)
- if ($field['name'] == 'numberofconnections')
- $field['value'] = ($wans < $lans ? $wans : $lans);
-}
-
-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;
-
- $wans = 0;
- $lans = 0;
- $iflist = array();
- $iflisttmp = get_configured_interface_with_descr();
- foreach ($iflisttmp as $if => $ifdesc) {
- if (!is_altq_capable(get_real_interface($if)))
- continue;
- if (interface_has_gateway($if) || interface_has_gatewayv6($if))
- $wans++;
- else
- $lans++;
- $iflist[$if] = $ifdesc;
- }
- $numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']);
- if ($numberofconnections > ($wans < $lans ? $wans : $lans)) {
- $savemsg=gettext("You have less interfaces than number of connections!");
- $stepid--;
- return;
- }
-
- $cfgname = "traffic_shaper_wizard_dedicated.xml";
-
- $fields =& $pkg['step'][1]['fields']['field'];
-
- /*
- unset($config['ezshaper']['step2']);
- $config['ezshaper']['step2'] = array();
- write_config();
- */
- $fields = array();
-
- for ($i = 0; $i < $numberofconnections; $i++) {
- $field = array();
- $linknum = $i+1;
- $ifsel = ($i * 2);
- $field['name'] = "Connection #{$linknum} parameters";
- $field['type'] = "listtopic";
- $fields[] = $field;
-
- $field = array();
- $field['displayname'] = "Local interface";
- $field['name'] = "local{$i}interface";
- $field['type'] = "select";
- $field['options']['option'] = array();
- $ifcnt = 0;
- foreach ($iflist as $ifname => $ifdescr) {
- // Skip wan interfaces here
- if (interface_has_gateway($ifname) || interface_has_gatewayv6($ifname))
- continue;
- if ($ifcnt == ($ifsel + 1))
- $field['value'] = $ifname;
- $opts = array();
- $opts['displayname'] = $ifdescr;
- $opts['name'] = $ifname;
- $opts['value'] = $ifname;
- $field['options']['option'][] = $opts;
- $ifcnt++;
- }
- $field['combinefieldsbegin'] = "true";
- $field['bindstofield'] = "ezshaper->step2->local{$i}interface";
- $fields[] = $field;
-
- $field = array();
- $field['combinefieldsend'] = "true";
- $field['dontdisplayname'] = "true";
- $field['dontcombinecells'] = "true";
- $field['name'] = "local{$i}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->local{$i}downloadscheduler";
- $fields[] = $field;
-
- $field = array();
- $field['displayname'] = "WAN Interface";
- $field['name'] = "conn{$i}interface";
- $field['type'] = "select";
- $field['options']['option'] = array();
- $ifcnt = 0;
- foreach ($iflist as $ifname => $ifdescr) {
- // Skip lan interfaces here
- if (!interface_has_gateway($ifname) && !interface_has_gatewayv6($ifname))
- continue;
- if ($ifcnt == $ifsel)
- $field['value'] = $ifname;
- $opts = array();
- $opts['displayname'] = $ifdescr;
- $opts['name'] = $ifname;
- $opts['value'] = $ifname;
- $field['options']['option'][] = $opts;
- $ifcnt++;
- }
- $field['bindstofield'] = "ezshaper->step2->conn{$i}interface";
- $field['combinefieldsbegin'] = "true";
- $fields[] = $field;
-
- $field = array();
- $field['name'] = "conn{$i}uploadscheduler";
- $field['combinefieldsend'] = "true";
- $field['dontdisplayname'] = "true";
- $field['dontcombinecells'] = "true";
- $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'] = "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'] = "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++) {
- if ($_POST["conn{$i}interface"] == $_POST["conn{$j}interface"] || $_POST["conn{$i}interface"] == $_POST["local{$j}interface"]) {
- $savemsg=gettext("You cannot select the same interface for connections {$i} and {$j}.");
- $stepid--;
- return;
- }
- if (trim($_POST["conn{$i}uploadscheduler"]) != "PRIQ") {
- if (!is_numeric($_POST["conn{$i}upload"])) {
- $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if (!is_numeric($_POST["conn{$i}download"])) {
- $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- $upbw = $_POST["conn{$i}upload"];
- $downbw = $_POST["conn{$i}download"];
- if ($upbw < 1 || $downbw < 1) {
- $savemsg = gettext("You cannot specify bandwidth smaller than 1!");
- $stepid--;
- return;
- }
- if (intval($upbw) < 128 && $_POST["conn{$i}uploadspeed"] == "Kb" && trim($_POST["conn{$i}uploadscheduler"]) == "CBQ") {
- $savemsg=gettext("Uploads smaller than 128Kbit/s is not supported for connection {$i} on CBQ scheduler.");
- $stepid--;
- return;
- }
- }
- if ($_POST["local{$i}interface"] == $_POST["conn{$j}interface"] || $_POST["local{$i}interface"] == $_POST["local{$j}interface"]) {
- $savemsg=gettext("You cannot select the same interface for local and outside.");
- $stepid--;
- return;
- }
- }
- }
-
- /* This is necessary since the wizard expects predefined fields. */
- unset($config['ezshaper']['step2']);
- $config['ezshaper']['step2'] = array();
-
- for ($i = 0; $i < $steps; $i++) {
- $config['ezshaper']['step2']["local{$i}downloadscheduler"] = $_POST["local{$i}downloadscheduler"];
- $config['ezshaper']['step2']["local{$i}interface"] = $_POST["local{$i}interface"];
- $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_dedicated.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['displayname'] = "Upstream SIP Server";
- $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;
-
- for ($i = 0; $i < $numberofconnections; $i++) {
- $connum = $i + 1;
- $field = array();
- $field['name'] = "Connection #{$connum} parameters";
- $field['type'] = "listtopic";
- $voipfields[] = $field;
-
- $field = array();
- $field['displayname'] = "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";
- $field['typehint'] = "Upload bandwidth guarantee for VOIP phone(s) on connection {$i}.";
- $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();
- $field['displayname'] = "Download";
- $field['name'] = "local{$i}download";
- $enablefields[] = "local{$i}download";
- $field['type'] = "input";
- $field['bindstofield'] = "ezshaper->step3->local{$i}download";
- $field['combinefieldsbegin'] = "true";
- $voipfields[] = $field;
-
- $field = array();
- $field['combinefieldsend'] = "true";
- $field['dontdisplayname'] = "true";
- $field['dontcombinecells'] = "true";
- $field['name'] = "local{$i}downloadspeed";
- $enablefields[] = "local{$i}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->local{$i}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['upstream_sip_server']) {
- if(!is_ipaddroralias($_POST['upstream_sip_server'])) {
- /* 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 ($config['ezshaper']['step2']["conn{$i}uploadscheduler"] != "PRIQ") {
- if (!is_numeric($_POST["conn{$i}upload"])) {
- $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if ($_POST["conn{$i}uploadspeed"] == "%") {
- if (intval($_POST["conn{$i}upload"]) > 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']["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) {
- $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
- $stepid--;
- return;
- }
- }
- }
-
- if ($config['ezshaper']['step2']["local{$i}downloadscheduler"] != "PRIQ") {
- if (!is_numeric($_POST["local{$i}download"])) {
- $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if ($_POST["local{$i}downloadspeed"] == "%") {
- if (intval($_POST["local{$i}download"]) > 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']["conn{$i}downloadspeed"]);
- $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}download"]);
- $factor = wizard_get_bandwidthtype_scale($_POST["local{$i}downloadspeed"]);
- $input_bw = $factor * floatval($_POST["local{$i}download"]);
- if ((0.8 * $ifbw) < $input_bw) {
- $savemsg=gettext("You cannot set the VoIP download bandwidth on connection {$i} higher than 80% of the connection.");
- $stepid--;
- return;
- }
- }
- }
- }
-
- /* This is necessary since the wizard expects predefined fields. */
- unset($config['ezshaper']['step3']);
- $config['ezshaper']['step3'] = array();
-
- if (!empty($_POST['upstream_sip_server']))
- $config['ezshaper']['step3']['address'] = $_POST['upstream_sip_server'];
- if ($_POST['enable'] == 'on')
- $config['ezshaper']['step3']['enable'] = 'on';
- for ($i = 0; $i < $steps; $i++) {
- $config['ezshaper']['step3']["local{$i}download"] = $_POST["local{$i}download"];
- $config['ezshaper']['step3']["local{$i}downloadspeed"] = $_POST["local{$i}downloadspeed"];
- $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_chosen_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_chosen_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 = intval($config['ezshaper']['step1']['numberofconnections']);
-
- $interfacelist = array();
-
- for ($i = 0; $i < $steps; $i++) {
-
- $tmppath = array();
- $altq =& new altq_root_queue();
-
- $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;
- $factor = 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 = $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 (intval($remainbw) > 0 && intval($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_dedicated.xml&stepid=2&message={$savemsg}");
- exit;
- } else {
- $remainbw = 100 - $remainbw;
- }
-
- 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']["conn{$i}upload"]);
- $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}uploadspeed"];
- }
- else if ($sched == "HFSC") {
- $tmpcf['upperlimit'] = "on";
- $tmpcf['upperlimit3'] =
- floatval($config['ezshaper']['step2']["conn{$i}upload"]) . $config['ezshaper']['step2']["conn{$i}uploadspeed"];
- $tmpcf['linkshare'] = "on";
- $tmpcf['linkshare3'] = floatval($config['ezshaper']['step2']["conn{$i}upload"]) . $config['ezshaper']['step2']["conn{$i}uploadspeed"];
- $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conn{$i}upload"]);
- $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}uploadspeed"];
- }
- 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 ($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['bandwidthtype'] = $penaltybwunit;
- $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);
-
- $downfactor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}downloadspeed"]);
- $downbw = floatval($config['ezshaper']['step2']["conn{$i}download"]) * $downfactor;
-
- $tmppath = array();
- $altq =& new altq_root_queue();
-
- $altq->SetInterface($config['ezshaper']['step2']["local{$i}interface"]);
- $altq->SetScheduler($config['ezshaper']['step2']["local{$i}downloadscheduler"]);
- //$altq->SetBandwidth($config['ezshaper']['step2']["conn{$i}download"]);
- //$altq->SetBwscale($config['ezshaper']['step2']["conn{$i}downloadspeed"]);
- $altq->SetEnabled("on");
- $altq_list_queues[$altq->GetQname()] =& $altq;
- array_push($tmppath, $config['ezshaper']['step2']["local{$i}interface"]);
- $altq->SetLink($tmppath);
- //var_dump($input_errors);
- $altq->wconfig();
-
- $sched = $config['ezshaper']['step2']["local{$i}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']["local{$i}download"];
- $voipbwunit = $config['ezshaper']['step3']["local{$i}downloadspeed"];
- if ($sched != HFSC) {
- if ($voipbwunit == "%")
- $factor = $downbw/100;
- else
- $factor = wizard_get_bandwidthtype_scale($voipbwunit);
- $remainbw += floatval($voipbw) * $factor;
- } else
- $remainbw += 32000; /* 32Kbit/s reserved for HFSC link sharing */
- }
- if ($config['ezshaper']['step4']['enable']) {
- $penalty = true;
- $penaltybw = $config['ezshaper']['step4']['bandwidth'];
- $penaltybwunit = $config['ezshaper']['step4']['bandwidthunit'];
- if ($penaltybwunit == "%")
- $factor = $downbw/100;
- else
- $factor = wizard_get_bandwidthtype_scale($penaltybwunit);
- $remainbw += floatval($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 = $downbw/100;
- else
- $factor = wizard_get_bandwidthtype_scale($p2pcatchbwunit);
- $remainbw += floatval($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 / $downbw * 100, 2);
- if (intval($remainbw) > 0 && intval($remainbw) > 40) {
- $savemsg=gettext("Custom Bandwidths are greater than 40%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard_dedicated.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']["conn{$i}download"]);
- $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}downloadspeed"];
- }
- else if ($sched == "HFSC") {
- $tmpcf['upperlimit'] = "on";
- $tmpcf['upperlimit3'] = floatval($config['ezshaper']['step2']["conn{$i}download"]) . $config['ezshaper']['step2']["conn{$i}downloadspeed"];
- $tmpcf['linkshare'] = "on";
- $tmpcf['linkshare3'] = floatval($config['ezshaper']['step2']["conn{$i}download"]) . $config['ezshaper']['step2']["conn{$i}downloadspeed"];
- $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conn{$i}download"]);
- $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}downloadspeed"];
- }
- 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 $remainbw <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;
- $tmpcf['bandwidthtype'] = $penaltybwunit;
- } else {
- $tmpcf['bandwidthtype'] = "%";
- $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */
- }
- } 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);
- }
-
- if (!is_array($config['filter']['rule']))
- $config['filter']['rule'] = array();
-
- $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];
- $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 automatically 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_dedicated.xml b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml
deleted file mode 100755
index c86a72a..0000000
--- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml
+++ /dev/null
@@ -1,1649 +0,0 @@
-<?xml version="1.0"?>
-<pfsensewizard>
- <copyright><![CDATA[
- /*
- traffic_shaper_wizard_dedicated.xml
- part of pfSense (https://www.pfsense.org/)
-
- Copyright (C) 2005 Bill Marquette - bill.marquette@gmail.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.
- */]]></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>
- <type>listtopic</type>
- <name>Traffic shaper Wizard</name>
- </field>
- <field>
- <displayname>Enter number of WAN type 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>
- <stepbeforeformdisplay>step1_stepbeforeformdisplay();</stepbeforeformdisplay>
- <stepsubmitphpaction>step1_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_dedicated.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_dedicated.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-&gt;step3-&gt;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-&gt;step3-&gt;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>
- <displayname>Upstream SIP Server</displayname>
- <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 &lt;strong&gt;remote&lt;/strong&gt; PBX or SIP Trunk to prioritize. &lt;br /&gt;NOTE: You can also use a Firewall Alias in this location.</description>
- <bindstofield>ezshaper-&gt;step3-&gt;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-&gt;step3-&gt;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_dedicated.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-&gt;step4-&gt;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-&gt;step4-&gt;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-&gt;step4-&gt;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_dedicated.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-&gt;step5-&gt;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-&gt;step5-&gt;p2pcatchall</bindstofield>
- </field>
- <field>
- <name>Bandwidth</name>
- <type>input</type>
- <validate>^[0-9]*$</validate>
- <message>Speed must be numerical.</message>
- <bindstofield>ezshaper-&gt;step5-&gt;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-&gt;step5-&gt;aimster</bindstofield>
- </field>
- <field>
- <name>BitTorrent</name>
- <type>checkbox</type>
- <typehint>Bittorrent and other P2P using the Torrent protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;bittorrent</bindstofield>
- </field>
- <field>
- <name>BuddyShare</name>
- <type>checkbox</type>
- <typehint>BuddyShare and other P2P using the BuddyShare protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;buddyshare</bindstofield>
- </field>
- <field>
- <name>CuteMX</name>
- <type>checkbox</type>
- <typehint>CuteMX and other P2P using the CuteMX protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;cutemx</bindstofield>
- </field>
- <field>
- <name>DCplusplus</name>
- <type>checkbox</type>
- <typehint>DC++ and other P2P using the DC++ protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;dcplusplus</bindstofield>
- </field>
- <field>
- <name>DCC</name>
- <type>checkbox</type>
- <typehint>irc DCC file transfers</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;dcc</bindstofield>
- </field>
- <field>
- <name>DirectConnect</name>
- <type>checkbox</type>
- <typehint>DirectConnect and other P2P using the DirectConnect protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;directconnect</bindstofield>
- </field>
- <field>
- <name>DirectFileExpress</name>
- <type>checkbox</type>
- <typehint>DirectFileExpress and other P2P using the DirectFileExpress protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;directfileexpress</bindstofield>
- </field>
- <field>
- <name>eDonkey2000</name>
- <type>checkbox</type>
- <typehint>eDonkey and other P2P using the eDonkey protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;edonkey2000</bindstofield>
- </field>
- <field>
- <name>FastTrack</name>
- <type>checkbox</type>
- <typehint>FastTrack and other P2P using the FastTrack protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;fasttrack</bindstofield>
- </field>
- <field>
- <name>Gnutella</name>
- <type>checkbox</type>
- <typehint>Gnutella and other P2P using the Gnutella protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;gnutella</bindstofield>
- </field>
- <field>
- <name>grouper</name>
- <type>checkbox</type>
- <typehint>grouper and other P2P using the grouper protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;grouper</bindstofield>
- </field>
- <field>
- <name>hotComm</name>
- <type>checkbox</type>
- <typehint>hotComm and other P2P using the hotComm protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;hotcomm</bindstofield>
- </field>
- <field>
- <name>HotlineConnect</name>
- <type>checkbox</type>
- <typehint>HotlineConnect and other P2P using the HotlineConnect protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;hotlineconnect</bindstofield>
- </field>
- <field>
- <name>iMesh</name>
- <type>checkbox</type>
- <typehint>iMesh and other P2P using the iMesh protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;imesh</bindstofield>
- </field>
- <field>
- <name>Napster</name>
- <type>checkbox</type>
- <typehint>Napster and other P2P using the Napster protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;napster</bindstofield>
- </field>
- <field>
- <name>OpenNap</name>
- <type>checkbox</type>
- <typehint>OpenNap and other P2P using the OpenNap protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;opennap</bindstofield>
- </field>
- <field>
- <name>Scour</name>
- <type>checkbox</type>
- <typehint>Scour and other P2P using the Scour protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;scour</bindstofield>
- </field>
- <field>
- <name>Shareaza</name>
- <type>checkbox</type>
- <typehint>Shareaza and other P2P using the Shareaza protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;shareaza</bindstofield>
- </field>
- <field>
- <name>SongSpy</name>
- <type>checkbox</type>
- <typehint>SongSpy and other P2P using the SongSpy protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;songspy</bindstofield>
- </field>
- <field>
- <name>WinMX</name>
- <type>checkbox</type>
- <typehint>WinMX and other P2P using the WinMX protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;winmx</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>step5_stepsubmitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_dedicated.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>BattleNET,EAOrigin,GameForWindowsLive,PlayStationConsoles,Steam,WiiConsoles,XboxConsoles,ARMA2,ARMA3,Battlefield2,Battlefield3,BattlefieldBC2,Borderlands,CallOfDuty,Counterstrike,Crysis2,Crysis3,DeltaForce,DeadSpace2,DeadSpace3,Dirt3,DOOM3,DragonAge2,EmpireEarth,EveOnline,Everquest,Everquest2,FarCry,FarCry2,FarCry3,GunZOnline,HalfLife,LeagueofLegends,Lineage2,MassEffect3,MechwarriorOnline,Minecraft,OperationFlashpointDR,PlanetSide,PlanetSide2,QuakeIII,QuakeIV,StarWarsTOR,TigerWoods2004PS2,TribesAscend,UnrealTournament,WolfensteinEnemyTerritory,WorldOfWarcraft</enablefields>
- <donotdisable>true</donotdisable>
- <bindstofield>ezshaper-&gt;step6-&gt;enable</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- <field>
- <name>Enable/Disable specific game consoles and services</name>
- <type>listtopic</type>
- </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-&gt;step6-&gt;battlenet</bindstofield>
- </field>
- <field>
- <name>EAOrigin</name>
- <type>checkbox</type>
- <typehint>EA Origin Client - Some PC games by EA use this.</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;eaorigin</bindstofield>
- </field>
- <field>
- <name>GameForWindowsLive</name>
- <type>checkbox</type>
- <typehint>Games for Windows Live</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;gamesforwindowslive</bindstofield>
- </field>
- <field>
- <name>PlayStationConsoles</name>
- <type>checkbox</type>
- <typehint>PlayStation Consoles - This should cover all ports required for the Playstation 4, Playstation, PS Vita</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;playstationconsoles</bindstofield>
- </field>
- <field>
- <name>Steam</name>
- <type>checkbox</type>
- <typehint>Steam Game Client (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 and many other games on the Steam)</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;steam</bindstofield>
- </field>
- <field>
- <name>WiiConsoles</name>
- <type>checkbox</type>
- <typehint>Wii Consoles - Wii, Wii U, DS and 3DS</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;wiiconsoles</bindstofield>
- </field>
- <field>
- <name>XboxConsoles</name>
- <type>checkbox</type>
- <typehint>Xbox Consoles - Xbox 360 and Xbox One</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;xboxconsoles</bindstofield>
- </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-&gt;step6-&gt;arma2</bindstofield>
- </field>
- <field>
- <name>ARMA3</name>
- <type>checkbox</type>
- <typehint>ARMA 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;arma3</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-&gt;step6-&gt;battlefield2</bindstofield>
- </field>
- <field>
- <name>Battlefield3</name>
- <type>checkbox</type>
- <typehint>Battlefield 3 and 4 - 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-&gt;step6-&gt;battlefield3</bindstofield>
- </field>
- <field>
- <name>BattlefieldBC2</name>
- <type>checkbox</type>
- <typehint>Battlefield: Bad Company 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;battlefieldbc2</bindstofield>
- </field>
- <field>
- <name>Borderlands</name>
- <type>checkbox</type>
- <typehint>Borderlands</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;borderlands</bindstofield>
- </field>
- <field>
- <name>CallOfDuty</name>
- <type>checkbox</type>
- <typehint>Call Of Duty (United Offensive)</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;callofduty</bindstofield>
- </field>
- <field>
- <name>Counterstrike</name>
- <type>checkbox</type>
- <typehint>Counterstrike. The ultimate 1st person shooter.</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;counterstrike</bindstofield>
- </field>
- <field>
- <name>Crysis2</name>
- <type>checkbox</type>
- <typehint>Crysis 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;crysis2</bindstofield>
- </field>
- <field>
- <name>Crysis3</name>
- <type>checkbox</type>
- <typehint>Crysis 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;crysis3</bindstofield>
- </field>
- <field>
- <name>DeadSpace2</name>
- <type>checkbox</type>
- <typehint>Dead Space2 - this game uses a HUGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;deadspace2</bindstofield>
- </field>
- <field>
- <name>DeadSpace3</name>
- <type>checkbox</type>
- <typehint>Dead Space 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;deadspace3</bindstofield>
- </field>
- <field>
- <name>DeltaForce</name>
- <type>checkbox</type>
- <typehint>Delta Force</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;deltaforce</bindstofield>
- </field>
- <field>
- <name>Dirt3</name>
- <type>checkbox</type>
- <typehint>Dirt 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;dirt3</bindstofield>
- </field>
- <field>
- <name>DOOM3</name>
- <type>checkbox</type>
- <typehint>DOOM3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;doom3</bindstofield>
- </field>
- <field>
- <name>DragonAge2</name>
- <type>checkbox</type>
- <typehint>Dragon Age 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;dragonage2</bindstofield>
- </field>
- <field>
- <name>EmpireEarth</name>
- <type>checkbox</type>
- <typehint>Empire Earth</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;empireearth</bindstofield>
- </field>
- <field>
- <name>EveOnline</name>
- <type>checkbox</type>
- <typehint>EVE Online</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;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-&gt;step6-&gt;everquest</bindstofield>
- </field>
- <field>
- <name>Everquest2</name>
- <type>checkbox</type>
- <typehint>Everquest II</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;everquest2</bindstofield>
- </field>
- <field>
- <name>FarCry</name>
- <type>checkbox</type>
- <typehint>Far Cry</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;farcry</bindstofield>
- </field>
- <field>
- <name>FarCry2</name>
- <type>checkbox</type>
- <typehint>Far Cry 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;farcry2</bindstofield>
- </field>
- <field>
- <name>FarCry3</name>
- <type>checkbox</type>
- <typehint>Far Cry 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;farcry3</bindstofield>
- </field>
- <field>
- <name>GunZOnline</name>
- <type>checkbox</type>
- <typehint>GunZ Online</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;gunzonline</bindstofield>
- </field>
- <field>
- <name>HalfLife</name>
- <type>checkbox</type>
- <typehint>Half-Life</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;halflife</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-&gt;step6-&gt;leagueoflegends</bindstofield>
- </field>
- <field>
- <name>Lineage2</name>
- <type>checkbox</type>
- <typehint>Lineage II</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;lineage2</bindstofield>
- </field>
- <field>
- <name>MassEffect3</name>
- <type>checkbox</type>
- <typehint>Mass Effect 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;masseffect3</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-&gt;step6-&gt;mechwarrioronline</bindstofield>
- </field>
- <field>
- <name>Minecraft</name>
- <type>checkbox</type>
- <typehint>Minecraft</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;minecraft</bindstofield>
- </field>
- <field>
- <name>PlanetSide</name>
- <type>checkbox</type>
- <typehint>PlanetSide</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;planetside</bindstofield>
- </field>
- <field>
- <name>PlanetSide2</name>
- <type>checkbox</type>
- <typehint>PlanetSide 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;planetside2</bindstofield>
- </field>
- <field>
- <name>OperationFlashpointDR</name>
- <type>checkbox</type>
- <typehint>Operation Flashpoint: Dragon Rising</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;operationflashpoint-dr</bindstofield>
- </field>
- <field>
- <name>QuakeIII</name>
- <type>checkbox</type>
- <typehint>Quake III</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;quakeiii</bindstofield>
- </field>
- <field>
- <name>QuakeIV</name>
- <type>checkbox</type>
- <typehint>Quake IV</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;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-&gt;step6-&gt;starwarstor</bindstofield>
- </field>
- <field>
- <name>TigerWoods2004PS2</name>
- <type>checkbox</type>
- <typehint>Tiger Woods 2004 for PS2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;tigerwoods2004ps2</bindstofield>
- </field>
- <field>
- <name>TribesAscend</name>
- <type>checkbox</type>
- <typehint>Tribes Ascend</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;tribesascend</bindstofield>
- </field>
- <field>
- <name>UnrealTournament</name>
- <type>checkbox</type>
- <typehint>Unreal Tournament Series</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;unrealtournament</bindstofield>
- </field>
- <field>
- <name>WolfensteinEnemyTerritory</name>
- <type>checkbox</type>
- <typehint>Wolfenstein Enemy Territory</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;wolfet</bindstofield>
- </field>
- <field>
- <name>WorldOfWarcraft</name>
- <type>checkbox</type>
- <typehint>World of Warcraft</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;wow</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_dedicated.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>AppleRemoteDesktop,MSRDP,PCAnywhere,VNC,AIM,Facetime,GoogleHangouts,ICQ,IRC,Jabber,MSN,TeamSpeak,TeamSpeak3,Ventrilo,PPTP,IPSEC,iTunesRadio,StreamingMP3,RTSP,RTMP,HTTP,IMAP,LotusNotes,POP3,SMTP,BattleNETDownloader,SteamDownloader,APNS,AppleMobileSync,CrashPlan,CVSUP,DNS,GIT,HBCI,ICMP,MySqlServer,NNTP,Slingbox,SMB,SNMP,Subversion</enablefields>
- <donotdisable>true</donotdisable>
- <bindstofield>ezshaper-&gt;step7-&gt;enable</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- <field>
- <name>Remote Service / Terminal emulation</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>AppleRemoteDesktop</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>MSRDP</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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>PCAnywhere</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>VNC</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>Messengers</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>AIM</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>Facetime</name>
- <bindstofield>ezshaper-&gt;step7-&gt;facetime</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>Facetime</typehint>
- </field>
- <field>
- <name>ICQ</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>IRC</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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>GoogleHangouts</name>
- <bindstofield>ezshaper-&gt;step7-&gt;googlehangouts</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>Google Hangouts</typehint>
- </field>
- <field>
- <name>MSN</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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>Teamspeak3</name>
- <bindstofield>ezshaper-&gt;step7-&gt;teamspeak3</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 3</typehint>
- </field>
- <field>
- <name>Ventrilo</name>
- <bindstofield>ezshaper-&gt;step7-&gt;ventrilo</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>Ventrilo</typehint>
- </field>
- <field>
- <name>VPN</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>PPTP</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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>iTunesRadio</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;itunesradio</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>iTunes Radio - this rule uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint>
- </field>
- <field>
- <name>StreamingMP3</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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>RTMP</name>
- <bindstofield>ezshaper-&gt;step7-&gt;rtmp</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>Real-Time Messaging Protocol - Used by video streaming services such as Twitch.tv.</typehint>
- </field>
- <field>
- <name>Web</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>HTTP</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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>Game Downloader</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>BattleNetDownloader</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;battlenetdownloader</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>Battle.NET Downloader</typehint>
- </field>
- <field>
- <name>SteamDownloader</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;steamdownloader</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>Steam Downloader</typehint>
- </field>
- <field>
- <name>Miscellaneous</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>APNS</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;apns</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>Apple Push Notification Service</typehint>
- </field>
- <field>
- <name>AppleMobileSync</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;applemobilesync</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>Apple Mobile Sync</typehint>
- </field>
- <field>
- <name>CrashPlan</name>
- <bindstofield>ezshaper-&gt;step7-&gt;crashplan</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>CrashPlan</typehint>
- </field>
- <field>
- <name>CVSUP</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>DNS</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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>Git</name>
- <bindstofield>ezshaper-&gt;step7-&gt;git</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>Git Server</typehint>
- </field>
- <field>
- <name>HBCI</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>ICMP</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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>Slingbox</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>Subversion</name>
- <bindstofield>ezshaper-&gt;step7-&gt;subversion</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>Subversion Server</typehint>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_dedicated.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.&lt;br/&gt; Please note that this may take a moment.&lt;br/&gt; Also note that the traffic shaper is stateful meaning that only new connections will be shaped.&lt;br/&gt; If this is an issue please reset the state table after loading the profile.&lt;br/&gt;</description>
- <fields>
- <field>
- <name>Finish</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>step8_stepsubmitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc</includefile>
- </step>
-</pfsensewizard>
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
deleted file mode 100644
index 3f68869..0000000
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ /dev/null
@@ -1,1741 +0,0 @@
-<?php
-/*
- traffic_shaper_wizard_multi_all.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_stepbeforeformdisplay() {
- global $stepid, $savemsg, $pkg;
-
- $fields =& $pkg['step'][0]['fields']['field'];
-
- $lans = 0;
- $wans = 0;
-
- $iflisttmp = get_configured_interface_with_descr();
- foreach ($iflisttmp as $if => $ifdesc) {
- if (!is_altq_capable(get_real_interface($if)))
- continue;
- if (interface_has_gateway($if) || interface_has_gatewayv6($if))
- $wans++;
- else
- $lans++;
- }
-
- foreach ($fields as &$field) {
- if ($field['name'] == 'numberofconnections')
- $field['value'] = $wans;
- else if ($field['name'] == 'numberoflocalinterfaces')
- $field['value'] = $lans;
- }
-}
-
-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;
- }
-
- if (!isset($_POST['numberoflocalinterfaces'])) {
- $savemsg=gettext("You need to specify the number of LAN type interfaces.");
- $stepid--;
- return;
- }
- if (intval($_POST['numberoflocalinterfaces']) < 1) {
- $savemsg=gettext("The number of LAN type interfaces should be greater than 1.");
- $stepid--;
- return;
- }
-}
-
-function step2_stepbeforeformdisplay() {
- global $config, $pkg;
- global $stepid, $savemsg;
-
- $wans = 0;
- $lans = 0;
- $iflist = array();
- $iflisttmp = get_configured_interface_with_descr();
- foreach ($iflisttmp as $if => $ifdesc) {
- if (!is_altq_capable(get_real_interface($if)))
- continue;
- if (interface_has_gateway($if) || interface_has_gatewayv6($if))
- $wans++;
- else
- $lans++;
- $iflist[$if] = $ifdesc;
- }
- $numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']);
- if ($numberofconnections > $wans) {
- $savemsg=gettext("You have less interfaces than number of connections!");
- $stepid--;
- return;
- }
-
- $numberoflocalinterfaces = intval($config['ezshaper']['step1']['numberoflocalinterfaces']);
- if ($numberoflocalinterfaces > $lans) {
- $savemsg=gettext("You have less interfaces than number of connections!");
- $stepid--;
- return;
- }
- $cfgname = "traffic_shaper_wizard_multi_all.xml";
-
- $fields =& $pkg['step'][1]['fields']['field'];
-
- /*
- unset($config['ezshaper']['step2']);
- $config['ezshaper']['step2'] = array();
- write_config();
- */
- $fields = array();
-
- for ($i = 0; $i < $numberoflocalinterfaces; $i++) {
- $field = array();
- $interface_friendly = $i+1;
- $field['name'] = "Setup connection speed and scheduler information for interface LAN #{$interface_friendly}";
- $field['type'] = "listtopic";
- $fields[] = $field;
-
- $field = array();
- $field['displayname'] = "Interface & Scheduler";
- $field['name'] = "local{$i}interface";
- $field['type'] = "select";
- $field['options']['option'] = array();
- foreach ($iflist as $ifname => $ifdescr) {
- // Skip wan interfaces here
- if (interface_has_gateway($ifname) || interface_has_gatewayv6($ifname))
- continue;
- $opts = array();
- $opts['displayname'] = $ifdescr;
- $opts['name'] = $ifname;
- $opts['value'] = $ifname;
- $field['options']['option'][] = $opts;
- }
- $field['combinefieldsbegin'] = "true";
- $field['bindstofield'] = "ezshaper->step2->local{$i}interface";
- $fields[] = $field;
-
- $field = array();
- $field['combinefieldsend'] = "true";
- $field['dontdisplayname'] = "true";
- $field['dontcombinecells'] = "true";
- $field['name'] = "local{$i}downloadscheduler";
- $field['type'] = "select";
- $field['typehint'] = "Queueing discipline to apply on this local interface.";
- $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->local{$i}downloadscheduler";
- $fields[] = $field;
- }
-
- for ($i = 0; $i < $numberofconnections; $i++) {
- $field = array();
- $interface_friendly = $i+1;
- $field['name'] = "Setup connection speed and scheduler information for interface WAN#{$interface_friendly}";
- $field['type'] = "listtopic";
- $fields[] = $field;
-
- $field = array();
- $field['displayname'] = "Interface & Scheduler";
- $field['name'] = "conn{$i}interface";
- $field['type'] = "select";
- $interface_real = $i+1;
- $field['options']['option'] = array();
- foreach ($iflist as $ifname => $ifdescr) {
- // Skip lan interfaces here
- if (!interface_has_gateway($ifname) && !interface_has_gatewayv6($ifname))
- continue;
- $opts = array();
- $opts['displayname'] = $ifdescr;
- $opts['name'] = $ifname;
- $opts['value'] = $ifname;
- $field['options']['option'][] = $opts;
- }
- $field['bindstofield'] = "ezshaper->step2->conn{$i}interface";
- $field['combinefieldsbegin'] = "true";
- $fields[] = $field;
-
- $field = array();
- $field['combinefieldsend'] = "true";
- $field['dontdisplayname'] = "true";
- $field['dontcombinecells'] = "true";
- $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'] = "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'] = "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']);
- $localint = intval($config['ezshaper']['step1']['numberoflocalinterfaces']);
- 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 connections {$i} and {$j}.");
- $stepid--;
- return;
- }
- if (trim($_POST["conn{$i}uploadscheduler"]) != "PRIQ") {
- if (!is_numeric($_POST["conn{$i}upload"])) {
- $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if (!is_numeric($_POST["conn{$i}download"])) {
- $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- $upbw = $_POST["conn{$i}upload"];
- $downbw = $_POST["conn{$i}download"];
- if ($upbw < 1 || $downbw < 1) {
- $savemsg = gettext("You cannot specify 0 bandwidth!");
- $stepid--;
- return;
- }
- if (intval($upbw) < 128 && $_POST["conn{$i}uploadspeed"] == "Kb" && trim($_POST["conn{$i}uploadscheduler"]) == "CBQ") {
- $savemsg=gettext("Uploads smaller than 128Kbit/s is not supported for connection {$i} on CBQ scheduler.");
- $stepid--;
- return;
- }
- }
- }
- for ($j = 0; $j < $localint; $j++) {
- if ($_POST["conn{$i}interface"] == $_POST["local{$j}interface"]) {
- $savemsg=gettext("You cannot select the same interface for local and outside.");
- $stepid--;
- return;
- }
- }
- }
- for ($i = 0; $i < $localint; $i++) {
- for ($j = $i + 1; $j < $localint; $j++) {
- if ($_POST["local{$i}interface"] == $_POST["local{$j}interface"]) {
- $savemsg=gettext("You cannot select the same interface twice on local interfaces.");
- $stepid--;
- return;
- }
- }
- }
-
- /* This is necessary since the wizard expects predefined fields. */
- unset($config['ezshaper']['step2']);
- $config['ezshaper']['step2'] = array();
-
- for ($i = 0; $i < $localint; $i++) {
- $config['ezshaper']['step2']["local{$i}downloadscheduler"] = $_POST["local{$i}downloadscheduler"];
- $config['ezshaper']['step2']["local{$i}interface"] = $_POST["local{$i}interface"];
- }
-
- 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_multi_all.xml";
-
- $numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']);
- $numberoflocalinterfaces = intval($config['ezshaper']['step1']['numberoflocalinterfaces']);
-
- $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['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['displayname'] = "Upstream SIP Server";
- $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;
-
- for ($i = 0; $i < $numberofconnections; $i++) {
- $field = array();
- $interface_friendly = $i+1;
- $field['name'] = "Connection WAN #{$interface_friendly}";
- $field['type'] = "listtopic";
- $voipfields[] = $field;
-
- $field = array();
- $field['displayname'] = "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";
- $field['typehint'] = "Upload bandwidth guarantee for VOIP phone(s) on connection {$i}.";
- $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;
- }
-
- for ($i = 0; $i < $numberoflocalinterfaces; $i++) {
- $field = array();
- $interface_friendly = $i+1;
- $field['name'] = "Connection LAN #{$interface_friendly}";
- $field['type'] = "listtopic";
- $voipfields[] = $field;
-
- $field = array();
- $field['displayname'] = "Download";
- $field['name'] = "local{$i}download";
- $enablefields[] = "local{$i}download";
- $field['type'] = "input";
- $field['bindstofield'] = "ezshaper->step3->local{$i}download";
- $field['combinefieldsbegin'] = "true";
- $voipfields[] = $field;
-
- $field = array();
- $field['combinefieldsend'] = "true";
- $field['dontdisplayname'] = "true";
- $field['dontcombinecells'] = "true";
- $field['name'] = "local{$i}downloadspeed";
- $enablefields[] = "local{$i}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->local{$i}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['upstream_sip_server']) {
- if(!is_ipaddroralias($_POST['upstream_sip_server'])) {
- /* 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 ($config['ezshaper']['step2']["conn{$i}uploadscheduler"] == "PRIQ")
- continue;
- if (!is_numeric($_POST["conn{$i}upload"])) {
- $savemsg = gettext("Upload bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if ($_POST["conn{$i}uploadspeed"] == "%") {
- if (intval($_POST["conn{$i}upload"]) > 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']["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) {
- $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
- $stepid--;
- return;
- }
- }
- }
-
- $localint = intval($config['ezshaper']['step1']['numberoflocalinterfaces']);
- for ($i = 0; $i < $localint; $i++) {
- if ($config['ezshaper']['step2']["local{$i}downloadscheduler"] == "PRIQ")
- continue;
- if (!is_numeric($_POST["local{$i}download"])) {
- $savemsg = gettext("Download bandwidth of connection {$i} is not valid.");
- $stepid--;
- return;
- }
- if ($_POST["local{$i}downloadspeed"] == "%") {
- if (intval($_POST["local{$i}download"]) > 80) {
- $savemsg=gettext("You cannot set the VoIP download bandwidth on connection {$i} higher than 80% of the connection.");
- $stepid--;
- return;
- }
- } else {
- for ($j = 0; $j < $steps; $j++) {
- $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$j}downloadspeed"]);
- $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$j}download"]);
- $factor = wizard_get_bandwidthtype_scale($_POST["local{$i}downloadspeed"]);
- $input_bw = $factor * floatval($_POST["local{$i}download"]);
- if ((0.8 * $ifbw) < $input_bw) {
- $savemsg=gettext("You cannot set the VoIP download bandwidth on connection {$j} higher than 80% of the connection.");
- $stepid--;
- return;
- }
- }
- }
- }
-
- /* This is necessary since the wizard expects predefined fields. */
- unset($config['ezshaper']['step3']);
- $config['ezshaper']['step3'] = array();
-
- if (!empty($_POST['upstream_sip_server']))
- $config['ezshaper']['step3']['address'] = $_POST['upstream_sip_server'];
- if ($_POST['enable'] == 'on')
- $config['ezshaper']['step3']['enable'] = 'on';
- if (!empty($_POST['provider'])) {
- $VoIPproviders = array("Generic", "VoicePulse", "Asterisk", "Panasonic");
- if (in_array($_POST['provider'], $VoIPproviders)) {
- $config['ezshaper']['step3']['provider'] = $_POST['provider'];
- }
- }
- for ($i = 0; $i < $localint; $i++) {
- $config['ezshaper']['step3']["local{$i}download"] = $_POST["local{$i}download"];
- $config['ezshaper']['step3']["local{$i}downloadspeed"] = $_POST["local{$i}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--;
- }
- 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_chosen_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_chosen_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 = intval($config['ezshaper']['step1']['numberofconnections']);
-
- $interfacelist = array();
-
- for ($i = 0; $i < $steps; $i++) {
-
- $tmppath = array();
- $altq =& new altq_root_queue();
-
- $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;
- $factor = 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 = $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 (intval($remainbw) > 0 && intval($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_all.xml&stepid=2&message={$savemsg}");
- exit;
- } else {
- $remainbw = 100 - $remainbw;
- }
-
- 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']["conn{$i}upload"]);
- $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}uploadspeed"];
- }
- else if ($sched == "HFSC") {
- $tmpcf['linkshare3'] =
- floatval($config['ezshaper']['step2']["conn{$i}upload"]) . $config['ezshaper']['step2']["conn{$i}uploadspeed"];
- $tmpcf['upperlimit3'] =
- floatval($config['ezshaper']['step2']["conn{$i}upload"]) . $config['ezshaper']['step2']["conn{$i}uploadspeed"];
- $tmpcf['upperlimit'] = "on";
-
-
- $tmpcf['linkshare'] = "on";
- $tmpcf['bandwidth'] = floatval($config['ezshaper']['step2']["conn{$i}upload"]);
- $tmpcf['bandwidthtype'] = $config['ezshaper']['step2']["conn{$i}uploadspeed"];
- }
- 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 ($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['bandwidthtype'] = $penaltybwunit;
- $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 ----------------------------------------------------------------------------------------- */
- $localint = intval($config['ezshaper']['step1']['numberoflocalinterfaces']);
- $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;
- }
-
- for ($i = 0; $i < $localint; $i++) {
-
- $tmppath = array();
- $altq =& new altq_root_queue();
-
- $altq->SetInterface($config['ezshaper']['step2']["local{$i}interface"]);
- $altq->SetScheduler($config['ezshaper']['step2']["local{$i}downloadscheduler"]);
- //$altq->SetBandwidth($lanbw/1000);
- //$altq->SetBwscale("Kb");
- $altq->SetEnabled("on");
- $altq_list_queues[$altq->GetQname()] =& $altq;
- array_push($tmppath, $config['ezshaper']['step2']["local{$i}interface"]);
- $altq->SetLink($tmppath);
- //var_dump($input_errors);
- $altq->wconfig();
-
- $sched = $config['ezshaper']['step2']["local{$i}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']["local{$i}download"];
- $voipbwunit = $config['ezshaper']['step3']["local{$i}downloadspeed"];
- if ($sched != HFSC) {
- if ($voipbwunit == "%")
- $factor = $lanbw/100;
- else
- $factor = wizard_get_bandwidthtype_scale($voipbwunit);
- $remainbw += floatval($voipbw) * $factor;
- } else
- $remainbw += 32000; /* 32Kbit/s reserved for HFSC link sharing */
- }
- 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 += floatval($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 += floatval($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 (intval($remainbw) > 0 && intval($remainbw) > 40) {
- $savemsg=gettext("Custom Bandwidths are greater than 40%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.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['upperlimit3'] = $lanbw/1000 . "Kb";
- $tmpcf['upperlimit'] = "on";
- $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";
- $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;
- $tmpcf['bandwidthtype'] = $penaltybwunit;
- } else {
- $tmpcf['bandwidthtype'] = "%";
- $tmpcf['bandwidth'] = $remainbw * 0.05; /* 5% bandwidth */
- }
- } 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();
-
- $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 automatically 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_all.xml b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
deleted file mode 100755
index e94256b..0000000
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
+++ /dev/null
@@ -1,1657 +0,0 @@
-<?xml version="1.0"?>
-<pfsensewizard>
- <copyright><![CDATA[
- /*
- traffic_shaper_wizard_multi_all.xml
- part of pfSense (https://www.pfsense.org/)
-
- Copyright (C) 2005 Bill Marquette - bill.marquette@gmail.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.
- */]]></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>
- <type>listtopic</type>
- <name>Traffic shaper Wizard</name>
- </field>
- <field>
- <displayname>Enter number of WAN type 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>
- <displayname>Enter number of LAN type interfaces</displayname>
- <name>numberoflocalinterfaces</name>
- <type>input</type>
- <validate>^[0-9]+$</validate>
- <description>Number of local interfaces you have</description>
- <bindstofield>ezshaper->step1->numberoflocalinterfaces</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepbeforeformdisplay>step1_stepbeforeformdisplay();</stepbeforeformdisplay>
- <stepsubmitphpaction>step1_submitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_all.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_all.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-&gt;step3-&gt;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-&gt;step3-&gt;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>
- <displayname>Upstream SIP Server</displayname>
- <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 &lt;strong&gt;remote&lt;/strong&gt; PBX or SIP Trunk to prioritize. &lt;br /&gt;NOTE: You can also use a Firewall Alias in this location.</description>
- <bindstofield>ezshaper-&gt;step3-&gt;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-&gt;step3-&gt;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_multi_all.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-&gt;step4-&gt;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-&gt;step4-&gt;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-&gt;step4-&gt;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_all.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-&gt;step5-&gt;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-&gt;step5-&gt;p2pcatchall</bindstofield>
- </field>
- <field>
- <name>Bandwidth</name>
- <type>input</type>
- <validate>^[0-9]*$</validate>
- <message>Speed must be numerical.</message>
- <bindstofield>ezshaper-&gt;step5-&gt;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-&gt;step5-&gt;aimster</bindstofield>
- </field>
- <field>
- <name>BitTorrent</name>
- <type>checkbox</type>
- <typehint>Bittorrent and other P2P using the Torrent protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;bittorrent</bindstofield>
- </field>
- <field>
- <name>BuddyShare</name>
- <type>checkbox</type>
- <typehint>BuddyShare and other P2P using the BuddyShare protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;buddyshare</bindstofield>
- </field>
- <field>
- <name>CuteMX</name>
- <type>checkbox</type>
- <typehint>CuteMX and other P2P using the CuteMX protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;cutemx</bindstofield>
- </field>
- <field>
- <name>DCplusplus</name>
- <type>checkbox</type>
- <typehint>DC++ and other P2P using the DC++ protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;dcplusplus</bindstofield>
- </field>
- <field>
- <name>DCC</name>
- <type>checkbox</type>
- <typehint>irc DCC file transfers</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;dcc</bindstofield>
- </field>
- <field>
- <name>DirectConnect</name>
- <type>checkbox</type>
- <typehint>DirectConnect and other P2P using the DirectConnect protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;directconnect</bindstofield>
- </field>
- <field>
- <name>DirectFileExpress</name>
- <type>checkbox</type>
- <typehint>DirectFileExpress and other P2P using the DirectFileExpress protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;directfileexpress</bindstofield>
- </field>
- <field>
- <name>eDonkey2000</name>
- <type>checkbox</type>
- <typehint>eDonkey and other P2P using the eDonkey protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;edonkey2000</bindstofield>
- </field>
- <field>
- <name>FastTrack</name>
- <type>checkbox</type>
- <typehint>FastTrack and other P2P using the FastTrack protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;fasttrack</bindstofield>
- </field>
- <field>
- <name>Gnutella</name>
- <type>checkbox</type>
- <typehint>Gnutella and other P2P using the Gnutella protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;gnutella</bindstofield>
- </field>
- <field>
- <name>grouper</name>
- <type>checkbox</type>
- <typehint>grouper and other P2P using the grouper protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;grouper</bindstofield>
- </field>
- <field>
- <name>hotComm</name>
- <type>checkbox</type>
- <typehint>hotComm and other P2P using the hotComm protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;hotcomm</bindstofield>
- </field>
- <field>
- <name>HotlineConnect</name>
- <type>checkbox</type>
- <typehint>HotlineConnect and other P2P using the HotlineConnect protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;hotlineconnect</bindstofield>
- </field>
- <field>
- <name>iMesh</name>
- <type>checkbox</type>
- <typehint>iMesh and other P2P using the iMesh protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;imesh</bindstofield>
- </field>
- <field>
- <name>Napster</name>
- <type>checkbox</type>
- <typehint>Napster and other P2P using the Napster protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;napster</bindstofield>
- </field>
- <field>
- <name>OpenNap</name>
- <type>checkbox</type>
- <typehint>OpenNap and other P2P using the OpenNap protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;opennap</bindstofield>
- </field>
- <field>
- <name>Scour</name>
- <type>checkbox</type>
- <typehint>Scour and other P2P using the Scour protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;scour</bindstofield>
- </field>
- <field>
- <name>Shareaza</name>
- <type>checkbox</type>
- <typehint>Shareaza and other P2P using the Shareaza protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;shareaza</bindstofield>
- </field>
- <field>
- <name>SongSpy</name>
- <type>checkbox</type>
- <typehint>SongSpy and other P2P using the SongSpy protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;songspy</bindstofield>
- </field>
- <field>
- <name>WinMX</name>
- <type>checkbox</type>
- <typehint>WinMX and other P2P using the WinMX protocol and ports</typehint>
- <bindstofield>ezshaper-&gt;step5-&gt;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_all.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>BattleNET,EAOrigin,GameForWindowsLive,PlayStationConsoles,Steam,WiiConsoles,XboxConsoles,ARMA2,ARMA3,Battlefield2,Battlefield3,BattlefieldBC2,Borderlands,CallOfDuty,Counterstrike,Crysis2,Crysis3,DeltaForce,DeadSpace2,DeadSpace3,Dirt3,DOOM3,DragonAge2,EmpireEarth,EveOnline,Everquest,Everquest2,FarCry,FarCry2,FarCry3,GunZOnline,HalfLife,LeagueofLegends,Lineage2,MassEffect3,MechwarriorOnline,Minecraft,OperationFlashpointDR,PlanetSide,PlanetSide2,QuakeIII,QuakeIV,StarWarsTOR,TigerWoods2004PS2,TribesAscend,UnrealTournament,WolfensteinEnemyTerritory,WorldOfWarcraft</enablefields>
- <donotdisable>true</donotdisable>
- <bindstofield>ezshaper-&gt;step6-&gt;enable</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- <field>
- <name>Enable/Disable specific game consoles and services</name>
- <type>listtopic</type>
- </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-&gt;step6-&gt;battlenet</bindstofield>
- </field>
- <field>
- <name>EAOrigin</name>
- <type>checkbox</type>
- <typehint>EA Origin Client - Some PC games by EA use this.</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;eaorigin</bindstofield>
- </field>
- <field>
- <name>GameForWindowsLive</name>
- <type>checkbox</type>
- <typehint>Games for Windows Live</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;gamesforwindowslive</bindstofield>
- </field>
- <field>
- <name>PlayStationConsoles</name>
- <type>checkbox</type>
- <typehint>PlayStation Consoles - This should cover all ports required for the Playstation 4, Playstation, PS Vita</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;playstationconsoles</bindstofield>
- </field>
- <field>
- <name>Steam</name>
- <type>checkbox</type>
- <typehint>Steam Game Client (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 and many other games on the Steam)</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;steam</bindstofield>
- </field>
- <field>
- <name>WiiConsoles</name>
- <type>checkbox</type>
- <typehint>Wii Consoles - Wii, Wii U, DS and 3DS</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;wiiconsoles</bindstofield>
- </field>
- <field>
- <name>XboxConsoles</name>
- <type>checkbox</type>
- <typehint>Xbox Consoles - Xbox 360 and Xbox One</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;xboxconsoles</bindstofield>
- </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-&gt;step6-&gt;arma2</bindstofield>
- </field>
- <field>
- <name>ARMA3</name>
- <type>checkbox</type>
- <typehint>ARMA 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;arma3</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-&gt;step6-&gt;battlefield2</bindstofield>
- </field>
- <field>
- <name>Battlefield3</name>
- <type>checkbox</type>
- <typehint>Battlefield 3 and 4 - 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-&gt;step6-&gt;battlefield3</bindstofield>
- </field>
- <field>
- <name>BattlefieldBC2</name>
- <type>checkbox</type>
- <typehint>Battlefield: Bad Company 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;battlefieldbc2</bindstofield>
- </field>
- <field>
- <name>Borderlands</name>
- <type>checkbox</type>
- <typehint>Borderlands</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;borderlands</bindstofield>
- </field>
- <field>
- <name>CallOfDuty</name>
- <type>checkbox</type>
- <typehint>Call Of Duty (United Offensive)</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;callofduty</bindstofield>
- </field>
- <field>
- <name>Counterstrike</name>
- <type>checkbox</type>
- <typehint>Counterstrike. The ultimate 1st person shooter.</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;counterstrike</bindstofield>
- </field>
- <field>
- <name>Crysis2</name>
- <type>checkbox</type>
- <typehint>Crysis 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;crysis2</bindstofield>
- </field>
- <field>
- <name>Crysis3</name>
- <type>checkbox</type>
- <typehint>Crysis 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;crysis3</bindstofield>
- </field>
- <field>
- <name>DeadSpace2</name>
- <type>checkbox</type>
- <typehint>Dead Space2 - this game uses a HUGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;deadspace2</bindstofield>
- </field>
- <field>
- <name>DeadSpace3</name>
- <type>checkbox</type>
- <typehint>Dead Space 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;deadspace3</bindstofield>
- </field>
- <field>
- <name>DeltaForce</name>
- <type>checkbox</type>
- <typehint>Delta Force</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;deltaforce</bindstofield>
- </field>
- <field>
- <name>Dirt3</name>
- <type>checkbox</type>
- <typehint>Dirt 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;dirt3</bindstofield>
- </field>
- <field>
- <name>DOOM3</name>
- <type>checkbox</type>
- <typehint>DOOM3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;doom3</bindstofield>
- </field>
- <field>
- <name>DragonAge2</name>
- <type>checkbox</type>
- <typehint>Dragon Age 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;dragonage2</bindstofield>
- </field>
- <field>
- <name>EmpireEarth</name>
- <type>checkbox</type>
- <typehint>Empire Earth</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;empireearth</bindstofield>
- </field>
- <field>
- <name>EveOnline</name>
- <type>checkbox</type>
- <typehint>EVE Online</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;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-&gt;step6-&gt;everquest</bindstofield>
- </field>
- <field>
- <name>Everquest2</name>
- <type>checkbox</type>
- <typehint>Everquest II</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;everquest2</bindstofield>
- </field>
- <field>
- <name>FarCry</name>
- <type>checkbox</type>
- <typehint>Far Cry</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;farcry</bindstofield>
- </field>
- <field>
- <name>FarCry2</name>
- <type>checkbox</type>
- <typehint>Far Cry 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;farcry2</bindstofield>
- </field>
- <field>
- <name>FarCry3</name>
- <type>checkbox</type>
- <typehint>Far Cry 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;farcry3</bindstofield>
- </field>
- <field>
- <name>GunZOnline</name>
- <type>checkbox</type>
- <typehint>GunZ Online</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;gunzonline</bindstofield>
- </field>
- <field>
- <name>HalfLife</name>
- <type>checkbox</type>
- <typehint>Half-Life</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;halflife</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-&gt;step6-&gt;leagueoflegends</bindstofield>
- </field>
- <field>
- <name>Lineage2</name>
- <type>checkbox</type>
- <typehint>Lineage II</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;lineage2</bindstofield>
- </field>
- <field>
- <name>MassEffect3</name>
- <type>checkbox</type>
- <typehint>Mass Effect 3</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;masseffect3</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-&gt;step6-&gt;mechwarrioronline</bindstofield>
- </field>
- <field>
- <name>Minecraft</name>
- <type>checkbox</type>
- <typehint>Minecraft</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;minecraft</bindstofield>
- </field>
- <field>
- <name>PlanetSide</name>
- <type>checkbox</type>
- <typehint>PlanetSide</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;planetside</bindstofield>
- </field>
- <field>
- <name>PlanetSide2</name>
- <type>checkbox</type>
- <typehint>PlanetSide 2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;planetside2</bindstofield>
- </field>
- <field>
- <name>OperationFlashpointDR</name>
- <type>checkbox</type>
- <typehint>Operation Flashpoint: Dragon Rising</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;operationflashpoint-dr</bindstofield>
- </field>
- <field>
- <name>QuakeIII</name>
- <type>checkbox</type>
- <typehint>Quake III</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;quakeiii</bindstofield>
- </field>
- <field>
- <name>QuakeIV</name>
- <type>checkbox</type>
- <typehint>Quake IV</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;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-&gt;step6-&gt;starwarstor</bindstofield>
- </field>
- <field>
- <name>TigerWoods2004PS2</name>
- <type>checkbox</type>
- <typehint>Tiger Woods 2004 for PS2</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;tigerwoods2004ps2</bindstofield>
- </field>
- <field>
- <name>TribesAscend</name>
- <type>checkbox</type>
- <typehint>Tribes Ascend</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;tribesascend</bindstofield>
- </field>
- <field>
- <name>UnrealTournament</name>
- <type>checkbox</type>
- <typehint>Unreal Tournament Series</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;unrealtournament</bindstofield>
- </field>
- <field>
- <name>WolfensteinEnemyTerritory</name>
- <type>checkbox</type>
- <typehint>Wolfenstein Enemy Territory</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;wolfet</bindstofield>
- </field>
- <field>
- <name>WorldOfWarcraft</name>
- <type>checkbox</type>
- <typehint>World of Warcraft</typehint>
- <bindstofield>ezshaper-&gt;step6-&gt;wow</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_all.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>AppleRemoteDesktop,MSRDP,PCAnywhere,VNC,AIM,Facetime,GoogleHangouts,ICQ,IRC,Jabber,MSN,TeamSpeak,TeamSpeak3,Ventrilo,PPTP,IPSEC,iTunesRadio,StreamingMP3,RTSP,RTMP,HTTP,IMAP,LotusNotes,POP3,SMTP,BattleNETDownloader,SteamDownloader,APNS,AppleMobileSync,CrashPlan,CVSUP,DNS,GIT,HBCI,ICMP,MySqlServer,NNTP,Slingbox,SMB,SNMP,Subversion</enablefields>
- <donotdisable>true</donotdisable>
- <bindstofield>ezshaper-&gt;step7-&gt;enable</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- <field>
- <name>Remote Service / Terminal emulation</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>AppleRemoteDesktop</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>MSRDP</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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>PCAnywhere</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>VNC</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>Messengers</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>AIM</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>Facetime</name>
- <bindstofield>ezshaper-&gt;step7-&gt;facetime</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>Facetime</typehint>
- </field>
- <field>
- <name>ICQ</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>IRC</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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>GoogleHangouts</name>
- <bindstofield>ezshaper-&gt;step7-&gt;googlehangouts</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>Google Hangouts</typehint>
- </field>
- <field>
- <name>MSN</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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>Teamspeak3</name>
- <bindstofield>ezshaper-&gt;step7-&gt;teamspeak3</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 3</typehint>
- </field>
- <field>
- <name>Ventrilo</name>
- <bindstofield>ezshaper-&gt;step7-&gt;ventrilo</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>Ventrilo</typehint>
- </field>
- <field>
- <name>VPN</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>PPTP</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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>iTunesRadio</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;itunesradio</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>iTunes Radio - this rule uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic.</typehint>
- </field>
- <field>
- <name>StreamingMP3</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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>RTMP</name>
- <bindstofield>ezshaper-&gt;step7-&gt;rtmp</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>Real-Time Messaging Protocol - Used by video streaming services such as Twitch.tv.</typehint>
- </field>
- <field>
- <name>Web</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>HTTP</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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>Game Downloader</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>BattleNetDownloader</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;battlenetdownloader</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>Battle.NET Downloader</typehint>
- </field>
- <field>
- <name>SteamDownloader</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;steamdownloader</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>Steam Downloader</typehint>
- </field>
- <field>
- <name>Miscellaneous</name>
- <type>listtopic</type>
- </field>
- <field>
- <name>APNS</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;apns</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>Apple Push Notification Service</typehint>
- </field>
- <field>
- <name>AppleMobileSync</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;applemobilesync</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>Apple Mobile Sync</typehint>
- </field>
- <field>
- <name>CrashPlan</name>
- <bindstofield>ezshaper-&gt;step7-&gt;crashplan</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>CrashPlan</typehint>
- </field>
- <field>
- <name>CVSUP</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>DNS</name>
- <type>select</type>
- <bindstofield>ezshaper-&gt;step7-&gt;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>Git</name>
- <bindstofield>ezshaper-&gt;step7-&gt;git</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>Git Server</typehint>
- </field>
- <field>
- <name>HBCI</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>ICMP</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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-&gt;step7-&gt;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>Slingbox</name>
- <bindstofield>ezshaper-&gt;step7-&gt;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>Subversion</name>
- <bindstofield>ezshaper-&gt;step7-&gt;subversion</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>Subversion Server</typehint>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_all.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.&lt;br/&gt; Please note that this may take a moment.&lt;br/&gt; Also note that the traffic shaper is stateful meaning that only new connections will be shaped.&lt;br/&gt; If this is an issue please reset the state table after loading the profile.&lt;br/&gt;</description>
- <fields>
- <field>
- <name>Finish</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>step8_stepsubmitphpaction();</stepsubmitphpaction>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc</includefile>
- </step>
-</pfsensewizard>
OpenPOWER on IntegriCloud