ldns  1.7.0
Data Structures | Macros | Typedefs | Enumerations | Functions
rr.h File Reference

Contains the definition of ldns_rr and functions to manipulate those. More...

Go to the source code of this file.

Data Structures

struct  ldns_struct_rr
 Resource Record. More...
 
struct  ldns_struct_rr_list
 List or Set of Resource Records. More...
 
struct  ldns_struct_rr_descriptor
 Contains all information about resource record types. More...
 

Macros

#define LDNS_MAX_LABELLEN   63
 Maximum length of a dname label. More...
 
#define LDNS_MAX_DOMAINLEN   255
 Maximum length of a complete dname. More...
 
#define LDNS_MAX_POINTERS   65535
 Maximum number of pointers in 1 dname. More...
 
#define LDNS_RR_OVERHEAD   10
 The bytes TTL, CLASS and length use up in an rr. More...
 
#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON   259
 

Typedefs

typedef enum ldns_enum_rr_class ldns_rr_class
 
typedef enum ldns_enum_rr_compress ldns_rr_compress
 
typedef enum ldns_enum_rr_type ldns_rr_type
 
typedef struct ldns_struct_rr ldns_rr
 
typedef struct ldns_struct_rr_list ldns_rr_list
 
typedef struct ldns_struct_rr_descriptor ldns_rr_descriptor
 

Enumerations

enum  ldns_enum_rr_class {
  LDNS_RR_CLASS_IN = 1, LDNS_RR_CLASS_CH = 3, LDNS_RR_CLASS_HS = 4, LDNS_RR_CLASS_NONE = 254,
  LDNS_RR_CLASS_ANY = 255, LDNS_RR_CLASS_FIRST = 0, LDNS_RR_CLASS_LAST = 65535, LDNS_RR_CLASS_COUNT = LDNS_RR_CLASS_LAST - LDNS_RR_CLASS_FIRST + 1
}
 The different RR classes. More...
 
enum  ldns_enum_rr_compress { LDNS_RR_COMPRESS, LDNS_RR_NO_COMPRESS }
 Used to specify whether compression is allowed. More...
 
enum  ldns_enum_rr_type {
  LDNS_RR_TYPE_A = 1, LDNS_RR_TYPE_NS = 2, LDNS_RR_TYPE_MD = 3, LDNS_RR_TYPE_MF = 4,
  LDNS_RR_TYPE_CNAME = 5, LDNS_RR_TYPE_SOA = 6, LDNS_RR_TYPE_MB = 7, LDNS_RR_TYPE_MG = 8,
  LDNS_RR_TYPE_MR = 9, LDNS_RR_TYPE_NULL = 10, LDNS_RR_TYPE_WKS = 11, LDNS_RR_TYPE_PTR = 12,
  LDNS_RR_TYPE_HINFO = 13, LDNS_RR_TYPE_MINFO = 14, LDNS_RR_TYPE_MX = 15, LDNS_RR_TYPE_TXT = 16,
  LDNS_RR_TYPE_RP = 17, LDNS_RR_TYPE_AFSDB = 18, LDNS_RR_TYPE_X25 = 19, LDNS_RR_TYPE_ISDN = 20,
  LDNS_RR_TYPE_RT = 21, LDNS_RR_TYPE_NSAP = 22, LDNS_RR_TYPE_NSAP_PTR = 23, LDNS_RR_TYPE_SIG = 24,
  LDNS_RR_TYPE_KEY = 25, LDNS_RR_TYPE_PX = 26, LDNS_RR_TYPE_GPOS = 27, LDNS_RR_TYPE_AAAA = 28,
  LDNS_RR_TYPE_LOC = 29, LDNS_RR_TYPE_NXT = 30, LDNS_RR_TYPE_EID = 31, LDNS_RR_TYPE_NIMLOC = 32,
  LDNS_RR_TYPE_SRV = 33, LDNS_RR_TYPE_ATMA = 34, LDNS_RR_TYPE_NAPTR = 35, LDNS_RR_TYPE_KX = 36,
  LDNS_RR_TYPE_CERT = 37, LDNS_RR_TYPE_A6 = 38, LDNS_RR_TYPE_DNAME = 39, LDNS_RR_TYPE_SINK = 40,
  LDNS_RR_TYPE_OPT = 41, LDNS_RR_TYPE_APL = 42, LDNS_RR_TYPE_DS = 43, LDNS_RR_TYPE_SSHFP = 44,
  LDNS_RR_TYPE_IPSECKEY = 45, LDNS_RR_TYPE_RRSIG = 46, LDNS_RR_TYPE_NSEC = 47, LDNS_RR_TYPE_DNSKEY = 48,
  LDNS_RR_TYPE_DHCID = 49, LDNS_RR_TYPE_NSEC3 = 50, LDNS_RR_TYPE_NSEC3PARAM = 51, LDNS_RR_TYPE_NSEC3PARAMS = 51,
  LDNS_RR_TYPE_TLSA = 52, LDNS_RR_TYPE_SMIMEA = 53, LDNS_RR_TYPE_HIP = 55, LDNS_RR_TYPE_NINFO = 56,
  LDNS_RR_TYPE_RKEY = 57, LDNS_RR_TYPE_TALINK = 58, LDNS_RR_TYPE_CDS = 59, LDNS_RR_TYPE_CDNSKEY = 60,
  LDNS_RR_TYPE_OPENPGPKEY = 61, LDNS_RR_TYPE_CSYNC = 62, LDNS_RR_TYPE_SPF = 99, LDNS_RR_TYPE_UINFO = 100,
  LDNS_RR_TYPE_UID = 101, LDNS_RR_TYPE_GID = 102, LDNS_RR_TYPE_UNSPEC = 103, LDNS_RR_TYPE_NID = 104,
  LDNS_RR_TYPE_L32 = 105, LDNS_RR_TYPE_L64 = 106, LDNS_RR_TYPE_LP = 107, LDNS_RR_TYPE_EUI48 = 108,
  LDNS_RR_TYPE_EUI64 = 109, LDNS_RR_TYPE_TKEY = 249, LDNS_RR_TYPE_TSIG = 250, LDNS_RR_TYPE_IXFR = 251,
  LDNS_RR_TYPE_AXFR = 252, LDNS_RR_TYPE_MAILB = 253, LDNS_RR_TYPE_MAILA = 254, LDNS_RR_TYPE_ANY = 255,
  LDNS_RR_TYPE_URI = 256, LDNS_RR_TYPE_CAA = 257, LDNS_RR_TYPE_AVC = 258, LDNS_RR_TYPE_TA = 32768,
  LDNS_RR_TYPE_DLV = 32769, LDNS_RR_TYPE_FIRST = 0, LDNS_RR_TYPE_LAST = 65535, LDNS_RR_TYPE_COUNT = LDNS_RR_TYPE_LAST - LDNS_RR_TYPE_FIRST + 1
}
 The different RR types. More...
 

