D/N/A project
A new way of using
Domain Name Service

Documents :: API

RNA::DNS::PacketLab


NAME

RNA::DNS::PacketLab


DESCRIPTION

This module is part of the RNA Server, and implementation of DNA Project. DNA is an acronym for Domain Name Anarchy. For further informations take a look at DNA man page.

This module is a collection of subroutine which build packets. All informations are taken from DNS Cache, so pleas feed all needed informations to cache before using RNA::DNS::PacketLab methods.


API

PUBLIC METHODS

The only two public methods are new() and synth(). Other methods are private to RNA::DNS::PacketLab class and should never be invoked externally.

RNA::DNS::PacketLab-new()

Construct a new RNA::DNS::PacketLab object.

$lab->synth( type => 'A', class => 'IN', name => 'www.ecn.org' )

This subroutine synthetize (formerly known as 'builds') required DNA helix, oops, pardon, required DNS packet, using DNS algorithms described in RFC 1034. type defaults to 'A' and class defaults to 'IN', as usually.

$lab-helix()

Even if $lab->synth() fails, it's always possible to save so far built DNS packet calling this method. Returns a RNA::DNS::Packet object.

$lab-seq_QTYPE(%data)

Here we add a generic method description for a method family: seq_QTYPE(). For each QTYPE, here we declare a corresponding &seq_QTYPE() method which handles required information packing inside the packet to be built. All seq_QTYPE methods require the same %data structure to be passed here:

        %data = (
                name => "www.domain.org",
                type => "A", # ............. Optional, defaults to 'A'
                class => "IN", # ........... Optional, defaults to 'IN'
        );

Here is the complete list of defined &seq_QTYPE() methods:

$lab-seq_A(%data)

$lab-seq_NS(%data)

$lab-seq_MD(%data)

$lab-seq_MF(%data)

$lab-seq_CNAME(%data)

$lab-seq_SOA(%data)

$lab-seq_MB(%data)

Add RR sequence for MB queries.

$lab-seq_MG(%data)

$lab-seq_MR(%data)

$lab-seq_NULL(%data)

$lab-seq_WKS(%data)

$lab-seq_PTR(%data)

$lab-seq_HINFO(%data)

$lab-seq_MINFO(%data)

$lab-seq_MX(%data)

$lab-seq_TXT(%data)

$lab-add_seq(%data)

This is the generic core of &seq_XXXX() internal functions. Adds requested information, as specifyied in %data:

        %data = (
                name => 'www.strumentiresistenti.org',
                type => 'CNAME', # .............. Optional, defaults to 'A'
                class => 'IN', # ................ Optional, defaults to 'IN'
                section => 'ARs', # ............. Optional, defaults to 'ARs'
        );

As shown, by default, $lab->add_seq() push informations in the Additional Record list.

$lab-add_ns_glue(%data)

Add informations about authoritative name servers. %data holds same informations passed to $lab->synth() .

$lab-add_soa_glue(%data)

Add informations about zone management policy (SOA record). %data holds same informations passed to $lab->synth() .


ERROR API

This section of PacketLab code produce error packets.

$lab-ERR_format_error(%data)

$lab-ERR_server_failure(%data)

$lab-ERR_no_such_name(%data)

$lab-ERR_not_implemented(%data)

$lab-ERR_refused(%data)

$lab-resp_pkt(%data)

Prepare a standard response packet, containing passed QD and setting response flag and recursion available, if nameserver is configured so. %data describes the QD section. return a RNA::DNS::Packet object.

This page last modified: Wednesday, 09-Jan-2008 16:25:00 CET
© 2007-2008 Tx0 - Some right reserved
This work is released under Creative Commons License
hosted by gna!
Valid HTML 4.01 Transitional
Valid CSS!