Electroneum
rrdef.h
Go to the documentation of this file.
1 /*
2  * rrdef.h
3  *
4  * RR definitions
5  *
6  * a Net::DNS like library for C
7  *
8  * (c) NLnet Labs, 2005-2006
9  *
10  * See the file LICENSE for the license
11  */
12 
19 #ifndef LDNS_RRDEF_H
20 #define LDNS_RRDEF_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
27 #define LDNS_MAX_LABELLEN 63
28 
29 #define LDNS_MAX_DOMAINLEN 255
30 
31 #define LDNS_MAX_POINTERS 65535
32 
33 #define LDNS_RR_OVERHEAD 10
34 
35 #define LDNS_DNSSEC_KEYPROTO 3
36 #define LDNS_KEY_ZONE_KEY 0x0100 /* set for ZSK&KSK, rfc 4034 */
37 #define LDNS_KEY_SEP_KEY 0x0001 /* set for KSK, rfc 4034 */
38 #define LDNS_KEY_REVOKE_KEY 0x0080 /* used to revoke KSK, rfc 5011 */
39 
40 /* The first fields are contiguous and can be referenced instantly */
41 #define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON 259
42 
45 
50 {
61 
65 };
67 
72 {
76 };
78 
83 {
171  LDNS_RR_TYPE_SSHFP = 44, /* RFC 4255 */
173  LDNS_RR_TYPE_IPSECKEY = 45, /* RFC 4025 */
175  LDNS_RR_TYPE_RRSIG = 46, /* RFC 4034 */
176  LDNS_RR_TYPE_NSEC = 47, /* RFC 4034 */
177  LDNS_RR_TYPE_DNSKEY = 48, /* RFC 4034 */
178 
179  LDNS_RR_TYPE_DHCID = 49, /* RFC 4701 */
180  /* NSEC3 */
181  LDNS_RR_TYPE_NSEC3 = 50, /* RFC 5155 */
182  LDNS_RR_TYPE_NSEC3PARAM = 51, /* RFC 5155 */
184  LDNS_RR_TYPE_TLSA = 52, /* RFC 6698 */
185  LDNS_RR_TYPE_SMIMEA = 53, /* draft-ietf-dane-smime, TLSA-like but may
186  be extended */
187 
188  LDNS_RR_TYPE_HIP = 55, /* RFC 5205 */
189 
198  LDNS_RR_TYPE_OPENPGPKEY = 61, /* RFC 7929 */
199  LDNS_RR_TYPE_CSYNC = 62, /* RFC 7477 */
200 
201  LDNS_RR_TYPE_SPF = 99, /* RFC 4408 */
202 
207 
208  LDNS_RR_TYPE_NID = 104, /* RFC 6742 */
209  LDNS_RR_TYPE_L32 = 105, /* RFC 6742 */
210  LDNS_RR_TYPE_L64 = 106, /* RFC 6742 */
211  LDNS_RR_TYPE_LP = 107, /* RFC 6742 */
212 
216 
217  LDNS_RR_TYPE_TKEY = 249, /* RFC 2930 */
227  LDNS_RR_TYPE_URI = 256, /* RFC 7553 */
228  LDNS_RR_TYPE_CAA = 257, /* RFC 6844 */
230 
233  /* RFC 4431, 5074, DNSSEC Lookaside Validation */
235 
236  /* type codes from nsec3 experimental phase
237  LDNS_RR_TYPE_NSEC3 = 65324,
238  LDNS_RR_TYPE_NSEC3PARAMS = 65325, */
242 };
244 
245 /* RDATA */
246 #define LDNS_MAX_RDFLEN 65535
247 
248 #define LDNS_RDF_SIZE_BYTE 1
249 #define LDNS_RDF_SIZE_WORD 2
250 #define LDNS_RDF_SIZE_DOUBLEWORD 4
251 #define LDNS_RDF_SIZE_6BYTES 6
252 #define LDNS_RDF_SIZE_8BYTES 8
253 #define LDNS_RDF_SIZE_16BYTES 16
254 
255 #define LDNS_NSEC3_VARS_OPTOUT_MASK 0x01
256 
257 #define LDNS_APL_IP4 1
258 #define LDNS_APL_IP6 2
259 #define LDNS_APL_MASK 0x7f
260 #define LDNS_APL_NEGATION 0x80
261 
266 {
332 
337 
342 
347 
353 
356 
357  /* Aliases */
359 };
361 
366 {
367  LDNS_RSAMD5 = 1, /* RFC 4034,4035 */
368  LDNS_DH = 2,
369  LDNS_DSA = 3,
370  LDNS_ECC = 4,
374  LDNS_RSASHA256 = 8, /* RFC 5702 */
375  LDNS_RSASHA512 = 10, /* RFC 5702 */
376  LDNS_ECC_GOST = 12, /* RFC 5933 */
377  LDNS_ECDSAP256SHA256 = 13, /* RFC 6605 */
378  LDNS_ECDSAP384SHA384 = 14, /* RFC 6605 */
379  LDNS_ED25519 = 15, /* RFC 8080 */
380  LDNS_ED448 = 16, /* RFC 8080 */
384 };
386 
391 {
392  LDNS_SHA1 = 1, /* RFC 4034 */
393  LDNS_SHA256 = 2, /* RFC 4509 */
394  LDNS_HASH_GOST = 3, /* RFC 5933 */
395  LDNS_SHA384 = 4 /* RFC 6605 */
396 };
398 
403 {
414 };
416 
421 {
422  LDNS_EDNS_LLQ = 1, /* http://files.dns-sd.org/draft-sekar-dns-llq.txt */
423  LDNS_EDNS_UL = 2, /* http://files.dns-sd.org/draft-sekar-dns-ul.txt */
424  LDNS_EDNS_NSID = 3, /* RFC5001 */
425  /* 4 draft-cheshire-edns0-owner-option */
426  LDNS_EDNS_DAU = 5, /* RFC6975 */
427  LDNS_EDNS_DHU = 6, /* RFC6975 */
428  LDNS_EDNS_N3U = 7, /* RFC6975 */
429  LDNS_EDNS_CLIENT_SUBNET = 8, /* RFC7871 */
430  LDNS_EDNS_KEEPALIVE = 11, /* draft-ietf-dnsop-edns-tcp-keepalive*/
431  LDNS_EDNS_PADDING = 12 /* RFC7830 */
432 };
434 
435 #define LDNS_EDNS_MASK_DO_BIT 0x8000
436 
438 #define LDNS_TSIG_ERROR_NOERROR 0
439 #define LDNS_TSIG_ERROR_BADSIG 16
440 #define LDNS_TSIG_ERROR_BADKEY 17
441 #define LDNS_TSIG_ERROR_BADTIME 18
442 #define LDNS_TSIG_ERROR_BADMODE 19
443 #define LDNS_TSIG_ERROR_BADNAME 20
444 #define LDNS_TSIG_ERROR_BADALG 21
445 
452 {
456  const char *_name;
469 };
471 
479 
486 size_t sldns_rr_descriptor_minimum(const sldns_rr_descriptor *descriptor);
487 
494 size_t sldns_rr_descriptor_maximum(const sldns_rr_descriptor *descriptor);
495 
503 sldns_rdf_type sldns_rr_descriptor_field_type(const sldns_rr_descriptor *descriptor, size_t field);
504 
511 
518 
519 #ifdef __cplusplus
520 }
521 #endif
522 
523 #endif /* LDNS_RRDEF_H */
sldns_enum_hash
Definition: rrdef.h:390
struct sldns_struct_lookup_table * sldns_rr_classes
enum sldns_enum_algorithm sldns_algorithm
Definition: rrdef.h:385
enum sldns_enum_rr_compress sldns_rr_compress
Definition: rrdef.h:77
enum sldns_enum_rr_type sldns_rr_type
Definition: rrdef.h:243
unsigned short uint16_t
Definition: stdint.h:125
enum sldns_enum_hash sldns_hash
Definition: rrdef.h:397
unsigned char uint8_t
Definition: stdint.h:124
enum sldns_enum_rr_class sldns_rr_class
Definition: rrdef.h:66
const char * name
sldns_enum_rdf_type
Definition: rrdef.h:265
sldns_enum_rr_class
Definition: rrdef.h:49
sldns_rr_class sldns_get_rr_class_by_name(const char *name)
sldns_enum_cert_algorithm
Definition: rrdef.h:402
sldns_enum_rr_compress
Definition: rrdef.h:71
enum sldns_enum_edns_option sldns_edns_option
Definition: rrdef.h:433
sldns_enum_edns_option
Definition: rrdef.h:420
enum sldns_enum_cert_algorithm sldns_cert_algorithm
Definition: rrdef.h:415
const char * _name
Definition: rrdef.h:456
sldns_rr_compress _compress
Definition: rrdef.h:466
sldns_rdf_type sldns_rr_descriptor_field_type(const sldns_rr_descriptor *descriptor, size_t field)
Definition: rrdef.h:368
sldns_enum_rr_type
Definition: rrdef.h:82
sldns_rr_type _type
Definition: rrdef.h:454
size_t sldns_rr_descriptor_minimum(const sldns_rr_descriptor *descriptor)
sldns_enum_algorithm
Definition: rrdef.h:365
const sldns_rdf_type * _wireformat
Definition: rrdef.h:462
sldns_rr_type sldns_get_rr_type_by_name(const char *name)
size_t sldns_rr_descriptor_maximum(const sldns_rr_descriptor *descriptor)
enum sldns_enum_rdf_type sldns_rdf_type
Definition: rrdef.h:360
const sldns_rr_descriptor * sldns_rr_descript(uint16_t type)
sldns_rdf_type _variable
Definition: rrdef.h:464