Commit 0bc35548 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) refactor interfaces_bridge_edit.php

parent f47013c9
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Ermal Luçi Copyright (C) 2008 Ermal Luçi
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, 1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
...@@ -36,608 +36,611 @@ require_once("unbound.inc"); ...@@ -36,608 +36,611 @@ require_once("unbound.inc");
require_once("services.inc"); require_once("services.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_bridge.php'); if (!isset($config['bridges']) || !is_array($config['bridges'])) {
$config['bridges'] = array();
if (!is_array($config['bridges'])) {
$config['bridges'] = array();
} }
if (!isset($config['bridges']['bridged']) || !is_array($config['bridges']['bridged'])) {
if (!is_array($config['bridges']['bridged'])) { $config['bridges']['bridged'] = array();
$config['bridges']['bridged'] = array();
} }
$a_bridges = &$config['bridges']['bridged']; $a_bridges = &$config['bridges']['bridged'];
$ifacelist = get_configured_interface_with_descr(); // interface list
foreach ($ifacelist as $bif => $bdescr) { $ifacelist = array();
if (substr(get_real_interface($bif), 0, 3) == "gre") foreach (get_configured_interface_with_descr() as $bif => $bdescr) {
unset($ifacelist[$bif]); if (substr(get_real_interface($bif), 0, 3) != "gre") {
$ifacelist[$bif] = $bdescr;
}
} }
if (is_numericint($_GET['id']))
$id = $_GET['id'];
if (isset($_POST['id']) && is_numericint($_POST['id']))
$id = $_POST['id'];
if (isset($id) && $a_bridges[$id]) { if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['enablestp'] = isset($a_bridges[$id]['enablestp']); // read form data
$pconfig['descr'] = $a_bridges[$id]['descr']; if (!empty($a_bridges[$_GET['id']])) {
$pconfig['bridgeif'] = $a_bridges[$id]['bridgeif']; $id = $_GET['id'];
$pconfig['members'] = $a_bridges[$id]['members']; }
$pconfig['maxaddr'] = $a_bridges[$id]['maxaddr']; // copy fields 1-on-1
$pconfig['timeout'] = $a_bridges[$id]['timeout']; $copy_fields = array('descr', 'bridgeif', 'maxaddr', 'timeout', 'maxage','fwdelay', 'hellotime', 'priority', 'proto', 'holdcnt', 'span');
if ($a_bridges[$id]['static']) foreach ($copy_fields as $fieldname) {
$pconfig['static'] = $a_bridges[$id]['static']; if (isset($a_bridges[$id][$fieldname])) {
if ($a_bridges[$id]['private']) $pconfig[$fieldname] = $a_bridges[$id][$fieldname];
$pconfig['private'] = $a_bridges[$id]['private']; } else {
if (isset($a_bridges[$id]['stp'])) $pconfig[$fieldname] = null;
$pconfig['stp'] = $a_bridges[$id]['stp']; }
$pconfig['maxage'] = $a_bridges[$id]['maxage']; }
$pconfig['fwdelay'] = $a_bridges[$id]['fwdelay']; // bool fields
$pconfig['hellotime'] = $a_bridges[$id]['hellotime']; $pconfig['enablestp'] = isset($a_bridges[$id]['enablestp']);
$pconfig['priority'] = $a_bridges[$id]['priority'];
$pconfig['proto'] = $a_bridges[$id]['proto']; // simple array fields
$pconfig['holdcnt'] = $a_bridges[$id]['holdcnt']; $array_fields = array('members', 'stp', 'edge', 'autoedge', 'ptp', 'autoptp', 'static', 'private');
if (!empty($a_bridges[$id]['ifpriority'])) { foreach ($array_fields as $fieldname) {
$pconfig['ifpriority'] = explode(",", $a_bridges[$id]['ifpriority']); if (!empty($a_bridges[$id][$fieldname])) {
$ifpriority = array(); $pconfig[$fieldname] = explode(',', $a_bridges[$id][$fieldname]);
foreach ($pconfig['ifpriority'] as $cfg) { } else {
list ($key, $value) = explode(":", $cfg); $pconfig[$fieldname] = array();
$embprioritycfg[$key] = $value; }
foreach ($embprioritycfg as $key => $value) { }
$ifpriority[$key] = $value;
} // array key/value sets
} if (!empty($a_bridges[$id]['ifpriority'])) {
$pconfig['ifpriority'] = $ifpriority; foreach (explode(",", $a_bridges[$id]['ifpriority']) as $cfg) {
} list ($key, $value) = explode(":", $cfg);
if (!empty($a_bridges[$id]['ifpathcost'])) { $pconfig['ifpriority_'.$key] = $value;
$pconfig['ifpathcost'] = explode(",", $a_bridges[$id]['ifpathcost']); }
$ifpathcost = array(); }
foreach ($pconfig['ifpathcost'] as $cfg) { if (!empty($a_bridges[$id]['ifpathcost'])) {
list ($key, $value) = explode(":", $cfg); foreach (explode(",", $a_bridges[$id]['ifpathcost']) as $cfg) {
$embpathcfg[$key] = $value; list ($key, $value) = explode(":", $cfg);
foreach ($embpathcfg as $key => $value) { $pconfig['ifpathcost_'.$key] = $value;
$ifpathcost[$key] = $value; }
} }
} } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
$pconfig['ifpathcost'] = $ifpathcost; // save / validate formdata
} if (!empty($a_bridges[$_POST['id']])) {
$pconfig['span'] = $a_bridges[$id]['span']; $id = $_POST['id'];
if (isset($a_bridges[$id]['edge'])) }
$pconfig['edge'] = $a_bridges[$id]['edge'];
if (isset($a_bridges[$id]['autoedge'])) $input_errors = array();
$pconfig['autoedge'] = $a_bridges[$id]['autoedge']; $pconfig = $_POST;
if (isset($a_bridges[$id]['ptp']))
$pconfig['ptp'] = $a_bridges[$id]['ptp']; /* input validation */
if (isset($a_bridges[$id]['autoptp'])) $reqdfields = explode(" ", "members");
$pconfig['autoptp'] = $a_bridges[$id]['autoptp']; $reqdfieldsn = array(gettext("Member Interfaces"));
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if ($_POST) {
if (!empty($pconfig['maxage']) && !is_numeric($pconfig['maxage'])) {
unset($input_errors); $input_errors[] = gettext("Maxage needs to be an integer between 6 and 40.");
$pconfig = $_POST; }
if (!empty($pconfig['maxaddr']) && !is_numeric($pconfig['maxaddr'])) {
/* input validation */ $input_errors[] = gettext("Maxaddr needs to be an integer.");
$reqdfields = explode(" ", "members"); }
$reqdfieldsn = array(gettext("Member Interfaces")); if (!empty($pconfig['timeout']) && !is_numeric($pconfig['timeout'])) {
$input_errors[] = gettext("Timeout needs to be an integer.");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); }
if (!empty($pconfig['fwdelay']) && !is_numeric($pconfig['fwdelay'])) {
if ($_POST['maxage'] && !is_numeric($_POST['maxage'])) $input_errors[] = gettext("Forward Delay needs to be an integer between 4 and 30.");
$input_errors[] = gettext("Maxage needs to be an integer between 6 and 40."); }
if ($_POST['maxaddr'] && !is_numeric($_POST['maxaddr'])) if (!empty($pconfig['hellotime']) && !is_numeric($pconfig['hellotime'])) {
$input_errors[] = gettext("Maxaddr needs to be an integer."); $input_errors[] = gettext("Hello time for STP needs to be an integer between 1 and 2.");
if ($_POST['timeout'] && !is_numeric($_POST['timeout'])) }
$input_errors[] = gettext("Timeout needs to be an integer."); if (!empty($pconfig['priority']) && !is_numeric($pconfig['priority'])) {
if ($_POST['fwdelay'] && !is_numeric($_POST['fwdelay'])) $input_errors[] = gettext("Priority for STP needs to be an integer between 0 and 61440.");
$input_errors[] = gettext("Forward Delay needs to be an integer between 4 and 30."); }
if ($_POST['hellotime'] && !is_numeric($_POST['hellotime'])) if (!empty($pconfig['holdcnt']) && !is_numeric($pconfig['holdcnt'])) {
$input_errors[] = gettext("Hello time for STP needs to be an integer between 1 and 2."); $input_errors[] = gettext("Transmit Hold Count for STP needs to be an integer between 1 and 10.");
if ($_POST['priority'] && !is_numeric($_POST['priority'])) }
$input_errors[] = gettext("Priority for STP needs to be an integer between 0 and 61440."); foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST['holdcnt'] && !is_numeric($_POST['holdcnt'])) if (!empty($pconfig['ifpriority_'.$ifn]) && !is_numeric($pconfig['ifpriority_'.$ifn])) {
$input_errors[] = gettext("Transmit Hold Count for STP needs to be an integer between 1 and 10."); $input_errors[] = sprintf(gettext("%s interface priority for STP needs to be an integer between 0 and 240."), $ifdescr);
foreach ($ifacelist as $ifn => $ifdescr) { }
if ($_POST[$ifn] <> "" && !is_numeric($_POST[$ifn])) { if (!empty($pconfig['ifpathcost_'.$ifn]) && !is_numeric($pconfig['ifpathcost_'.$ifn])) {
$input_errors[] = sprintf(gettext("%s interface priority for STP needs to be an integer between 0 and 240."), $ifdescr); $input_errors[] = sprintf(gettext("%s interface path cost for STP needs to be an integer between 1 and 200000000."), $ifdescr);
} }
} }
$i = 0;
foreach ($ifacelist as $ifn => $ifdescr) { if (!is_array($pconfig['members']) || count($_POST['members']) < 2) {
if ($_POST["{$ifn}{$i}"] <> "" && !is_numeric($_POST["{$ifn}{$i}"])) { $input_errors[] = gettext("You must select at least 2 member interfaces for a bridge.");
$input_errors[] = sprintf(gettext("%s interface path cost for STP needs to be an integer between 1 and 200000000."), $ifdescr); }
}
$i++; if (is_array($pconfig['members'])) {
} foreach($pconfig['members'] as $ifmembers) {
if (empty($config['interfaces'][$ifmembers])) {
if (!is_array($_POST['members']) || count($_POST['members']) < 2) $input_errors[] = gettext("A member interface passed does not exist in configuration");
$input_errors[] = gettext("You must select at least 2 member interfaces for a bridge."); }
if (!empty($config['interfaces'][$ifmembers]['wireless']['mode']) && $config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap") {
if (is_array($_POST['members'])) { $input_errors[] = gettext("Bridging a wireless interface is only possible in hostap mode.");
foreach($_POST['members'] as $ifmembers) { }
if (empty($config['interfaces'][$ifmembers])) if ($pconfig['span'] != "none" && $pconfig['span'] == $ifmembers) {
$input_errors[] = gettext("A member interface passed does not exist in configuration"); $input_errors[] = gettext("Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue.");
if (is_array($config['interfaces'][$ifmembers]['wireless']) && }
$config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap") }
$input_errors[] = gettext("Bridging a wireless interface is only possible in hostap mode."); }
if ($_POST['span'] != "none" && $_POST['span'] == $ifmembers)
$input_errors[] = gettext("Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue."); if (count($input_errors) == 0) {
} $bridge = array();
} $bridge['enablestp'] = !empty($pconfig['enablestp']);
// 1 on 1 copy
if (!$input_errors) { $copy_fields = array('descr', 'maxaddr', 'timeout', 'bridgeif', 'maxage','fwdelay', 'hellotime', 'priority', 'proto', 'holdcnt');
$bridge = array(); foreach ($copy_fields as $fieldname) {
$bridge['members'] = implode(',', $_POST['members']); if (isset($pconfig[$fieldname]) && $pconfig[$fieldname] != "") {
$bridge['enablestp'] = $_POST['enablestp'] ? true : false; $bridge[$fieldname] = $pconfig[$fieldname];
$bridge['descr'] = $_POST['descr']; } else {
$bridge['maxaddr'] = $_POST['maxaddr']; $bridge[$fieldname] = null;
$bridge['timeout'] = $_POST['timeout']; }
if ($_POST['static']) }
$bridge['static'] = implode(',', $_POST['static']); if ($pconfig['span'] != "none") {
if ($_POST['private']) $bridge['span'] = $pconfig['span'];
$bridge['private'] = implode(',', $_POST['private']); }
if (isset($_POST['stp'])) // simple array fields
$bridge['stp'] = implode(',', $_POST['stp']); $array_fields = array('members', 'stp', 'edge', 'autoedge', 'ptp', 'autoptp', 'static', 'private');
$bridge['maxage'] = $_POST['maxage']; foreach ($array_fields as $fieldname) {
$bridge['fwdelay'] = $_POST['fwdelay']; if(!empty($pconfig[$fieldname])) {
$bridge['hellotime'] = $_POST['hellotime']; $bridge[$fieldname] = implode(',', $pconfig[$fieldname]);
$bridge['priority'] = $_POST['priority']; }
$bridge['proto'] = $_POST['proto']; }
$bridge['holdcnt'] = $_POST['holdcnt']; // array key/value sets
$i = 0; $bridge['ifpriority'] = "";
$ifpriority = ""; $bridge['ifpathcost'] = "";
$ifpathcost = ""; foreach ($ifacelist as $ifn => $ifdescr) {
foreach ($ifacelist as $ifn => $ifdescr) { if (isset($pconfig['ifpriority_'.$ifn]) && $pconfig['ifpriority_'.$ifn] != "") {
if ($_POST[$ifn] <> "") { if (!empty($bridge['ifpriority'])) {
if ($i > 0) $bridge['ifpriority'] .= ',';
$ifpriority .= ","; }
$ifpriority .= $ifn.":".$_POST[$ifn]; $bridge['ifpriority'] .= $ifn.":".$pconfig['ifpriority_'.$ifn];
} }
if ($_POST["{$ifn}0"] <> "") { if (isset($pconfig['ifpathcost_'.$ifn]) && $pconfig['ifpathcost_'.$ifn] != "") {
if ($i > 0) if (!empty($bridge['ifpathcost'])) {
$ifpathcost .= ","; $bridge['ifpathcost'] .= ',';
$ifpathcost .= $ifn.":".$_POST["{$ifn}0"]; }
} $bridge['ifpathcost'] .= $ifn.":".$pconfig['ifpathcost_'.$ifn];
$i++; }
} }
$bridge['ifpriority'] = $ifpriority;
$bridge['ifpathcost'] = $ifpathcost; interface_bridge_configure($bridge);
if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge")) {
if ($_POST['span'] != "none") $input_errors[] = gettext("Error occurred creating interface, please retry.");
$bridge['span'] = $_POST['span']; } else {
else if (isset($id)) {
unset($bridge['span']); $a_bridges[$id] = $bridge;
if (isset($_POST['edge'])) } else {
$bridge['edge'] = implode(',', $_POST['edge']); $a_bridges[] = $bridge;
if (isset($_POST['autoedge'])) }
$bridge['autoedge'] = implode(',', $_POST['autoedge']); write_config();
if (isset($_POST['ptp'])) $confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
$bridge['ptp'] = implode(',', $_POST['ptp']); if ($confif <> "") {
if (isset($_POST['autoptp'])) interface_configure($confif);
$bridge['autoptp'] = implode(',', $_POST['autoptp']); }
header("Location: interfaces_bridge.php");
$bridge['bridgeif'] = $_POST['bridgeif']; exit;
interface_bridge_configure($bridge); }
if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge")) }
$input_errors[] = gettext("Error occurred creating interface, please retry.");
else {
if (isset($id) && $a_bridges[$id])
$a_bridges[$id] = $bridge;
else
$a_bridges[] = $bridge;
write_config();
$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
if ($confif <> "")
interface_configure($confif);
header("Location: interfaces_bridge.php");
exit;
}
}
} }
legacy_html_escape_form_data($pconfig);
include("head.inc"); include("head.inc");
?> ?>
<body> <body>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ $(document).ready(function() {
function show_source_port_range() { // advanced options
document.getElementById("sprtable").style.display = 'none'; $("#show_advanced").click(function(){
document.getElementById("sprtable1").style.display = ''; $(".act_show_advanced").show();
document.getElementById("sprtable2").style.display = ''; $("#show_advanced_opt").hide();
document.getElementById("sprtable3").style.display = ''; });
document.getElementById("sprtable4").style.display = ''; });
document.getElementById("sprtable5").style.display = '';
document.getElementById("sprtable6").style.display = '';
document.getElementById("sprtable7").style.display = '';
document.getElementById("sprtable8").style.display = '';
document.getElementById("sprtable9").style.display = '';
document.getElementById("sprtable10").style.display = '';
}
//]]>
</script> </script>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<section class="page-content-main">
<section class="page-content-main"> <div class="container-fluid">
<div class="container-fluid"> <div class="row">
<div class="row"> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <form method="post" name="iform" id="iform">
<div id="inputerrors"></div> <div class="tab-content content-box col-xs-12 __mb">
<div class="table-responsive">
<table class="table table-striped">
<section class="col-xs-12"> <thead>
<tr>
<div class="content-box"> <td width="22%"><strong><?=gettext("Bridge configuration");?></strong></td>
<td width="78%" align="right">
<header class="content-box-head container-fluid"> <small><?=gettext("full help"); ?> </small>
<h3><?=gettext("Bridge configuration");?></h3> <i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i></a>
</header> &nbsp;
</td>
<div class="content-box-main"> </tr>
</thead>
<form action="interfaces_bridge_edit.php" method="post" name="iform" id="iform"> <tbody>
<table class="table table-striped table-sort"> <tr>
<tr> <td><a id="help_for_members" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Member interfaces"); ?></td>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Member interfaces"); ?></td> <td>
<td width="78%" class="vtable"> <select name="members[]" multiple="multiple" class="selectpicker" data-size="5" data-live-search="true">
<select name="members[]" multiple="multiple" class="selectpicker" size="3" data-live-search="true"> <?php
<?php foreach ($ifacelist as $ifn => $ifinfo):?>
// let's fix this for now in the template, although it should be fixed at the top of the page <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['members']) ? "selected=\"selected\"" : "";?>>
// $pconfig['members'] can be of different type now. <?=$ifinfo;?>
if ( isset($pconfig['members']) && is_array($pconfig['members'])) { </option>
$members_array = $pconfig['members']; <?php
} elseif (!empty($pconfig['members'])) { endforeach;?>
$members_array = explode(',', $pconfig['members']); </select>
} else { <div class="hidden" for="help_for_members">
$members_array = array(); <?=gettext("Interfaces participating in the bridge."); ?>
} </div>
foreach ($ifacelist as $ifn => $ifinfo) { </td>
echo "<option value=\"{$ifn}\""; </tr>
if (in_array($ifn, $members_array)) <tr>
echo " selected=\"selected\""; <td><a id="help_for_descr" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description"); ?></td>
echo ">{$ifinfo}</option>"; <td>
} <input type="text" name="descr" value="<?=$pconfig['descr'];?>" />
unset($members_array); <div class="hidden" for="help_for_descr">
?> <?=gettext("You may enter a description here for your reference (not parsed).");?>
</select> </div>
<br /> </td>
<span class="vexpl"><?=gettext("Interfaces participating in the bridge."); ?></span> </tr>
</td> <tr id="show_advanced_opt">
</tr> <td></td>
<tr> <td>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <input type="button" id="show_advanced" class="btn btn-xs btn-default" value="<?=gettext("Show advanced options"); ?>" />
<td width="78%" class="vtable"> </td>
<input type="text" name="descr" id="descr" class="form-control unknown" size="50" value="<?=htmlspecialchars($pconfig['descr']);?>" /> </tr>
</td> </tbody>
</tr> </table>
<tr id="sprtable"> </div>
<td></td> </div>
<td> <!-- Advanced / RSTP/STP -->
<p><input type="button" class="btn btn-xs btn-default" onclick="show_source_port_range()" value="<?=gettext("Show advanced options"); ?>" /></p> <div class="tab-content content-box col-xs-12 __mb act_show_advanced" style="display:none">
</td> <div class="table-responsive">
</tr> <table class="table table-striped">
<tr style="display:none" id="sprtable1"> <thead>
<td valign="top" class="vncell"><?=gettext("RSTP/STP"); ?> </td> <tr>
<td class="vtable"> <td colspan="2"><strong><?=gettext("Spanning Tree Protocol");?> (<?=gettext("RSTP/STP"); ?>)</strong></td>
<input type="checkbox" name="enablestp" id="enablestp" <?php if ($pconfig['enablestp']) echo "checked=\"checked\"";?> /> </tr>
<span class="vexpl"><strong><?=gettext("Enable spanning tree options for this bridge."); ?> </strong></span> </thead>
<br /><br /> <tbody>
<table id="stpoptions" border="0" cellpadding="6" cellspacing="0" summary="protocol" class="table table-striped"> <tr>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Protocol"); ?></td> <td width="22%"><a id="help_for_enablestp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Enable");?></td>
<td class="vtable" width="80%"> <td width="78%">
<select name="proto" id="proto" class="selectpicker"> <input type="checkbox" name="enablestp" <?= !empty($pconfig['enablestp']) ? "checked=\"checked\"" : "";?> />
<?php <div class="hidden" for="help_for_enablestp">
foreach (array("rstp", "stp") as $proto) { <?=gettext("Enable spanning tree options for this bridge."); ?>
echo "<option value=\"{$proto}\""; </div>
if ($pconfig['proto'] == $proto) </td>
echo " selected=\"selected\""; </tr>
echo ">".strtoupper($proto)."</option>"; <tr>
} <td><a id="help_for_proto" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Protocol"); ?></td>
?> <td>
</select> <select name="proto" id="proto" class="selectpicker">
<br /> <option value="rstp" <?=$pconfig['proto'] == "rstp" ? "selected=\"selected\"" : "";?> >
<span class="vexpl"><?=gettext("Protocol used for spanning tree."); ?> </span></td> <?=gettext("RSTP");?>
</tr> </option>
<tr> <td valign="top" class="vncell" width="20%"><?=gettext("STP interfaces"); ?></td> <option value="stp" <?=$pconfig['proto'] == "stp" ? "selected=\"selected\"" : "";?> >
<td class="vtable" width="80%"> <?=gettext("STP");?>
<select name="stp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> </option>
<?php </select>
foreach ($ifacelist as $ifn => $ifdescr) { <div class="hidden" for="help_for_proto">
echo "<option value=\"{$ifn}\""; <?=gettext("Protocol used for spanning tree."); ?>
if (stristr($pconfig['stp'], $ifn)) </div>
echo " selected=\"selected\""; </td>
echo ">{$ifdescr}</option>"; </tr>
} <tr>
?> <td><a id="help_for_stp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("STP interfaces"); ?></td>
</select> <td>
<br /> <select name="stp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<span class="vexpl" > <?php
<?=gettext("Enable Spanning Tree Protocol on interface. The if_bridge(4) " . foreach ($ifacelist as $ifn => $ifdescr):?>
"driver has support for the IEEE 802.1D Spanning Tree Protocol " . <option value="<?$ifn;?>" <?=in_array($ifn, $pconfig['stp']) ? "selected=\"selected\"" : "";?> >
"(STP). STP is used to detect and remove loops in a " . <?=$ifdescr;?>
"network topology."); ?> </option>
</span> <?php
</td></tr> endforeach;?>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Valid time"); ?></td> </select>
<td class="vtable" width="80%"> <div class="hidden" for="help_for_stp" >
<input name="maxage" type="text" class="form-control unkown" id="maxage" size="8" value="<?=htmlspecialchars($pconfig['maxage']);?>" /> <?=gettext("seconds"); ?> <?=gettext("Enable Spanning Tree Protocol on interface. The if_bridge(4) " .
<br /> "driver has support for the IEEE 802.1D Spanning Tree Protocol " .
<span class="vexpl"> "(STP). STP is used to detect and remove loops in a " .
<?=gettext("Set the time that a Spanning Tree Protocol configuration is " . "network topology."); ?>
"valid. The default is 20 seconds. The minimum is 6 seconds and " . </div>
"the maximum is 40 seconds."); ?> </td>
</span> </tr>
</td></tr> <tr>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Forward time"); ?> </td> <td><a id="help_for_maxage" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Valid time"); ?> (<?=gettext("seconds"); ?>)</td>
<td class="vtable" width="80%"> <td>
<input name="fwdelay" type="text" class="form-control unkown" id="fwdelay" size="8" value="<?=htmlspecialchars($pconfig['fwdelay']);?>" /> <?=gettext("seconds"); ?> <input name="maxage" type="text" value="<?=$pconfig['maxage'];?>" />
<br /> <div class="hidden" for="help_for_maxage">
<span class="vexpl"> <?=gettext("Set the time that a Spanning Tree Protocol configuration is " .
<?=gettext("Set the time that must pass before an interface begins forwarding " . "valid. The default is 20 seconds. The minimum is 6 seconds and " .
"packets when Spanning Tree is enabled. The default is 15 seconds. The minimum is 4 seconds and the maximum is 30 seconds."); ?> "the maximum is 40 seconds."); ?>
</span> </div>
</td></tr> </td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hello time"); ?></td> </tr>
<td class="vtable" width="80%"> <tr>
<input name="hellotime" type="text" class="form-control unkown" size="8" id="hellotime" value="<?=htmlspecialchars($pconfig['hellotime']);?>" /> <?=gettext("seconds"); ?> <td><a id="help_for_fwdelay" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Forward time"); ?> (<?=gettext("seconds"); ?>)</td>
<br /> <td>
<span class="vexpl"> <input name="fwdelay" type="text" value="<?=$pconfig['fwdelay'];?>" />
<?=gettext("Set the time between broadcasting of Spanning Tree Protocol configuration messages. The hello time may only be changed when " . <div class="hidden" for="help_for_fwdelay">
"operating in legacy STP mode. The default is 2 seconds. The minimum is 1 second and the maximum is 2 seconds."); ?> <?=gettext("Set the time that must pass before an interface begins forwarding " .
</span> "packets when Spanning Tree is enabled. The default is 15 seconds. The minimum is 4 seconds and the maximum is 30 seconds."); ?>
</td></tr> </div>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td> </td>
<td class="vtable" width="80%"> </tr>
<input name="priority" type="text" class="form-control unkown" id="priority" value="<?=htmlspecialchars($pconfig['priority']);?>" /> <tr>
<br /> <td><a id="help_for_hellotime" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hello time"); ?> (<?=gettext("seconds"); ?>)</td>
<span class="vexpl"> <td>
<?=gettext("Set the bridge priority for Spanning Tree. The default is 32768. " . <input name="hellotime" type="text" value="<?=$pconfig['hellotime'];?>" />
"The minimum is 0 and the maximum is 61440."); ?> <div class="hidden" for="help_for_hellotime">
</span> <?=gettext("Set the time between broadcasting of Spanning Tree Protocol configuration messages. The hello time may only be changed when " .
</td></tr> "operating in legacy STP mode. The default is 2 seconds. The minimum is 1 second and the maximum is 2 seconds."); ?>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hold count"); ?></td> </div>
<td class="vtable" width="80%"> </td>
<input name="holdcnt" type="text" class="form-control unkown" id="holdcnt" value="<?=htmlspecialchars($pconfig['holdcnt']);?>" /> </tr>
<br /> <tr>
<span class="vexpl"> <td><a id="help_for_priority" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Priority"); ?></td>
<?=gettext("Set the transmit hold count for Spanning Tree. This is the number" . <td>
" of packets transmitted before being rate limited. The " . <input name="priority" type="text" value="<?=$pconfig['priority'];?>" />
"default is 6. The minimum is 1 and the maximum is 10."); ?> <div class="hidden" for="help_for_priority">
</span> <?=gettext("Set the bridge priority for Spanning Tree. The default is 32768. " .
</td></tr> "The minimum is 0 and the maximum is 61440."); ?>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td> </div>
<td class="vtable" width="80%"> </td>
<table summary="priority" class="table table-striped"> </tr>
<?php foreach ($ifacelist as $ifn => $ifdescr) <tr>
echo "<tr><td>{$ifdescr}</td><td><input size=\"5\" name=\"{$ifn}\" type=\"text\" class=\"form-control unkown\" id=\"{$ifn}\" value=\"{$ifpriority[$ifn]}\" /></td></tr>"; <td><a id="help_for_holdcnt" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hold count"); ?></td>
?> <td>
<tr><td></td></tr> <input name="holdcnt" type="text" value="<?=$pconfig['holdcnt'];?>" />
</table> <div class="hidden" for="help_for_holdcnt">
<br /> <?=gettext("Set the transmit hold count for Spanning Tree. This is the number" .
<span class="vexpl" > " of packets transmitted before being rate limited. The " .
<?=gettext("Set the Spanning Tree priority of interface to value. The " . "default is 6. The minimum is 1 and the maximum is 10."); ?>
"default is 128. The minimum is 0 and the maximum is 240. Increments of 16."); ?> </div>
</span> </td>
</td></tr> </tr>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Path cost"); ?></td> <tr>
<td class="vtable" width="80%"> <td><a id="help_for_intf_priority" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Priority"); ?></td>
<table summary="path cost" class="table table-striped"> <td>
<?php $i = 0; foreach ($ifacelist as $ifn => $ifdescr) <table class="table table-striped table-condensed">
echo "<tr><td>{$ifdescr}</td><td><input size=\"8\" name=\"{$ifn}{$i}\" type=\"text\" class=\"form-control unkown\" id=\"{$ifn}{$i}\" value=\"{$ifpathcost[$ifn]}\" /></td></tr>"; <?php
?> foreach ($ifacelist as $ifn => $ifdescr):?>
<tr><td></td></tr> <tr>
</table> <td><?=$ifdescr;?></td>
<br /> <td>
<span class="vexpl" > <input name="ifpriority_<?=$ifn;?>" type="text" value="<?=isset($pconfig['ifpriority_'.$ifn]) ? $pconfig['ifpriority_'.$ifn] : "";?>" />
<?=gettext("Set the Spanning Tree path cost of interface to value. The " . </td>
"default is calculated from the link speed. To change a previously selected path cost back to automatic, set the cost to 0. ". </tr>
"The minimum is 1 and the maximum is 200000000."); ?> <?php
</span> endforeach;?>
</td></tr> </table>
<div class="hidden" for="help_for_intf_priority">
</table> <?=gettext("Set the Spanning Tree priority of interface to value. The " .
</td></tr> "default is 128. The minimum is 0 and the maximum is 240. Increments of 16."); ?>
<tr style="display:none" id="sprtable2"> </div>
<td valign="top" class="vncell"><?=gettext("Cache size"); ?></td> </td>
<td class="vtable"> </tr>
<input name="maxaddr" size="10" type="text" class="form-control unkown" id="maxaddr" value="<?=htmlspecialchars($pconfig['maxaddr']);?>" /> <?=gettext("entries"); ?> <tr>
<br /><span class="vexpl"> <td><a id="help_for_intf_pathcost" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Path cost"); ?></td>
<?=gettext("Set the size of the bridge address cache to size. The default is " . <td>
".100 entries."); ?> <table class="table table-striped table-condensed">
</span> <?php
</td> foreach ($ifacelist as $ifn => $ifdescr):?>
</tr> <tr>
<tr style="display:none" id="sprtable3"> <td><?=$ifdescr;?></td>
<td valign="top" class="vncell"><?=gettext("Cache entry expire time"); ?></td> <td>
<td> <input name="ifpathcost_<?=$ifn;?>" type="text" value="<?=isset($pconfig['ifpathcost_'.$ifn]) ? $pconfig['ifpathcost_'.$ifn] : "";?>" />
<input name="timeout" type="text" class="form-control unkown" id="timeout" size="10" value="<?=htmlspecialchars($pconfig['timeout']);?>" /> <?=gettext("seconds"); ?> </td>
<br /><span class="vexpl"> </tr>
<?=gettext("Set the timeout of address cache entries to this number of seconds. If " . <?php
"seconds is zero, then address cache entries will not be expired. " . endforeach;?>
"The default is 240 seconds."); ?> </table>
</span> <div class="hidden" for="help_for_intf_pathcost">
</td> <?=gettext("Set the Spanning Tree path cost of interface to value. The " .
</tr> "default is calculated from the link speed. To change a previously selected path cost back to automatic, set the cost to 0. ".
<tr style="display:none" id="sprtable4"> "The minimum is 1 and the maximum is 200000000."); ?>
<td valign="top" class="vncell"><?=gettext("Span port"); ?></td> </div>
<td class="vtable"> </td>
<select name="span" class="selectpicker" id="span" data-live-search="true"> </tr>
<option value="none" selected="selected"><?=gettext("None"); ?></option> </tbody>
<?php </table>
foreach ($ifacelist as $ifn => $ifdescr) { </div>
echo "<option value=\"{$ifn}\""; </div>
if ($ifn == $pconfig['span']) <!-- Advanced options-->
echo " selected=\"selected\""; <div class="tab-content content-box col-xs-12 __mb act_show_advanced" style="display:none">
echo ">{$ifdescr}</option>"; <div class="table-responsive">
} <table class="table table-striped">
?> <thead>
</select> <tr>
<br /><span class="vexpl"> <td colspan="2"><strong><?=gettext("Advanced options");?></strong></td>
<?=gettext("Add the interface named by interface as a span port on the " . </tr>
"bridge. Span ports transmit a copy of every frame received by " . </thead>
"the bridge. This is most useful for snooping a bridged network " . <tbody>
"passively on another host connected to one of the span ports of " . <tr>
"the bridge."); ?> <td width="22%"><a id="help_for_maxaddr" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Cache size"); ?> (<?=gettext("entries"); ?>)</td>
</span> <td width="78%">
<p class="vexpl"><span class="red"><strong> <input name="maxaddr" type="text" value="<?=$pconfig['maxaddr'];?>" />
<?=gettext("Note:"); ?><br /> <div class="hidden" for="help_for_maxaddr">
</strong></span> <?=gettext("Set the size of the bridge address cache to size. The default is .100 entries."); ?>
<?=gettext("The span interface cannot be part of the bridge member interfaces."); ?> </span>
</p> </td>
</td> </tr>
</tr> <tr>
<tr style="display:none" id="sprtable5"> <td><a id="help_for_timeout" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Cache entry expire time"); ?> (<?=gettext("seconds"); ?>)</td>
<td valign="top" class="vncell"><?=gettext("Edge ports"); ?></td> <td>
<td class="vtable"> <input name="timeout" type="text" value="<?=$pconfig['timeout'];?>" />
<select name="edge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <div class="hidden" for="help_for_timeout">
<?php <?=gettext("Set the timeout of address cache entries to this number of seconds. If " .
foreach ($ifacelist as $ifn => $ifdescr) { "seconds is zero, then address cache entries will not be expired. " .
echo "<option value=\"{$ifn}\""; "The default is 240 seconds."); ?>
if (stristr($pconfig['edge'], $ifn)) </div>
echo " selected=\"selected\""; </td>
echo ">{$ifdescr}</option>"; </tr>
} <tr>
?> <td><a id="help_for_span" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Span port"); ?></td>
</select> <td>
<br /> <select name="span" class="selectpicker" data-live-search="true">
<span class="vexpl"> <option value="none"><?=gettext("None"); ?></option>
<?=gettext("Set interface as an edge port. An edge port connects directly to " . <?php
"end stations and cannot create bridging loops in the network; this " . foreach ($ifacelist as $ifn => $ifdescr):?>
"allows it to transition straight to forwarding."); ?> <option value="<?=$ifn;?>" <?=$ifn == $pconfig['span'] ? "selected=\"selected\"" : "";?>>
</span></td> <?=$ifdescr;?>
</tr> </option>
<tr style="display:none" id="sprtable6"> <?php
<td valign="top" class="vncell"><?=gettext("Auto Edge ports"); ?></td> endforeach;?>
<td class="vtable"> </select>
<select name="autoedge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <div class="hidden" for="help_for_span">
<?php <?=gettext("Add the interface named by interface as a span port on the " .
foreach ($ifacelist as $ifn => $ifdescr) { "bridge. Span ports transmit a copy of every frame received by " .
echo "<option value=\"{$ifn}\""; "the bridge. This is most useful for snooping a bridged network " .
if (stristr($pconfig['autoedge'], $ifn)) "passively on another host connected to one of the span ports of " .
echo " selected=\"selected\""; "the bridge."); ?><br/>
echo ">{$ifdescr}</option>"; <span class="text-warning"><strong><?=gettext("Note:"); ?><br /></strong></span>
} <?=gettext("The span interface cannot be part of the bridge member interfaces."); ?>
?> </div>
</select> </td>
<br /> </tr>
<span class="vexpl"> <tr>
<?=gettext("Allow interface to automatically detect edge status. This is the " . <td><a id="help_for_edge" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Edge ports"); ?></td>
"default for all interfaces added to a bridge."); ?></span> <td>
<p class="vexpl"><span class="red"><strong> <select name="edge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?=gettext("Note:"); ?><br /> <?php
</strong></span> foreach ($ifacelist as $ifn => $ifdescr):?>
<?=gettext("This will disable the autoedge status of interfaces."); ?> <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['edge']) ? "selected=\"selected\"" : "";?>>
</p></td> <?=$ifdescr;?>
</tr> </option>
<tr style="display:none" id="sprtable7"> <?php
<td valign="top" class="vncell"><?=gettext("PTP ports"); ?></td> endforeach;?>
<td class="vtable"> </select>
<select name="ptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <div class="hidden" for="help_for_edge">
<?php <?=gettext("Set interface as an edge port. An edge port connects directly to " .
foreach ($ifacelist as $ifn => $ifdescr) { "end stations and cannot create bridging loops in the network; this " .
echo "<option value=\"{$ifn}\""; "allows it to transition straight to forwarding."); ?>
if (stristr($pconfig['ptp'], $ifn)) </div>
echo " selected=\"selected\""; </td>
echo ">{$ifdescr}</option>"; </tr>
} <tr>
?> <td><a id="help_for_autoedge" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Auto Edge ports"); ?></td>
</select> <td>
<br /> <select name="autoedge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<span class="vexpl"> <?php
<?=gettext("Set the interface as a point-to-point link. This is required for " . foreach ($ifacelist as $ifn => $ifdescr):?>
"straight transitions to forwarding and should be enabled on a " . <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['autoedge']) ? "selected=\"selected\"" : "";?>>
"direct link to another RSTP-capable switch."); ?> <?=$ifdescr;?>
</span></td> </option>
</tr> <?php
<tr style="display:none" id="sprtable8"> endforeach;?>
<td valign="top" class="vncell"><?=gettext("Auto PTP ports"); ?></td> </select>
<td class="vtable"> <div class="hidden" for="help_for_autoedge">
<select name="autoptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <?=gettext("Allow interface to automatically detect edge status. This is the " .
<?php "default for all interfaces added to a bridge."); ?><br/>
foreach ($ifacelist as $ifn => $ifdescr) { <span class="text-warning"><strong><?=gettext("Note:"); ?><br /></strong></span>
echo "<option value=\"{$ifn}\""; <?=gettext("This will disable the autoedge status of interfaces."); ?>
if (stristr($pconfig['autoptp'], $ifn)) </div>
echo " selected=\"selected\""; </td>
echo ">{$ifdescr}</option>"; </tr>
} <tr>
?> <td><a id="help_for_ptp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("PTP ports"); ?></td>
</select> <td>
<br /> <select name="ptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<span class="vexpl"> <?php
<?=gettext("Automatically detect the point-to-point status on interface by " . foreach ($ifacelist as $ifn => $ifdescr):?>
"checking the full duplex link status. This is the default for " . <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['ptp']) ? "selected=\"selected\"" : "";?>>
"interfaces added to the bridge."); ?></span> <?=$ifdescr;?>
<p class="vexpl"><span class="red"><strong> </option>
<?=gettext("Note:"); ?><br /> <?php
</strong></span> endforeach;?>
<?=gettext("The interfaces selected here will be removed from default autoedge status."); ?> </select>
</p></td> <div class="hidden" for="help_for_ptp">
</tr> <?=gettext("Set the interface as a point-to-point link. This is required for " .
<tr style="display:none" id="sprtable9"> "straight transitions to forwarding and should be enabled on a " .
<td valign="top" class="vncell"><?=gettext("Sticky ports"); ?></td> "direct link to another RSTP-capable switch."); ?>
<td class="vtable"> </div>
<select name="static[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> </td>
<?php </tr>
foreach ($ifacelist as $ifn => $ifdescr) { <tr>
echo "<option value=\"{$ifn}\""; <td><a id="help_for_autoptp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Auto PTP ports"); ?></td>
if (stristr($pconfig['static'], $ifn)) <td>
echo " selected=\"selected\""; <select name="autoptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
echo ">{$ifdescr}</option>"; <?php
} foreach ($ifacelist as $ifn => $ifdescr):?>
?> <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['autoptp']) ? "selected=\"selected\"" : "";?>>
</select> <?=$ifdescr;?>
<br /> </option>
<span class="vexpl"> <?php
<?=gettext("Mark an interface as a \"sticky\" interface. Dynamically learned " . endforeach;?>
"address entries are treated as static once entered into the " . </select>
"cache. Sticky entries are never aged out of the cache or " . <div class="hidden" for="help_for_autoptp">
"replaced, even if the address is seen on a different interface."); ?> <?=gettext("Automatically detect the point-to-point status on interface by " .
</span></td> "checking the full duplex link status. This is the default for " .
</tr> "interfaces added to the bridge."); ?><br/>
<tr style="display:none" id="sprtable10"> <span class="text-warning"><strong><?=gettext("Note:"); ?><br /></strong></span>
<td valign="top" class="vncell"><?=gettext("Private ports"); ?></td> <?=gettext("The interfaces selected here will be removed from default autoedge status."); ?>
<td class="vtable"> </div>
<select name="private[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> </td>
<?php </tr>
foreach ($ifacelist as $ifn => $ifdescr) { <tr>
echo "<option value=\"{$ifn}\""; <td><a id="help_for_static" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Sticky ports"); ?></td>
if (stristr($pconfig['private'], $ifn)) <td>
echo " selected=\"selected\""; <select name="static[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
echo ">{$ifdescr}</option>"; <?php
} foreach ($ifacelist as $ifn => $ifdescr):?>
?> <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['static']) ? "selected=\"selected\"" : "";?>>
</select> <?=$ifdescr;?>
<br /> </option>
<span class="vexpl"> <?php
<?=gettext("Mark an interface as a \"private\" interface. A private interface does not forward any traffic to any other port that is also " . endforeach;?>
"a private interface."); ?> </select>
</span></td> <div class="hidden" for="help_for_static">
</tr> <?=gettext("Mark an interface as a \"sticky\" interface. Dynamically learned " .
<tr> "address entries are treated as static once entered into the " .
<td width="22%" valign="top">&nbsp;</td> "cache. Sticky entries are never aged out of the cache or " .
<td width="78%"> "replaced, even if the address is seen on a different interface."); ?>
<input type="hidden" name="bridgeif" value="<?=htmlspecialchars($pconfig['bridgeif']); ?>" /> </div>
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> </td>
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" /> </tr>
<?php if (isset($id) && $a_bridges[$id]): ?> <tr>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> <td><a id="help_for_private" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Private ports"); ?></td>
<?php endif; ?> <td>
</td> <select name="private[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
</tr> <?php
</table> foreach ($ifacelist as $ifn => $ifdescr):?>
</form> <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['private']) ? "selected=\"selected\"" : "";?>>
</div> <?=$ifdescr;?>
</div> </option>
</section> <?php
</div> endforeach;?>
</div> </select>
</section> <div class="hidden" for="help_for_private">
<?=gettext("Mark an interface as a \"private\" interface. A private interface does not forward any traffic to any other port that is also " .
"a private interface."); ?>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Advanced / RSTP/STP -->
<div class="tab-content content-box col-xs-12 __mb">
<div class="table-responsive">
<table class="table table-striped">
<tbody>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input type="hidden" name="bridgeif" value="<?=$pconfig['bridgeif']; ?>" />
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_bridge.php');?>'" />
<?php if (isset($id)): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</form>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment