#include <ldns/ldns.h>
This is the basic DNS element that contains actual data
From RFC1035:
<pre>
3.2.1. Format
All RRs have the same top level format shown below:
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| |
/ /
/ NAME /
| |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| TYPE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| CLASS |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| TTL |
| |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| RDLENGTH |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|
/ RDATA /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
where:
NAME an owner name, i.e., the name of the node to which this
resource record pertains.
TYPE two octets containing one of the RR TYPE codes.
CLASS two octets containing one of the RR CLASS codes.
TTL a 32 bit signed integer that specifies the time interval
that the resource record may be cached before the source
of the information should again be consulted. Zero
values are interpreted to mean that the RR can only be
used for the transaction in progress, and should not be
cached. For example, SOA records are always distributed
with a zero TTL to prohibit caching. Zero values can
also be used for extremely volatile data.
RDLENGTH an unsigned 16 bit integer that specifies the length in
octets of the RDATA field.
RDATA a variable length string of octets that describes the
resource. The format of this information varies
according to the TYPE and CLASS of the resource record.
</pre>
The actual amount and type of rdata fields depend on the RR type of the
RR, and can be found by using \ref ldns_rr_descriptor functions.
struct ldns_struct_rr
{
Owner name, uncompressed:
ldns_rdf *_owner;
Time to live:
uint32_t _ttl;
Number of data fields:
size_t _rd_count;
the type of the RR. A, MX etc.:
ldns_rr_type _rr_type;
Class of the resource record.:
ldns_rr_class _rr_class;
/* everything in the rdata is in network order */
The array of rdata's:
ldns_rdf **_rdata_fields;
/** question rr [it would be nicer if thous is after _rd_count]
ABI change: Fix this in next major release
*/
bool _rr_question;
};
typedef struct ldns_struct_rr ldns_rr;
LDNS_RR_CLASS_FIRST = 0,
LDNS_RR_CLASS_LAST = 65535,
LDNS_RR_CLASS_COUNT = LDNS_RR_CLASS_LAST - LDNS_RR_CLASS_FIRST + 1
};
typedef enum ldns_enum_rr_class ldns_rr_class;
LDNS_RR_TYPE_DHCID = 49, /* RFC 4701 */
/* NSEC3 */
LDNS_RR_TYPE_NSEC3 = 50, /* RFC 5155 */
LDNS_RR_TYPE_NSEC3PARAM = 51, /* RFC 5155 */
LDNS_RR_TYPE_NSEC3PARAMS = 51,
LDNS_RR_TYPE_TLSA = 52, /* RFC 6698 */
LDNS_RR_TYPE_SMIMEA = 53, /* draft-ietf-dane-smime */
LDNS_RR_TYPE_HIP = 55, /* RFC 5205 */
draft-reid-dnsext-zs:
LDNS_RR_TYPE_NINFO = 56,
draft-reid-dnsext-rkey:
LDNS_RR_TYPE_RKEY = 57,
draft-ietf-dnsop-trust-history:
LDNS_RR_TYPE_TALINK = 58,
LDNS_RR_TYPE_CDS = 59, /* RFC 7344 */
LDNS_RR_TYPE_CDNSKEY = 60, /* RFC 7344 */
LDNS_RR_TYPE_OPENPGPKEY = 61, /* RFC 7929 */
LDNS_RR_TYPE_CSYNC = 62, /* RFC 7477 */
LDNS_RR_TYPE_SPF = 99, /* RFC 4408 */
LDNS_RR_TYPE_UINFO = 100,
LDNS_RR_TYPE_UID = 101,
LDNS_RR_TYPE_GID = 102,
LDNS_RR_TYPE_UNSPEC = 103,
LDNS_RR_TYPE_NID = 104, /* RFC 6742 */
LDNS_RR_TYPE_L32 = 105, /* RFC 6742 */
LDNS_RR_TYPE_L64 = 106, /* RFC 6742 */
LDNS_RR_TYPE_LP = 107, /* RFC 6742 */
LDNS_RR_TYPE_EUI48 = 108, /* RFC 7043 */
LDNS_RR_TYPE_EUI64 = 109, /* RFC 7043 */
LDNS_RR_TYPE_TKEY = 249, /* RFC 2930 */
LDNS_RR_TYPE_TSIG = 250,
LDNS_RR_TYPE_IXFR = 251,
LDNS_RR_TYPE_AXFR = 252,
A request for mailbox-related records (MB, MG or MR):
LDNS_RR_TYPE_MAILB = 253,
A request for mail agent RRs (Obsolete - see MX):
LDNS_RR_TYPE_MAILA = 254,
any type (wildcard):
LDNS_RR_TYPE_ANY = 255,
LDNS_RR_TYPE_URI = 256, /* RFC 7553 */
LDNS_RR_TYPE_CAA = 257, /* RFC 6844 */
LDNS_RR_TYPE_AVC = 258, /* Cisco's DNS-AS RR, see www.dns-as.org */
DNSSEC Trust Authorities:
LDNS_RR_TYPE_TA = 32768,
/* RFC 4431, 5074, DNSSEC Lookaside Validation */
LDNS_RR_TYPE_DLV = 32769,
/* type codes from nsec3 experimental phase
LDNS_RR_TYPE_NSEC3 = 65324,
LDNS_RR_TYPE_NSEC3PARAMS = 65325, */
LDNS_RR_TYPE_FIRST = 0,
LDNS_RR_TYPE_LAST = 65535,
LDNS_RR_TYPE_COUNT = LDNS_RR_TYPE_LAST - LDNS_RR_TYPE_FIRST + 1
};
typedef enum ldns_enum_rr_type ldns_rr_type;
Contains a list of rr's <br>
No official RFC-like checks are made
struct ldns_struct_rr_list
{
size_t _rr_count;
size_t _rr_capacity;
ldns_rr **_rrs;
};
typedef struct ldns_struct_rr_list ldns_rr_list;
Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.