Remove custom ipNetToMediaTable implementations, and inherit them
from Layer3.pm Use orig_foo() instead of custom versions Rename 'serial' to 'serial1' so Layer3.pm's serial() sub will use it
This commit is contained in:
@@ -35,15 +35,17 @@ use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::Bridge;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE /;
|
||||
|
||||
@SNMP::Info::Layer3::AlteonAD::ISA = qw/SNMP::Info SNMP::Info::Bridge Exporter/;
|
||||
@SNMP::Info::Layer3::AlteonAD::ISA = qw/SNMP::Info SNMP::Info::Layer3 SNMP::Info::Bridge Exporter/;
|
||||
@SNMP::Info::Layer3::AlteonAD::EXPORT_OK = qw//;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
'ALTEON-TIGON-SWITCH-MIB' => 'agSoftwareVersion',
|
||||
'ALTEON-TS-PHYSICAL-MIB' => 'agPortTableMaxEnt',
|
||||
@@ -52,6 +54,7 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE /;
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
'sw_ver' => 'agSoftwareVersion',
|
||||
'tftp_action' => 'agTftpAction',
|
||||
@@ -62,13 +65,8 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE /;
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
'bp_index_2' => 'dot1dBasePortIfIndex',
|
||||
'i_name2' => 'ifName',
|
||||
# From RFC1213-MIB
|
||||
'at_index' => 'ipNetToMediaIfIndex',
|
||||
'at_paddr' => 'ipNetToMediaPhysAddress',
|
||||
'at_netaddr' => 'ipNetToMediaNetAddress',
|
||||
# From agPortCurCfgTable
|
||||
'ag_p_cfg_idx' => 'agPortCurCfgIndx',
|
||||
'ag_p_cfg_pref' => 'agPortCurCfgPrefLink',
|
||||
@@ -86,8 +84,8 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE /;
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::MUNGE,
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::Bridge::MUNGE,
|
||||
'at_paddr' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
sub model {
|
||||
@@ -236,7 +234,7 @@ sub i_name {
|
||||
# Bridge MIB does not map Bridge Port to ifIndex correctly
|
||||
sub bp_index {
|
||||
my $alteon = shift;
|
||||
my $b_index = $alteon->bp_index_2();
|
||||
my $b_index = $alteon->orig_bp_index();
|
||||
|
||||
my %bp_index;
|
||||
foreach my $iid (keys %$b_index){
|
||||
@@ -409,30 +407,6 @@ Returns a mapping between ifIndex and the Bridge Table.
|
||||
|
||||
=back
|
||||
|
||||
=head2 RFC1213 Arp Cache Table (B<ipNetToMediaTable>)
|
||||
|
||||
=over
|
||||
|
||||
=item $alteon->at_index()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to Interface IIDs
|
||||
|
||||
(B<ipNetToMediaIfIndex>)
|
||||
|
||||
=item $alteon->at_paddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to MAC addresses.
|
||||
|
||||
(B<ipNetToMediaPhysAddress>)
|
||||
|
||||
=item $alteon->at_netaddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to IPs
|
||||
|
||||
(B<ipNetToMediaNetAddress>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
|
||||
@@ -35,15 +35,17 @@ use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::Bridge;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE %MODEL_MAP/;
|
||||
|
||||
@SNMP::Info::Layer3::BayRS::ISA = qw/SNMP::Info SNMP::Info::Bridge Exporter/;
|
||||
@SNMP::Info::Layer3::BayRS::ISA = qw/SNMP::Info SNMP::Info::Layer3 SNMP::Info::Bridge Exporter/;
|
||||
@SNMP::Info::Layer3::BayRS::EXPORT_OK = qw//;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
'Wellfleet-HARDWARE-MIB' => 'wfHwBpIdOpt',
|
||||
'Wellfleet-OSPF-MIB' => 'wfOspfRouterId',
|
||||
@@ -53,6 +55,7 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE %MODEL_MAP/;
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
'bp_id' => 'wfHwBpIdOpt',
|
||||
'bp_serial' => 'wfHwBpSerialNumber',
|
||||
@@ -61,12 +64,8 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE %MODEL_MAP/;
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
'i_name2' => 'ifName',
|
||||
# From RFC1213-MIB
|
||||
'at_index' => 'ipNetToMediaIfIndex',
|
||||
'at_paddr' => 'ipNetToMediaPhysAddress',
|
||||
'at_netaddr' => 'ipNetToMediaNetAddress',
|
||||
# From Wellfleet-CSMACD-MIB::wfCSMACDTable
|
||||
'wf_csmacd_cct' => 'wfCSMACDCct',
|
||||
'wf_csmacd_slot' => 'wfCSMACDSlot',
|
||||
@@ -97,8 +96,8 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE %MODEL_MAP/;
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::MUNGE,
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::Bridge::MUNGE,
|
||||
'at_paddr' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
%MODEL_MAP = (
|
||||
@@ -494,34 +493,14 @@ Returns reference to hash. Maps port VLAN ID to IIDs.
|
||||
|
||||
=back
|
||||
|
||||
=head2 RFC1213 Arp Cache Table (B<ipNetToMediaTable>)
|
||||
|
||||
=over
|
||||
|
||||
=item $bayrs->at_index()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to Interface IIDs
|
||||
|
||||
(B<ipNetToMediaIfIndex>)
|
||||
|
||||
=item $bayrs->at_paddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to MAC addresses.
|
||||
|
||||
(B<ipNetToMediaPhysAddress>)
|
||||
|
||||
=item $bayrs->at_netaddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to IPs
|
||||
|
||||
(B<ipNetToMediaNetAddress>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Bridge
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
@@ -35,37 +35,36 @@ use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::Entity;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
|
||||
@SNMP::Info::Layer3::Contivity::ISA = qw/SNMP::Info SNMP::Info::Entity Exporter/;
|
||||
@SNMP::Info::Layer3::Contivity::ISA = qw/SNMP::Info SNMP::Info::Layer3 SNMP::Info::Entity Exporter/;
|
||||
@SNMP::Info::Layer3::Contivity::EXPORT_OK = qw//;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::Entity::MIBS,
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::Entity::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::Entity::FUNCS,
|
||||
'i_name2' => 'ifName',
|
||||
# From RFC1213-MIB
|
||||
'at_index' => 'ipNetToMediaIfIndex',
|
||||
'at_paddr' => 'ipNetToMediaPhysAddress',
|
||||
'at_netaddr' => 'ipNetToMediaNetAddress',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::MUNGE,
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::Entity::MUNGE,
|
||||
'at_paddr' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
sub layers {
|
||||
@@ -142,7 +141,7 @@ sub interfaces {
|
||||
|
||||
sub i_name {
|
||||
my $contivity = shift;
|
||||
my $i_name2 = $contivity->i_name2();
|
||||
my $i_name2 = $contivity->orig_i_name();
|
||||
|
||||
my %i_name;
|
||||
foreach my $iid (keys %$i_name2){
|
||||
@@ -200,6 +199,8 @@ a more specific class using the method above.
|
||||
|
||||
=item SNMP::Info
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=item SNMP::Info::Entity
|
||||
|
||||
=back
|
||||
@@ -212,6 +213,8 @@ a more specific class using the method above.
|
||||
|
||||
See SNMP::Info for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::Layer3 for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::Entity for its own MIB requirements.
|
||||
|
||||
=back
|
||||
@@ -267,6 +270,10 @@ layers.
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Entity
|
||||
|
||||
See documentation in SNMP::Info::Entity for details.
|
||||
@@ -287,34 +294,14 @@ tunnel interfaces.
|
||||
|
||||
=back
|
||||
|
||||
=head2 RFC1213 Arp Cache Table (B<ipNetToMediaTable>)
|
||||
|
||||
=over
|
||||
|
||||
=item $contivity->at_index()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to Interface IIDs
|
||||
|
||||
(B<ipNetToMediaIfIndex>)
|
||||
|
||||
=item $contivity->at_paddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to MAC addresses.
|
||||
|
||||
(B<ipNetToMediaPhysAddress>)
|
||||
|
||||
=item $contivity->at_netaddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to IPs
|
||||
|
||||
(B<ipNetToMediaNetAddress>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Entity
|
||||
|
||||
See documentation in SNMP::Info::Entity for details.
|
||||
|
||||
@@ -61,7 +61,7 @@ $VERSION = '1.04';
|
||||
%SNMP::Info::FDP::GLOBALS,
|
||||
'mac' => 'ifPhysAddress.1',
|
||||
'chassis' => 'entPhysicalDescr.1',
|
||||
'serial' => 'snChasSerNum',
|
||||
'serial1' => 'snChasSerNum',
|
||||
'temp' => 'snChasActualTemperature',
|
||||
'ps1_type' => 'snChasPwrSupplyDescription.1',
|
||||
'ps1_status' => 'snChasPwrSupplyOperStatus.1',
|
||||
@@ -89,7 +89,6 @@ $VERSION = '1.04';
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::FDP::MUNGE,
|
||||
'at_paddr' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
|
||||
@@ -422,30 +421,6 @@ does a little munging.
|
||||
|
||||
=back
|
||||
|
||||
=head2 RFC1213 Arp Cache Table (B<ipNetToMediaTable>)
|
||||
|
||||
=over
|
||||
|
||||
=item $foundry->at_index()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to Interface IIDs
|
||||
|
||||
(B<ipNetToMediaIfIndex>)
|
||||
|
||||
=item $foundry->at_paddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to MAC addresses.
|
||||
|
||||
(B<ipNetToMediaPhysAddress>)
|
||||
|
||||
=item $foundry->at_netaddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to IPs
|
||||
|
||||
(B<ipNetToMediaNetAddress>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Foundry Switch Port Information Table (B<snSwPortIfTable>)
|
||||
|
||||
=over
|
||||
|
||||
Reference in New Issue
Block a user