From cac2224fa181ff7219049870a9c313beb413212c Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Wed, 27 Jun 2012 00:19:05 -0400 Subject: [PATCH 1/3] LLDP bug fixes --- ChangeLog | 3 ++- Info/Layer3/Enterasys.pm | 16 +++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e5fdfda..bb95fbef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,8 +20,9 @@ version 2.07 () [BUG FIXES] + * [2929883] [3413999] LLDP interface mapping issue + * [3297786] LLDP TimeMark component defaults to zero (David Baldwin) * [2988163] Detect Juniper SSG firewalls as Layer3::Netscreen (R. Kerr) - * [3297786] LLDP INDEX munged to ignore TimeMark component (David Baldwin) * [3317739] Fix for Baystack without POE on stack member 1 (David Baldwin) * [2037444] os_ver fails on some Extreme versions (Robert Kerr) * [2980789] Fix root_ip to try OSPF RouterID first (Brian De Wolf) diff --git a/Info/Layer3/Enterasys.pm b/Info/Layer3/Enterasys.pm index 44ee09eb..8ecad765 100644 --- a/Info/Layer3/Enterasys.pm +++ b/Info/Layer3/Enterasys.pm @@ -166,12 +166,6 @@ sub fw_port { } # Use CDP and/or LLDP -# -# LLDP table timefilter implementation continuously increments when walked -# and we may never reach the end of the table. This behavior can be -# modified with the "set snmp timefilter break disable" command, -# unfortunately it is not the default. Query with a partial value of zero -# which means no time filter. sub hasCDP { my $enterasys = shift; @@ -184,7 +178,7 @@ sub c_ip { my $partial = shift; my $cdp = $enterasys->SUPER::c_ip($partial) || {}; - my $lldp = $enterasys->lldp_ip(0) || {}; + my $lldp = $enterasys->lldp_ip($partial) || {}; my %c_ip; foreach my $iid ( keys %$cdp ) { @@ -207,7 +201,7 @@ sub c_if { my $enterasys = shift; my $partial = shift; - my $lldp = $enterasys->lldp_if(0) || {}; + my $lldp = $enterasys->lldp_if($partial) || {}; my $cdp = $enterasys->SUPER::c_if($partial) || {}; my %c_if; @@ -231,7 +225,7 @@ sub c_port { my $enterasys = shift; my $partial = shift; - my $lldp = $enterasys->lldp_port(0) || {}; + my $lldp = $enterasys->lldp_port($partial) || {}; my $cdp = $enterasys->SUPER::c_port($partial) || {}; my %c_port; @@ -255,7 +249,7 @@ sub c_id { my $enterasys = shift; my $partial = shift; - my $lldp = $enterasys->lldp_id(0) || {}; + my $lldp = $enterasys->lldp_id($partial) || {}; my $cdp = $enterasys->SUPER::c_id($partial) || {}; my %c_id; @@ -279,7 +273,7 @@ sub c_platform { my $enterasys = shift; my $partial = shift; - my $lldp = $enterasys->lldp_rem_sysdesc(0) || {}; + my $lldp = $enterasys->lldp_rem_sysdesc($partial) || {}; my $cdp = $enterasys->SUPER::c_platform($partial) || {}; my %c_platform; From 63687b5f8f6f9db303eb04cc7e2ec6b5ad23ac90 Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Wed, 27 Jun 2012 00:23:16 -0400 Subject: [PATCH 2/3] [3323842] Juniper EX/SRX correct VLAN tag support - i_vlan() fix --- Info/Layer3/Juniper.pm | 76 +++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 46 deletions(-) diff --git a/Info/Layer3/Juniper.pm b/Info/Layer3/Juniper.pm index da4e8082..6652234a 100644 --- a/Info/Layer3/Juniper.pm +++ b/Info/Layer3/Juniper.pm @@ -38,7 +38,7 @@ use SNMP::Info::LLDP; @SNMP::Info::Layer3::Juniper::ISA = qw/SNMP::Info::Layer3 SNMP::Info::LLDP Exporter/; @SNMP::Info::Layer3::Juniper::EXPORT_OK = qw//; -use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/; +use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE/; $VERSION = '2.07'; @@ -116,10 +116,10 @@ sub serial { # 'i_trunk' => 'jnxExVlanPortAccessMode', sub i_trunk { - my ($juniper) = shift; - my ($partial) = shift; + my $juniper = shift; + my $partial = shift; - my ($access) = $juniper->jnxExVlanPortAccessMode($partial); + my $access = $juniper->jnxExVlanPortAccessMode($partial); my %i_trunk; @@ -134,22 +134,12 @@ sub i_trunk { return \%i_trunk; } -# 'v_name' => 'jnxExVlanName', -sub v_name { - my ($juniper) = shift; - my ($partial) = shift; - - my ($v_name) = $juniper->jnxExVlanName($partial); - - return $v_name; -} - # 'v_type' => 'jnxExVlanType', sub v_type { - my ($juniper) = shift; - my ($partial) = shift; + my $juniper = shift; + my $partial = shift; - my ($v_type) = $juniper->jnxExVlanType($partial); + my $v_type = $juniper->jnxExVlanType($partial); return $v_type; } @@ -165,41 +155,35 @@ sub v_index { } sub i_vlan { - my ($juniper) = shift; - my ($partial) = shift; + my $juniper = shift; + my $partial = shift; my $index = $juniper->bp_index(); - my $v_ports = $juniper->qb_v_egress() || {}; - my ($i_type) = $juniper->i_type($partial); - my ($i_descr) = $juniper->i_description($partial); - my ($v_index) = $juniper->jnxExVlanTag($partial); - - my %i_vlan; - - foreach my $idx ( sort keys %$v_ports ) { - next unless ( defined $v_ports->{$idx} ); - - my $portlist = $v_ports->{$idx}; # is an array reference - my $ret = []; - - # Convert portlist bit array to bp_index array - for ( my $i = 0; $i <= $#$portlist; $i++ ) { - push( @{$ret}, $i + 1 ) if ( @$portlist[$i] ); - } - - foreach my $port ( @{$ret} ) { - my $ifindex = $index->{$port}; - next unless ( defined($ifindex) ); # shouldn't happen - next if ( defined $partial and $ifindex !~ /^$partial$/ ); - - $i_vlan{$ifindex} = $v_index->{$idx}; - } + # If given a partial it will be an ifIndex, we need to use dot1dBasePort + if ($partial) { + my %r_index = reverse %$index; + $partial = $r_index{$partial}; } - return \%i_vlan; -} + my $v_index = $juniper->jnxExVlanTag(); + my $i_pvid = $juniper->qb_i_vlan($partial) || {}; + my $i_vlan = {}; + foreach my $bport ( keys %$i_pvid ) { + my $q_vlan = $i_pvid->{$bport}; + my $vlan = $v_index->{$q_vlan}; + my $ifindex = $index->{$bport}; + unless ( defined $ifindex ) { + print " Port $bport has no bp_index mapping. Skipping.\n" + if $DEBUG; + next; + } + $i_vlan->{$ifindex} = $vlan; + } + + return $i_vlan; +} sub i_vlan_membership { my $juniper = shift; From 3b25711e1ff2ec2d756a0669b0b6c22e2892e57e Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Wed, 27 Jun 2012 20:36:35 -0400 Subject: [PATCH 3/3] * Add method to report current transmit power of the radio interface, dot11_cur_tx_pwr_mw(), in Airespace class * Correct reporting of SSID broadcast status in Airespace class --- ChangeLog | 3 +++ Info/Airespace.pm | 61 +++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb95fbef..01b3e3e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ version 2.07 () [ENHANCEMENTS] + * Add method to report current transmit power of the radio interface, + dot11_cur_tx_pwr_mw(), in Airespace class * [3085411] Activate L3 properties for Netgear GSM7224v2 (phishphreek) * [3085413] SNMP OIDs for Netgear Serial and OS Ver (phishphreek) * [3286549] Dell LLDP Support (Nico Giefing) @@ -20,6 +22,7 @@ version 2.07 () [BUG FIXES] + * Correct reporting of SSID broadcast status in Airespace class * [2929883] [3413999] LLDP interface mapping issue * [3297786] LLDP TimeMark component defaults to zero (David Baldwin) * [2988163] Detect Juniper SSG firewalls as Layer3::Netscreen (R. Kerr) diff --git a/Info/Airespace.pm b/Info/Airespace.pm index 647ba03e..25389ab1 100644 --- a/Info/Airespace.pm +++ b/Info/Airespace.pm @@ -83,7 +83,8 @@ $VERSION = '2.06'; 'airespace_ess_qos' => 'bsnDot11EssQualityOfService', 'airespace_ess_ifname' => 'bsnDot11EssInterfaceName', 'airespace_ess_aclname' => 'bsnDot11EssAclName', - + 'airespace_ess_bcast' => 'bsnDot11EssBroadcastSsid', + # AIRESPACE-WIRELESS-MIB::bsnAPTable 'airespace_ap_mac' => 'bsnAPDot3MacAddress', 'airespace_ap_name' => 'bsnAPName', @@ -105,6 +106,7 @@ $VERSION = '2.06'; 'airespace_apif' => 'bsnAPIfOperStatus', 'airespace_apif_oride' => 'bsnAPIfWlanOverride', 'airespace_apif_admin' => 'bsnAPIfAdminStatus', + 'airespace_apif_a_pwr' => 'bsnAPIfAbsolutePowerList', # AIRESPACE-WIRELESS-MIB::bsnMobileStationTable 'airespace_sta_mac' => 'bsnMobileStationAPMacAddr', @@ -631,15 +633,27 @@ sub i_ssidbcast { my $airespace = shift; my $partial = shift; - my $ssidlist = $airespace->i_ssidlist($partial) || {}; - my $bc_mode = $airespace->airespace_bssid_mode() || 'enable'; + my $ssidlist = $airespace->i_ssidlist($partial) || {}; + my $bc_mode = $airespace->airespace_bssid_mode() || 'enable'; + my $ess_bc_mode = $airespace->airespace_ess_bcast() || {}; + my $ssids = $airespace->airespace_ess_ssid() || {}; + my %ssid_index = reverse %$ssids; my %bcmap = qw/enable 1 disable 0/; my $broadcast = $bcmap{$bc_mode}; my %i_ssidbcast; foreach my $iid ( keys %$ssidlist ) { - $i_ssidbcast{$iid} = $broadcast; + if (!$broadcast) { + $i_ssidbcast{$iid} = $broadcast; + next; + } + else { + my $ssid = $ssidlist->{$iid}; + my $ssid_idx = $ssid_index{$ssid}; + my $bc = $ess_bc_mode->{$ssid_idx}; + $i_ssidbcast{$iid} = $bcmap{$bc}; + } } return \%i_ssidbcast; @@ -661,6 +675,28 @@ sub i_80211channel { return \%i_80211channel; } +sub dot11_cur_tx_pwr_mw { + my $airespace = shift; + my $partial = shift; + my $cur = $airespace->airespace_apif_power($partial); + my $pwr_abs = $airespace->airespace_apif_a_pwr($partial); + + my $dot11_cur_tx_pwr_mw = {}; + foreach my $idx ( keys %$cur ) { + my $pwr = $cur->{$idx}; + if ( $pwr >= 1 && $pwr <= 8 ) { + + my @pwr_list = split(/,/, $pwr_abs->{$idx} ); + $dot11_cur_tx_pwr_mw->{$idx} = $pwr_list[$pwr-1]; + + } + else { + next; + } + } + return $dot11_cur_tx_pwr_mw; +} + # Pseudo ENTITY-MIB methods sub e_index { @@ -1147,6 +1183,11 @@ Returns reference to hash. Indicates whether the SSID is broadcast. Returns reference to hash. Current operating frequency channel of the radio interface. +=item $dot11->dot11_cur_tx_pwr_mw() + +Returns reference to hash. Current transmit power, in milliwatts, of the +radio interface. + =back =head2 Dot11 Ess Table (C) @@ -1214,6 +1255,12 @@ enabled. (C) +=item $airespace->airespace_ess_bcast() + +This attribute when enabled allows the switch to broadcast this SSID. + +(C) + =back =head2 AP Table (C) @@ -1317,6 +1364,12 @@ However, if this is enabled, then only those WLANs that appear in the (C) +=item $airespace->airespace_apif_a_pwr() + +List of comma separated absolute power levels supported by the radio. + +(C) + =back =head2 Mobile Station Table (C)