Functions

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. More...
 
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. More...
 
ldns_rrldns_rr_new (void)
 creates a new rr structure. More...
 
ldns_rrldns_rr_new_frm_type (ldns_rr_type t)
 creates a new rr structure, based on the given type. More...
 
void ldns_rr_free (ldns_rr *rr)
 frees an RR structure More...
 
ldns_status ldns_rr_new_frm_str (ldns_rr **n, const char *str, uint32_t default_ttl, const ldns_rdf *origin, ldns_rdf **prev)
 creates an rr from a string. More...
 
ldns_status ldns_rr_new_question_frm_str (ldns_rr **n, const char *str, const ldns_rdf *origin, ldns_rdf **prev)
 creates an rr for the question section from a string, i.e. More...
 
ldns_status ldns_rr_new_frm_fp (ldns_rr **rr, FILE *fp, uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev)
 creates a new rr from a file containing a string. More...
 
ldns_status ldns_rr_new_frm_fp_l (ldns_rr **rr, 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. More...
 
void ldns_rr_set_owner (ldns_rr *rr, ldns_rdf *owner)
 sets the owner in the rr structure. More...
 
void ldns_rr_set_question (ldns_rr *rr, signed char question)
 sets the question flag in the rr structure. More...
 
void ldns_rr_set_ttl (ldns_rr *rr, uint32_t ttl)
 sets the ttl in the rr structure. More...
 
void ldns_rr_set_rd_count (ldns_rr *rr, size_t count)
 sets the rd_count in the rr. More...
 
void ldns_rr_set_type (ldns_rr *rr, ldns_rr_type rr_type)
 sets the type in the rr. More...
 
void ldns_rr_set_class (ldns_rr *rr, ldns_rr_class rr_class)
 sets the class in the rr. More...
 
ldns_rdfldns_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. More...
 
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. More...
 
ldns_rdfldns_rr_pop_rdf (ldns_rr *rr)
 removes a rd_field member, it will be popped from the last position. More...
 
ldns_rdfldns_rr_rdf (const ldns_rr *rr, size_t nr)
 returns the rdata field member counter. More...
 
ldns_rdfldns_rr_owner (const ldns_rr *rr)
 returns the owner name of an rr structure. More...
 
signed char ldns_rr_is_question (const ldns_rr *rr)
 returns the question flag of an rr structure. More...
 
uint32_t ldns_rr_ttl (const ldns_rr *rr)
 returns the ttl of an rr structure. More...
 
size_t ldns_rr_rd_count (const ldns_rr *rr)
 returns the rd_count of an rr structure. More...
 
ldns_rr_type ldns_rr_get_type (const ldns_rr *rr)
 returns the type of the rr. More...
 
ldns_rr_class ldns_rr_get_class (const ldns_rr *rr)
 returns the class of the rr. More...
 
size_t ldns_rr_list_rr_count (const ldns_rr_list *rr_list)
 returns the number of rr's in an rr_list. More...
 
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. More...
 
ldns_rrldns_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 More...
 
ldns_rrldns_rr_list_rr (const ldns_rr_list *rr_list, size_t nr)
 returns a specific rr of an rrlist. More...
 
ldns_rr_listldns_rr_list_new (void)
 creates a new rr_list structure. More...
 
void ldns_rr_list_free (ldns_rr_list *rr_list)
 frees an rr_list structure. More...
 
void ldns_rr_list_deep_free (ldns_rr_list *rr_list)
 frees an rr_list structure and all rrs contained therein. More...
 
signed char ldns_rr_list_cat (ldns_rr_list *left, const ldns_rr_list *right)
 concatenates two ldns_rr_lists together. More...
 
ldns_rr_listldns_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). More...
 
signed char ldns_rr_list_push_rr (ldns_rr_list *rr_list, const ldns_rr *rr)
 pushes an rr to an rrlist. More...
 
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. More...
 
ldns_rrldns_rr_list_pop_rr (ldns_rr_list *rr_list)
 pops the last rr from an rrlist. More...
 
ldns_rr_listldns_rr_list_pop_rr_list (ldns_rr_list *rr_list, size_t size)
 pops an rr_list of size s from an rrlist. More...
 
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 More...
 
signed char ldns_is_rrset (const ldns_rr_list *rr_list)
 checks if an rr_list is a rrset. More...
 
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). More...
 
ldns_rrldns_rr_set_pop_rr (ldns_rr_list *rr_list)
 pops the last rr from an rrset. More...
 
ldns_rr_listldns_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 next to each other More...
 
ldns_rr_type ldns_get_rr_type_by_name (const char *name)
 retrieves a rrtype by looking up its name. More...
 
ldns_rr_class ldns_get_rr_class_by_name (const char *name)
 retrieves a class by looking up its name. More...
 
ldns_rrldns_rr_clone (const ldns_rr *rr)
 clones a rr and all its data More...
 
ldns_rr_listldns_rr_list_clone (const ldns_rr_list *rrlist)
 clones an rrlist. More...
 
void ldns_rr_list_sort (ldns_rr_list *unsorted)
 sorts an rr_list (canonical wire format). More...
 
int ldns_rr_compare (const ldns_rr *rr1, const ldns_rr *rr2)
 compares two rrs. More...
 
int ldns_rr_compare_no_rdata (const ldns_rr *rr1, const ldns_rr *rr2)
 compares two rrs, up to the rdata. More...
 
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. More...
 
