Small improvements in consistency for code and manual (#298)

usage of munge_prio_mac/port was mixed up.
make manual a bit more consistent while here.
This commit is contained in:
nick n
2019-01-15 10:43:47 +01:00
committed by Jeroen van Ingen Schenau
parent 64846ed2de
commit b28f81adbb

View File

@@ -3540,7 +3540,7 @@ $REPEATERS = 20;
=item munge_speed() =item munge_speed()
Makes human friendly speed ratings using %SPEED_MAP Makes human friendly speed ratings using C<%SPEED_MAP>.
%SPEED_MAP = ( %SPEED_MAP = (
'56000' => '56 kbps', '56000' => '56 kbps',
@@ -3639,7 +3639,7 @@ sub munge_speed {
=item munge_highspeed() =item munge_highspeed()
Makes human friendly speed ratings for C<ifHighSpeed> Makes human friendly speed ratings for C<ifHighSpeed>.
=cut =cut
@@ -3668,7 +3668,7 @@ sub munge_highspeed {
=item munge_ip() =item munge_ip()
Takes a binary IP and makes it dotted ASCII Takes a binary IP and makes it dotted ASCII.
=cut =cut
@@ -3695,7 +3695,7 @@ sub munge_mac {
=item munge_prio_mac() =item munge_prio_mac()
Takes an 2-byte octet stream (HEX-STRING) and returns a colon separated ASCII Takes an 8-byte octet stream (HEX-STRING) and returns a colon separated ASCII
hex string. hex string.
=cut =cut
@@ -3711,23 +3711,23 @@ sub munge_prio_mac {
=item munge_prio_port() =item munge_prio_port()
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
sub munge_prio_port { sub munge_prio_port {
my $mac = shift; my $priop = shift;
return unless defined $mac; return unless defined $priop;
return unless length $mac; return unless length $priop;
$mac = join( ':', map { sprintf "%02x", $_ } unpack( 'C*', $mac ) ); $priop = join( ':', map { sprintf "%02x", $_ } unpack( 'C*', $priop ) );
return $mac if $mac =~ /^([0-9A-F][0-9A-F]:){1}[0-9A-F][0-9A-F]$/i; return $priop if $priop =~ /^([0-9A-F][0-9A-F]:){1}[0-9A-F][0-9A-F]$/i;
return; 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.
=cut =cut
@@ -3738,7 +3738,7 @@ sub munge_octet2hex {
=item munge_dec2bin() =item munge_dec2bin()
Takes a binary char and returns its ASCII binary representation Takes a binary char and returns its ASCII binary representation.
=cut =cut
@@ -3754,9 +3754,9 @@ sub munge_dec2bin {
return $num; return $num;
} }
=item munge_bits =item munge_bits()
Takes a SNMP2 'BITS' field and returns the ASCII bit string Takes a SNMP2 'BITS' field and returns the ASCII bit string.
=cut =cut
@@ -3767,7 +3767,7 @@ sub munge_bits {
return unpack( "B*", $bits ); return unpack( "B*", $bits );
} }
=item munge_counter64 =item munge_counter64()
If $BIGINT is set to true, then a Math::BigInt object is returned. If $BIGINT is set to true, then a Math::BigInt object is returned.
See Math::BigInt for details. See Math::BigInt for details.
@@ -3782,7 +3782,7 @@ sub munge_counter64 {
return $bigint; return $bigint;
} }
=item munge_i_up =item munge_i_up()
Net-SNMP tends to load C<RFC1213-MIB> first, and so ignores the Net-SNMP tends to load C<RFC1213-MIB> first, and so ignores the
updated enumeration for C<ifOperStatus> in C<IF-MIB>. This munge updated enumeration for C<ifOperStatus> in C<IF-MIB>. This munge
@@ -3804,7 +3804,7 @@ sub munge_i_up {
return $ifOperStatusMap{$i_up} || $i_up; return $ifOperStatusMap{$i_up} || $i_up;
} }
=item munge_port_list =item munge_port_list()
Takes an octet string representing a set of ports and returns a reference Takes an octet string representing a set of ports and returns a reference
to an array of binary values each array element representing a port. to an array of binary values each array element representing a port.
@@ -3825,7 +3825,7 @@ sub munge_port_list {
=item munge_null() =item munge_null()
Removes control characters from a string Removes control characters from a string.
=cut =cut