Project

General

Profile

Download (24.8 KB) Statistics
| Branch: | Tag: | Revision:
1 648ec0c2 Ermal Luçi
<?php
2
/* $Id$ */
3
/*
4
	interfaces_bridge_edit.php
5
6 86cb9ad1 Ermal Luçi
	Copyright (C) 2008 Ermal Lu?i
7 648ec0c2 Ermal Luçi
	All rights reserved.
8
9
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11
12
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14
15
	2. Redistributions in binary form must reproduce the above copyright
16
	   notice, this list of conditions and the following disclaimer in the
17
	   documentation and/or other materials provided with the distribution.
18
19
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29
*/
30 7ac5a4cb Scott Ullrich
/*
31
	pfSense_MODULE:	interfaces
32
*/
33 648ec0c2 Ermal Luçi
34 ea9828af Ermal Lu?i
##|+PRIV
35
##|*IDENT=page-interfaces-bridge-edit
36
##|*NAME=Interfaces: Bridge edit page
37
##|*DESCR=Allow access to the 'Interfaces: Bridge : Edit' page.
38
##|*MATCH=interfaces_bridge_edit.php*
39
##|-PRIV
40
41 648ec0c2 Ermal Luçi
require("guiconfig.inc");
42
43 3134528d Ermal Luçi
if (!is_array($config['bridges']['bridged']))
44
	$config['bridges']['bridged'] = array();
45 648ec0c2 Ermal Luçi
46 3134528d Ermal Luçi
$a_bridges = &$config['bridges']['bridged'];
47 648ec0c2 Ermal Luçi
48
$ifacelist = get_configured_interface_with_descr();
49
50
$id = $_GET['id'];
51
if (isset($_POST['id']))
52
	$id = $_POST['id'];
