mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Refactor MAC utilities into a single class (#15379)
* Refactor MAC utils to a new utility class * Apply fixes from StyleCI * Inline functions Add tests Handle bridgeid format * Apply fixes from StyleCI * Dedicated code path for stp bridge parsing, and improve STP output a bit * Correctly parse dot1dBaseBridgeAddress and don't store int in bool field * trim any unexpected character from bridge addresses, add extra test data. * better comment * barsBridge can handle dot1dBaseBridgeAddress correctly now * parseBridge, check for properly formatted mac first. * update test data, empty data = empty mac * Fix new usage after rebase * import --------- Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Util\Mac;
|
||||
|
||||
// FIXME - REWRITE!
|
||||
$hostname = $device['hostname'];
|
||||
@@ -186,7 +187,7 @@ if ($vars['subview'] == 'top10') {
|
||||
echo '
|
||||
<table>
|
||||
<tr>
|
||||
<td class=list-large width=200>' . \LibreNMS\Util\Rewrite::readableMac($acc['mac']) . '</td>
|
||||
<td class=list-large width=200>' . Mac::parse($acc['mac'])->readable() . '</td>
|
||||
<td class=list-large width=200>' . $addy['ipv4_address'] . '</td>
|
||||
<td class=list-large width=500>' . $name . ' ' . $arp_name . '</td>
|
||||
<td class=list-large width=100>' . \LibreNMS\Util\Number::formatSi($acc['cipMacHCSwitchedBytes_input_rate'] / 8, 2, 3, 'bps') . '</td>
|
||||
|
Reference in New Issue
Block a user