From 8264f68f6c16e6152e8c66ee280417164b04f86f Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Thu, 2 Aug 2012 23:27:48 -0400 Subject: [PATCH] Add i_ssidmac() method to get BSSID's from AP's --- ChangeLog | 2 ++ Info/Layer2/Aironet.pm | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 80c9e15a..dbfc8575 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ version 2.09 [NEW FEATURES] + * New method i_ssidmac() to get BSSID's from AP's with initial support + in L2::Aironet and Airespace classes * Support for Avaya Secure Routers in new class L3::Tasman * Add EDP and LLDP L2 Topology to L3::Extreme * [3185393] Support for Juniper SSL VPN in new class L7::Neoteris diff --git a/Info/Layer2/Aironet.pm b/Info/Layer2/Aironet.pm index 1716370f..c1c4bfd5 100644 --- a/Info/Layer2/Aironet.pm +++ b/Info/Layer2/Aironet.pm @@ -437,6 +437,26 @@ sub i_ssidbcast { return $i_ssidbcast; } +sub i_ssidmac { + my $aironet = shift; + my $partial = shift; + my $mbss_mac_addr = $aironet->mbss_mac_addr(); + + # Same logic as i_ssidbcast to return same indexes as i_ssidlist + my $map = {}; + foreach my $key ( keys %$mbss_mac_addr ) { + my ( $interface, @idx ) = split( /\./, $key ); + $map->{ pack( "C*", @idx ) } = $mbss_mac_addr->{$key}; + } + + my $i_ssidlist = $aironet->i_ssidlist(); + my $i_ssidmac = {}; + foreach my $key ( keys %$i_ssidlist ) { + $i_ssidmac->{$key} = $map->{ $i_ssidlist->{$key} }; + } + return $i_ssidmac; +} + 1; __END__ @@ -623,6 +643,11 @@ to which they belong. With the same keys as i_ssidlist, returns whether the given SSID is being broadcast. +=item $aironet->i_ssidmac() + +With the same keys as i_ssidlist, returns the Basic service set +identification (BSSID), MAC address, the AP is using for the SSID. + =back =head2 Table Methods imported from SNMP::Info::Layer2