Add munge_caps() and munge_null()

This commit is contained in:
Eric Miller
2008-07-15 02:39:43 +00:00
parent 740707539e
commit 71b0e7c60f

28
Info.pm
View File

@@ -2522,6 +2522,20 @@ sub munge_bits {
return unpack("b*",$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 =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.
@@ -2577,6 +2591,20 @@ sub munge_port_list {
return $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 =back
=head2 Internally Used Functions =head2 Internally Used Functions