1ldns(3)                    Library Functions Manual                    ldns(3)
2
3
4

NAME

6       ldns_rr, ldns_rr_class, ldns_rr_type, ldns_rr_compress, ldns_rr_list -
7       types representing dns resource records
8
9

SYNOPSIS

11       #include <stdint.h>
12       #include <stdbool.h>
13
14       #include <ldns/ldns.h>
15

DESCRIPTION

17       ldns_rr
18              Resource Record
19
20              This is the basic DNS element that contains actual data
21
22              From RFC1035:
23              <pre>
24              3.2.1. Format
25
26              All RRs have the same top level format shown below:
27
28                                                  1  1  1  1  1  1
29                    0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
30                  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
31                  |                                               |
32                  /                                               /
33                  /                      NAME                     /
34                  |                                               |
35                  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
36                  |                      TYPE                     |
37                  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
38                  |                     CLASS                     |
39                  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
40                  |                      TTL                      |
41                  |                                               |
42                  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
43                  |                   RDLENGTH                    |
44                  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|
45                  /                     RDATA                     /
46                  /                                               /
47                  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
48
49              where:
50
51              NAME            an owner name, i.e., the name of the node to
52              which this
53                              resource record pertains.
54
55              TYPE            two octets containing one of the RR TYPE codes.
56
57              CLASS           two octets containing one of the RR CLASS codes.
58
59              TTL             a 32 bit signed integer that specifies the time
60              interval
61                              that the resource record may be cached before
62              the source
63                              of the information should again be consulted.
64              Zero
65                              values are interpreted to mean that the RR can
66              only be
67                              used for the transaction in progress, and should
68              not be
69                              cached.  For example, SOA records are always
70              distributed
71                              with a zero TTL to prohibit caching.  Zero val‐
72              ues can
73                              also be used for extremely volatile data.
74
75              RDLENGTH        an unsigned 16 bit integer that specifies the
76              length in
77                              octets of the RDATA field.
78
79              RDATA           a variable length string of octets that de‐
80              scribes the
81                              resource.  The format of this information varies
82                              according to the TYPE and CLASS of the resource
83              record.
84              </pre>
85
86              The actual amount and type of rdata fields depend on the RR type
87              of the
88              RR, and can be found by using \ref ldns_rr_descriptor functions.
89              struct ldns_struct_rr
90              {
91                   Owner name, uncompressed:
92                   ldns_rdf  *_owner;
93                   Time to live:
94                   uint32_t  _ttl;
95                   Number of data fields:
96                   size_t            _rd_count;
97                   the type of the RR. A, MX etc.:
98                   ldns_rr_type   _rr_type;
99                   Class of the resource record.:
100                   ldns_rr_class  _rr_class;
101                   /* everything in the rdata is in network order */
102                   The array of rdata's:
103                   ldns_rdf   **_rdata_fields;
104                   /**  question rr [it would be nicer if thous is after
105              _rd_count]
106                         ABI change: Fix this in next major release
107                    */
108                   bool      _rr_question;
109              };
110              typedef struct ldns_struct_rr ldns_rr;
111
112       ldns_rr_class
113               The different RR classes.
114              enum ldns_enum_rr_class
115              {
116                   the Internet:
117                   LDNS_RR_CLASS_IN    = 1,
118                   Chaos class:
119                   LDNS_RR_CLASS_CH    = 3,
120                   Hesiod (Dyer 87):
121                   LDNS_RR_CLASS_HS    = 4,
122                  None class, dynamic update:
123                  LDNS_RR_CLASS_NONE      = 254,
124                   Any class:
125                   LDNS_RR_CLASS_ANY   = 255,
126
127                   LDNS_RR_CLASS_FIRST     = 0,
128                   LDNS_RR_CLASS_LAST      = 65535,
129                   LDNS_RR_CLASS_COUNT     = LDNS_RR_CLASS_LAST -
130              LDNS_RR_CLASS_FIRST + 1
131              };
132              typedef enum ldns_enum_rr_class ldns_rr_class;
133
134       ldns_rr_type
135              The different RR types.
136              enum ldns_enum_rr_type
137              {
138                   a host address:
139                   LDNS_RR_TYPE_A = 1,
140                   an authoritative name server:
141                   LDNS_RR_TYPE_NS = 2,
142                   a mail destination (Obsolete - use MX):
143                   LDNS_RR_TYPE_MD = 3,
144                   a mail forwarder (Obsolete - use MX):
145                   LDNS_RR_TYPE_MF = 4,
146                   the canonical name for an alias:
147                   LDNS_RR_TYPE_CNAME = 5,
148                   marks the start of a zone of authority:
149                   LDNS_RR_TYPE_SOA = 6,
150                   a mailbox domain name (EXPERIMENTAL):
151                   LDNS_RR_TYPE_MB = 7,
152                   a mail group member (EXPERIMENTAL):
153                   LDNS_RR_TYPE_MG = 8,
154                   a mail rename domain name (EXPERIMENTAL):
155                   LDNS_RR_TYPE_MR = 9,
156                   a null RR (EXPERIMENTAL):
157                   LDNS_RR_TYPE_NULL = 10,
158                   a well known service description:
159                   LDNS_RR_TYPE_WKS = 11,
160                   a domain name pointer:
161                   LDNS_RR_TYPE_PTR = 12,
162                   host information:
163                   LDNS_RR_TYPE_HINFO = 13,
164                   mailbox or mail list information:
165                   LDNS_RR_TYPE_MINFO = 14,
166                   mail exchange:
167                   LDNS_RR_TYPE_MX = 15,
168                   text strings:
169                   LDNS_RR_TYPE_TXT = 16,
170                   RFC1183:
171                   LDNS_RR_TYPE_RP = 17,
172                   RFC1183:
173                   LDNS_RR_TYPE_AFSDB = 18,
174                   RFC1183:
175                   LDNS_RR_TYPE_X25 = 19,
176                   RFC1183:
177                   LDNS_RR_TYPE_ISDN = 20,
178                   RFC1183:
179                   LDNS_RR_TYPE_RT = 21,
180                   RFC1706:
181                   LDNS_RR_TYPE_NSAP = 22,
182                   RFC1348:
183                   LDNS_RR_TYPE_NSAP_PTR = 23,
184                   2535typecode:
185                   LDNS_RR_TYPE_SIG = 24,
186                   2535typecode:
187                   LDNS_RR_TYPE_KEY = 25,
188                   RFC2163:
189                   LDNS_RR_TYPE_PX = 26,
190                   RFC1712:
191                   LDNS_RR_TYPE_GPOS = 27,
192                   ipv6 address:
193                   LDNS_RR_TYPE_AAAA = 28,
194                   LOC record  RFC1876:
195                   LDNS_RR_TYPE_LOC = 29,
196                   2535typecode:
197                   LDNS_RR_TYPE_NXT = 30,
198                   draft-ietf-nimrod-dns-01.txt:
199                   LDNS_RR_TYPE_EID = 31,
200                   draft-ietf-nimrod-dns-01.txt:
201                   LDNS_RR_TYPE_NIMLOC = 32,
202                   SRV record RFC2782:
203                   LDNS_RR_TYPE_SRV = 33,
204                   http://www.jhsoft.com/rfc/af-saa-0069.000.rtf:
205                   LDNS_RR_TYPE_ATMA = 34,
206                   RFC2915:
207                   LDNS_RR_TYPE_NAPTR = 35,
208                   RFC2230:
209                   LDNS_RR_TYPE_KX = 36,
210                   RFC2538:
211                   LDNS_RR_TYPE_CERT = 37,
212                   RFC2874:
213                   LDNS_RR_TYPE_A6 = 38,
214                   RFC2672:
215                   LDNS_RR_TYPE_DNAME = 39,
216                   dnsind-kitchen-sink-02.txt:
217                   LDNS_RR_TYPE_SINK = 40,
218                   OPT record RFC 6891:
219                   LDNS_RR_TYPE_OPT = 41,
220                   RFC3123:
221                   LDNS_RR_TYPE_APL = 42,
222                   RFC4034, RFC3658:
223                   LDNS_RR_TYPE_DS = 43,
224                   SSH Key Fingerprint:
225                   LDNS_RR_TYPE_SSHFP = 44, /* RFC 4255 */
226                   IPsec Key:
227                   LDNS_RR_TYPE_IPSECKEY = 45, /* RFC 4025 */
228                   DNSSEC:
229                   LDNS_RR_TYPE_RRSIG = 46, /* RFC 4034 */
230                   LDNS_RR_TYPE_NSEC = 47, /* RFC 4034 */
231                   LDNS_RR_TYPE_DNSKEY = 48, /* RFC 4034 */
232
233                   LDNS_RR_TYPE_DHCID = 49, /* RFC 4701 */
234                   /* NSEC3 */
235                   LDNS_RR_TYPE_NSEC3 = 50, /* RFC 5155 */
236                   LDNS_RR_TYPE_NSEC3PARAM = 51, /* RFC 5155 */
237                   LDNS_RR_TYPE_NSEC3PARAMS = 51,
238                   LDNS_RR_TYPE_TLSA = 52, /* RFC 6698 */
239                   LDNS_RR_TYPE_SMIMEA = 53, /* RFC 8162 */
240
241                   LDNS_RR_TYPE_HIP = 55, /* RFC 5205 */
242
243                   draft-reid-dnsext-zs:
244                   LDNS_RR_TYPE_NINFO = 56,
245                   draft-reid-dnsext-rkey:
246                   LDNS_RR_TYPE_RKEY = 57,
247                      draft-ietf-dnsop-trust-history:
248                      LDNS_RR_TYPE_TALINK = 58,
249                   LDNS_RR_TYPE_CDS = 59, /* RFC 7344 */
250                   LDNS_RR_TYPE_CDNSKEY = 60, /* RFC 7344 */
251                   LDNS_RR_TYPE_OPENPGPKEY = 61, /* RFC 7929 */
252                   LDNS_RR_TYPE_CSYNC = 62, /* RFC 7477 */
253                   LDNS_RR_TYPE_ZONEMD = 63, /* draft-ietf-dnsop-dns-zone-di‐
254              gest */
255                   LDNS_RR_TYPE_SVCB = 64, /* draft-ietf-dnsop-svcb-https */
256                   LDNS_RR_TYPE_HTTPS = 65, /* draft-ietf-dnsop-svcb-https */
257
258                   LDNS_RR_TYPE_SPF = 99, /* RFC 4408 */
259
260                   LDNS_RR_TYPE_UINFO = 100,
261                   LDNS_RR_TYPE_UID = 101,
262                   LDNS_RR_TYPE_GID = 102,
263                   LDNS_RR_TYPE_UNSPEC = 103,
264
265                   LDNS_RR_TYPE_NID = 104, /* RFC 6742 */
266                   LDNS_RR_TYPE_L32 = 105, /* RFC 6742 */
267                   LDNS_RR_TYPE_L64 = 106, /* RFC 6742 */
268                   LDNS_RR_TYPE_LP = 107, /* RFC 6742 */
269
270                   LDNS_RR_TYPE_EUI48 = 108, /* RFC 7043 */
271                   LDNS_RR_TYPE_EUI64 = 109, /* RFC 7043 */
272
273                   LDNS_RR_TYPE_TKEY = 249, /* RFC 2930 */
274                   LDNS_RR_TYPE_TSIG = 250,
275                   LDNS_RR_TYPE_IXFR = 251,
276                   LDNS_RR_TYPE_AXFR = 252,
277                   A request for mailbox-related records (MB, MG or MR):
278                   LDNS_RR_TYPE_MAILB = 253,
279                   A request for mail agent RRs (Obsolete - see MX):
280                   LDNS_RR_TYPE_MAILA = 254,
281                   any type (wildcard):
282                   LDNS_RR_TYPE_ANY = 255,
283                   LDNS_RR_TYPE_URI = 256, /* RFC 7553 */
284                   LDNS_RR_TYPE_CAA = 257, /* RFC 6844 */
285                   LDNS_RR_TYPE_AVC = 258, /* Cisco's DNS-AS RR, see www.dns-
286              as.org */
287                   LDNS_RR_TYPE_DOA = 259, /* draft-durand-doa-over-dns */
288
289                   draft-ietf-mboned-driad-amt-discovery *:
290                   LDNS_RR_TYPE_AMTRELAY = 260,
291
292                   DNSSEC Trust Authorities:
293                   LDNS_RR_TYPE_TA = 32768,
294                   /* RFC 4431, 5074, DNSSEC Lookaside Validation */
295                   LDNS_RR_TYPE_DLV = 32769,
296
297                   /* type codes from nsec3 experimental phase
298                   LDNS_RR_TYPE_NSEC3 = 65324,
299                   LDNS_RR_TYPE_NSEC3PARAMS = 65325, */
300                   LDNS_RR_TYPE_FIRST = 0,
301                   LDNS_RR_TYPE_LAST  = 65535,
302                   LDNS_RR_TYPE_COUNT = LDNS_RR_TYPE_LAST - LDNS_RR_TYPE_FIRST
303              + 1
304              };
305              typedef enum ldns_enum_rr_type ldns_rr_type;
306
307       ldns_rr_compress
308               Used to specify whether compression is allowed.
309              enum ldns_enum_rr_compress
310              {
311                   compression is allowed:
312                   LDNS_RR_COMPRESS,
313                   LDNS_RR_NO_COMPRESS
314              };
315              typedef enum ldns_enum_rr_compress ldns_rr_compress;
316
317       ldns_rr_list
318              List or Set of Resource Records
319
320              Contains a list of rr's <br>
321              No official RFC-like checks are made
322              struct ldns_struct_rr_list
323              {
324                   size_t _rr_count;
325                   size_t _rr_capacity;
326                   ldns_rr **_rrs;
327              };
328              typedef struct ldns_struct_rr_list ldns_rr_list;
329

