Maintained by: NLnet Labs
Macros | Functions | Variables
rrdef.c File Reference

Defines resource record types and constants. More...

#include "config.h"
#include "sldns/rrdef.h"
#include "sldns/parseutil.h"

Macros

#define LDNS_RDATA_FIELD_DESCRIPTORS_COUNT   (sizeof(rdata_field_descriptors)/sizeof(rdata_field_descriptors[0]))
 computes the number of rdata fields
 

Functions

const sldns_rr_descriptorsldns_rr_descript (uint16_t type)
 returns the resource record descriptor for the given rr type. More...
 
size_t sldns_rr_descriptor_minimum (const sldns_rr_descriptor *descriptor)
 returns the minimum number of rdata fields of the rr type this descriptor describes. More...
 
size_t sldns_rr_descriptor_maximum (const sldns_rr_descriptor *descriptor)
 returns the maximum number of rdata fields of the rr type this descriptor describes. More...
 
sldns_rdf_type sldns_rr_descriptor_field_type (const sldns_rr_descriptor *descriptor, size_t index)
 returns the rdf type for the given rdata field number of the rr type for the given descriptor. More...
 
sldns_rr_type sldns_get_rr_type_by_name (const char *name)
 retrieves a rrtype by looking up its name. More...
 
sldns_rr_class sldns_get_rr_class_by_name (const char *name)
 retrieves a class by looking up its name. More...
 

Variables

static sldns_lookup_table sldns_rr_classes_data []
 
sldns_lookup_tablesldns_rr_classes = sldns_rr_classes_data
 lookuptable for rr classes
 
static const sldns_rdf_type type_0_wireformat [] = { LDNS_RDF_TYPE_UNKNOWN }
 
static const sldns_rdf_type type_a_wireformat [] = { LDNS_RDF_TYPE_A }
 
static const sldns_rdf_type type_ns_wireformat [] = { LDNS_RDF_TYPE_DNAME }
 
static const sldns_rdf_type type_md_wireformat [] = { LDNS_RDF_TYPE_DNAME }
 
static const sldns_rdf_type type_mf_wireformat [] = { LDNS_RDF_TYPE_DNAME }
 
static const sldns_rdf_type type_cname_wireformat [] = { LDNS_RDF_TYPE_DNAME }
 
static const sldns_rdf_type type_soa_wireformat []
 
static const sldns_rdf_type type_mb_wireformat [] = { LDNS_RDF_TYPE_DNAME }
 
static const sldns_rdf_type type_mg_wireformat [] = { LDNS_RDF_TYPE_DNAME }
 
static const sldns_rdf_type type_mr_wireformat [] = { LDNS_RDF_TYPE_DNAME }
 
static const sldns_rdf_type type_wks_wireformat []
 
static const sldns_rdf_type type_ptr_wireformat [] = { LDNS_RDF_TYPE_DNAME }
 
static const sldns_rdf_type type_hinfo_wireformat []
 
static const sldns_rdf_type type_minfo_wireformat []
 
static const sldns_rdf_type type_mx_wireformat []
 
static const sldns_rdf_type type_rp_wireformat []
 
static const sldns_rdf_type type_afsdb_wireformat []
 
static const sldns_rdf_type type_x25_wireformat [] = { LDNS_RDF_TYPE_STR }
 
static const sldns_rdf_type type_isdn_wireformat []
 
static const sldns_rdf_type type_rt_wireformat []
 
static const sldns_rdf_type type_nsap_wireformat []
 
static const sldns_rdf_type type_nsap_ptr_wireformat []
 
static const sldns_rdf_type type_sig_wireformat []
 
static const sldns_rdf_type type_key_wireformat []
 
static const sldns_rdf_type type_px_wireformat []
 
static const sldns_rdf_type type_gpos_wireformat []
 
static const sldns_rdf_type type_aaaa_wireformat [] = { LDNS_RDF_TYPE_AAAA }
 
static const sldns_rdf_type type_loc_wireformat [] = { LDNS_RDF_TYPE_LOC }
 
static const sldns_rdf_type type_nxt_wireformat []
 
static const sldns_rdf_type type_eid_wireformat []
 
