duplex support for ciscosb (#352)
This commit is contained in:
6
Changes
6
Changes
@@ -1,3 +1,9 @@
|
|||||||
|
Version 3.69 (2019-xx-xx)
|
||||||
|
|
||||||
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
|
* duplex support for ciscosb
|
||||||
|
|
||||||
Version 3.68 (2019-04-28)
|
Version 3.68 (2019-04-28)
|
||||||
|
|
||||||
[NEW FEATURES]
|
[NEW FEATURES]
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
package SNMP::Info::Layer2::CiscoSB;
|
package SNMP::Info::Layer2::CiscoSB;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use warnings;
|
||||||
use Exporter;
|
use Exporter;
|
||||||
use SNMP::Info::Layer2;
|
use SNMP::Info::Layer2;
|
||||||
use SNMP::Info::Entity;
|
use SNMP::Info::Entity;
|
||||||
@@ -137,6 +138,26 @@ sub model {
|
|||||||
return $ciscosb->description();
|
return $ciscosb->description();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# CISCOSBinterfaces.mib also contains duplex info if needed
|
||||||
|
sub i_duplex {
|
||||||
|
my $ciscosb = shift;
|
||||||
|
my $partial = shift;
|
||||||
|
|
||||||
|
my $el_duplex = $ciscosb->el_duplex($partial);
|
||||||
|
|
||||||
|
if ( defined $el_duplex and scalar( keys %$el_duplex ) ) {
|
||||||
|
my %i_duplex;
|
||||||
|
foreach my $el_port ( keys %$el_duplex ) {
|
||||||
|
my $duplex = $el_duplex->{$el_port};
|
||||||
|
next unless defined $duplex;
|
||||||
|
|
||||||
|
$i_duplex{$el_port} = 'half' if $duplex =~ /half/i;
|
||||||
|
$i_duplex{$el_port} = 'full' if $duplex =~ /full/i;
|
||||||
|
}
|
||||||
|
return \%i_duplex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# ifDescr is the same for all interfaces in a class, but the ifName is
|
# ifDescr is the same for all interfaces in a class, but the ifName is
|
||||||
# unique, so let's use that for port name.
|
# unique, so let's use that for port name.
|
||||||
sub interfaces {
|
sub interfaces {
|
||||||
@@ -256,6 +277,14 @@ See documentation in L<SNMP::Info::EtherLike/"GLOBALS"> for details.
|
|||||||
|
|
||||||
=head1 TABLE METHODS
|
=head1 TABLE METHODS
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item $ciscosb->i_duplex()
|
||||||
|
|
||||||
|
Return duplex based upon the result of EtherLike->el_duplex().
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
=head2 Overrides
|
=head2 Overrides
|
||||||
|
|
||||||
=over
|
=over
|
||||||
|
|||||||
Reference in New Issue
Block a user