brought this thing back to life

This commit is contained in:
Max Baker
2005-02-17 01:31:49 +00:00
parent 2b42f25d1e
commit 6685e4dd77

View File

@@ -30,25 +30,25 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Foundry;
$VERSION = 1.0;
# $Id$
use strict;
use Exporter;
use SNMP::Info;
use SNMP::Info::Bridge;
use SNMP::Info::Layer3;
use SNMP::Info::FDP;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
@SNMP::Info::Layer3::Foundry::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::FDP Exporter/;
$VERSION = 1.0;
@SNMP::Info::Layer3::Foundry::ISA = qw/SNMP::Info::Layer3 SNMP::Info::FDP Exporter/;
@SNMP::Info::Layer3::Foundry::EXPORT_OK = qw//;
%MIBS = ( %SNMP::Info::MIBS,
%SNMP::Info::Bridge::MIBS,
%MIBS = ( %SNMP::Info::Layer3::MIBS,
%SNMP::Info::FDP::MIBS,
'FOUNDRY-SN-ROOT-MIB' => 'foundry',
'FOUNDRY-SN-AGENT-MIB' => 'snChasPwrSupplyDescription',
# IP-FORWARD-MIB
# ETHERLIKE-MIB
# RFC1398-MIB
@@ -57,9 +57,7 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
);
%GLOBALS = (
# Inherit the super class ones
%SNMP::Info::GLOBALS,
%SNMP::Info::Bridge::GLOBALS,
%SNMP::Info::Layer3::GLOBALS,
%SNMP::Info::FDP::GLOBALS,
'mac' => 'ifPhysAddress.1',
'chassis' => 'entPhysicalDescr.1',
@@ -76,14 +74,9 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
);
%FUNCS = (
%SNMP::Info::FUNCS,
%SNMP::Info::Bridge::FUNCS,
%SNMP::Info::Layer3::FUNCS,
%SNMP::Info::FDP::FUNCS,
'i_name2' => 'ifName',
# From RFC1213-MIB
'at_index' => 'ipNetToMediaIfIndex',
'at_paddr' => 'ipNetToMediaPhysAddress',
'at_netaddr' => 'ipNetToMediaNetAddress',
# FOUNDRY-MIB
# snSwPortInfoTable - Switch Port Information Group
'sw_index' => 'snSwPortIfIndex',
@@ -94,8 +87,7 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
%MUNGE = (
# Inherit all the built in munging
%SNMP::Info::MUNGE,
%SNMP::Info::Bridge::MUNGE,
%SNMP::Info::Layer3::MUNGE,
%SNMP::Info::FDP::MUNGE,
'at_paddr' => \&SNMP::Info::munge_mac,
);
@@ -103,6 +95,8 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
# Method OverRides
sub bulkwalk_no { 1; }
# Add our i_aliases if they are set (manually)
sub i_name {
my $foundry = shift;
@@ -141,6 +135,10 @@ sub i_duplex {
my $sw_index = $foundry->sw_index();
my $sw_duplex= $foundry->sw_duplex();
unless (defined $sw_index and defined $sw_duplex){
return $foundry->SUPER::i_duplex();
}
my %i_duplex;
foreach my $sw_port (keys %$sw_duplex){
my $iid = $sw_index->{$sw_port};
@@ -157,6 +155,10 @@ sub i_type {
my $sw_index = $foundry->sw_index();
my $sw_type= $foundry->sw_type();
unless (defined $sw_index and defined $sw_type){
return $foundry->SUPER::i_type();
}
my %i_type;
foreach my $sw_port (keys %$sw_type){
my $iid = $sw_index->{$sw_port};
@@ -172,6 +174,10 @@ sub i_speed {
my $sw_index = $foundry->sw_index();
my $sw_speed= $foundry->sw_speed();
unless (defined $sw_index and defined $sw_speed){
return $foundry->SUPER::i_speed();
}
my %i_speed;
foreach my $sw_port (keys %$sw_speed){
my $iid = $sw_index->{$sw_port};
@@ -196,6 +202,7 @@ sub model {
my $model = &SNMP::translateObj($id);
$model = $1 if $desc =~ /\s+([a-z]{2}\d{4})\D/i;
$model = $1 if $desc =~ /\b(FW[A-Z\d]+)/;
return $model;
@@ -241,6 +248,7 @@ sub interfaces {
sub vendor {
return 'foundry';
}
1;
__END__
@@ -266,15 +274,14 @@ Max Baker
or die "Can't connect to DestHost.\n";
my $class = $foundry->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
=head1 DESCRIPTION
This subclass no longer supported.
This module provides limited functionality from some L2+L3 and L3 Foundry devices.
This module provides limited functionality from older Foundry devices.
Specifically designed for a FI4802.
Specifically designed for a FI4802. Works on a FWSX424.
For speed or debugging purposes you can call the subclass directly, but not after determining
a more specific class using the method above. Turn off the AutoSpecify flag.
@@ -287,7 +294,6 @@ a more specific class using the method above. Turn off the AutoSpecify flag.
=item SNMP::Info
=item SNMP::Info::Bridge
=back
@@ -368,10 +374,6 @@ Returns the status of the chassis fan.
See documentation in SNMP::Info for details.
=head2 Globals imported from SNMP::Info::Bridge
See documentation in SNMP::Info::Bridge for details.
=head1 TABLE ENTRIES
These are methods that return tables of information in the form of a reference
@@ -477,8 +479,4 @@ Returns reference to hash. Current Port Speed.
See documentation in SNMP::Info for details.
=head2 Table Methods imported from SNMP::Info::Bridge
See documentation in SNMP::Info::Bridge for details.
=cut