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.
This commit is contained in:
		@@ -7,6 +7,7 @@ version 3.02 ()
 | 
				
			|||||||
    * Properly pull os_ver from Netgear GS series switches.
 | 
					    * Properly pull os_ver from Netgear GS series switches.
 | 
				
			||||||
    * Support Alcatel devices with layer3 features.
 | 
					    * Support Alcatel devices with layer3 features.
 | 
				
			||||||
    * Identify Cisco Aironet 1140 APs as Layer2::Aironet
 | 
					    * Identify Cisco Aironet 1140 APs as Layer2::Aironet
 | 
				
			||||||
 | 
					    * LAN switch support added to Layer3::Aruba class
 | 
				
			||||||
 | 
					
 | 
				
			||||||
version 3.01 (2013-04-13)
 | 
					version 3.01 (2013-04-13)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,8 +101,11 @@ portmac: yes
 | 
				
			|||||||
duplex: no
 | 
					duplex: no
 | 
				
			||||||
class: Layer3::Aruba
 | 
					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: 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
 | 
					device: 5000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -322,6 +322,8 @@ sub i_ssidbcast {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Wireless switches do not support the standard Bridge MIB
 | 
					# 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 {
 | 
					sub bp_index {
 | 
				
			||||||
    my $aruba   = shift;
 | 
					    my $aruba   = shift;
 | 
				
			||||||
    my $partial = shift;
 | 
					    my $partial = shift;
 | 
				
			||||||
@@ -329,10 +331,14 @@ sub bp_index {
 | 
				
			|||||||
    my $i_index  = $aruba->orig_i_index($partial)  || {};
 | 
					    my $i_index  = $aruba->orig_i_index($partial)  || {};
 | 
				
			||||||
    my $ap_index = $aruba->aruba_ap_name($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 ) {
 | 
					    foreach my $iid ( keys %$i_index ) {
 | 
				
			||||||
        my $index = $i_index->{$iid};
 | 
					        my $index = $i_index->{$iid};
 | 
				
			||||||
        next unless defined $index;
 | 
					        next unless defined $index;
 | 
				
			||||||
 | 
					        next if exists $bp_index{$iid}; # Only augment bp_index, don't overwrite any existing mappings 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $bp_index{$iid} = $index;
 | 
					        $bp_index{$iid} = $index;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -355,7 +361,9 @@ sub fw_port {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    my $fw_idx = $aruba->fw_user($partial) || {};
 | 
					    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 ) {
 | 
					    foreach my $iid ( keys %$fw_idx ) {
 | 
				
			||||||
        if ( $iid
 | 
					        if ( $iid
 | 
				
			||||||
            =~ /(\d+\.\d+\.\d+\.\d+\.\d+\.\d+).(\d+\.\d+\.\d+\.\d+\.\d+\.\d+)/
 | 
					            =~ /(\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_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 ) {
 | 
					    foreach my $iid ( keys %$fw_idx ) {
 | 
				
			||||||
        if ( $iid
 | 
					        if ( $iid
 | 
				
			||||||
            =~ /(\d+\.\d+\.\d+\.\d+\.\d+\.\d+).(\d+\.\d+\.\d+\.\d+\.\d+\.\d+)/
 | 
					            =~ /(\d+\.\d+\.\d+\.\d+\.\d+\.\d+).(\d+\.\d+\.\d+\.\d+\.\d+\.\d+)/
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user