Project

General

Profile

Download (25.8 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	interfaces_bridge_edit.php
5

    
6
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7
	Copyright (C) 2008 Ermal Luçi
8
	All rights reserved.
9

    
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12

    
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15

    
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19

    
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
/*
32
	pfSense_MODULE:	interfaces
33
*/
34

    
35
##|+PRIV
36
##|*IDENT=page-interfaces-bridge-edit
37
##|*NAME=Interfaces: Bridge edit page
38
##|*DESCR=Allow access to the 'Interfaces: Bridge : Edit' page.
39
##|*MATCH=interfaces_bridge_edit.php*
40
##|-PRIV
41

    
42
require("guiconfig.inc");
43

    
44
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_bridge.php');
45

    
46
if (!is_array($config['bridges']['bridged']))
47
	$config['bridges']['bridged'] = array();
48

    
49
$a_bridges = &$config['bridges']['bridged'];
50

    
51
$ifacelist = get_configured_interface_with_descr();
52
foreach ($ifacelist as $bif => $bdescr) {
53
	if (substr(get_real_interface($bif), 0, 3) == "gre")
54
		unset($ifacelist[$bif]);
55
}
56

    
57
if (is_numericint($_GET['id']))
58
	$id = $_GET['id'];
59
if (isset($_POST['id']) && is_numericint($_POST['id']))
60
	$id = $_POST['id'];
61

    
62
if (isset($id) && $a_bridges[$id]) {
63
	$pconfig['enablestp'] = isset($a_bridges[$id]['enablestp']);
64
	$pconfig['descr'] = $a_bridges[$id]['descr'];
65
	$pconfig['bridgeif'] = $a_bridges[$id]['bridgeif'];
66
	$pconfig['members'] = $a_bridges[$id]['members'];
67
	$pconfig['maxaddr'] = $a_bridges[$id]['maxaddr'];
68
	$pconfig['timeout'] = $a_bridges[$id]['timeout'];
69
	if ($a_bridges[$id]['static'])
70
		$pconfig['static'] = $a_bridges[$id]['static'];
71
	if ($a_bridges[$id]['private'])
72
		$pconfig['private'] = $a_bridges[$id]['private'];
73
	if (isset($a_bridges[$id]['stp']))
74
		$pconfig['stp'] = $a_bridges[$id]['stp'];
75
	$pconfig['maxage'] = $a_bridges[$id]['maxage'];
76
	$pconfig['fwdelay'] = $a_bridges[$id]['fwdelay'];
77
	$pconfig['hellotime'] = $a_bridges[$id]['hellotime'];
78
	$pconfig['priority'] = $a_bridges[$id]['priority'];
79
	$pconfig['proto'] = $a_bridges[$id]['proto'];
80
	$pconfig['holdcnt'] = $a_bridges[$id]['holdcnt'];
81
	if (!empty($a_bridges[$id]['ifpriority'])) {
82
		$pconfig['ifpriority'] = explode(",", $a_bridges[$id]['ifpriority']);
83
		$ifpriority = array();
84
		foreach ($pconfig['ifpriority'] as $cfg) {
85
			list ($key, $value)  = explode(":", $cfg);
86
			$embprioritycfg[$key] = $value;
87
			foreach ($embprioritycfg as $key => $value) {
88
				$ifpriority[$key] = $value;
89
			}
90
		}
91
		$pconfig['ifpriority'] = $ifpriority;
92
	}
93
	if (!empty($a_bridges[$id]['ifpathcost'])) {
94
		$pconfig['ifpathcost'] = explode(",", $a_bridges[$id]['ifpathcost']);
95
		$ifpathcost = array();
96
		foreach ($pconfig['ifpathcost'] as $cfg) {
97
			list ($key, $value)  = explode(":", $cfg);
98
			$embpathcfg[$key] = $value;
99
			foreach ($embpathcfg as $key => $value) {
100
				$ifpathcost[$key] = $value;
101
			}
102
		}
103
		$pconfig['ifpathcost'] = $ifpathcost;
104
	}
105
	$pconfig['span'] = $a_bridges[$id]['span'];
106
	if (isset($a_bridges[$id]['edge']))
107
		$pconfig['edge'] = $a_bridges[$id]['edge'];
108
	if (isset($a_bridges[$id]['autoedge']))
109
		$pconfig['autoedge'] = $a_bridges[$id]['autoedge'];
110
	if (isset($a_bridges[$id]['ptp']))
111
		$pconfig['ptp'] = $a_bridges[$id]['ptp'];
112
	if (isset($a_bridges[$id]['autoptp']))
113
		$pconfig['autoptp'] = $a_bridges[$id]['autoptp'];
114
}
115

    
116
if ($_POST) {
117

    
118
	unset($input_errors);
119
	$pconfig = $_POST;
120

    
121
	/* input validation */
122
	$reqdfields = explode(" ", "members");
123
	$reqdfieldsn = array(gettext("Member Interfaces"));
124

    
125
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
126

    
127
	if ($_POST['maxage'] && !is_numeric($_POST['maxage']))
128
		$input_errors[] = gettext("Maxage needs to be an integer between 6 and 40.");
129
	if ($_POST['maxaddr'] && !is_numeric($_POST['maxaddr']))
130
		$input_errors[] = gettext("Maxaddr needs to be an integer.");
131
	if ($_POST['timeout'] && !is_numeric($_POST['timeout']))
132
		$input_errors[] = gettext("Timeout needs to be an integer.");
133
	if ($_POST['fwdelay'] && !is_numeric($_POST['fwdelay']))
134
		$input_errors[] = gettext("Forward Delay needs to be an integer between 4 and 30.");
135
	if ($_POST['hellotime'] && !is_numeric($_POST['hellotime']))
136
		$input_errors[] = gettext("Hello time for STP needs to be an integer between 1 and 2.");
137
	if ($_POST['priority'] && !is_numeric($_POST['priority']))
138
		$input_errors[] = gettext("Priority for STP needs to be an integer between 0 and 61440.");
139
	if ($_POST['holdcnt'] && !is_numeric($_POST['holdcnt']))
140
		$input_errors[] = gettext("Transmit Hold Count for STP needs to be an integer between 1 and 10.");
141
	foreach ($ifacelist as $ifn => $ifdescr) {
142
		if ($_POST[$ifn] <> "" && !is_numeric($_POST[$ifn]))
143
			$input_errors[] = "{$ifdescr} " . gettext("interface priority for STP needs to be an integer between 0 and 240.");
144
	}
145
	$i = 0;
146
	foreach ($ifacelist as $ifn => $ifdescr) {
147
		if ($_POST["{$ifn}{$i}"] <> "" && !is_numeric($_POST["{$ifn}{$i}"]))
148
			$input_errors[] = "{$ifdescr} " . gettext("interface path cost for STP needs to be an integer between 1 and 200000000.");
149
		$i++;
150
	}
151

    
152
	if (!is_array($_POST['members']) || count($_POST['members']) < 2)
153
		$input_errors[] = gettext("You must select at least 2 member interfaces for a bridge.");
154

    
155
	if (is_array($_POST['members'])) {
156
		foreach($_POST['members'] as $ifmembers) {
157
			if (empty($config['interfaces'][$ifmembers]))
158
				$input_errors[] = gettext("A member interface passed does not exist in configuration");
159
			if (is_array($config['interfaces'][$ifmembers]['wireless']) &&
160
				$config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap")
161
				$input_errors[] = gettext("Bridging a wireless interface is only possible in hostap mode.");
162
			if ($_POST['span'] != "none" && $_POST['span'] == $ifmembers)
163
				$input_errors[] = gettext("Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue.");
164
		}
165
	}
166

    
167
	if (!$input_errors) {
168
		$bridge = array();
169
		$bridge['members'] = implode(',', $_POST['members']);
170
		$bridge['enablestp'] = $_POST['enablestp'] ? true : false;
171
		$bridge['descr'] = $_POST['descr'];
172
		$bridge['maxaddr'] = $_POST['maxaddr'];
173
		$bridge['timeout'] = $_POST['timeout'];
174
		if ($_POST['static'])
175
			$bridge['static'] = implode(',', $_POST['static']);
176
		if ($_POST['private'])
177
			$bridge['private'] = implode(',', $_POST['private']);
178
		if (isset($_POST['stp']))
179
			$bridge['stp'] = implode(',', $_POST['stp']);
180
		$bridge['maxage'] = $_POST['maxage'];
181
		$bridge['fwdelay'] = $_POST['fwdelay'];
182
		$bridge['hellotime'] = $_POST['hellotime'];
183
		$bridge['priority'] = $_POST['priority'];
184
		$bridge['proto'] = $_POST['proto'];
185
		$bridge['holdcnt'] = $_POST['holdcnt'];
186
		$i = 0;
187
		$ifpriority = "";
188
		$ifpathcost = "";
189
		foreach ($ifacelist as $ifn => $ifdescr) {
190
			if ($_POST[$ifn] <> "") {
191
				if ($i > 0)
192
					$ifpriority .= ",";
193
				$ifpriority .= $ifn.":".$_POST[$ifn];
194
			}
195
			if ($_POST["{$ifn}0"] <> "") {
196
				if ($i > 0)
197
					$ifpathcost .= ",";
198
				$ifpathcost .= $ifn.":".$_POST["{$ifn}0"];
199
			}
200
			$i++;
201
		}
202
		$bridge['ifpriority'] = $ifpriority;
203
		$bridge['ifpathcost'] = $ifpathcost;
204

    
205
		if ($_POST['span'] != "none")
206
			$bridge['span'] = $_POST['span'];
207
		else
208
			unset($bridge['span']);
209
		if (isset($_POST['edge']))
210
			$bridge['edge'] = implode(',', $_POST['edge']);
211
		if (isset($_POST['autoedge']))
212
			$bridge['autoedge'] = implode(',', $_POST['autoedge']);
213
		if (isset($_POST['ptp']))
214
			$bridge['ptp'] = implode(',', $_POST['ptp']);
215
		if (isset($_POST['autoptp']))
216
			$bridge['autoptp'] = implode(',', $_POST['autoptp']);
217

    
218
		$bridge['bridgeif'] = $_POST['bridgeif'];
219
		interface_bridge_configure($bridge);
220
		if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge"))
221
			$input_errors[] = gettext("Error occurred creating interface, please retry.");
222
		else {
223
			if (isset($id) && $a_bridges[$id])
224
				$a_bridges[$id] = $bridge;
225
			else
226
				$a_bridges[] = $bridge;
227

    
228
			write_config();
229

    
230
			$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
231
			if ($confif <> "")
232
				interface_configure($confif);
233

    
234
			header("Location: interfaces_bridge.php");
235
			exit;
236
		}
237
	}
238
}
239

    
240
$pgtitle = array(gettext("Interfaces"),gettext("Bridge"),gettext("Edit"));
241
$shortcut_section = "interfaces";
242
include("head.inc");
243

    
244
?>
245

    
246
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
247
<script type="text/javascript">
248
//<![CDATA[
249
function show_source_port_range() {
250
        document.getElementById("sprtable").style.display = 'none';
251
        document.getElementById("sprtable1").style.display = '';
252
        document.getElementById("sprtable2").style.display = '';
253
        document.getElementById("sprtable3").style.display = '';
254
        document.getElementById("sprtable4").style.display = '';
255
        document.getElementById("sprtable5").style.display = '';
256
        document.getElementById("sprtable6").style.display = '';
257
        document.getElementById("sprtable7").style.display = '';
258
        document.getElementById("sprtable8").style.display = '';
259
        document.getElementById("sprtable9").style.display = '';
260
        document.getElementById("sprtable10").style.display = '';
261
}
262
//]]>
263
</script>
264

    
265
<?php include("fbegin.inc"); ?>
266
<?php if ($input_errors) print_input_errors($input_errors); ?>
267
            <form action="interfaces_bridge_edit.php" method="post" name="iform" id="iform">
268
              <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="interfaces bridge edit">
269
				<tr>
270
					<td colspan="2" valign="top" class="listtopic"><?=gettext("Bridge configuration"); ?></td>
271
				</tr>
272
				<tr>
273
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Member interfaces"); ?></td>
274
                  <td width="78%" class="vtable">
275
				  <select name="members[]" multiple="multiple" class="formselect" size="3">
276
                      <?php
277
						$members_array = explode(',', $pconfig['members']);
278
						foreach ($ifacelist as $ifn => $ifinfo) {
279
							echo "<option value=\"{$ifn}\"";
280
							if (in_array($ifn, $members_array))
281
								echo " selected=\"selected\"";
282
							echo ">{$ifinfo}</option>";
283
						}
284
						unset($members_array);
285
				?>
286
                    </select>
287
			<br />
288
			<span class="vexpl"><?=gettext("Interfaces participating in the bridge."); ?></span>
289
			</td>
290
            </tr>
291
			<tr>
292
                  <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
293
                  <td width="78%" class="vtable">
294
				  <input type="text" name="descr" id="descr" class="formfld unknown" size="50" value="<?=htmlspecialchars($pconfig['descr']);?>" />
295
					</td>
296
				</tr>
297
            <tr id="sprtable">
298
                <td></td>
299
                <td>
300
                <p><input type="button" onclick="show_source_port_range()" value="<?=gettext("Show advanced options"); ?>" /></p>
301
                </td>
302
			</tr>
303
                <tr style="display:none" id="sprtable1">
304
                  <td valign="top" class="vncell" align="center"><?=gettext("RSTP/STP"); ?>  </td>
305
                  <td class="vtable">
306
					<input type="checkbox" name="enablestp" id="enablestp" <?php if ($pconfig['enablestp']) echo "checked=\"checked\"";?> />
307
					<span class="vexpl"><strong><?=gettext("Enable spanning tree options for this bridge."); ?> </strong></span>
308
					<br /><br />
309
					<table id="stpoptions" border="0" cellpadding="6" cellspacing="0" summary="protocol">
310
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Protocol"); ?></td>
311
					<td class="vtable" width="80%">
312
					<select name="proto" id="proto">
313
						<?php
314
							foreach (array("rstp", "stp") as $proto) {
315
								echo "<option value=\"{$proto}\"";
316
								if ($pconfig['proto'] == $proto)
317
									echo " selected=\"selected\"";
318
								echo ">".strtoupper($proto)."</option>";
319
							}
320
						?>
321
					</select>
322
                    <br />
323
                    <span class="vexpl"><?=gettext("Protocol used for spanning tree."); ?> </span></td>
324
					</tr>
325
					<tr> <td valign="top" class="vncell" width="20%"><?=gettext("STP interfaces"); ?></td>
326
					<td class="vtable" width="80%">
327
					<select name="stp[]" class="formselect" multiple="multiple" size="3">
328
						<?php
329
							foreach ($ifacelist as $ifn => $ifdescr) {
330
								echo "<option value=\"{$ifn}\"";
331
								if (stristr($pconfig['stp'], $ifn))
332
									echo " selected=\"selected\"";
333
								echo ">{$ifdescr}</option>";
334
							}
335
						?>
336
					</select>
337
					<br />
338
					<span class="vexpl" >
339
	     <?=gettext("Enable Spanning Tree Protocol on interface.  The if_bridge(4) " .
340
	     "driver has support for the IEEE 802.1D Spanning Tree Protocol " .
341
	     "(STP).  STP is used to detect and remove loops in a " .
342
	     "network topology."); ?>
343
					</span>
344
					</td></tr>
345
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Valid time"); ?></td>
346
					<td class="vtable" width="80%">
347
					<input name="maxage" type="text" class="formfld unkown" id="maxage" size="8" value="<?=htmlspecialchars($pconfig['maxage']);?>" /> <?=gettext("seconds"); ?>
348
					<br />
349
					<span class="vexpl">
350
	     <?=gettext("Set the time that a Spanning Tree Protocol configuration is " .
351
	     "valid.  The default is 20 seconds.  The minimum is 6 seconds and " .
352
	     "the maximum is 40 seconds."); ?>
353
					</span>
354
					</td></tr>
355
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Forward time"); ?> </td>
356
					<td class="vtable" width="80%">
357
					<input name="fwdelay" type="text" class="formfld unkown" id="fwdelay" size="8" value="<?=htmlspecialchars($pconfig['fwdelay']);?>" /> <?=gettext("seconds"); ?>
358
					<br />
359
					<span class="vexpl">
360
	     <?=gettext("Set the time that must pass before an interface begins forwarding " .
361
	     "packets when Spanning Tree is enabled.  The default is 15 seconds.  The minimum is 4 seconds and the maximum is 30 seconds."); ?>
362
					</span>
363
					</td></tr>
364
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hello time"); ?></td>
365
					<td class="vtable" width="80%">
366
					<input name="hellotime" type="text" class="formfld unkown" size="8" id="hellotime" value="<?=htmlspecialchars($pconfig['hellotime']);?>" /> <?=gettext("seconds"); ?>
367
					<br />
368
					<span class="vexpl">
369
	     <?=gettext("Set the time between broadcasting of Spanning Tree Protocol configuration messages.  The hello time may only be changed when " .
370
	     "operating in legacy STP mode.  The default is 2 seconds.  The minimum is 1 second and the maximum is 2 seconds."); ?>
371
					</span>
372
					</td></tr>
373
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td>
374
					<td class="vtable" width="80%">
375
					<input name="priority" type="text" class="formfld unkown" id="priority" value="<?=htmlspecialchars($pconfig['priority']);?>" />
376
					<br />
377
					<span class="vexpl">
378
	     <?=gettext("Set the bridge priority for Spanning Tree.  The default is 32768. " .
379
	     "The minimum is 0 and the maximum is 61440."); ?>
380
					</span>
381
					</td></tr>
382
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hold count"); ?></td>
383
					<td class="vtable" width="80%">
384
					<input name="holdcnt" type="text" class="formfld unkown" id="holdcnt" value="<?=htmlspecialchars($pconfig['holdcnt']);?>" />
385
					<br />
386
					<span class="vexpl">
387
	     <?=gettext("Set the transmit hold count for Spanning Tree.  This is the number" .
388
	     " of packets transmitted before being rate limited.  The " .
389
	     "default is 6.  The minimum is 1 and the maximum is 10."); ?>
390
					</span>
391
					</td></tr>
392
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td>
393
					<td class="vtable" width="80%">
394
					<table summary="priority">
395
					<?php foreach ($ifacelist as $ifn => $ifdescr)
396
							echo "<tr><td>{$ifdescr}</td><td><input size=\"5\" name=\"{$ifn}\" type=\"text\" class=\"formfld unkown\" id=\"{$ifn}\" value=\"{$ifpriority[$ifn]}\" /></td></tr>";
397
					?>
398
					<tr><td></td></tr>
399
					</table>
400
					<br />
401
					<span class="vexpl" >
402
	     <?=gettext("Set the Spanning Tree priority of interface to value.  The " .
403
	     "default is 128.  The minimum is 0 and the maximum is 240.  Increments of 16."); ?>
404
					</span>
405
					</td></tr>
406
					<tr><td valign="top" class="vncell" width="20%"><?=gettext("Path cost"); ?></td>
407
					<td class="vtable" width="80%">
408
					<table summary="path cost">
409
					<?php $i = 0; foreach ($ifacelist as $ifn => $ifdescr)
410
							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>";
411
					?>
412
					<tr><td></td></tr>
413
					</table>
414
					<br />
415
					<span class="vexpl" >
416
	     <?=gettext("Set the Spanning Tree path cost of interface to value.  The " .
417
	     "default is calculated from the link speed.  To change a previously selected path cost back to automatic, set the cost to 0. ".
418
	     "The minimum is 1 and the maximum is 200000000."); ?>
419
					</span>
420
					</td></tr>
421

    
422
			    </table>
423
				</td></tr>
424
                <tr style="display:none" id="sprtable2">
425
                  <td valign="top" class="vncell"><?=gettext("Cache size"); ?></td>
426
					<td class="vtable">
427
						<input name="maxaddr" size="10" type="text" class="formfld unkown" id="maxaddr" value="<?=htmlspecialchars($pconfig['maxaddr']);?>" /> <?=gettext("entries"); ?>
428
					<br /><span class="vexpl">
429
<?=gettext("Set the size of the bridge address cache to size.	The default is " .
430
	     ".100 entries."); ?>
431
					</span>
432
					</td>
433
				</tr>
434
                <tr style="display:none" id="sprtable3">
435
                  <td valign="top" class="vncell"><?=gettext("Cache entry expire time"); ?></td>
436
				  <td>
437
					<input name="timeout" type="text" class="formfld unkown" id="timeout" size="10" value="<?=htmlspecialchars($pconfig['timeout']);?>" /> <?=gettext("seconds"); ?>
438
					<br /><span class="vexpl">
439
	     <?=gettext("Set the timeout of address cache entries to this number of seconds.  If " .
440
	     "seconds is zero, then address cache entries will not be expired. " .
441
	     "The default is 240 seconds."); ?>
442
					</span>
443
					</td>
444
				</tr>
445
                <tr style="display:none" id="sprtable4">
446
                  <td valign="top" class="vncell"><?=gettext("Span port"); ?></td>
447
					<td class="vtable">
448
				  	<select name="span" class="formselect" id="span">
449
						<option value="none" selected="selected"><?=gettext("None"); ?></option>
450
						<?php
451
							foreach ($ifacelist as $ifn => $ifdescr) {
452
								echo "<option value=\"{$ifn}\"";
453
								if ($ifn == $pconfig['span'])
454
									echo " selected=\"selected\"";
455
								echo ">{$ifdescr}</option>";
456
							}
457
						?>
458
					</select>
459
					<br /><span class="vexpl">
460
	     <?=gettext("Add the interface named by interface as a span port on the " .
461
	     "bridge.  Span ports transmit a copy of every frame received by " .
462
	     "the bridge.  This is most useful for snooping a bridged network " .
463
	     "passively on another host connected to one of the span ports of " .
464
	     "the bridge."); ?>
465
					</span>
466
		<p class="vexpl"><span class="red"><strong>
467
					 <?=gettext("Note:"); ?><br />
468
                                  </strong></span>
469
                 <?=gettext("The span interface cannot be part of the bridge member interfaces."); ?>
470
                                        </p>
471
					</td>
472
				</tr>
473
                <tr style="display:none" id="sprtable5">
474
                  <td valign="top" class="vncell"><?=gettext("Edge ports"); ?></td>
475
                  <td class="vtable">
476
					<select name="edge[]" class="formselect" multiple="multiple" size="3">
477
						<?php
478
							foreach ($ifacelist as $ifn => $ifdescr) {
479
								echo "<option value=\"{$ifn}\"";
480
								if (stristr($pconfig['edge'], $ifn))
481
									echo " selected=\"selected\"";
482
								echo ">{$ifdescr}</option>";
483
							}
484
						?>
485
					</select>
486
                    <br />
487
                    <span class="vexpl">
488
	     <?=gettext("Set interface as an edge port.  An edge port connects directly to " .
489
	     "end stations and cannot create bridging loops in the network; this " .
490
	     "allows it to transition straight to forwarding."); ?>
491
					</span></td>
492
			    </tr>
493
                <tr style="display:none" id="sprtable6">
494
                  <td valign="top" class="vncell"><?=gettext("Auto Edge ports"); ?></td>
495
                  <td class="vtable">
496
					<select name="autoedge[]" class="formselect" multiple="multiple" size="3">
497
						<?php
498
							foreach ($ifacelist as $ifn => $ifdescr) {
499
								echo "<option value=\"{$ifn}\"";
500
								if (stristr($pconfig['autoedge'], $ifn))
501
									echo " selected=\"selected\"";
502
								echo ">{$ifdescr}</option>";
503
							}
504
						?>
505
					</select>
506
                    <br />
507
                    <span class="vexpl">
508
	     <?=gettext("Allow interface to automatically detect edge status.  This is the " .
509
	     "default for all interfaces added to a bridge."); ?></span>
510
		 <p class="vexpl"><span class="red"><strong>
511
				  <?=gettext("Note:"); ?><br />
512
				  </strong></span>
513
		 <?=gettext("This will disable the autoedge status of interfaces."); ?>
514
					</p></td>
515
			    </tr>
516
                <tr style="display:none" id="sprtable7">
517
                  <td valign="top" class="vncell"><?=gettext("PTP ports"); ?></td>
518
                  <td class="vtable">
519
					<select name="ptp[]" class="formselect" multiple="multiple" size="3">
520
						<?php
521
							foreach ($ifacelist as $ifn => $ifdescr) {
522
								echo "<option value=\"{$ifn}\"";
523
								if (stristr($pconfig['ptp'], $ifn))
524
									echo " selected=\"selected\"";
525
								echo ">{$ifdescr}</option>";
526
							}
527
						?>
528
					</select>
529
                    <br />
530
                    <span class="vexpl">
531
	     <?=gettext("Set the interface as a point-to-point link.  This is required for " .
532
	     "straight transitions to forwarding and should be enabled on a " .
533
	     "direct link to another RSTP-capable switch."); ?>
534
					</span></td>
535
			    </tr>
536
                <tr style="display:none" id="sprtable8">
537
                  <td valign="top" class="vncell"><?=gettext("Auto PTP ports"); ?></td>
538
                  <td class="vtable">
539
					<select name="autoptp[]" class="formselect" multiple="multiple" size="3">
540
						<?php
541
							foreach ($ifacelist as $ifn => $ifdescr) {
542
								echo "<option value=\"{$ifn}\"";
543
								if (stristr($pconfig['autoptp'], $ifn))
544
									echo " selected=\"selected\"";
545
								echo ">{$ifdescr}</option>";
546
							}
547
						?>
548
					</select>
549
                    <br />
550
                    <span class="vexpl">
551
	     <?=gettext("Automatically detect the point-to-point status on interface by " .
552
	     "checking the full duplex link status.  This is the default for " .
553
	     "interfaces added to the bridge."); ?></span>
554
				 <p class="vexpl"><span class="red"><strong>
555
				  <?=gettext("Note:"); ?><br />
556
				  </strong></span>
557
		 <?=gettext("The interfaces selected here will be removed from default autoedge status."); ?>
558
					</p></td>
559
			    </tr>
560
                <tr style="display:none" id="sprtable9">
561
                  <td valign="top" class="vncell"><?=gettext("Sticky ports"); ?></td>
562
                  <td class="vtable">
563
					<select name="static[]" class="formselect" multiple="multiple" size="3">
564
						<?php
565
							foreach ($ifacelist as $ifn => $ifdescr) {
566
								echo "<option value=\"{$ifn}\"";
567
								if (stristr($pconfig['static'], $ifn))
568
									echo " selected=\"selected\"";
569
								echo ">{$ifdescr}</option>";
570
							}
571
						?>
572
					</select>
573
                    <br />
574
                    <span class="vexpl">
575
	     <?=gettext("Mark an interface as a \"sticky\" interface.  Dynamically learned " .
576
	     "address entries are treated as static once entered into the " .
577
	     "cache.  Sticky entries are never aged out of the cache or " .
578
	     "replaced, even if the address is seen on a different interface."); ?>
579
					</span></td>
580
			    </tr>
581
                <tr style="display:none" id="sprtable10">
582
                  <td valign="top" class="vncell"><?=gettext("Private ports"); ?></td>
583
                  <td class="vtable">
584
					<select name="private[]" class="formselect" multiple="multiple" size="3">
585
						<?php
586
							foreach ($ifacelist as $ifn => $ifdescr) {
587
								echo "<option value=\"{$ifn}\"";
588
								if (stristr($pconfig['private'], $ifn))
589
									echo " selected=\"selected\"";
590
								echo ">{$ifdescr}</option>";
591
							}
592
						?>
593
					</select>
594
                    <br />
595
                    <span class="vexpl">
596
	     <?=gettext("Mark an interface as a \"private\" interface.  A private interface does not forward any traffic to any other port that is also " .
597
	     "a private interface."); ?>
598
					</span></td>
599
			    </tr>
600
                <tr>
601
                  <td width="22%" valign="top">&nbsp;</td>
602
                  <td width="78%">
603
		    <input type="hidden" name="bridgeif" value="<?=htmlspecialchars($pconfig['bridgeif']); ?>" />
604
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
605
                    <input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
606
                    <?php if (isset($id) && $a_bridges[$id]): ?>
607
                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
608
                    <?php endif; ?>
609
                  </td>
610
                </tr>
611
              </table>
612
</form>
613
<?php include("fend.inc"); ?>
614
</body>
615
</html>
(98-98/256)