Fix SNMP::Info::IEEE802dot3ad when more than 1 LAG

This commit is contained in:
Eric A. Miller
2018-03-10 19:01:31 -05:00
parent 5ce80ba4ee
commit a83855157b
7 changed files with 54 additions and 20 deletions

View File

@@ -1,3 +1,9 @@
version 3.50
[BUG FIXES]
* Fix SNMP::Info::IEEE802dot3ad when more than 1 LAG
version 3.49 (2018-03-03) version 3.49 (2018-03-03)
[ENHANCEMENTS] [ENHANCEMENTS]

View File

@@ -1,6 +1,6 @@
# SNMP::Info::CiscoAgg # SNMP::Info::CiscoAgg
# #
# Copyright (c) 2014 SNMP::Info Developers # Copyright (c) 2018 SNMP::Info Developers
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -52,9 +52,13 @@ $VERSION = '3.49';
%GLOBALS = (); %GLOBALS = ();
%FUNCS = (); %FUNCS = (
%SNMP::Info::IEEE802dot3ad::FUNCS,
);
%MUNGE = (); %MUNGE = (
%SNMP::Info::IEEE802dot3ad::MUNGE,
);
sub agg_ports_pagp { sub agg_ports_pagp {
my $dev = shift; my $dev = shift;
@@ -147,4 +151,8 @@ automatically.
=back =back
=head2 Table Methods imported from SNMP::Info::IEEE802dot3ad
See documentation in L<SNMP::Info::IEEE802dot3ad> for details.
=cut =cut

View File

@@ -1,6 +1,6 @@
# SNMP::Info::IEEE802dot3ad # SNMP::Info::IEEE802dot3ad
# #
# Copyright (c) 2014 SNMP::Info Developers # Copyright (c) 2018 SNMP::Info Developers
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -52,29 +52,30 @@ $VERSION = '3.49';
%GLOBALS = (); %GLOBALS = ();
%FUNCS = (); %FUNCS = (
'ad_lag_ports' => 'dot3adAggPortListPorts',
);
%MUNGE = (); %MUNGE = (
'ad_lag_ports' => \&SNMP::Info::munge_port_list,
);
sub agg_ports_lag { sub agg_ports_lag {
my $dev = shift; my $dev = shift;
# TODO: implement partial # TODO: implement partial
my $masters = $dev->dot3adAggActorOperKey; my $ports = $dev->ad_lag_ports;
my $slaves = $dev->dot3adAggPortActorOperKey;
return {} unless return {} unless ref {} eq ref $ports and scalar keys %$ports;
ref {} eq ref $masters and scalar keys %$masters
and ref {} eq ref $slaves and scalar keys %$slaves;
my $ret = {}; my $ret = {};
foreach my $s (keys %$slaves) { foreach my $m ( keys %$ports ) {
next if $slaves->{$s} == 0; my $idx = $m;
foreach my $m (keys %$masters) { my $portlist = $ports->{$m};
next unless $masters->{$m} == $slaves->{$s}; next unless $portlist;
$ret->{$s} = $m; for ( my $i = 0; $i <= scalar(@$portlist); $i++ ) {
last; $ret->{$i+1} = $idx if ( @$portlist[$i] );
} }
} }
return $ret; return $ret;

View File

@@ -68,11 +68,13 @@ $VERSION = '3.49';
%FUNCS = ( %FUNCS = (
%SNMP::Info::Layer3::FUNCS, %SNMP::Info::Layer3::FUNCS,
%SNMP::Info::LLDP::FUNCS, %SNMP::Info::LLDP::FUNCS,
%SNMP::Info::IEEE802dot3ad::FUNCS,
); );
%MUNGE = ( %MUNGE = (
%SNMP::Info::Layer3::MUNGE, %SNMP::Info::Layer3::MUNGE,
%SNMP::Info::LLDP::MUNGE, %SNMP::Info::LLDP::MUNGE,
%SNMP::Info::IEEE802dot3ad::MUNGE,
); );
sub vendor { return 'Cumulus Networks' } sub vendor { return 'Cumulus Networks' }

View File

@@ -1,6 +1,6 @@
# SNMP::Info::Layer3::H3C # SNMP::Info::Layer3::H3C
# #
# Copyright (c) 2012 Jeroen van Ingen # Copyright (c) 2018 Jeroen van Ingen
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -71,12 +71,14 @@ $VERSION = '3.49';
%FUNCS = ( %FUNCS = (
%SNMP::Info::Layer3::FUNCS, %SNMP::Info::Layer3::FUNCS,
%SNMP::Info::LLDP::FUNCS, %SNMP::Info::LLDP::FUNCS,
%SNMP::Info::IEEE802dot3ad::FUNCS,
i_duplex_admin => 'hh3cifEthernetDuplex', i_duplex_admin => 'hh3cifEthernetDuplex',
); );
%MUNGE = ( %MUNGE = (
%SNMP::Info::Layer3::MUNGE, %SNMP::Info::Layer3::MUNGE,
%SNMP::Info::LLDP::MUNGE, %SNMP::Info::LLDP::MUNGE,
%SNMP::Info::IEEE802dot3ad::MUNGE,
); );
sub vendor { sub vendor {
@@ -265,4 +267,8 @@ See documentation in L<SNMP::Info::Layer3> for details.
See documentation in L<SNMP::Info::LLDP> for details. See documentation in L<SNMP::Info::LLDP> for details.
=head2 Table Methods imported from SNMP::Info::IEEE802dot3ad
See documentation in L<SNMP::Info::IEEE802dot3ad> for details.
=cut =cut

View File

@@ -1,6 +1,6 @@
# SNMP::Info::Layer3::Huawei # SNMP::Info::Layer3::Huawei
# #
# Copyright (c) 2015 Jeroen van Ingen # Copyright (c) 2018 Jeroen van Ingen
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -64,11 +64,13 @@ $VERSION = '3.49';
%FUNCS = ( %FUNCS = (
%SNMP::Info::Layer3::FUNCS, %SNMP::Info::Layer3::FUNCS,
%SNMP::Info::LLDP::FUNCS, %SNMP::Info::LLDP::FUNCS,
%SNMP::Info::IEEE802dot3ad::FUNCS,
); );
%MUNGE = ( %MUNGE = (
%SNMP::Info::Layer3::MUNGE, %SNMP::Info::Layer3::MUNGE,
%SNMP::Info::LLDP::MUNGE, %SNMP::Info::LLDP::MUNGE,
%SNMP::Info::IEEE802dot3ad::MUNGE,
); );
sub vendor { sub vendor {
@@ -229,4 +231,8 @@ See documentation in L<SNMP::Info::Layer3> for details.
See documentation in L<SNMP::Info::LLDP> for details. See documentation in L<SNMP::Info::LLDP> for details.
=head2 Table Methods imported from SNMP::Info::IEEE802dot3ad
See documentation in L<SNMP::Info::IEEE802dot3ad> for details.
=cut =cut

View File

@@ -60,10 +60,12 @@ $VERSION = '3.49';
%FUNCS = ( %FUNCS = (
%SNMP::Info::Layer3::FUNCS, %SNMP::Info::Layer3::FUNCS,
%SNMP::Info::IEEE802dot3ad::FUNCS,
); );
%MUNGE = ( %MUNGE = (
%SNMP::Info::Layer3::MUNGE, %SNMP::Info::Layer3::MUNGE,
%SNMP::Info::IEEE802dot3ad::MUNGE,
); );
sub vendor { sub vendor {
@@ -191,5 +193,8 @@ ifIndex of the corresponding master ports.
See documentation in L<SNMP::Info::Layer3> for details. See documentation in L<SNMP::Info::Layer3> for details.
=head2 Table Methods imported from SNMP::Info::IEEE802dot3ad
See documentation in L<SNMP::Info::IEEE802dot3ad> for details.
=cut =cut