static const sldns_rdf_type type_nimloc_wireformat []
 
static const sldns_rdf_type type_srv_wireformat []
 
static const sldns_rdf_type type_atma_wireformat []
 
static const sldns_rdf_type type_naptr_wireformat []
 
static const sldns_rdf_type type_kx_wireformat []
 
static const sldns_rdf_type type_cert_wireformat []
 
static const sldns_rdf_type type_a6_wireformat [] = { LDNS_RDF_TYPE_UNKNOWN }
 
static const sldns_rdf_type type_dname_wireformat [] = { LDNS_RDF_TYPE_DNAME }
 
static const sldns_rdf_type type_sink_wireformat []
 
static const sldns_rdf_type type_apl_wireformat []
 
static const sldns_rdf_type type_ds_wireformat []
 
static const sldns_rdf_type type_sshfp_wireformat []
 
static const sldns_rdf_type type_ipseckey_wireformat []
 
static const sldns_rdf_type type_rrsig_wireformat []
 
static const sldns_rdf_type type_nsec_wireformat []
 
static const sldns_rdf_type type_dhcid_wireformat []
 
static const sldns_rdf_type type_talink_wireformat []
 
static const sldns_rdf_type type_openpgpkey_wireformat []
 
static const sldns_rdf_type type_csync_wireformat []
 
static const sldns_rdf_type type_nsec3_wireformat []
 
static const sldns_rdf_type type_nsec3param_wireformat []
 
static const sldns_rdf_type type_dnskey_wireformat []
 
static const sldns_rdf_type type_tkey_wireformat []
 
static const sldns_rdf_type type_tsig_wireformat []
 
static const sldns_rdf_type type_tlsa_wireformat []
 
static const sldns_rdf_type type_hip_wireformat []
 
static const sldns_rdf_type type_nid_wireformat []
 
static const sldns_rdf_type type_l32_wireformat []
 
static const sldns_rdf_type type_l64_wireformat []
 
static const sldns_rdf_type type_lp_wireformat []
 
static const sldns_rdf_type type_eui48_wireformat []
 
static const sldns_rdf_type type_eui64_wireformat []
 
static const sldns_rdf_type type_uri_wireformat []
 
static const sldns_rdf_type type_caa_wireformat []
 
static sldns_rr_descriptor rdata_field_descriptors []
 

Detailed Description

Defines resource record types and constants.

Function Documentation

◆ sldns_rr_descript()

const sldns_rr_descriptor* sldns_rr_descript ( uint16_t  type)

returns the resource record descriptor for the given rr type.

Parameters
[in]typethe type value of the rr type
Returns
the sldns_rr_descriptor for this type

Referenced by analyze_rr(), calc_size(), canonical_compare(), lowercase_rdata(), print_ext(), rrinternal_parse_rdata(), sldns_wire2str_rdata_scan(), sldns_wire2str_type_print(), type_rdata_compressable(), and worker_handle_request().

◆ sldns_rr_descriptor_minimum()

size_t sldns_rr_descriptor_minimum ( const sldns_rr_descriptor descriptor)

returns the minimum number of rdata fields of the rr type this descriptor describes.

Parameters
[in]descriptorfor an rr type
Returns
the minimum number of rdata fields

References sldns_struct_rr_descriptor::_minimum.

Referenced by sldns_wire2str_rdata_scan().

◆ sldns_rr_descriptor_maximum()

size_t sldns_rr_descriptor_maximum ( const sldns_rr_descriptor descriptor)

returns the maximum number of rdata fields of the rr type this descriptor describes.

Parameters
[in]descriptorfor an rr type
Returns
the maximum number of rdata fields

References sldns_struct_rr_descriptor::_maximum, sldns_struct_rr_descriptor::_variable, and LDNS_RDF_TYPE_NONE.

Referenced by sldns_wire2str_rdata_scan().

◆ sldns_rr_descriptor_field_type()

sldns_rdf_type sldns_rr_descriptor_field_type ( const sldns_rr_descriptor descriptor,
size_t  field 
)

returns the rdf type for the given rdata field number of the rr type for the given descriptor.

Parameters
[in]descriptorfor an rr type
[in]fieldthe field number
Returns
the rdf type for the field