53
54
if (isset($id) && $a_bridges[$id]) {
55
	$pconfig['enablestp'] = isset($a_bridges[$id]['enablestp']);
56
	$pconfig['descr'] = $a_bridges[$id]['descr'];
57
	$pconfig['bridgeif'] = $a_bridges[$id]['bridgeif'];
58
	$pconfig['members'] = $a_bridges[$id]['members'];
59
	$pconfig['maxaddr'] = $a_bridges[$id]['maxaddr'];
60
	$pconfig['timeout'] = $a_bridges[$id]['timeout'];
61
	if ($a_bridges[$id]['static'])
62
		$pconfig['static'] = $a_bridges[$id]['static'];
63
	if ($a_bridges[$id]['private'])
64
		$pconfig['private'] = $a_bridges[$id]['private'];
65
	if (isset($a_bridges[$id]['stp']))
66
		$pconfig['stp'] = $a_bridges[$id]['stp'];
67
	$pconfig['maxage'] = $a_bridges[$id]['maxage'];
68
	$pconfig['fwdelay'] = $a_bridges[$id]['fwdelay'];
69
	$pconfig['hellotime'] = $a_bridges[$id]['hellotime'];
70
	$pconfig['priority'] = $a_bridges[$id]['priority'];
71
	$pconfig['proto'] = $a_bridges[$id]['proto'];
72
	$pconfig['holdcount'] = $a_bridges[$id]['holdcount'];
73
	$pconfig['ifpriority'] = explode(",", $a_bridges[$id]['ifpriority']);
74
	$ifpriority = array();
75
	foreach ($pconfig['ifpriority'] as $cfg) {
76
		$embcfg = explode(":", $cfg);
77
		foreach ($embcfg as $key => $value)
78
			$ifpriority[$key] = $value;
79
	}
80
	$pconfig['ifpriority'] = $ifpriority;
81
	$pconfig['ifpathcost'] = explode(",", $a_bridges[$id]['ifpathcost']);
82
	$ifpathcost = array();
83
	foreach ($pconfig['ifpathcost'] as $cfg) {
84
		$embcfg = explode(":", $cfg);
85
		foreach ($embcfg as $key => $value)
86
			$ifpathcost[$key] = $value;
87
	}
88
	$pconfig['ifpathcost'] = $ifpathcost;
89
	$pconfig['span'] = $a_bridges[$id]['span'];
90
	if (isset($a_bridges[$id]['edge']))
91
		$pconfig['edge'] = $a_bridges[$id]['edge'];
92
	if (isset($a_bridges[$id]['autoedge']))
93
		$pconfig['autoedge'] = $a_bridges[$id]['autoedge'];
94
	if (isset($a_bridges[$id]['ptp']))
95
		$pconfig['ptp'] = $a_bridges[$id]['ptp'];
96
	if (isset($a_bridges[$id]['autoptp']))
97
		$pconfig['autoptp'] = $a_bridges[$id]['autoptp'];
98
}
99
100
if ($_POST) {
101
102
	unset($input_errors);
103
	$pconfig = $_POST;
104
105
	/* input validation */
106
	$reqdfields = explode(" ", "members");
107 eb4cf3cb Neriberto C.Prado
	$reqdfieldsn = array(gettext("Member Interfaces"));
108 648ec0c2 Ermal Luçi
109
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
110
111
	if ($_POST['maxage'] && !is_numeric($_POST['maxage']))
112 eb4cf3cb Neriberto C.Prado
		$input_errors[] = gettext("Maxage needs to be an integer between 6 and 40.");
113 648ec0c2 Ermal Luçi
	if ($_POST['maxaddr'] && !is_numeric($_POST['maxaddr']))
114 eb4cf3cb Neriberto C.Prado
		$input_errors[] = gettext("Maxaddr needs to be an integer.");
115 648ec0c2 Ermal Luçi
	if ($_POST['timeout'] && !is_numeric($_POST['timeout']))
116 eb4cf3cb Neriberto C.Prado
		$input_errors[] = gettext("Timeout needs to be an integer.");
117 648ec0c2 Ermal Luçi
	if ($_POST['fwdelay'] && !is_numeric($_POST['fwdelay']))
118 eb4cf3cb Neriberto C.Prado
		$input_errors[] = gettext("Forward Delay needs to be an integer between 4 and 30.");
119 648ec0c2 Ermal Luçi
	if ($_POST['hellotime'] && !is_numeric($_POST['hellotime']))
120 eb4cf3cb Neriberto C.Prado
		$input_errors[] = gettext("Hello time for STP needs to be an integer between 1 and 2.");
121 648ec0c2 Ermal Luçi
	if ($_POST['priority'] && !is_numeric($_POST['priority']))
122 eb4cf3cb Neriberto C.Prado
		$input_errors[] = gettext("Priority for STP needs to be an integer between 0 and 61440.");
123 648ec0c2 Ermal Luçi
	if ($_POST['holdcnt'] && !is_numeric($_POST['holdcnt']))
124 eb4cf3cb Neriberto C.Prado
		$input_errors[] = gettext("Transmit Hold Count for STP needs to be an integer between 1 and 10.");
125 648ec0c2 Ermal Luçi
	foreach ($ifacelist as $ifn => $ifdescr) {
126
		if ($_POST[$ifn] <> "" && !is_numeric($_POST[$ifn]))
127 eb4cf3cb Neriberto C.Prado
			$input_errors[] = "{$ifdescr} " . gettext("interface priority for STP needs to be an integer between 0 and 240.");
128 648ec0c2 Ermal Luçi
	}
129
	$i = 0;
130
	foreach ($ifacelist as $ifn => $ifdescr) {
131
		if ($_POST["{$ifn}{$i}"] <> "" && !is_numeric($_POST["{$ifn}{$i}"]))
132 eb4cf3cb Neriberto C.Prado
			$input_errors[] = "{$ifdescr} " . gettext("interface path cost for STP needs to be an integer between 1 and 200000000.");
133 648ec0c2 Ermal Luçi
		$i++;
134
	}
135 7a701b1e Ermal Luçi
136 9710f0fa Ermal Luçi
	if (!is_array($_POST['members']) || count($_POST['members']) < 2)
137 eb4cf3cb Neriberto C.Prado
		$input_errors[] = gettext("You must select at least 2 member interfaces for a bridge.");
138 7a701b1e Ermal Luçi
139
	if (is_array($_POST['members'])) {
140 86cb9ad1 Ermal Luçi
		foreach($_POST['members'] as $ifmembers) {
141 7a701b1e Ermal Luçi
			if (is_array($config['interfaces'][$ifmembers]['wireless']) &&
142
				$config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap")
143 eb4cf3cb Neriberto C.Prado
				$input_errors[] = gettext("Bridging a wireless interface is only possible in hostap mode.");
144 86cb9ad1 Ermal Luçi
			if ($_POST['span'] != "none" && $_POST['span'] == $ifmembers)
145 eb4cf3cb Neriberto C.Prado
				$input_errors[] = gettext("Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue.");
146 86cb9ad1 Ermal Luçi
		}
147 7a701b1e Ermal Luçi
	}
148
149 648ec0c2 Ermal Luçi
	if (!$input_errors) {
150
		$bridge = array();
151
		$bridge['members'] = implode(',', $_POST['members']);
152 541ba27e gnhb
		$bridge['enablestp'] = $_POST['enablestp'] ? true : false;
153 648ec0c2 Ermal Luçi
		$bridge['descr'] = $_POST['descr'];
154
		$bridge['maxaddr'] = $_POST['maxaddr'];
155
		$bridge['timeout'] = $_POST['timeout'];
156
		if ($_POST['static'])
157
			$bridge['static'] = implode(',', $_POST['static']);
158
		if ($_POST['private'])
159
			$bridge['private'] = implode(',', $_POST['private']);
160
		if (isset($_POST['stp']))
161
			$bridge['stp'] = implode(',', $_POST['stp']);
162
		$bridge['maxage'] = $_POST['maxage'];
163
		$bridge['fwdelay'] = $_POST['fwdelay'];
164
		$bridge['hellotime'] = $_POST['hellotime'];
165
		$bridge['priority'] = $_POST['priority'];
166
		$bridge['proto'] = $_POST['proto'];
167
		$bridge['holdcount'] = $_POST['holdcount'];
168
		$i = 0;
169
		$ifpriority = "";
170
		$ifpathcost = "";
171
		foreach ($ifacelist as $ifn => $ifdescr) {
172
			if ($_POST[$ifn] <> "") {
173
				if ($i > 0)
174
					$ifpriority .= ",";
175
				$ifpriority .= $ifn.":".$_POST[$ifn];
176
			}
177
			if ($_POST["{$ifn}{$i}"] <> "") {
178
				if ($i > 0)
179
					$ifpathcost .= ",";
180
				$ifpathcost .= $ifn.":".$_POST[$ifn];
181
			}
182
			$i++;
183
		}
184
		$bridge['ifpriority'] = $ifpriority;
185
		$bridge['ifpathcost'] = $ifpathcost;
186 86cb9ad1 Ermal Luçi
		if ($_POST['span'] != "none")
187
			$bridge['span'] = $_POST['span'];
188
		else 
189
			unset($bridge['span']);
190 648ec0c2 Ermal Luçi
		if (isset($_POST['edge']))
191
			$bridge['edge'] = implode(',', $_POST['edge']);
192
		if (isset($_POST['autoedge']))
193
			$bridge['autoedge'] = implode(',', $_POST['autoedge']);
194
		if (isset($_POST['ptp']))
195
			$bridge['ptp'] = implode(',', $_POST['ptp']);
196
		if (isset($_POST['autoptp']))
197
			$bridge['autoptp'] = implode(',', $_POST['autoptp']);
198
199
		$bridge['bridgeif'] = $_POST['bridgeif'];
200
                $bridge['bridgeif'] = interface_bridge_configure($bridge);
201
                if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge"))
202 eb4cf3cb Neriberto C.Prado
                        $input_errors[] = gettext("Error occured creating interface, please retry.");
203 648ec0c2 Ermal Luçi
                else {
204
                        if (isset($id) && $a_bridges[$id])
205
                                $a_bridges[$id] = $bridge;
206
                        else
207
                                $a_bridges[] = $bridge;
208
209
                        write_config();
210
211 5efc5b6f Ermal Luçi
			$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
212
                        if ($confif <> "")
213 69e5a8be Ermal Luçi
                                interface_configure($confif);
214 5efc5b6f Ermal Luçi
215
216 648ec0c2 Ermal Luçi
			header("Location: interfaces_bridge.php");
217
			exit;
218
		}
219
	}
220
}
221
222 eb4cf3cb Neriberto C.Prado
$pgtitle = array(gettext("Firewall"),gettext("Bridge"),gettext("Edit"));
223 648ec0c2 Ermal Luçi
include("head.inc");
224
225
?>
226
227
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
228
<script type="text/javascript">
229
function show_source_port_range() {
230
        document.getElementById("sprtable").style.display = 'none';
231
        document.getElementById("sprtable1").style.display = '';
232
        document.getElementById("sprtable2").style.display = '';
233
        document.getElementById("sprtable3").style.display = '';
234
        document.getElementById("sprtable4").style.display = '';
235
        document.getElementById("sprtable5").style.display = '';
236
        document.getElementById("sprtable6").style.display = '';
237
        document.getElementById("sprtable7").style.display = '';
238
        document.getElementById("sprtable8").style.display = '';
239
        document.getElementById("sprtable9").style.display = '';
240
        document.getElementById("sprtable10").style.display = '';
241
}
242
</script>
243
244
<?php include("fbegin.inc"); ?>
245
<?php if ($input_errors) print_input_errors($input_errors); ?>
246
            <form action="interfaces_bridge_edit.php" method="post" name="iform" id="iform">
247
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
248
				<tr>
249 eb4cf3cb Neriberto C.Prado
					<td colspan="2" valign="top" class="listtopic"><?=gettext("Bridge configuration"); ?></td>
250 ae5b49b1 Scott Ullrich
				</tr>
251
				<tr>
252 eb4cf3cb Neriberto C.Prado
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Member interfaces"); ?></td>
253 648ec0c2 Ermal Luçi
                  <td width="78%" class="vtable">
254
				  <select name="members[]" multiple="true" class="formselect" size="3">
255
                      <?php
256
					  	foreach ($ifacelist as $ifn => $ifinfo) {
257
							echo "<option value=\"{$ifn}\"";
258
							if (stristr($pconfig['members'], $ifn))
259
								echo "selected";
260
							echo ">{$ifinfo}</option>";
261
						}
262
		      		?>
263
                    </select>
264
			<br/>
265 eb4cf3cb Neriberto C.Prado
			<span class="vexpl"><?=gettext("Interfaces participating in the bridge."); ?></span>
266 648ec0c2 Ermal Luçi
			</td>
267
            </tr>
268
			<tr>
269 eb4cf3cb Neriberto C.Prado
                  <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
270 648ec0c2 Ermal Luçi
                  <td width="78%" class="vtable">
271
				  <input type="text" name="descr" id="descr" class="formfld unknown" size="50" value="<?=$pconfig['descr'];?>">
272
				 	</td>
273
				</tr>
274
            <tr id="sprtable" name="sprtable">
275
                <td></td>
276
                <td>
277 b0e30881 Carlos Eduardo Ramos
                <p><input type="button" onClick="show_source_port_range()" value="<?=gettext("Show advanced options"); ?>"></p>
278 648ec0c2 Ermal Luçi
                </td>
279
			</tr>
280
                <tr style="display:none" id="sprtable1" name="sprtable1">
281 8caea9a2 Carlos Eduardo Ramos
                  <td valign="top" class="vncell" align="middle"><?=gettext("RSTP/STP"); ?>  </td>
282 648ec0c2 Ermal Luçi
                  <td class="vtable">
283 541ba27e gnhb
					<input type="checkbox" name="enablestp" id="enablestp" <?php if ($pconfig['enablestp']) echo "checked";?>>
284 eb4cf3cb Neriberto C.Prado
					<span class="vexpl"><strong><?=gettext("Enable spanning tree options for this bridge."); ?> </strong></span>
285 648ec0c2 Ermal Luçi
					<br/><br/>
286
				  	<table id="stpoptions" name="stpoptions" border="0" cellpadding="6" cellspacing="0">
287 eb4cf3cb Neriberto C.Prado
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Protocol"); ?></td>
288 648ec0c2 Ermal Luçi
					<td class="vtable" width="80%">
289
				  	<select name="proto" id="proto">
290
						<?php 
291
							foreach (array("rstp", "stp") as $proto) {
292
								echo "<option value=\"{$proto}\"";
293
								if ($pconfig['proto'] == $proto)
294
									echo "selected";
295
								echo ">".strtoupper($proto)."</option>";
296
							}
297
						?>
298
					</select>
299
                    <br/>
300 eb4cf3cb Neriberto C.Prado
                    <span class="vexpl"><?=gettext("Protocol used for spanning tree."); ?> </span></td>
301 648ec0c2 Ermal Luçi
					</td></tr>
302 eb4cf3cb Neriberto C.Prado
					<tr> <td valign="top" class="vncell" width="20%"><?=gettext("STP interfaces"); ?></td>
303 648ec0c2 Ermal Luçi
					<td class="vtable" width="80%">
304
				  	<select name="stp[]" class="formselect" multiple="true" size="3">
305
						<?php 
306
							foreach ($ifacelist as $ifn => $ifdescr) {
307
								echo "<option value=\"{$ifn}\"";
308
								if (stristr($pconfig['stp'], $ifn))
309
									echo "selected";
310
								echo ">{$ifdescr}</option>";
311
							}
312
						?>
313
					</select>
314
					<br/>
315 eb4cf3cb Neriberto C.Prado
					<span class="vexpl" >
316 308a8589 Neriberto C.Prado
	     <?=gettext("Enable Spanning Tree Protocol on interface.  The if_bridge(4) " .
317
	     "driver has support for the IEEE 802.1D Spanning Tree Protocol " .
318
	     "(STP).  STP is used to detect and remove loops in a " .
319 ad803a5f Neriberto C.Prado
	     "network topology."); ?>
320 648ec0c2 Ermal Luçi
					</span>
321
					</td></tr>
322 eb4cf3cb Neriberto C.Prado
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Valid time"); ?></td>
323 648ec0c2 Ermal Luçi
					<td class="vtable" width="80%">
324 eb4cf3cb Neriberto C.Prado
					<input name="maxage" type="text" class="formfld unkown" id="maxage" size="8" value="<?=$pconfig['maxage'];?>"> <?=gettext("seconds"); ?>
325 648ec0c2 Ermal Luçi
					<br/>
326
					<span class="vexpl">
327 308a8589 Neriberto C.Prado
	     <?=gettext("Set the time that a Spanning Tree Protocol configuration is " .
328
	     "valid.  The default is 20 seconds.  The minimum is 6 seconds and " .
329 ad803a5f Neriberto C.Prado
	     "the maximum is 40 seconds."); ?>
330 648ec0c2 Ermal Luçi
					</span>
331
					</td></tr>
332 eb4cf3cb Neriberto C.Prado
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Forward time"); ?> </td>
333 648ec0c2 Ermal Luçi
					<td class="vtable" width="80%">
334 eb4cf3cb Neriberto C.Prado
					<input name="fwdelay" type="text" class="formfld unkown" id="fwdelay" size="8" value="<?=$pconfig['fwdelay'];?>"> <?=gettext("seconds"); ?>
335 648ec0c2 Ermal Luçi
					<br/>
336
					<span class="vexpl">
337 308a8589 Neriberto C.Prado
	     <?=gettext("Set the time that must pass before an interface begins forwarding " .
338 ad803a5f Neriberto C.Prado
	     "packets when Spanning Tree is enabled.  The default is 15 seconds.  The minimum is 4 seconds and the maximum is 30 seconds."); ?>		
339 648ec0c2 Ermal Luçi
					</span>
340
					</td></tr>
341 eb4cf3cb Neriberto C.Prado
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hello time"); ?></td>
342 648ec0c2 Ermal Luçi
					<td class="vtable" width="80%">
343 eb4cf3cb Neriberto C.Prado
					<input name="hellotime" type="text" class="formfld unkown" size="8" id="hellotime" value="<?=$pconfig['hellotime'];?>"> <?=gettext("seconds"); ?>
344 648ec0c2 Ermal Luçi
					<br/>
345
					<span class="vexpl">
346 308a8589 Neriberto C.Prado
	     <?=gettext("Set the time between broadcasting of Spanning Tree Protocol configuration messages.  The hello time may only be changed when " .
347 ad803a5f Neriberto C.Prado
	     "operating in legacy STP mode.  The default is 2 seconds.  The minimum is 1 second and the maximum is 2 seconds."); ?>		
348 648ec0c2 Ermal Luçi
					</span>
349
					</td></tr>
350 eb4cf3cb Neriberto C.Prado
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td>
351 648ec0c2 Ermal Luçi
					<td class="vtable" width="80%">
352
					<input name="priority" type="text" class="formfld unkown" id="priority" value="<?=$pconfig['priority'];?>">
353
					<br/>
354
					<span class="vexpl">
355 308a8589 Neriberto C.Prado
	     <?=gettext("Set the bridge priority for Spanning Tree.  The default is 32768. " .
356 ad803a5f Neriberto C.Prado
	     "The minimum is 0 and the maximum is 61440."); ?>		
357 648ec0c2 Ermal Luçi
					</span>
358
					</td></tr>
359 eb4cf3cb Neriberto C.Prado
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hold count"); ?></td>
360 648ec0c2 Ermal Luçi
					<td class="vtable" width="80%">
361
					<input name="holdcnt" type="text" class="formfld unkown" id="holdcnt" value="<?=$pconfig['holdcnt'];?>">
362
					<br/>
363
					<span class="vexpl">
364 308a8589 Neriberto C.Prado
	     <?=gettext("Set the transmit hold count for Spanning Tree.  This is the num- " .
365
	     "ber of packets transmitted before being rate limited.  The " .
366 ad803a5f Neriberto C.Prado
	     "default is 6.  The minimum is 1 and the maximum is 10."); ?>		
367 648ec0c2 Ermal Luçi
					</span>
368
					</td></tr>
369 eb4cf3cb Neriberto C.Prado
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td>
370 648ec0c2 Ermal Luçi
					<td class="vtable" width="80%">
371
					<table>
372
					<?php foreach ($ifacelist as $ifn => $ifdescr) 
373
							echo "<tr><td>{$ifdescr}</td><td><input size=\"5\" name=\"{$ifn}\" type=\"text\" class=\"formfld unkown\" id=\"{$ifn}\" value=\"{$ifpriority[$ifn]}\"></td></tr>";
374
					?>
375
					</table>
376
					<br/>
377
					<span class="vexpl" > 
378 308a8589 Neriberto C.Prado
	     <?=gettext("Set the Spanning Tree priority of interface to value.  The " .
379 ad803a5f Neriberto C.Prado
	     "default is 128.  The minimum is 0 and the maximum is 240."); ?>		
380 648ec0c2 Ermal Luçi
					</span>
381
					</td></tr>
382 eb4cf3cb Neriberto C.Prado
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Path cost"); ?></td>
383 648ec0c2 Ermal Luçi
					<td class="vtable" width="80%">
384
					<table>
385
					<?php $i = 0; foreach ($ifacelist as $ifn => $ifdescr)
386
							echo "<tr><td>{$ifdescr}</td><td><input size=\"8\" name=\"{$ifn}{$i}\" type=\"text\" class=\"formfld unkown\" id=\"{$ifn}{$i}\" value=\"{$ifpathcost[$ifn]}\"></td></tr>";
387
					?>
388
					</table>
389
					<br/>
390
					<span class="vexpl" > 
391 308a8589 Neriberto C.Prado
	     <?=gettext("Set the Spanning Tree path cost of interface to value.  The " .
392
	     "default is calculated from the link speed.  To change a previously selected path cost back to automatic, set the cost to 0. ".
393
	     "The minimum is 1 and the maximum is 200000000."); ?>		
394 648ec0c2 Ermal Luçi
					</span>
395
					</td></tr>
396
397
			    </table>
398
				</tr>
399
                <tr style="display:none" id="sprtable2" name="sprtable2">
400 eb4cf3cb Neriberto C.Prado
                  <td valign="top" class="vncell"><?=gettext("Cache size"); ?></td>
401 648ec0c2 Ermal Luçi
					<td class="vtable">
402 b0e30881 Carlos Eduardo Ramos
						<input name="maxaddr" size="10" type="text" class="formfld unkown" id="maxaddr" value="<?=$pconfig['maxaddr'];?>"> <?=gettext("entries"); ?>
403 648ec0c2 Ermal Luçi
					<br/><span class="vexpl">		
404 308a8589 Neriberto C.Prado
<?=gettext("Set the size of the bridge address cache to size.	The default is " .
405 ad803a5f Neriberto C.Prado
	     ".100 entries."); ?>
406 648ec0c2 Ermal Luçi
					</span>					
407
					</td>
408
				</tr>
409
                <tr style="display:none" id="sprtable3" name="sprtable3">
410 eb4cf3cb Neriberto C.Prado
                  <td valign="top" class="vncell"><?=gettext("Cache entry expire time"); ?></td>
411 648ec0c2 Ermal Luçi
				  <td>
412 b0e30881 Carlos Eduardo Ramos
					<input name="timeout" type="text" class="formfld unkown" id="timeout" size="10" value="<?=$pconfig['timeout'];?>"> <?=gettext("seconds"); ?>
413 648ec0c2 Ermal Luçi
					<br/><span class="vexpl">		
414 308a8589 Neriberto C.Prado
	     <?=gettext("Set the timeout of address cache entries to this number of seconds.  If " .
415
	     "seconds is zero, then address cache entries will not be expired. " .
416 ad803a5f Neriberto C.Prado
	     "The default is 240 seconds."); ?>
417 648ec0c2 Ermal Luçi
					</span>					
418
					</td>
419
				</tr>
420
                <tr style="display:none" id="sprtable4" name="sprtable4">
421 eb4cf3cb Neriberto C.Prado
                  <td valign="top" class="vncell"><?=gettext("Span port"); ?></td>
422 648ec0c2 Ermal Luçi
					<td class="vtable">
423
				  	<select name="span" class="formselect" id="span">
424 eb4cf3cb Neriberto C.Prado
						<option value="none" selected><?=gettext("None"); ?></option>
425 648ec0c2 Ermal Luçi
						<?php 
426
							foreach ($ifacelist as $ifn => $ifdescr) {
427
								echo "<option value=\"{$ifn}\"";
428
								if ($ifn == $pconfig['span'])
429
									echo "selected";
430
								echo ">{$ifdescr}</option>";
431
							}
432
						?>
433
					</select>
434
					<br/><span class="vexpl">		
435 308a8589 Neriberto C.Prado
	     <?=gettext("Add the interface named by interface as a span port on the " .
436
	     "bridge.  Span ports transmit a copy of every frame received by " .
437
	     "the bridge.  This is most useful for snooping a bridged network " .
438
	     "passively on another host connected to one of the span ports of " .
439 ad803a5f Neriberto C.Prado
	     "the bridge."); ?>		
440 5e3b419e Ermal Luçi
					</span>
441
		<p class="vexpl"><span class="red"><strong>
442 8c287f1b Vinicius Coque
					 <?=gettext("Note:"); ?><br>
443 5e3b419e Ermal Luçi
                                  </strong></span>
444 eb4cf3cb Neriberto C.Prado
                 <?=gettext("The span interface cannot be part of the bridge member interfaces."); ?>
445 5e3b419e Ermal Luçi
                                        </span>
446 648ec0c2 Ermal Luçi
					</td>
447
				</tr>
448
                <tr style="display:none" id="sprtable5" name="sprtable5">
449 eb4cf3cb Neriberto C.Prado
                  <td valign="top" class="vncell"><?=gettext("Edge ports"); ?></td>
450 648ec0c2 Ermal Luçi
                  <td class="vtable">
451
				  	<select name="edge[]" class="formselect" multiple="true" size="3">
452
						<?php 
453
							foreach ($ifacelist as $ifn => $ifdescr) {
454
								echo "<option value=\"{$ifn}\"";
455
								if (stristr($pconfig['edge'], $ifn))
456
									echo "selected";
457
								echo ">{$ifdescr}</option>";
458
							}
459
						?>
460
					</select>
461
                    <br>
462
                    <span class="vexpl">
463 308a8589 Neriberto C.Prado
	     <?=gettext("Set interface as an edge port.  An edge port connects directly to " .
464
	     "end stations and cannot create bridging loops in the network; this " .
465 ad803a5f Neriberto C.Prado
	     "allows it to transition straight to forwarding."); ?>			
466 648ec0c2 Ermal Luçi
					</span></td>
467
			    </tr>
468
                <tr style="display:none" id="sprtable6" name="sprtable6">
469 eb4cf3cb Neriberto C.Prado
                  <td valign="top" class="vncell"><?=gettext("Auto Edge ports"); ?></td>
470 648ec0c2 Ermal Luçi
                  <td class="vtable">
471
				  	<select name="autoedge[]" class="formselect" multiple="true" size="3">
472
						<?php 
473
							foreach ($ifacelist as $ifn => $ifdescr) {
474
								echo "<option value=\"{$ifn}\"";
475
								if (stristr($pconfig['autoedge'], $ifn))
476
									echo "selected";
477
								echo ">{$ifdescr}</option>";
478
							}
479
						?>
480
					</select>
481
                    <br>
482
                    <span class="vexpl">
483 308a8589 Neriberto C.Prado
	     <?=gettext("Allow interface to automatically detect edge status.  This is the " .
484 ad803a5f Neriberto C.Prado
	     "default for all interfaces added to a bridge."); ?>
485 648ec0c2 Ermal Luçi
		 <p class="vexpl"><span class="red"><strong>
486 8c287f1b Vinicius Coque
				  <?=gettext("Note:"); ?><br>
487 648ec0c2 Ermal Luçi
				  </strong></span>
488 eb4cf3cb Neriberto C.Prado
		 <?=gettext("This will disable the autoedge status of interfaces."); ?>
489 648ec0c2 Ermal Luçi
					</span></td>
490
			    </tr>
491
                <tr style="display:none" id="sprtable7" name="sprtable7">
492 eb4cf3cb Neriberto C.Prado
                  <td valign="top" class="vncell"><?=gettext("PTP ports"); ?></td>
493 648ec0c2 Ermal Luçi
                  <td class="vtable">
494
				  	<select name="ptp[]" class="formselect" multiple="true" size="3">
495
						<?php 
496
							foreach ($ifacelist as $ifn => $ifdescr) {
497
								echo "<option value=\"{$ifn}\"";
498
								if (stristr($pconfig['ptp'], $ifn))
499
									echo "selected";
500
								echo ">{$ifdescr}</option>";
501
							}
502
						?>
503
					</select>
504
                    <br>
505
                    <span class="vexpl">
506 308a8589 Neriberto C.Prado
	     <?=gettext("Set the interface as a point-to-point link.  This is required for " .
507
	     "straight transitions to forwarding and should be enabled on a " .
508 ad803a5f Neriberto C.Prado
	     "direct link to another RSTP-capable switch."); ?>
509 648ec0c2 Ermal Luçi
					</span></td>
510
			    </tr>
511
                <tr style="display:none" id="sprtable8" name="sprtable8">
512 eb4cf3cb Neriberto C.Prado
                  <td valign="top" class="vncell"><?=gettext("Auto PTP ports"); ?></td>
513 648ec0c2 Ermal Luçi
                  <td class="vtable">
514
				  	<select name="autoptp[]" class="formselect" multiple="true" size="3">
515
						<?php 
516
							foreach ($ifacelist as $ifn => $ifdescr) {
517
								echo "<option value=\"{$ifn}\"";
518
								if (stristr($pconfig['autoptp'], $ifn))
519
									echo "selected";
520
								echo ">{$ifdescr}</option>";
521
							}
522
						?>
523
					</select>
524
                    <br>
525
                    <span class="vexpl">
526 308a8589 Neriberto C.Prado
	     <?=gettext("Automatically detect the point-to-point status on interface by " .
527
	     "checking the full duplex link status.  This is the default for " .
528 ad803a5f Neriberto C.Prado
	     "interfaces added to the bridge."); ?>
529 648ec0c2 Ermal Luçi
		 		 <p class="vexpl"><span class="red"><strong>
530 8c287f1b Vinicius Coque
				  <?=gettext("Note:"); ?><br>
531 648ec0c2 Ermal Luçi
				  </strong></span>
532 eb4cf3cb Neriberto C.Prado
		 <?=gettext("The interfaces selected here will be removed from default autoedge status."); ?>
533 648ec0c2 Ermal Luçi
					</span></td>
534
			    </tr>
535
                <tr style="display:none" id="sprtable9" name="sprtable9">
536 eb4cf3cb Neriberto C.Prado
                  <td valign="top" class="vncell"><?=gettext("Sticky ports"); ?></td>
537 648ec0c2 Ermal Luçi
                  <td class="vtable">
538
				  	<select name="static[]" class="formselect" multiple="true" size="3">
539
						<?php 
540
							foreach ($ifacelist as $ifn => $ifdescr) {
541
								echo "<option value=\"{$ifn}\"";
542
								if (stristr($pconfig['static'], $ifn))
543
									echo "selected";
544
								echo ">{$ifdescr}</option>";
545
							}
546
						?>
547
					</select>
548
                    <br>
549
                    <span class="vexpl">
550 308a8589 Neriberto C.Prado
	     <?=gettext("Mark an interface as a \"sticky\" interface.  Dynamically learned " .
551
	     "address entries are treated as static once entered into the " .
552
	     "cache.  Sticky entries are never aged out of the cache or " .
553 ad803a5f Neriberto C.Prado
	     "replaced, even if the address is seen on a different interface."); ?>		
554 648ec0c2 Ermal Luçi
					</span></td>
555
			    </tr>
556
                <tr style="display:none" id="sprtable10" name="sprtable10">
557 eb4cf3cb Neriberto C.Prado
                  <td valign="top" class="vncell"><?=gettext("Private ports"); ?></td>
558 648ec0c2 Ermal Luçi
                  <td class="vtable">
559
				  	<select name="private[]" class="formselect" multiple="true" size="3">
560
						<?php 
561
							foreach ($ifacelist as $ifn => $ifdescr) {
562
								echo "<option value=\"{$ifn}\"";
563
								if (stristr($pconfig['private'], $ifn))
564
									echo "selected";
565
								echo ">{$ifdescr}</option>";
566
							}
567
						?>
568
					</select>
569
                    <br>
570
                    <span class="vexpl">
571 308a8589 Neriberto C.Prado
	     <?=gettext("Mark an interface as a \"private\" interface.  A private interface does not forward any traffic to any other port that is also " .
572 ad803a5f Neriberto C.Prado
	     "a private interface."); ?>
573 648ec0c2 Ermal Luçi
					</span></td>
574
			    </tr>
575
                <tr>
576
                  <td width="22%" valign="top">&nbsp;</td>
577
                  <td width="78%">
578
		    <input type="hidden" name="bridgeif" value="<?=$pconfig['bridgeif']; ?>">
579 eb4cf3cb Neriberto C.Prado
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> <input type="button" value="<?=gettext("Cancel"); ?>" onclick="history.back()">
580 648ec0c2 Ermal Luçi
                    <?php if (isset($id) && $a_bridges[$id]): ?>
581
                    <input name="id" type="hidden" value="<?=$id;?>">
582
                    <?php endif; ?>
583
                  </td>
584
                </tr>
585
              </table>
586
</form>
587
<?php include("fend.inc"); ?>
588
</body>
589
</html>