Net::DNS::Text3pm
Dns text representation
Usage
use Net::DNS::Text;$object = Net::DNS::Text->new('example');$string = $object->string;$object = Net::DNS::Text->decode( \$data, $offset );( $object, $next ) = Net::DNS::Text->decode( \$data, $offset );$data = $object->encode;$text = $object->value;
Overview
The "Net::DNS::Text" module implements a class of text objects with associated class and instance methods.
Each text object instance has a fixed identity throughout its lifetime.
Methods
new
$object = Net::DNS::Text->new('example');
Creates a text object which encapsulates a single character string component of a resource record.
Arbitrary single-byte characters can be represented by \ followed by exactly three decimal digits. Such characters are devoid of any special meaning.
A character preceded by \ represents itself, without any special interpretation.
decode
$object = Net::DNS::Text->decode( \$buffer, $offset );( $object, $next ) = Net::DNS::Text->decode( \$buffer, $offset );
Creates a text object which represents the decoded data at the indicated offset within the data buffer.
The argument list consists of a reference to a scalar containing the wire-format data and offset of the text data.
The returned offset value indicates the start of the next item in the data buffer.
encode
$data = $object->encode;
Returns the wire-format encoded representation of the text object suitable for inclusion in a DNS packet buffer.
raw
$data = $object->raw;
Returns the wire-format encoded representation of the text object without the explicit length field.
value
$value = $text->value;
Character string representation of the text object.
string
$string = $text->string;
Conditionally quoted RFC1035 zone file representation of the text object.
unicode
$string = $text->unicode;
Conditionally quoted Unicode representation of the text object.
Releases
7 releases since Debian 8 (Jessie); the text changed 6 times.