/build/ldns-NeVfgT/ldns-1.9.2/rr.c
Go to the documentation of this file.
/* rr.c
*
* access functions for ldns_rr -
* a Net::DNS like library for C
* LibDNS Team @ NLnet Labs
*
* (c) NLnet Labs, 2004-2006
* See the file LICENSE for the license
*/
#include <ldns/config.h>
#include <ldns/ldns.h>
#include <strings.h>
#include <limits.h>
#include <errno.h>
#define LDNS_SYNTAX_DATALEN 16
#define LDNS_TTL_DATALEN 21
#define LDNS_RRLIST_INIT 8
#define _IS_WHITESPACE(chr) \
( NULL != strchr( LDNS_PARSE_NO_NL, chr) )
#define _BUFFER_IS_AT_WHITESPACE(rd_buf) \
_IS_WHITESPACE(*(ldns_buffer_current(rd_buf)))
ldns_rr *
ldns_rr_new(void)
{
ldns_rr *rr;
rr = LDNS_MALLOC(ldns_rr);
if (!rr) {
return NULL;
}
ldns_rr_set_owner(rr, NULL);
ldns_rr_set_question(rr, false);
ldns_rr_set_rd_count(rr, 0);
rr->_rdata_fields = NULL;
ldns_rr_set_class(rr, LDNS_RR_CLASS_IN);
ldns_rr_set_ttl(rr, LDNS_DEFAULT_TTL);
return rr;
}
ldns_rr *
ldns_rr_new_frm_type(ldns_rr_type t)
{
ldns_rr *rr;
const ldns_rr_descriptor *desc;
size_t i;
rr = LDNS_MALLOC(ldns_rr);
if (!rr) {
return NULL;
}
desc = ldns_rr_descript(t);
rr->_rdata_fields = LDNS_XMALLOC(ldns_rdf *, ldns_rr_descriptor_minimum(desc));
if(!rr->_rdata_fields) {
LDNS_FREE(rr);
return NULL;
}
for (i = 0; i < ldns_rr_descriptor_minimum(desc); i++) {
rr->_rdata_fields[i] = NULL;
}
ldns_rr_set_owner(rr, NULL);
ldns_rr_set_question(rr, false);
/* set the count to minimum */
ldns_rr_set_rd_count(rr, ldns_rr_descriptor_minimum(desc));
ldns_rr_set_class(rr, LDNS_RR_CLASS_IN);
ldns_rr_set_ttl(rr, LDNS_DEFAULT_TTL);
ldns_rr_set_type(rr, t);
return rr;
}
void
ldns_rr_free(ldns_rr *rr)
{
size_t i;
if (rr) {
if (ldns_rr_owner(rr)) {
ldns_rdf_deep_free(ldns_rr_owner(rr));
}
for (i = 0; i < ldns_rr_rd_count(rr); i++) {
ldns_rdf_deep_free(ldns_rr_rdf(rr, i));
}
LDNS_FREE(rr->_rdata_fields);
LDNS_FREE(rr);
}
}
/* Syntactic sugar for ldns_rr_new_frm_str_internal */
INLINE bool
ldns_rdf_type_maybe_quoted(ldns_rdf_type rdf_type)
{
return rdf_type == LDNS_RDF_TYPE_STR ||
rdf_type == LDNS_RDF_TYPE_LONG_STR;
}
/*
* trailing spaces are allowed
* leading spaces are not allowed
* allow ttl to be optional
* class is optional too
* if ttl is missing, and default_ttl is 0, use DEF_TTL
* allow ttl to be written as 1d3h
* So the RR should look like. e.g.
* miek.nl. 3600 IN MX 10 elektron.atoom.net
* or
* miek.nl. 1h IN MX 10 elektron.atoom.net
* or
* miek.nl. IN MX 10 elektron.atoom.net
*/
static ldns_status
ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
uint32_t default_ttl, const ldns_rdf *origin,
ldns_rdf **prev, bool question,
bool *explicit_ttl)
{
ldns_rr *new;
const ldns_rr_descriptor *desc;
ldns_rr_type rr_type;
ldns_buffer *rr_buf = NULL;
ldns_buffer *rd_buf = NULL;
uint32_t ttl_val;
char *owner = NULL;
char *ttl = NULL;
ldns_rr_class clas_val;
char *clas = NULL;
char *type = NULL;
size_t type_sz;
char *rdata = NULL;
char *rd = NULL;
char *xtok = NULL; /* For RDF types with spaces (i.e. extra tokens) */
size_t rd_strlen;
const char *delimiters;
ssize_t c;
ldns_rdf *owner_dname;
const char* endptr;
int was_unknown_rr_format = 0;
ldns_status status = LDNS_STATUS_OK;
/* used for types with unknown number of rdatas */
bool done;
bool quoted;
ldns_rdf *r = NULL;
uint16_t r_cnt;
uint16_t r_min;
uint16_t r_max;
size_t pre_data_pos;
uint16_t hex_data_size;
char *hex_data_str = NULL;
uint16_t cur_hex_data_size;
size_t hex_pos = 0;
uint8_t *hex_data = NULL;
new = ldns_rr_new();
owner = LDNS_XMALLOC(char, LDNS_MAX_DOMAINLEN + 1);
ttl = LDNS_XMALLOC(char, LDNS_TTL_DATALEN);
clas = LDNS_XMALLOC(char, LDNS_SYNTAX_DATALEN);
rdata = LDNS_XMALLOC(char, LDNS_MAX_PACKETLEN + 1);
rr_buf = LDNS_MALLOC(ldns_buffer);
rd_buf = LDNS_MALLOC(ldns_buffer);
rd = LDNS_XMALLOC(char, LDNS_MAX_RDFLEN);
xtok = LDNS_XMALLOC(char, LDNS_MAX_RDFLEN);
if (rr_buf) {
rr_buf->_data = NULL;
}
if (rd_buf) {
rd_buf->_data = NULL;
}
if (!new || !owner || !ttl || !clas || !rdata ||
!rr_buf || !rd_buf || !rd || !xtok) {
goto memerror;
}
ldns_buffer_new_frm_data(rr_buf, (char*)str, strlen(str));
/* split the rr in its parts -1 signals trouble */
if (ldns_bget_token(rr_buf, owner, "\t\n ", LDNS_MAX_DOMAINLEN) == -1){
status = LDNS_STATUS_SYNTAX_ERR;
goto error;
}
if (ldns_bget_token(rr_buf, ttl, "\t\n ", LDNS_TTL_DATALEN) == -1) {
status = LDNS_STATUS_SYNTAX_TTL_ERR;
goto error;
}
ttl_val = (uint32_t) ldns_str2period(ttl, &endptr);
if (strlen(ttl) > 0 && !isdigit((int) ttl[0])) {
/* ah, it's not there or something */
if (default_ttl == 0) {
ttl_val = LDNS_DEFAULT_TTL;
} else {
ttl_val = default_ttl;
}
if (explicit_ttl)
*explicit_ttl = false;
/* we not ASSUMING the TTL is missing and that
* the rest of the RR is still there. That is
* CLASS TYPE RDATA
* so ttl value we read is actually the class
*/
clas_val = ldns_get_rr_class_by_name(ttl);
/* class can be left out too, assume IN, current
* token must be type
*/
if (clas_val == 0) {
clas_val = LDNS_RR_CLASS_IN;
type_sz = strlen(ttl) + 1;
type = LDNS_XMALLOC(char, type_sz);
if (!type) {
goto memerror;
}
strlcpy(type, ttl, type_sz);
}
} else {
if (explicit_ttl)
*explicit_ttl = true;
if (-1 == ldns_bget_token(
rr_buf, clas, "\t\n ", LDNS_SYNTAX_DATALEN)) {
status = LDNS_STATUS_SYNTAX_CLASS_ERR;
goto error;
}
clas_val = ldns_get_rr_class_by_name(clas);
/* class can be left out too, assume IN, current
* token must be type
*/
if (clas_val == 0) {
clas_val = LDNS_RR_CLASS_IN;
type_sz = strlen(clas) + 1;
type = LDNS_XMALLOC(char, type_sz);
if (!type) {
goto memerror;
}
strlcpy(type, clas, type_sz);
}
}
/* the rest should still be waiting for us */
if (!type) {
type = LDNS_XMALLOC(char, LDNS_SYNTAX_DATALEN);
if (!type) {
goto memerror;
}
if (-1 == ldns_bget_token(
rr_buf, type, "\t\n ", LDNS_SYNTAX_DATALEN)) {
status = LDNS_STATUS_SYNTAX_TYPE_ERR;
goto error;
}
}
if (ldns_bget_token(rr_buf, rdata, "\0", LDNS_MAX_PACKETLEN) == -1) {
/* apparently we are done, and it's only a question RR
* so do not set status and go to ldnserror here
*/
}
ldns_buffer_new_frm_data(rd_buf, rdata, strlen(rdata));
if (strncmp(owner, "@", 1) == 0) {
if (origin) {
ldns_rr_set_owner(new, ldns_rdf_clone(origin));
} else if (prev && *prev) {
ldns_rr_set_owner(new, ldns_rdf_clone(*prev));
} else {
/* default to root */
ldns_rr_set_owner(new, ldns_dname_new_frm_str("."));
}
/* @ also overrides prev */
if (prev) {
ldns_rdf_deep_free(*prev);
*prev = ldns_rdf_clone(ldns_rr_owner(new));
if (!*prev) {
goto memerror;
}
}
} else {
if (strlen(owner) == 0) {
/* no ownername was given, try prev, if that fails
* origin, else default to root */
if (prev && *prev) {
ldns_rr_set_owner(new, ldns_rdf_clone(*prev));
} else if (origin) {
ldns_rr_set_owner(new, ldns_rdf_clone(origin));
} else {
ldns_rr_set_owner(new,
ldns_dname_new_frm_str("."));
}
if(!ldns_rr_owner(new)) {
goto memerror;
}
} else {
owner_dname = ldns_dname_new_frm_str(owner);
if (!owner_dname) {
status = LDNS_STATUS_SYNTAX_ERR;
goto error;
}
ldns_rr_set_owner(new, owner_dname);
if (!ldns_dname_str_absolute(owner) && origin) {
if(ldns_dname_cat(ldns_rr_owner(new), origin)
!= LDNS_STATUS_OK) {
status = LDNS_STATUS_SYNTAX_ERR;
goto error;
}
}
if (prev) {
ldns_rdf_deep_free(*prev);
*prev = ldns_rdf_clone(ldns_rr_owner(new));
if (!*prev) {
goto error;
}
}
}
}
LDNS_FREE(owner);
ldns_rr_set_question(new, question);
ldns_rr_set_ttl(new, ttl_val);
LDNS_FREE(ttl);
ldns_rr_set_class(new, clas_val);
LDNS_FREE(clas);
rr_type = ldns_get_rr_type_by_name(type);
LDNS_FREE(type);
desc = ldns_rr_descript((uint16_t)rr_type);
ldns_rr_set_type(new, rr_type);
if (desc) {
/* only the rdata remains */
r_max = ldns_rr_descriptor_maximum(desc);
r_min = ldns_rr_descriptor_minimum(desc);
} else {
r_min = 0;
r_max = 1;
}
for (done = false, r_cnt = 0; !done && r_cnt < r_max; r_cnt++) {
quoted = false;
switch (ldns_rr_descriptor_field_type(desc, r_cnt)) {
case LDNS_RDF_TYPE_B64 :
case LDNS_RDF_TYPE_HEX : /* These rdf types may con- */
case LDNS_RDF_TYPE_NSEC : /* tain whitespace, only if */
case LDNS_RDF_TYPE_LOC : /* it is the last rd field. */
case LDNS_RDF_TYPE_WKS :
case LDNS_RDF_TYPE_IPSECKEY :
case LDNS_RDF_TYPE_AMTRELAY :
case LDNS_RDF_TYPE_SVCPARAMS : if (r_cnt == r_max - 1) {
delimiters = "\n";
break;
}
/* fallthrough */
default : delimiters = "\n\t ";
}
if (ldns_rdf_type_maybe_quoted(
ldns_rr_descriptor_field_type(
desc, r_cnt)) &&
ldns_buffer_remaining(rd_buf) > 0){
/* skip whitespace */
while (ldns_buffer_remaining(rd_buf) > 0 &&
_BUFFER_IS_AT_WHITESPACE(rd_buf)) {
ldns_buffer_skip(rd_buf, 1);
}
if (ldns_buffer_remaining(rd_buf) > 0 &&
*(ldns_buffer_current(rd_buf)) == '\"') {
delimiters = "\"\0";
ldns_buffer_skip(rd_buf, 1);
quoted = true;
}
}
/* because number of fields can be variable, we can't rely on
* _maximum() only
*/
/* skip whitespace */
while (ldns_buffer_position(rd_buf) < ldns_buffer_limit(rd_buf)
&& _BUFFER_IS_AT_WHITESPACE(rd_buf)
&& !quoted) {
ldns_buffer_skip(rd_buf, 1);
}
pre_data_pos = ldns_buffer_position(rd_buf);
if (-1 == ldns_bget_token(
rd_buf, rd, delimiters, LDNS_MAX_RDFLEN)) {
done = true;
(void)done; /* we're breaking, so done not read anymore */
break;
}
/* hmmz, rfc3597 specifies that any type can be represented
* with \# method, which can contain spaces...
* it does specify size though...
*/
rd_strlen = strlen(rd);
/* unknown RR data */
if (strncmp(rd, "\\#", 2) == 0 && !quoted &&
(rd_strlen == 2 || _IS_WHITESPACE(rd[2]))) {
was_unknown_rr_format = 1;
/* go back to before \#
* and skip it while setting delimiters better
*/
ldns_buffer_set_position(rd_buf, pre_data_pos);
delimiters = "\n\t ";
(void)ldns_bget_token(rd_buf, rd,
delimiters, LDNS_MAX_RDFLEN);
/* read rdata octet length */
c = ldns_bget_token(rd_buf, rd,
delimiters, LDNS_MAX_RDFLEN);
if (c == -1) {
/* something goes very wrong here */
status = LDNS_STATUS_SYNTAX_RDATA_ERR;
goto error;
}
hex_data_size = (uint16_t) atoi(rd);
/* copy hex chars into hex str (2 chars per byte) */
hex_data_str = LDNS_XMALLOC(char, 2*hex_data_size + 1);
if (!hex_data_str) {
/* malloc error */
goto memerror;
}
cur_hex_data_size = 0;
while(cur_hex_data_size < 2 * hex_data_size) {
c = ldns_bget_token(rd_buf, rd,
delimiters, LDNS_MAX_RDFLEN);
if (c == -1) {
status = LDNS_STATUS_SYNTAX_RDATA_ERR;
goto error;
}
rd_strlen = strlen(rd);
if ((size_t)cur_hex_data_size + rd_strlen >
2 * (size_t)hex_data_size) {
status = LDNS_STATUS_SYNTAX_RDATA_ERR;
goto error;
}
strlcpy(hex_data_str + cur_hex_data_size, rd,
rd_strlen + 1);
cur_hex_data_size += rd_strlen;
}
hex_data_str[cur_hex_data_size] = '\0';
/* correct the rdf type */
/* if *we* know the type, interpret it as wireformat */
if (desc) {
hex_pos = 0;
hex_data =
LDNS_XMALLOC(uint8_t, hex_data_size+2);
if (!hex_data) {
goto memerror;
}
ldns_write_uint16(hex_data, hex_data_size);
ldns_hexstring_to_data(
hex_data + 2, hex_data_str);
status = ldns_wire2rdf(new, hex_data,
hex_data_size + 2, &hex_pos);
if (status != LDNS_STATUS_OK) {
goto error;
}
LDNS_FREE(hex_data);
} else {
r = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_HEX,
hex_data_str);
if (!r) {
goto memerror;
}
ldns_rdf_set_type(r, LDNS_RDF_TYPE_UNKNOWN);
if (!ldns_rr_push_rdf(new, r)) {
goto memerror;
}
}
LDNS_FREE(hex_data_str);
} else if(rd_strlen > 0 || quoted) {
/* Normal RR */
switch(ldns_rr_descriptor_field_type(desc, r_cnt)) {
case LDNS_RDF_TYPE_HEX:
case LDNS_RDF_TYPE_B64:
/* When this is the last rdata field, then the
* rest should be read in (cause then these
* rdf types may contain spaces).
*/
if (r_cnt == r_max - 1) {
c = ldns_bget_token(rd_buf, xtok,
"\n", LDNS_MAX_RDFLEN);
if (c != -1) {
(void) strncat(rd, xtok,
LDNS_MAX_RDFLEN -
strlen(rd) - 1);
}
}
r = ldns_rdf_new_frm_str(
ldns_rr_descriptor_field_type(
desc, r_cnt), rd);
break;
case LDNS_RDF_TYPE_HIP:
/*
* In presentation format this RDATA type has
* three tokens: An algorithm byte, then a
* variable length HIT (in hexbytes) and then
* a variable length Public Key (in base64).
*
* We have just read the algorithm, so we need
* two more tokens: HIT and Public Key.
*/
do {
/* Read and append HIT */
if (ldns_bget_token(rd_buf,
xtok, delimiters,
LDNS_MAX_RDFLEN) == -1)
break;
(void) strncat(rd, " ",
LDNS_MAX_RDFLEN -
strlen(rd) - 1);
(void) strncat(rd, xtok,
LDNS_MAX_RDFLEN -
strlen(rd) - 1);
/* Read and append Public Key*/
if (ldns_bget_token(rd_buf,
xtok, delimiters,
LDNS_MAX_RDFLEN) == -1)
break;
(void) strncat(rd, " ",
LDNS_MAX_RDFLEN -
strlen(rd) - 1);
(void) strncat(rd, xtok,
LDNS_MAX_RDFLEN -
strlen(rd) - 1);
} while (false);
r = ldns_rdf_new_frm_str(
ldns_rr_descriptor_field_type(
desc, r_cnt), rd);
break;
case LDNS_RDF_TYPE_DNAME:
r = ldns_rdf_new_frm_str(
ldns_rr_descriptor_field_type(
desc, r_cnt), rd);
/* check if the origin should be used
* or concatenated
*/
if (r && ldns_rdf_size(r) > 1 &&
ldns_rdf_data(r)[0] == 1 &&
ldns_rdf_data(r)[1] == '@') {
ldns_rdf_deep_free(r);
r = origin ? ldns_rdf_clone(origin)
: ( rr_type == LDNS_RR_TYPE_SOA ?
ldns_rdf_clone(
ldns_rr_owner(new))
: ldns_rdf_new_frm_str(
LDNS_RDF_TYPE_DNAME, ".")
);
} else if (r && rd_strlen >= 1
&& (origin || rr_type == LDNS_RR_TYPE_SOA)
&& !ldns_dname_str_absolute(rd)) {
status = ldns_dname_cat(r, origin
? origin : ldns_rr_owner(new));
if (status != LDNS_STATUS_OK) {
goto error;
}
}
break;
default:
r = ldns_rdf_new_frm_str(
ldns_rr_descriptor_field_type(
desc, r_cnt), rd);
break;
}
if (!r) {
status = LDNS_STATUS_SYNTAX_RDATA_ERR;
goto error;
}
ldns_rr_push_rdf(new, r);
}
} /* for (done = false, r_cnt = 0; !done && r_cnt < r_max; r_cnt++) */
LDNS_FREE(rd);
LDNS_FREE(xtok);
ldns_buffer_free(rr_buf);
LDNS_FREE(rdata);
if (ldns_buffer_remaining(rd_buf) > 0) {
ldns_buffer_free(rd_buf);
ldns_rr_free(new);
return LDNS_STATUS_SYNTAX_SUPERFLUOUS_TEXT_ERR;
}
ldns_buffer_free(rd_buf);
if (!question && desc && !was_unknown_rr_format &&
ldns_rr_rd_count(new) < r_min) {
ldns_rr_free(new);
return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR;
}
if (newrr) {
*newrr = new;
} else {
/* Maybe the caller just wanted to see if it would parse? */
ldns_rr_free(new);
}
return LDNS_STATUS_OK;
memerror:
status = LDNS_STATUS_MEM_ERR;
error:
if (rd_buf && rd_buf->_data) {
ldns_buffer_free(rd_buf);
} else {
LDNS_FREE(rd_buf);
}
if (rr_buf && rr_buf->_data) {
ldns_buffer_free(rr_buf);
} else {
LDNS_FREE(rr_buf);
}
LDNS_FREE(type);
LDNS_FREE(owner);
LDNS_FREE(ttl);
LDNS_FREE(clas);
LDNS_FREE(hex_data);
LDNS_FREE(hex_data_str);
LDNS_FREE(xtok);
LDNS_FREE(rd);
LDNS_FREE(rdata);
ldns_rr_free(new);
return status;
}
ldns_status
ldns_rr_new_frm_str(ldns_rr **newrr, const char *str,
uint32_t default_ttl, const ldns_rdf *origin,
ldns_rdf **prev)
{
return ldns_rr_new_frm_str_internal(newrr,
str,
default_ttl,
origin,
prev,
false,
NULL);
}
ldns_status
ldns_rr_new_question_frm_str(ldns_rr **newrr, const char *str,
const ldns_rdf *origin, ldns_rdf **prev)
{
return ldns_rr_new_frm_str_internal(newrr,
str,
0,
origin,
prev,
true,
NULL);
}
/* Strip whitespace from the start and the end of <line>. */
static char *
ldns_strip_ws(char *line)
{
char *s = line, *e;
for (s = line; *s && isspace((unsigned char)*s); s++)
;
for (e = strchr(s, 0); e > s+2 && isspace((unsigned char)e[-1]) && e[-2] != '\\'; e--)
;
*e = 0;
return s;
}
ldns_status
ldns_rr_new_frm_fp(ldns_rr **newrr, FILE *fp, uint32_t *ttl, ldns_rdf **origin, ldns_rdf **prev)
{
return ldns_rr_new_frm_fp_l(newrr, fp, ttl, origin, prev, NULL);
}
ldns_status
_ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp,
uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev,
int *line_nr, bool *explicit_ttl);
ldns_status
_ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp,
uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev,
int *line_nr, bool *explicit_ttl)
{
char *line = NULL;
size_t limit = 0;
const char *endptr; /* unused */
ldns_rr *rr;
uint32_t ttl;
ldns_rdf *tmp;
ldns_status s;
if (default_ttl) {
ttl = *default_ttl;
} else {
ttl = 0;
}
/* read an entire line in from the file */
if ((s = ldns_fget_token_l_st( fp, &line, &limit, false
, LDNS_PARSE_SKIP_SPACE, line_nr))) {
LDNS_FREE(line);
return s;
}
if (strncmp(line, "$ORIGIN", 7) == 0 && isspace((unsigned char)line[7])) {
if (*origin) {
ldns_rdf_deep_free(*origin);
*origin = NULL;
}
tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME,
ldns_strip_ws(line + 8));
if (!tmp) {
/* could not parse what next to $ORIGIN */
LDNS_FREE(line);
return LDNS_STATUS_SYNTAX_DNAME_ERR;
}
*origin = tmp;
s = LDNS_STATUS_SYNTAX_ORIGIN;
} else if (strncmp(line, "$TTL", 4) == 0 && isspace((unsigned char)line[4])) {
if (default_ttl) {
*default_ttl = ldns_str2period(
ldns_strip_ws(line + 5), &endptr);
}
s = LDNS_STATUS_SYNTAX_TTL;
} else if (strncmp(line, "$INCLUDE", 8) == 0) {
s = LDNS_STATUS_SYNTAX_INCLUDE;
} else if (!*ldns_strip_ws(line)) {
LDNS_FREE(line);
return LDNS_STATUS_SYNTAX_EMPTY;
} else {
if (origin && *origin) {
s = ldns_rr_new_frm_str_internal(&rr, (const char*)line,
ttl, *origin, prev, false, explicit_ttl);
} else {
s = ldns_rr_new_frm_str_internal(&rr, (const char*)line,
ttl, NULL, prev, false, explicit_ttl);
}
}
LDNS_FREE(line);
if (s == LDNS_STATUS_OK) {
if (newrr) {
*newrr = rr;
} else {
/* Just testing if it would parse? */
ldns_rr_free(rr);
}
}
return s;
}
ldns_status
ldns_rr_new_frm_fp_l(ldns_rr **newrr, FILE *fp, uint32_t *default_ttl,
ldns_rdf **origin, ldns_rdf **prev, int *line_nr)
{
return _ldns_rr_new_frm_fp_l_internal(newrr, fp, default_ttl, origin,
prev, line_nr, NULL);
}
void
ldns_rr_set_owner(ldns_rr *rr, ldns_rdf *owner)
{
rr->_owner = owner;
}
void
ldns_rr_set_question(ldns_rr *rr, bool question)
{
rr->_rr_question = question;
}
void
ldns_rr_set_ttl(ldns_rr *rr, uint32_t ttl)
{
rr->_ttl = ttl;
}
void
ldns_rr_set_rd_count(ldns_rr *rr, size_t count)
{
rr->_rd_count = count;
}
void
ldns_rr_set_type(ldns_rr *rr, ldns_rr_type rr_type)
{
rr->_rr_type = rr_type;
}
void
ldns_rr_set_class(ldns_rr *rr, ldns_rr_class rr_class)
{
rr->_rr_class = rr_class;
}
ldns_rdf *
ldns_rr_set_rdf(ldns_rr *rr, const ldns_rdf *f, size_t position)
{
size_t rd_count;
ldns_rdf *pop;
rd_count = ldns_rr_rd_count(rr);
if (position < rd_count) {
/* discard the old one */
pop = rr->_rdata_fields[position];
rr->_rdata_fields[position] = (ldns_rdf*)f;
return pop;
} else {
return NULL;
}
}
bool
ldns_rr_push_rdf(ldns_rr *rr, const ldns_rdf *f)
{
size_t rd_count;
ldns_rdf **rdata_fields;
rd_count = ldns_rr_rd_count(rr);
/* grow the array */
rdata_fields = LDNS_XREALLOC(
rr->_rdata_fields, ldns_rdf *, rd_count + 1);
if (!rdata_fields) {
return false;
}
/* add the new member */
rr->_rdata_fields = rdata_fields;
rr->_rdata_fields[rd_count] = (ldns_rdf*)f;
ldns_rr_set_rd_count(rr, rd_count + 1);
return true;
}
ldns_rdf *
ldns_rr_pop_rdf(ldns_rr *rr)
{
size_t rd_count;
ldns_rdf *pop;
ldns_rdf** newrd;
rd_count = ldns_rr_rd_count(rr);
if (rd_count == 0) {
return NULL;
}
pop = rr->_rdata_fields[rd_count - 1];
/* try to shrink the array */
if(rd_count > 1) {
newrd = LDNS_XREALLOC(
rr->_rdata_fields, ldns_rdf *, rd_count - 1);
if(newrd)
rr->_rdata_fields = newrd;
} else {
LDNS_FREE(rr->_rdata_fields);
}
ldns_rr_set_rd_count(rr, rd_count - 1);
return pop;
}
ldns_rdf *
ldns_rr_rdf(const ldns_rr *rr, size_t nr)
{
if (rr && nr < ldns_rr_rd_count(rr)) {
return rr->_rdata_fields[nr];
} else {
return NULL;
}
}
ldns_rdf *
ldns_rr_owner(const ldns_rr *rr)
{
return rr->_owner;
}
bool
ldns_rr_is_question(const ldns_rr *rr)
{
return rr->_rr_question;
}
uint32_t
ldns_rr_ttl(const ldns_rr *rr)
{
return rr->_ttl;
}
size_t
ldns_rr_rd_count(const ldns_rr *rr)
{
return rr->_rd_count;
}
ldns_rr_type
ldns_rr_get_type(const ldns_rr *rr)
{
return rr->_rr_type;
}
ldns_rr_class
ldns_rr_get_class(const ldns_rr *rr)
{
return rr->_rr_class;
}
/* rr_lists */
size_t
ldns_rr_list_rr_count(const ldns_rr_list *rr_list)
{
if (rr_list) {
return rr_list->_rr_count;
} else {
return 0;
}
}
ldns_rr *
ldns_rr_list_set_rr(ldns_rr_list *rr_list, const ldns_rr *r, size_t count)
{
ldns_rr *old;
if (count > ldns_rr_list_rr_count(rr_list)) {
return NULL;
}
old = ldns_rr_list_rr(rr_list, count);
/* overwrite old's pointer */
rr_list->_rrs[count] = (ldns_rr*)r;
return old;
}
void
ldns_rr_list_set_rr_count(ldns_rr_list *rr_list, size_t count)
{
assert(count <= rr_list->_rr_capacity);
rr_list->_rr_count = count;
}
ldns_rr *
ldns_rr_list_rr(const ldns_rr_list *rr_list, size_t nr)
{
if (nr < ldns_rr_list_rr_count(rr_list)) {
return rr_list->_rrs[nr];
} else {
return NULL;
}
}
ldns_rr_list *
ldns_rr_list_new(void)
{
ldns_rr_list *rr_list = LDNS_MALLOC(ldns_rr_list);
if(!rr_list) return NULL;
rr_list->_rr_count = 0;
rr_list->_rr_capacity = 0;
rr_list->_rrs = NULL;
return rr_list;
}
void
ldns_rr_list_free(ldns_rr_list *rr_list)
{
if (rr_list) {
LDNS_FREE(rr_list->_rrs);
LDNS_FREE(rr_list);
}
}
void
ldns_rr_list_deep_free(ldns_rr_list *rr_list)
{
size_t i;
if (rr_list) {
for (i=0; i < ldns_rr_list_rr_count(rr_list); i++) {
ldns_rr_free(ldns_rr_list_rr(rr_list, i));
}
LDNS_FREE(rr_list->_rrs);
LDNS_FREE(rr_list);
}
}
/* add right to left. So we modify *left! */
bool
ldns_rr_list_cat(ldns_rr_list *left, const ldns_rr_list *right)
{
size_t r_rr_count;
size_t i;
if (!left) {
return false;
}
if (right) {
r_rr_count = ldns_rr_list_rr_count(right);
} else {
r_rr_count = 0;
}
/* push right to left */
for(i = 0; i < r_rr_count; i++) {
ldns_rr_list_push_rr(left, ldns_rr_list_rr(right, i));
}
return true;
}
ldns_rr_list *
ldns_rr_list_cat_clone(const ldns_rr_list *left, const ldns_rr_list *right)
{
size_t l_rr_count;
size_t r_rr_count;
size_t i;
ldns_rr_list *cat;
if (left) {
l_rr_count = ldns_rr_list_rr_count(left);
} else {
return ldns_rr_list_clone(right);
}
if (right) {
r_rr_count = ldns_rr_list_rr_count(right);
} else {
r_rr_count = 0;
}
cat = ldns_rr_list_new();
if (!cat) {
return NULL;
}
/* left */
for(i = 0; i < l_rr_count; i++) {
ldns_rr_list_push_rr(cat,
ldns_rr_clone(ldns_rr_list_rr(left, i)));
}
/* right */
for(i = 0; i < r_rr_count; i++) {
ldns_rr_list_push_rr(cat,
ldns_rr_clone(ldns_rr_list_rr(right, i)));
}
return cat;
}
ldns_rr_list *
ldns_rr_list_subtype_by_rdf(const ldns_rr_list *l, const ldns_rdf *r, size_t pos)
{
size_t i;
ldns_rr_list *subtyped;
ldns_rdf *list_rdf;
subtyped = ldns_rr_list_new();
for(i = 0; i < ldns_rr_list_rr_count(l); i++) {
list_rdf = ldns_rr_rdf(
ldns_rr_list_rr(l, i),
pos);
if (!list_rdf) {
/* pos is too large or any other error */
ldns_rr_list_deep_free(subtyped);
return NULL;
}
if (ldns_rdf_compare(list_rdf, r) == 0) {
/* a match */
ldns_rr_list_push_rr(subtyped,
ldns_rr_clone(ldns_rr_list_rr(l, i)));
}
}
if (ldns_rr_list_rr_count(subtyped) > 0) {
return subtyped;
} else {
ldns_rr_list_free(subtyped);
return NULL;
}
}
bool
ldns_rr_list_push_rr(ldns_rr_list *rr_list, const ldns_rr *rr)
{
size_t rr_count;
size_t cap;
rr_count = ldns_rr_list_rr_count(rr_list);
cap = rr_list->_rr_capacity;
/* grow the array */
if(rr_count+1 > cap) {
ldns_rr **rrs;
if(cap == 0)
cap = LDNS_RRLIST_INIT; /* initial list size */
else cap *= 2;
rrs = LDNS_XREALLOC(rr_list->_rrs, ldns_rr *, cap);
if (!rrs) {
return false;
}
rr_list->_rrs = rrs;
rr_list->_rr_capacity = cap;
}
/* add the new member */
rr_list->_rrs[rr_count] = (ldns_rr*)rr;
ldns_rr_list_set_rr_count(rr_list, rr_count + 1);
return true;
}
bool
ldns_rr_list_push_rr_list(ldns_rr_list *rr_list, const ldns_rr_list *push_list)
{
size_t i;
for(i = 0; i < ldns_rr_list_rr_count(push_list); i++) {
if (!ldns_rr_list_push_rr(rr_list,
ldns_rr_list_rr(push_list, i))) {
return false;
}
}
return true;
}
ldns_rr *
ldns_rr_list_pop_rr(ldns_rr_list *rr_list)
{
size_t rr_count;
size_t cap;
ldns_rr *pop;
rr_count = ldns_rr_list_rr_count(rr_list);
if (rr_count == 0) {
return NULL;
}
cap = rr_list->_rr_capacity;
pop = ldns_rr_list_rr(rr_list, rr_count - 1);
/* shrink the array */
if(cap > LDNS_RRLIST_INIT && rr_count-1 <= cap/2) {
ldns_rr** a;
cap /= 2;
a = LDNS_XREALLOC(rr_list->_rrs, ldns_rr *, cap);
if(a) {
rr_list->_rrs = a;
rr_list->_rr_capacity = cap;
}
/* if the realloc fails, the capacity for the list remains unchanged */
}
ldns_rr_list_set_rr_count(rr_list, rr_count - 1);
return pop;
}
ldns_rr_list *
ldns_rr_list_pop_rr_list(ldns_rr_list *rr_list, size_t howmany)
{
/* pop a number of rr's and put them in a rr_list */
ldns_rr_list *popped;
ldns_rr *p;
size_t i = howmany;
popped = ldns_rr_list_new();
if (!popped) {
return NULL;
}
while(i > 0 &&
(p = ldns_rr_list_pop_rr(rr_list)) != NULL) {
ldns_rr_list_push_rr(popped, p);
i--;
}
if (i == howmany) { /* so i <= 0 */
ldns_rr_list_free(popped);
return NULL;
} else {
return popped;
}
}
bool
ldns_rr_list_contains_rr(const ldns_rr_list *rr_list, const ldns_rr *rr)
{
size_t i;
if (!rr_list || !rr || ldns_rr_list_rr_count(rr_list) == 0) {
return false;
}
for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) {
if (rr == ldns_rr_list_rr(rr_list, i)) {
return true;
} else if (ldns_rr_compare(rr, ldns_rr_list_rr(rr_list, i)) == 0) {
return true;
}
}
return false;
}
bool
ldns_is_rrset(const ldns_rr_list *rr_list)
{
ldns_rr_type t;
ldns_rr_class c;
ldns_rdf *o;
ldns_rr *tmp;
size_t i;
if (!rr_list || ldns_rr_list_rr_count(rr_list) == 0) {
return false;
}
tmp = ldns_rr_list_rr(rr_list, 0);
t = ldns_rr_get_type(tmp);
c = ldns_rr_get_class(tmp);
o = ldns_rr_owner(tmp);
/* compare these with the rest of the rr_list, start with 1 */
for (i = 1; i < ldns_rr_list_rr_count(rr_list); i++) {
tmp = ldns_rr_list_rr(rr_list, i);
if (t != ldns_rr_get_type(tmp)) {
return false;
}
if (c != ldns_rr_get_class(tmp)) {
return false;
}
if (ldns_dname_compare(o, ldns_rr_owner(tmp)) != 0) {
return false;
}
}
return true;
}
bool
ldns_is_rrset_strict(const ldns_rr_list *rr_list)
{
ldns_rr_type t;
ldns_rr_class c;
uint32_t l;
ldns_rdf *o;
ldns_rr *tmp;
size_t i;
if (!rr_list || ldns_rr_list_rr_count(rr_list) == 0) {
return false;
}
tmp = ldns_rr_list_rr(rr_list, 0);
t = ldns_rr_get_type(tmp);
c = ldns_rr_get_class(tmp);
l = ldns_rr_ttl(tmp);
o = ldns_rr_owner(tmp);
/* compare these with the rest of the rr_list, start with 1 */
for (i = 1; i < ldns_rr_list_rr_count(rr_list); i++) {
tmp = ldns_rr_list_rr(rr_list, i);
if (t != ldns_rr_get_type(tmp)) {
return false;
}
if (c != ldns_rr_get_class(tmp)) {
return false;
}
if (l != ldns_rr_ttl(tmp)) {
return false;
}
if (ldns_dname_compare(o, ldns_rr_owner(tmp)) != 0) {
return false;
}
}
return true;
}
bool
ldns_rr_set_push_rr(ldns_rr_list *rr_list, ldns_rr *rr)
{
size_t rr_count;
size_t i;
ldns_rr *last;
assert(rr != NULL);
rr_count = ldns_rr_list_rr_count(rr_list);
if (rr_count == 0) {
/* nothing there, so checking it is
* not needed */
return ldns_rr_list_push_rr(rr_list, rr);
} else {
/* check with the final rr in the rr_list */
last = ldns_rr_list_rr(rr_list, rr_count - 1);
if (ldns_rr_get_class(last) != ldns_rr_get_class(rr)) {
return false;
}
if (ldns_rr_get_type(last) != ldns_rr_get_type(rr)) {
return false;
}
/* only check if not equal to RRSIG */
if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_RRSIG) {
if (ldns_rr_ttl(last) != ldns_rr_ttl(rr)) {
return false;
}
}
if (ldns_rdf_compare(ldns_rr_owner(last),
ldns_rr_owner(rr)) != 0) {
return false;
}
/* ok, still alive - check if the rr already
* exists - if so, don't add it */
for(i = 0; i < rr_count; i++) {
if(ldns_rr_compare(
ldns_rr_list_rr(rr_list, i), rr) == 0) {
return false;
}
}
/* it's safe, push it */
return ldns_rr_list_push_rr(rr_list, rr);
}
}
ldns_rr *
ldns_rr_set_pop_rr(ldns_rr_list *rr_list)
{
return ldns_rr_list_pop_rr(rr_list);
}
ldns_rr_list *
ldns_rr_list_pop_rrset(ldns_rr_list *rr_list)
{
ldns_rr_list *rrset;
ldns_rr *last_rr = NULL;
ldns_rr *next_rr;
if (!rr_list) {
return NULL;
}
rrset = ldns_rr_list_new();
if (!last_rr) {
last_rr = ldns_rr_list_pop_rr(rr_list);
if (!last_rr) {
ldns_rr_list_free(rrset);
return NULL;
} else {
ldns_rr_list_push_rr(rrset, last_rr);
}
}
if (ldns_rr_list_rr_count(rr_list) > 0) {
next_rr = ldns_rr_list_rr(rr_list, ldns_rr_list_rr_count(rr_list) - 1);
} else {
next_rr = NULL;
}
while (next_rr) {
if (
ldns_rdf_compare(ldns_rr_owner(next_rr),
ldns_rr_owner(last_rr)) == 0
&&
ldns_rr_get_type(next_rr) == ldns_rr_get_type(last_rr)
&&
ldns_rr_get_class(next_rr) == ldns_rr_get_class(last_rr)
) {
ldns_rr_list_push_rr(rrset, ldns_rr_list_pop_rr(rr_list));
if (ldns_rr_list_rr_count(rr_list) > 0) {
last_rr = next_rr;
next_rr = ldns_rr_list_rr(rr_list, ldns_rr_list_rr_count(rr_list) - 1);
} else {
next_rr = NULL;
}
} else {
next_rr = NULL;
}
}
return rrset;
}
ldns_rr *
ldns_rr_clone(const ldns_rr *rr)
{
size_t i;
ldns_rr *new_rr;
if (!rr) {
return NULL;
}
new_rr = ldns_rr_new();
if (!new_rr) {
return NULL;
}
if (ldns_rr_owner(rr)) {
ldns_rr_set_owner(new_rr, ldns_rdf_clone(ldns_rr_owner(rr)));
}
ldns_rr_set_ttl(new_rr, ldns_rr_ttl(rr));
ldns_rr_set_type(new_rr, ldns_rr_get_type(rr));
ldns_rr_set_class(new_rr, ldns_rr_get_class(rr));
ldns_rr_set_question(new_rr, ldns_rr_is_question(rr));
for (i = 0; i < ldns_rr_rd_count(rr); i++) {
if (ldns_rr_rdf(rr,i)) {
ldns_rr_push_rdf(new_rr, ldns_rdf_clone(ldns_rr_rdf(rr, i)));
}
}
return new_rr;
}
ldns_rr_list *
ldns_rr_list_clone(const ldns_rr_list *rrlist)
{
size_t i;
ldns_rr_list *new_list;
ldns_rr *r;
if (!rrlist) {
return NULL;
}
new_list = ldns_rr_list_new();
if (!new_list) {
return NULL;
}
for (i = 0; i < ldns_rr_list_rr_count(rrlist); i++) {
r = ldns_rr_clone(
ldns_rr_list_rr(rrlist, i)
);
if (!r) {
/* huh, failure in cloning */
ldns_rr_list_deep_free(new_list);
return NULL;
}
ldns_rr_list_push_rr(new_list, r);
}
return new_list;
}
static int
qsort_schwartz_rr_compare(const void *a, const void *b)
{
int result = 0;
ldns_rr *rr1, *rr2;
ldns_buffer *rr1_buf, *rr2_buf;
struct ldns_schwartzian_compare_struct *sa = *(struct ldns_schwartzian_compare_struct **) a;
struct ldns_schwartzian_compare_struct *sb = *(struct ldns_schwartzian_compare_struct **) b;
/* if we are doing 2wire, we need to do lowercasing on the dname (and maybe on the rdata)
* this must be done for comparison only, so we need to have a temp var for both buffers,
* which is only used when the transformed object value isn't there yet
*/
ldns_rr *canonical_a, *canonical_b;
rr1 = (ldns_rr *) sa->original_object;
rr2 = (ldns_rr *) sb->original_object;
result = ldns_rr_compare_no_rdata(rr1, rr2);
if (result == 0) {
if (!sa->transformed_object) {
canonical_a = ldns_rr_clone(sa->original_object);
ldns_rr2canonical(canonical_a);
sa->transformed_object = ldns_buffer_new(ldns_rr_uncompressed_size(canonical_a));
if (ldns_rr2buffer_wire(sa->transformed_object, canonical_a, LDNS_SECTION_ANY) != LDNS_STATUS_OK) {
ldns_buffer_free((ldns_buffer *)sa->transformed_object);
sa->transformed_object = NULL;
ldns_rr_free(canonical_a);
return 0;
}
ldns_rr_free(canonical_a);
}
if (!sb->transformed_object) {
canonical_b = ldns_rr_clone(sb->original_object);
ldns_rr2canonical(canonical_b);
sb->transformed_object = ldns_buffer_new(ldns_rr_uncompressed_size(canonical_b));
if (ldns_rr2buffer_wire(sb->transformed_object, canonical_b, LDNS_SECTION_ANY) != LDNS_STATUS_OK) {
ldns_buffer_free((ldns_buffer *)sa->transformed_object);
ldns_buffer_free((ldns_buffer *)sb->transformed_object);
sa->transformed_object = NULL;
sb->transformed_object = NULL;
ldns_rr_free(canonical_b);
return 0;
}
ldns_rr_free(canonical_b);
}
rr1_buf = (ldns_buffer *) sa->transformed_object;
rr2_buf = (ldns_buffer *) sb->transformed_object;
result = ldns_rr_compare_wire(rr1_buf, rr2_buf);
}
return result;
}
void
ldns_rr_list_sort(ldns_rr_list *unsorted)
{
struct ldns_schwartzian_compare_struct **sortables;
size_t item_count;
size_t i;
if (unsorted) {
item_count = ldns_rr_list_rr_count(unsorted);
sortables = LDNS_XMALLOC(struct ldns_schwartzian_compare_struct *,
item_count);
if(!sortables) return; /* no way to return error */
for (i = 0; i < item_count; i++) {
sortables[i] = LDNS_XMALLOC(struct ldns_schwartzian_compare_struct, 1);
if(!sortables[i]) {
/* free the allocated parts */
while(i>0) {
i--;
LDNS_FREE(sortables[i]);
}
/* no way to return error */
LDNS_FREE(sortables);
return;
}
sortables[i]->original_object = ldns_rr_list_rr(unsorted, i);
sortables[i]->transformed_object = NULL;
}
qsort(sortables,
item_count,
sizeof(struct ldns_schwartzian_compare_struct *),
qsort_schwartz_rr_compare);
for (i = 0; i < item_count; i++) {
unsorted->_rrs[i] = sortables[i]->original_object;
if (sortables[i]->transformed_object) {
ldns_buffer_free(sortables[i]->transformed_object);
}
LDNS_FREE(sortables[i]);
}
LDNS_FREE(sortables);
}
}
int
ldns_rr_compare_no_rdata(const ldns_rr *rr1, const ldns_rr *rr2)
{
size_t rr1_len;
size_t rr2_len;
size_t offset;
assert(rr1 != NULL);
assert(rr2 != NULL);
rr1_len = ldns_rr_uncompressed_size(rr1);
rr2_len = ldns_rr_uncompressed_size(rr2);
if (ldns_dname_compare(ldns_rr_owner(rr1), ldns_rr_owner(rr2)) < 0) {
return -1;
} else if (ldns_dname_compare(ldns_rr_owner(rr1), ldns_rr_owner(rr2)) > 0) {
return 1;
}
/* should return -1 if rr1 comes before rr2, so need to do rr1 - rr2, not rr2 - rr1 */
if (ldns_rr_get_class(rr1) != ldns_rr_get_class(rr2)) {
return ldns_rr_get_class(rr1) - ldns_rr_get_class(rr2);
}
/* should return -1 if rr1 comes before rr2, so need to do rr1 - rr2, not rr2 - rr1 */
if (ldns_rr_get_type(rr1) != ldns_rr_get_type(rr2)) {
return ldns_rr_get_type(rr1) - ldns_rr_get_type(rr2);
}
/* offset is the owername length + ttl + type + class + rdlen == start of wire format rdata */
offset = ldns_rdf_size(ldns_rr_owner(rr1)) + 4 + 2 + 2 + 2;
/* if either record doesn't have any RDATA... */
if (offset > rr1_len || offset > rr2_len) {
if (rr1_len == rr2_len) {
return 0;
}
return ((int) rr2_len - (int) rr1_len);
}
return 0;
}
int ldns_rr_compare_wire(const ldns_buffer *rr1_buf, const ldns_buffer *rr2_buf)
{
size_t rr1_len, rr2_len, min_len, i, offset;
rr1_len = ldns_buffer_capacity(rr1_buf);
rr2_len = ldns_buffer_capacity(rr2_buf);
/* jump past dname (checked in earlier part)
* and especially past TTL */
offset = 0;
while (offset < rr1_len && *ldns_buffer_at(rr1_buf, offset) != 0) {
offset += *ldns_buffer_at(rr1_buf, offset) + 1;
}
/* jump to rdata section (PAST the rdata length field, otherwise
rrs with different lengths might be sorted erroneously */
offset += 11;
min_len = (rr1_len < rr2_len) ? rr1_len : rr2_len;
/* Compare RRs RDATA byte for byte. */
for(i = offset; i < min_len; i++) {
if (*ldns_buffer_at(rr1_buf,i) < *ldns_buffer_at(rr2_buf,i)) {
return -1;
} else if (*ldns_buffer_at(rr1_buf,i) > *ldns_buffer_at(rr2_buf,i)) {
return +1;
}
}
/* If both RDATAs are the same up to min_len, then the shorter one sorts first. */
if (rr1_len < rr2_len) {
return -1;
} else if (rr1_len > rr2_len) {
return +1;
}
/* The RDATAs are equal. */
return 0;
}
int
ldns_rr_compare(const ldns_rr *rr1, const ldns_rr *rr2)
{
int result;
size_t rr1_len, rr2_len;
ldns_buffer *rr1_buf;
ldns_buffer *rr2_buf;
result = ldns_rr_compare_no_rdata(rr1, rr2);
if (result == 0) {
rr1_len = ldns_rr_uncompressed_size(rr1);
rr2_len = ldns_rr_uncompressed_size(rr2);
rr1_buf = ldns_buffer_new(rr1_len);
rr2_buf = ldns_buffer_new(rr2_len);
if (ldns_rr2buffer_wire_canonical(rr1_buf,
rr1,
LDNS_SECTION_ANY)
!= LDNS_STATUS_OK) {
ldns_buffer_free(rr1_buf);
ldns_buffer_free(rr2_buf);
return 0;
}
if (ldns_rr2buffer_wire_canonical(rr2_buf,
rr2,
LDNS_SECTION_ANY)
!= LDNS_STATUS_OK) {
ldns_buffer_free(rr1_buf);
ldns_buffer_free(rr2_buf);
return 0;
}
result = ldns_rr_compare_wire(rr1_buf, rr2_buf);
ldns_buffer_free(rr1_buf);
ldns_buffer_free(rr2_buf);
}
return result;
}
/* convert (c)dnskey to a (c)ds with the given algorithm,
* then compare the result with the given (c)ds */
static int
ldns_rr_compare_ds_dnskey(ldns_rr *ds,
ldns_rr *dnskey)
{
ldns_rr *ds_gen;
bool result = false;
ldns_hash algo;
if (!dnskey || !ds ||
(ldns_rr_get_type(ds) != LDNS_RR_TYPE_DS &&
ldns_rr_get_type(ds) != LDNS_RR_TYPE_CDS) ||
(ldns_rr_get_type(dnskey) != LDNS_RR_TYPE_DNSKEY &&
ldns_rr_get_type(dnskey) != LDNS_RR_TYPE_CDNSKEY)) {
return false;
}
if (ldns_rr_rdf(ds, 2) == NULL) {
return false;
}
algo = ldns_rdf2native_int8(ldns_rr_rdf(ds, 2));
ds_gen = ldns_key_rr2ds(dnskey, algo);
if (ds_gen) {
result = ldns_rr_compare(ds, ds_gen) == 0;
ldns_rr_free(ds_gen);
}
return result;
}
bool
ldns_rr_compare_ds(const ldns_rr *orr1, const ldns_rr *orr2)
{
bool result;
ldns_rr *rr1 = ldns_rr_clone(orr1);
ldns_rr *rr2 = ldns_rr_clone(orr2);
/* set ttls to zero */
ldns_rr_set_ttl(rr1, 0);
ldns_rr_set_ttl(rr2, 0);
if (ldns_rr_get_type(rr1) == LDNS_RR_TYPE_DS &&
ldns_rr_get_type(rr2) == LDNS_RR_TYPE_DNSKEY) {
result = ldns_rr_compare_ds_dnskey(rr1, rr2);
} else if (ldns_rr_get_type(rr1) == LDNS_RR_TYPE_DNSKEY &&
ldns_rr_get_type(rr2) == LDNS_RR_TYPE_DS) {
result = ldns_rr_compare_ds_dnskey(rr2, rr1);
} else if (ldns_rr_get_type(rr1) == LDNS_RR_TYPE_CDS &&
ldns_rr_get_type(rr2) == LDNS_RR_TYPE_CDNSKEY) {
result = ldns_rr_compare_ds_dnskey(rr1, rr2);
} else if (ldns_rr_get_type(rr1) == LDNS_RR_TYPE_CDNSKEY &&
ldns_rr_get_type(rr2) == LDNS_RR_TYPE_CDS) {
result = ldns_rr_compare_ds_dnskey(rr2, rr1);
} else {
result = (ldns_rr_compare(rr1, rr2) == 0);
}
ldns_rr_free(rr1);
ldns_rr_free(rr2);
return result;
}
int
ldns_rr_list_compare(const ldns_rr_list *rrl1, const ldns_rr_list *rrl2)
{
size_t i = 0;
int rr_cmp;
assert(rrl1 != NULL);
assert(rrl2 != NULL);
for (i = 0; i < ldns_rr_list_rr_count(rrl1) && i < ldns_rr_list_rr_count(rrl2); i++) {
rr_cmp = ldns_rr_compare(ldns_rr_list_rr(rrl1, i), ldns_rr_list_rr(rrl2, i));
if (rr_cmp != 0) {
return rr_cmp;
}
}
if (i == ldns_rr_list_rr_count(rrl1) &&
i != ldns_rr_list_rr_count(rrl2)) {
return 1;
} else if (i == ldns_rr_list_rr_count(rrl2) &&
i != ldns_rr_list_rr_count(rrl1)) {
return -1;
} else {
return 0;
}
}
size_t
ldns_rr_uncompressed_size(const ldns_rr *r)
{
size_t rrsize;
size_t i;
rrsize = 0;
/* add all the rdf sizes */
for(i = 0; i < ldns_rr_rd_count(r); i++) {
rrsize += ldns_rdf_size(ldns_rr_rdf(r, i));
}
/* ownername */
rrsize += ldns_rdf_size(ldns_rr_owner(r));
rrsize += LDNS_RR_OVERHEAD;
return rrsize;
}
void
ldns_rr2canonical(ldns_rr *rr)
{
uint16_t i;
if (!rr) {
return;
}
ldns_dname2canonical(ldns_rr_owner(rr));
/*
* lowercase the rdata dnames if the rr type is one
* of the list in chapter 7 of RFC3597
* Also added RRSIG, because a "Signer's Name" should be canonicalized
* too. See dnssec-bis-updates-16. We can add it to this list because
* the "Signer's Name" is the only dname type rdata field in a RRSIG.
*/
switch(ldns_rr_get_type(rr)) {
case LDNS_RR_TYPE_NS:
case LDNS_RR_TYPE_MD:
case LDNS_RR_TYPE_MF:
case LDNS_RR_TYPE_CNAME:
case LDNS_RR_TYPE_SOA:
case LDNS_RR_TYPE_MB:
case LDNS_RR_TYPE_MG:
case LDNS_RR_TYPE_MR:
case LDNS_RR_TYPE_PTR:
case LDNS_RR_TYPE_MINFO:
case LDNS_RR_TYPE_MX:
case LDNS_RR_TYPE_RP:
case LDNS_RR_TYPE_AFSDB:
case LDNS_RR_TYPE_RT:
case LDNS_RR_TYPE_SIG:
case LDNS_RR_TYPE_PX:
case LDNS_RR_TYPE_NXT:
case LDNS_RR_TYPE_NAPTR:
case LDNS_RR_TYPE_KX:
case LDNS_RR_TYPE_SRV:
case LDNS_RR_TYPE_DNAME:
case LDNS_RR_TYPE_A6:
case LDNS_RR_TYPE_RRSIG:
for (i = 0; i < ldns_rr_rd_count(rr); i++) {
ldns_dname2canonical(ldns_rr_rdf(rr, i));
}
return;
default:
/* do nothing */
return;
}
}
void
ldns_rr_list2canonical(const ldns_rr_list *rr_list)
{
size_t i;
for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) {
ldns_rr2canonical(ldns_rr_list_rr(rr_list, i));
}
}
uint8_t
ldns_rr_label_count(const ldns_rr *rr)
{
if (!rr) {
return 0;
}
return ldns_dname_label_count(
ldns_rr_owner(rr));
}
static const ldns_rdf_type type_0_wireformat[] = { LDNS_RDF_TYPE_UNKNOWN };
static const ldns_rdf_type type_a_wireformat[] = { LDNS_RDF_TYPE_A };
static const ldns_rdf_type type_ns_wireformat[] = { LDNS_RDF_TYPE_DNAME };
static const ldns_rdf_type type_md_wireformat[] = { LDNS_RDF_TYPE_DNAME };
static const ldns_rdf_type type_mf_wireformat[] = { LDNS_RDF_TYPE_DNAME };
static const ldns_rdf_type type_cname_wireformat[] = { LDNS_RDF_TYPE_DNAME };
static const ldns_rdf_type type_soa_wireformat[] = {
LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_INT32,
LDNS_RDF_TYPE_PERIOD, LDNS_RDF_TYPE_PERIOD, LDNS_RDF_TYPE_PERIOD,
LDNS_RDF_TYPE_PERIOD
};
static const ldns_rdf_type type_mb_wireformat[] = { LDNS_RDF_TYPE_DNAME };
static const ldns_rdf_type type_mg_wireformat[] = { LDNS_RDF_TYPE_DNAME };
static const ldns_rdf_type type_mr_wireformat[] = { LDNS_RDF_TYPE_DNAME };
static const ldns_rdf_type type_wks_wireformat[] = {
LDNS_RDF_TYPE_A, LDNS_RDF_TYPE_WKS
};
static const ldns_rdf_type type_ptr_wireformat[] = { LDNS_RDF_TYPE_DNAME };
static const ldns_rdf_type type_hinfo_wireformat[] = {
LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR
};
static const ldns_rdf_type type_minfo_wireformat[] = {
LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_mx_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_rp_wireformat[] = {
LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_afsdb_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_x25_wireformat[] = { LDNS_RDF_TYPE_STR };
static const ldns_rdf_type type_isdn_wireformat[] = {
LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR
};
static const ldns_rdf_type type_rt_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_nsap_wireformat[] = {
LDNS_RDF_TYPE_NSAP
};
static const ldns_rdf_type type_nsap_ptr_wireformat[] = {
LDNS_RDF_TYPE_UNQUOTED
};
static const ldns_rdf_type type_sig_wireformat[] = {
LDNS_RDF_TYPE_TYPE, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT32,
LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_B64
};
static const ldns_rdf_type type_key_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_B64
};
static const ldns_rdf_type type_px_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_gpos_wireformat[] = {
LDNS_RDF_TYPE_UNQUOTED, LDNS_RDF_TYPE_UNQUOTED, LDNS_RDF_TYPE_UNQUOTED
};
static const ldns_rdf_type type_aaaa_wireformat[] = { LDNS_RDF_TYPE_AAAA };
static const ldns_rdf_type type_loc_wireformat[] = { LDNS_RDF_TYPE_LOC };
static const ldns_rdf_type type_nxt_wireformat[] = {
LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_UNKNOWN
};
static const ldns_rdf_type type_eid_wireformat[] = {
LDNS_RDF_TYPE_HEX
};
static const ldns_rdf_type type_nimloc_wireformat[] = {
LDNS_RDF_TYPE_HEX
};
static const ldns_rdf_type type_srv_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_atma_wireformat[] = {
LDNS_RDF_TYPE_ATMA
};
static const ldns_rdf_type type_naptr_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_kx_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_cert_wireformat[] = {
LDNS_RDF_TYPE_CERT_ALG, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_B64
};
static const ldns_rdf_type type_a6_wireformat[] = { LDNS_RDF_TYPE_UNKNOWN };
static const ldns_rdf_type type_dname_wireformat[] = { LDNS_RDF_TYPE_DNAME };
static const ldns_rdf_type type_sink_wireformat[] = { LDNS_RDF_TYPE_INT8,
LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_B64
};
static const ldns_rdf_type type_apl_wireformat[] = {
LDNS_RDF_TYPE_APL
};
static const ldns_rdf_type type_ds_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_HEX
};
static const ldns_rdf_type type_sshfp_wireformat[] = {
LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_HEX
};
static const ldns_rdf_type type_ipseckey_wireformat[] = {
LDNS_RDF_TYPE_IPSECKEY
};
static const ldns_rdf_type type_rrsig_wireformat[] = {
LDNS_RDF_TYPE_TYPE, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT32,
LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_B64
};
static const ldns_rdf_type type_nsec_wireformat[] = {
LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_NSEC
};
static const ldns_rdf_type type_dhcid_wireformat[] = {
LDNS_RDF_TYPE_B64
};
static const ldns_rdf_type type_talink_wireformat[] = {
LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME
};
#ifdef RRTYPE_OPENPGPKEY
static const ldns_rdf_type type_openpgpkey_wireformat[] = {
LDNS_RDF_TYPE_B64
};
#endif
static const ldns_rdf_type type_csync_wireformat[] = {
LDNS_RDF_TYPE_INT32, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_NSEC
};
static const ldns_rdf_type type_zonemd_wireformat[] = {
LDNS_RDF_TYPE_INT32,
LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_HEX
};
#ifdef RRTYPE_SVCB_HTTPS
static const ldns_rdf_type type_svcb_wireformat[] = {
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_DNAME,
LDNS_RDF_TYPE_SVCPARAMS
};
#endif
#ifdef RRTYPE_DSYNC
static const ldns_rdf_type type_dsync_wireformat[] = {
LDNS_RDF_TYPE_TYPE,
LDNS_RDF_TYPE_INT8,
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_DNAME
};
#endif
#ifdef RRTYPE_HHIT_BRID
static const ldns_rdf_type type_hhit_wireformat[] = {
LDNS_RDF_TYPE_B64
};
static const ldns_rdf_type type_brid_wireformat[] = {
LDNS_RDF_TYPE_B64
};
#endif
/* nsec3 is some vars, followed by same type of data of nsec */
static const ldns_rdf_type type_nsec3_wireformat[] = {
/* LDNS_RDF_TYPE_NSEC3_VARS, LDNS_RDF_TYPE_NSEC3_NEXT_OWNER, LDNS_RDF_TYPE_NSEC*/
LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_NSEC3_SALT, LDNS_RDF_TYPE_NSEC3_NEXT_OWNER, LDNS_RDF_TYPE_NSEC
};
static const ldns_rdf_type type_nsec3param_wireformat[] = {
/* LDNS_RDF_TYPE_NSEC3_PARAMS_VARS*/
LDNS_RDF_TYPE_INT8,
LDNS_RDF_TYPE_INT8,
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_NSEC3_SALT
};
static const ldns_rdf_type type_dnskey_wireformat[] = {
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_INT8,
LDNS_RDF_TYPE_ALG,
LDNS_RDF_TYPE_B64
};
static const ldns_rdf_type type_tkey_wireformat[] = {
LDNS_RDF_TYPE_DNAME,
LDNS_RDF_TYPE_TIME,
LDNS_RDF_TYPE_TIME,
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_INT16_DATA,
LDNS_RDF_TYPE_INT16_DATA,
};
static const ldns_rdf_type type_tsig_wireformat[] = {
LDNS_RDF_TYPE_DNAME,
LDNS_RDF_TYPE_TSIGTIME,
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_INT16_DATA,
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_INT16_DATA
};
static const ldns_rdf_type type_tlsa_wireformat[] = {
LDNS_RDF_TYPE_CERTIFICATE_USAGE,
LDNS_RDF_TYPE_SELECTOR,
LDNS_RDF_TYPE_MATCHING_TYPE,
LDNS_RDF_TYPE_HEX
};
static const ldns_rdf_type type_hip_wireformat[] = {
LDNS_RDF_TYPE_HIP
};
static const ldns_rdf_type type_nid_wireformat[] = {
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_ILNP64
};
static const ldns_rdf_type type_l32_wireformat[] = {
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_A
};
static const ldns_rdf_type type_l64_wireformat[] = {
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_ILNP64
};
static const ldns_rdf_type type_lp_wireformat[] = {
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_eui48_wireformat[] = {
LDNS_RDF_TYPE_EUI48
};
static const ldns_rdf_type type_eui64_wireformat[] = {
LDNS_RDF_TYPE_EUI64
};
static const ldns_rdf_type type_uri_wireformat[] = {
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_INT16,
LDNS_RDF_TYPE_LONG_STR
};
static const ldns_rdf_type type_caa_wireformat[] = {
LDNS_RDF_TYPE_INT8,
LDNS_RDF_TYPE_TAG,
LDNS_RDF_TYPE_LONG_STR
};
#ifdef RRTYPE_DOA
static const ldns_rdf_type type_doa_wireformat[] = {
LDNS_RDF_TYPE_INT32,
LDNS_RDF_TYPE_INT32,
LDNS_RDF_TYPE_INT8,
LDNS_RDF_TYPE_STR,
LDNS_RDF_TYPE_B64
};
#endif
#ifdef RRTYPE_AMTRELAY
static const ldns_rdf_type type_amtrelay_wireformat[] = {
LDNS_RDF_TYPE_AMTRELAY
};
#endif
#ifdef RRTYPE_CLA_IPN
static const ldns_rdf_type type_ipn_wireformat[] = {
LDNS_RDF_TYPE_IPN
};
#endif
/* All RR's defined in 1035 are well known and can thus
* be compressed. See RFC3597. These RR's are:
* CNAME HINFO MB MD MF MG MINFO MR MX NULL NS PTR SOA TXT
*/
static ldns_rr_descriptor rdata_field_descriptors[] = {
/* 0 */
{ 0, NULL, 0, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 1 */
{LDNS_RR_TYPE_A, "A", 1, 1, type_a_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 2 */
{LDNS_RR_TYPE_NS, "NS", 1, 1, type_ns_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
/* 3 */
{LDNS_RR_TYPE_MD, "MD", 1, 1, type_md_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
/* 4 */
{LDNS_RR_TYPE_MF, "MF", 1, 1, type_mf_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
/* 5 */
{LDNS_RR_TYPE_CNAME, "CNAME", 1, 1, type_cname_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
/* 6 */
{LDNS_RR_TYPE_SOA, "SOA", 7, 7, type_soa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 2 },
/* 7 */
{LDNS_RR_TYPE_MB, "MB", 1, 1, type_mb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
/* 8 */
{LDNS_RR_TYPE_MG, "MG", 1, 1, type_mg_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
/* 9 */
{LDNS_RR_TYPE_MR, "MR", 1, 1, type_mr_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
/* 10 */
{LDNS_RR_TYPE_NULL, "NULL", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 11 */
{LDNS_RR_TYPE_WKS, "WKS", 2, 2, type_wks_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 12 */
{LDNS_RR_TYPE_PTR, "PTR", 1, 1, type_ptr_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
/* 13 */
{LDNS_RR_TYPE_HINFO, "HINFO", 2, 2, type_hinfo_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 14 */
{LDNS_RR_TYPE_MINFO, "MINFO", 2, 2, type_minfo_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 2 },
/* 15 */
{LDNS_RR_TYPE_MX, "MX", 2, 2, type_mx_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
/* 16 */
{LDNS_RR_TYPE_TXT, "TXT", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
/* 17 */
{LDNS_RR_TYPE_RP, "RP", 2, 2, type_rp_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 2 },
/* 18 */
{LDNS_RR_TYPE_AFSDB, "AFSDB", 2, 2, type_afsdb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 19 */
{LDNS_RR_TYPE_X25, "X25", 1, 1, type_x25_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 20 */
{LDNS_RR_TYPE_ISDN, "ISDN", 1, 2, type_isdn_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 21 */
{LDNS_RR_TYPE_RT, "RT", 2, 2, type_rt_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 22 */
{LDNS_RR_TYPE_NSAP, "NSAP", 1, 1, type_nsap_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 23 */
{LDNS_RR_TYPE_NSAP_PTR, "NSAP-PTR", 1, 1, type_nsap_ptr_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 24 */
{LDNS_RR_TYPE_SIG, "SIG", 9, 9, type_sig_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 25 */
{LDNS_RR_TYPE_KEY, "KEY", 4, 4, type_key_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 26 */
{LDNS_RR_TYPE_PX, "PX", 3, 3, type_px_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 2 },
/* 27 */
{LDNS_RR_TYPE_GPOS, "GPOS", 3, 3, type_gpos_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 28 */
{LDNS_RR_TYPE_AAAA, "AAAA", 1, 1, type_aaaa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 29 */
{LDNS_RR_TYPE_LOC, "LOC", 1, 1, type_loc_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 30 */
{LDNS_RR_TYPE_NXT, "NXT", 2, 2, type_nxt_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 31 */
{LDNS_RR_TYPE_EID, "EID", 1, 1, type_eid_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 32 */
{LDNS_RR_TYPE_NIMLOC, "NIMLOC", 1, 1, type_nimloc_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 33 */
{LDNS_RR_TYPE_SRV, "SRV", 4, 4, type_srv_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 34 */
{LDNS_RR_TYPE_ATMA, "ATMA", 1, 1, type_atma_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 35 */
{LDNS_RR_TYPE_NAPTR, "NAPTR", 6, 6, type_naptr_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 36 */
{LDNS_RR_TYPE_KX, "KX", 2, 2, type_kx_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 37 */
{LDNS_RR_TYPE_CERT, "CERT", 4, 4, type_cert_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 38 */
{LDNS_RR_TYPE_A6, "A6", 1, 1, type_a6_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 39 */
{LDNS_RR_TYPE_DNAME, "DNAME", 1, 1, type_dname_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 40 */
{LDNS_RR_TYPE_SINK, "SINK", 1, 1, type_sink_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 41 */
{LDNS_RR_TYPE_OPT, "OPT", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 42 */
{LDNS_RR_TYPE_APL, "APL", 0, 0, type_apl_wireformat, LDNS_RDF_TYPE_APL, LDNS_RR_NO_COMPRESS, 0 },
/* 43 */
{LDNS_RR_TYPE_DS, "DS", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 44 */
{LDNS_RR_TYPE_SSHFP, "SSHFP", 3, 3, type_sshfp_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 45 */
{LDNS_RR_TYPE_IPSECKEY, "IPSECKEY", 1, 1, type_ipseckey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 46 */
{LDNS_RR_TYPE_RRSIG, "RRSIG", 9, 9, type_rrsig_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 47 */
{LDNS_RR_TYPE_NSEC, "NSEC", 1, 2, type_nsec_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 48 */
{LDNS_RR_TYPE_DNSKEY, "DNSKEY", 4, 4, type_dnskey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 49 */
{LDNS_RR_TYPE_DHCID, "DHCID", 1, 1, type_dhcid_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 50 */
{LDNS_RR_TYPE_NSEC3, "NSEC3", 5, 6, type_nsec3_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 51 */
{LDNS_RR_TYPE_NSEC3PARAM, "NSEC3PARAM", 4, 4, type_nsec3param_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 52 */
{LDNS_RR_TYPE_TLSA, "TLSA", 4, 4, type_tlsa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_SMIMEA, "SMIMEA", 4, 4, type_tlsa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE54", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 55
* Hip ends with 0 or more Rendezvous Servers represented as dname's.
* Hence the LDNS_RDF_TYPE_DNAME _variable field and the _maximum field
* set to 0.
*/
{LDNS_RR_TYPE_HIP, "HIP", 1, 1, type_hip_wireformat, LDNS_RDF_TYPE_DNAME, LDNS_RR_NO_COMPRESS, 0 },
#ifdef RRTYPE_NINFO
/* 56 */
{LDNS_RR_TYPE_NINFO, "NINFO", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE56", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
#ifdef RRTYPE_RKEY
/* 57 */
{LDNS_RR_TYPE_RKEY, "RKEY", 4, 4, type_key_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE57", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
/* 58 */
{LDNS_RR_TYPE_TALINK, "TALINK", 2, 2, type_talink_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 2 },
/* 59 */
{LDNS_RR_TYPE_CDS, "CDS", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 60 */
{LDNS_RR_TYPE_CDNSKEY, "CDNSKEY", 4, 4, type_dnskey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#ifdef RRTYPE_OPENPGPKEY
/* 61 */
{LDNS_RR_TYPE_OPENPGPKEY, "OPENPGPKEY", 1, 1, type_openpgpkey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE61", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
/* 62 */
{LDNS_RR_TYPE_CSYNC, "CSYNC", 3, 3, type_csync_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 63 */
{LDNS_RR_TYPE_ZONEMD, "ZONEMD", 4, 4, type_zonemd_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#ifdef RRTYPE_SVCB_HTTPS
/* 64 */
{LDNS_RR_TYPE_SVCB, "SVCB", 2, 3, type_svcb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 65 */
{LDNS_RR_TYPE_HTTPS, "HTTPS", 2, 3, type_svcb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
#else
{LDNS_RR_TYPE_NULL, "TYPE64", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE65", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
#ifdef RRTYPE_DSYNC
/* 66 */
{LDNS_RR_TYPE_DSYNC, "DSYNC", 4, 4, type_dsync_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
#else
{LDNS_RR_TYPE_NULL, "TYPE66", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
#ifdef RRTYPE_HHIT_BRID
/* 67 */
{LDNS_RR_TYPE_HHIT, "HHIT", 1, 1, type_hhit_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 68 */
{LDNS_RR_TYPE_BRID, "BRID", 1, 1, type_brid_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE67", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE68", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
{LDNS_RR_TYPE_NULL, "TYPE69", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE70", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE71", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE72", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE73", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE74", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE75", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE76", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE77", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE78", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE79", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE80", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE81", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE82", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE83", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE84", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE85", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE86", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE87", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE88", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE89", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE90", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE91", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE92", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE93", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE94", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE95", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE96", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE97", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE98", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 99 */
{LDNS_RR_TYPE_SPF, "SPF", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
/* UINFO [IANA-Reserved] */
{LDNS_RR_TYPE_NULL, "TYPE100", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* UID [IANA-Reserved] */
{LDNS_RR_TYPE_NULL, "TYPE101", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* GID [IANA-Reserved] */
{LDNS_RR_TYPE_NULL, "TYPE102", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* UNSPEC [IANA-Reserved] */
{LDNS_RR_TYPE_NULL, "TYPE103", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 104 */
{LDNS_RR_TYPE_NID, "NID", 2, 2, type_nid_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 105 */
{LDNS_RR_TYPE_L32, "L32", 2, 2, type_l32_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 106 */
{LDNS_RR_TYPE_L64, "L64", 2, 2, type_l64_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 107 */
{LDNS_RR_TYPE_LP, "LP", 2, 2, type_lp_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 108 */
{LDNS_RR_TYPE_EUI48, "EUI48", 1, 1, type_eui48_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 109 */
{LDNS_RR_TYPE_EUI64, "EUI64", 1, 1, type_eui64_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE110", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE111", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE112", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE113", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE114", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE115", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE116", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE117", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE118", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE119", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE120", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE121", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE122", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE123", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE124", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE125", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE126", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE127", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NXNAME, "NXNAME", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE129", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE130", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE131", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE132", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE133", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE134", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE135", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE136", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE137", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE138", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE139", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE140", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE141", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE142", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE143", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE144", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE145", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE146", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE147", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE148", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE149", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE150", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE151", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE152", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE153", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE154", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE155", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE156", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE157", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE158", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE159", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE160", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE161", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE162", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE163", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE164", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE165", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE166", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE167", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE168", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE169", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE170", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE171", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE172", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE173", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE174", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE175", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE176", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE177", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE178", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE179", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE180", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE181", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE182", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE183", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE184", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE185", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE186", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE187", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE188", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE189", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE190", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE191", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE192", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE193", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE194", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE195", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE196", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE197", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE198", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE199", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE200", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE201", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE202", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE203", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE204", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE205", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE206", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE207", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE208", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE209", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE210", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE211", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE212", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE213", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE214", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE215", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE216", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE217", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE218", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE219", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE220", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE221", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE222", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE223", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE224", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE225", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE226", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE227", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE228", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE229", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE230", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE231", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE232", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE233", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE234", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE235", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE236", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE237", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE238", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE239", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE240", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE241", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE242", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE243", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE244", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE245", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE246", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE247", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE248", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* LDNS_RDF_TYPE_INT16_DATA takes two fields (length and data) as one.
* So, unlike RFC 2930 spec, we have 7 min/max rdf's i.s.o. 8/9.
*/
/* 249 */
{LDNS_RR_TYPE_TKEY, "TKEY", 7, 7, type_tkey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* LDNS_RDF_TYPE_INT16_DATA takes two fields (length and data) as one.
* So, unlike RFC 2930 spec, we have 7 min/max rdf's i.s.o. 8/9.
*/
/* 250 */
{LDNS_RR_TYPE_TSIG, "TSIG", 7, 7, type_tsig_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* IXFR: A request for a transfer of an incremental zone transfer */
{LDNS_RR_TYPE_NULL, "TYPE251", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* AXFR: A request for a transfer of an entire zone */
{LDNS_RR_TYPE_NULL, "TYPE252", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* MAILB: A request for mailbox-related records (MB, MG or MR) */
{LDNS_RR_TYPE_NULL, "TYPE253", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* MAILA: A request for mail agent RRs (Obsolete - see MX) */
{LDNS_RR_TYPE_NULL, "TYPE254", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* ANY: A request for all (available) records */
{LDNS_RR_TYPE_NULL, "TYPE255", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 256 */
{LDNS_RR_TYPE_URI, "URI", 3, 3, type_uri_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 257 */
{LDNS_RR_TYPE_CAA, "CAA", 3, 3, type_caa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#ifdef RRTYPE_AVC
/* 258 */
{LDNS_RR_TYPE_AVC, "AVC", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE258", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
#ifdef RRTYPE_DOA
/* 259 */
{LDNS_RR_TYPE_DOA, "DOA", 5, 5, type_doa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE259", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
#ifdef RRTYPE_AMTRELAY
/* 260 */
{LDNS_RR_TYPE_AMTRELAY, "AMTRELAY", 1, 1, type_amtrelay_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE260", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
#ifdef RRTYPE_RESINFO
/* 261 */
{LDNS_RR_TYPE_RESINFO, "RESINFO", 1, 0, NULL, LDNS_RDF_TYPE_UNQUOTED, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE261", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
/* 262 */
{LDNS_RR_TYPE_WALLET, "WALLET", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
#ifdef RRTYPE_CLA_IPN
/* 263 */
{LDNS_RR_TYPE_CLA, "CLA", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
/* 264 */
{LDNS_RR_TYPE_IPN, "IPN", 1, 1, type_ipn_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE263", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE264", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
/* split in array, no longer contiguous */
#ifdef RRTYPE_TA
/* 32768 */
{LDNS_RR_TYPE_TA, "TA", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#else
{LDNS_RR_TYPE_NULL, "TYPE32768", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
#endif
/* 32769 */
{LDNS_RR_TYPE_DLV, "DLV", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }
};
#define LDNS_RDATA_FIELD_DESCRIPTORS_COUNT \
(sizeof(rdata_field_descriptors)/sizeof(rdata_field_descriptors[0]))
/*---------------------------------------------------------------------------*
* The functions below return an bitmap RDF with the space required to set
* or unset all known RR types. Arguably these functions are better situated
* in rdata.c, however for the space calculation it is necessary to walk
* through rdata_field_descriptors which is not easily possible from anywhere
* other than rr.c where it is declared static.
*
* Alternatively rr.c could have provided an iterator for rr_type or
* rdf_descriptors, but this seemed overkill for internal use only.
*/
static ldns_rr_descriptor* rdata_field_descriptors_end =
&rdata_field_descriptors[LDNS_RDATA_FIELD_DESCRIPTORS_COUNT];
/* From RFC3845:
*
* 2.1.2. The List of Type Bit Map(s) Field
*
* The RR type space is split into 256 window blocks, each representing
* the low-order 8 bits of the 16-bit RR type space. Each block that
* has at least one active RR type is encoded using a single octet
* window number (from 0 to 255), a single octet bitmap length (from 1
* to 32) indicating the number of octets used for the window block's
* bitmap, and up to 32 octets (256 bits) of bitmap.
*
* Window blocks are present in the NSEC RR RDATA in increasing
* numerical order.
*
* "|" denotes concatenation
*
* Type Bit Map(s) Field = ( Window Block # | Bitmap Length | Bitmap ) +
*
* <cut>
*
* Blocks with no types present MUST NOT be included. Trailing zero
* octets in the bitmap MUST be omitted. The length of each block's
* bitmap is determined by the type code with the largest numerical
* value within that block, among the set of RR types present at the
* NSEC RR's owner name. Trailing zero octets not specified MUST be
* interpreted as zero octets.
*/
static ldns_status
ldns_rdf_bitmap_known_rr_types_set(ldns_rdf** rdf, int value)
{
uint8_t window; /* most significant octet of type */
uint8_t subtype; /* least significant octet of type */
uint16_t windows[256] /* Max subtype per window */
#ifndef S_SPLINT_S
= { 0 }
#endif
;
ldns_rr_descriptor* d; /* used to traverse rdata_field_descriptors */
size_t i; /* used to traverse windows array */
size_t sz; /* size needed for type bitmap rdf */
uint8_t* data = NULL; /* rdf data */
uint8_t* dptr; /* used to itraverse rdf data */
assert(rdf != NULL);
/* Which windows need to be in the bitmap rdf?
*/
for (d=rdata_field_descriptors; d < rdata_field_descriptors_end; d++) {
window = d->_type >> 8;
subtype = d->_type & 0xff;
/* In the code below, windows[window] == 0 means that the
* window is not in use. So subtype == 0 is a problem. The
* easiest solution is to set subtype to 1, that marks the
* window as in use and doesn't have negative effects.
*/
if (subtype == 0)
subtype = 1;
if (windows[window] < subtype) {
windows[window] = subtype;
}
}
/* How much space do we need in the rdf for those windows?
*/
sz = 0;
for (i = 0; i < 256; i++) {
if (windows[i]) {
sz += windows[i] / 8 + 3;
}
}
if (sz > 0) {
/* Format rdf data according RFC3845 Section 2.1.2 (see above)
*/
dptr = data = LDNS_XMALLOC(uint8_t, sz);
if (!data) {
return LDNS_STATUS_MEM_ERR;
}
memset(data, value, sz);
for (i = 0; i < 256; i++) {
if (windows[i]) {
*dptr++ = (uint8_t)i;
*dptr++ = (uint8_t)(windows[i] / 8 + 1);
dptr += dptr[-1];
}
}
}
/* Allocate and return rdf structure for the data
*/
*rdf = ldns_rdf_new(LDNS_RDF_TYPE_BITMAP, sz, data);
if (!*rdf) {
LDNS_FREE(data);
return LDNS_STATUS_MEM_ERR;
}
return LDNS_STATUS_OK;
}
ldns_status
ldns_rdf_bitmap_known_rr_types_space(ldns_rdf** rdf)
{
return ldns_rdf_bitmap_known_rr_types_set(rdf, 0);
}
ldns_status
ldns_rdf_bitmap_known_rr_types(ldns_rdf** rdf)
{
return ldns_rdf_bitmap_known_rr_types_set(rdf, 255);
}
/* End of RDF bitmap functions
*---------------------------------------------------------------------------*/
const ldns_rr_descriptor *
ldns_rr_descript(uint16_t type)
{
size_t i;
if (type < LDNS_RDATA_FIELD_DESCRIPTORS_COMMON) {
return &rdata_field_descriptors[type];
} else {
/* because not all array index equals type code */
for (i = LDNS_RDATA_FIELD_DESCRIPTORS_COMMON;
i < LDNS_RDATA_FIELD_DESCRIPTORS_COUNT;
i++) {
if (rdata_field_descriptors[i]._type == type) {
return &rdata_field_descriptors[i];
}
}
return &rdata_field_descriptors[0];
}
}
size_t
ldns_rr_descriptor_minimum(const ldns_rr_descriptor *descriptor)
{
if (descriptor) {
return descriptor->_minimum;
} else {
return 0;
}
}
size_t
ldns_rr_descriptor_maximum(const ldns_rr_descriptor *descriptor)
{
if (descriptor) {
if (descriptor->_variable != LDNS_RDF_TYPE_NONE) {
/* Should really be SIZE_MAX... bad FreeBSD. */
return UINT_MAX;
} else {
return descriptor->_maximum;
}
} else {
return 0;
}
}
ldns_rdf_type
ldns_rr_descriptor_field_type(const ldns_rr_descriptor *descriptor,
size_t index)
{
assert(descriptor != NULL);
assert(index < descriptor->_maximum
|| descriptor->_variable != LDNS_RDF_TYPE_NONE);
if (index < descriptor->_maximum) {
return descriptor->_wireformat[index];
} else {
return descriptor->_variable;
}
}
ldns_rr_type
ldns_get_rr_type_by_name(const char *name)
{
unsigned int i;
const char *desc_name;
const ldns_rr_descriptor *desc;
/* TYPEXX representation */
if (strlen(name) > 4 && strncasecmp(name, "TYPE", 4) == 0) {
return atoi(name + 4);
}
/* Normal types */
for (i = 0; i < (unsigned int) LDNS_RDATA_FIELD_DESCRIPTORS_COUNT; i++) {
desc = &rdata_field_descriptors[i];
desc_name = desc->_name;
if(desc_name &&
strlen(name) == strlen(desc_name) &&
strncasecmp(name, desc_name, strlen(desc_name)) == 0) {
/* because not all array index equals type code */
return desc->_type;
}
}
/* special cases for query types */
if (strlen(name) == 4 && strncasecmp(name, "IXFR", 4) == 0) {
return 251;
} else if (strlen(name) == 4 && strncasecmp(name, "AXFR", 4) == 0) {
return 252;
} else if (strlen(name) == 5 && strncasecmp(name, "MAILB", 5) == 0) {
return 253;
} else if (strlen(name) == 5 && strncasecmp(name, "MAILA", 5) == 0) {
return 254;
} else if (strlen(name) == 3 && strncasecmp(name, "ANY", 3) == 0) {
return 255;
}
return 0;
}
ldns_rr_class
ldns_get_rr_class_by_name(const char *name)
{
ldns_lookup_table *lt;
/* CLASSXX representation */
if (strlen(name) > 5 && strncasecmp(name, "CLASS", 5) == 0) {
return atoi(name + 5);
}
/* Normal types */
lt = ldns_lookup_by_name(ldns_rr_classes, name);
if (lt) {
return lt->id;
}
return 0;
}
ldns_rr_type
ldns_rdf2rr_type(const ldns_rdf *rd)
{
ldns_rr_type r;
if (!rd) {
return 0;
}
if (ldns_rdf_get_type(rd) != LDNS_RDF_TYPE_TYPE) {
return 0;
}
r = (ldns_rr_type) ldns_rdf2native_int16(rd);
return r;
}
ldns_rr_type
ldns_rr_list_type(const ldns_rr_list *rr_list)
{
if (rr_list && ldns_rr_list_rr_count(rr_list) > 0) {
return ldns_rr_get_type(ldns_rr_list_rr(rr_list, 0));
} else {
return 0;
}
}
ldns_rdf *
ldns_rr_list_owner(const ldns_rr_list *rr_list)
{
if (rr_list && ldns_rr_list_rr_count(rr_list) > 0) {
return ldns_rr_owner(ldns_rr_list_rr(rr_list, 0));
} else {
return NULL;
}
}
ldns_buffer_free
void ldns_buffer_free(ldns_buffer *buffer)
frees the buffer.
Definition buffer.c:137
ldns_buffer
struct ldns_struct_buffer ldns_buffer
Definition buffer.h:72
ldns_buffer_new
ldns_buffer * ldns_buffer_new(size_t capacity)
creates a new buffer with the specified capacity.
Definition buffer.c:16
ldns_buffer_new_frm_data
void ldns_buffer_new_frm_data(ldns_buffer *buffer, const void *data, size_t size)
creates a buffer with the specified data.
Definition buffer.c:41
config.h
ldns_dname_str_absolute
signed char ldns_dname_str_absolute(const char *dname_str)
Checks whether the given dname string is absolute (i.e.
Definition dname.c:518
ldns_dname_compare
int ldns_dname_compare(const ldns_rdf *dname1, const ldns_rdf *dname2)
Compares the two dname rdf's according to the algorithm for ordering in RFC4034 Section 6.
Definition dname.c:359
ldns_dname2canonical
void ldns_dname2canonical(const ldns_rdf *rdf)
Put a dname into canonical fmt - ie.
Definition dname.c:280
ldns_dname_label_count
uint8_t ldns_dname_label_count(const ldns_rdf *r)
count the number of labels inside a LDNS_RDF_DNAME type rdf.
Definition dname.c:214
ldns_dname_cat
ldns_status ldns_dname_cat(ldns_rdf *rd1, const ldns_rdf *rd2)
concatenates rd2 after rd1 (rd2 is copied, rd1 is modified)
Definition dname.c:90
ldns_dname_new_frm_str
ldns_rdf * ldns_dname_new_frm_str(const char *str)
creates a new dname rdf from a string.
Definition dname.c:268
ldns_key_rr2ds
ldns_rr * ldns_key_rr2ds(const ldns_rr *key, ldns_hash h)
returns a new DS rr that represents the given key rr.
Definition dnssec.c:509
LDNS_STATUS_SYNTAX_SUPERFLUOUS_TEXT_ERR
@ LDNS_STATUS_SYNTAX_SUPERFLUOUS_TEXT_ERR
Definition error.h:130
LDNS_STATUS_SYNTAX_ERR
@ LDNS_STATUS_SYNTAX_ERR
Definition error.h:97
LDNS_STATUS_SYNTAX_DNAME_ERR
@ LDNS_STATUS_SYNTAX_DNAME_ERR
Definition error.h:84
LDNS_STATUS_MEM_ERR
@ LDNS_STATUS_MEM_ERR
Definition error.h:34
LDNS_STATUS_SYNTAX_TTL
@ LDNS_STATUS_SYNTAX_TTL
Definition error.h:88
LDNS_STATUS_SYNTAX_RDATA_ERR
@ LDNS_STATUS_SYNTAX_RDATA_ERR
Definition error.h:83
LDNS_STATUS_SYNTAX_TYPE_ERR
@ LDNS_STATUS_SYNTAX_TYPE_ERR
Definition error.h:79
LDNS_STATUS_OK
@ LDNS_STATUS_OK
Definition error.h:26
LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR
@ LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR
Definition error.h:93
LDNS_STATUS_SYNTAX_EMPTY
@ LDNS_STATUS_SYNTAX_EMPTY
Definition error.h:91
LDNS_STATUS_SYNTAX_CLASS_ERR
@ LDNS_STATUS_SYNTAX_CLASS_ERR
Definition error.h:80
LDNS_STATUS_SYNTAX_INCLUDE
@ LDNS_STATUS_SYNTAX_INCLUDE
Definition error.h:90
LDNS_STATUS_SYNTAX_TTL_ERR
@ LDNS_STATUS_SYNTAX_TTL_ERR
Definition error.h:81
LDNS_STATUS_SYNTAX_ORIGIN
@ LDNS_STATUS_SYNTAX_ORIGIN
Definition error.h:89
ldns_status
enum ldns_enum_status ldns_status
Definition error.h:152
ldns_rr2buffer_wire
ldns_status ldns_rr2buffer_wire(ldns_buffer *output, const ldns_rr *rr, int section)
Copies the rr data to the buffer in wire format.
Definition host2wire.c:244
ldns_rr2buffer_wire_canonical
ldns_status ldns_rr2buffer_wire_canonical(ldns_buffer *output, const ldns_rr *rr, int section)
Copies the rr data to the buffer in wire format, in canonical format according to RFC3597 (every dnam...
Definition host2wire.c:171
ldns_hash
enum ldns_enum_hash ldns_hash
Definition keys.h:76
LDNS_DEFAULT_TTL
#define LDNS_DEFAULT_TTL
Definition ldns.h:136
ldns_rr_classes
ldns_lookup_table ldns_rr_classes[]
rr types
Definition host2str.c:99
LDNS_MAX_PACKETLEN
#define LDNS_MAX_PACKETLEN
Definition packet.h:24
LDNS_SECTION_ANY
@ LDNS_SECTION_ANY
bogus section, if not interested
Definition packet.h:283
ldns_fget_token_l_st
ldns_status ldns_fget_token_l_st(FILE *f, char **token, size_t *limit, signed char fixed, const char *delim, int *line_nr)
returns a token/char from the stream f.
Definition parse.c:226
LDNS_PARSE_SKIP_SPACE
#define LDNS_PARSE_SKIP_SPACE
Definition parse.h:20
ldns_bget_token
ssize_t ldns_bget_token(ldns_buffer *b, char *token, const char *delim, size_t limit)
returns a token/char from the buffer b.
Definition parse.c:301
ldns_str2period
uint32_t ldns_str2period(const char *nptr, const char **endptr)
converts a ttl value (like 5d2h) to a long.
Definition rdata.c:697
ldns_rdf_new_frm_str
ldns_rdf * ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str)
creates a new rdf from a string.
Definition rdata.c:249
ldns_rdf_data
uint8_t * ldns_rdf_data(const ldns_rdf *rd)
returns the data of the rdf.
Definition rdata.c:38
ldns_rdf_clone
ldns_rdf * ldns_rdf_clone(const ldns_rdf *rd)
clones a rdf structure.
Definition rdata.c:222
ldns_rdf_get_type
ldns_rdf_type ldns_rdf_get_type(const ldns_rdf *rd)
returns the type of the rdf.
Definition rdata.c:31
ldns_rdf_set_type
void ldns_rdf_set_type(ldns_rdf *rd, ldns_rdf_type type)
sets the size of the rdf.
Definition rdata.c:53
ldns_rdf_deep_free
void ldns_rdf_deep_free(ldns_rdf *rd)
frees a rdf structure and frees the data.
Definition rdata.c:230
LDNS_MAX_RDFLEN
#define LDNS_MAX_RDFLEN
Definition rdata.h:31
ldns_rdf2native_int16
uint16_t ldns_rdf2native_int16(const ldns_rdf *rd)
returns the native uint16_t representation from the rdf.
Definition rdata.c:84
ldns_rdf2native_int8
uint8_t ldns_rdf2native_int8(const ldns_rdf *rd)
returns the native uint8_t representation from the rdf.
Definition rdata.c:70
LDNS_RDF_TYPE_INT32
@ LDNS_RDF_TYPE_INT32
32 bits
Definition rdata.h:56
LDNS_RDF_TYPE_TAG
@ LDNS_RDF_TYPE_TAG
A non-zero sequence of US-ASCII letters and numbers in lower case.
Definition rdata.h:132
LDNS_RDF_TYPE_NSAP
@ LDNS_RDF_TYPE_NSAP
NSAP.
Definition rdata.h:106
LDNS_RDF_TYPE_HIP
@ LDNS_RDF_TYPE_HIP
Represents the Public Key Algorithm, HIT and Public Key fields for the HIP RR types.
Definition rdata.h:95
LDNS_RDF_TYPE_IPN
@ LDNS_RDF_TYPE_IPN
draft-johnson-dns-ipn-cla-07
Definition rdata.h:155
LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
@ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
nsec3 base32 string (with length byte on wire
Definition rdata.h:114
LDNS_RDF_TYPE_CERT_ALG
@ LDNS_RDF_TYPE_CERT_ALG
certificate algorithm
Definition rdata.h:81
LDNS_RDF_TYPE_EUI48
@ LDNS_RDF_TYPE_EUI48
6 * 8 bit hex numbers separated by dashes.
Definition rdata.h:122
LDNS_RDF_TYPE_EUI64
@ LDNS_RDF_TYPE_EUI64
8 * 8 bit hex numbers separated by dashes.
Definition rdata.h:124
LDNS_RDF_TYPE_PERIOD
@ LDNS_RDF_TYPE_PERIOD
period
Definition rdata.h:89
LDNS_RDF_TYPE_B64
@ LDNS_RDF_TYPE_B64
b64 string
Definition rdata.h:70
LDNS_RDF_TYPE_AAAA
@ LDNS_RDF_TYPE_AAAA
AAAA record.
Definition rdata.h:62
LDNS_RDF_TYPE_UNKNOWN
@ LDNS_RDF_TYPE_UNKNOWN
unknown types
Definition rdata.h:85
LDNS_RDF_TYPE_WKS
@ LDNS_RDF_TYPE_WKS
well known services
Definition rdata.h:104
LDNS_RDF_TYPE_DNAME
@ LDNS_RDF_TYPE_DNAME
domain name
Definition rdata.h:50
LDNS_RDF_TYPE_TIME
@ LDNS_RDF_TYPE_TIME
time (32 bits)
Definition rdata.h:87
LDNS_RDF_TYPE_BITMAP
@ LDNS_RDF_TYPE_BITMAP
Definition rdata.h:75
LDNS_RDF_TYPE_SVCPARAMS
@ LDNS_RDF_TYPE_SVCPARAMS
draft-ietf-dnsop-svcb-https
Definition rdata.h:152
LDNS_RDF_TYPE_NSEC
@ LDNS_RDF_TYPE_NSEC
nsec type codes
Definition rdata.h:74
LDNS_RDF_TYPE_SELECTOR
@ LDNS_RDF_TYPE_SELECTOR
Definition rdata.h:145
LDNS_RDF_TYPE_NSEC3_SALT
@ LDNS_RDF_TYPE_NSEC3_SALT
nsec3 hash salt
Definition rdata.h:112
LDNS_RDF_TYPE_APL
@ LDNS_RDF_TYPE_APL
apl data
Definition rdata.h:66
LDNS_RDF_TYPE_A
@ LDNS_RDF_TYPE_A
A record.
Definition rdata.h:60
LDNS_RDF_TYPE_LONG_STR
@ LDNS_RDF_TYPE_LONG_STR
A <character-string> encoding of the value field as specified [RFC1035], Section 5....
Definition rdata.h:138
LDNS_RDF_TYPE_LOC
@ LDNS_RDF_TYPE_LOC
location data
Definition rdata.h:102
LDNS_RDF_TYPE_INT16_DATA
@ LDNS_RDF_TYPE_INT16_DATA
variable length any type rdata where the length is specified by the first 2 bytes
Definition rdata.h:98
LDNS_RDF_TYPE_ILNP64
@ LDNS_RDF_TYPE_ILNP64
4 shorts represented as 4 * 16 bit hex numbers separated by colons.
Definition rdata.h:119
LDNS_RDF_TYPE_ATMA
@ LDNS_RDF_TYPE_ATMA
ATMA.
Definition rdata.h:108
LDNS_RDF_TYPE_HEX
@ LDNS_RDF_TYPE_HEX
hex string
Definition rdata.h:72
LDNS_RDF_TYPE_NONE
@ LDNS_RDF_TYPE_NONE
none
Definition rdata.h:48
LDNS_RDF_TYPE_INT8
@ LDNS_RDF_TYPE_INT8
8 bits
Definition rdata.h:52
LDNS_RDF_TYPE_MATCHING_TYPE
@ LDNS_RDF_TYPE_MATCHING_TYPE
Definition rdata.h:146
LDNS_RDF_TYPE_IPSECKEY
@ LDNS_RDF_TYPE_IPSECKEY
IPSECKEY.
Definition rdata.h:110
LDNS_RDF_TYPE_CERTIFICATE_USAGE
@ LDNS_RDF_TYPE_CERTIFICATE_USAGE
Since RFC7218 TLSA records can be given with mnemonics, hence these rdata field types.
Definition rdata.h:144
LDNS_RDF_TYPE_STR
@ LDNS_RDF_TYPE_STR
txt string
Definition rdata.h:64
LDNS_RDF_TYPE_INT16
@ LDNS_RDF_TYPE_INT16
16 bits
Definition rdata.h:54
LDNS_RDF_TYPE_ALG
@ LDNS_RDF_TYPE_ALG
a key algorithm
Definition rdata.h:83
LDNS_RDF_TYPE_AMTRELAY
@ LDNS_RDF_TYPE_AMTRELAY
draft-ietf-mboned-driad-amt-discovery
Definition rdata.h:149
LDNS_RDF_TYPE_UNQUOTED
@ LDNS_RDF_TYPE_UNQUOTED
Character string without quotes.
Definition rdata.h:127
LDNS_RDF_TYPE_TSIGTIME
@ LDNS_RDF_TYPE_TSIGTIME
tsig time 48 bits
Definition rdata.h:91
LDNS_RDF_TYPE_TYPE
@ LDNS_RDF_TYPE_TYPE
a RR type
Definition rdata.h:77
ldns_rdf_size
size_t ldns_rdf_size(const ldns_rdf *rd)
returns the size of the rdf.
Definition rdata.c:24
ldns_rdf
struct ldns_struct_rdf ldns_rdf
Definition rdata.h:211
ldns_rdf_new
ldns_rdf * ldns_rdf_new(ldns_rdf_type type, size_t size, void *data)
allocates a new rdf structure and fills it.
Definition rdata.c:179
ldns_rdf_compare
int ldns_rdf_compare(const ldns_rdf *rd1, const ldns_rdf *rd2)
compares two rdf's on their wire formats.
Definition rdata.c:663
ldns_rdf_type
enum ldns_enum_rdf_type ldns_rdf_type
Definition rdata.h:157
ldns_rr_list_free
void ldns_rr_list_free(ldns_rr_list *rr_list)
frees an rr_list structure.
Definition rr.c:1009
ldns_get_rr_class_by_name
ldns_rr_class ldns_get_rr_class_by_name(const char *name)
retrieves a class by looking up its name.
Definition rr.c:2835
ldns_rr_new_frm_str
ldns_status ldns_rr_new_frm_str(ldns_rr **newrr, const char *str, uint32_t default_ttl, const ldns_rdf *origin, ldns_rdf **prev)
creates an rr from a string.
Definition rr.c:670
ldns_rr_ttl
uint32_t ldns_rr_ttl(const ldns_rr *rr)
returns the ttl of an rr structure.
Definition rr.c:929
ldns_rr_pop_rdf
ldns_rdf * ldns_rr_pop_rdf(ldns_rr *rr)
removes a rd_field member, it will be popped from the last position.
Definition rr.c:878
ldns_rdf2rr_type
ldns_rr_type ldns_rdf2rr_type(const ldns_rdf *rd)
convert an rdf of type LDNS_RDF_TYPE_TYPE to an actual LDNS_RR_TYPE.
Definition rr.c:2855
ldns_rr_new_frm_fp_l
ldns_status ldns_rr_new_frm_fp_l(ldns_rr **newrr, FILE *fp, uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev, int *line_nr)
creates a new rr from a file containing a string.
Definition rr.c:794
ldns_rr_list_deep_free
void ldns_rr_list_deep_free(ldns_rr_list *rr_list)
frees an rr_list structure and all rrs contained therein.
Definition rr.c:1018
ldns_rr_free
void ldns_rr_free(ldns_rr *rr)
frees an RR structure
Definition rr.c:81
ldns_rr_set_owner
void ldns_rr_set_owner(ldns_rr *rr, ldns_rdf *owner)
sets the owner in the rr structure.
Definition rr.c:802
_BUFFER_IS_AT_WHITESPACE
#define _BUFFER_IS_AT_WHITESPACE(rd_buf)
Definition rr.c:26
ldns_rr_list_new
ldns_rr_list * ldns_rr_list_new(void)
creates a new rr_list structure.
Definition rr.c:998
ldns_rr_list_type
ldns_rr_type ldns_rr_list_type(const ldns_rr_list *rr_list)
Returns the type of the first element of the RR If there are no elements present, 0 is returned.
Definition rr.c:2872
ldns_rr_list_pop_rr
ldns_rr * ldns_rr_list_pop_rr(ldns_rr_list *rr_list)
pops the last rr from an rrlist.
Definition rr.c:1175
LDNS_RDATA_FIELD_DESCRIPTORS_COUNT
#define LDNS_RDATA_FIELD_DESCRIPTORS_COUNT
computes the number of rdata fields
Definition rr.c:2606
LDNS_TTL_DATALEN
#define LDNS_TTL_DATALEN
Definition rr.c:20
LDNS_RRLIST_INIT
#define LDNS_RRLIST_INIT
Definition rr.c:21
ldns_rr_set_pop_rr
ldns_rr * ldns_rr_set_pop_rr(ldns_rr_list *rr_list)
pops the last rr from an rrset.
Definition rr.c:1380
ldns_rr_list_owner
ldns_rdf * ldns_rr_list_owner(const ldns_rr_list *rr_list)
Returns the owner domain name rdf of the first element of the RR If there are no elements present,...
Definition rr.c:2882
ldns_rr_set_push_rr
signed char ldns_rr_set_push_rr(ldns_rr_list *rr_list, ldns_rr *rr)
pushes an rr to an rrset (which really are rr_list's).
Definition rr.c:1332
ldns_rr_list_pop_rrset
ldns_rr_list * ldns_rr_list_pop_rrset(ldns_rr_list *rr_list)
pops the first rrset from the list, the list must be sorted, so that all rr's from each rrset are nex...
Definition rr.c:1386
ldns_rr_new
ldns_rr * ldns_rr_new(void)
creates a new rr structure.
Definition rr.c:30
ldns_rr_new_frm_fp
ldns_status ldns_rr_new_frm_fp(ldns_rr **newrr, FILE *fp, uint32_t *ttl, ldns_rdf **origin, ldns_rdf **prev)
creates a new rr from a file containing a string.
Definition rr.c:713
ldns_rr_list_contains_rr
signed char ldns_rr_list_contains_rr(const ldns_rr_list *rr_list, const ldns_rr *rr)
returns true if the given rr is one of the rrs in the list, or if it is equal to one
Definition rr.c:1238
ldns_rr_list_sort
void ldns_rr_list_sort(ldns_rr_list *unsorted)
sorts an rr_list (canonical wire format).
Definition rr.c:1554
_IS_WHITESPACE
#define _IS_WHITESPACE(chr)
Definition rr.c:23
ldns_rr_new_frm_type
ldns_rr * ldns_rr_new_frm_type(ldns_rr_type t)
creates a new rr structure, based on the given type.
Definition rr.c:48
ldns_rr_set_type
void ldns_rr_set_type(ldns_rr *rr, ldns_rr_type rr_type)
sets the type in the rr.
Definition rr.c:826
ldns_rr_list_cat_clone
ldns_rr_list * ldns_rr_list_cat_clone(const ldns_rr_list *left, const ldns_rr_list *right)
concatenates two ldns_rr_lists together, but makes clones of the rr's (instead of pointer copying).
Definition rr.c:1057
ldns_rr_list_push_rr
signed char ldns_rr_list_push_rr(ldns_rr_list *rr_list, const ldns_rr *rr)
pushes an rr to an rrlist.
Definition rr.c:1130
ldns_rr_list_push_rr_list
signed char ldns_rr_list_push_rr_list(ldns_rr_list *rr_list, const ldns_rr_list *push_list)
pushes an rr_list to an rrlist.
Definition rr.c:1161
ldns_rr_is_question
signed char ldns_rr_is_question(const ldns_rr *rr)
returns the question flag of an rr structure.
Definition rr.c:923
ldns_rr2canonical
void ldns_rr2canonical(ldns_rr *rr)
converts each dname in a rr to its canonical form.
Definition rr.c:1827
ldns_rr_rd_count
size_t ldns_rr_rd_count(const ldns_rr *rr)
returns the rd_count of an rr structure.
Definition rr.c:935
ldns_rr_rdf
ldns_rdf * ldns_rr_rdf(const ldns_rr *rr, size_t nr)
returns the rdata field member counter.
Definition rr.c:907
ldns_rr_list_subtype_by_rdf
ldns_rr_list * ldns_rr_list_subtype_by_rdf(const ldns_rr_list *l, const ldns_rdf *r, size_t pos)
Return the rr_list which matches the rdf at position field.
Definition rr.c:1096
ldns_rr_label_count
uint8_t ldns_rr_label_count(const ldns_rr *rr)
counts the number of labels of the ownername.
Definition rr.c:1888
ldns_rr_descriptor_field_type
ldns_rdf_type ldns_rr_descriptor_field_type(const ldns_rr_descriptor *descriptor, size_t index)
returns the rdf type for the given rdata field number of the rr type for the given descriptor.
Definition rr.c:2781
ldns_rr_compare_ds
signed char ldns_rr_compare_ds(const ldns_rr *orr1, const ldns_rr *orr2)
returns true of the given rr's are equal.
Definition rr.c:1750
ldns_rr_list_rr_count
size_t ldns_rr_list_rr_count(const ldns_rr_list *rr_list)
returns the number of rr's in an rr_list.
Definition rr.c:955
LDNS_SYNTAX_DATALEN
#define LDNS_SYNTAX_DATALEN
Definition rr.c:19
ldns_rr_compare_wire
int ldns_rr_compare_wire(const ldns_buffer *rr1_buf, const ldns_buffer *rr2_buf)
compares the wireformat of two rrs, contained in the given buffers.
Definition rr.c:1638
ldns_rr_list2canonical
void ldns_rr_list2canonical(const ldns_rr_list *rr_list)
converts each dname in each rr in a rr_list to its canonical form.
Definition rr.c:1879
ldns_rr_list_pop_rr_list
ldns_rr_list * ldns_rr_list_pop_rr_list(ldns_rr_list *rr_list, size_t howmany)
pops an rr_list of size s from an rrlist.
Definition rr.c:1208
ldns_rr_get_type
ldns_rr_type ldns_rr_get_type(const ldns_rr *rr)
returns the type of the rr.
Definition rr.c:941
ldns_rr_set_ttl
void ldns_rr_set_ttl(ldns_rr *rr, uint32_t ttl)
sets the ttl in the rr structure.
Definition rr.c:814
ldns_rr_set_rdf
ldns_rdf * ldns_rr_set_rdf(ldns_rr *rr, const ldns_rdf *f, size_t position)
sets a rdf member, it will be set on the position given.
Definition rr.c:838
ldns_rr_clone
ldns_rr * ldns_rr_clone(const ldns_rr *rr)
clones a rr and all its data
Definition rr.c:1438
_ldns_rr_new_frm_fp_l_internal
ldns_status _ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp, uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev, int *line_nr, signed char *explicit_ttl)
Definition rr.c:723
ldns_rr_set_question
void ldns_rr_set_question(ldns_rr *rr, signed char question)
sets the question flag in the rr structure.
Definition rr.c:808
ldns_rr_descriptor_maximum
size_t ldns_rr_descriptor_maximum(const ldns_rr_descriptor *descriptor)
returns the maximum number of rdata fields of the rr type this descriptor describes.
Definition rr.c:2766
ldns_rr_compare_no_rdata
int ldns_rr_compare_no_rdata(const ldns_rr *rr1, const ldns_rr *rr2)
compares two rrs, up to the rdata.
Definition rr.c:1597
ldns_rr_get_class
ldns_rr_class ldns_rr_get_class(const ldns_rr *rr)
returns the class of the rr.
Definition rr.c:947
ldns_rr_list_set_rr
ldns_rr * ldns_rr_list_set_rr(ldns_rr_list *rr_list, const ldns_rr *r, size_t count)
set a rr on a specific index in a ldns_rr_list
Definition rr.c:965
ldns_rr_set_rd_count
void ldns_rr_set_rd_count(ldns_rr *rr, size_t count)
sets the rd_count in the rr.
Definition rr.c:820
ldns_rr_list_rr
ldns_rr * ldns_rr_list_rr(const ldns_rr_list *rr_list, size_t nr)
returns a specific rr of an rrlist.
Definition rr.c:988
ldns_rdf_bitmap_known_rr_types_space
ldns_status ldns_rdf_bitmap_known_rr_types_space(ldns_rdf **rdf)
Create a rr type bitmap rdf providing enough space to set all known (to ldns) rr types.
Definition rr.c:2722
ldns_rr_set_class
void ldns_rr_set_class(ldns_rr *rr, ldns_rr_class rr_class)
sets the class in the rr.
Definition rr.c:832
ldns_is_rrset
signed char ldns_is_rrset(const ldns_rr_list *rr_list)
checks if an rr_list is a rrset.
Definition rr.c:1257
ldns_rr_list_cat
signed char ldns_rr_list_cat(ldns_rr_list *left, const ldns_rr_list *right)
concatenates two ldns_rr_lists together.
Definition rr.c:1034
ldns_rr_list_compare
int ldns_rr_list_compare(const ldns_rr_list *rrl1, const ldns_rr_list *rrl2)
compares two rr lists.
Definition rr.c:1783
ldns_rr_push_rdf
signed char ldns_rr_push_rdf(ldns_rr *rr, const ldns_rdf *f)
sets rd_field member, it will be placed in the next available spot.
Definition rr.c:855
ldns_rr_list_clone
ldns_rr_list * ldns_rr_list_clone(const ldns_rr_list *rrlist)
clones an rrlist.
Definition rr.c:1469
ldns_rr_owner
ldns_rdf * ldns_rr_owner(const ldns_rr *rr)
returns the owner name of an rr structure.
Definition rr.c:917
ldns_rr_compare
int ldns_rr_compare(const ldns_rr *rr1, const ldns_rr *rr2)
compares two rrs.
Definition rr.c:1676
ldns_rr_list_set_rr_count
void ldns_rr_list_set_rr_count(ldns_rr_list *rr_list, size_t count)
sets the number of rr's in an rr_list.
Definition rr.c:981
ldns_rr_descriptor_minimum
size_t ldns_rr_descriptor_minimum(const ldns_rr_descriptor *descriptor)
returns the minimum number of rdata fields of the rr type this descriptor describes.
Definition rr.c:2756
ldns_rr_new_question_frm_str
ldns_status ldns_rr_new_question_frm_str(ldns_rr **newrr, const char *str, const ldns_rdf *origin, ldns_rdf **prev)
creates an rr for the question section from a string, i.e.
Definition rr.c:684
ldns_rr_descript
const ldns_rr_descriptor * ldns_rr_descript(uint16_t type)
returns the resource record descriptor for the given rr type.
Definition rr.c:2737
ldns_rr_uncompressed_size
size_t ldns_rr_uncompressed_size(const ldns_rr *r)
calculates the uncompressed size of an RR.
Definition rr.c:1810
ldns_rdf_bitmap_known_rr_types
ldns_status ldns_rdf_bitmap_known_rr_types(ldns_rdf **rdf)
Create a rr type bitmap rdf with at least all known (to ldns) rr types set.
Definition rr.c:2728
ldns_is_rrset_strict
signed char ldns_is_rrset_strict(const ldns_rr_list *rr_list)
checks if an rr_list is a rrset, including checking for TTL.
Definition rr.c:1292
ldns_get_rr_type_by_name
ldns_rr_type ldns_get_rr_type_by_name(const char *name)
retrieves a rrtype by looking up its name.
Definition rr.c:2795
LDNS_RDATA_FIELD_DESCRIPTORS_COMMON
#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON
Definition rr.h:263
LDNS_RR_NO_COMPRESS
@ LDNS_RR_NO_COMPRESS
Definition rr.h:70
LDNS_RR_COMPRESS
@ LDNS_RR_COMPRESS
compression is allowed
Definition rr.h:69
ldns_rr
struct ldns_struct_rr ldns_rr
Definition rr.h:346
ldns_rr_type
enum ldns_enum_rr_type ldns_rr_type
Definition rr.h:260
LDNS_RR_OVERHEAD
#define LDNS_RR_OVERHEAD
The bytes TTL, CLASS and length use up in an rr.
Definition rr.h:37
LDNS_RR_TYPE_MF
@ LDNS_RR_TYPE_MF
a mail forwarder (Obsolete - use MX)
Definition rr.h:86
LDNS_RR_TYPE_CERT
@ LDNS_RR_TYPE_CERT
RFC2538.
Definition rr.h:152
LDNS_RR_TYPE_RP
@ LDNS_RR_TYPE_RP
RFC1183.
Definition rr.h:112
LDNS_RR_TYPE_KX
@ LDNS_RR_TYPE_KX
RFC2230.
Definition rr.h:150
LDNS_RR_TYPE_DOA
@ LDNS_RR_TYPE_DOA
Definition rr.h:231
LDNS_RR_TYPE_SPF
@ LDNS_RR_TYPE_SPF
Definition rr.h:201
LDNS_RR_TYPE_DSYNC
@ LDNS_RR_TYPE_DSYNC
Definition rr.h:197
LDNS_RR_TYPE_RESINFO
@ LDNS_RR_TYPE_RESINFO
RFC 9606.
Definition rr.h:237
LDNS_RR_TYPE_OPT
@ LDNS_RR_TYPE_OPT
OPT record RFC 6891.
Definition rr.h:160
LDNS_RR_TYPE_RRSIG
@ LDNS_RR_TYPE_RRSIG
DNSSEC.
Definition rr.h:170
LDNS_RR_TYPE_SINK
@ LDNS_RR_TYPE_SINK
dnsind-kitchen-sink-02.txt
Definition rr.h:158
LDNS_RR_TYPE_A
@ LDNS_RR_TYPE_A
a host address
Definition rr.h:80
LDNS_RR_TYPE_HIP
@ LDNS_RR_TYPE_HIP
Definition rr.h:182
LDNS_RR_TYPE_LP
@ LDNS_RR_TYPE_LP
Definition rr.h:211
LDNS_RR_TYPE_ISDN
@ LDNS_RR_TYPE_ISDN
RFC1183.
Definition rr.h:118
LDNS_RR_TYPE_MINFO
@ LDNS_RR_TYPE_MINFO
mailbox or mail list information
Definition rr.h:106
LDNS_RR_TYPE_L32
@ LDNS_RR_TYPE_L32
Definition rr.h:209
LDNS_RR_TYPE_GPOS
@ LDNS_RR_TYPE_GPOS
RFC1712.
Definition rr.h:132
LDNS_RR_TYPE_TKEY
@ LDNS_RR_TYPE_TKEY
Definition rr.h:218
LDNS_RR_TYPE_ZONEMD
@ LDNS_RR_TYPE_ZONEMD
Definition rr.h:194
LDNS_RR_TYPE_DNSKEY
@ LDNS_RR_TYPE_DNSKEY
Definition rr.h:172
LDNS_RR_TYPE_SOA
@ LDNS_RR_TYPE_SOA
marks the start of a zone of authority
Definition rr.h:90
LDNS_RR_TYPE_SSHFP
@ LDNS_RR_TYPE_SSHFP
SSH Key Fingerprint.
Definition rr.h:166
LDNS_RR_TYPE_TSIG
@ LDNS_RR_TYPE_TSIG
Definition rr.h:219
LDNS_RR_TYPE_X25
@ LDNS_RR_TYPE_X25
RFC1183.
Definition rr.h:116
LDNS_RR_TYPE_WKS
@ LDNS_RR_TYPE_WKS
a well known service description
Definition rr.h:100
LDNS_RR_TYPE_TLSA
@ LDNS_RR_TYPE_TLSA
Definition rr.h:179
LDNS_RR_TYPE_PX
@ LDNS_RR_TYPE_PX
RFC2163.
Definition rr.h:130
LDNS_RR_TYPE_RT
@ LDNS_RR_TYPE_RT
RFC1183.
Definition rr.h:120
LDNS_RR_TYPE_NSEC
@ LDNS_RR_TYPE_NSEC
Definition rr.h:171
LDNS_RR_TYPE_DNAME
@ LDNS_RR_TYPE_DNAME
RFC2672.
Definition rr.h:156
LDNS_RR_TYPE_OPENPGPKEY
@ LDNS_RR_TYPE_OPENPGPKEY
Definition rr.h:192
LDNS_RR_TYPE_AMTRELAY
@ LDNS_RR_TYPE_AMTRELAY
RFC 8777.
Definition rr.h:234
LDNS_RR_TYPE_DS
@ LDNS_RR_TYPE_DS
RFC4034, RFC3658.
Definition rr.h:164
LDNS_RR_TYPE_KEY
@ LDNS_RR_TYPE_KEY
2535typecode
Definition rr.h:128
LDNS_RR_TYPE_NULL
@ LDNS_RR_TYPE_NULL
a null RR (EXPERIMENTAL)
Definition rr.h:98
LDNS_RR_TYPE_NSEC3PARAM
@ LDNS_RR_TYPE_NSEC3PARAM
Definition rr.h:177
LDNS_RR_TYPE_RKEY
@ LDNS_RR_TYPE_RKEY
draft-reid-dnsext-rkey
Definition rr.h:187
LDNS_RR_TYPE_BRID
@ LDNS_RR_TYPE_BRID
Definition rr.h:199
LDNS_RR_TYPE_NXT
@ LDNS_RR_TYPE_NXT
2535typecode
Definition rr.h:138
LDNS_RR_TYPE_DLV
@ LDNS_RR_TYPE_DLV
Definition rr.h:251
LDNS_RR_TYPE_SIG
@ LDNS_RR_TYPE_SIG
2535typecode
Definition rr.h:126
LDNS_RR_TYPE_CNAME
@ LDNS_RR_TYPE_CNAME
the canonical name for an alias
Definition rr.h:88
LDNS_RR_TYPE_NID
@ LDNS_RR_TYPE_NID
Definition rr.h:208
LDNS_RR_TYPE_NSEC3
@ LDNS_RR_TYPE_NSEC3
Definition rr.h:176
LDNS_RR_TYPE_DHCID
@ LDNS_RR_TYPE_DHCID
Definition rr.h:174
LDNS_RR_TYPE_CDNSKEY
@ LDNS_RR_TYPE_CDNSKEY
Definition rr.h:191
LDNS_RR_TYPE_TA
@ LDNS_RR_TYPE_TA
DNSSEC Trust Authorities.
Definition rr.h:249
LDNS_RR_TYPE_NXNAME
@ LDNS_RR_TYPE_NXNAME
Definition rr.h:216
LDNS_RR_TYPE_IPN
@ LDNS_RR_TYPE_IPN
https://www.iana.org/assignments/dns-parameters/IPN/ipn-completed-template
Definition rr.h:246
LDNS_RR_TYPE_LOC
@ LDNS_RR_TYPE_LOC
LOC record RFC1876.
Definition rr.h:136
LDNS_RR_TYPE_TXT
@ LDNS_RR_TYPE_TXT
text strings
Definition rr.h:110
LDNS_RR_TYPE_PTR
@ LDNS_RR_TYPE_PTR
a domain name pointer
Definition rr.h:102
LDNS_RR_TYPE_AAAA
@ LDNS_RR_TYPE_AAAA
ipv6 address
Definition rr.h:134
LDNS_RR_TYPE_EUI64
@ LDNS_RR_TYPE_EUI64
Definition rr.h:214
LDNS_RR_TYPE_MD
@ LDNS_RR_TYPE_MD
a mail destination (Obsolete - use MX)
Definition rr.h:84
LDNS_RR_TYPE_A6
@ LDNS_RR_TYPE_A6
RFC2874.
Definition rr.h:154
LDNS_RR_TYPE_NS
@ LDNS_RR_TYPE_NS
an authoritative name server
Definition rr.h:82
LDNS_RR_TYPE_MR
@ LDNS_RR_TYPE_MR
a mail rename domain name (EXPERIMENTAL)
Definition rr.h:96
LDNS_RR_TYPE_WALLET
@ LDNS_RR_TYPE_WALLET
https://iana.org/assignments/dns-parameters/WALLET/wallet-completed-template
Definition rr.h:240
LDNS_RR_TYPE_CAA
@ LDNS_RR_TYPE_CAA
Definition rr.h:229
LDNS_RR_TYPE_HHIT
@ LDNS_RR_TYPE_HHIT
Definition rr.h:198
LDNS_RR_TYPE_CLA
@ LDNS_RR_TYPE_CLA
https://www.iana.org/assignments/dns-parameters/CLA/cla-completed-template
Definition rr.h:243
LDNS_RR_TYPE_SVCB
@ LDNS_RR_TYPE_SVCB
Definition rr.h:195
LDNS_RR_TYPE_EUI48
@ LDNS_RR_TYPE_EUI48
Definition rr.h:213
LDNS_RR_TYPE_HTTPS
@ LDNS_RR_TYPE_HTTPS
Definition rr.h:196
LDNS_RR_TYPE_MB
@ LDNS_RR_TYPE_MB
a mailbox domain name (EXPERIMENTAL)
Definition rr.h:92
LDNS_RR_TYPE_NINFO
@ LDNS_RR_TYPE_NINFO
draft-reid-dnsext-zs
Definition rr.h:185
LDNS_RR_TYPE_TALINK
@ LDNS_RR_TYPE_TALINK
draft-ietf-dnsop-trust-history
Definition rr.h:189
LDNS_RR_TYPE_ATMA
@ LDNS_RR_TYPE_ATMA
http://www.jhsoft.com/rfc/af-saa-0069.000.rtf
Definition rr.h:146
LDNS_RR_TYPE_HINFO
@ LDNS_RR_TYPE_HINFO
host information
Definition rr.h:104
LDNS_RR_TYPE_CSYNC
@ LDNS_RR_TYPE_CSYNC
Definition rr.h:193
LDNS_RR_TYPE_EID
@ LDNS_RR_TYPE_EID
draft-ietf-nimrod-dns-01.txt
Definition rr.h:140
LDNS_RR_TYPE_AFSDB
@ LDNS_RR_TYPE_AFSDB
RFC1183.
Definition rr.h:114
LDNS_RR_TYPE_L64
@ LDNS_RR_TYPE_L64
Definition rr.h:210
LDNS_RR_TYPE_NSAP
@ LDNS_RR_TYPE_NSAP
RFC1706.
Definition rr.h:122
LDNS_RR_TYPE_URI
@ LDNS_RR_TYPE_URI
Definition rr.h:228
LDNS_RR_TYPE_AVC
@ LDNS_RR_TYPE_AVC
Definition rr.h:230
LDNS_RR_TYPE_CDS
@ LDNS_RR_TYPE_CDS
Definition rr.h:190
LDNS_RR_TYPE_NAPTR
@ LDNS_RR_TYPE_NAPTR
RFC2915.
Definition rr.h:148
LDNS_RR_TYPE_SMIMEA
@ LDNS_RR_TYPE_SMIMEA
Definition rr.h:180
LDNS_RR_TYPE_SRV
@ LDNS_RR_TYPE_SRV
SRV record RFC2782.
Definition rr.h:144
LDNS_RR_TYPE_IPSECKEY
@ LDNS_RR_TYPE_IPSECKEY
IPsec Key.
Definition rr.h:168
LDNS_RR_TYPE_APL
@ LDNS_RR_TYPE_APL
RFC3123.
Definition rr.h:162
LDNS_RR_TYPE_MX
@ LDNS_RR_TYPE_MX
mail exchange
Definition rr.h:108
LDNS_RR_TYPE_NIMLOC
@ LDNS_RR_TYPE_NIMLOC
draft-ietf-nimrod-dns-01.txt
Definition rr.h:142
LDNS_RR_TYPE_MG
@ LDNS_RR_TYPE_MG
a mail group member (EXPERIMENTAL)
Definition rr.h:94
LDNS_RR_TYPE_NSAP_PTR
@ LDNS_RR_TYPE_NSAP_PTR
RFC1348.
Definition rr.h:124
ldns_rr_list
struct ldns_struct_rr_list ldns_rr_list
Definition rr.h:360
ldns_rr_class
enum ldns_enum_rr_class ldns_rr_class
Definition rr.h:61
ldns_rr_owner
ldns_rdf * ldns_rr_owner(const ldns_rr *rr)
returns the owner name of an rr structure.
Definition rr.c:917
LDNS_MAX_DOMAINLEN
#define LDNS_MAX_DOMAINLEN
Maximum length of a complete dname.
Definition rr.h:33
LDNS_RR_CLASS_IN
@ LDNS_RR_CLASS_IN
the Internet
Definition rr.h:47
ldns_rr_descriptor
struct ldns_struct_rr_descriptor ldns_rr_descriptor
Definition rr.h:386
ldns_schwartzian_compare_struct
Structure to do a Schwartzian-like transformation, for instance when sorting.
Definition util.h:166
ldns_schwartzian_compare_struct::original_object
void * original_object
Definition util.h:167
ldns_schwartzian_compare_struct::transformed_object
void * transformed_object
Definition util.h:168
ldns_struct_buffer::_data
uint8_t * _data
The data contained in the buffer.
Definition buffer.h:62
ldns_struct_lookup_table::id
int id
Definition util.h:179
ldns_struct_rr_descriptor::_maximum
uint8_t _maximum
Maximum number of rdata fields in the RRs of this type.
Definition rr.h:376
ldns_struct_rr_descriptor::_name
const char * _name
Textual name of the RR type.
Definition rr.h:372
ldns_struct_rr_descriptor::_variable
ldns_rdf_type _variable
Special rdf types.
Definition rr.h:380
ldns_struct_rr_descriptor::_type
ldns_rr_type _type
Type of the RR that is described here.
Definition rr.h:370
ldns_struct_rr_descriptor::_minimum
uint8_t _minimum
Minimum number of rdata fields in the RRs of this type.
Definition rr.h:374
ldns_struct_rr_descriptor::_wireformat
const ldns_rdf_type * _wireformat
Wireformat specification for the rr, i.e.
Definition rr.h:378
ldns_struct_rr_list::_rr_capacity
size_t _rr_capacity
Definition rr.h:357
ldns_struct_rr_list::_rrs
ldns_rr ** _rrs
Definition rr.h:358
ldns_struct_rr_list::_rr_count
size_t _rr_count
Definition rr.h:356
ldns_struct_rr::_rr_type
ldns_rr_type _rr_type
the type of the RR.
Definition rr.h:335
ldns_struct_rr::_owner
ldns_rdf * _owner
Owner name, uncompressed.
Definition rr.h:329
ldns_struct_rr::_rdata_fields
ldns_rdf ** _rdata_fields
The array of rdata's.
Definition rr.h:340
ldns_struct_rr::_rr_question
signed char _rr_question
question rr [it would be nicer if thous is after _rd_count] ABI change: Fix this in next major releas...
Definition rr.h:344
ldns_struct_rr::_ttl
uint32_t _ttl
Time to live.
Definition rr.h:331
ldns_struct_rr::_rr_class
ldns_rr_class _rr_class
Class of the resource record.
Definition rr.h:337
ldns_struct_rr::_rd_count
size_t _rd_count
Number of data fields.
Definition rr.h:333
ldns_hexstring_to_data
int ldns_hexstring_to_data(uint8_t *data, const char *str)
Converts a hex string to binary data.
Definition util.c:138
ldns_lookup_by_name
ldns_lookup_table * ldns_lookup_by_name(ldns_lookup_table table[], const char *name)
Looks up the table entry by name, returns NULL if not found.
INLINE
#define INLINE
splint static inline workaround
Definition util.h:42
LDNS_FREE
#define LDNS_FREE(ptr)
Definition util.h:60
LDNS_MALLOC
#define LDNS_MALLOC(type)
Memory management macros.
Definition util.h:49
LDNS_XMALLOC
#define LDNS_XMALLOC(type, count)
Definition util.h:51
ldns_lookup_table
struct ldns_struct_lookup_table ldns_lookup_table
Definition util.h:182
LDNS_XREALLOC
#define LDNS_XREALLOC(ptr, type, count)
Definition util.h:57
ldns_wire2rdf
ldns_status ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos)
converts the data on the uint8_t bytearray (in wire format) to DNS rdata fields, and adds them to the...
Definition wire2host.c:156