From 77d854f58fce9d68e6d03bec9ae4eaf3163beac0 Mon Sep 17 00:00:00 2001 From: Max Baker <> Date: Tue, 29 Apr 2003 17:10:11 +0000 Subject: [PATCH] - version 0.4 call and doc upgrade - Added os_ver() os() --- Info/Layer3/Aironet.pm | 186 ++++++++++++++++++++++++++++------------- 1 file changed, 130 insertions(+), 56 deletions(-) diff --git a/Info/Layer3/Aironet.pm b/Info/Layer3/Aironet.pm index 2c28ed1a..e3912133 100644 --- a/Info/Layer3/Aironet.pm +++ b/Info/Layer3/Aironet.pm @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer3::Aironet; -$VERSION = 0.3; +$VERSION = 0.4; # $Id$ use strict; @@ -82,6 +82,26 @@ $INIT = 0; 'fw_mac2' => \&SNMP::Info::munge_mac, ); +sub os { + return 'aironet'; +} + +sub os_ver { + my $aironet = shift; + my $descr = $aironet->description(); + + # CAP340 11.21 + if ($descr =~ /AP\d{3}\s+(\d{2}\.\d{2})/){ + return $1; + } + + if ($descr =~ /Series\s*AP\s+(\d{2}\.\d{2})/){ + return $1; + } + + return undef; +} + # Override wireless port with static info sub bp_index { my $aironet = shift; @@ -190,11 +210,7 @@ __END__ =head1 NAME -SNMP::Info::Layer3::Aironet - Perl5 Interface to Cisco Aironet Wireless Devices - -=head1 DESCRIPTION - -Inherits all methods from SNMP::Info::Layer3 +SNMP::Info::Layer3::Aironet - Perl5 Interface to Cisco Aironet Wireless Devices running Aironet software, not IOS =head1 AUTHOR @@ -202,37 +218,70 @@ Max Baker (C) =head1 SYNOPSIS - my $aironet = new SNMP::Info::Layer3::Aironet(DestHost => 'myswitch', - Community => 'public'); - my $mac = $aironet->mac(); + # Let SNMP::Info determine the correct subclass for you. + my $aironet = new SNMP::Info( + AutoSpecify => 1, + Debug => 1, + # These arguments are passed directly on to SNMP::Session + DestHost => 'myswitch', + Community => 'public', + Version => 2 + ) + or die "Can't connect to DestHost.\n"; -=head1 CREATING AN OBJECT + my $class = $aironet->class(); + print "SNMP::Info determined this device to fall under subclass : $class\n"; + +=head1 DESCRIPTION + +SNMP::Info subclass to provide access to SNMP data for an Aironet device running Aironet software, +not cisco IOS. + +Note there are two classes for Aironet devices : =over -=item new SNMP::Info::Layer3::Aironet() +=item SNMP::Info::Layer3::Aironet -Arguments passed to new() are passed on to SNMP::Session::new() - +This class is for devices running Aironet software (older) - my $aironet = new SNMP::Info::Layer3::Aironet( - DestHost => $host, - Community => 'public', - Version => 3,... - ) - die "Couldn't connect.\n" unless defined $aironet; +=item SNMP::Info::Layer2::Aironet + +This class is for devices running Cisco IOS software (newer) =back -=head1 Globals +For speed or debugging purposes you can call the subclass directly, but not after determining +a more specific class using the method above. + + my $aironet = new SNMP::Info::Layer3::Aironet(...); + +=head2 Inherited Classes =over -=item $aironet->mac() +=item SNMP::Info::Layer3 -Gives the MAC Address of the wireless side +=back -B +=head2 Required MIBs + +=over + +=item AWCVX-MIB + +=item IEEE802dot11-MIB + +=back + +These MIBs are now included in the v2.tar.gz archive available from ftp.cisco.com. Make sure you +have a current version. + +=head1 GLOBALS + +These are methods that return scalar value from SNMP + +=over =item $aironet->awc_duplex() @@ -240,47 +289,34 @@ Gives the admin duplex setting for the Ethernet Port. B +=item $aironet->mac() + +Gives the MAC Address of the wireless side + +B + +=item $aironet->os() + +'aironet' + +=item $aironet->os_ver + +Tries to cull the version from the description field. + =item $aironet->vendor() Returns 'cisco'. =back +=head2 Globals imported from SNMP::Info::Layer3 + +See documentation in SNMP::Info::Layer3 for details. + =head1 TABLE ENTRIES -=head2 Aironet specific items - -=over - -=item $aironet->awc_default_mac() - -Gives the default MAC address of each interface. - -B - -=item $aironet->awc_mac() - -Gives the actual MAC address of each interface. - -B - -=item $aironet->awc_ip() - -Gives the IP Address assigned to each interface. - -B - -=item $aironet->awc_netmask() - -Gives the NetMask for each interface. - -B - -=item $aironet->awc_msdu() - -B - -=back +These are methods that return tables of information in the form of a reference +to a hash. =head2 Overrides @@ -315,4 +351,42 @@ Ignores ports that are of type ``rptr'' and ``lo''. =back +=head2 Aironet specific items + +=over + +=item $aironet->awc_default_mac() + +Gives the default MAC address of each interface. + +B + +=item $aironet->awc_mac() + +Gives the actual MAC address of each interface. + +B + +=item $aironet->awc_ip() + +Gives the IP Address assigned to each interface. + +B + +=item $aironet->awc_netmask() + +Gives the NetMask for each interface. + +B + +=item $aironet->awc_msdu() + +B + +=back + +=head2 Table Methods imported from SNMP::Info::Layer3 + +See documentation in SNMP::Info::Layer3 for details. + =cut