From b9aebf7e9e38a322e9d448f699cf6ccf358f9926 Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Thu, 3 Jan 2013 23:05:09 -0500 Subject: [PATCH] - Move AIRESPACE-*-MIB methods to base Airespace class - Add cd11_ssid() to support Nedisco feature request [3598089] Collect SSID in macsuck --- Info/Airespace.pm | 31 ++++++++++++++++++++++++++++++- Info/Layer2/Airespace.pm | 24 +++--------------------- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/Info/Airespace.pm b/Info/Airespace.pm index 26749dec..f75fd38a 100644 --- a/Info/Airespace.pm +++ b/Info/Airespace.pm @@ -148,6 +148,16 @@ $VERSION = '2.11'; # AIRESPACE-SWITCHING-MIB::agentPortConfigTable 'airespace_duplex_admin' => 'agentPortPhysicalMode', 'airespace_duplex' => 'agentPortPhysicalStatus', + + # This needs to be cleaned up, but for now we pretend to + # have the CISCO-DOT11-MIB for signal strengths, etc. + 'cd11_sigstrength' => 'bsnMobileStationRSSI', # kinda + 'cd11_sigqual' => 'bsnMobileStationSnr', # kinda + 'cd11_rxbyte' => 'bsnMobileStationBytesReceived', + 'cd11_txbyte' => 'bsnMobileStationBytesSent', + 'cd11_rxpkt' => 'bsnMobileStationPacketsReceived', + 'cd11_txpkt' => 'bsnMobileStationPacketsSent', + 'cd11_ssid' => 'bsnMobileStationSsid', ); %MUNGE = ( @@ -158,6 +168,8 @@ $VERSION = '2.11'; 'airespace_bl_mac' => \&SNMP::Info::munge_mac, 'airespace_if_mac' => \&SNMP::Info::munge_mac, 'airespace_sta_mac' => \&SNMP::Info::munge_mac, + 'cd11_rxpkt' => \&munge_64bits, + 'cd11_txpkt' => \&munge_64bits, ); sub layers { @@ -1031,6 +1043,13 @@ sub at_netaddr { return $ret; } +sub munge_64bits { + # The controller sometimes hands off a ridiculous value for packets. + # Just truncate it to 32 bits. + my $value = shift; + return $value & 0xffffffff; +} + 1; __END__ @@ -1080,7 +1099,7 @@ Do not use directly. =over -None. +=item None. =back @@ -1790,4 +1809,14 @@ entity which 'contains' this entity. =back +=head1 Data Munging Callback Subroutines + +=over + +=item munge_64bits() + +Truncate packet values to 32 bits. + +=back + =cut diff --git a/Info/Layer2/Airespace.pm b/Info/Layer2/Airespace.pm index bee6fcb1..6b4c2f8c 100644 --- a/Info/Layer2/Airespace.pm +++ b/Info/Layer2/Airespace.pm @@ -60,17 +60,11 @@ $VERSION = '2.11'; %SNMP::Info::CDP::FUNCS, %SNMP::Info::Airespace::FUNCS, # CISCO-LWAPP-AP-MIB::cLApTable 'ap_if_mac' => 'cLApIfMacAddress', - # This needs to be cleaned up, but for now we pretend to - # have the CISCO-DOT11-MIB for signal strengths, etc. - 'cd11_sigstrength' => 'bsnMobileStationRSSI', # kinda - 'cd11_sigqual' => 'bsnMobileStationSnr', # kinda - 'cd11_rxbyte' => 'bsnMobileStationBytesReceived', - 'cd11_txbyte' => 'bsnMobileStationBytesSent', - 'cd11_rxpkt' => 'bsnMobileStationPacketsReceived', - 'cd11_txpkt' => 'bsnMobileStationPacketsSent', + # CISCO-LWAPP-DOT11-CLIENT-MIB::cldcClientTable 'client_txrate' => 'cldcClientCurrentTxRateSet', 'cd11_proto' => 'cldcClientProtocol', 'cd11_rateset' => 'cldcClientDataRateSet', + # CISCO-LWAPP-DOT11-MIB::cldHtMacOperationsTable 'cd11n_ch_bw' => 'cldHtDot11nChannelBandwidth', ); @@ -79,8 +73,6 @@ $VERSION = '2.11'; %SNMP::Info::MUNGE, %SNMP::Info::Bridge::MUNGE, %SNMP::Info::CDP::MUNGE, %SNMP::Info::Airespace::MUNGE, 'ap_if_mac' => \&SNMP::Info::munge_mac, - 'cd11_rxpkt' => \&munge_64bits, - 'cd11_txpkt' => \&munge_64bits, 'cd11n_ch_bw' => \&munge_cd11n_ch_bw, 'cd11_rateset' => \&munge_cd11_rateset, 'cd11_proto' => \&munge_cd11_proto, @@ -179,6 +171,7 @@ sub cd11_txrate { $cd11_txrate->{$idx} = [ $rate ]; } } + return $cd11_txrate; } sub munge_cd11n_ch_bw { @@ -203,13 +196,6 @@ sub munge_cd11_rateset { return [ map { $_ * 1.0 } split /,/, $rates ]; } -sub munge_64bits { - # The controller sometimes hands off a ridiculous value for packets. - # Just truncate it to 32 bits. - my $value = shift; - return $value & 0xffffffff; -} - # Cisco provides the AP's Ethernet MAC via # CISCO-LWAPP-AP-MIB::cLApIfMacAddress this was not available pre-Cisco sub i_mac { @@ -394,10 +380,6 @@ Converts 802.11n 2.4Ghz to 1 and 5Ghz to 2 to correspond to the Converts rateset to array. -=item munge_64bits() - -Truncate packet values to 32 bits. - =back =cut