Net::Frame::Layer::DNS::RR - DNS Resource Record type object
use Net::Frame::Layer::DNS::RR qw(:consts); my $layer = Net::Frame::Layer::DNS::RR->new( name => 'localhost', type => NF_DNS_TYPE_A, class => NF_DNS_CLASS_IN, ttl => 0, rdlength => 0, rdata => '', ); $layer->pack; print 'RAW: '.$layer->dump."\n"; # Create RR with rdata use Net::Frame::Layer::DNS::RR::A; my $rdata = Net::Frame::Layer::DNS::RR::A->new; my $layer = Net::Frame::Layer::DNS::RR->new( rdata => $rdata->pack, ); $layer->pack; # Read a raw layer my $layer = Net::Frame::Layer::DNS::RR->new(raw => $raw); print $layer->print."\n"; print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n" if $layer->payload;
This modules implements the encoding and decoding of the DNS Resource Record object.
See also Net::Frame::Layer for other attributes and methods.
Resource name (hostname / domain).
Record type. See CONSTANTS for more information.
Class type. See CONSTANTS for more information.
Time interval (in seconds) that the resource record may be cached before it should be discarded. Zero (0) means the RR can only be used for the current transaction and should not be cached.
Length in octets of the RDATA field.
String of octets that describes the resource. Can be created with any Net::Frame::Layer::DNS::RR::* modules. See SYNOPSIS for example.
The following are inherited attributes. See Net::Frame::Layer for more information.
Object constructor. You can pass attributes that will overwrite default ones. See SYNOPSIS for default values.
The following are inherited methods. Some of them may be overriden in this layer, and some others may not be meaningful in this layer. See Net::Frame::Layer for more information.
Load them: use Net::Frame::Layer::DNS::RR qw(:consts);
See Net::Frame::Layer::DNS::Constants for more information.
Net::Frame::Layer::DNS, Net::Frame::Layer
Michael Vincent
Copyright (c) 2012, Michael Vincent
You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.
To install Net::Frame::Layer::DNS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Frame::Layer::DNS
CPAN shell
perl -MCPAN -e shell install Net::Frame::Layer::DNS
For more information on module installation, please visit the detailed CPAN module installation guide.