- PBP compliance via Perl::Critic

- Use bare return to return failure
- No code before strictures are enabled
This commit is contained in:
Eric Miller
2008-07-09 00:32:47 +00:00
parent 1b85820314
commit 2c5301b676
68 changed files with 464 additions and 415 deletions

View File

@@ -31,17 +31,18 @@
# POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Aironet;
$VERSION = '1.09';
use strict;
use Exporter;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
@SNMP::Info::Layer3::Aironet::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::Aironet::EXPORT_OK = qw//;
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
'AWCVX-MIB' => 'awcIfTable',
@@ -97,7 +98,7 @@ sub os_ver {
return $1;
}
return undef;
return;
}
# Override wireless port with static info

View File

@@ -29,18 +29,18 @@
# POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::AlteonAD;
$VERSION = '1.09';
use strict;
use Exporter;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE /;
@SNMP::Info::Layer3::AlteonAD::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::AlteonAD::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
'ALTEON-ROOT-MIB' => 'aceswitch184',
@@ -115,7 +115,7 @@ sub model {
unless (defined $id){
print " SNMP::Info::Layer3::AlteonAD::model() - Device does not support sysObjectID\n" if $alteon->debug();
return undef;
return;
}
my $model = &SNMP::translateObj($id);
@@ -140,7 +140,7 @@ sub os {
sub os_ver {
my $alteon = shift;
my $version = $alteon->new_sw_ver() || $alteon->old_sw_ver();
return undef unless defined $version;
return unless defined $version;
return $version;
}

View File

@@ -29,22 +29,22 @@
# POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::BayRS;
$VERSION = '1.09';
use strict;
use Exporter;
use SNMP::Info;
use SNMP::Info::Layer3;
use SNMP::Info::Bridge;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE %MODEL_MAP
%MODID_MAP %PROCID_MAP/;
@SNMP::Info::Layer3::BayRS::ISA = qw/SNMP::Info SNMP::Info::Layer3
SNMP::Info::Bridge Exporter/;
@SNMP::Info::Layer3::BayRS::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE %MODEL_MAP
%MODID_MAP %PROCID_MAP/;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::MIBS,
%SNMP::Info::Layer3::MIBS,
@@ -548,12 +548,12 @@ sub os {
sub os_ver {
my $bayrs = shift;
my $descr = $bayrs->description();
return undef unless defined $descr;
return unless defined $descr;
if ($descr =~ m/^\s*Image:\s+re[lv]\/((\d+\.){1,3}\d+)/){
return $1;
}
return undef;
return;
}
sub serial {
@@ -562,7 +562,7 @@ sub serial {
$serialnum = hex(join('','0x',map{sprintf "%02X", $_}unpack("C*",$serialnum)));
return $serialnum if defined $serialnum ;
return undef;
return;
}
sub interfaces {
@@ -740,7 +740,7 @@ sub root_ip {
return $ospf_ip;
}
return undef;
return;
}
# Pseudo ENTITY-MIB methods
@@ -1287,7 +1287,7 @@ sub munge_hw_rev {
my $rev = "$major.$minor";
return $rev if defined($rev);
return undef;
return;
}
sub munge_wf_serial {
@@ -1296,7 +1296,7 @@ sub munge_wf_serial {
my $serial = hex(join('','0x',map{sprintf "%02X", $_}unpack("C*",$wf_serial)));
return $serial if defined($serial);
return undef;
return;
}
1;

View File

@@ -30,10 +30,8 @@
# POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::C3550;
$VERSION = '1.09';
use strict;
use Exporter;
use SNMP::Info::CiscoVTP;
use SNMP::Info::CiscoStack;
@@ -44,7 +42,6 @@ use SNMP::Info::CiscoPortSecurity;
use SNMP::Info::CiscoPower;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
@SNMP::Info::Layer3::C3550::ISA = qw/SNMP::Info::CiscoVTP SNMP::Info::CiscoStack
SNMP::Info::CDP SNMP::Info::CiscoStats
SNMP::Info::CiscoPortSecurity
@@ -53,6 +50,10 @@ use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
Exporter/;
@SNMP::Info::Layer3::C3550::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/ ;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoPower::MIBS,

View File

@@ -31,9 +31,7 @@
package SNMP::Info::Layer3::C4000;
use strict;
use Exporter;
use SNMP::Info::CiscoVTP;
use SNMP::Info::CDP;
use SNMP::Info::CiscoStats;
@@ -43,8 +41,6 @@ use SNMP::Info::CiscoConfig;
use SNMP::Info::MAU;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
$VERSION = '1.09';
@SNMP::Info::Layer3::C4000::ISA = qw/SNMP::Info::CiscoVTP SNMP::Info::CDP
SNMP::Info::CiscoStats SNMP::Info::CiscoImage
SNMP::Info::CiscoPortSecurity
@@ -52,6 +48,10 @@ $VERSION = '1.09';
SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::C4000::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/ ;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
%SNMP::Info::MAU::MIBS,
@@ -118,7 +118,7 @@ sub fan {
$ret .= $s . $fan_descr->{$i} . ": " . $fan_state->{$i};
$s = ", ";
}
return undef if ($s eq "");
return if ($s eq "");
$ret;
}

View File

@@ -31,7 +31,6 @@
package SNMP::Info::Layer3::C6500;
use strict;
use Exporter;
use SNMP::Info::CiscoVTP;
use SNMP::Info::CiscoStack;
@@ -43,8 +42,6 @@ use SNMP::Info::CiscoConfig;
use SNMP::Info::CiscoPower;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
$VERSION = '1.09';
@SNMP::Info::Layer3::C6500::ISA = qw/SNMP::Info::CiscoVTP SNMP::Info::CiscoStack
SNMP::Info::CDP SNMP::Info::CiscoStats
SNMP::Info::CiscoImage
@@ -55,6 +52,10 @@ $VERSION = '1.09';
Exporter/;
@SNMP::Info::Layer3::C6500::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/ ;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoPower::MIBS,

View File

@@ -2,6 +2,7 @@
# $Id$
#
# Copyright (c) 2008 Max Baker
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -30,7 +31,6 @@
package SNMP::Info::Layer3::Cisco;
use strict;
use Exporter;
use SNMP::Info::CiscoVTP;
use SNMP::Info::CDP;
@@ -42,8 +42,6 @@ use SNMP::Info::CiscoConfig;
use SNMP::Info::CiscoPower;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
$VERSION = '1.09';
@SNMP::Info::Layer3::Cisco::ISA = qw/SNMP::Info::CiscoVTP SNMP::Info::CDP
SNMP::Info::CiscoStats SNMP::Info::CiscoImage
SNMP::Info::CiscoRTT SNMP::Info::CiscoQOS
@@ -52,6 +50,10 @@ $VERSION = '1.09';
Exporter/;
@SNMP::Info::Layer3::Cisco::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoPower::MIBS,

View File

@@ -29,20 +29,20 @@
# POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Contivity;
$VERSION = '1.09';
use strict;
use Exporter;
use SNMP::Info;
use SNMP::Info::Layer3;
use SNMP::Info::Entity;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
@SNMP::Info::Layer3::Contivity::ISA = qw/SNMP::Info SNMP::Info::Layer3 SNMP::Info::Entity Exporter/;
@SNMP::Info::Layer3::Contivity::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::MIBS,
%SNMP::Info::Layer3::MIBS,
@@ -82,7 +82,7 @@ sub model {
my $model = $e_model->{1} || undef;
return $1 if (defined $model and $model =~ /(CES\d+)/i);
return undef;
return;
}
sub os {
@@ -92,12 +92,12 @@ sub os {
sub os_ver {
my $contivity = shift;
my $descr = $contivity->description();
return undef unless defined $descr;
return unless defined $descr;
if ($descr =~ m/V(\d+_\d+\.\d+)/i){
return $1;
}
return undef;
return;
}
sub mac {
@@ -110,7 +110,7 @@ sub mac {
next unless $sn;
return $sn;
}
return undef;
return;
}
sub serial {
@@ -120,7 +120,7 @@ sub serial {
my $serial = $e_serial->{1} || undef;
return $1 if (defined $serial and $serial =~ /(\d+)/);
return undef;
return;
}

View File

@@ -31,17 +31,16 @@
package SNMP::Info::Layer3::Dell;
use strict;
use Exporter;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
$VERSION = '1.09';
@SNMP::Info::Layer3::Dell::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::Dell::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = ( %SNMP::Info::Layer3::MIBS,
'RADLAN-Physicaldescription-MIB' => 'rlPhdStackReorder',
'RADLAN-rlInterfaces' => 'rlIfNumOfLoopbackPorts',
@@ -210,9 +209,9 @@ sub _vendor {
my $id = $dell->id() || 'undef';
my %oidmap = (
2 => 'ibm',
171 => 'dlink',
674 => 'dell',
2 => 'ibm',
171 => 'dlink',
674 => 'dell',
3955 => 'linksys',
);
$id = $1 if (defined($id) && $id =~ /^\.1\.3\.6\.1\.4\.1\.(\d+)/);

View File

@@ -31,22 +31,21 @@
package SNMP::Info::Layer3::Enterasys;
use strict;
use Exporter;
use SNMP::Info::MAU;
use SNMP::Info::LLDP;
use SNMP::Info::CDP;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
$VERSION = '1.09';
@SNMP::Info::Layer3::Enterasys::ISA = qw/SNMP::Info::MAU SNMP::Info::LLDP
SNMP::Info::CDP SNMP::Info::Layer3
Exporter/;
@SNMP::Info::Layer3::Enterasys::EXPORT_OK = qw//;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
%SNMP::Info::CDP::MIBS,
@@ -83,7 +82,7 @@ sub model {
unless (defined $id){
print " SNMP::Info::Layer3::Enterasys::model() - Device does not support sysObjectID\n" if $enterasys->debug();
return undef;
return;
}
my $model = &SNMP::translateObj($id);
@@ -106,13 +105,13 @@ sub os {
sub os_ver {
my $enterasys = shift;
my $descr = $enterasys->description();
return undef unless defined $descr;
return unless defined $descr;
if ($descr =~ m/\bRev ([\d.]*)/){
return $1;
}
return undef;
return;
}
# Use ifName as it is used for CDP and LLDP.

View File

@@ -33,18 +33,17 @@
package SNMP::Info::Layer3::Extreme;
use strict;
use Exporter;
use SNMP::Info::Layer3;
use SNMP::Info::MAU;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
$VERSION = '1.09';
@SNMP::Info::Layer3::Extreme::ISA = qw/SNMP::Info::Layer3 SNMP::Info::MAU Exporter/;
@SNMP::Info::Layer3::Extreme::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = ( %SNMP::Info::Layer3::MIBS,
%SNMP::Info::MAU::MIBS,
'EXTREME-BASE-MIB' => 'extremeAgent',
@@ -103,7 +102,7 @@ sub model {
unless (defined $id){
print " SNMP::Info::Layer3::Extreme::model() - Device does not support sysObjectID\n" if $extreme->debug();
return undef;
return;
}
my $model = &SNMP::translateObj($id);
@@ -124,13 +123,13 @@ sub os {
sub os_ver {
my $extreme = shift;
my $descr = $extreme->description();
return undef unless defined $descr;
return unless defined $descr;
if ($descr =~ m/Version ([\d.]*)/){
return $1;
}
return undef;
return;
}
#
@@ -188,7 +187,7 @@ sub bp_index {
sub munge_true_ok {
my $val = shift;
return undef unless defined($val);
return unless defined($val);
return "OK" if ($val eq 'true');
return "Not OK" if ($val eq 'false');
return $val;
@@ -196,7 +195,7 @@ sub munge_true_ok {
sub munge_power_stat {
my $val = shift;
return undef unless defined($val);
return unless defined($val);
$val =~ s/^present//;
$val =~ s/^not/Not /i;
return $val;
@@ -223,7 +222,7 @@ sub fan {
$ret .= $s . $i . ": " . $fan_state->{$i};
$s = ", ";
}
return undef if ($s eq "");
return if ($s eq "");
$ret;
}
@@ -404,13 +403,13 @@ sub _extreme_set_i_vlan {
my $encapidx = $encapif{$vlan_id};
if (!defined($encapidx)) {
$extreme->error_throw("can't map $vlan_id to encapsulation interface");
return undef;
return;
}
# now find vlan interface stacked above encap
my @abovevlan = keys %{$invstack->{$encapidx}};
if (@abovevlan != 1) {
$extreme->error_throw("can't map encap interface $encapidx for $vlan_id to encapsulation interface");
return undef;
return;
}
my $vlanidx = $abovevlan[0];
my $rv;
@@ -422,14 +421,14 @@ sub _extreme_set_i_vlan {
$rv = $extreme->set_ifStackStatus("destroy", $oldidx . "." . $ifindex);
unless ($rv) {
$extreme->error_throw("Unable to remove $ifindex from old VLAN index $oldidx");
return undef;
return;
}
}
# Add new VLAN mapping
$rv = $extreme->set_ifStackStatus("createAndGo", $vlanidx . "." . $ifindex);
unless ($rv) {
$extreme->error_throw("Unable to add new VLAN index $vlanidx to ifIndex $ifindex");
return undef;
return;
}
# XXX invalidate cache of ifstack?
# XXX Info.pm library function for this?
@@ -449,12 +448,12 @@ sub set_remove_i_vlan_tagged {
my $encapidx = $encapif{$vlan_id};
if (!defined($encapidx)) {
$extreme->error_throw("can't map $vlan_id to encapsulation interface");
return undef;
return;
}
my $rv = $extreme->set_ifStackStatus("destroy", $encapidx . "." . $ifindex);
unless ($rv) {
$extreme->error_throw("Unable to delete VLAN encap ifIndex $encapidx for VLAN $vlan_id from ifIndex $ifindex");
return undef;
return;
}
# invalidate cache of ifstack?
return $rv;
@@ -470,12 +469,12 @@ sub set_add_i_vlan_tagged {
my $encapidx = $encapif{$vlan_id};
if (!defined($encapidx)) {
$extreme->error_throw("can't map $vlan_id to encapsulation interface");
return undef;
return;
}
my $rv = $extreme->set_ifStackStatus("createAndGo", $encapidx . "." . $ifindex);
unless ($rv) {
$extreme->error_throw("Unable to add VLAN encap ifIndex $encapidx for VLAN $vlan_id to ifIndex $ifindex");
return undef;
return;
}
# invalidate cache of ifstack?
return $rv;

View File

@@ -33,20 +33,19 @@
package SNMP::Info::Layer3::Foundry;
use strict;
use Exporter;
use SNMP::Info::Layer3;
use SNMP::Info::FDP;
use SNMP::Info::LLDP;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
$VERSION = '1.09';
@SNMP::Info::Layer3::Foundry::ISA = qw/SNMP::Info::FDP SNMP::Info::LLDP
SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::Foundry::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = ( %SNMP::Info::Layer3::MIBS,
%SNMP::Info::LLDP::MIBS,
%SNMP::Info::FDP::MIBS,
@@ -257,7 +256,7 @@ sub stp_p_state {
my $descr = $foundry->description();
if ($descr =~ m/\bEdgeIron 24G\b/) {
return undef;
return;
}
return $foundry->SUPER::stp_p_state($partial) || {};

View File

@@ -31,20 +31,19 @@
package SNMP::Info::Layer3::HP9300;
use strict;
use Exporter;
use SNMP::Info::Layer3;
use SNMP::Info::FDP;
use SNMP::Info::LLDP;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
$VERSION = '1.09';
@SNMP::Info::Layer3::HP9300::ISA = qw/SNMP::Info::FDP SNMP::Info::LLDP
SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::HP9300::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = ( %SNMP::Info::Layer3::MIBS,
%SNMP::Info::LLDP::MIBS,
%SNMP::Info::FDP::MIBS,

View File

@@ -30,14 +30,17 @@
package SNMP::Info::Layer3::Juniper;
use strict;
use Exporter;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
$VERSION = '1.09';
@SNMP::Info::Layer3::Juniper::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::Juniper::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/ ;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
'JUNIPER-CHASSIS-DEFINES-MIB' => 'jnxChassisDefines',
@@ -68,12 +71,12 @@ sub os {
sub os_ver {
my $juniper = shift;
my $descr = $juniper->description();
return undef unless defined $descr;
return unless defined $descr;
if ($descr =~ m/kernel JUNOS (\S+)/) {
return $1;
}
return undef;
return;
}
sub model {
@@ -82,7 +85,7 @@ sub model {
unless (defined $id){
print " SNMP::Info::Layer3::Juniper::model() - Device does not support sysObjectID\n" if $l3->debug();
return undef;
return;
}
my $model = &SNMP::translateObj($id);

View File

@@ -29,15 +29,18 @@
# POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Microsoft;
$VERSION = '1.09';
use strict;
use Exporter;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
@SNMP::Info::Layer3::Microsoft::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::Microsoft::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/ ;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
);

View File

@@ -31,18 +31,17 @@
package SNMP::Info::Layer3::N1600;
use strict;
use Exporter;
use SNMP::Info::Layer3;
use SNMP::Info::SONMP;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
$VERSION = '1.09';
@SNMP::Info::Layer3::N1600::ISA = qw/SNMP::Info::Layer3 SNMP::Info::SONMP Exporter/;
@SNMP::Info::Layer3::N1600::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = ( %SNMP::Info::Layer3::MIBS,
%SNMP::Info::SONMP::MIBS,
'SWL2MGMT-MIB' => 'swL2MgmtMIB',
@@ -80,7 +79,7 @@ sub model {
unless (defined $id){
print " SNMP::Info::Layer3::N1600::model() - Device does not support sysObjectID\n" if $n1600->debug();
return undef;
return;
}
my $model = &SNMP::translateObj($id);
@@ -102,13 +101,13 @@ sub os {
sub os_ver {
my $n1600 = shift;
my $descr = $n1600->description();
return undef unless defined $descr;
return unless defined $descr;
if ($descr =~ m/(\d+\.\d+\.\d+\.\d+)/){
return $1;
}
return undef;
return;
}
sub interfaces {

View File

@@ -30,14 +30,17 @@
package SNMP::Info::Layer3::NetSNMP;
use strict;
use Exporter;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
$VERSION = '1.09';
@SNMP::Info::Layer3::NetSNMP::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::NetSNMP::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/ ;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
'UCD-SNMP-MIB' => 'versionTag',
@@ -68,7 +71,7 @@ sub os {
my $descr = $netsnmp->description();
return $1 if ($descr =~ /^(\S+)\s+/);
return undef;
return;
}
sub os_ver {

View File

@@ -29,17 +29,18 @@
# POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Netscreen;
$VERSION = '1.09';
use strict;
use strict;
use Exporter;
use SNMP::Info::Layer3;
@SNMP::Info::Layer3::Netscreen::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::Netscreen::EXPORT_OK = qw//;
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
'NETSCREEN-SMI' => 'netscreenSetting',
@@ -80,7 +81,7 @@ sub os_ver {
if ( $descr =~ m/version (\d\S*) \(SN: /) {
return $1;
}
return undef;
return;
}
sub serial {
@@ -95,7 +96,7 @@ sub serial {
if ( $descr =~ m/version .*\(SN: (\d\S*),/) {
return $1;
}
return undef;
return;
}
1;

View File

@@ -29,21 +29,21 @@
# POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Passport;
$VERSION = '1.09';
use strict;
use Exporter;
use SNMP::Info::SONMP;
use SNMP::Info::RapidCity;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
@SNMP::Info::Layer3::Passport::ISA = qw/SNMP::Info::SONMP SNMP::Info::RapidCity
SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::Passport::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
%SNMP::Info::RapidCity::MIBS,
@@ -74,7 +74,7 @@ sub model {
unless (defined $id){
print " SNMP::Info::Layer3::Passport::model() - Device does not support sysObjectID\n" if $passport->debug();
return undef;
return;
}
my $model = &SNMP::translateObj($id);
@@ -96,7 +96,7 @@ sub os {
sub os_ver {
my $passport = shift;
my $descr = $passport->description();
return undef unless defined $descr;
return unless defined $descr;
#ERS / Passport
if ($descr =~ m/(\d+\.\d+\.\d+\.\d+)/){
@@ -106,7 +106,7 @@ sub os_ver {
if ($descr =~ m/(\d+\.\d+\.\d+)/){
return $1;
}
return undef;
return;
}
sub i_index {
@@ -512,7 +512,7 @@ sub root_ip {
my $ip = $sonmp_topo_ip->{$entry};
return $ip if ( (defined $ip) and ($ip ne '0.0.0.0') and ($passport->snmp_connect_ip($ip)) );
}
return undef;
return;
}
# Required for SNMP::Info::SONMP

View File

@@ -29,17 +29,18 @@
# POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Sun;
$VERSION = '1.09';
use strict;
use Exporter;
use SNMP::Info::Layer3;
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
@SNMP::Info::Layer3::Sun::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::Sun::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/ ;
$VERSION = '1.09';
%MIBS = (
%SNMP::Info::Layer3::MIBS,
);
@@ -69,12 +70,12 @@ sub os {
sub os_ver {
my $sun = shift;
my $descr = $sun->motd();
return undef unless defined $descr;
return unless defined $descr;
if ($descr =~ m/SunOS (\S+)/) {
return $1;
}
return undef;
return;
}
sub model {