Prepped for 1.0 :

- some minor white space changes (\t -> spaces)
    - removed email
    - removed $DEBUG, $INIT and $SNMP::debugging references
    - rev'd version
This commit is contained in:
Max Baker
2005-01-28 08:39:35 +00:00
parent afe5436749
commit ff07325a05
9 changed files with 205 additions and 258 deletions

View File

@@ -1,5 +1,5 @@
# SNMP::Info::Layer3::Aironet
# Max Baker <max@warped.org>
# Max Baker
#
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
#
@@ -30,7 +30,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Aironet;
$VERSION = 0.9;
$VERSION = 1.0;
# $Id$
use strict;
@@ -42,10 +42,6 @@ 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//;
$DEBUG=0;
$SNMP::debugging=$DEBUG;
$INIT = 0;
%MIBS = (
%SNMP::Info::Layer3::MIBS,
'AWCVX-MIB' => 'awcIfTable',
@@ -220,7 +216,7 @@ SNMP::Info::Layer3::Aironet - Perl5 Interface to Cisco Aironet Wireless Devices
=head1 AUTHOR
Max Baker (C<max@warped.org>)
Max Baker
=head1 SYNOPSIS

View File

@@ -2,7 +2,7 @@
# Eric Miller <eric@jeneric.org>
# $Id$
#
# Copyright (c) 2004 Max Baker
# Copyright (c) 2004 Eric Miller
# All Rights Reserved
#
# Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::AlteonAD;
$VERSION = 0.9;
$VERSION = 1.0;
use strict;
@@ -42,26 +42,20 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE /;
@SNMP::Info::Layer3::AlteonAD::ISA = qw/SNMP::Info SNMP::Info::Bridge Exporter/;
@SNMP::Info::Layer3::AlteonAD::EXPORT_OK = qw//;
$DEBUG=0;
# See SNMP::Info for the details of these data structures and
# the interworkings.
$INIT = 0;
%MIBS = (
%SNMP::Info::MIBS,
%SNMP::Info::Bridge::MIBS,
'ALTEON-TIGON-SWITCH-MIB' => 'agSoftwareVersion',
'ALTEON-TS-PHYSICAL-MIB' => 'agPortTableMaxEnt',
'ALTEON-TS-NETWORK-MIB' => 'agPortTableMaxEnt',
'ALTEON-TIGON-SWITCH-MIB' => 'agSoftwareVersion',
'ALTEON-TS-PHYSICAL-MIB' => 'agPortTableMaxEnt',
'ALTEON-TS-NETWORK-MIB' => 'agPortTableMaxEnt',
);
%GLOBALS = (
%SNMP::Info::GLOBALS,
%SNMP::Info::Bridge::GLOBALS,
'sw_ver' => 'agSoftwareVersion',
'tftp_action' => 'agTftpAction',
'tftp_host' => 'agTftpServer',
'sw_ver' => 'agSoftwareVersion',
'tftp_action' => 'agTftpAction',
'tftp_host' => 'agTftpServer',
'tftp_file' => 'agTftpCfgFileName',
'tftp_result' => 'agTftpLastActionStatus',
);
@@ -69,8 +63,8 @@ $INIT = 0;
%FUNCS = (
%SNMP::Info::FUNCS,
%SNMP::Info::Bridge::FUNCS,
'bp_index_2' => 'dot1dBasePortIfIndex',
'i_name2' => 'ifName',
'bp_index_2' => 'dot1dBasePortIfIndex',
'i_name2' => 'ifName',
# From RFC1213-MIB
'at_index' => 'ipNetToMediaIfIndex',
'at_paddr' => 'ipNetToMediaPhysAddress',
@@ -137,12 +131,12 @@ sub interfaces {
my $desc = $descriptions->{$iid};
next unless defined $desc;
if ($desc =~ /(^net\d+)/) {
$desc = $1;
}
elsif (($iid > 256) and ($iid < 266)) {
$desc = ($iid % 256);
}
if ($desc =~ /(^net\d+)/) {
$desc = $1;
}
elsif (($iid > 256) and ($iid < 266)) {
$desc = ($iid % 256);
}
$interfaces{$iid} = $desc;
}
return \%interfaces;
@@ -160,9 +154,9 @@ sub i_duplex {
$duplex = 'half' if $duplex =~ /half/i;
$duplex = 'full' if $duplex =~ /full/i;
my $idx = $if + 256;
my $idx = $if + 256;
$i_duplex{$idx}=$duplex;
}
return \%i_duplex;
@@ -180,22 +174,22 @@ sub i_duplex_admin {
foreach my $if (keys %$ag_pref){
my $pref = $ag_pref->{$if};
next unless defined $pref;
my $string = 'other';
if ($pref =~ /gigabit/i) {
my $ge_auto = $ag_ge_auto->{$if};
$string = 'full' if ($ge_auto =~ /off/i);
$string = 'auto' if ($ge_auto =~ /on/i);
}
elsif ($pref =~ /fast/i) {
my $fe_auto = $ag_fe_auto->{$if};
my $fe_mode = $ag_fe_mode->{$if};
$string = 'half' if ($fe_mode =~ /half/i and $fe_auto =~ /off/i);
my $string = 'other';
if ($pref =~ /gigabit/i) {
my $ge_auto = $ag_ge_auto->{$if};
$string = 'full' if ($ge_auto =~ /off/i);
$string = 'auto' if ($ge_auto =~ /on/i);
}
elsif ($pref =~ /fast/i) {
my $fe_auto = $ag_fe_auto->{$if};
my $fe_mode = $ag_fe_mode->{$if};
$string = 'half' if ($fe_mode =~ /half/i and $fe_auto =~ /off/i);
$string = 'full' if ($fe_mode =~ /full/i and $fe_auto =~ /off/i);
$string = 'auto' if $fe_auto =~ /on/i;
}
my $idx = $if + 256;
}
my $idx = $if + 256;
$i_duplex_admin{$idx}=$string;
}
return \%i_duplex_admin;
@@ -211,15 +205,15 @@ sub i_vlan {
my %i_vlan;
foreach my $if (keys %$ip_vlans){
my $ip_vlanid = $ip_vlans->{$if};
next unless defined $ip_vlanid;
next unless defined $ip_vlanid;
$i_vlan{$if}=$ip_vlanid;
}
foreach my $if (keys %$ag_vlans){
my $ag_vlanid = $ag_vlans->{$if};
next unless defined $ag_vlanid;
next unless defined $ag_vlanid;
my $idx = $if + 256;
my $idx = $if + 256;
$i_vlan{$idx}=$ag_vlanid;
}
return \%i_vlan;
@@ -232,7 +226,7 @@ sub i_name {
my %i_name;
foreach my $iid (keys %$p_name){
my $name = $p_name->{$iid};
next unless defined $name;
next unless defined $name;
my $idx = $iid + 256;
$i_name{$idx} = $name;
}
@@ -250,7 +244,7 @@ sub bp_index {
next unless defined $port;
$port = $port + 256;
$bp_index{$iid} = $port;
$bp_index{$iid} = $port;
}
return \%bp_index;
}
@@ -259,10 +253,10 @@ sub root_ip {
my $alteon = shift;
my $ip_table = $alteon->ip_table();
# Return First IP Address
# Return First IP Address
foreach my $entry (keys %$ip_table){
my $router_ip = $ip_table->{$entry};
print " SNMP::Layer3::AlteonAD::root_ip() using $router_ip\n" if $DEBUG;
print " SNMP::Layer3::AlteonAD::root_ip() using $router_ip\n" if $alteon->debug();
next unless $router_ip;
return $router_ip if ($router_ip ne '0.0.0.0');
}

View File

@@ -2,7 +2,7 @@
# Eric Miller <eric@jeneric.org>
# $Id$
#
# Copyright (c) 2004 Max Baker
# Copyright (c) 2004 Eric Miller, Max Baker
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::BayRS;
$VERSION = 0.9;
$VERSION = 1.0;
use strict;
@@ -42,19 +42,13 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE %MODEL_MAP/;
@SNMP::Info::Layer3::BayRS::ISA = qw/SNMP::Info SNMP::Info::Bridge Exporter/;
@SNMP::Info::Layer3::BayRS::EXPORT_OK = qw//;
$DEBUG=0;
# See SNMP::Info for the details of these data structures and
# the interworkings.
$INIT = 0;
%MIBS = (
%SNMP::Info::MIBS,
%SNMP::Info::Bridge::MIBS,
'Wellfleet-HARDWARE-MIB' => 'wfHwBpIdOpt',
'Wellfleet-OSPF-MIB' => 'wfOspfRouterId',
'Wellfleet-DOT1QTAG-CONFIG-MIB' => 'wfDot1qTagCfgVlanName',
'Wellfleet-CSMACD-MIB' => 'wfCSMACDCct',
'Wellfleet-HARDWARE-MIB' => 'wfHwBpIdOpt',
'Wellfleet-OSPF-MIB' => 'wfOspfRouterId',
'Wellfleet-DOT1QTAG-CONFIG-MIB' => 'wfDot1qTagCfgVlanName',
'Wellfleet-CSMACD-MIB' => 'wfCSMACDCct',
);
%GLOBALS = (
@@ -68,37 +62,37 @@ $INIT = 0;
%FUNCS = (
%SNMP::Info::FUNCS,
%SNMP::Info::Bridge::FUNCS,
'i_name2' => 'ifName',
'i_name2' => 'ifName',
# From RFC1213-MIB
'at_index' => 'ipNetToMediaIfIndex',
'at_paddr' => 'ipNetToMediaPhysAddress',
'at_netaddr' => 'ipNetToMediaNetAddress',
# From Wellfleet-CSMACD-MIB::wfCSMACDTable
'wf_csmacd_cct' => 'wfCSMACDCct',
'wf_csmacd_cct' => 'wfCSMACDCct',
'wf_csmacd_slot' => 'wfCSMACDSlot',
'wf_csmacd_conn' => 'wfCSMACDConnector',
'wf_csmacd_mtu' => 'wfCSMACDMtu',
'wf_duplex' => 'wfCSMACDLineCapability',
'wf_csmacd_line' => 'wfCSMACDLineNumber',
'wf_csmacd_mtu' => 'wfCSMACDMtu',
'wf_duplex' => 'wfCSMACDLineCapability',
'wf_csmacd_line' => 'wfCSMACDLineNumber',
# From Wellfleet-CSMACD-MIB::wfCSMACDAutoNegTable
'wf_auto' => 'wfCSMACDAutoNegSpeedSelect',
'wf_auto' => 'wfCSMACDAutoNegSpeedSelect',
# From Wellfleet-DOT1QTAG-CONFIG-MIB::wfDot1qTagConfigTable
'wf_vlan_name' => 'wfDot1qTagCfgVlanName',
'wf_local_vlan_id' => 'wfDot1qTagCfgLocalVlanId',
'wf_global_vlan_id' => 'wfDot1qTagCfgGlobalVlanId',
'wf_vlan_port' => 'wfDot1qTagCfgPhysicalPortId',
# From Wellfleet-HARDWARE-MIB::wfHwTable
'wf_vlan_port' => 'wfDot1qTagCfgPhysicalPortId',
# From Wellfleet-HARDWARE-MIB::wfHwTable
'wf_hw_slot' => 'wfHwSlot',
'wf_hw_mod_id' => 'wfHwModIdOpt',
'wf_hw_mod_rev' => 'wfHwModRev',
'wf_hw_mod_ser' => 'wfHwModSerialNumber',
'wf_hw_mod_id' => 'wfHwModIdOpt',
'wf_hw_mod_rev' => 'wfHwModRev',
'wf_hw_mod_ser' => 'wfHwModSerialNumber',
'wf_hw_mobo_id' => 'wfHwMotherBdIdOpt ',
'wf_hw_mobo_rev' => 'wfHwMotherBdRev',
'wf_hw_mobo_ser' => 'wfHwMotherBdSerialNumber',
'wf_hw_diag' => 'wfHwDiagPromRev',
'wf_hw_boot' => 'wfHwBootPromRev',
'wf_hw_mobo_mem' => 'wfHwMotherBdMemorySize',
'wf_hw_cfg_time' => 'wfHwConfigDateAndTime ',
'wf_hw_mobo_ser' => 'wfHwMotherBdSerialNumber',
'wf_hw_diag' => 'wfHwDiagPromRev',
'wf_hw_boot' => 'wfHwBootPromRev',
'wf_hw_mobo_mem' => 'wfHwMotherBdMemorySize',
'wf_hw_cfg_time' => 'wfHwConfigDateAndTime ',
);
%MUNGE = (
@@ -108,20 +102,20 @@ $INIT = 0;
);
%MODEL_MAP = (
'acefn' => 'FN',
'aceln' => 'LN',
'acecn' => 'CN',
'afn' => 'AFN',
'in' => 'IN',
'an' => 'AN',
'arn' => 'ARN',
'sys5000' => '5000',
'freln' => 'BLN',
'frecn' => 'BCN',
'frerbln' => 'BLN-2',
'asn' => 'ASN',
'asnzcable' => 'ASN-Z',
'asnbcable' => 'ASN-B',
'acefn' => 'FN',
'aceln' => 'LN',
'acecn' => 'CN',
'afn' => 'AFN',
'in' => 'IN',
'an' => 'AN',
'arn' => 'ARN',
'sys5000' => '5000',
'freln' => 'BLN',
'frecn' => 'BCN',
'frerbln' => 'BLN-2',
'asn' => 'ASN',
'asnzcable' => 'ASN-Z',
'asnbcable' => 'ASN-B',
);
sub model {
@@ -170,7 +164,7 @@ sub interfaces {
my $desc = $description->{$iid};
next unless defined $desc;
$desc = $1 if $desc =~ /(^[A-Z]\d+)/;
$desc = $1 if $desc =~ /(^[A-Z]\d+)/;
$interfaces{$iid} = $desc;
}
@@ -179,8 +173,8 @@ sub interfaces {
next unless defined $vlan;
my $vlan_if = $vlan_idx->{$iid};
next unless defined $vlan_if;
my $desc = 'V' . $vlan;
my $desc = 'V' . $vlan;
$interfaces{$vlan_if} = $desc;
}
@@ -203,7 +197,7 @@ sub i_name {
# Get VLAN Virtual Router Interfaces
foreach my $vid (keys %$v_name){
my $v_name = $v_name->{$vid};
next unless defined $v_name;
next unless defined $v_name;
my $vlan_if = $vlan_idx->{$vid};
next unless defined $vlan_if;
@@ -227,7 +221,7 @@ sub i_duplex {
my $string = 'half';
$string = 'full' if $duplex =~ /duplex/i;
$i_duplex{$idx}=$string;
}
return \%i_duplex;
@@ -248,22 +242,22 @@ sub i_duplex_admin {
next unless defined $idx;
my $duplex = $wf_duplex->{$if};
next unless defined $duplex;
my $slot = $wf_slot->{$if};
my $conn = $wf_conn->{$if};
my $auto_idx = "$slot.$conn";
my $auto = $wf_auto->{$auto_idx};
my $string = 'other';
if ($auto) {
$string = 'half';
$string = 'full' if $auto =~ /duplex/i;
$string = 'auto' if $auto =~ /nway/i;
}
elsif ($duplex) {
$string = 'half';
$string = 'full' if $duplex =~ /duplex/i;
}
my $slot = $wf_slot->{$if};
my $conn = $wf_conn->{$if};
my $auto_idx = "$slot.$conn";
my $auto = $wf_auto->{$auto_idx};
my $string = 'other';
if ($auto) {
$string = 'half';
$string = 'full' if $auto =~ /duplex/i;
$string = 'auto' if $auto =~ /nway/i;
}
elsif ($duplex) {
$string = 'half';
$string = 'full' if $duplex =~ /duplex/i;
}
$i_duplex_admin{$idx}=$string;
}
return \%i_duplex_admin;
@@ -272,41 +266,41 @@ sub i_duplex_admin {
sub i_vlan {
my $bayrs = shift;
my $wf_cct = $bayrs->wf_csmacd_cct();
my $wf_mtu = $bayrs->wf_csmacd_mtu();
my $wf_line = $bayrs->wf_csmacd_line();
my $wf_local_vid = $bayrs->wf_local_vlan_id();
my $wf_global_vid = $bayrs->wf_global_vlan_id();
my $wf_vport = $bayrs->wf_vlan_port();
my $wf_cct = $bayrs->wf_csmacd_cct();
my $wf_mtu = $bayrs->wf_csmacd_mtu();
my $wf_line = $bayrs->wf_csmacd_line();
my $wf_local_vid = $bayrs->wf_local_vlan_id();
my $wf_global_vid = $bayrs->wf_global_vlan_id();
my $wf_vport = $bayrs->wf_vlan_port();
my %i_vlan;
# Look for VLANs on Ethernet Interfaces
foreach my $if (keys %$wf_cct){
my $idx = $wf_cct->{$if};
next unless defined $idx;
# Check MTU size, if unable to carry VLAN tag skip.
my $mtu = $wf_mtu->{$if};
next unless defined $idx;
# Check MTU size, if unable to carry VLAN tag skip.
my $mtu = $wf_mtu->{$if};
next if (($mtu =~ /default/i) or ($mtu < 1522));
my $line = $wf_line->{$if};
my @vlans = ();
foreach my $v_idx (keys %$wf_vport){
my $port = $wf_vport->{$v_idx};
next unless defined $port;
next if ($port != $line);
my $vlan = $wf_global_vid->{$v_idx};
push(@vlans, $vlan);
}
my $vlans = join (',', @vlans);
$i_vlan{$idx}=$vlans;
my $line = $wf_line->{$if};
my @vlans = ();
foreach my $v_idx (keys %$wf_vport){
my $port = $wf_vport->{$v_idx};
next unless defined $port;
next if ($port != $line);
my $vlan = $wf_global_vid->{$v_idx};
push(@vlans, $vlan);
}
my $vlans = join (',', @vlans);
$i_vlan{$idx}=$vlans;
}
# Add VLAN on VLAN Interfaces
foreach my $idx (keys %$wf_global_vid){
my $v_if = $wf_local_vid->{$idx};
next unless defined $v_if;
next unless defined $v_if;
my $vlan = $wf_global_vid->{$idx};
next unless defined $vlan;
next unless defined $vlan;
$i_vlan{$v_if}=$vlan;
}
return \%i_vlan;
@@ -315,28 +309,28 @@ sub i_vlan {
sub root_ip {
my $bayrs = shift;
my $ip_index = $bayrs->ip_index();
my $ip_table = $bayrs->ip_table();
my $ip_index = $bayrs->ip_index();
my $ip_table = $bayrs->ip_table();
# Check for CLIP
foreach my $entry (keys %$ip_index){
my $idx = $ip_index->{$entry};
next unless $idx == 0;
my $clip = $ip_table->{$entry};
next unless ((defined $clip) and ($clip eq '0.0.0.0'));
print " SNMP::Layer3::BayRS::root_ip() using $clip\n" if $DEBUG;
return $clip;
next unless $idx == 0;
my $clip = $ip_table->{$entry};
next unless ((defined $clip) and ($clip eq '0.0.0.0'));
print " SNMP::Layer3::BayRS::root_ip() using $clip\n" if $bayrs->debug();
return $clip;
}
# Check for OSPF Router ID
my $ospf_ip = $bayrs->ospf_rtr_id();
if ((defined $ospf_ip) and ($ospf_ip ne '0.0.0.0')) {
print " SNMP::Layer3::BayRS::root_ip() using $ospf_ip\n" if $DEBUG;
return $ospf_ip;
print " SNMP::Layer3::BayRS::root_ip() using $ospf_ip\n" if $bayrs->debug();
return $ospf_ip;
}
# Else Return First IP Address
foreach my $entry (keys %$ip_table){
my $ip = $ip_table->{$entry};
print " SNMP::Layer3::BayRS::root_ip() using $ip\n" if $DEBUG;
print " SNMP::Layer3::BayRS::root_ip() using $ip\n" if $bayrs->debug();
next unless $ip;
return $ip if ($ip ne '0.0.0.0');
}
@@ -429,20 +423,20 @@ Returns the model of the BayRS router. Will translate between the MIB model and
the common model with this map :
%MODEL_MAP = (
'acefn' => 'FN',
'aceln' => 'LN',
'acecn' => 'CN',
'afn' => 'AFN',
'in' => 'IN',
'an' => 'AN',
'arn' => 'ARN',
'sys5000' => '5000',
'freln' => 'BLN',
'frecn' => 'BCN',
'frerbln' => 'BLN-2',
'asn' => 'ASN',
'asnzcable' => 'ASN-Z',
'asnbcable' => 'ASN-B',
'acefn' => 'FN',
'aceln' => 'LN',
'acecn' => 'CN',
'afn' => 'AFN',
'in' => 'IN',
'an' => 'AN',
'arn' => 'ARN',
'sys5000' => '5000',
'freln' => 'BLN',
'frecn' => 'BCN',
'frerbln' => 'BLN-2',
'asn' => 'ASN',
'asnzcable' => 'ASN-Z',
'asnbcable' => 'ASN-B',
);
=item $bayrs->vendor()

View File

@@ -1,5 +1,5 @@
# SNMP::Info::Layer3::C3550
# Max Baker <max@warped.org>
# Max Baker
#
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
# Copyright (c) 2003, Regents of the University of California
@@ -46,12 +46,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
SNMP::Info::CiscoStats SNMP::Info::CDP Exporter /;
@SNMP::Info::Layer3::C3550::EXPORT_OK = qw//;
$DEBUG=0;
# See SNMP::Info for the details of these data structures and
# the interworkings.
$INIT = 0;
%MIBS = (
%SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoVTP::MIBS,
@@ -140,7 +134,7 @@ SNMP::Info::Layer3::C3550 - Perl5 Interface to Cisco Catalyst 3550 Layer 2/3 Swi
=head1 AUTHOR
Max Baker (C<max@warped.org>)
Max Baker
=head1 SYNOPSIS

View File

@@ -1,7 +1,7 @@
# SNMP::Info::Layer3::C6500
# Max Baker <max@warped.org>
# Max Baker
#
# Copyright (c) 2003,2004 Max Baker
# Copyright (c) 2003,2004,2005 Max Baker
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -45,12 +45,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
SNMP::Info::CiscoStats SNMP::Info::CDP Exporter/;
@SNMP::Info::Layer3::C6500::EXPORT_OK = qw//;
$DEBUG=0;
# See SNMP::Info for the details of these data structures and
# the interworkings.
$INIT = 0;
%MIBS = (
%SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoVTP::MIBS,
@@ -109,7 +103,7 @@ SNMP::Info::Layer3::C6500 - Perl5 Interface to Cisco Catalyst 6500 Layer 2/3 Swi
=head1 AUTHOR
Max Baker (C<max@warped.org>)
Max Baker
=head1 SYNOPSIS

View File

@@ -1,7 +1,7 @@
# SNMP::Info::Layer3::Cisco
# Max Baker <max@warped.org>
# Max Baker
#
# Copyright (c) 2004 Max Baker
# Copyright (c) 2004,2005 Max Baker
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -44,12 +44,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
Exporter/;
@SNMP::Info::Layer3::Cisco::EXPORT_OK = qw//;
$DEBUG=0;
# See SNMP::Info for the details of these data structures and
# the interworkings.
$INIT = 0;
%MIBS = (
%SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoVTP::MIBS,
@@ -88,7 +82,7 @@ that are not covered in other classes.
=head1 AUTHOR
Max Baker (C<max@warped.org>)
Max Baker
=head1 SYNOPSIS

View File

@@ -2,7 +2,7 @@
# Eric Miller <eric@jeneric.org>
# $Id$
#
# Copyright (c) 2004 Max Baker
# Copyright (c) 2004 Eric Miller, Max Baker
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Contivity;
$VERSION = 0.9;
$VERSION = 1.0;
use strict;
@@ -42,12 +42,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
@SNMP::Info::Layer3::Contivity::ISA = qw/SNMP::Info SNMP::Info::Entity Exporter/;
@SNMP::Info::Layer3::Contivity::EXPORT_OK = qw//;
$DEBUG=0;
# See SNMP::Info for the details of these data structures and
# the interworkings.
$INIT = 0;
%MIBS = (
%SNMP::Info::MIBS,
%SNMP::Info::Entity::MIBS,
@@ -170,7 +164,7 @@ sub root_ip {
# Return First IP Address
foreach my $entry (keys %$ip_table){
my $router_ip = $ip_table->{$entry};
print " SNMP::Layer3::Contivity::root_ip() using $router_ip\n" if $DEBUG;
print " SNMP::Layer3::Contivity::root_ip() using $router_ip\n" if $contivity->debug();
next unless $router_ip;
return $router_ip if ($router_ip ne '0.0.0.0');
}

View File

@@ -1,7 +1,7 @@
# SNMP::Info::Layer3::Foundry - SNMP Interface to Foundry devices
# Max Baker <max@warped.org>
# Max Baker
#
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
# 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.
@@ -30,7 +30,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Foundry;
$VERSION = 0.9;
$VERSION = 1.0;
# $Id$
use strict;
@@ -45,11 +45,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
@SNMP::Info::Layer3::Foundry::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::FDP Exporter/;
@SNMP::Info::Layer3::Foundry::EXPORT_OK = qw//;
$DEBUG=0;
$SNMP::debugging=$DEBUG;
$INIT = 0;
%MIBS = ( %SNMP::Info::MIBS,
%SNMP::Info::Bridge::MIBS,
%SNMP::Info::FDP::MIBS,
@@ -255,7 +250,7 @@ SNMP::Info::Layer3::Foundry - Perl5 Interface to Foundry FastIron Network Device
=head1 AUTHOR
Max Baker (C<max@warped.org>)
Max Baker
=head1 SYNOPSIS

View File

@@ -2,7 +2,7 @@
# Eric Miller <eric@jeneric.org>
# $Id$
#
# Copyright (c) 2004 Max Baker
# Copyright (c) 2004 Eric Miller, Max Baker
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Passport;
$VERSION = 0.9;
$VERSION = 1.0;
use strict;
@@ -44,13 +44,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
@SNMP::Info::Layer3::Passport::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::SONMP SNMP::Info::RapidCity Exporter/;
@SNMP::Info::Layer3::Passport::EXPORT_OK = qw//;
$DEBUG=0;
# See SNMP::Info for the details of these data structures and
# the interworkings.
$INIT = 0;
%MIBS = (
%SNMP::Info::MIBS,
%SNMP::Info::Bridge::MIBS,
@@ -74,14 +67,14 @@ $INIT = 0;
%SNMP::Info::RapidCity::FUNCS,
'i_index2' => 'ifIndex',
'i_mac2' => 'ifPhysAddress',
'i_description2' => 'ifDescr',
'i_description2' => 'ifDescr',
'i_name2' => 'ifName',
'ip_index2' => 'ipAdEntIfIndex',
# From RFC1213-MIB
'at_index' => 'ipNetToMediaIfIndex',
'at_paddr' => 'ipNetToMediaPhysAddress',
'at_netaddr' => 'ipNetToMediaNetAddress',
'i_name2' => 'ifName'
'i_name2' => 'ifName'
);
%MUNGE = (
@@ -136,8 +129,8 @@ sub i_index {
foreach my $iid (keys %$i_index){
my $index = $i_index->{$iid};
next unless defined $index;
$if_index{$iid} = $index;
$if_index{$iid} = $index;
}
# Get VLAN Virtual Router Interfaces
@@ -182,36 +175,35 @@ sub interfaces {
next unless defined $index;
if ($index == 1) {
$if{$index} = 'CPU.Virtual';
$if{$index} = 'CPU.Virtual';
}
elsif (($index == 192) and ($model eq '8603')) {
$if{$index} = 'CPU3';
$if{$index} = 'CPU3';
}
elsif ($index == 320) {
$if{$index} = 'CPU5';
$if{$index} = 'CPU5';
}
elsif ($index == 384) {
$if{$index} = 'CPU6';
$if{$index} = 'CPU6';
}
elsif ($index > 2000) {
my $vlan_index = $reverse_vlan{$iid};
my $v_id = $vlan_id->{$vlan_index};
next unless defined $v_id;
my $v_port = 'V'."$v_id";
$if{$index} = $v_port;
my $vlan_index = $reverse_vlan{$iid};
my $v_id = $vlan_id->{$vlan_index};
next unless defined $v_id;
my $v_port = 'V'."$v_id";
$if{$index} = $v_port;
}
else {
my $port = ($index % 64) + 1;
my $slot = int($index / 64);
my $port = ($index % 64) + 1;
my $slot = int($index / 64);
my $slotport = "$slot.$port";
$if{$iid} = $slotport;
my $slotport = "$slot.$port";
$if{$iid} = $slotport;
}
}
@@ -232,7 +224,7 @@ sub i_mac {
my $mac = $i_mac->{$iid};
next unless defined $mac;
$if_mac{$iid} = $mac;
$if_mac{$iid} = $mac;
}
# Get VLAN Virtual Router Interfaces
@@ -249,12 +241,12 @@ sub i_mac {
my $mac = $cpu_mac->{$iid};
next unless defined $mac;
$if_mac{$iid} = $mac;
$if_mac{$iid} = $mac;
}
# Check for Virtual Mgmt Interface
unless ($virt_ip eq '0.0.0.0'){
my @virt_mac = split /:/, $chassis_base_mac;
my @virt_mac = split /:/, $chassis_base_mac;
$virt_mac[0] = hex($virt_mac[0]);
$virt_mac[1] = hex($virt_mac[1]);
$virt_mac[2] = hex($virt_mac[2]);
@@ -264,7 +256,7 @@ sub i_mac {
my $mac = join(':',map { sprintf "%02x",$_ } @virt_mac);
$if_mac{1} = $mac;
$if_mac{1} = $mac;
}
return \%if_mac;
@@ -281,7 +273,7 @@ sub i_description {
my $if_descr = $i_descr->{$iid};
next unless defined $if_descr;
$descr{$iid} = $if_descr;
$descr{$iid} = $if_descr;
}
# Get VLAN Virtual Router Interfaces
@@ -308,9 +300,9 @@ sub i_name {
my %i_name;
foreach my $iid (keys %$i_index){
if ($iid == 1) {
$i_name{$iid} = 'CPU Virtual Management IP';
if ($iid == 1) {
$i_name{$iid} = 'CPU Virtual Management IP';
}
elsif (($iid == 192) and ($model eq '8603')) {
@@ -318,28 +310,28 @@ sub i_name {
}
elsif ($iid == 320) {
$i_name{$iid} = 'CPU 5 Ethernet Port';
$i_name{$iid} = 'CPU 5 Ethernet Port';
}
elsif ($iid == 384) {
$i_name{$iid} = 'CPU 5 Ethernet Port';
$i_name{$iid} = 'CPU 5 Ethernet Port';
}
elsif ($iid > 2000) {
my $vlan_index = $reverse_vlan{$iid};
my $vlan_name = $v_name->{$vlan_index};
next unless defined $vlan_name;
my $vlan_index = $reverse_vlan{$iid};
my $vlan_name = $v_name->{$vlan_index};
next unless defined $vlan_name;
$i_name{$iid} = $vlan_name;
$i_name{$iid} = $vlan_name;
}
else {
my $name = $i_name2->{$iid};
my $alias = $rc_alias->{$iid};
$i_name{$iid} = (defined $alias and $alias !~ /^\s*$/) ?
my $name = $i_name2->{$iid};
my $alias = $rc_alias->{$iid};
$i_name{$iid} = (defined $alias and $alias !~ /^\s*$/) ?
$alias :
$name;
}
}
}
return \%i_name;
@@ -356,7 +348,7 @@ sub ip_index {
my $iid = $ip_index->{$ip};
next unless defined $iid;
$ip_index{$ip} = $iid;
$ip_index{$ip} = $iid;
}
# Get CPU Ethernet IP
@@ -386,9 +378,9 @@ sub root_ip {
foreach my $iid (keys %$rc_ip_type){
my $ip_type = $rc_ip_type->{$iid};
next unless ((defined $ip_type) and ($ip_type =~ /circuitLess/i));
my $ip = $rc_ip_addr->{$iid};
next unless defined $ip;
my $ip = $rc_ip_addr->{$iid};
next unless defined $ip;
return $ip;
}
@@ -403,7 +395,7 @@ sub root_ip {
my $port = $sonmp_topo_port->{$entry};
next unless $port == 0;
my $ip = $sonmp_topo_ip->{$entry};
return $ip if ((defined $ip) and ($ip ne '0.0.0.0'));
return $ip if ((defined $ip) and ($ip ne '0.0.0.0'));
}
return undef;
}