From 070d911c602e738464747fe64827353ae5c3bdbf Mon Sep 17 00:00:00 2001 From: Jeroen van Ingen Date: Mon, 24 Jun 2013 10:42:58 +0200 Subject: [PATCH] Add support for Aruba LAN switches. Known issue with Aruba AOS 7.2.0.0: nodes on "trusted" LAN ports in "access" mode point to non-existing bp_index values; they will be mapped to the wrong interface or not be mapped to an interface at all. --- ChangeLog | 1 + DeviceMatrix.txt | 5 ++++- Info/Layer3/Aruba.pm | 16 +++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 554da155..1747ddd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ version 3.02 () * Properly pull os_ver from Netgear GS series switches. * Support Alcatel devices with layer3 features. * Identify Cisco Aironet 1140 APs as Layer2::Aironet + * LAN switch support added to Layer3::Aruba class version 3.01 (2013-04-13) diff --git a/DeviceMatrix.txt b/DeviceMatrix.txt index 12081c54..d594d8fd 100644 --- a/DeviceMatrix.txt +++ b/DeviceMatrix.txt @@ -101,8 +101,11 @@ portmac: yes duplex: no class: Layer3::Aruba -device-family: Aruba Wireless Controllers +device-family: Aruba Wireless Controllers and LAN switches note: Uses proprietary MIBs to provide MAC to port mapping. APs appear as switch ports. +note: On LAN switches, hosts connected to "trusted" switch ports in "access" mode may be mapped to incorrect ports. + +device: 3500 device: 5000 diff --git a/Info/Layer3/Aruba.pm b/Info/Layer3/Aruba.pm index 7104685c..335bda0c 100644 --- a/Info/Layer3/Aruba.pm +++ b/Info/Layer3/Aruba.pm @@ -322,6 +322,8 @@ sub i_ssidbcast { } # Wireless switches do not support the standard Bridge MIB +# Wired switches currently (AOS 7.2.0.0) do, but it seems only for +# dot1q ports or access ports that are 'untrusted' ? sub bp_index { my $aruba = shift; my $partial = shift; @@ -329,10 +331,14 @@ sub bp_index { my $i_index = $aruba->orig_i_index($partial) || {}; my $ap_index = $aruba->aruba_ap_name($partial) || {}; - my %bp_index; + # Collect standard bp_index first + my $wired_bp_index = $aruba->SUPER::bp_index($partial) || {}; + my %bp_index = %$wired_bp_index; + foreach my $iid ( keys %$i_index ) { my $index = $i_index->{$iid}; next unless defined $index; + next if exists $bp_index{$iid}; # Only augment bp_index, don't overwrite any existing mappings $bp_index{$iid} = $index; } @@ -355,7 +361,9 @@ sub fw_port { my $fw_idx = $aruba->fw_user($partial) || {}; - my %fw_port; + my $wired_fw_port = $aruba->SUPER::qb_fw_port($partial) || {}; + my %fw_port = %$wired_fw_port; + foreach my $iid ( keys %$fw_idx ) { if ( $iid =~ /(\d+\.\d+\.\d+\.\d+\.\d+\.\d+).(\d+\.\d+\.\d+\.\d+\.\d+\.\d+)/ @@ -378,7 +386,9 @@ sub fw_mac { my $fw_idx = $aruba->fw_user($partial) || {}; - my %fw_mac; + my $wired_fw_mac = $aruba->SUPER::qb_fw_mac($partial) || {}; + my %fw_mac = %$wired_fw_mac; + foreach my $iid ( keys %$fw_idx ) { if ( $iid =~ /(\d+\.\d+\.\d+\.\d+\.\d+\.\d+).(\d+\.\d+\.\d+\.\d+\.\d+\.\d+)/