From fed2cb61f4e7ea60e24f338de61d0748330baabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Mon, 14 Jul 2008 21:10:57 +0000 Subject: This is not needed anymore. --- usr/local/www/interfaces_opt.php | 561 --------------------------------------- 1 file changed, 561 deletions(-) delete mode 100755 usr/local/www/interfaces_opt.php (limited to 'usr') diff --git a/usr/local/www/interfaces_opt.php b/usr/local/www/interfaces_opt.php deleted file mode 100755 index 5f404ef..0000000 --- a/usr/local/www/interfaces_opt.php +++ /dev/null @@ -1,561 +0,0 @@ -. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -require("guiconfig.inc"); - -unset($optif); -if ($_GET['optif']) - $optif = $_GET['optif']; -else if ($_POST['optif']) - $optif = $_POST['optif']; - -if (!$optif) - exit; - -function remove_bad_chars($string) { - return preg_replace('/[^a-z|_|0-9]/i','',$string); -} - -if (!is_array($config['gateways']['gateway_item'])) - $config['gateways']['gateway_item'] = array(); -$a_gateways = &$config['gateways']['gateway_item']; - -$optcfg = &$config['interfaces'][$optif]; -$optcfg['descr'] = remove_bad_chars($optcfg['descr']); - -if(is_array($config['aliases']['alias'])) - foreach($config['aliases']['alias'] as $alias) - if($alias['name'] == $optcfg['descr']) - $input_errors[] = gettext("Sorry, an alias with the name {$optcfg['descr']} already exists."); - -$pconfig['descr'] = $optcfg['descr']; -$pconfig['bridge'] = $optcfg['bridge']; - -$pconfig['enable'] = isset($optcfg['enable']); - -$pconfig['blockpriv'] = isset($optcfg['blockpriv']); -$pconfig['blockbogons'] = isset($optcfg['blockbogons']); -$pconfig['spoofmac'] = $optcfg['spoofmac']; -$pconfig['mtu'] = $optcfg['mtu']; - -$pconfig['disableftpproxy'] = isset($optcfg['disableftpproxy']); - -/* Wireless interface? */ -if (isset($optcfg['wireless'])) { - require("interfaces_wlan.inc"); - wireless_config_init(); -} - -if ($optcfg['ipaddr'] == "dhcp") { - $pconfig['type'] = "DHCP"; - $pconfig['dhcphostname'] = $optcfg['dhcphostname']; - $pconfig['alias-address'] = $optcfg['alias-address']; - $pconfig['alias-subnet'] = $optcfg['alias-subnet']; -} else { - $pconfig['type'] = "Static"; - $pconfig['ipaddr'] = $optcfg['ipaddr']; - $pconfig['subnet'] = $optcfg['subnet']; - $pconfig['gateway'] = $optcfg['gateway']; - $pconfig['pointtopoint'] = $optcfg['pointtopoint']; - $pconfig['ap'] = $optcfg['ap']; - $pconfig['phone'] = $optcfg['phone']; -} - -if ($_POST) { - - unset($input_errors); - - /* filter out spaces from descriptions */ - $POST['descr'] = remove_bad_chars($POST['descr']); - - if($_POST['gateway'] and $pconfig['gateway'] <> $_POST['gateway']) { - /* enumerate slbd gateways and make sure we are not creating a route loop */ - if(is_array($config['load_balancer']['lbpool'])) { - foreach($config['load_balancer']['lbpool'] as $lbpool) { - if($lbpool['type'] == "gateway") { - foreach ((array) $lbpool['servers'] as $server) { - $svr = split("\|", $server); - if($svr[1] == $pconfig['gateway']) { - $_POST['gateway'] = $pconfig['gateway']; - $input_errors[] = "Cannot change {$svr[1]} gateway. It is currently referenced by the load balancer pools."; - break; - } - } - } - } - foreach($config['filter']['rule'] as $rule) { - if($rule['gateway'] == $_POST['gateway']) { - $input_errors[] = "Cannot change {$_POST['gateway']} gateway. It is currently referenced by the filter rules via policy based routing."; - break; - } - } - } - } - - $pconfig = $_POST; - - /* input validation */ - if ($_POST['enable']) { - - /* optional interface if list */ - $iflist = get_configured_interface_with_descr(true); - - /* description unique? */ - foreach ($iflist as $if => $ifdescr) { - if ($if != $optif && $ifdescr == $_POST['descr']) - $input_errors[] = "An interface with the specified description already exists."; - } - - if ($_POST['bridge']) { - /* double bridging? */ - foreach($iflist as $oif => $oifname) { - if ($oif != $optif) { - if ($config['interfaces'][$oif]['bridge'] == $_POST['bridge']) { - //$input_errors[] = "Optional interface {$optif} " . - // "({$config['interfaces'][$oif]['descr']}) is already bridged to " . - // "the specified interface."; - } else if ($config['interfaces'][$oif]['bridge'] == $optif) { - //$input_errors[] = "Optional interface {$optif} " . - // "({$config['interfaces'][$oif]['descr']}) is already bridged to " . - // "this interface."; - } - } - } - if ($config['interfaces'][$_POST['bridge']]['bridge']) { - //$input_errors[] = "The specified interface is already bridged to " . - // "another interface."; - } - /* captive portal on? */ - if (isset($config['captiveportal']['enable'])) { - //$input_errors[] = "Interfaces cannot be bridged while the captive portal is enabled."; - } - } else { - if ($_POST['type'] <> "DHCP") { - $reqdfields = explode(" ", "descr ipaddr subnet"); - $reqdfieldsn = explode(",", "Description,IP address,Subnet bit count"); - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) { - $input_errors[] = "A valid IP address must be specified."; - } - if (($_POST['subnet'] && !is_numeric($_POST['subnet']))) { - $input_errors[] = "A valid subnet bit count must be specified."; - } - if ($_POST['gateway']) { - $match = false; - foreach($a_gateways as $gateway) { - if(in_array($_POST['gateway'], $gateway)) { - $match = true; - } - } - if(!$match) - $input_errors[] = "A valid gateway must be specified."; - } - } - } - if (($_POST['alias-address'] && !is_ipaddr($_POST['alias-address']))) { - $input_errors[] = "A valid alias IP address must be specified."; - } - if (($_POST['alias-subnet'] && !is_numeric($_POST['alias-subnet']))) { - $input_errors[] = "A valid alias subnet bit count must be specified."; - } - - if ($_POST['mtu'] && (($_POST['mtu'] < 576) || ($_POST['mtu'] > 1500))) { - $input_errors[] = "The MTU must be between 576 and 1500 bytes."; - } - if (($_POST['spoofmac'] && !is_macaddr($_POST['spoofmac']))) { - $input_errors[] = "A valid MAC address must be specified."; - } - } - - if($_POST['mtu']) { - if($_POST['mtu'] < 24 or $_POST['mtu'] > 1501) - $input_errors[] = "A valid MTU is required 24-1500."; - } - - /* Wireless interface? */ - if (isset($optcfg['wireless'])) { - $wi_input_errors = wireless_config_post(); - if ($wi_input_errors) { - $input_errors = array_merge($input_errors, $wi_input_errors); - } - } - - if (!$input_errors) { - - $bridge = discover_bridge($optcfg['if'], filter_translate_type_to_real_interface($optcfg['bridge'])); - if($bridge <> "-1") { - destroy_bridge($bridge); - } - - unset($optcfg['dhcphostname']); - unset($optcfg['disableftpproxy']); - - /* per interface pftpx helper */ - if($_POST['disableftpproxy'] == "yes") { - $optcfg['disableftpproxy'] = true; - system_start_ftp_helpers(); - } else { - system_start_ftp_helpers(); - } - - $optcfg['descr'] = remove_bad_chars($_POST['descr']); - $optcfg['bridge'] = $_POST['bridge']; - $optcfg['enable'] = $_POST['enable'] ? true : false; - - if ($_POST['type'] == "Static") { - $optcfg['ipaddr'] = $_POST['ipaddr']; - $optcfg['subnet'] = $_POST['subnet']; - $optcfg['gateway'] = $_POST['gateway']; - if (isset($optcfg['ispointtopoint'])) { - $optcfg['pointtopoint'] = $_POST['pointtopoint']; - $optcfg['ap'] = $_POST['ap']; - $optcfg['phone'] = $_POST['phone']; - } - } else if ($_POST['type'] == "DHCP") { - $optcfg['ipaddr'] = "dhcp"; - $optcfg['dhcphostname'] = $_POST['dhcphostname']; - $optcfg['alias-address'] = $_POST['alias-address']; - $optcfg['alias-subnet'] = $_POST['alias-subnet']; - } - - $optcfg['blockpriv'] = $_POST['blockpriv'] ? true : false; - $optcfg['blockbogons'] = $_POST['blockbogons'] ? true : false; - $optcfg['spoofmac'] = $_POST['spoofmac']; - $optcfg['mtu'] = $_POST['mtu']; - - write_config(); - - $savemsg = get_std_save_message($retval); - } -} - - -$pgtitle = array("Interfaces","Optional {$optif} (" . htmlspecialchars($optcfg['descr']) . ")"); -include("head.inc"); - -?> - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Optional Interface Configuration
  - onClick="enable_change(false)"> - Enable Optional interface
Description - -
Enter a description (name) for the interface here. -
General configuration
AP Hostname - -
Phone Number - -
Remote IP - -
Type
MAC address - - Copy my MAC address -
- 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
MTU -
- 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 MTU of 1492 bytes for PPPoE and 1500 bytes for all other - connection types will be assumed.
IP configuration
Bridge with -
IP address - - / - -
GatewaySelect a existing Gateway from the list or add one on the Gateways page
-
Other
FTP Helper - onclick="enable_change(false)" /> - Disable the userland FTP-Proxy application -
-
DHCP client configuration
Hostname -
- 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).
Alias IP address - - The value in this field is used as a fixed alias IP address by the - DHCP client.
  - - -
 Note:
-
be sure to add firewall rules to permit traffic - through the interface. You also need firewall rules for an interface in - bridged mode as the firewall acts as a filtering bridge.
-
- - -

Optional has been disabled because there is no interface.

- - - - - - -- cgit v1.1