Support partial table fetches on overridden table methods.

Prep 1.05
This commit is contained in:
Eric Miller
2007-06-13 02:48:44 +00:00
parent 069695f570
commit 2070f9b9e0
7 changed files with 77 additions and 65 deletions

View File

@@ -29,7 +29,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Contivity;
$VERSION = '1.04';
$VERSION = '1.05';
use strict;
@@ -126,7 +126,9 @@ sub serial {
sub interfaces {
my $contivity = shift;
my $description = $contivity->i_description();
my $partial = shift;
my $description = $contivity->i_description($partial) || {};
my %interfaces = ();
foreach my $iid (keys %$description){
@@ -141,7 +143,9 @@ sub interfaces {
sub i_name {
my $contivity = shift;
my $i_name2 = $contivity->orig_i_name();
my $partial = shift;
my $i_name2 = $contivity->orig_i_name($partial) || {};
my %i_name;
foreach my $iid (keys %$i_name2){
@@ -161,8 +165,8 @@ __END__
=head1 NAME
SNMP::Info::Layer3::Contivity - Perl5 Interface to Nortel Networks' Contivity
Extranet Switches (CES).
SNMP::Info::Layer3::Contivity - SNMP Interface to Nortel VPN Routers (Contivity
Extranet Switches).
=head1 AUTHOR
@@ -181,15 +185,15 @@ Eric Miller
)
or die "Can't connect to DestHost.\n";
my $class = $contivity->class();
my $class = $contivity->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
=head1 DESCRIPTION
Abstraction subclass for Nortel Networks' Contivity Extranet Switch (CES).
Abstraction subclass for Nortel VPN Routers (Contivity Extranet Switch).
For speed or debugging purposes you can call the subclass directly, but not after determining
a more specific class using the method above.
For speed or debugging purposes you can call the subclass directly, but not
after determining a more specific class using the method above.
my $contivity = new SNMP::Info::Layer3::Contivity(...);

View File

@@ -146,9 +146,10 @@ sub serial {
# Descriptions are all the same, so use name instead
sub interfaces {
my $dell = shift;
my $partial = shift;
my $interfaces = $dell->i_index();
my $names = $dell->orig_i_name();
my $interfaces = $dell->i_index($partial) || {};
my $names = $dell->orig_i_name($partial) || {};
my %interfaces = ();
foreach my $iid (keys %$interfaces){
@@ -163,10 +164,11 @@ sub interfaces {
sub i_duplex_admin {
my $dell = shift;
my $partial = shift;
my $interfaces = $dell->interfaces();
my $dell_duplex = $dell->dell_duplex_admin();
my $dell_auto = $dell->dell_auto();
my $interfaces = $dell->interfaces($partial) || {};
my $dell_duplex = $dell->dell_duplex_admin($partial) || {};
my $dell_auto = $dell->dell_auto($partial) || {};
my %i_duplex_admin;
foreach my $if (keys %$interfaces){
@@ -182,15 +184,6 @@ sub i_duplex_admin {
return \%i_duplex_admin;
}
sub i_vlan {
my $dell = shift;
my $qb_i_vlan = $dell->qb_i_vlan_t();
if (defined $qb_i_vlan and scalar(keys %$qb_i_vlan)){
return $qb_i_vlan;
}
}
# dot1qTpFdbAddress doesn't return values but is used as the index for the table
# so extract mac from index of dot1qTpFdbPort
sub fw_mac {
@@ -217,7 +210,7 @@ __END__
=head1 NAME
SNMP::Info::Layer3::Dell - Perl5 Interface to Dell Power Connect Network Devices
SNMP::Info::Layer3::Dell - SNMP Interface to Dell Power Connect Network Devices
=head1 AUTHOR
@@ -236,7 +229,7 @@ Eric Miller
)
or die "Can't connect to DestHost.\n";
my $class = $dell->class();
my $class = $dell->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
@@ -245,8 +238,8 @@ Eric Miller
Provides abstraction to the configuration information obtainable from an
Dell Power Connect device 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.
For speed or debugging purposes you can call the subclass directly, but not
after determining a more specific class using the method above.
my $dell = new SNMP::Info::Layer3::Dell(...);

View File

@@ -1,10 +1,7 @@
# SNMP::Info::Layer3::N1600 - SNMP Interface to Nortel N16XX devices
# Eric Miller
#
# Copyright (c) 2004,2005 Max Baker changes from version 0.8 and beyond.
#
# Copyright (c) 2002,2003 Regents of the University of California
# All rights reserved.
# Copyright (c) 2005 Eric Miller
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -14,9 +11,6 @@
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the University of California, Santa Cruz nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -40,7 +34,7 @@ use SNMP::Info::SONMP;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
$VERSION = '1.04';
$VERSION = '1.05';
@SNMP::Info::Layer3::N1600::ISA = qw/SNMP::Info::Layer3 SNMP::Info::SONMP Exporter/;
@SNMP::Info::Layer3::N1600::EXPORT_OK = qw//;
@@ -115,7 +109,9 @@ sub os_ver {
sub interfaces {
my $n1600 = shift;
my $i_index = $n1600->i_index();
my $partial = shift;
my $i_index = $n1600->i_index($partial) || {};
my %if;
foreach my $iid (keys %$i_index){
@@ -130,7 +126,9 @@ sub interfaces {
sub i_duplex {
my $n1600 = shift;
my $nway_status = $n1600->n1600_nway_status();
my $partial = shift;
my $nway_status = $n1600->n1600_nway_status($partial) || {};
my %i_duplex;
foreach my $iid (keys %$nway_status){
@@ -145,7 +143,9 @@ sub i_duplex {
sub i_duplex_admin {
my $n1600 = shift;
my $nway_state = $n1600->n1600_nway_state();
my $partial = shift;
my $nway_state = $n1600->n1600_nway_state($partial) || {};
my %i_duplex;
foreach my $iid (keys %$nway_state){
@@ -169,7 +169,7 @@ __END__
=head1 NAME
SNMP::Info::Layer3::N1600 - Perl5 Interface to Nortel 16XX Network Devices
SNMP::Info::Layer3::N1600 - SNMP Interface to Nortel 16XX Network Devices
=head1 AUTHOR
@@ -197,8 +197,8 @@ Eric Miller
Provides abstraction to the configuration information obtainable from a Nortel
N16XX device 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.
For speed or debugging purposes you can call the subclass directly, but not
after determining a more specific class using the method above.
my $n1600 = new SNMP::Info::Layer3::N1600(...);

View File

@@ -24,12 +24,15 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Sun;
$VERSION = '1.05';
# $Id$
use strict;
use Exporter;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
$VERSION = '1.05';
@SNMP::Info::Layer3::Sun::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::Sun::EXPORT_OK = qw//;
@@ -81,8 +84,9 @@ sub serial {
sub i_ignore {
my $l3 = shift;
my $partial = shift;
my $interfaces = $l3->interfaces();
my $interfaces = $l3->interfaces($partial) || {};
my %i_ignore;
foreach my $if (keys %$interfaces) {
@@ -99,7 +103,7 @@ __END__
=head1 NAME
SNMP::Info::Layer3::Sun - Perl5 Interface to L3 Sun Solaris
SNMP::Info::Layer3::Sun - SNMP Interface to L3 Sun Solaris
=head1 AUTHOR