rr.h File Reference

Go to the source code of this file.

Data Structures

struct  ldns_struct_rr
 Resource Record type. More...
struct  ldns_struct_rr_list
 Resource Record Set. More...
struct  ldns_struct_rr_descriptor
 struct to hold the whole set of rd_fields. More...

Defines

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

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 ldns_struct_rr ldns_rr
typedef ldns_struct_rr_list ldns_rr_list
typedef 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_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_UINFO = 100, LDNS_RR_TYPE_UID = 101, LDNS_RR_TYPE_GID = 102, LDNS_RR_TYPE_UNSPEC = 103,
  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_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_rrldns_rr_new (void)
 creates a new rr structure.
ldns_rrldns_rr_new_frm_type (ldns_rr_type t)
 creates a new rr structure, based on the given type.
void ldns_rr_free (ldns_rr *rr)
 frees an RR structure
ldns_rrldns_rr_new_frm_str (const char *str, uint16_t default_ttl, ldns_rdf *origin)
 creates an rr from a string.
ldns_rrldns_rr_new_frm_fp (FILE *fp, uint16_t *default_ttl, ldns_rdf **origin)
 creates a new rr from a file containing a string.
ldns_rrldns_rr_new_frm_fp_l (FILE *fp, uint16_t *default_ttl, ldns_rdf **origin, int *line_nr)
 creates a new rr from a file containing a string.
void ldns_rr_set_owner (ldns_rr *rr, ldns_rdf *owner)
 sets the owner in the rr structure.
void ldns_rr_set_ttl (ldns_rr *rr, uint32_t ttl)
 sets the ttl in the rr structure.
void ldns_rr_set_rd_count (ldns_rr *rr, size_t count)
 sets the rd_count in the rr.
void ldns_rr_set_type (ldns_rr *rr, ldns_rr_type rr_type)
 sets the type in the rr.
void ldns_rr_set_class (ldns_rr *rr, ldns_rr_class rr_class)
 sets the class in the rr.
ldns_rdfldns_rr_set_rdf (ldns_rr *rr, ldns_rdf *f, size_t position)
 sets a rdf member, it will be set on the position given.
bool ldns_rr_push_rdf (ldns_rr *rr, ldns_rdf *f)
 sets rd_field member, it will be placed in the next available spot.
ldns_rdfldns_rr_pop_rdf (ldns_rr *rr)
 removes a rd_field member, it will be popped from the last position.
ldns_rdfldns_rr_rdf (const ldns_rr *rr, size_t nr)
 returns the rdata field member counter.
ldns_rdfldns_rr_owner (const ldns_rr *rr)
 returns the owner name of an rr structure.
uint32_t ldns_rr_ttl (const ldns_rr *rr)
 returns the ttl of an rr structure.
size_t ldns_rr_rd_count (const ldns_rr *rr)
 returns the rd_count of an rr structure.
ldns_rr_type ldns_rr_get_type (const ldns_rr *rr)
 returns the type of the rr.
ldns_rr_class ldns_rr_get_class (const ldns_rr *rr)
 returns the class of the rr.
size_t ldns_rr_list_rr_count (ldns_rr_list *rr_list)
 returns the number of rr's in an rr_list.
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.
ldns_rrldns_rr_list_set_rr (ldns_rr_list *rr_list, ldns_rr *r, size_t count)
ldns_rrldns_rr_list_rr (ldns_rr_list *rr_list, size_t nr)
 returns a specific rr of an rrlist.
ldns_rr_listldns_rr_list_new ()
 creates a new rr_list structure.
void ldns_rr_list_free (ldns_rr_list *rr_list)
 frees an rr_list structure.
void ldns_rr_list_deep_free (ldns_rr_list *rr_list)
 frees an rr_list structure and all rrs contained therein.
bool ldns_rr_list_cat (ldns_rr_list *left, ldns_rr_list *right)
 concatenates two ldns_rr_lists together.
ldns_rr_listldns_rr_list_cat_clone (ldns_rr_list *left, ldns_rr_list *right)
 concatenates two ldns_rr_lists together, but makes clones of the rr's (instead of pointer copying).
bool ldns_rr_list_push_rr (ldns_rr_list *rr_list, ldns_rr *rr)
 pushes an rr to an rrlist.
ldns_rrldns_rr_list_pop_rr (ldns_rr_list *rr_list)
 pops the last rr from an rrlist.
bool ldns_rr_list_contains_rr (ldns_rr_list *rr_list, ldns_rr *rr)
 returns true if the given rr is one of the rrs in the list, or if it is equal to one
bool ldns_is_rrset (ldns_rr_list *rr_list)
 checks if an rr_list is a rrset.
bool 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).
ldns_rrldns_rr_set_pop_rr (ldns_rr_list *rr_list)
 pops the last rr from an rrset.
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
ldns_rr_type ldns_get_rr_type_by_name (const char *name)
 retrieves a rrtype by looking up its name.
