Project

General

Profile

Download (25.7 KB) Statistics
| Branch: | Tag: | Revision:

univnautes / usr / local / www / interfaces_bridge_edit.php @ a1b66bec

1
<?php
2
/* $Id$ */
3
/*
4
	interfaces_bridge_edit.php
5

    
6
	Copyright (C) 2008 Ermal Luçi
7
	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
/*
31
	pfSense_MODULE:	interfaces
32
*/
33

    
34
##|+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
require("guiconfig.inc");
42

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

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

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

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

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

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

    
115
if ($_POST) {
116

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

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

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

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

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

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

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

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

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

    
227
			write_config();
228

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

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

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

    
243
?>
244

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

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

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