Project

General

Profile

Download (22.9 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	interfaces_bridge_edit.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9

    
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12

    
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15

    
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19

    
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31

    
32
require("guiconfig.inc");
33

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

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

    
39
$ifacelist = get_configured_interface_with_descr();
40

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

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

    
91
if ($_POST) {
92

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

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

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

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

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

    
130
	if (is_array($_POST['members'])) {
131
		foreach($_POST['members'] as $ifmembers)
132
			if (is_array($config['interfaces'][$ifmembers]['wireless']) &&
133
				$config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap")
134
				$input_errors[] = "Bridging a wireless interface is only possible in hostap mode.";
135
	}
136

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

    
184
		$bridge['bridgeif'] = $_POST['bridgeif'];
185
                $bridge['bridgeif'] = interface_bridge_configure($bridge);
186
                if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge"))
187
                        $input_errors[] = "Error occured creating interface, please retry.";
188
                else {
189
                        if (isset($id) && $a_bridges[$id])
190
                                $a_bridges[$id] = $bridge;
191
                        else
192
                                $a_bridges[] = $bridge;
193

    
194
                        write_config();
195

    
196
			$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
197
                        if ($confif <> "")
198
                                interface_configure($confif);
199

    
200

    
201
			header("Location: interfaces_bridge.php");
202
			exit;
203
		}
204
	}
205
}
206

    
207
$pgtitle = array("Firewall","Bridge","Edit");
208
include("head.inc");
209

    
210
?>
211

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

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

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