31 #define LDNS_MAX_RDFLEN 65535
33 #define LDNS_RDF_SIZE_BYTE 1
34 #define LDNS_RDF_SIZE_WORD 2
35 #define LDNS_RDF_SIZE_DOUBLEWORD 4
36 #define LDNS_RDF_SIZE_6BYTES 6
37 #define LDNS_RDF_SIZE_8BYTES 8
38 #define LDNS_RDF_SIZE_16BYTES 16
40 #define LDNS_NSEC3_VARS_OPTOUT_MASK 0x01
453 uint8_t *hit_size, uint8_t** hit,
454 uint16_t *pk_size, uint8_t** pk);
467 uint8_t hit_size, uint8_t *hit, uint16_t pk_size, uint8_t *pk);
Common definitions for LDNS.
Defines error numbers and functions to translate those to a readable string.
enum ldns_enum_status ldns_status
uint32_t ldns_str2period(const char *nptr, const char **endptr)
converts a ttl value (like 5d2h) to a long.
enum ldns_enum_cert_algorithm ldns_cert_algorithm
ldns_status ldns_rdf_hip_new_frm_alg_hit_pk(ldns_rdf **rdf, uint8_t alg, uint8_t hit_size, uint8_t *hit, uint16_t pk_size, uint8_t *pk)
Creates a new LDNS_RDF_TYPE_HIP rdf from given data.
ldns_rdf_type ldns_rdf_get_type(const ldns_rdf *rd)
returns the type of the rdf.
void ldns_rdf_set_type(ldns_rdf *rd, ldns_rdf_type type)
sets the size of the rdf.
ldns_rdf * ldns_native2rdf_int8(ldns_rdf_type type, uint8_t value)
returns the rdf containing the native uint8_t repr.
void ldns_rdf_deep_free(ldns_rdf *rd)
frees a rdf structure and frees the data.
ldns_rdf * ldns_rdf_new(ldns_rdf_type type, size_t size, void *data)
allocates a new rdf structure and fills it.
ldns_rdf * ldns_native2rdf_int16_data(size_t size, uint8_t *data)
returns an int16_data rdf that contains the data in the given array, preceded by an int16 specifying ...
uint32_t ldns_rdf2native_int32(const ldns_rdf *rd)
returns the native uint32_t representation from the rdf.
uint16_t ldns_rdf2native_int16(const ldns_rdf *rd)
returns the native uint16_t representation from the rdf.
ldns_status ldns_rdf_new_frm_fp_l(ldns_rdf **r, ldns_rdf_type type, FILE *fp, int *line_nr)
creates a new rdf from a file containing a string.
ldns_status ldns_octet(char *word, size_t *length)
removes \DDD, \[space] and other escapes from the input.
ldns_rdf * ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str)
creates a new rdf from a string.
ldns_rdf * ldns_native2rdf_int16(ldns_rdf_type type, uint16_t value)
returns the rdf containing the native uint16_t representation.
enum ldns_enum_svcparam_key ldns_svcparam_key
uint8_t ldns_rdf2native_int8(const ldns_rdf *rd)
returns the native uint8_t representation from the rdf.
ldns_enum_rdf_type
The different types of RDATA fields.
@ LDNS_RDF_TYPE_INT32
32 bits
@ LDNS_RDF_TYPE_TAG
A non-zero sequence of US-ASCII letters and numbers in lower case.
@ LDNS_RDF_TYPE_NSAP
NSAP.
@ LDNS_RDF_TYPE_HIP
Represents the Public Key Algorithm, HIT and Public Key fields for the HIP RR types.
@ LDNS_RDF_TYPE_B32_EXT
b32 string
@ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
nsec3 base32 string (with length byte on wire
@ LDNS_RDF_TYPE_CERT_ALG
certificate algorithm
@ LDNS_RDF_TYPE_EUI48
6 * 8 bit hex numbers separated by dashes.
@ LDNS_RDF_TYPE_SERVICE
protocol and port bitmaps
@ LDNS_RDF_TYPE_EUI64
8 * 8 bit hex numbers separated by dashes.
@ LDNS_RDF_TYPE_PERIOD
period
@ LDNS_RDF_TYPE_B64
b64 string
@ LDNS_RDF_TYPE_AAAA
AAAA record.
@ LDNS_RDF_TYPE_UNKNOWN
unknown types
@ LDNS_RDF_TYPE_WKS
well known services
@ LDNS_RDF_TYPE_DNAME
domain name
@ LDNS_RDF_TYPE_TIME
time (32 bits)
@ LDNS_RDF_TYPE_SVCPARAMS
draft-ietf-dnsop-svcb-https
@ LDNS_RDF_TYPE_NSEC
nsec type codes
@ LDNS_RDF_TYPE_NSEC3_SALT
nsec3 hash salt
@ LDNS_RDF_TYPE_APL
apl data
@ LDNS_RDF_TYPE_A
A record.
@ LDNS_RDF_TYPE_LONG_STR
A <character-string> encoding of the value field as specified [RFC1035], Section 5....
@ LDNS_RDF_TYPE_LOC
location data
@ LDNS_RDF_TYPE_INT16_DATA
variable length any type rdata where the length is specified by the first 2 bytes
@ LDNS_RDF_TYPE_ILNP64
4 shorts represented as 4 * 16 bit hex numbers separated by colons.
@ LDNS_RDF_TYPE_ATMA
ATMA.
@ LDNS_RDF_TYPE_HEX
hex string
@ LDNS_RDF_TYPE_CLASS
a class
@ LDNS_RDF_TYPE_INT8
8 bits
@ LDNS_RDF_TYPE_MATCHING_TYPE
@ LDNS_RDF_TYPE_IPSECKEY
IPSECKEY.
@ LDNS_RDF_TYPE_CERTIFICATE_USAGE
Since RFC7218 TLSA records can be given with mnemonics, hence these rdata field types.
@ LDNS_RDF_TYPE_STR
txt string
@ LDNS_RDF_TYPE_INT16
16 bits
@ LDNS_RDF_TYPE_ALG
a key algorithm
@ LDNS_RDF_TYPE_AMTRELAY
draft-ietf-mboned-driad-amt-discovery
@ LDNS_RDF_TYPE_TSIGTIME
tsig time 48 bits
@ LDNS_RDF_TYPE_TYPE
a RR type
ldns_rdf * ldns_rdf_address_reverse(const ldns_rdf *rd)
reverses an rdf, only actually useful for AAAA and A records.
ldns_status ldns_rdf_new_frm_fp(ldns_rdf **r, ldns_rdf_type type, FILE *fp)
creates a new rdf from a file containing a string.
ldns_status ldns_rdf_hip_get_alg_hit_pk(ldns_rdf *rdf, uint8_t *alg, uint8_t *hit_size, uint8_t **hit, uint16_t *pk_size, uint8_t **pk)
Gets the algorithm value, the HIT and Public Key data from the rdf with type LDNS_RDF_TYPE_HIP.
size_t ldns_rdf_size(const ldns_rdf *rd)
returns the size of the rdf.
time_t ldns_rdf2native_time_t(const ldns_rdf *rd)
returns the native time_t representation from the rdf.
void ldns_rdf_set_data(ldns_rdf *rd, void *data)
sets the size of the rdf.
uint8_t * ldns_rdf_data(const ldns_rdf *rd)
returns the data of the rdf.
void ldns_rdf_set_size(ldns_rdf *rd, size_t size)
sets the size of the rdf.
ldns_rdf * ldns_native2rdf_int32(ldns_rdf_type type, uint32_t value)
returns an rdf that contains the given int32 value.
void ldns_rdf_free(ldns_rdf *rd)
frees a rdf structure, leaving the data pointer intact.
int ldns_rdf_compare(const ldns_rdf *rd1, const ldns_rdf *rd2)
compares two rdf's on their wire formats.
ldns_enum_svcparam_key
keys types in SVCPARAMS rdata fields
@ LDNS_SVCPARAM_KEY_MANDATORY
@ LDNS_SVCPARAM_KEY_IPV4HINT
@ LDNS_SVCPARAM_KEY_IPV6HINT
@ LDNS_SVCPARAM_KEY_RESERVED
@ LDNS_SVCPARAM_KEY_LAST_KEY
@ LDNS_SVCPARAM_KEY_NO_DEFAULT_ALPN
@ LDNS_SVCPARAM_KEY_DOHPATH
ldns_enum_cert_algorithm
algorithms used in CERT rrs
enum ldns_enum_rdf_type ldns_rdf_type
ldns_rdf * ldns_rdf_clone(const ldns_rdf *rd)
clones a rdf structure.
ldns_rdf * ldns_rdf_new_frm_data(ldns_rdf_type type, size_t size, const void *data)
allocates a new rdf structure and fills it.
Resource record data field.
ldns_rdf_type _type
The type of the data.
size_t _size
The size of the data (in octets)
void * _data
Pointer to the data (raw octets)