Add munge_caps() and munge_null()
This commit is contained in:
28
Info.pm
28
Info.pm
@@ -2522,6 +2522,20 @@ sub munge_bits {
|
||||
return unpack("b*",$bits);
|
||||
}
|
||||
|
||||
=item munge_caps
|
||||
|
||||
Takes an octet string and returns an ascii binary string, 7 digits long, MSB.
|
||||
|
||||
=cut
|
||||
|
||||
sub munge_caps {
|
||||
my $caps = shift;
|
||||
return unless defined $caps;
|
||||
|
||||
my $bits = substr(unpack("B*",$caps),-7);
|
||||
return $bits;
|
||||
}
|
||||
|
||||
=item munge_counter64
|
||||
|
||||
If $BIGINT is set to true, then a Math::BigInt object is returned.
|
||||
@@ -2577,6 +2591,20 @@ sub munge_port_list {
|
||||
return $list;
|
||||
}
|
||||
|
||||
=item munge_null()
|
||||
|
||||
Removes nulls from a string
|
||||
|
||||
=cut
|
||||
|
||||
# munge_null() - removes nulls (\0)
|
||||
sub munge_null {
|
||||
my $text = shift || return;
|
||||
|
||||
$text =~ s/\0//g;
|
||||
return $text;
|
||||
}
|
||||
|
||||
=back
|
||||
|
||||
=head2 Internally Used Functions
|
||||
|
||||
Reference in New Issue
Block a user