- Move AIRESPACE-*-MIB methods to base Airespace class

- Add cd11_ssid() to support Nedisco feature request [3598089] Collect SSID in macsuck
This commit is contained in:
Eric A. Miller
2013-01-03 23:05:09 -05:00
parent e1e693a7c8
commit b9aebf7e9e
2 changed files with 33 additions and 22 deletions

View File

@@ -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

View File

@@ -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