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
8

SYNOPSIS

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

DESCRIPTION

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

AUTHOR

297       The ldns team at NLnet Labs. Which consists out  of  Jelte  Jansen  and
298       Miek Gieben.
299
300

REPORTING BUGS

302       Please  report  bugs  to  ldns-team@nlnetlabs.nl  or in our bugzilla at
303       http://www.nlnetlabs.nl/bugs/index.html
304
305
307       Copyright (c) 2004 - 2006 NLnet Labs.
308
309       Licensed under the BSD License. There is NO warranty; not even for MER‐
310       CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
311
312

SEE ALSO

314       ldns_rr_new,         ldns_rr_new_frm_type,         ldns_rr_new_frm_str,
315       ldns_rr_new_frm_fp,  ldns_rr_free,  ldns_rr_print,   ldns_rr_set_owner,
316       ldns_rr_set_ttl,         ldns_rr_set_type,        ldns_rr_set_rd_count,
317       ldns_rr_set_class, ldns_rr_set_rdf, ldns_rr_push_rdf,  ldns_rr_pop_rdf,
318       ldns_rr_rdf,      ldns_rr_owner,     ldns_rr_rd_count,     ldns_rr_ttl,
319       ldns_rr_get_class,  ldns_rr_list_rr_count,   ldns_rr_list_set_rr_count,
320       ldns_rr_list_new,          ldns_rr_list_free,         ldns_rr_list_cat,
321       ldns_rr_list_push_rr,        ldns_rr_list_pop_rr,        ldns_is_rrset,
322       ldns_rr_set_push_rr,   ldns_rr_set_pop_rr,   ldns_get_rr_class_by_name,
323       ldns_get_rr_type_by_name,    ldns_rr_list_clone,     ldns_rr_list_sort,
324       ldns_rr_compare,     ldns_rr_compare_ds,     ldns_rr_uncompressed_size,
325       ldns_rr2canonical, ldns_rr_label_count, ldns_is_rrset, ldns_rr_descrip‐
326       tor,   ldns_rr_descript.    And  perldoc  Net::DNS,  RFC1034,  RFC1035,
327       RFC4033, RFC4034  and RFC4035.
328

REMARKS

330       This manpage was automaticly generated from the ldns source code by use
331       of Doxygen and some perl.
332
333
334
335                                  30 May 2006                          ldns(3)
Impressum