signed char ldns_rr_compare_ds (const ldns_rr *rr1, const ldns_rr *rr2)
 returns true of the given rr's are equal. More...
 
int ldns_rr_list_compare (const ldns_rr_list *rrl1, const ldns_rr_list *rrl2)
 compares two rr listss. More...
 
size_t ldns_rr_uncompressed_size (const ldns_rr *r)
 calculates the uncompressed size of an RR. More...
 
void ldns_rr2canonical (ldns_rr *rr)
 converts each dname in a rr to its canonical form. More...
 
void ldns_rr_list2canonical (const ldns_rr_list *rr_list)
 converts each dname in each rr in a rr_list to its canonical form. More...
 
uint8_t ldns_rr_label_count (const ldns_rr *rr)
 counts the number of labels of the ownername. More...
 
const ldns_rr_descriptorldns_rr_descript (uint16_t type)
 returns the resource record descriptor for the given rr type. More...
 
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. More...
 
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. More...
 
ldns_rdf_type ldns_rr_descriptor_field_type (const ldns_rr_descriptor *descriptor, size_t field)
 returns the rdf type for the given rdata field number of the rr type for the given descriptor. More...
 
ldns_rr_listldns_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. More...
 
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. More...
 
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. More...
 
ldns_rdfldns_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, NULL is returned. More...
 

Detailed Description

Contains the definition of ldns_rr and functions to manipulate those.

Definition in file rr.h.

Macro Definition Documentation

§ LDNS_MAX_LABELLEN

#define LDNS_MAX_LABELLEN   63

Maximum length of a dname label.

Definition at line 31 of file rr.h.

§ LDNS_MAX_DOMAINLEN

#define LDNS_MAX_DOMAINLEN   255

Maximum length of a complete dname.

Definition at line 33 of file rr.h.

§ LDNS_MAX_POINTERS

#define LDNS_MAX_POINTERS   65535

Maximum number of pointers in 1 dname.

Definition at line 35 of file rr.h.

§ LDNS_RR_OVERHEAD

#define LDNS_RR_OVERHEAD   10

The bytes TTL, CLASS and length use up in an rr.

Definition at line 37 of file rr.h.

§ LDNS_RDATA_FIELD_DESCRIPTORS_COMMON

#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON   259

Definition at line 40 of file rr.h.

Typedef Documentation

§ ldns_rr_class

Definition at line 64 of file rr.h.

§ ldns_rr_compress

Definition at line 75 of file rr.h.

§ ldns_rr_type

Definition at line 239 of file rr.h.

§ ldns_rr

typedef struct ldns_struct_rr ldns_rr

Definition at line 322 of file rr.h.

§ ldns_rr_list

Definition at line 336 of file rr.h.

§ ldns_rr_descriptor

Definition at line 362 of file rr.h.

Enumeration Type Documentation

§ ldns_enum_rr_class

The different RR classes.

Enumerator
LDNS_RR_CLASS_IN 

the Internet

LDNS_RR_CLASS_CH 

Chaos class.

LDNS_RR_CLASS_HS 

Hesiod (Dyer 87)

LDNS_RR_CLASS_NONE 

None class, dynamic update.

LDNS_RR_CLASS_ANY 

Any class.

LDNS_RR_CLASS_FIRST 
LDNS_RR_CLASS_LAST 
LDNS_RR_CLASS_COUNT 

Definition at line 47 of file rr.h.

§ ldns_enum_rr_compress

Used to specify whether compression is allowed.

Enumerator
LDNS_RR_COMPRESS 

compression is allowed

LDNS_RR_NO_COMPRESS 

Definition at line 69 of file rr.h.

§ ldns_enum_rr_type

The different RR types.

Enumerator
LDNS_RR_TYPE_A 

a host address

LDNS_RR_TYPE_NS 

an authoritative name server

LDNS_RR_TYPE_MD 

a mail destination (Obsolete - use MX)

LDNS_RR_TYPE_MF 

a mail forwarder (Obsolete - use MX)

LDNS_RR_TYPE_CNAME 

the canonical name for an alias

LDNS_RR_TYPE_SOA 

marks the start of a zone of authority

LDNS_RR_TYPE_MB 

a mailbox domain name (EXPERIMENTAL)

LDNS_RR_TYPE_MG 

a mail group member (EXPERIMENTAL)

LDNS_RR_TYPE_MR 

a mail rename domain name (EXPERIMENTAL)

LDNS_RR_TYPE_NULL 

a null RR (EXPERIMENTAL)

LDNS_RR_TYPE_WKS 

a well known service description

LDNS_RR_TYPE_PTR 

a domain name pointer

LDNS_RR_TYPE_HINFO 

host information

LDNS_RR_TYPE_MINFO 

mailbox or mail list information

LDNS_RR_TYPE_MX 

mail exchange

LDNS_RR_TYPE_TXT 

text strings

LDNS_RR_TYPE_RP 

RFC1183.

LDNS_RR_TYPE_AFSDB 

RFC1183.

LDNS_RR_TYPE_X25 

RFC1183.

LDNS_RR_TYPE_ISDN 

RFC1183.

LDNS_RR_TYPE_RT 

RFC1183.

LDNS_RR_TYPE_NSAP 

RFC1706.

LDNS_RR_TYPE_NSAP_PTR 

RFC1348.

LDNS_RR_TYPE_SIG 

2535typecode

LDNS_RR_TYPE_KEY 

2535typecode

LDNS_RR_TYPE_PX 

RFC2163.

LDNS_RR_TYPE_GPOS 

RFC1712.

LDNS_RR_TYPE_AAAA 

ipv6 address

LDNS_RR_TYPE_LOC 

LOC record RFC1876.

LDNS_RR_TYPE_NXT 

2535typecode

LDNS_RR_TYPE_EID 

draft-ietf-nimrod-dns-01.txt

LDNS_RR_TYPE_NIMLOC 

draft-ietf-nimrod-dns-01.txt

LDNS_RR_TYPE_SRV 

SRV record RFC2782.

LDNS_RR_TYPE_ATMA 

http://www.jhsoft.com/rfc/af-saa-0069.000.rtf

LDNS_RR_TYPE_NAPTR 

