diff --git a/ChangeLog b/ChangeLog index afac78e1..fe6e0b9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,12 @@ SNMP::Info - Friendly OO-style interface to Network devices using SNMP. version 3.12 + [ENHANCEMENTS] + + * Modify L3::Passport to obtain forwarding table information from + RAPID-CITY if information is not available in either Q-BRIDGE-MIB or + BRIDGE-MIB. Needed for VSP 9000 prior to version 4.x (Tobias Gerlach) + [BUG FIXES] * [#52] NETSCREEN-IP-ARP-MIB considered harmful diff --git a/Info/Layer3/Passport.pm b/Info/Layer3/Passport.pm index 6cbc2700..a300bf95 100644 --- a/Info/Layer3/Passport.pm +++ b/Info/Layer3/Passport.pm @@ -612,6 +612,69 @@ sub bp_index { return \%bp_index; } +# We have devices which support BRIDGE-MIB, Q-BRIDGE-MIB, and RAPID-CITY +# exclusively. Use standards-based first and fall back to RAPID-CITY. +sub fw_mac { + my $passport = shift; + my $partial = shift; + + my $qb = $passport->SUPER::fw_mac($partial); + return $qb if (ref {} eq ref $qb and scalar keys %$qb); + + my $qb_fw_port = $passport->rcBridgeTpFdbPort($partial); + my $qb_fw_mac = {}; + foreach my $idx ( keys %$qb_fw_port ) { + my ( $fdb_id, $mac ) = _rc_fdbtable_index($idx); + $qb_fw_mac->{$idx} = $mac; + } + return $qb_fw_mac; +} + +sub fw_port { + my $passport = shift; + my $partial = shift; + + my $qb = $passport->SUPER::fw_port($partial); + return $qb if (ref {} eq ref $qb and scalar keys %$qb); + + return $passport->rcBridgeTpFdbPort($partial); +} + +sub fw_status { + my $passport = shift; + my $partial = shift; + + my $qb = $passport->SUPER::fw_status($partial); + return $qb if (ref {} eq ref $qb and scalar keys %$qb); + + return $passport->rcBridgeTpFdbStatus($partial); +} + +sub qb_fw_vlan { + my $passport = shift; + my $partial = shift; + + my $qb = $passport->SUPER::qb_fw_vlan($partial); + return $qb if (ref {} eq ref $qb and scalar keys %$qb); + + my $qb_fw_port = $passport->rcBridgeTpFdbPort($partial); + my $qb_fw_vlan = {}; + foreach my $idx ( keys %$qb_fw_port ) { + my ( $fdb_id, $mac ) = _rc_fdbtable_index($idx); + $qb_fw_vlan->{$idx} = $fdb_id; + } + return $qb_fw_vlan; +} + +# break up the rcBridgeTpFdbEntry INDEX into FDB ID and MAC Address. +sub _rc_fdbtable_index { + my $idx = shift; + my @values = split( /\./, $idx ); + my $fdb_id = shift(@values); + return ( $fdb_id, join( ':', map { sprintf "%02x", $_ } @values ) ); +} + + # Pseudo ENTITY-MIB methods sub e_index { @@ -1266,6 +1329,40 @@ problems with F =back +=head2 Forwarding Table + +These methods utilize, in order; F, F, and +F to obtain the forwarding table information. + +=over + +=item $passport->fw_mac() + +Returns reference to hash of forwarding table MAC Addresses + +(C), (C), (C) + +=item $passport->fw_port() + +Returns reference to hash of forwarding table entries port interface +identifier (iid) + +(C), (C), (C) + +=item $passport->fw_status() + +Returns reference to hash of forwarding table entries status + +(C), (C), (C) + +=item $passport->qb_fw_vlan() + +Returns reference to hash of forwarding table entries VLAN ID + +(C), (C) + +=back + =head2 Pseudo F information These devices do not support F. These methods emulate Physical