- Change inheritance - Layer2 and IEEE802dot11

- Implement i_ssidlist(), and i_80211channel() methods through IEEE802dot11 class
- Use orig_ syntax. Remove redundant items
- Support partial table fetches on overridden table methods
- Documentation updates
This commit is contained in:
Eric Miller
2006-10-27 15:23:11 +00:00
parent 3da742fa1d
commit b8c03fa9c1

View File

@@ -2,7 +2,7 @@
# Eric Miller # Eric Miller
# $Id$ # $Id$
# #
# Copyright (c) 2004-6 Eric Miller # Copyright (c) 2004 Eric Miller
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met: # modification, are permitted provided that the following conditions are met:
@@ -28,36 +28,42 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer2::Orinoco; package SNMP::Info::Layer2::Orinoco;
$VERSION = '1.04'; $VERSION = '1.05';
use strict; use strict;
use Exporter; use Exporter;
use SNMP::Info; use SNMP::Info::IEEE802dot11;
use SNMP::Info::Bridge; use SNMP::Info::Layer2;
@SNMP::Info::Layer2::Orinoco::ISA = qw/SNMP::Info SNMP::Info::Bridge Exporter/; @SNMP::Info::Layer2::Orinoco::ISA = qw/SNMP::Info::IEEE802dot11 SNMP::Info::Layer2 Exporter/;
@SNMP::Info::Layer2::Orinoco::EXPORT_OK = qw//; @SNMP::Info::Layer2::Orinoco::EXPORT_OK = qw//;
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/; use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
%MIBS = ( %MIBS = (
%SNMP::Info::MIBS, %SNMP::Info::Layer2::MIBS,
%SNMP::Info::Bridge::MIBS, %SNMP::Info::IEEE802dot11::MIBS,
#'ORiNOCO-MIB' => 'orinoco',
); );
%GLOBALS = ( %GLOBALS = (
%SNMP::Info::GLOBALS, %SNMP::Info::Layer2::GLOBALS,
%SNMP::Info::Bridge::GLOBALS, %SNMP::Info::IEEE802dot11::GLOBALS,
); );
%FUNCS = ( %FUNCS = (
%SNMP::Info::FUNCS, %SNMP::Info::Layer2::FUNCS,
%SNMP::Info::Bridge::FUNCS, %SNMP::Info::IEEE802dot11::FUNCS,
# ORiNOCO-MIB:oriWirelessIfPropertiesTable
#'ori_ssid' => 'oriWirelessIfNetworkName',
#'ori_channel' => 'oriWirelessIfChannel',
#'ori_closed_sys' => 'oriWirelessIfClosedSystem',
# ORiNOCO-MIB:oriSystemInvMgmtComponentTable
); );
%MUNGE = ( %MUNGE = (
%SNMP::Info::MUNGE, %SNMP::Info::Layer2::MUNGE,
%SNMP::Info::Bridge::MUNGE, %SNMP::Info::IEEE802dot11::MUNGE,
); );
sub os { sub os {
@@ -66,6 +72,7 @@ sub os {
sub os_ver { sub os_ver {
my $orinoco = shift; my $orinoco = shift;
my $descr = $orinoco->description(); my $descr = $orinoco->description();
return undef unless defined $descr; return undef unless defined $descr;
@@ -81,6 +88,7 @@ sub os_ver {
sub os_bin { sub os_bin {
my $orinoco = shift; my $orinoco = shift;
my $descr = $orinoco->description(); my $descr = $orinoco->description();
return undef unless defined $descr; return undef unless defined $descr;
@@ -100,6 +108,7 @@ sub vendor {
sub model { sub model {
my $orinoco = shift; my $orinoco = shift;
my $descr = $orinoco->description(); my $descr = $orinoco->description();
return undef unless defined $descr; return undef unless defined $descr;
@@ -110,6 +119,7 @@ sub model {
sub serial { sub serial {
my $orinoco = shift; my $orinoco = shift;
my $descr = $orinoco->description(); my $descr = $orinoco->description();
return undef unless defined $descr; return undef unless defined $descr;
@@ -119,7 +129,9 @@ sub serial {
sub i_ignore { sub i_ignore {
my $orinoco = shift; my $orinoco = shift;
my $descr = $orinoco->i_description(); my $partial = shift;
my $descr = $orinoco->i_description($partial) || {};
my %i_ignore; my %i_ignore;
foreach my $if (keys %$descr){ foreach my $if (keys %$descr){
@@ -132,8 +144,10 @@ sub i_ignore {
sub interfaces { sub interfaces {
my $orinoco = shift; my $orinoco = shift;
my $interfaces = $orinoco->i_index(); my $partial = shift;
my $descriptions = $orinoco->i_description();
my $interfaces = $orinoco->i_index($partial) || {};
my $descriptions = $orinoco->i_description($partial) || {};
my %interfaces = (); my %interfaces = ();
foreach my $iid (keys %$interfaces){ foreach my $iid (keys %$interfaces){
@@ -148,6 +162,22 @@ sub interfaces {
return \%interfaces; return \%interfaces;
} }
#sub i_ssidbcast {
# my $orinoco = shift;
# my $partial = shift;
#
# my $bcast = $orinoco->ori_closed_sys($partial) || {};
#
# my %i_ssidbcast;
# foreach my $iid (keys %$bcast){
# my $bc = $bcast->{$iid};
# next unless defined $bc;
#
# $i_ssidbcast{$iid} = $bc;
# }
# return \%i_ssidbcast;
#}
1; 1;
__END__ __END__
@@ -178,7 +208,8 @@ Eric Miller
=head1 DESCRIPTION =head1 DESCRIPTION
Provides abstraction to the configuration information obtainable from a Orinoco Provides abstraction to the configuration information obtainable from a Orinoco
Access Point through SNMP. Access Point through SNMP. Orinoco devices have been maufactured by Proxim,
Agere, and Lucent.
For speed or debugging purposes you can call the subclass directly, but not after For speed or debugging purposes you can call the subclass directly, but not after
determining a more specific class using the method above. determining a more specific class using the method above.
@@ -189,9 +220,9 @@ determining a more specific class using the method above.
=over =over
=item SNMP::Info =item SNMP::Info::Layer2
=item SNMP::Info::Bridge =item SNMP::Info::IEEE802dot11
=back =back
@@ -199,14 +230,16 @@ determining a more specific class using the method above.
=over =over
=item Inherited classes None.
See SNMP::Info for its own MIB requirements.
See SNMP::Info::Bridge for its own MIB requirements.
=back =back
=head2 Inherited MIBs
See L<SNMP::Info::Layer2/"Required MIBs"> for its MIB requirements.
See L<SNMP::Info::IEEE802dot11/"Required MIBs"> for its MIB requirements.
=head1 GLOBALS =head1 GLOBALS
These are methods that return scalar value from SNMP These are methods that return scalar value from SNMP
@@ -215,7 +248,7 @@ These are methods that return scalar value from SNMP
=item $orinoco->vendor() =item $orinoco->vendor()
Returns 'Proxim' :) Returns 'proxim'
=item $orinoco->model() =item $orinoco->model()
@@ -239,13 +272,13 @@ Returns the serial number extracted from B<sysDescr>.
=back =back
=head2 Globals imported from SNMP::Info =head2 Global Methods imported from SNMP::Info::Layer2
See documentation in SNMP::Info for details. See L<SNMP::Info::Layer2/"GLOBALS"> for details.
=head2 Globals imported from SNMP::Info::Bridge =head2 Global Methods imported from SNMP::Info::IEEE802dot11
See documentation in SNMP::Info::Bridge for details. See L<SNMP::Info::IEEE802dot11/"GLOBALS"> for details.
=head1 TABLE ENTRIES =head1 TABLE ENTRIES
@@ -266,12 +299,12 @@ Returns reference to hash of IIDs to ignore.
=back =back
=head2 Table Methods imported from SNMP::Info =head2 Table Methods imported from SNMP::Info::Layer2
See documentation in SNMP::Info for details. See L<SNMP::Info::Layer2/"TABLE ENTRIES"> for details.
=head2 Table Methods imported from SNMP::Info::Bridge =head2 Table Methods imported from SNMP::Info::IEEE802dot11
See documentation in SNMP::Info::Bridge for details. See L<SNMP::Info::IEEE802dot11/"TABLE ENTRIES"> for details.
=cut =cut