D/N/A uses a modular design to build a complete library. D/N/A is both a DNS resolving library and a zone registration library.
D/N/A implementation is called RNA (the Rhizomatic Name Archiver) and is entirely written in Perl. Its source tree is depicted here, by classes.
This is the main namespace of RNA library. Its only module, RNA.pm, is just a container for global useful values.
This is the main interface to resolver library. The only two public methods are new() and manage_query(). All the other methods are for internal implementation. A normal usage of this namespace is just:
use RNA::DNS; $resolver = RNA::DNS->new(); $answer = $resolver->manage_query($packet);
Both $packet and $answer are RNA::DNS::Packet objects.
This class implements DNS packet creation and management. The new() method creates the packet on the basis of raw data, passed as first argument, like in:
$packet = RNA::DNS::Packet->new($raw_data);
If data is not available at object creation, can be later fed with fill_buffer() method and subsequently parsed using parse() method.
check_internal_consistency() can be used to verify packet health (it's also automatically called by new() and parse() methods).
Packets are transformed in internal data structures for manipulation. To later transmit it over the wire, a special method must be called to serialize the structures: this is prepare() method.
This class is access and manipulation interface to data repository stored inside SQL db. It is used to retrieve and save information about queried resources. It's of interest only for D/N/A hackers, not to external programmers.
This class is a collection of all DNS codes defined by RFC.
This class is the forge for DNS packets. It's able to produce valid packets in answer to a specific query. Uses informations located inside the SQL db via RNA::DNS::Repository.
This class is devoted to missing information retrieving. Given a packet model which must be fulfilled, this class can decide if all needed informations are already available inside the SQL db or should be retrieved from the Net and consequently starts searching for them.
This class performs serialization of a packet (its the real backed of RNA::DNS::Packet::prepare() method.
This class is a full implementation of a D/N/A/ based nameserver. To run such a nameserver just do:
use RNA::NameServer; $dns = RNA::NameServer->new(); $dns->run();
This code does not handle UNIX signals, does not save process PID inside a file. This kind of operations are added in sbin/rna_named server script which is the recommended way to start RNA nameserver.
This is the SQL back-end class.
Real SQL db interface, used internally by RNA::SQL class.
This class perform operations over SQL data. Its development is strictly bound to D/N/A design issues. Many methods of this class, like reserve_zone() are inherited by a previous D/N/A design based on round robin registration process (based on unicast or multicast) which is no longer planned because obsoleted by distributed hash tables.
A utility collection class, used by all other modules. Contains configuration file parsing and writing code (parse_config_file() and write_config_file()), debugging code (debug(), dump_packet_to_file()), process forking (spawn(), read_children() and set_children()) and zone MD5 hashing (zoneMD5()).
This is RNA interface with the Internet. All the operation performed over the net is done using this class.
This page last modified: Wednesday, 09-Jan-2008 16:25:02 CET