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%">Protocol</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 for 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).  STP 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 seconds.  The minimum is 4 seconds and the maximum is 30 seconds.		
329
					</span>
330
					</td></tr>
331
					<tr><td valign="top" class="vncell" width="20%">Hello time</td>
332
					<td class="vtable" width="80%">
333
					<input name="hellotime" type="text" class="formfld unkown" size="8" id="hellotime" value="<?=$pconfig['hellotime'];?>"> seconds
334
					<br/>
335
					<span class="vexpl">
336
	     Set the time between broadcasting of Spanning Tree Protocol configuration messages.  The hello time may only be changed when
337
	     operating in legacy STP mode.  The default is 2 seconds.  The minimum is 1 second and the maximum is 2 seconds.		
338
					</span>
339
					</td></tr>
340
					<tr><td valign="top" class="vncell" width="20%">Priority</td>
341
					<td class="vtable" width="80%">
342
					<input name="priority" type="text" class="formfld unkown" id="priority" value="<?=$pconfig['priority'];?>">
343
					<br/>
344
					<span class="vexpl">
345
	     Set the bridge priority for Spanning Tree.  The default is 32768.
346
	     The minimum is 0 and the maximum is 61440.		
347
					</span>
348
					</td></tr>
349
					<tr><td valign="top" class="vncell" width="20%">Hold count</td>
350
					<td class="vtable" width="80%">
351
					<input name="holdcnt" type="text" class="formfld unkown" id="holdcnt" value="<?=$pconfig['holdcnt'];?>">
352
					<br/>
353
					<span class="vexpl">
354
	     Set the transmit hold count for Spanning Tree.  This is the num-
355
	     ber of packets transmitted before being rate limited.  The
356
	     default is 6.  The minimum is 1 and the maximum is 10.		
357
					</span>
358
					</td></tr>
359
					<tr><td valign="top" class="vncell" width="20%">Priority</td>
360
					<td class="vtable" width="80%">
361
					<table>
362
					<?php foreach ($ifacelist as $ifn => $ifdescr) 
363
							echo "<tr><td>{$ifdescr}</td><td><input size=\"5\" name=\"{$ifn}\" type=\"text\" class=\"formfld unkown\" id=\"{$ifn}\" value=\"{$ifpriority[$ifn]}\"></td></tr>";
364
					?>
365
					</table>
366
					<br/>
367
					<span class="vexpl" > 
368
	     Set the Spanning Tree priority of interface to value.  The
369
	     default is 128.  The minimum is 0 and the maximum is 240.		
370
					</span>
371
					</td></tr>
372
					<tr><td valign="top" class="vncell" width="20%">Path cost</td>
373
					<td class="vtable" width="80%">
374
					<table>
375
					<?php $i = 0; foreach ($ifacelist as $ifn => $ifdescr)
376
							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>";
377
					?>
378
					</table>
379
					<br/>
380
					<span class="vexpl" > 
381
	     Set the Spanning Tree path cost of interface to value.  The
382
	     default is calculated from the link speed.  To change a previously selected path cost back to automatic, set the cost to 0.
383
	     The minimum is 1 and the maximum is 200000000.		
384
					</span>
385
					</td></tr>
386

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