ldns_rr_class ldns_get_rr_class_by_name (const char *name)
 retrieves a class by looking up its name.
ldns_rrldns_rr_clone (const ldns_rr *rr)
 clones a rr and all its data
ldns_rr_listldns_rr_list_clone (ldns_rr_list *rrlist)
 clones an rrlist.
void ldns_rr_list_sort (ldns_rr_list *unsorted)
 sorts an rr_list (canonical wire format).
void ldns_rr_list_sort_oct (ldns_rr_list *unsorted)
 sorts an rr_list (owner - class - type).
int ldns_rr_compare (const ldns_rr *rr1, const ldns_rr *rr2)
 compares two rrs.
int ldns_rr_compare_oct (const ldns_rr *rr1, const ldns_rr *rr2)
 compares two rrs.
bool ldns_rr_compare_ds (const ldns_rr *rr1, const ldns_rr *rr2)
 returns true of the given rr's are equal.
size_t ldns_rr_uncompressed_size (const ldns_rr *r)
 calculates the uncompressed size of an RR.
void ldns_rr2canonical (ldns_rr *rr)
 converts each dname in a rr to its canonical form.
void ldns_rr_list2canonical (ldns_rr_list *rr_list)
 converts each dname in each rr in a rr_list to its canonical form.
uint8_t ldns_rr_label_count (ldns_rr *rr)
 counts the number of labels of the ownername.
const ldns_rr_descriptorldns_rr_descript (uint16_t type)
 returns the resource record descriptor for the given rr type.
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.
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.
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.
ldns_rr_listldns_rr_list_subtype_by_rdf (ldns_rr_list *l, ldns_rdf *r, size_t pos)
 Return the rr_list which matches the rdf at position field.
bool ldns_rr_list_insert_rr (ldns_rr_list *rr_list, ldns_rr *r, size_t count)


Define Documentation

#define LDNS_MAX_DOMAINLEN   255

Maximum length of a complete dname.

Definition at line 22 of file rr.h.

#define LDNS_MAX_LABELLEN   63

Maximum length of a dname label.

Definition at line 20 of file rr.h.

#define LDNS_MAX_POINTERS   65535

Maximum number of pointers in 1 dname.

Definition at line 24 of file rr.h.

#define LDNS_MAX_RR   65535

Maximum number of rr's in a rr_list.

Definition at line 26 of file rr.h.

#define LDNS_RR_OVERHEAD   10

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

Definition at line 28 of file rr.h.


Typedef Documentation

typedef struct ldns_struct_rr ldns_rr

Definition at line 204 of file rr.h.

typedef enum ldns_enum_rr_class ldns_rr_class

Definition at line 49 of file rr.h.

typedef enum ldns_enum_rr_compress ldns_rr_compress

Definition at line 60 of file rr.h.

typedef struct ldns_struct_rr_descriptor ldns_rr_descriptor

Definition at line 242 of file rr.h.

typedef struct ldns_struct_rr_list ldns_rr_list

Definition at line 217 of file rr.h.

typedef enum ldns_enum_rr_type ldns_rr_type

Definition at line 181 of file rr.h.


Enumeration Type Documentation

enum 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_ANY  Any class.
LDNS_RR_CLASS_FIRST 
LDNS_RR_CLASS_LAST 
LDNS_RR_CLASS_COUNT 

Definition at line 34 of file rr.h.

enum 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 54 of file rr.h.

enum 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  draft-ietf-dnsext-delegation
LDNS_RR_TYPE_SSHFP  SSH Key Fingerprint.
LDNS_RR_TYPE_IPSECKEY  draft-richardson-ipseckey-rr-11.txt
LDNS_RR_TYPE_RRSIG  draft-ietf-dnsext-dnssec-25
LDNS_RR_TYPE_NSEC 
LDNS_RR_TYPE_DNSKEY 
LDNS_RR_TYPE_UINFO 
LDNS_RR_TYPE_UID 
LDNS_RR_TYPE_GID 
LDNS_RR_TYPE_UNSPEC 
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_FIRST 
LDNS_RR_TYPE_LAST 
LDNS_RR_TYPE_COUNT 

Definition at line 65 of file rr.h.


Function Documentation

ldns_rr_class ldns_get_rr_class_by_name ( const char *  name  ) 

retrieves a class by looking up its name.

Parameters:
[in] name string with the name
Returns:
the cass which corresponds with the name

ldns_rr_type ldns_get_rr_type_by_name ( const char *  name  ) 

retrieves a rrtype by looking up its name.

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

bool ldns_is_rrset ( ldns_rr_list rr_list  ) 

checks if an rr_list is a rrset.

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

