Project

General

Profile

Download (23.7 KB) Statistics
| Branch: | Tag: | Revision:
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

    
50
$id = $_GET['id'];
51
if (isset($_POST['id']))
52
	$id = $_POST['id'];
53

    
54
if (isset($id) && $a_bridges[$id]) {
55
	$pconfig['enablestp'] = isset($a_bridges[$id]['enablestp']);
56
	$pconfig['descr'] = $a_bridges[$id]['descr'];
57
	$pconfig['bridgeif'] = $a_bridges[$id]['bridgeif'];
58
	$pconfig['members'] = $a_bridges[$id]['members'];
59
	$pconfig['maxaddr'] = $a_bridges[$id]['maxaddr'];
60
	$pconfig['timeout'] = $a_bridges[$id]['timeout'];
61
	if ($a_bridges[$id]['static'])
62
		$pconfig['static'] = $a_bridges[$id]['static'];
63
	if ($a_bridges[$id]['private'])
64
		$pconfig['private'] = $a_bridges[$id]['private'];
65
	if (isset($a_bridges[$id]['stp']))
66
		$pconfig['stp'] = $a_bridges[$id]['stp'];
67
	$pconfig['maxage'] = $a_bridges[$id]['maxage'];
68
	$pconfig['fwdelay'] = $a_bridges[$id]['fwdelay'];
69
	$pconfig['hellotime'] = $a_bridges[$id]['hellotime'];
70
	$pconfig['priority'] = $a_bridges[$id]['priority'];
71
	$pconfig['proto'] = $a_bridges[$id]['proto'];
72
	$pconfig['holdcount'] = $a_bridges[$id]['holdcount'];
73
	$pconfig['ifpriority'] = explode(",", $a_bridges[$id]['ifpriority']);
74
	$ifpriority = array();
75
	foreach ($pconfig['ifpriority'] as $cfg) {
76
		$embcfg = explode(":", $cfg);
77
		foreach ($embcfg as $key => $value)
78
			$ifpriority[$key] = $value;
79
	}
80
	$pconfig['ifpriority'] = $ifpriority;
81
	$pconfig['ifpathcost'] = explode(",", $a_bridges[$id]['ifpathcost']);
82
	$ifpathcost = array();
83
	foreach ($pconfig['ifpathcost'] as $cfg) {
84
		$embcfg = explode(":", $cfg);
85
		foreach ($embcfg as $key => $value)
86
			$ifpathcost[$key] = $value;
87
	}
88
	$pconfig['ifpathcost'] = $ifpathcost;
89
	$pconfig['span'] = $a_bridges[$id]['span'];
90
	if (isset($a_bridges[$id]['edge']))
91
		$pconfig['edge'] = $a_bridges[$id]['edge'];
92
	if (isset($a_bridges[$id]['autoedge']))
93
		$pconfig['autoedge'] = $a_bridges[$id]['autoedge'];
94
	if (isset($a_bridges[$id]['ptp']))
95
		$pconfig['ptp'] = $a_bridges[$id]['ptp'];
96
	if (isset($a_bridges[$id]['autoptp']))
97
		$pconfig['autoptp'] = $a_bridges[$id]['autoptp'];
98
}
99

    
100
if ($_POST) {
101

    
102
	unset($input_errors);
103
	$pconfig = $_POST;
104

    
105
	/* input validation */
106
	$reqdfields = explode(" ", "members");
107
	$reqdfieldsn = explode(",", "Member Interfaces");
108

    
109
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
110

    
111
	if ($_POST['maxage'] && !is_numeric($_POST['maxage']))
112
		$input_errors[] = "Maxage needs to be an interger between 6 and 40.";
113
	if ($_POST['maxaddr'] && !is_numeric($_POST['maxaddr']))
114
		$input_errors[] = "Maxaddr needs to be an interger.";
115
	if ($_POST['timeout'] && !is_numeric($_POST['timeout']))
116
		$input_errors[] = "Timeout needs to be an interger.";
117
	if ($_POST['fwdelay'] && !is_numeric($_POST['fwdelay']))
118
		$input_errors[] = "Forward Delay needs to be an interger between 4 and 30.";
119
	if ($_POST['hellotime'] && !is_numeric($_POST['hellotime']))
120
		$input_errors[] = "Hello time for STP needs to be an interger between 1 and 2.";
121
	if ($_POST['priority'] && !is_numeric($_POST['priority']))
122
		$input_errors[] = "Priority for STP needs to be an interger between 0 and 61440.";
123
	if ($_POST['holdcnt'] && !is_numeric($_POST['holdcnt']))
124
		$input_errors[] = "Transmit Hold Count for STP needs to be an interger between 1 and 10.";
125
	foreach ($ifacelist as $ifn => $ifdescr) {
126
		if ($_POST[$ifn] <> "" && !is_numeric($_POST[$ifn]))
127
			$input_errors[] = "{$ifdescr} interface priority for STP needs to be an interger between 0 and 240.";
128
	}
129
	$i = 0;
130
	foreach ($ifacelist as $ifn => $ifdescr) {
131
		if ($_POST["{$ifn}{$i}"] <> "" && !is_numeric($_POST["{$ifn}{$i}"]))
132
			$input_errors[] = "{$ifdescr} interface path cost for STP needs to be an interger between 1 and 200000000.";
133
		$i++;
134
	}
135

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

    
139
	if (is_array($_POST['members'])) {
140
		foreach($_POST['members'] as $ifmembers) {
141
			if (is_array($config['interfaces'][$ifmembers]['wireless']) &&
142
				$config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap")
143
				$input_errors[] = "Bridging a wireless interface is only possible in hostap mode.";
144
			if ($_POST['span'] != "none" && $_POST['span'] == $ifmembers)
145
				$input_errors[] = "Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue.";
146
		}
147
	}
148

    
149
	if (!$input_errors) {
150
		$bridge = array();
151
		$bridge['members'] = implode(',', $_POST['members']);
152
		$bridge['enablestp'] = isset($_POST['enablestp']);
153
		$bridge['descr'] = $_POST['descr'];
154
		$bridge['maxaddr'] = $_POST['maxaddr'];
155
		$bridge['timeout'] = $_POST['timeout'];
156
		if ($_POST['static'])
157
			$bridge['static'] = implode(',', $_POST['static']);
158
		if ($_POST['private'])
159
			$bridge['private'] = implode(',', $_POST['private']);
160
		if (isset($_POST['stp']))
161
			$bridge['stp'] = implode(',', $_POST['stp']);
162
		$bridge['maxage'] = $_POST['maxage'];
163
		$bridge['fwdelay'] = $_POST['fwdelay'];
164
		$bridge['hellotime'] = $_POST['hellotime'];
165
		$bridge['priority'] = $_POST['priority'];
166
		$bridge['proto'] = $_POST['proto'];
167
		$bridge['holdcount'] = $_POST['holdcount'];
168
		$i = 0;
169
		$ifpriority = "";
170
		$ifpathcost = "";
171
		foreach ($ifacelist as $ifn => $ifdescr) {
172
			if ($_POST[$ifn] <> "") {
173
				if ($i > 0)
174
					$ifpriority .= ",";
175
				$ifpriority .= $ifn.":".$_POST[$ifn];
176
			}
177
			if ($_POST["{$ifn}{$i}"] <> "") {
178
				if ($i > 0)
179
					$ifpathcost .= ",";
180
				$ifpathcost .= $ifn.":".$_POST[$ifn];
181
			}
182
			$i++;
183
		}
184
		$bridge['ifpriority'] = $ifpriority;
185
		$bridge['ifpathcost'] = $ifpathcost;
186
		if ($_POST['span'] != "none")
187
			$bridge['span'] = $_POST['span'];
188
		else 
189
			unset($bridge['span']);
190
		if (isset($_POST['edge']))
191
			$bridge['edge'] = implode(',', $_POST['edge']);
192
		if (isset($_POST['autoedge']))
193
			$bridge['autoedge'] = implode(',', $_POST['autoedge']);
194
		if (isset($_POST['ptp']))
195
			$bridge['ptp'] = implode(',', $_POST['ptp']);
196
		if (isset($_POST['autoptp']))
197
			$bridge['autoptp'] = implode(',', $_POST['autoptp']);
198

    
199
		$bridge['bridgeif'] = $_POST['bridgeif'];
200
                $bridge['bridgeif'] = interface_bridge_configure($bridge);
201
                if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge"))
202
                        $input_errors[] = "Error occured creating interface, please retry.";
203
                else {
204
                        if (isset($id) && $a_bridges[$id])
205
                                $a_bridges[$id] = $bridge;
206
                        else
207
                                $a_bridges[] = $bridge;
208

    
209
                        write_config();
210

    
211
			$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
212
                        if ($confif <> "")
213
                                interface_configure($confif);
214

    
215

    
216
			header("Location: interfaces_bridge.php");
217
			exit;
218
		}
219
	}
220
}
221

    
222
$pgtitle = array("Firewall","Bridge","Edit");
223
include("head.inc");
224

    
225
?>
226

    
227
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
228
<script type="text/javascript">
229
function show_source_port_range() {
230
        document.getElementById("sprtable").style.display = 'none';
231
        document.getElementById("sprtable1").style.display = '';
232
        document.getElementById("sprtable2").style.display = '';
233
        document.getElementById("sprtable3").style.display = '';
234
        document.getElementById("sprtable4").style.display = '';
235
        document.getElementById("sprtable5").style.display = '';
236
        document.getElementById("sprtable6").style.display = '';
237
        document.getElementById("sprtable7").style.display = '';
238
        document.getElementById("sprtable8").style.display = '';
239
        document.getElementById("sprtable9").style.display = '';
240
        document.getElementById("sprtable10").style.display = '';
241
}
242
</script>
243

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

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