From 40caf6cc0e8dd4e3d1ffdb5ae619325f83eaedc6 Mon Sep 17 00:00:00 2001 From: Eric Miller <> Date: Sat, 18 Feb 2006 03:49:55 +0000 Subject: [PATCH] use CISCO-STACK-MIB for bridge port mapping rather than BRIDGE-MIB due to some devices not returning complete index --- Info/Layer2/Catalyst.pm | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Info/Layer2/Catalyst.pm b/Info/Layer2/Catalyst.pm index 3a05dc02..c13dbc13 100644 --- a/Info/Layer2/Catalyst.pm +++ b/Info/Layer2/Catalyst.pm @@ -122,6 +122,23 @@ sub os_ver { return undef; } +# Workaround for incomplete bp_index +sub bp_index { + my $cat = shift; + my $p_index = $cat->p_port(); + my $b_index = $cat->p_oidx(); + + my %bp_index; + foreach my $iid (keys %$p_index){ + my $ifidx = $p_index->{$iid}; + next unless defined $ifidx; + my $bpidx = $b_index->{$iid}||0; + + $bp_index{$bpidx} = $ifidx; + } + return \%bp_index; +} + sub cisco_comm_indexing { 1; } @@ -240,6 +257,19 @@ See documentation in SNMP::Info::CiscoStack for details. These are methods that return tables of information in the form of a reference to a hash. +=head2 Overrides + +=over + +=item $cat->bp_index() + +Returns reference to hash of bridge port table entries map back to interface identifier (iid) + +Crosses (B) to (B) since some devices seem to have +problems with BRIDGE-MIB + +=back + =head2 Table Methods imported from SNMP::Info::CiscoVTP See documentation in SNMP::Info::CiscoVTP for details. @@ -248,7 +278,7 @@ See documentation in SNMP::Info::CiscoVTP for details. See documentation in SNMP::Info::Layer2 for details. -=head2 Table Methods imported from SNMP::Info::Layer2::CiscoSTack +=head2 Table Methods imported from SNMP::Info::Layer2::CiscoStack See documentation in SNMP::Info::Layer2::CiscoStack for details.