Projet

Général

Profil

Télécharger (25,5 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / interfaces_bridge_edit.php @ 0fab7eb1

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
if (!is_array($config['bridges']['bridged']))
44
	$config['bridges']['bridged'] = array();
45

    
46
$a_bridges = &$config['bridges']['bridged'];
47

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

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

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

    
113
if ($_POST) {
114

    
115
	unset($input_errors);
116
	$pconfig = $_POST;
117

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

    
122
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
123

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

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

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

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

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

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

    
225
			write_config();
226

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

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

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

    
241
?>
242

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

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

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