Project

General

Profile

Download (23.3 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
require("guiconfig.inc");
32

    
33
if (!is_array($config['bridges']['bridged']))
34
	$config['bridges']['bridged'] = array();
35

    
36
$a_bridges = &$config['bridges']['bridged'];
37

    
38
$ifacelist = get_configured_interface_with_descr();
39

    
40
$id = $_GET['id'];
41
if (isset($_POST['id']))
42
	$id = $_POST['id'];
43

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

    
90
if ($_POST) {
91

    
92
	unset($input_errors);
93
	$pconfig = $_POST;
94

    
95
	/* input validation */
96
	$reqdfields = explode(" ", "members");
97
	$reqdfieldsn = explode(",", "Member Interfaces");
98

    
99
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
100

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

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

    
129
	if (is_array($_POST['members'])) {
130
		foreach($_POST['members'] as $ifmembers) {
131
			if (is_array($config['interfaces'][$ifmembers]['wireless']) &&
132
				$config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap")
133
				$input_errors[] = "Bridging a wireless interface is only possible in hostap mode.";
134
			if ($_POST['span'] != "none" && $_POST['span'] == $ifmembers)
135
				$input_errors[] = "Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue.";
136
		}
137
	}
138

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

    
189
		$bridge['bridgeif'] = $_POST['bridgeif'];
190
                $bridge['bridgeif'] = interface_bridge_configure($bridge);
191
                if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge"))
192
                        $input_errors[] = "Error occured creating interface, please retry.";
193
                else {
194
                        if (isset($id) && $a_bridges[$id])
195
                                $a_bridges[$id] = $bridge;
196
                        else
197
                                $a_bridges[] = $bridge;
198

    
199
                        write_config();
200

    
201
			$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
202
                        if ($confif <> "")
203
                                interface_configure($confif);
204

    
205

    
206
			header("Location: interfaces_bridge.php");
207
			exit;
208
		}
209
	}
210
}
211

    
212
$pgtitle = array("Firewall","Bridge","Edit");
213
include("head.inc");
214

    
215
?>
216

    
217
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
218
<script type="text/javascript">
219
function show_source_port_range() {
220
        document.getElementById("sprtable").style.display = 'none';
221
        document.getElementById("sprtable1").style.display = '';
222
        document.getElementById("sprtable2").style.display = '';
223
        document.getElementById("sprtable3").style.display = '';
224
        document.getElementById("sprtable4").style.display = '';
225
        document.getElementById("sprtable5").style.display = '';
226
        document.getElementById("sprtable6").style.display = '';
227
        document.getElementById("sprtable7").style.display = '';
228
        document.getElementById("sprtable8").style.display = '';
229
        document.getElementById("sprtable9").style.display = '';
230
        document.getElementById("sprtable10").style.display = '';
231
}
232
</script>
233

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

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