References sldns_struct_rr_descriptor::_variable, sldns_struct_rr_descriptor::_wireformat, and LDNS_RDF_TYPE_NONE.

Referenced by lowercase_rdata(), and sldns_wire2str_rdata_scan().

◆ sldns_get_rr_type_by_name()

sldns_rr_type sldns_get_rr_type_by_name ( const char *  name)

retrieves a rrtype by looking up its name.

Parameters
[in]namea string with the name
Returns
the type which corresponds with the name

References sldns_struct_rr_descriptor::_name, sldns_struct_rr_descriptor::_type, and LDNS_RDATA_FIELD_DESCRIPTORS_COUNT.

Referenced by do_flush_type(), massage_type(), qlist_parse_line(), sldns_str2wire_nsec_buf(), sldns_str2wire_type_buf(), and write_q().

◆ sldns_get_rr_class_by_name()

sldns_rr_class sldns_get_rr_class_by_name ( const char *  name)

retrieves a class by looking up its name.

Parameters
[in]namestring with the name
Returns
the cass which corresponds with the name

References sldns_lookup_by_name().

Referenced by massage_class(), qlist_parse_line(), sldns_str2wire_class_buf(), and write_q().

Variable Documentation

◆ sldns_rr_classes_data

sldns_lookup_table sldns_rr_classes_data[]
static
Initial value:
= {
{ LDNS_RR_CLASS_IN, "IN" },
{ LDNS_RR_CLASS_CH, "CH" },
{ LDNS_RR_CLASS_HS, "HS" },
{ LDNS_RR_CLASS_NONE, "NONE" },
{ LDNS_RR_CLASS_ANY, "ANY" },
{ 0, NULL }
}
Chaos class.
Definition: rrdef.h:54
Hesiod (Dyer 87)
Definition: rrdef.h:56
None class, dynamic update.
Definition: rrdef.h:58
the Internet
Definition: rrdef.h:52
Any class.
Definition: rrdef.h:60

◆ type_soa_wireformat

const sldns_rdf_type type_soa_wireformat[]
static
Initial value:
= {
LDNS_RDF_TYPE_PERIOD
}
32 bits
Definition: rrdef.h:276
domain name
Definition: rrdef.h:270
period
Definition: rrdef.h:306

◆ type_wks_wireformat

const sldns_rdf_type type_wks_wireformat[]
static
Initial value:
= {
}
well known services
Definition: rrdef.h:321
A record.
Definition: rrdef.h:278

◆ type_hinfo_wireformat

const sldns_rdf_type type_hinfo_wireformat[]
static
Initial value:
= {
}
txt string
Definition: rrdef.h:282

◆ type_minfo_wireformat

const sldns_rdf_type type_minfo_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270

◆ type_mx_wireformat

const sldns_rdf_type type_mx_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274

◆ type_rp_wireformat

const sldns_rdf_type type_rp_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270

◆ type_afsdb_wireformat

const sldns_rdf_type type_afsdb_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274

◆ type_isdn_wireformat

const sldns_rdf_type type_isdn_wireformat[]
static
Initial value:
= {
}
txt string
Definition: rrdef.h:282

◆ type_rt_wireformat

const sldns_rdf_type type_rt_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274

◆ type_nsap_wireformat

const sldns_rdf_type type_nsap_wireformat[]
static
Initial value:
= {
}
NSAP.
Definition: rrdef.h:323

◆ type_nsap_ptr_wireformat

const sldns_rdf_type type_nsap_ptr_wireformat[]
static
Initial value:
= {
}
txt string
Definition: rrdef.h:282

◆ type_sig_wireformat

const sldns_rdf_type type_sig_wireformat[]
static
Initial value:
= {
}
32 bits
Definition: rrdef.h:276
domain name
Definition: rrdef.h:270
8 bits
Definition: rrdef.h:272
16 bits
Definition: rrdef.h:274
a key algorithm
Definition: rrdef.h:300
a RR type
Definition: rrdef.h:294
time (32 bits)
Definition: rrdef.h:304
b64 string
Definition: rrdef.h:288

◆ type_key_wireformat

