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

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