From ab08aa1de199d50a94dc77e1a9e1c23721d80be6 Mon Sep 17 00:00:00 2001 From: Eric Miller <> Date: Tue, 26 Jun 2007 01:35:17 +0000 Subject: [PATCH] Some devices have issues with BRIDGE-MIB (duplicates and non-increasing oids). Use Q-BRIDGE-MIB for macsuck. --- Info/Layer3/Enterasys.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Info/Layer3/Enterasys.pm b/Info/Layer3/Enterasys.pm index 82d8d5e4..a25abcd6 100644 --- a/Info/Layer3/Enterasys.pm +++ b/Info/Layer3/Enterasys.pm @@ -64,6 +64,9 @@ $VERSION = '1.05'; %SNMP::Info::CDP::FUNCS, %SNMP::Info::LLDP::FUNCS, %SNMP::Info::MAU::FUNCS, + # Normal BRIDGE-MIB has issues on some devices, duplicates and + # non-increasing oids, Use Q-BRIDGE-MIB for macsuck + 'fw_port' => 'dot1qTpFdbPort', ); %MUNGE = ( @@ -150,6 +153,27 @@ sub i_duplex_admin { return $enterasys->mau_i_duplex_admin($partial); } +# dot1qTpFdbAddress doesn't return values but is used as the index for the table +# so extract mac from index of dot1qTpFdbPort +sub fw_mac { + my $enterasys = shift; + + my $enterasys_fw_port = $enterasys->fw_port(); + + my %fw_mac; + foreach my $iid (keys %$enterasys_fw_port){ + # iid is dot1qFdbId.dot1qTpFdbAddress so strip dot1qFdbId + my $mac = $iid; + $mac =~ s/^\d+\.//; + # Convert the remaining 0.254.123.456 index entry to a MAC address. + $mac = join(':',map {sprintf("%02x",$_)} split(/\./,$mac)); + next unless defined $mac; + + $fw_mac{$iid}=$mac; + } + return \%fw_mac; +} + # Use CDP and/or LLDP sub hasCDP {