Cisco PAgP support added to LAG method

Squashed commit of the following:

commit 5cb2d637c7e990bbb8f789b6878f4bcb99778157
Author: Brian De Wolf <git@bldewolf.com>
Date:   Wed Feb 26 18:31:22 2014 -0800

    Implement agg_ports_pagp

    This function was a stub that is now filled out.  Also filled out the function
    that merges PAgP and LAG groups and did minimal testing of the PAgP side (no
    LAG in use in my env).
This commit is contained in:
Oliver Gorwits
2014-03-27 23:08:53 +00:00
parent 6764f15fd0
commit 88295e8c1e
2 changed files with 29 additions and 3 deletions

View File

@@ -1,5 +1,11 @@
SNMP::Info - Friendly OO-style interface to Network devices using SNMP. SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
version 3.13 (2014-03-27)
[ENHANCEMENTS]
* Cisco PAgP support added to LAG method
version 3.12 (2014-02-10) version 3.12 (2014-02-10)
[ENHANCEMENTS] [ENHANCEMENTS]

View File

@@ -56,11 +56,31 @@ $VERSION = '3.12';
%MUNGE = (); %MUNGE = ();
# until someone using PAgP sends us a patch sub agg_ports_pagp {
sub agg_ports_pagp { {} } my $dev = shift;
# Note that this mapping will miss any interfaces that are down during
# polling. If one of the members is up, we could use
# pagpAdminGroupCapability to figure things out, but if they're all
# down, we're hosed. Since we could be hosed anyway, we skip the fancy
# stuff.
my $mapping = {};
my $group = $dev->pagpGroupIfIndex;
for my $slave (keys %$group) {
my $master = $group->{$slave};
next if($master == 0 || $slave == $master);
$mapping->{$slave} = $master;
}
return $mapping;
}
# until we have PAgP data and need to combine with LAG data # until we have PAgP data and need to combine with LAG data
sub agg_ports { return agg_ports_lag(@_) } sub agg_ports {
my $ret = {%{agg_ports_pagp(@_)}, %{agg_ports_lag(@_)}};
return $ret;
}
1; 1;