From 7ad449303b34cfbe7a4f42ae3cf58d45f20bd1e4 Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Sat, 8 Nov 2014 09:52:41 -0500 Subject: [PATCH] L3::Force10 now inherits i_vlan_membership() and i_vlan_membership_untagged() from Bridge and only overrides VLAN mapping --- Info/Layer3/Force10.pm | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/Info/Layer3/Force10.pm b/Info/Layer3/Force10.pm index 879f0e52..33c5c99a 100644 --- a/Info/Layer3/Force10.pm +++ b/Info/Layer3/Force10.pm @@ -121,29 +121,25 @@ sub i_vlan { return $i_vlan; } -sub i_vlan_membership { +# Apparently index doesn't use VLAN ID, so override the HOA private +# method here to correct the mapping +sub _vlan_hoa { my $force10 = shift; - my $partial = shift; + my ( $v_ports, $partial ) = @_; - my $index = $force10->bp_index(); + my $index = $force10->bp_index(); my $v_index = $force10->v_index(); - my $v_ports = $force10->qb_v_egress(); - - # If given a partial it will be an ifIndex, we need to use dot1dBasePort - if ($partial) { - my %r_index = reverse %$index; - $partial = $r_index{$partial}; - } - - my $i_vlan_membership = {}; - + my $vlan_hoa = {}; foreach my $idx ( sort keys %{$v_ports} ) { next unless ( defined $v_ports->{$idx} ); my $portlist = $v_ports->{$idx}; # is an array reference my $ret = []; my $vlan_ndx = $idx; + # Strip TimeFilter if we're using VlanCurrentTable + ( $vlan_ndx = $idx ) =~ s/^\d+\.//; + # Convert portlist bit array to bp_index array for ( my $i = 0; $i <= $#$portlist; $i++ ) { push( @{$ret}, $i + 1 ) if ( @$portlist[$i] ); @@ -160,11 +156,10 @@ sub i_vlan_membership { # the mapping from Q-BRIDGE-MIB::dot1qVlanFdbId my $mod = $vlan_tag % 4096; - push ( @{ $i_vlan_membership->{$ifindex} }, ($mod) ); + push ( @{ $vlan_hoa->{$ifindex} }, ($mod) ); } } - - return $i_vlan_membership; + return $vlan_hoa; } 1; @@ -278,12 +273,6 @@ Returns the VLAN names. Currently not implemented. -=item $force10->i_vlan_membership() - -Returns reference to hash of arrays: -key = C, value = array of VLAN IDs. -These are the VLANs which are members of the egress list for the port. - =item $force10->i_duplex_admin() Returns info from F