RFC2915.

LDNS_RR_TYPE_KX 

RFC2230.

LDNS_RR_TYPE_CERT 

RFC2538.

LDNS_RR_TYPE_A6 

RFC2874.

LDNS_RR_TYPE_DNAME 

RFC2672.

LDNS_RR_TYPE_SINK 

dnsind-kitchen-sink-02.txt

LDNS_RR_TYPE_OPT 

Pseudo OPT record...

LDNS_RR_TYPE_APL 

RFC3123.

LDNS_RR_TYPE_DS 

RFC4034, RFC3658.

LDNS_RR_TYPE_SSHFP 

SSH Key Fingerprint.

LDNS_RR_TYPE_IPSECKEY 

IPsec Key.

LDNS_RR_TYPE_RRSIG 

DNSSEC.

LDNS_RR_TYPE_NSEC 
LDNS_RR_TYPE_DNSKEY 
LDNS_RR_TYPE_DHCID 
LDNS_RR_TYPE_NSEC3 
LDNS_RR_TYPE_NSEC3PARAM 
LDNS_RR_TYPE_NSEC3PARAMS 
LDNS_RR_TYPE_TLSA 
LDNS_RR_TYPE_SMIMEA 
LDNS_RR_TYPE_HIP 
LDNS_RR_TYPE_NINFO 

draft-reid-dnsext-zs

LDNS_RR_TYPE_RKEY 

draft-reid-dnsext-rkey

LDNS_RR_TYPE_TALINK 

draft-ietf-dnsop-trust-history

LDNS_RR_TYPE_CDS 
LDNS_RR_TYPE_CDNSKEY 
LDNS_RR_TYPE_OPENPGPKEY 
LDNS_RR_TYPE_CSYNC 
LDNS_RR_TYPE_SPF 
LDNS_RR_TYPE_UINFO 
LDNS_RR_TYPE_UID 
LDNS_RR_TYPE_GID 
LDNS_RR_TYPE_UNSPEC 
LDNS_RR_TYPE_NID 
LDNS_RR_TYPE_L32 
LDNS_RR_TYPE_L64 
LDNS_RR_TYPE_LP 
LDNS_RR_TYPE_EUI48 
LDNS_RR_TYPE_EUI64 
LDNS_RR_TYPE_TKEY 
LDNS_RR_TYPE_TSIG 
LDNS_RR_TYPE_IXFR 
LDNS_RR_TYPE_AXFR 
LDNS_RR_TYPE_MAILB 

A request for mailbox-related records (MB, MG or MR)

LDNS_RR_TYPE_MAILA 

A request for mail agent RRs (Obsolete - see MX)

LDNS_RR_TYPE_ANY 

any type (wildcard)

LDNS_RR_TYPE_URI 
LDNS_RR_TYPE_CAA 
LDNS_RR_TYPE_AVC 
LDNS_RR_TYPE_TA 

DNSSEC Trust Authorities.

LDNS_RR_TYPE_DLV 
LDNS_RR_TYPE_FIRST 
LDNS_RR_TYPE_LAST 
LDNS_RR_TYPE_COUNT 

Definition at line 80 of file rr.h.

Function Documentation

§ 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.

Parameters
[out]rdfthe constructed rdf
Returns
LDNS_STATUS_OK if all went well.

Definition at line 2554 of file rr.c.

§ 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.

Parameters
[out]rdfthe constructed rdf
Returns
LDNS_STATUS_OK if all went well.

Definition at line 2560 of file rr.c.

§ ldns_rr_new()

ldns_rr* ldns_rr_new ( void  )

§ ldns_rr_new_frm_type()

ldns_rr* ldns_rr_new_frm_type ( ldns_rr_type  t)

§ ldns_rr_free()

void ldns_rr_free ( ldns_rr rr)

frees an RR structure

Parameters
[in]*rrthe RR to be freed
Returns
void

Definition at line 75 of file rr.c.

References ldns_struct_rr::_rdata_fields, INLINE, LDNS_FREE, ldns_rdf_deep_free(), ldns_rr_owner(), ldns_rr_rd_count(), and ldns_rr_rdf().

§ ldns_rr_new_frm_str()

ldns_status ldns_rr_new_frm_str ( ldns_rr **  n,
const char *  str,
uint32_t  default_ttl,
const ldns_rdf origin,
ldns_rdf **  prev 
)

creates an rr from a string.

The string should be a fully filled-in rr, like ownername <space> TTL <space> CLASS <space> TYPE <space> RDATA.

Parameters
[out]nthe rr to return
[in]strthe string to convert
[in]default_ttldefault ttl value for the rr. If 0 DEF_TTL will be used
[in]originwhen the owner is relative add this. The caller must ldns_rdf_deep_free it.
[out]prevthe previous ownername. if this value is not NULL, the function overwrites this with the ownername found in this string. The caller must then ldns_rdf_deep_free it.
Returns
a status msg describing an error or LDNS_STATUS_OK

Definition at line 659 of file rr.c.

§ ldns_rr_new_question_frm_str()

ldns_status ldns_rr_new_question_frm_str ( ldns_rr **  n,
const char *  str,
const ldns_rdf origin,
ldns_rdf **  prev 
)

creates an rr for the question section from a string, i.e.

without RDATA fields Origin and previous RR functionality are the same as in ldns_rr_new_frm_str()

Parameters
[out]nthe rr to return
[in]strthe string to convert
[in]originwhen the owner is relative add this. The caller must ldns_rdf_deep_free it.
prevthe previous ownername. the function overwrite this with the current found ownername. The caller must ldns_rdf_deep_free it.
Returns
a status msg describing an error or LDNS_STATUS_OK

Definition at line 672 of file rr.c.

§ ldns_rr_new_frm_fp()

ldns_status ldns_rr_new_frm_fp ( ldns_rr **  rr,
FILE *  fp,
uint32_t *  default_ttl,
ldns_rdf **  origin,
ldns_rdf **  prev 
)

creates a new rr from a file containing a string.

