Project

General

Profile

Download (23.6 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
##|+PRIV
32
##|*IDENT=page-interfaces-bridge-edit
33
##|*NAME=Interfaces: Bridge edit page
34
##|*DESCR=Allow access to the 'Interfaces: Bridge : Edit' page.
35
##|*MATCH=interfaces_bridge_edit.php*
36
##|-PRIV
37

    
38
require("guiconfig.inc");
39

    
40
if (!is_array($config['bridges']['bridged']))
41
	$config['bridges']['bridged'] = array();
42

    
43
$a_bridges = &$config['bridges']['bridged'];
44

    
45
$ifacelist = get_configured_interface_with_descr();
46

    
47
$id = $_GET['id'];
48
if (isset($_POST['id']))
49
	$id = $_POST['id'];
50

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

    
97
if ($_POST) {
98

    
99
	unset($input_errors);
100
	$pconfig = $_POST;
101

    
102
	/* input validation */
103
	$reqdfields = explode(" ", "members");
104
	$reqdfieldsn = explode(",", "Member Interfaces");
105

    
106
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
107

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

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

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

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

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

    
206
                        write_config();
207

    
208
			$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
209
                        if ($confif <> "")
210
                                interface_configure($confif);
211

    
212

    
213
			header("Location: interfaces_bridge.php");
214
			exit;
215
		}
216
	}
217
}
218

    
219
$pgtitle = array("Firewall","Bridge","Edit");
220
include("head.inc");
221

    
222
?>
223

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

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

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