RNA::DNS::Serialize;
use RNA::DNS::Serialize;
my $serialized = &serialize_rdata({
type => 'MX',
rdata => {
preference => 10,
exchange => 'mail.domain.com',
}
});
my $deserialized = &deserialize_rdata( 'MX', $serialized );
This module is part of the RNA Server, an implementation of DNA Project. DNA is an acronym for Domain Name Anarchy. For further informations take a look at DNA man page or browse http://www.dna-project.net/.
This module provide common subroutines used for data serialization and deserialization.
&serialize_rdata(\%data)Serialize rdata in a convenient way for storage. %rdata is a hash structure which hold data, conformed as:
%data = (
type => 'A', # ........ Defaults to 'A'
class => 'IN', # ______ Defaults to 'IN',
rdata => '127.0.0.1', # Data to be cached
);
If rdata is a scalar, is returned as is. rdata key can hold a scalar value, such as 127.0.0.1, or a reference to more adequate structure such as this:
%data = (
type => 'MX',
rdata => {
preference => 10,
exchange => 'mail.mydomain.rna',
}
);
To see which one is more adequate, look directly the code below.
TODO Fix the code here luke!
&deserialize_rdata(\%data,$type[,$class])Deserialize data serialized by &serialize_rdata().
Written by Tx0 .
© 2003 Tx0
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Some practical programming solutions has been taken from Net::DNS modules by Michael Fuhr and others. For further information please see http://www.net-dns.org/ or the man page of Net::DNS.
RNA(5), RNA::Internals(3), RNA::Internode(3), rnad(8), Net::DNS(3), Net::DNS::Header(3)
This page last modified: Wednesday, 09-Jan-2008 16:25:00 CET