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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
# SNMP::Info::Layer3::C3550 # 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) 2004 Max Baker changes from version 0.8 and beyond.
# Copyright (c) 2003, Regents of the University of California # 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::CiscoStats SNMP::Info::CDP Exporter /;
@SNMP::Info::Layer3::C3550::EXPORT_OK = qw//; @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 = ( %MIBS = (
%SNMP::Info::Layer3::MIBS, %SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoVTP::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 =head1 AUTHOR
Max Baker (C<max@warped.org>) Max Baker
=head1 SYNOPSIS =head1 SYNOPSIS

View File

@@ -1,7 +1,7 @@
# SNMP::Info::Layer3::C6500 # 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. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # 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::CiscoStats SNMP::Info::CDP Exporter/;
@SNMP::Info::Layer3::C6500::EXPORT_OK = qw//; @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 = ( %MIBS = (
%SNMP::Info::Layer3::MIBS, %SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoVTP::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 =head1 AUTHOR
Max Baker (C<max@warped.org>) Max Baker
=head1 SYNOPSIS =head1 SYNOPSIS

View File

@@ -1,7 +1,7 @@
# SNMP::Info::Layer3::Cisco # 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 # 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:
@@ -44,12 +44,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
Exporter/; Exporter/;
@SNMP::Info::Layer3::Cisco::EXPORT_OK = qw//; @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 = ( %MIBS = (
%SNMP::Info::Layer3::MIBS, %SNMP::Info::Layer3::MIBS,
%SNMP::Info::CiscoVTP::MIBS, %SNMP::Info::CiscoVTP::MIBS,
@@ -88,7 +82,7 @@ that are not covered in other classes.
=head1 AUTHOR =head1 AUTHOR
Max Baker (C<max@warped.org>) Max Baker
=head1 SYNOPSIS =head1 SYNOPSIS

View File

@@ -2,7 +2,7 @@
# Eric Miller <eric@jeneric.org> # Eric Miller <eric@jeneric.org>
# $Id$ # $Id$
# #
# Copyright (c) 2004 Max Baker # Copyright (c) 2004 Eric Miller, Max Baker
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # 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. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Contivity; package SNMP::Info::Layer3::Contivity;
$VERSION = 0.9; $VERSION = 1.0;
use strict; 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::ISA = qw/SNMP::Info SNMP::Info::Entity Exporter/;
@SNMP::Info::Layer3::Contivity::EXPORT_OK = qw//; @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 = ( %MIBS = (
%SNMP::Info::MIBS, %SNMP::Info::MIBS,
%SNMP::Info::Entity::MIBS, %SNMP::Info::Entity::MIBS,
@@ -170,7 +164,7 @@ sub root_ip {
# Return First IP Address # Return First IP Address
foreach my $entry (keys %$ip_table){ foreach my $entry (keys %$ip_table){
my $router_ip = $ip_table->{$entry}; 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; next unless $router_ip;
return $router_ip if ($router_ip ne '0.0.0.0'); 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 # 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 # Copyright (c) 2002,2003 Regents of the University of California
# All rights reserved. # All rights reserved.
@@ -30,7 +30,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package SNMP::Info::Layer3::Foundry; package SNMP::Info::Layer3::Foundry;
$VERSION = 0.9; $VERSION = 1.0;
# $Id$ # $Id$
use strict; 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::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::FDP Exporter/;
@SNMP::Info::Layer3::Foundry::EXPORT_OK = qw//; @SNMP::Info::Layer3::Foundry::EXPORT_OK = qw//;
$DEBUG=0;
$SNMP::debugging=$DEBUG;
$INIT = 0;
%MIBS = ( %SNMP::Info::MIBS, %MIBS = ( %SNMP::Info::MIBS,
%SNMP::Info::Bridge::MIBS, %SNMP::Info::Bridge::MIBS,
%SNMP::Info::FDP::MIBS, %SNMP::Info::FDP::MIBS,
@@ -255,7 +250,7 @@ SNMP::Info::Layer3::Foundry - Perl5 Interface to Foundry FastIron Network Device
=head1 AUTHOR =head1 AUTHOR
Max Baker (C<max@warped.org>) Max Baker
=head1 SYNOPSIS =head1 SYNOPSIS

View File

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