Parameters
[out]rrthe new rr
[in]fpthe file pointer to use
[in]default_ttlpointer to a default ttl for the rr. If NULL DEF_TTL will be used the pointer will be updated if the file contains a $TTL directive
[in]originwhen the owner is relative add this the pointer will be updated if the file contains a $ORIGIN directive The caller must ldns_rdf_deep_free it.
[in]prevwhen the owner is whitespaces use this as the * ownername the pointer will be updated after the call The caller must ldns_rdf_deep_free it.
Returns
a ldns_status with an error or LDNS_STATUS_OK

Definition at line 700 of file rr.c.

References ldns_rr_new_frm_fp_l().

§ ldns_rr_new_frm_fp_l()

ldns_status ldns_rr_new_frm_fp_l ( ldns_rr **  rr,
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.

Parameters
[out]rrthe new rr
[in]fpthe file pointer to use
[in]default_ttla default ttl for the rr. If NULL DEF_TTL will be used the pointer will be updated if the file contains a $TTL directive
[in]originwhen the owner is relative add this the pointer will be updated if the file contains a $ORIGIN directive The caller must ldns_rdf_deep_free it.
[in]line_nrpointer to an integer containing the current line number (for debugging purposes)
[in]prevwhen the owner is whitespaces use this as the * ownername the pointer will be updated after the call The caller must ldns_rdf_deep_free it.
Returns
a ldns_status with an error or LDNS_STATUS_OK

Definition at line 706 of file rr.c.

References ldns_fget_token_l(), LDNS_FREE, LDNS_MAX_LINELEN, LDNS_PARSE_SKIP_SPACE, ldns_rdf_deep_free(), ldns_rdf_new_frm_str(), LDNS_RDF_TYPE_DNAME, LDNS_STATUS_MEM_ERR, LDNS_STATUS_SYNTAX_EMPTY, LDNS_STATUS_SYNTAX_ERR, and LDNS_XMALLOC.

§ ldns_rr_set_owner()

void ldns_rr_set_owner ( ldns_rr rr,
ldns_rdf owner 
)

sets the owner in the rr structure.

Parameters
[in]*rrrr to operate on
[in]*ownerset to this owner
Returns
void

Definition at line 790 of file rr.c.

References ldns_struct_rr::_owner.

§ ldns_rr_set_question()

void ldns_rr_set_question ( ldns_rr rr,
signed char  question 
)

sets the question flag in the rr structure.

Parameters
[in]*rrrr to operate on
[in]questionquestion flag
Returns
void

§ ldns_rr_set_ttl()

void ldns_rr_set_ttl ( ldns_rr rr,
uint32_t  ttl 
)

sets the ttl in the rr structure.

Parameters
[in]*rrrr to operate on
[in]ttlset to this ttl
Returns
void

Definition at line 802 of file rr.c.

References ldns_struct_rr::_ttl.

§ ldns_rr_set_rd_count()

void ldns_rr_set_rd_count ( ldns_rr rr,
size_t  count 
)

sets the rd_count in the rr.

Parameters
[in]*rrrr to operate on
[in]countset to this count
Returns
void

Definition at line 808 of file rr.c.

References ldns_struct_rr::_rd_count.

§ ldns_rr_set_type()

void ldns_rr_set_type ( ldns_rr rr,
ldns_rr_type  rr_type 
)

sets the type in the rr.

Parameters
[in]*rrrr to operate on
[in]rr_typeset to this type
Returns
void

Definition at line 814 of file rr.c.

References ldns_struct_rr::_rr_type.

§ ldns_rr_set_class()

void ldns_rr_set_class ( ldns_rr rr,
ldns_rr_class  rr_class 
)

sets the class in the rr.

Parameters
[in]*rrrr to operate on
[in]rr_classset to this class
Returns
void

Definition at line 820 of file rr.c.

References ldns_struct_rr::_rr_class.

§ 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.

The old value is returned, like pop.

Parameters
[in]*rrthe rr to operate on
[in]*fthe rdf to set
[in]positionthe position the set the rdf
Returns
the old value in the rr, NULL on failyre

Definition at line 826 of file rr.c.

References ldns_struct_rr::_rdata_fields, and ldns_rr_rd_count().

§ 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.

Parameters
[in]*rrrr to operate on
[in]*fthe data field member to set
Returns
bool

Definition at line 843 of file rr.c.

References ldns_struct_rr::_rdata_fields, ldns_rr_rd_count(), ldns_rr_set_rd_count(), and LDNS_XREALLOC.

§ 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.

Parameters
[in]*rrrr to operate on
Returns
rdf which was popped (null if nothing)

Definition at line 866 of file rr.c.

References ldns_struct_rr::_rdata_fields, LDNS_FREE, ldns_rr_rd_count(), ldns_rr_set_rd_count(), and LDNS_XREALLOC.

§ ldns_rr_rdf()

ldns_rdf* ldns_rr_rdf ( const ldns_rr rr,
size_t  nr 
)

returns the rdata field member counter.

Parameters
[in]*rrrr to operate on
[in]nrthe number of the rdf to return
Returns
ldns_rdf *

Definition at line 895 of file rr.c.

References ldns_struct_rr::_rdata_fields, and ldns_rr_rd_count().

§ ldns_rr_owner()

ldns_rdf* ldns_rr_owner ( const ldns_rr rr)

returns the owner name of an rr structure.

Parameters
[in]*rrrr to operate on
Returns
ldns_rdf *

Definition at line 905 of file rr.c.

References ldns_struct_rr::_owner.

§ ldns_rr_is_question()

signed char ldns_rr_is_question ( const ldns_rr rr)

returns the question flag of an rr structure.

Parameters
[in]*rrrr to operate on
Returns
bool true if question

Definition at line 911 of file rr.c.

References ldns_struct_rr::_rr_question.

§ ldns_rr_ttl()

uint32_t ldns_rr_ttl ( const ldns_rr rr)

returns the ttl of an rr structure.

Parameters
[in]*rrthe rr to read from
Returns
the ttl of the rr

Definition at line 917 of file rr.c.

References ldns_struct_rr::_ttl.

§ ldns_rr_rd_count()

size_t ldns_rr_rd_count ( const ldns_rr rr)

returns the rd_count of an rr structure.

Parameters
[in]*rrthe rr to read from
Returns
the rd count of the rr

Definition at line 923 of file rr.c.

References ldns_struct_rr::_rd_count.

§ ldns_rr_get_type()

ldns_rr_type ldns_rr_get_type ( const ldns_rr rr)

returns the type of the rr.

Parameters
[in]*rrthe rr to read from
Returns
the type of the rr

Definition at line 929 of file rr.c.

References ldns_struct_rr::_rr_type.

§ ldns_rr_get_class()

ldns_rr_class ldns_rr_get_class ( const ldns_rr rr)

returns the class of the rr.

Parameters
[in]*rrthe rr to read from
Returns
the class of the rr

Definition at line 935 of file rr.c.

References ldns_struct_rr::_rr_class.

§ 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.

Parameters
[in]rr_listthe rr_list to read from
Returns
the number of rr's

Definition at line 943 of file rr.c.

References ldns_struct_rr_list::_rr_count.

§ 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.

Parameters
[in]rr_listthe rr_list to set the count on
[in]countthe number of rr in this list
Returns
void

Definition at line 969 of file rr.c.

References ldns_struct_rr_list::_rr_count.

§ 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

Parameters
[in]rr_listthe rr_list to use
[in]rthe rr to set
[in]countindex into the rr_list
Returns
the old rr which was stored in the rr_list, or NULL is the index was too large set a specific rr

Definition at line 953 of file rr.c.

References ldns_struct_rr_list::_rrs, ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ 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.

Parameters
[in]rr_listthe rr_list to read from
[in]nrreturn this rr
Returns
the rr at position nr

Definition at line 976 of file rr.c.

References ldns_struct_rr_list::_rrs, and ldns_rr_list_rr_count().

§ ldns_rr_list_new()

ldns_rr_list* ldns_rr_list_new ( void  )

creates a new rr_list structure.

Returns
a new rr_list structure

Definition at line 986 of file rr.c.

References ldns_struct_rr_list::_rr_capacity, ldns_struct_rr_list::_rr_count, ldns_struct_rr_list::_rrs, and LDNS_MALLOC.

§ ldns_rr_list_free()

void ldns_rr_list_free ( ldns_rr_list rr_list)

frees an rr_list structure.

Parameters
[in]rr_listthe list to free

Definition at line 997 of file rr.c.

References ldns_struct_rr_list::_rrs, and LDNS_FREE.

§ 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.

Parameters
[in]rr_listthe list to free

Definition at line 1006 of file rr.c.

References ldns_struct_rr_list::_rrs, LDNS_FREE, ldns_rr_free(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ 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.

This modifies *left (to extend it and add the pointers from *right).

Parameters
[in]leftthe leftside
[in]rightthe rightside
Returns
a left with right concatenated to it

Definition at line 1022 of file rr.c.

References ldns_rr_list_push_rr(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ 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).

Parameters
[in]leftthe leftside
[in]rightthe rightside
Returns
a new rr_list with leftside/rightside concatenated

Definition at line 1045 of file rr.c.

References ldns_rr_clone(), ldns_rr_list_clone(), ldns_rr_list_new(), ldns_rr_list_push_rr(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ 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.

Parameters
[in]rr_listthe rr_list to push to
[in]rrthe rr to push
Returns
false on error, otherwise true

Definition at line 1118 of file rr.c.

References ldns_struct_rr_list::_rr_capacity, ldns_struct_rr_list::_rrs, ldns_rr_list_rr_count(), ldns_rr_list_set_rr_count(), LDNS_RRLIST_INIT, and LDNS_XREALLOC.

§ 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.

Parameters
[in]rr_listthe rr_list to push to
[in]push_listthe rr_list to push
Returns
false on error, otherwise true

Definition at line 1149 of file rr.c.

References ldns_rr_list_push_rr(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ ldns_rr_list_pop_rr()

ldns_rr* ldns_rr_list_pop_rr ( ldns_rr_list rr_list)

pops the last rr from an rrlist.

Parameters
[in]rr_listthe rr_list to pop from
Returns
NULL if nothing to pop. Otherwise the popped RR

Definition at line 1163 of file rr.c.

References ldns_struct_rr_list::_rr_capacity, ldns_struct_rr_list::_rrs, ldns_rr_list_rr(), ldns_rr_list_rr_count(), ldns_rr_list_set_rr_count(), LDNS_RRLIST_INIT, and LDNS_XREALLOC.

§ ldns_rr_list_pop_rr_list()

ldns_rr_list* ldns_rr_list_pop_rr_list ( ldns_rr_list rr_list,
size_t  size 
)

pops an rr_list of size s from an rrlist.

Parameters
[in]rr_listthe rr_list to pop from
[in]sizethe number of rr's to pop
Returns
NULL if nothing to pop. Otherwise the popped rr_list

Definition at line 1195 of file rr.c.

References ldns_rr_list_free(), ldns_rr_list_new(), ldns_rr_list_pop_rr(), and ldns_rr_list_push_rr().

§ 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

Parameters
[in]rr_listthe rr_list to check
[in]rrthe rr to check
Returns
true if rr_list contains rr, false otherwise

Definition at line 1225 of file rr.c.

References ldns_rr_compare(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ ldns_is_rrset()

signed char ldns_is_rrset ( const ldns_rr_list rr_list)

checks if an rr_list is a rrset.

Parameters
[in]rr_listthe rr_list to check
Returns
true if it is an rrset otherwise false

Definition at line 1244 of file rr.c.

References ldns_rdf_compare(), ldns_rr_get_class(), ldns_rr_get_type(), ldns_rr_list_rr(), ldns_rr_list_rr_count(), and ldns_rr_owner().

§ 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).

Parameters
[in]*rr_listthe rrset to push the rr to
[in]*rrthe rr to push
Returns
true if the push succeeded otherwise false

Definition at line 1279 of file rr.c.

References ldns_rdf_compare(), ldns_rr_compare(), ldns_rr_get_class(), ldns_rr_get_type(), ldns_rr_list_push_rr(), ldns_rr_list_rr(), ldns_rr_list_rr_count(), ldns_rr_owner(), ldns_rr_ttl(), and LDNS_RR_TYPE_RRSIG.

§ ldns_rr_set_pop_rr()

ldns_rr* ldns_rr_set_pop_rr ( ldns_rr_list rr_list)

pops the last rr from an rrset.

This function is there only for the symmetry.

Parameters
[in]rr_listthe rr_list to pop from
Returns
NULL if nothing to pop. Otherwise the popped RR

Definition at line 1327 of file rr.c.

References ldns_rr_list_pop_rr().

§ 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 next to each other

Definition at line 1333 of file rr.c.

References ldns_rdf_compare(), ldns_rr_get_class(), ldns_rr_get_type(), ldns_rr_list_free(), ldns_rr_list_new(), ldns_rr_list_pop_rr(), ldns_rr_list_push_rr(), ldns_rr_list_rr(), ldns_rr_list_rr_count(), and ldns_rr_owner().

§ 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.

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

Definition at line 2627 of file rr.c.

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

§ 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.

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

Definition at line 2667 of file rr.c.

References ldns_struct_lookup_table::id, ldns_lookup_by_name(), and ldns_rr_classes.

§ ldns_rr_clone()

ldns_rr* ldns_rr_clone ( const ldns_rr rr)

§ ldns_rr_list_clone()

ldns_rr_list* ldns_rr_list_clone ( const ldns_rr_list rrlist)

clones an rrlist.

Parameters
[in]rrlistthe rrlist to clone
Returns
the cloned rr list

Definition at line 1416 of file rr.c.

References ldns_rr_clone(), ldns_rr_list_deep_free(), ldns_rr_list_new(), ldns_rr_list_push_rr(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ ldns_rr_list_sort()

void ldns_rr_list_sort ( ldns_rr_list unsorted)

sorts an rr_list (canonical wire format).

the sorting is done inband.

Parameters
[in]unsortedthe rr_list to be sorted
Returns
void

Definition at line 1501 of file rr.c.

References LDNS_FREE, ldns_rr_list_rr(), ldns_rr_list_rr_count(), LDNS_XMALLOC, ldns_schwartzian_compare_struct::original_object, and ldns_schwartzian_compare_struct::transformed_object.

§ ldns_rr_compare()

int ldns_rr_compare ( const ldns_rr rr1,
const ldns_rr rr2 
)

compares two rrs.

The TTL is not looked at.

Parameters
[in]rr1the first one
[in]rr2the second one
Returns
0 if equal -1 if rr1 comes before rr2 +1 if rr2 comes before rr1

Definition at line 1623 of file rr.c.

References ldns_buffer_free(), ldns_buffer_new(), ldns_rr2buffer_wire_canonical(), ldns_rr_compare_no_rdata(), ldns_rr_compare_wire(), ldns_rr_uncompressed_size(), LDNS_SECTION_ANY, and LDNS_STATUS_OK.

§ 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.

Parameters
[in]rr1the first one
[in]rr2the second one
Returns
0 if equal -1 if rr1 comes before rr2 +1 if rr2 comes before rr1

Definition at line 1544 of file rr.c.

References ldns_dname_compare(), ldns_rdf_size(), ldns_rr_get_class(), ldns_rr_get_type(), ldns_rr_owner(), and ldns_rr_uncompressed_size().

§ 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.

Parameters
[in]rr1_bufthe first one
[in]rr2_bufthe second one
Returns
0 if equal -1 if rr1_buf comes before rr2_buf +1 if rr2_buf comes before rr1_buf

Definition at line 1585 of file rr.c.

§ ldns_rr_compare_ds()

signed char ldns_rr_compare_ds ( const ldns_rr rr1,
const ldns_rr rr2 
)

returns true of the given rr's are equal.

Also returns true if one record is a DS that represents the same DNSKEY record as the other record

Parameters
[in]rr1the first rr
[in]rr2the second rr
Returns
true if equal otherwise false

Definition at line 1695 of file rr.c.

References ldns_rr_clone(), ldns_rr_get_type(), ldns_rr_set_ttl(), LDNS_RR_TYPE_DNSKEY, and LDNS_RR_TYPE_DS.

§ ldns_rr_list_compare()

int ldns_rr_list_compare ( const ldns_rr_list rrl1,
const ldns_rr_list rrl2 
)

compares two rr listss.

Parameters
[in]rrl1the first one
[in]rrl2the second one
Returns
0 if equal -1 if rrl1 comes before rrl2 +1 if rrl2 comes before rrl1

Definition at line 1722 of file rr.c.

References ldns_rr_compare(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ ldns_rr_uncompressed_size()

size_t ldns_rr_uncompressed_size ( const ldns_rr r)

calculates the uncompressed size of an RR.

Parameters
[in]rthe rr to operate on
Returns
size of the rr

Definition at line 1749 of file rr.c.

References ldns_rdf_size(), LDNS_RR_OVERHEAD, ldns_rr_owner(), ldns_rr_rd_count(), and ldns_rr_rdf().

§ ldns_rr2canonical()

void ldns_rr2canonical ( ldns_rr rr)

§ 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.

Parameters
[in]rr_listthe rr_list to work on
Returns
void

Definition at line 1818 of file rr.c.

References ldns_rr2canonical(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ ldns_rr_label_count()

uint8_t ldns_rr_label_count ( const ldns_rr rr)

counts the number of labels of the ownername.

Parameters
[in]rrcount the labels of this rr
Returns
the number of labels

Definition at line 1827 of file rr.c.

References ldns_dname_label_count(), LDNS_RDF_TYPE_A, LDNS_RDF_TYPE_AAAA, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_APL, LDNS_RDF_TYPE_ATMA, LDNS_RDF_TYPE_B64, LDNS_RDF_TYPE_CERT_ALG, LDNS_RDF_TYPE_CERTIFICATE_USAGE, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_EUI48, LDNS_RDF_TYPE_EUI64, LDNS_RDF_TYPE_HEX, LDNS_RDF_TYPE_HIP, LDNS_RDF_TYPE_ILNP64, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT16_DATA, LDNS_RDF_TYPE_INT32, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_IPSECKEY, LDNS_RDF_TYPE_LOC, LDNS_RDF_TYPE_LONG_STR, LDNS_RDF_TYPE_MATCHING_TYPE, LDNS_RDF_TYPE_NONE, LDNS_RDF_TYPE_NSAP, LDNS_RDF_TYPE_NSEC, LDNS_RDF_TYPE_NSEC3_NEXT_OWNER, LDNS_RDF_TYPE_NSEC3_SALT, LDNS_RDF_TYPE_PERIOD, LDNS_RDF_TYPE_SELECTOR, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_TAG, LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_TSIGTIME, LDNS_RDF_TYPE_TYPE, LDNS_RDF_TYPE_UNKNOWN, LDNS_RDF_TYPE_WKS, LDNS_RR_COMPRESS, LDNS_RR_NO_COMPRESS, ldns_rr_owner(), LDNS_RR_TYPE_A, LDNS_RR_TYPE_A6, LDNS_RR_TYPE_AAAA, LDNS_RR_TYPE_AFSDB, LDNS_RR_TYPE_APL, LDNS_RR_TYPE_ATMA, LDNS_RR_TYPE_AVC, LDNS_RR_TYPE_CAA, LDNS_RR_TYPE_CDNSKEY, LDNS_RR_TYPE_CDS, LDNS_RR_TYPE_CERT, LDNS_RR_TYPE_CNAME, LDNS_RR_TYPE_CSYNC, LDNS_RR_TYPE_DHCID, LDNS_RR_TYPE_DLV, LDNS_RR_TYPE_DNAME, LDNS_RR_TYPE_DNSKEY, LDNS_RR_TYPE_DS, LDNS_RR_TYPE_EID, LDNS_RR_TYPE_EUI48, LDNS_RR_TYPE_EUI64, LDNS_RR_TYPE_GPOS, LDNS_RR_TYPE_HINFO, LDNS_RR_TYPE_HIP, LDNS_RR_TYPE_IPSECKEY, LDNS_RR_TYPE_ISDN, LDNS_RR_TYPE_KEY, LDNS_RR_TYPE_KX, LDNS_RR_TYPE_L32, LDNS_RR_TYPE_L64, LDNS_RR_TYPE_LOC, LDNS_RR_TYPE_LP, LDNS_RR_TYPE_MB, LDNS_RR_TYPE_MD, LDNS_RR_TYPE_MF, LDNS_RR_TYPE_MG, LDNS_RR_TYPE_MINFO, LDNS_RR_TYPE_MR, LDNS_RR_TYPE_MX, LDNS_RR_TYPE_NAPTR, LDNS_RR_TYPE_NID, LDNS_RR_TYPE_NIMLOC, LDNS_RR_TYPE_NINFO, LDNS_RR_TYPE_NS, LDNS_RR_TYPE_NSAP, LDNS_RR_TYPE_NSAP_PTR, LDNS_RR_TYPE_NSEC, LDNS_RR_TYPE_NSEC3, LDNS_RR_TYPE_NSEC3PARAM, LDNS_RR_TYPE_NULL, LDNS_RR_TYPE_NXT, LDNS_RR_TYPE_OPENPGPKEY, LDNS_RR_TYPE_OPT, LDNS_RR_TYPE_PTR, LDNS_RR_TYPE_PX, LDNS_RR_TYPE_RKEY, LDNS_RR_TYPE_RP, LDNS_RR_TYPE_RRSIG, LDNS_RR_TYPE_RT, LDNS_RR_TYPE_SIG, LDNS_RR_TYPE_SINK, LDNS_RR_TYPE_SMIMEA, LDNS_RR_TYPE_SOA, LDNS_RR_TYPE_SPF, LDNS_RR_TYPE_SRV, LDNS_RR_TYPE_SSHFP, LDNS_RR_TYPE_TA, LDNS_RR_TYPE_TALINK, LDNS_RR_TYPE_TKEY, LDNS_RR_TYPE_TLSA, LDNS_RR_TYPE_TSIG, LDNS_RR_TYPE_TXT, LDNS_RR_TYPE_URI, LDNS_RR_TYPE_WKS, and LDNS_RR_TYPE_X25.

§ ldns_rr_descript()

const ldns_rr_descriptor* ldns_rr_descript ( uint16_t  type)

returns the resource record descriptor for the given rr type.

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

Definition at line 2569 of file rr.c.

References LDNS_RDATA_FIELD_DESCRIPTORS_COMMON, and LDNS_RDATA_FIELD_DESCRIPTORS_COUNT.

§ 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.

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

Definition at line 2588 of file rr.c.

References ldns_struct_rr_descriptor::_minimum.

§ 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.

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

Definition at line 2598 of file rr.c.

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

§ ldns_rr_descriptor_field_type()

ldns_rdf_type ldns_rr_descriptor_field_type ( const ldns_rr_descriptor descriptor,
size_t  field 
)

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

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

Definition at line 2613 of file rr.c.

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

§ 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.

Think type-covered stuff for RRSIG

Parameters
[in]lthe rr_list to look in
[in]rthe rdf to use for the comparison
[in]posat which position can we find the rdf
Returns
a new rr list with only the RRs that match

Definition at line 1084 of file rr.c.

References ldns_rdf_compare(), ldns_rr_clone(), ldns_rr_list_deep_free(), ldns_rr_list_free(), ldns_rr_list_new(), ldns_rr_list_push_rr(), ldns_rr_list_rr(), ldns_rr_list_rr_count(), and ldns_rr_rdf().

§ 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.

This is useful in the case when inspecting the rrtype covered field of an RRSIG.

Parameters
[in]rdthe rdf to look at
Returns
a ldns_rr_type with equivalent LDNS_RR_TYPE

Definition at line 2687 of file rr.c.

References ldns_rdf2native_int16(), ldns_rdf_get_type(), and LDNS_RDF_TYPE_TYPE.

§ 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.

Parameters
[in]rr_listThe rr list
Returns
rr_type of the first element, or 0 if the list is empty

Definition at line 2704 of file rr.c.

References ldns_rr_get_type(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

§ 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, NULL is returned.

Parameters
[in]rr_listThe rr list
Returns
dname of the first element, or NULL if the list is empty

Definition at line 2714 of file rr.c.

References ldns_rr_list_rr(), ldns_rr_list_rr_count(), and ldns_rr_owner().