Revision c6f8c400
Added by Renato Botelho over 12 years ago
usr/local/www/interfaces_bridge_edit.php | ||
---|---|---|
198 | 198 |
|
199 | 199 |
if ($_POST['span'] != "none") |
200 | 200 |
$bridge['span'] = $_POST['span']; |
201 |
else
|
|
201 |
else |
|
202 | 202 |
unset($bridge['span']); |
203 | 203 |
if (isset($_POST['edge'])) |
204 | 204 |
$bridge['edge'] = implode(',', $_POST['edge']); |
... | ... | |
210 | 210 |
$bridge['autoptp'] = implode(',', $_POST['autoptp']); |
211 | 211 |
|
212 | 212 |
$bridge['bridgeif'] = $_POST['bridgeif']; |
213 |
$bridge['bridgeif'] = interface_bridge_configure($bridge);
|
|
214 |
if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge"))
|
|
215 |
$input_errors[] = gettext("Error occured creating interface, please retry.");
|
|
216 |
else {
|
|
217 |
if (isset($id) && $a_bridges[$id])
|
|
218 |
$a_bridges[$id] = $bridge;
|
|
219 |
else
|
|
220 |
$a_bridges[] = $bridge;
|
|
213 |
$bridge['bridgeif'] = interface_bridge_configure($bridge);
|
|
214 |
if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge"))
|
|
215 |
$input_errors[] = gettext("Error occured creating interface, please retry.");
|
|
216 |
else {
|
|
217 |
if (isset($id) && $a_bridges[$id])
|
|
218 |
$a_bridges[$id] = $bridge;
|
|
219 |
else
|
|
220 |
$a_bridges[] = $bridge;
|
|
221 | 221 |
|
222 |
write_config();
|
|
222 |
write_config();
|
|
223 | 223 |
|
224 | 224 |
$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']); |
225 |
if ($confif <> "") |
|
226 |
interface_configure($confif); |
|
227 |
|
|
225 |
if ($confif <> "") |
|
226 |
interface_configure($confif); |
|
228 | 227 |
|
229 | 228 |
header("Location: interfaces_bridge.php"); |
230 | 229 |
exit; |
... | ... | |
267 | 266 |
<td width="78%" class="vtable"> |
268 | 267 |
<select name="members[]" multiple="true" class="formselect" size="3"> |
269 | 268 |
<?php |
270 |
foreach ($ifacelist as $ifn => $ifinfo) {
|
|
269 |
foreach ($ifacelist as $ifn => $ifinfo) { |
|
271 | 270 |
echo "<option value=\"{$ifn}\""; |
272 | 271 |
if (stristr($pconfig['members'], $ifn)) |
273 | 272 |
echo "selected"; |
274 | 273 |
echo ">{$ifinfo}</option>"; |
275 | 274 |
} |
276 |
?>
|
|
275 |
?> |
|
277 | 276 |
</select> |
278 | 277 |
<br/> |
279 | 278 |
<span class="vexpl"><?=gettext("Interfaces participating in the bridge."); ?></span> |
... | ... | |
283 | 282 |
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> |
284 | 283 |
<td width="78%" class="vtable"> |
285 | 284 |
<input type="text" name="descr" id="descr" class="formfld unknown" size="50" value="<?=htmlspecialchars($pconfig['descr']);?>"> |
286 |
</td>
|
|
285 |
</td> |
|
287 | 286 |
</tr> |
288 | 287 |
<tr id="sprtable" name="sprtable"> |
289 | 288 |
<td></td> |
... | ... | |
297 | 296 |
<input type="checkbox" name="enablestp" id="enablestp" <?php if ($pconfig['enablestp']) echo "checked";?>> |
298 | 297 |
<span class="vexpl"><strong><?=gettext("Enable spanning tree options for this bridge."); ?> </strong></span> |
299 | 298 |
<br/><br/> |
300 |
<table id="stpoptions" name="stpoptions" border="0" cellpadding="6" cellspacing="0">
|
|
299 |
<table id="stpoptions" name="stpoptions" border="0" cellpadding="6" cellspacing="0"> |
|
301 | 300 |
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Protocol"); ?></td> |
302 | 301 |
<td class="vtable" width="80%"> |
303 |
<select name="proto" id="proto">
|
|
304 |
<?php
|
|
302 |
<select name="proto" id="proto"> |
|
303 |
<?php |
|
305 | 304 |
foreach (array("rstp", "stp") as $proto) { |
306 | 305 |
echo "<option value=\"{$proto}\""; |
307 | 306 |
if ($pconfig['proto'] == $proto) |
... | ... | |
315 | 314 |
</td></tr> |
316 | 315 |
<tr> <td valign="top" class="vncell" width="20%"><?=gettext("STP interfaces"); ?></td> |
317 | 316 |
<td class="vtable" width="80%"> |
318 |
<select name="stp[]" class="formselect" multiple="true" size="3">
|
|
319 |
<?php
|
|
317 |
<select name="stp[]" class="formselect" multiple="true" size="3"> |
|
318 |
<?php |
|
320 | 319 |
foreach ($ifacelist as $ifn => $ifdescr) { |
321 | 320 |
echo "<option value=\"{$ifn}\""; |
322 | 321 |
if (stristr($pconfig['stp'], $ifn)) |
... | ... | |
349 | 348 |
<br/> |
350 | 349 |
<span class="vexpl"> |
351 | 350 |
<?=gettext("Set the time that must pass before an interface begins forwarding " . |
352 |
"packets when Spanning Tree is enabled. The default is 15 seconds. The minimum is 4 seconds and the maximum is 30 seconds."); ?>
|
|
351 |
"packets when Spanning Tree is enabled. The default is 15 seconds. The minimum is 4 seconds and the maximum is 30 seconds."); ?> |
|
353 | 352 |
</span> |
354 | 353 |
</td></tr> |
355 | 354 |
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hello time"); ?></td> |
... | ... | |
358 | 357 |
<br/> |
359 | 358 |
<span class="vexpl"> |
360 | 359 |
<?=gettext("Set the time between broadcasting of Spanning Tree Protocol configuration messages. The hello time may only be changed when " . |
361 |
"operating in legacy STP mode. The default is 2 seconds. The minimum is 1 second and the maximum is 2 seconds."); ?>
|
|
360 |
"operating in legacy STP mode. The default is 2 seconds. The minimum is 1 second and the maximum is 2 seconds."); ?> |
|
362 | 361 |
</span> |
363 | 362 |
</td></tr> |
364 | 363 |
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td> |
... | ... | |
367 | 366 |
<br/> |
368 | 367 |
<span class="vexpl"> |
369 | 368 |
<?=gettext("Set the bridge priority for Spanning Tree. The default is 32768. " . |
370 |
"The minimum is 0 and the maximum is 61440."); ?>
|
|
369 |
"The minimum is 0 and the maximum is 61440."); ?> |
|
371 | 370 |
</span> |
372 | 371 |
</td></tr> |
373 | 372 |
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hold count"); ?></td> |
... | ... | |
377 | 376 |
<span class="vexpl"> |
378 | 377 |
<?=gettext("Set the transmit hold count for Spanning Tree. This is the num- " . |
379 | 378 |
"ber of packets transmitted before being rate limited. The " . |
380 |
"default is 6. The minimum is 1 and the maximum is 10."); ?>
|
|
379 |
"default is 6. The minimum is 1 and the maximum is 10."); ?> |
|
381 | 380 |
</span> |
382 | 381 |
</td></tr> |
383 | 382 |
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td> |
384 | 383 |
<td class="vtable" width="80%"> |
385 | 384 |
<table> |
386 |
<?php foreach ($ifacelist as $ifn => $ifdescr)
|
|
385 |
<?php foreach ($ifacelist as $ifn => $ifdescr) |
|
387 | 386 |
echo "<tr><td>{$ifdescr}</td><td><input size=\"5\" name=\"{$ifn}\" type=\"text\" class=\"formfld unkown\" id=\"{$ifn}\" value=\"{$ifpriority[$ifn]}\"></td></tr>"; |
388 | 387 |
?> |
389 | 388 |
</table> |
390 | 389 |
<br/> |
391 |
<span class="vexpl" >
|
|
390 |
<span class="vexpl" > |
|
392 | 391 |
<?=gettext("Set the Spanning Tree priority of interface to value. The " . |
393 |
"default is 128. The minimum is 0 and the maximum is 240. Increments of 16."); ?>
|
|
392 |
"default is 128. The minimum is 0 and the maximum is 240. Increments of 16."); ?> |
|
394 | 393 |
</span> |
395 | 394 |
</td></tr> |
396 | 395 |
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Path cost"); ?></td> |
... | ... | |
401 | 400 |
?> |
402 | 401 |
</table> |
403 | 402 |
<br/> |
404 |
<span class="vexpl" >
|
|
403 |
<span class="vexpl" > |
|
405 | 404 |
<?=gettext("Set the Spanning Tree path cost of interface to value. The " . |
406 | 405 |
"default is calculated from the link speed. To change a previously selected path cost back to automatic, set the cost to 0. ". |
407 |
"The minimum is 1 and the maximum is 200000000."); ?>
|
|
406 |
"The minimum is 1 and the maximum is 200000000."); ?> |
|
408 | 407 |
</span> |
409 | 408 |
</td></tr> |
410 | 409 |
|
... | ... | |
414 | 413 |
<td valign="top" class="vncell"><?=gettext("Cache size"); ?></td> |
415 | 414 |
<td class="vtable"> |
416 | 415 |
<input name="maxaddr" size="10" type="text" class="formfld unkown" id="maxaddr" value="<?=htmlspecialchars($pconfig['maxaddr']);?>"> <?=gettext("entries"); ?> |
417 |
<br/><span class="vexpl">
|
|
416 |
<br/><span class="vexpl"> |
|
418 | 417 |
<?=gettext("Set the size of the bridge address cache to size. The default is " . |
419 | 418 |
".100 entries."); ?> |
420 |
</span>
|
|
419 |
</span> |
|
421 | 420 |
</td> |
422 | 421 |
</tr> |
423 | 422 |
<tr style="display:none" id="sprtable3" name="sprtable3"> |
424 | 423 |
<td valign="top" class="vncell"><?=gettext("Cache entry expire time"); ?></td> |
425 | 424 |
<td> |
426 | 425 |
<input name="timeout" type="text" class="formfld unkown" id="timeout" size="10" value="<?=htmlspecialchars($pconfig['timeout']);?>"> <?=gettext("seconds"); ?> |
427 |
<br/><span class="vexpl">
|
|
426 |
<br/><span class="vexpl"> |
|
428 | 427 |
<?=gettext("Set the timeout of address cache entries to this number of seconds. If " . |
429 | 428 |
"seconds is zero, then address cache entries will not be expired. " . |
430 | 429 |
"The default is 240 seconds."); ?> |
431 |
</span>
|
|
430 |
</span> |
|
432 | 431 |
</td> |
433 | 432 |
</tr> |
434 | 433 |
<tr style="display:none" id="sprtable4" name="sprtable4"> |
... | ... | |
436 | 435 |
<td class="vtable"> |
437 | 436 |
<select name="span" class="formselect" id="span"> |
438 | 437 |
<option value="none" selected><?=gettext("None"); ?></option> |
439 |
<?php
|
|
438 |
<?php |
|
440 | 439 |
foreach ($ifacelist as $ifn => $ifdescr) { |
441 | 440 |
echo "<option value=\"{$ifn}\""; |
442 | 441 |
if ($ifn == $pconfig['span']) |
... | ... | |
445 | 444 |
} |
446 | 445 |
?> |
447 | 446 |
</select> |
448 |
<br/><span class="vexpl">
|
|
447 |
<br/><span class="vexpl"> |
|
449 | 448 |
<?=gettext("Add the interface named by interface as a span port on the " . |
450 | 449 |
"bridge. Span ports transmit a copy of every frame received by " . |
451 | 450 |
"the bridge. This is most useful for snooping a bridged network " . |
452 | 451 |
"passively on another host connected to one of the span ports of " . |
453 |
"the bridge."); ?>
|
|
452 |
"the bridge."); ?> |
|
454 | 453 |
</span> |
455 | 454 |
<p class="vexpl"><span class="red"><strong> |
456 | 455 |
<?=gettext("Note:"); ?><br> |
... | ... | |
462 | 461 |
<tr style="display:none" id="sprtable5" name="sprtable5"> |
463 | 462 |
<td valign="top" class="vncell"><?=gettext("Edge ports"); ?></td> |
464 | 463 |
<td class="vtable"> |
465 |
<select name="edge[]" class="formselect" multiple="true" size="3">
|
|
466 |
<?php
|
|
464 |
<select name="edge[]" class="formselect" multiple="true" size="3"> |
|
465 |
<?php |
|
467 | 466 |
foreach ($ifacelist as $ifn => $ifdescr) { |
468 | 467 |
echo "<option value=\"{$ifn}\""; |
469 | 468 |
if (stristr($pconfig['edge'], $ifn)) |
... | ... | |
476 | 475 |
<span class="vexpl"> |
477 | 476 |
<?=gettext("Set interface as an edge port. An edge port connects directly to " . |
478 | 477 |
"end stations and cannot create bridging loops in the network; this " . |
479 |
"allows it to transition straight to forwarding."); ?>
|
|
478 |
"allows it to transition straight to forwarding."); ?> |
|
480 | 479 |
</span></td> |
481 | 480 |
</tr> |
482 | 481 |
<tr style="display:none" id="sprtable6" name="sprtable6"> |
483 | 482 |
<td valign="top" class="vncell"><?=gettext("Auto Edge ports"); ?></td> |
484 | 483 |
<td class="vtable"> |
485 |
<select name="autoedge[]" class="formselect" multiple="true" size="3">
|
|
486 |
<?php
|
|
484 |
<select name="autoedge[]" class="formselect" multiple="true" size="3"> |
|
485 |
<?php |
|
487 | 486 |
foreach ($ifacelist as $ifn => $ifdescr) { |
488 | 487 |
echo "<option value=\"{$ifn}\""; |
489 | 488 |
if (stristr($pconfig['autoedge'], $ifn)) |
... | ... | |
505 | 504 |
<tr style="display:none" id="sprtable7" name="sprtable7"> |
506 | 505 |
<td valign="top" class="vncell"><?=gettext("PTP ports"); ?></td> |
507 | 506 |
<td class="vtable"> |
508 |
<select name="ptp[]" class="formselect" multiple="true" size="3">
|
|
509 |
<?php
|
|
507 |
<select name="ptp[]" class="formselect" multiple="true" size="3"> |
|
508 |
<?php |
|
510 | 509 |
foreach ($ifacelist as $ifn => $ifdescr) { |
511 | 510 |
echo "<option value=\"{$ifn}\""; |
512 | 511 |
if (stristr($pconfig['ptp'], $ifn)) |
... | ... | |
525 | 524 |
<tr style="display:none" id="sprtable8" name="sprtable8"> |
526 | 525 |
<td valign="top" class="vncell"><?=gettext("Auto PTP ports"); ?></td> |
527 | 526 |
<td class="vtable"> |
528 |
<select name="autoptp[]" class="formselect" multiple="true" size="3">
|
|
529 |
<?php
|
|
527 |
<select name="autoptp[]" class="formselect" multiple="true" size="3"> |
|
528 |
<?php |
|
530 | 529 |
foreach ($ifacelist as $ifn => $ifdescr) { |
531 | 530 |
echo "<option value=\"{$ifn}\""; |
532 | 531 |
if (stristr($pconfig['autoptp'], $ifn)) |
... | ... | |
540 | 539 |
<?=gettext("Automatically detect the point-to-point status on interface by " . |
541 | 540 |
"checking the full duplex link status. This is the default for " . |
542 | 541 |
"interfaces added to the bridge."); ?> |
543 |
<p class="vexpl"><span class="red"><strong>
|
|
542 |
<p class="vexpl"><span class="red"><strong> |
|
544 | 543 |
<?=gettext("Note:"); ?><br> |
545 | 544 |
</strong></span> |
546 | 545 |
<?=gettext("The interfaces selected here will be removed from default autoedge status."); ?> |
... | ... | |
549 | 548 |
<tr style="display:none" id="sprtable9" name="sprtable9"> |
550 | 549 |
<td valign="top" class="vncell"><?=gettext("Sticky ports"); ?></td> |
551 | 550 |
<td class="vtable"> |
552 |
<select name="static[]" class="formselect" multiple="true" size="3">
|
|
553 |
<?php
|
|
551 |
<select name="static[]" class="formselect" multiple="true" size="3"> |
|
552 |
<?php |
|
554 | 553 |
foreach ($ifacelist as $ifn => $ifdescr) { |
555 | 554 |
echo "<option value=\"{$ifn}\""; |
556 | 555 |
if (stristr($pconfig['static'], $ifn)) |
... | ... | |
564 | 563 |
<?=gettext("Mark an interface as a \"sticky\" interface. Dynamically learned " . |
565 | 564 |
"address entries are treated as static once entered into the " . |
566 | 565 |
"cache. Sticky entries are never aged out of the cache or " . |
567 |
"replaced, even if the address is seen on a different interface."); ?>
|
|
566 |
"replaced, even if the address is seen on a different interface."); ?> |
|
568 | 567 |
</span></td> |
569 | 568 |
</tr> |
570 | 569 |
<tr style="display:none" id="sprtable10" name="sprtable10"> |
571 | 570 |
<td valign="top" class="vncell"><?=gettext("Private ports"); ?></td> |
572 | 571 |
<td class="vtable"> |
573 |
<select name="private[]" class="formselect" multiple="true" size="3">
|
|
574 |
<?php
|
|
572 |
<select name="private[]" class="formselect" multiple="true" size="3"> |
|
573 |
<?php |
|
575 | 574 |
foreach ($ifacelist as $ifn => $ifdescr) { |
576 | 575 |
echo "<option value=\"{$ifn}\""; |
577 | 576 |
if (stristr($pconfig['private'], $ifn)) |
Also available in: Unified diff
Fix indent and remove extra whitespaces between tabs and at EOL