Project

General

Profile

Download (26 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
if (isset($_POST['referer'])) {
45
	$referer = $_POST['referer'];
46
} else {
47
	$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_bridge.php');
48
}
49

    
50
if (!is_array($config['bridges']['bridged']))
51
	$config['bridges']['bridged'] = array();
52

    
53
$a_bridges = &$config['bridges']['bridged'];
54

    
55
$ifacelist = get_configured_interface_with_descr();
56
foreach ($ifacelist as $bif => $bdescr) {
57
	if (substr(get_real_interface($bif), 0, 3) == "gre")
58
		unset($ifacelist[$bif]);
59
}
60

    
61
if (is_numericint($_GET['id']))
62
	$id = $_GET['id'];
63
if (isset($_POST['id']) && is_numericint($_POST['id']))
64
	$id = $_POST['id'];
65

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

    
120
if ($_POST) {
121

    
122
	unset($input_errors);
123
	$pconfig = $_POST;
124

    
125
	/* input validation */
126
	$reqdfields = explode(" ", "members");
127
	$reqdfieldsn = array(gettext("Member Interfaces"));
128

    
129
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
130

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

    
156
	if (!is_array($_POST['members']) || count($_POST['members']) < 1)
157
		$input_errors[] = gettext("You must select at least one member interface for a bridge.");
158

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

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

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

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

    
232
			write_config();
233

    
234
			$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
235
			if ($confif <> "")
236
				interface_configure($confif);
237

    
238
			header("Location: interfaces_bridge.php");
239
			exit;
240
		}
241
	}
242
}
243

    
244
$pgtitle = array(gettext("Interfaces"),gettext("Bridge"),gettext("Edit"));
245
$shortcut_section = "interfaces";
246
include("head.inc");
247

    
248
?>
249

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

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

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