AUTHOR

331       The ldns team at NLnet Labs.
332
333

REPORTING BUGS

335       Please report bugs to ldns-team@nlnetlabs.nl or in our bugzilla at
336       http://www.nlnetlabs.nl/bugs/index.html
337
338
340       Copyright (c) 2004 - 2006 NLnet Labs.
341
342       Licensed under the BSD License. There is NO warranty; not even for MER‐
343       CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
344
345

SEE ALSO

347       ldns_rr_new, ldns_rr_new_frm_type, ldns_rr_new_frm_str,
348       ldns_rr_new_frm_fp, ldns_rr_free, ldns_rr_print, ldns_rr_set_owner,
349       ldns_rr_set_ttl, ldns_rr_set_type, ldns_rr_set_rd_count,
350       ldns_rr_set_class, ldns_rr_set_rdf, ldns_rr_push_rdf, ldns_rr_pop_rdf,
351       ldns_rr_rdf, ldns_rr_owner, ldns_rr_rd_count, ldns_rr_ttl,
352       ldns_rr_get_class, ldns_rr_list_rr_count, ldns_rr_list_set_rr_count,
353       ldns_rr_list_new, ldns_rr_list_free, ldns_rr_list_cat,
354       ldns_rr_list_push_rr, ldns_rr_list_pop_rr, ldns_is_rrset,
355       ldns_rr_set_push_rr, ldns_rr_set_pop_rr, ldns_get_rr_class_by_name,
356       ldns_get_rr_type_by_name, ldns_rr_list_clone, ldns_rr_list_sort,
357       ldns_rr_compare, ldns_rr_compare_ds, ldns_rr_uncompressed_size,
358       ldns_rr2canonical, ldns_rr_label_count, ldns_is_rrset, ldns_rr_descrip‐
359       tor, ldns_rr_descript.  And perldoc Net::DNS, RFC1034, RFC1035,
360       RFC4033, RFC4034  and RFC4035.
361

REMARKS

363       This manpage was automatically generated from the ldns source code.
364
365
366
367                                  30 May 2006                          ldns(3)
Impressum