const sldns_rdf_type type_key_wireformat[]
static
Initial value:
= {
}
8 bits
Definition: rrdef.h:272
16 bits
Definition: rrdef.h:274
b64 string
Definition: rrdef.h:288

◆ type_px_wireformat

const sldns_rdf_type type_px_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274

◆ type_gpos_wireformat

const sldns_rdf_type type_gpos_wireformat[]
static
Initial value:
= {
}
txt string
Definition: rrdef.h:282

◆ type_nxt_wireformat

const sldns_rdf_type type_nxt_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
unknown types
Definition: rrdef.h:302

◆ type_eid_wireformat

const sldns_rdf_type type_eid_wireformat[]
static
Initial value:
= {
}
hex string
Definition: rrdef.h:290

◆ type_nimloc_wireformat

const sldns_rdf_type type_nimloc_wireformat[]
static
Initial value:
= {
}
hex string
Definition: rrdef.h:290

◆ type_srv_wireformat

const sldns_rdf_type type_srv_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274

◆ type_atma_wireformat

const sldns_rdf_type type_atma_wireformat[]
static
Initial value:
= {
}
ATMA.
Definition: rrdef.h:325

◆ type_naptr_wireformat

const sldns_rdf_type type_naptr_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274
txt string
Definition: rrdef.h:282

◆ type_kx_wireformat

const sldns_rdf_type type_kx_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274

◆ type_cert_wireformat

const sldns_rdf_type type_cert_wireformat[]
static
Initial value:
= {
}
16 bits
Definition: rrdef.h:274
a key algorithm
Definition: rrdef.h:300
certificate algorithm
Definition: rrdef.h:298
b64 string
Definition: rrdef.h:288

◆ type_sink_wireformat

const sldns_rdf_type type_sink_wireformat[]
static
Initial value:
}
8 bits
Definition: rrdef.h:272
b64 string
Definition: rrdef.h:288

◆ type_apl_wireformat

const sldns_rdf_type type_apl_wireformat[]
static
Initial value:
= {
}
apl data
Definition: rrdef.h:284

◆ type_ds_wireformat

const sldns_rdf_type type_ds_wireformat[]
static
Initial value:
= {
}
hex string
Definition: rrdef.h:290
8 bits
Definition: rrdef.h:272
16 bits
Definition: rrdef.h:274
a key algorithm
Definition: rrdef.h:300

◆ type_sshfp_wireformat

const sldns_rdf_type type_sshfp_wireformat[]
static
Initial value:
= {
}
hex string
Definition: rrdef.h:290
8 bits
Definition: rrdef.h:272

◆ type_ipseckey_wireformat

const sldns_rdf_type type_ipseckey_wireformat[]
static
Initial value:
= {
}
IPSECKEY.
Definition: rrdef.h:327

◆ type_rrsig_wireformat

const sldns_rdf_type type_rrsig_wireformat[]
static
Initial value:
= {
}
32 bits
Definition: rrdef.h:276
domain name
Definition: rrdef.h:270
8 bits
Definition: rrdef.h:272
16 bits
Definition: rrdef.h:274
a key algorithm
Definition: rrdef.h:300
a RR type
Definition: rrdef.h:294
time (32 bits)
Definition: rrdef.h:304
b64 string
Definition: rrdef.h:288

◆ type_nsec_wireformat

const sldns_rdf_type type_nsec_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
nsec type codes
Definition: rrdef.h:292

◆ type_dhcid_wireformat

const sldns_rdf_type type_dhcid_wireformat[]
static
Initial value:
= {
}
b64 string
Definition: rrdef.h:288

◆ type_talink_wireformat

const sldns_rdf_type type_talink_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270

◆ type_openpgpkey_wireformat

const sldns_rdf_type type_openpgpkey_wireformat[]
static
Initial value:
= {
}
b64 string
Definition: rrdef.h:288

◆ type_csync_wireformat

const sldns_rdf_type type_csync_wireformat[]
static
Initial value:
= {
}
32 bits
Definition: rrdef.h:276
16 bits
Definition: rrdef.h:274
nsec type codes
Definition: rrdef.h:292

◆ type_nsec3_wireformat

