Project

General

Profile

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

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