void ldns_rr2canonical ( ldns_rr rr  ) 

converts each dname in a rr to its canonical form.

Parameters:
[in] rr the rr to work on
Returns:
void

ldns_rr* ldns_rr_clone ( const ldns_rr rr  ) 

clones a rr and all its data

Parameters:
[in] rr the rr to clone
Returns:
the new rr or NULL on failure

int ldns_rr_compare ( const ldns_rr rr1,
const ldns_rr rr2 
)

compares two rrs.

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

bool 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] rr1 the first rr
[in] rr2 the second rr
Returns:
true if equal otherwise false

int ldns_rr_compare_oct ( const ldns_rr rr1,
const ldns_rr rr2 
)

compares two rrs.

(owner-class-type order)

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

const ldns_rr_descriptor* ldns_rr_descript ( uint16_t  type  ) 

returns the resource record descriptor for the given rr type.

Parameters:
[in] type the type value of the rr type
Returns:
the ldns_rr_descriptor for this 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] descriptor for an rr type
[in] field the field number
Returns:
the rdf type for the field

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] descriptor for an rr type
Returns:
the maximum number of rdata fields

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] descriptor for an rr type
Returns:
the minimum number of rdata fields

void ldns_rr_free ( ldns_rr rr  ) 

frees an RR structure

Parameters:
[in] *rr the RR to be freed
Returns:
void

ldns_rr_class ldns_rr_get_class ( const ldns_rr rr  ) 

returns the class of the rr.

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

ldns_rr_type ldns_rr_get_type ( const ldns_rr rr  ) 

returns the type of the rr.

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

uint8_t ldns_rr_label_count ( ldns_rr rr  ) 

counts the number of labels of the ownername.

Parameters:
[in] rr count the labels of this rr
Returns:
the number of labels

void ldns_rr_list2canonical ( ldns_rr_list rr_list  ) 

converts each dname in each rr in a rr_list to its canonical form.

Parameters:
[in] rr_list the rr_list to work on
Returns:
void

bool ldns_rr_list_cat ( ldns_rr_list left,
ldns_rr_list right 
)

concatenates two ldns_rr_lists together.

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

Parameters:
[in] left the leftside
[in] right the rightside
Returns:
a left with right concatenated to it

ldns_rr_list* ldns_rr_list_cat_clone ( ldns_rr_list left,
ldns_rr_list right 
)

concatenates two ldns_rr_lists together, but makes clones of the rr's (instead of pointer copying).

Parameters:
[in] left the leftside
[in] right the rightside
Returns:
a new rr_list with leftside/rightside concatenated

ldns_rr_list* ldns_rr_list_clone ( ldns_rr_list rrlist  ) 

clones an rrlist.

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

