switched over to CiscoVTP subclass for vlan processing

This commit is contained in:
Max Baker
2003-07-03 17:18:26 +00:00
parent c59e13ac35
commit f060b67b4a
3 changed files with 60 additions and 100 deletions

View File

@@ -34,36 +34,35 @@ use strict;
use Exporter; use Exporter;
use SNMP::Info::Layer2; use SNMP::Info::Layer2;
use SNMP::Info::CiscoVTP;
@SNMP::Info::Layer2::C2900::ISA = qw/SNMP::Info::Layer2 Exporter/; @SNMP::Info::Layer2::C2900::ISA = qw/SNMP::Info::Layer2 SNMP::Info::CiscoVTP Exporter/;
@SNMP::Info::Layer2::C2900::EXPORT_OK = qw//; @SNMP::Info::Layer2::C2900::EXPORT_OK = qw//;
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/; use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
# Set for No CDP # Set for No CDP
%GLOBALS = ( %GLOBALS = (
%SNMP::Info::Layer2::GLOBALS %SNMP::Info::Layer2::GLOBALS,
%SNMP::Info::CiscoVTP::GLOBALS,
); );
%FUNCS = (%SNMP::Info::Layer2::FUNCS, %FUNCS = (%SNMP::Info::Layer2::FUNCS,
%SNMP::Info::CiscoVTP::FUNCS,
# C2900PortEntry # C2900PortEntry
'c2900_p_index' => 'c2900PortIfIndex', 'c2900_p_index' => 'c2900PortIfIndex',
'c2900_p_duplex' => 'c2900PortDuplexStatus', 'c2900_p_duplex' => 'c2900PortDuplexStatus',
'c2900_p_duplex_admin' => 'c2900PortDuplexState', 'c2900_p_duplex_admin' => 'c2900PortDuplexState',
'c2900_p_speed_admin' => 'c2900PortAdminSpeed', 'c2900_p_speed_admin' => 'c2900PortAdminSpeed',
# CISCO-VTP-MIB::VtpVlanEntry
'v_state' => 'vtpVlanState',
'v_type' => 'vtpVlanType',
'v_name' => 'vtpVlanName',
'v_mtu' => 'vtpVlanMtu',
); );
%MIBS = ( %SNMP::Info::Layer2::MIBS, %MIBS = ( %SNMP::Info::Layer2::MIBS,
%SNMP::Info::CiscoVTP::MIBS,
'CISCO-C2900-MIB' => 'ciscoC2900MIB', 'CISCO-C2900-MIB' => 'ciscoC2900MIB',
'CISCO-VTP-MIB' => 'vtpVlanIndex',
); );
%MUNGE = (%SNMP::Info::Layer2::MUNGE, %MUNGE = (%SNMP::Info::Layer2::MUNGE,
%SNMP::Info::CiscoVTP::MUNGE,
); );
sub vendor { sub vendor {
@@ -182,6 +181,8 @@ a more specific class using the method above.
=item SNMP::Info::Layer2 =item SNMP::Info::Layer2
=item SNMP::Info::CiscoVTP
=back =back
=head2 Required MIBs =head2 Required MIBs
@@ -192,6 +193,12 @@ a more specific class using the method above.
Part of the v2 MIBs from Cisco. Part of the v2 MIBs from Cisco.
=item Inherited Classes' MIBs
See SNMP::Info::Layer2 for its own MIB requirements.
See SNMP::Info::CiscoVTP for its own MIB requirements.
=back =back
=head1 GLOBALS =head1 GLOBALS
@@ -212,6 +219,10 @@ These are methods that return scalar value from SNMP
See documentation in SNMP::Info::Layer2 for details. See documentation in SNMP::Info::Layer2 for details.
=head2 Global Methods imported from SNMP::Info::CiscoVTP
See documentation in SNMP::Info::CiscoVTP for details.
=head1 TABLE ENTRIES =head1 TABLE ENTRIES
These are methods that return tables of information in the form of a reference These are methods that return tables of information in the form of a reference
@@ -279,33 +290,12 @@ to a hash.
=back =back
=head2 VLAN Entry Table
See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html
for a good treaty of how to connect to the VLANs
=over
=item $c2900->v_state()
(B<vtpVlanState>)
=item $c2900->v_type()
(B<vtpVlanType>)
=item $c2900->v_name()
(B<vtpVlanName>)
=item $c2900->v_mtu()
(B<vtpVlanMtu>)
=back
=head2 Table Methods imported from SNMP::Info::Layer2 =head2 Table Methods imported from SNMP::Info::Layer2
See documentation in SNMP::Info::Layer2 for details. See documentation in SNMP::Info::Layer2 for details.
=head2 Table Methods imported from SNMP::Info::CiscoVTP
See documentation in SNMP::Info::CiscoVTP for details.
=cut =cut

View File

@@ -28,16 +28,17 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer2::Catalyst; package SNMP::Info::Layer2::Catalyst;
$VERSION = 0.6; $VERSION = 0.7;
# $Id$ # $Id$
use strict; use strict;
use Exporter; use Exporter;
use SNMP::Info::Layer2; use SNMP::Info::Layer2;
use SNMP::Info::CiscoVTP;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/ ; use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/ ;
@SNMP::Info::Layer2::Catalyst::ISA = qw/SNMP::Info::Layer2 Exporter/; @SNMP::Info::Layer2::Catalyst::ISA = qw/SNMP::Info::Layer2 SNMP::Info::CiscoVTP Exporter/;
@SNMP::Info::Layer2::Catalyst::EXPORT_OK = qw//; @SNMP::Info::Layer2::Catalyst::EXPORT_OK = qw//;
$DEBUG=0; $DEBUG=0;
@@ -47,12 +48,13 @@ $DEBUG=0;
$INIT = 0; $INIT = 0;
%MIBS = ( %SNMP::Info::Layer2::MIBS, %MIBS = ( %SNMP::Info::Layer2::MIBS,
%SNMP::Info::CiscoVTP::MIBS,
'CISCO-STACK-MIB' => 'moduleType', 'CISCO-STACK-MIB' => 'moduleType',
'CISCO-VTP-MIB' => 'vtpVlanIndex'
); );
%GLOBALS = ( %GLOBALS = (
%SNMP::Info::Layer2::GLOBALS, %SNMP::Info::Layer2::GLOBALS,
%SNMP::Info::CiscoVTP::GLOBALS,
# these are in CISCO-STACK-MIB # these are in CISCO-STACK-MIB
'sysip' => 'sysIpAddr', 'sysip' => 'sysIpAddr',
'netmask' => 'sysNetMask', 'netmask' => 'sysNetMask',
@@ -69,6 +71,7 @@ $INIT = 0;
%FUNCS = ( %FUNCS = (
%SNMP::Info::Layer2::FUNCS, %SNMP::Info::Layer2::FUNCS,
%SNMP::Info::CiscoVTP::FUNCS,
'i_type2' => 'ifType', 'i_type2' => 'ifType',
# CISCO-STACK-MIB::moduleEntry # CISCO-STACK-MIB::moduleEntry
# These are blades in a catalyst device # These are blades in a catalyst device
@@ -97,15 +100,11 @@ $INIT = 0;
# CISCO-STACK-MIB::PortCpbEntry # CISCO-STACK-MIB::PortCpbEntry
'p_speed_admin' => 'portCpbSpeed', 'p_speed_admin' => 'portCpbSpeed',
'p_duplex_admin' => 'portCpbDuplex', 'p_duplex_admin' => 'portCpbDuplex',
# CISCO-VTP-MIB::VtpVlanEntry
'v_state' => 'vtpVlanState',
'v_type' => 'vtpVlanType',
'v_name' => 'vtpVlanName',
'v_mtu' => 'vtpVlanMtu',
); );
%MUNGE = ( %MUNGE = (
%SNMP::Info::Layer2::MUNGE, %SNMP::Info::Layer2::MUNGE,
%SNMP::Info::CiscoVTP::MUNGE,
'm_ports_status' => \&munge_port_status, 'm_ports_status' => \&munge_port_status,
'p_duplex_admin' => \&SNMP::Info::munge_bits, 'p_duplex_admin' => \&SNMP::Info::munge_bits,
); );
@@ -302,6 +301,8 @@ a more specific class using the method above.
=item SNMP::Info::Layer2 =item SNMP::Info::Layer2
=item SNMP::Info::CiscoVTP
=back =back
=head2 Required MIBs =head2 Required MIBs
@@ -310,12 +311,12 @@ a more specific class using the method above.
=item CISCO-STACK-MIB =item CISCO-STACK-MIB
=item CISCO-VTP-MIB
=item Inherited Classes' MIBs =item Inherited Classes' MIBs
See SNMP::Info::Layer2 for its own MIB requirements. See SNMP::Info::Layer2 for its own MIB requirements.
See SNMP::Info::CiscoVTP for its own MIB requirements.
=back =back
These MIBs are found in the standard v2 MIBs from Cisco. These MIBs are found in the standard v2 MIBs from Cisco.
@@ -385,6 +386,10 @@ Returns 'cisco'
See documentation in SNMP::Info::Layer2 for details. See documentation in SNMP::Info::Layer2 for details.
=head2 Global Methods imported from SNMP::Info::CiscoVTP
See documentation in SNMP::Info::CiscoVTP for details.
=head1 TABLE ENTRIES =head1 TABLE ENTRIES
These are methods that return tables of information in the form of a reference These are methods that return tables of information in the form of a reference
@@ -558,30 +563,9 @@ To see the status of port 4 :
=back =back
=head2 VLAN Entry Table =head2 Table Methods imported from SNMP::Info::CiscoVTP
See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html See documentation in SNMP::Info::CiscoVTP for details.
for a good treaty of how to connect to the VLANs
=over
=item $cat->v_state()
(B<vtpVlanState>)
=item $cat->v_type()
(B<vtpVlanType>)
=item $cat->v_name()
(B<vtpVlanName>)
=item $cat->v_mtu()
(B<vtpVlanMtu>)
=back
=head2 Table Methods imported from SNMP::Info::Layer2 =head2 Table Methods imported from SNMP::Info::Layer2

View File

@@ -28,16 +28,17 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::C3550; package SNMP::Info::Layer3::C3550;
$VERSION = 0.6; $VERSION = 0.7;
# $Id$ # $Id$
use strict; use strict;
use Exporter; use Exporter;
use SNMP::Info::Layer3; use SNMP::Info::Layer3;
use SNMP::Info::CiscoVTP;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/ ; use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/ ;
@SNMP::Info::Layer3::C3550::ISA = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::C3550::ISA = qw/SNMP::Info::Layer3 SNMP::Info::CiscoVTP Exporter/;
@SNMP::Info::Layer3::C3550::EXPORT_OK = qw//; @SNMP::Info::Layer3::C3550::EXPORT_OK = qw//;
$DEBUG=0; $DEBUG=0;
@@ -48,12 +49,13 @@ $INIT = 0;
%MIBS = ( %MIBS = (
%SNMP::Info::Layer3::MIBS, %SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoVTP::MIBS,
'CISCO-STACK-MIB' => 'moduleType', 'CISCO-STACK-MIB' => 'moduleType',
'CISCO-VTP-MIB' => 'vtpVlanIndex'
); );
%GLOBALS = ( %GLOBALS = (
%SNMP::Info::Layer3::GLOBALS, %SNMP::Info::Layer3::GLOBALS,
%SNMP::Info::CiscoVTP::GLOBALS,
'ports2' => 'ifNumber', 'ports2' => 'ifNumber',
# these are in CISCO-STACK-MIB # these are in CISCO-STACK-MIB
'serial' => 'chassisSerialNumberString', 'serial' => 'chassisSerialNumberString',
@@ -66,6 +68,7 @@ $INIT = 0;
%FUNCS = ( %FUNCS = (
%SNMP::Info::Layer3::FUNCS, %SNMP::Info::Layer3::FUNCS,
%SNMP::Info::CiscoVTP::FUNCS,
'i_type2' => 'ifType', 'i_type2' => 'ifType',
# CISCO-STACK-MIB::portEntry # CISCO-STACK-MIB::portEntry
'p_name' => 'portName', 'p_name' => 'portName',
@@ -78,15 +81,11 @@ $INIT = 0;
# CISCO-STACK-MIB::PortCpbEntry # CISCO-STACK-MIB::PortCpbEntry
'p_speed_admin' => 'portCpbSpeed', 'p_speed_admin' => 'portCpbSpeed',
'p_duplex_admin' => 'portCpbDuplex', 'p_duplex_admin' => 'portCpbDuplex',
# CISCO-VTP-MIB::VtpVlanEntry
'v_state' => 'vtpVlanState',
'v_type' => 'vtpVlanType',
'v_name' => 'vtpVlanName',
'v_mtu' => 'vtpVlanMtu',
); );
%MUNGE = ( %MUNGE = (
# Inherit all the built in munging # Inherit all the built in munging
%SNMP::Info::CiscoVTP::MUNGE,
%SNMP::Info::Layer3::MUNGE, %SNMP::Info::Layer3::MUNGE,
'm_ports_status' => \&munge_port_status, 'm_ports_status' => \&munge_port_status,
'p_duplex_admin' => \&SNMP::Info::munge_bits, 'p_duplex_admin' => \&SNMP::Info::munge_bits,
@@ -248,7 +247,11 @@ a more specific class using the method above.
=item CISCO-STACK-MIB =item CISCO-STACK-MIB
=item CISCO-VTP-MIB =item Inherited Classes' MIBs
See SNMP::Info::Layer3 for its own MIB requirements.
See SNMP::Info::CiscoVTP for its own MIB requirements.
=back =back
@@ -292,6 +295,10 @@ These are methods that return scalar value from SNMP
See documentation in SNMP::Info::Layer3 for details. See documentation in SNMP::Info::Layer3 for details.
=head2 Global Methods imported from SNMP::Info::CiscoVTP
See documentation in SNMP::Info::CiscoVTP for details.
=head1 TABLE ENTRIES =head1 TABLE ENTRIES
These are methods that return tables of information in the form of a reference These are methods that return tables of information in the form of a reference
@@ -371,33 +378,12 @@ Munges bit_string returned from p_duplex_admin to get duplex settings.
=back =back
=head2 VLAN Entry Table
See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html
for a good treaty of how to connect to the VLANs
=over
=item $c3550->v_state()
(B<vtpVlanState>)
=item $c3550->v_type()
(B<vtpVlanType>)
=item $c3550->v_name()
(B<vtpVlanName>)
=item $c3550->v_mtu()
(B<vtpVlanMtu>)
=back
=head2 Table Methods imported from SNMP::Info::Layer3 =head2 Table Methods imported from SNMP::Info::Layer3
See documentation in SNMP::Info::Layer3 for details. See documentation in SNMP::Info::Layer3 for details.
=head2 Table Methods imported from SNMP::Info::CiscoVTP
See documentation in SNMP::Info::CiscoVTP for details.
=cut =cut