Nortel name changes and arpnip support for Layer 3 models

This commit is contained in:
Eric Miller
2006-01-26 04:39:06 +00:00
parent 7966400cf2
commit fa8f91d508

View File

@@ -1,8 +1,8 @@
# SNMP::Info::Layer2::Baystack
# Eric Miller <eric@jeneric.org>
# Eric Miller
# $Id$
#
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
# Copyright (c) 2004-6 Max Baker changes from version 0.8 and beyond.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -68,6 +68,10 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
%SNMP::Info::NortelStack::FUNCS,
'i_name2' => 'ifName',
'i_mac2' => 'ifPhysAddress',
# From RFC1213-MIB
'at_index' => 'ipNetToMediaIfIndex',
'at_paddr' => 'ipNetToMediaPhysAddress',
'at_netaddr' => 'ipNetToMediaNetAddress',
);
# 450's report full duplex as speed = 20mbps?!
@@ -82,6 +86,7 @@ $SNMP::Info::SPEED_MAP{2_000_000_000} = '1.0 Gbps';
%SNMP::Info::RapidCity::MUNGE,
%SNMP::Info::NortelStack::MUNGE,
'i_mac2' => \&SNMP::Info::munge_mac,
'at_paddr' => \&SNMP::Info::munge_mac,
);
sub os {
@@ -89,7 +94,7 @@ sub os {
my $descr = $baystack->description();
my $model = $baystack->model();
if ((defined $model and $model =~ /(470|460|BPS|5510|5520)/) and (defined $descr and $descr =~ m/SW:v[3-5]/i)) {
if ((defined $model and $model =~ /(470|460|BPS|5510|5520|5530)/) and (defined $descr and $descr =~ m/SW:v[3-5]/i)) {
return 'boss';
}
return 'baystack';
@@ -126,23 +131,13 @@ sub model {
return undef unless defined $id;
my $model = &SNMP::translateObj($id);
return $id unless defined $model;
$model =~ s/^sreg-//i;
my $descr = $baystack->description();
return '303' if (defined $descr and $descr =~ /\D303\D/);
return '304' if (defined $descr and $descr =~ /\D304\D/);
return '350' if ($model =~ /BayStack350/);
return '380' if ($model =~ /BayStack380/);
return '410' if ($model =~ /BayStack410/);
return '420' if ($model =~ /BayStack420/);
return '425' if ($model =~ /BayStack425/);
return '450' if ($model =~ /BayStack450/);
return '470' if ($model =~ /BayStack470/i);
return '460' if ($model =~ /BayStack460/i);
return 'BPS' if ($model =~ /BPS2000/i);
return '5510' if ($model =~ /BayStack5510/i);
return '5520' if ($model =~ /BayStack5520/i);
return $2 if ($model =~ /(BayStack|EthernetRoutingSwitch|EthernetSwitch)(\d+)/);
return $model;
}
@@ -234,11 +229,11 @@ __END__
=head1 NAME
SNMP::Info::Layer2::Baystack - SNMP Interface to Nortel Baystack Switches
SNMP::Info::Layer2::Baystack - SNMP Interface to Nortel Ethernet (Baystack) Switches
=head1 AUTHOR
Eric Miller (C<eric@jeneric.org>)
Eric Miller
=head1 SYNOPSIS
@@ -259,7 +254,7 @@ Eric Miller (C<eric@jeneric.org>)
=head1 DESCRIPTION
Provides abstraction to the configuration information obtainable from a Nortel
Baystack device through SNMP.
Ethernet Switch (Baystack) through SNMP.
For speed or debugging purposes you can call the subclass directly, but not after determining
a more specific class using the method above.
@@ -316,7 +311,10 @@ Cross references $baystack->id() to the SYNOPTICS-MIB and returns
the results. 303s and 304s have the same ID, so we have a hack
to return depending on which it is.
Removes sreg- from the model name
Returns BPS for Business Policy Switch
For BayStack, EthernetRoutingSwitch, or EthernetSwitch extracts and returns
the switch numeric designation.
=item $baystack->os()
@@ -338,7 +336,7 @@ Required by SNMP::Info::SONMP. Number representing the number of ports
reserved per slot within the device MIB.
Index factor on the Baystack switches are determined by the formula: Index
Factor = 64 if (model = 470 or (os eq 'BoSS' and operating in pure mode))
Factor = 64 if (model = 470 or (os eq 'boss' and operating in pure mode))
or else Index factor = 32.
Returns either 32 or 64 based upon the formula.
@@ -402,6 +400,30 @@ Crosses ifName with ifAlias and returns the human set port name if exists.
=back
=head2 RFC1213 Arp Cache Table (B<ipNetToMediaTable>)
=over
=item $baystack->at_index()
Returns reference to hash. Maps ARP table entries to Interface IIDs
(B<ipNetToMediaIfIndex>)
=item $baystack->at_paddr()
Returns reference to hash. Maps ARP table entries to MAC addresses.
(B<ipNetToMediaPhysAddress>)
=item $baystack->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.