bool ldns_rr_list_contains_rr ( ldns_rr_list rr_list,
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_list the rr_list to check
[in] rr the rr to check
Returns:
true if rr_list contains rr, false otherwise

void ldns_rr_list_deep_free ( ldns_rr_list rr_list  ) 

frees an rr_list structure and all rrs contained therein.

Parameters:
[in] rr_list the list to free
Returns:
void

void ldns_rr_list_free ( ldns_rr_list rr_list  ) 

frees an rr_list structure.

Parameters:
[in] rr_list the list to free
Returns:
void

bool ldns_rr_list_insert_rr ( ldns_rr_list rr_list,
ldns_rr r,
size_t  count 
)

ldns_rr_list* ldns_rr_list_new (  ) 

creates a new rr_list structure.

Returns:
a new rr_list structure

ldns_rr* ldns_rr_list_pop_rr ( ldns_rr_list rr_list  ) 

pops the last rr from an rrlist.

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

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

bool ldns_rr_list_push_rr ( ldns_rr_list rr_list,
ldns_rr rr 
)

pushes an rr to an rrlist.

Parameters:
[in] rr_list the rr_list to push to
[in] rr the rr to push
Returns:
false on error, otherwise true

ldns_rr* ldns_rr_list_rr ( ldns_rr_list rr_list,
size_t  nr 
)

returns a specific rr of an rrlist.

Parameters:
[in] rr_list the rr_list to read from
[in] nr return this rr
Returns:
the rr at position nr

size_t ldns_rr_list_rr_count ( ldns_rr_list rr_list  ) 

returns the number of rr's in an rr_list.

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

ldns_rr* ldns_rr_list_set_rr ( ldns_rr_list rr_list,
ldns_rr r,
size_t  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_list the rr_list to set the count on
[in] count the number of rr in this list
Returns:
void

void ldns_rr_list_sort ( ldns_rr_list unsorted  ) 

sorts an rr_list (canonical wire format).

the sorting is done inband.

Parameters:
[in] unsorted the rr_list to be sorted
Returns:
void

void ldns_rr_list_sort_oct ( ldns_rr_list unsorted  ) 

sorts an rr_list (owner - class - type).

the sorting is done inband.

Parameters:
[in] unsorted the rr_list to be sorted
Returns:
void

ldns_rr_list* ldns_rr_list_subtype_by_rdf ( ldns_rr_list l,
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] l the rr_list to look in
[in] r the rdf to use for the comparison
[in] pos at which position can we find the rdf
Returns:
a new rr list with only the RRs that match

ldns_rr* ldns_rr_new ( void   ) 

creates a new rr structure.

Returns:
ldns_rr *

ldns_rr* ldns_rr_new_frm_fp ( FILE *  fp,
uint16_t *  default_ttl,
ldns_rdf **  origin 
)

creates a new rr from a file containing a string.

Parameters:
[in] fp the file pointer to use
[in] default_ttl pointer 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] origin when the owner is relative add this the pointer will be updated if the file contains a $ORIGIN directive
Returns:
ldns_rr*

ldns_rr* ldns_rr_new_frm_fp_l ( FILE *  fp,
uint16_t *  default_ttl,
ldns_rdf **  origin,
int *  line_nr 
)

creates a new rr from a file containing a string.

Parameters:
[in] fp the file pointer to use
[in] default_ttl a default ttl for the rr. If 0 DEF_TTL will be used the pointer will be updated if the file contains a $TTL directive
[in] origin when the owner is relative add this the pointer will be updated if the file contains a $ORIGIN directive
[in] line_nr pointer to an integer containing the current line number (for debugging purposes)
Returns:
ldns_rr*

ldns_rr* ldns_rr_new_frm_str ( const char *  str,
uint16_t  default_ttl,
ldns_rdf origin 
)

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:
[in] str the string to convert
[in] default_ttl pointer to a default ttl for the rr. If 0 DEF_TTL will be used
[in] origin when the owner is relative add this
Returns:
the new rr

ldns_rr* ldns_rr_new_frm_type ( ldns_rr_type  t  ) 

creates a new rr structure, based on the given type.

alloc enough space to hold all the rdf's

ldns_rdf* ldns_rr_owner ( const ldns_rr rr  ) 

returns the owner name of an rr structure.

Parameters:
[in] *rr rr to operate on
Returns:
ldns_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] *rr rr to operate on
Returns:
rdf which was popped (null if nothing)

bool ldns_rr_push_rdf ( ldns_rr rr,
ldns_rdf f 
)

sets rd_field member, it will be placed in the next available spot.

Parameters:
[in] *rr rr to operate on
[in] *f the data field member to set
Returns:
bool

size_t ldns_rr_rd_count ( const ldns_rr rr  ) 

returns the rd_count of an rr structure.

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

ldns_rdf* ldns_rr_rdf ( const ldns_rr rr,
size_t  nr 
)

returns the rdata field member counter.

Parameters:
[in] *rr rr to operate on
[in] nr the number of the rdf to return
Returns:
ldns_rdf *

void ldns_rr_set_class ( ldns_rr rr,
ldns_rr_class  rr_class 
)

sets the class in the rr.

Parameters:
[in] *rr rr to operate on
[in] rr_class set to this class
Returns:
void

void ldns_rr_set_owner ( ldns_rr rr,
ldns_rdf owner 
)

sets the owner in the rr structure.

Parameters:
[in] *rr rr to operate on
[in] *owner set to this owner
Returns:
void

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_list the rr_list to pop from
Returns:
NULL if nothing to pop. Otherwise the popped RR

bool 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_list the rrset to push the rr to
[in] *rr the rr to push
Returns:
true if the push succeeded otherwise false

void ldns_rr_set_rd_count ( ldns_rr rr,
size_t  count 
)

sets the rd_count in the rr.

Parameters:
[in] *rr rr to operate on
[in] count set to this count
Returns:
void

ldns_rdf* ldns_rr_set_rdf ( ldns_rr rr,
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] *rr the rr to operate on
[in] *f the rdf to set
[in] position the position the set the rdf
Returns:
the old value in the rr, NULL on failyre

void ldns_rr_set_ttl ( ldns_rr rr,
uint32_t  ttl 
)

sets the ttl in the rr structure.

Parameters:
[in] *rr rr to operate on
[in] ttl set to this ttl
Returns:
void

void ldns_rr_set_type ( ldns_rr rr,
ldns_rr_type  rr_type 
)

sets the type in the rr.

Parameters:
[in] *rr rr to operate on
[in] rr_type set to this type
Returns:
void

uint32_t ldns_rr_ttl ( const ldns_rr rr  ) 

returns the ttl of an rr structure.

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

size_t ldns_rr_uncompressed_size ( const ldns_rr r  ) 

calculates the uncompressed size of an RR.

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


Generated on Sat May 5 22:30:01 2007 for ldns by  doxygen 1.5.1