Net::DNS::DomainName (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
Net::DNS::DomainName - DNS name representationSYNOPSIS
use Net::DNS::DomainName; $object = new Net::DNS::DomainName('example.com'); $name = $object->name; $data = $object->encode; ( $object, $next ) = decode Net::DNS::DomainName( \$data, $offset );
DESCRIPTION
The Net::DNS::DomainName module implements the concrete representation ofNet::DNS::DomainName defines methods for encoding and decoding wire format octet strings as defined in
The Net::DNS::DomainName1035 and Net::DNS::DomainName2535 packages implement disjoint domain name subtypes which provide the name compression and canonicalisation specified by
METHODS
new
$object = new Net::DNS::DomainName('example.com');
Creates a domain name object which identifies the domain specified by the character string argument.
canonical
$data = $object->canonical;
Returns the canonical wire-format representation of the domain name as defined in
decode
$object = decode Net::DNS::DomainName( \$buffer, $offset, $hash ); ( $object, $next ) = decode Net::DNS::DomainName( \$buffer, $offset, $hash );
Creates a domain name object which represents the
The argument list consists of a reference to a scalar containing the wire-format data and specified offset. The optional reference to a hash table provides improved efficiency of decoding compressed names by exploiting already cached compression pointers.
The returned offset value indicates the start of the next item in the data buffer.
encode
$data = $object->encode;
Returns the wire-format representation of the domain name suitable for inclusion in a
Net::DNS::DomainName1035
Net::DNS::DomainName1035 implements a subclass of domain name objects which are to be encoded using the compressed wire format defined in
use Net::DNS::DomainName; $object = new Net::DNS::DomainName1035('compressible.example.com'); $data = $object->encode( $offset, $hash ); ( $object, $next ) = decode Net::DNS::DomainName1035( \$data, $offset );
Note that
encode
$data = $object->encode( $offset, $hash );
Returns the wire-format representation of the domain name suitable for inclusion in a
The optional arguments are the offset within the packet data where the domain name is to be stored and a reference to a hash table used to index compressed names within the packet.
If the hash reference is undefined, encode() returns the lowercase uncompressed canonical representation defined in
Net::DNS::DomainName2535
Net::DNS::DomainName2535 implements a subclass of domain name objects which are to be encoded using uncompressed wire format.Note that
use Net::DNS::DomainName; $object = new Net::DNS::DomainName2535('incompressible.example.com'); $data = $object->encode( $offset, $hash ); ( $object, $next ) = decode Net::DNS::DomainName2535( \$data, $offset );
encode
$data = $object->encode( $offset, $hash );
Returns the uncompressed wire-format representation of the domain name suitable for inclusion in a
If the hash reference is undefined, encode() returns the lowercase canonical form defined in
COPYRIGHT
Copyright (c)2009-2011 Dick Franks.All rights reserved.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.