Support obtaining FDB in Avaya SPBM edge deployments in L2::Baystack

NOTE: This requires a RAPID-CITY MIB with the rcBridgeSpbmMacTable
This commit is contained in:
Eric A. Miller
2014-10-21 23:23:20 -04:00
parent e84225fb23
commit 5f1426a0a3
3 changed files with 154 additions and 1 deletions

View File

@@ -2,6 +2,11 @@ SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
version 3.21 () version 3.21 ()
[NEW FEATURES]
* Support obtaining FDB in Avaya SPBM edge deployments in L2::Baystack
NOTE: This requires a RAPID-CITY MIB with the rcBridgeSpbmMacTable
[ENHANCEMENTS] [ENHANCEMENTS]
* No longer ignore interfaces based on name, in base L2/L3/L7 device * No longer ignore interfaces based on name, in base L2/L3/L7 device

View File

@@ -341,6 +341,52 @@ sub peth_port_ifindex {
return \%peth_port_ifindex; return \%peth_port_ifindex;
} }
# Currently only ERS 4800 v5.8+ support the rcBridgeSpbmMacTable
# which holds the FDB for a SPBM edge deployment.
#
# Q-BRIDGE still holds some entries when the rcBridgeSpbmMacTable is in use
# so we merge hash entries.
sub fw_mac {
my $rapidcity = shift;
my $qb = $rapidcity->SUPER::fw_mac() || {};
my $spbm = $rapidcity->rc_spbm_fw_mac() || {};
my $fw_mac = { %$qb, %$spbm };
return $fw_mac;
}
sub fw_port {
my $rapidcity = shift;
my $qb = $rapidcity->SUPER::fw_port() || {};
my $spbm = $rapidcity->rc_spbm_fw_port() || {};
my $fw_port = { %$qb, %$spbm };
return $fw_port;
}
sub fw_status {
my $rapidcity = shift;
my $qb = $rapidcity->SUPER::fw_status() || {};
my $spbm = $rapidcity->rc_spbm_fw_status() || {};
my $fw_status = { %$qb, %$spbm };
return $fw_status;
}
sub qb_fw_vlan {
my $rapidcity = shift;
my $qb = $rapidcity->SUPER::qb_fw_vlan() || {};
my $spbm = $rapidcity->rc_spbm_fw_vlan() || {};
my $qb_fw_vlan = { %$qb, %$spbm };
return $qb_fw_vlan;
}
1; 1;
__END__ __END__
@@ -600,6 +646,32 @@ ns_e_vendor().
=back =back
=head2 Layer 2 Forwarding Database
These methods try to obtain the layer 2 forwarding database entries via the
normal bridge methods as well as SPBM entries via rapid city methods.
=over
=item $baystack->fw_mac()
Returns reference to hash of forwarding table MAC Addresses
=item $baystack->fw_port()
Returns reference to hash of forwarding table entries port interface
identifier (iid)
=item $baystack->qb_fw_vlan()
Returns reference to hash of forwarding table entries VLAN ID
=item $baystack->fw_status()
Returns reference to hash of forwarding table entries status
=back
=head2 Table Methods imported from SNMP::Info::SONMP =head2 Table Methods imported from SNMP::Info::SONMP
See L<SNMP::Info::SONMP/"TABLE METHODS"> for details. See L<SNMP::Info::SONMP/"TABLE METHODS"> for details.

View File

@@ -1,7 +1,7 @@
# SNMP::Info::RapidCity # SNMP::Info::RapidCity
# $Id$ # $Id$
# #
# Copyright (c) 2008 Eric Miller # Copyright (c) 2014 Eric Miller
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -153,6 +153,11 @@ $VERSION = '3.20';
'rc_mlt_ports' => 'rcMltPortMembers', 'rc_mlt_ports' => 'rcMltPortMembers',
'rc_mlt_index' => 'rcMltIfIndex', 'rc_mlt_index' => 'rcMltIfIndex',
'rc_mlt_dp' => 'rcMltDesignatedPort', 'rc_mlt_dp' => 'rcMltDesignatedPort',
# From RAPID-CITY::rcBridgeSpbmMacTable
'rc_spbm_fw_port' => 'rcBridgeSpbmMacCPort',
'rc_spbm_fw_status' => 'rcBridgeSpbmMacStatus',
'rc_spbm_fw_vlan' => 'rcBridgeSpbmMacCVlanId',
); );
%MUNGE = ( %MUNGE = (
@@ -601,6 +606,40 @@ sub agg_ports {
return $ret; return $ret;
} }
# break up the rcBridgeSpbmMacEntry INDEX into ISID and MAC Address.
sub _spbm_fdbtable_index {
my $idx = shift;
my @values = split( /\./, $idx );
my $isid = shift(@values);
return ( $isid, join( ':', map { sprintf "%02x", $_ } @values ) );
}
sub rc_spbm_fw_mac {
my $rapidcity = shift;
my $partial = shift;
my $spbm_fw_ports = $rapidcity->rc_spbm_fw_port($partial);
my $spbm_fw_mac = {};
foreach my $idx ( keys %$spbm_fw_ports ) {
my ( $isid, $mac ) = _spbm_fdbtable_index($idx);
$spbm_fw_mac->{$idx} = $mac;
}
return $spbm_fw_mac;
}
sub rc_spbm_fw_isid {
my $rapidcity = shift;
my $partial = shift;
my $spbm_fw_ports = $rapidcity->rc_spbm_fw_port($partial);
my $spbm_fw_isid = {};
foreach my $idx ( keys %$spbm_fw_ports ) {
my ( $isid, $mac ) = _spbm_fdbtable_index($idx);
$spbm_fw_isid->{$idx} = $isid;
}
return $spbm_fw_isid;
}
1; 1;
__END__ __END__
@@ -1090,6 +1129,43 @@ Values are ifIndex of the corresponding master ports.
=back =back
=head2 RAPID-CITY Bridge SPBM MAC Table (C<rcBridgeSpbmMacTable>)
=over
=item $bridge->rc_spbm_fw_mac()
Returns reference to hash of forwarding table MAC Addresses
(C<rcBridgeSpbmMacAddr>)
=item $rapidcity->rc_spbm_fw_port()
Returns reference to hash of forwarding table entries port interface
identifier (iid)
(C<rcBridgeSpbmMacCPort>)
=item $rapidcity->rc_spbm_fw_status()
Returns reference to hash of forwarding table entries status
(C<rcBridgeSpbmMacStatus>)
=item $rapidcity->rc_spbm_fw_vlan()
Returns reference to hash of forwarding table entries Customer VLAN ID
(C<rcBridgeSpbmMacCVlanId>)
=item $rapidcity->rc_spbm_fw_isid()
Returns reference to hash of forwarding table entries ISID
(C<rcBridgeSpbmMacIsid>)
=back
=head1 SET METHODS =head1 SET METHODS
These are methods that provide SNMP set functionality for overridden methods These are methods that provide SNMP set functionality for overridden methods