Correct munging of dot1dStpPortDesignatedPort in stp_p_port() and i_stp_port() methods
This commit is contained in:
18
Info.pm
18
Info.pm
@@ -3411,7 +3411,7 @@ sub munge_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.
|
||||
|
||||
=cut
|
||||
@@ -3425,6 +3425,22 @@ sub munge_prio_mac {
|
||||
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()
|
||||
|
||||
Takes a binary octet stream and returns an ASCII hex string
|
||||
|
||||
Reference in New Issue
Block a user