The actual structure definitions are named ldns_struct_<name> which are all typedeffed to ldns_<name>
A DNS Resource record looks like this:
nlnetlabs.nl. 600 IN MX 10 open.nlnetlabs.nl.
\ \ \ \ \ /
owner ttl class type \ rdf[] /
(rdf) (uint16_t) (rr_class) (rr_type)
10 := rdf[0]
open.nlnetlabs.nl. := rdf[1]
Owner: The owner name is put in an ldns_rdf structure, which is a normal rdata field but always has the type LDNS_RDF_TYPE_DNAME.
An ldns_rdf structure has 3 members; the size, the type of rdata and a void * pointer to the data. The data is always in uncompressed wireformat.
The RSH (rdata) is put in an array of rdf's (in this case 2).
The entire resource record is put in a RR structure, which has the fields described above (under the RR):
RR list structure: An RR list structure is simply a structure with a counter and an array of RR structures. Different kinds of RR's can be grouped together this way.
RRset structure An RRset structure is an RR list structure, but its accessor function checks if the ldns_rr structures in there are:
This is the RFC definition of an RRset.
pkt structure: A pkt structure consists out of a header structure where packet specific flags are kept, TC, RD, IP from server which sent the packet, etc. Further more it is divided in 4 sections: question, authority, answer and additional.
All four sections have the type RRlist that simply hold a list of RR's
The exact function-call parameters have not yet been decided on.
Also the resolver module will need to access some of the to_wire and from_wire function to creates ldn_pkt's from the data it receives (arrow not drawn).
1.5.5