NAME

DOCSIS::ConfigFile::Decode - Decode functions for a DOCSIS config-file

DESCRIPTION

DOCSIS::ConfigFile::Decode has functions which is used to decode binary data into either plain strings or complex data structures, dependent on the function called.

FUNCTIONS

bigint

Returns a Math::BigInt object.

ether

Will unpack the input string and return a MAC address in this format: "00112233" or "00112233445566".

hexstr

Will unpack the input string and a string with leading "0x", followed by hexidesimal characters.

int

Will unpack the input string and return an integer, from -2147483648 to 2147483647.

ip

Will unpack the input string and return a human readable IPv4 address.

string

Returns human-readable string, where special characters are "uri encoded". Example: "%" = "%25" and " " = "%20". It can also return the value from "hexstr" if it starts with a weird character, such as \x00.

stringz

Same as string above. However this string is zero-terminated in encoded form, but this function remove the last "\0" seen in the string.

mic

Returns a value, printed as hex.

no_value

This method will return an empty string. It is used by DOCSIS types, which has zero length.

snmp_object

Will take a binary string and decode it into a complex datastructure, with "oid", "type" and "value".

uchar

Will unpack the input string and return a short integer, from 0 to 255.

uint

Will unpack the input string and return an integer, from 0 to 4294967295.

ushort

Will unpack the input string and return a short integer, from 0 to 65535.

ushort_list

Same as "ushort", but will return an array ref with the integers.

ushort_list

vendor

Will byte-encode a complex vendorspec datastructure.

vendorspec

Will unpack the input string and return a complex datastructure, representing the vendor specific data.

SEE ALSO

DOCSIS::ConfigFile