Correct munging of dot1dStpPortDesignatedPort in stp_p_port() and i_stp_port() methods

This commit is contained in:
Eric A. Miller
2014-11-09 17:43:41 -05:00
parent 09e18e9b64
commit 47954aba8e
3 changed files with 20 additions and 2 deletions

View File

@@ -26,6 +26,8 @@ version 3.21 ()
rather than assuming they are the same. rather than assuming they are the same.
* Capture port VLANs on Cisco interfaces which are configured for * Capture port VLANs on Cisco interfaces which are configured for
trunking but are not in operational trunking mode trunking but are not in operational trunking mode
* Correct munging of dot1dStpPortDesignatedPort in stp_p_port() and
i_stp_port() methods
version 3.20 (2014-09-08) version 3.20 (2014-09-08)

18
Info.pm
View File

@@ -3411,7 +3411,7 @@ sub munge_mac {
=item munge_prio_mac() =item munge_prio_mac()
Takes an 8-byte octet stream (HEX-STRING) and returns a colon separated ASCII Takes an 2-byte octet stream (HEX-STRING) and returns a colon separated ASCII
hex string. hex string.
=cut =cut
@@ -3425,6 +3425,22 @@ sub munge_prio_mac {
return; return;
} }
=item munge_prio_port()
Takes an 8-byte octet stream (HEX-STRING) and returns a colon separated ASCII
hex string.
=cut
sub munge_prio_port {
my $mac = shift;
return unless defined $mac;
return unless length $mac;
$mac = join( ':', map { sprintf "%02x", $_ } unpack( 'C*', $mac ) );
return $mac if $mac =~ /^([0-9A-F][0-9A-F]:){1}[0-9A-F][0-9A-F]$/i;
return;
}
=item munge_octet2hex() =item munge_octet2hex()
Takes a binary octet stream and returns an ASCII hex string Takes a binary octet stream and returns an ASCII hex string

View File

@@ -128,7 +128,7 @@ $VERSION = '3.20';
'stp_root' => \&SNMP::Info::munge_mac, 'stp_root' => \&SNMP::Info::munge_mac,
'stp_p_root' => \&SNMP::Info::munge_prio_mac, 'stp_p_root' => \&SNMP::Info::munge_prio_mac,
'stp_p_bridge' => \&SNMP::Info::munge_prio_mac, 'stp_p_bridge' => \&SNMP::Info::munge_prio_mac,
'stp_p_port' => \&SNMP::Info::munge_prio_mac, 'stp_p_port' => \&SNMP::Info::munge_prio_port,
'qb_cv_egress' => \&SNMP::Info::munge_port_list, 'qb_cv_egress' => \&SNMP::Info::munge_port_list,
'qb_cv_untagged' => \&SNMP::Info::munge_port_list, 'qb_cv_untagged' => \&SNMP::Info::munge_port_list,
'qb_v_egress' => \&SNMP::Info::munge_port_list, 'qb_v_egress' => \&SNMP::Info::munge_port_list,