const sldns_rdf_type type_nsec3_wireformat[]
static
Initial value:
= {
}
nsec3 hash salt
Definition: rrdef.h:329
8 bits
Definition: rrdef.h:272
16 bits
Definition: rrdef.h:274
nsec type codes
Definition: rrdef.h:292
nsec3 base32 string (with length byte on wire
Definition: rrdef.h:331

◆ type_nsec3param_wireformat

const sldns_rdf_type type_nsec3param_wireformat[]
static
Initial value:
= {
}
nsec3 hash salt
Definition: rrdef.h:329
8 bits
Definition: rrdef.h:272
16 bits
Definition: rrdef.h:274

◆ type_dnskey_wireformat

const sldns_rdf_type type_dnskey_wireformat[]
static
Initial value:
= {
}
8 bits
Definition: rrdef.h:272
16 bits
Definition: rrdef.h:274
a key algorithm
Definition: rrdef.h:300
b64 string
Definition: rrdef.h:288

◆ type_tkey_wireformat

const sldns_rdf_type type_tkey_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274
variable length any type rdata where the length is specified by the first 2 bytes ...
Definition: rrdef.h:315
time (32 bits)
Definition: rrdef.h:304
TSIG extended 16bit error value.
Definition: rrdef.h:355

◆ type_tsig_wireformat

const sldns_rdf_type type_tsig_wireformat[]
static
Initial value:
= {
LDNS_RDF_TYPE_INT16_DATA
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274
variable length any type rdata where the length is specified by the first 2 bytes ...
Definition: rrdef.h:315
tsig time 48 bits
Definition: rrdef.h:308
TSIG extended 16bit error value.
Definition: rrdef.h:355

◆ type_tlsa_wireformat

const sldns_rdf_type type_tlsa_wireformat[]
static
Initial value:
= {
}
hex string
Definition: rrdef.h:290
8 bits
Definition: rrdef.h:272

◆ type_hip_wireformat

const sldns_rdf_type type_hip_wireformat[]
static
Initial value:
= {
}
Represents the Public Key Algorithm, HIT and Public Key fields for the HIP RR types.
Definition: rrdef.h:312

◆ type_nid_wireformat

const sldns_rdf_type type_nid_wireformat[]
static
Initial value:
= {
}
16 bits
Definition: rrdef.h:274
4 shorts represented as 4 * 16 bit hex numbers separated by colons.
Definition: rrdef.h:336

◆ type_l32_wireformat

const sldns_rdf_type type_l32_wireformat[]
static
Initial value:
= {
}
16 bits
Definition: rrdef.h:274
A record.
Definition: rrdef.h:278

◆ type_l64_wireformat

const sldns_rdf_type type_l64_wireformat[]
static
Initial value:
= {
}
16 bits
Definition: rrdef.h:274
4 shorts represented as 4 * 16 bit hex numbers separated by colons.
Definition: rrdef.h:336

◆ type_lp_wireformat

const sldns_rdf_type type_lp_wireformat[]
static
Initial value:
= {
}
domain name
Definition: rrdef.h:270
16 bits
Definition: rrdef.h:274

◆ type_eui48_wireformat

const sldns_rdf_type type_eui48_wireformat[]
static
Initial value:
= {
}
6 * 8 bit hex numbers separated by dashes.
Definition: rrdef.h:339

◆ type_eui64_wireformat

const sldns_rdf_type type_eui64_wireformat[]
static
Initial value:
= {
}
8 * 8 bit hex numbers separated by dashes.
Definition: rrdef.h:341

◆ type_uri_wireformat

const sldns_rdf_type type_uri_wireformat[]
static
Initial value:
= {
}
16 bits
Definition: rrdef.h:274
A <character-string> encoding of the value field as specified [RFC1035], Section 5.1., encoded as remaining rdata.
Definition: rrdef.h:352

◆ type_caa_wireformat

const sldns_rdf_type type_caa_wireformat[]
static
Initial value:
= {
}
8 bits
Definition: rrdef.h:272
A <character-string> encoding of the value field as specified [RFC1035], Section 5.1., encoded as remaining rdata.
Definition: rrdef.h:352
A non-zero sequence of US-ASCII letters and numbers in lower case.
Definition: rrdef.h:346