ldns documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

Macros | Functions
rr.c File Reference

Go to the source code of this file.

## Macros
#define | LDNS_SYNTAX_DATALEN 16
#define | LDNS_TTL_DATALEN 21
#define | LDNS_RRLIST_INIT 8
#define | LDNS_RDATA_FIELD_DESCRIPTORS_COUNT (sizeof(rdata_field_descriptors)/sizeof(rdata_field_descriptors[0]))
| computes the number of rdata fields More...

## Functions
ldns_rr * | ldns_rr_new (void)
| creates a new rr structure. More...
ldns_rr * | ldns_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 **newrr, const char *str, uint32_t default_ttl, ldns_rdf *origin, ldns_rdf **prev)
| creates an rr from a string. More...
ldns_status | ldns_rr_new_question_frm_str (ldns_rr **newrr, const char *str, 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 **newrr, FILE *fp, uint32_t *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 **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. 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, bool question)
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_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. More...
bool | 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_rdf * | ldns_rr_pop_rdf (ldns_rr *rr)
| removes a rd_field member, it will be popped from the last position. More...
ldns_rdf * | ldns_rr_rdf (const ldns_rr *rr, size_t nr)
| returns the rdata field member counter. More...
ldns_rdf * | ldns_rr_owner (const ldns_rr *rr)
| returns the owner name of an rr structure. More...
bool | 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...
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 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_rr * | ldns_rr_list_rr (const ldns_rr_list *rr_list, size_t nr)
| returns a specific rr of an rrlist. More...
ldns_rr_list * | ldns_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...
bool | ldns_rr_list_cat (ldns_rr_list *left, ldns_rr_list *right)
| concatenates two ldns_rr_lists together. More...
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). More...
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. More...
bool | ldns_rr_list_push_rr (ldns_rr_list *rr_list, const ldns_rr *rr)
| pushes an rr to an rrlist. More...
bool | 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_rr * | ldns_rr_list_pop_rr (ldns_rr_list *rr_list)
| pops the last rr from an rrlist. More...
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. More...
bool | ldns_rr_list_contains_rr (const 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 More...
bool | ldns_is_rrset (ldns_rr_list *rr_list)
| checks if an rr_list is a rrset. More...
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). More...
ldns_rr * | ldns_rr_set_pop_rr (ldns_rr_list *rr_list)
| pops the last rr from an rrset. More...
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 More...
ldns_rr * | ldns_rr_clone (const ldns_rr *rr)
| clones a rr and all its data More...
ldns_rr_list * | ldns_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_no_rdata (const ldns_rr *rr1, const ldns_rr *rr2)
| compares two rrs, up to the rdata. More...
int | ldns_rr_compare_wire (ldns_buffer *rr1_buf, ldns_buffer *rr2_buf)
| compares the wireformat of two rrs, contained in the given buffers. More...
int | ldns_rr_compare (const ldns_rr *rr1, const ldns_rr *rr2)
| compares two rrs. More...
bool | ldns_rr_compare_ds (const ldns_rr *orr1, const ldns_rr *orr2)
| 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 (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 (ldns_rr *rr)
| counts the number of labels of the ownername. More...
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...
const ldns_rr_descriptor * | ldns_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 index)
| returns the rdf type for the given rdata field number of the rr type for the given descriptor. 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_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_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. More...

## Macro Definition Documentation

#define LDNS_SYNTAX_DATALEN 16

Definition at line 19 of file rr.c.

#define LDNS_TTL_DATALEN 21

Definition at line 20 of file rr.c.

#define LDNS_RRLIST_INIT 8

Definition at line 21 of file rr.c.

#define LDNS_RDATA_FIELD_DESCRIPTORS_COUNT (sizeof(rdata_field_descriptors)/sizeof(rdata_field_descriptors[0]))

computes the number of rdata fields

Definition at line 2412 of file rr.c.

## Function Documentation

ldns_rr* ldns_rr_new | ( | void |  | ) |

creates a new rr structure.

Returns
  ldns_rr *

Definition at line 24 of file rr.c.

References ldns_struct_rr::_rdata_fields, LDNS_DEFAULT_TTL, LDNS_MALLOC, LDNS_RR_CLASS_IN, ldns_rr_set_class(), ldns_rr_set_owner(), ldns_rr_set_question(), ldns_rr_set_rd_count(), and ldns_rr_set_ttl().

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

Definition at line 42 of file rr.c.

References ldns_struct_rr::_rdata_fields, LDNS_DEFAULT_TTL, LDNS_FREE, LDNS_MALLOC, LDNS_RR_CLASS_IN, ldns_rr_descript(), ldns_rr_descriptor_minimum(), ldns_rr_set_class(), ldns_rr_set_owner(), ldns_rr_set_question(), ldns_rr_set_rd_count(), ldns_rr_set_ttl(), ldns_rr_set_type(), and LDNS_XMALLOC.

void ldns_rr_free | ( | ldns_rr * | rr | ) |

frees an RR structure

Parameters

  [in] | *rr | the RR to be freed

Returns
  void

Definition at line 75 of file rr.c.

References ldns_struct_buffer::_data, ldns_struct_rr::_rdata_fields, INLINE, ldns_bget_token(), ldns_buffer_free(), ldns_buffer_new_frm_data(), LDNS_DEFAULT_TTL, ldns_dname_cat(), ldns_dname_new_frm_str(), ldns_dname_str_absolute(), LDNS_FREE, ldns_get_rr_class_by_name(), ldns_get_rr_type_by_name(), ldns_hexstring_to_data(), LDNS_MALLOC, LDNS_MAX_DOMAINLEN, LDNS_MAX_PACKETLEN, LDNS_MAX_RDFLEN, ldns_rdf_clone(), ldns_rdf_data(), ldns_rdf_deep_free(), ldns_rdf_new_frm_str(), ldns_rdf_set_type(), ldns_rdf_size(), LDNS_RDF_TYPE_B64, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_HEX, LDNS_RDF_TYPE_HIP, LDNS_RDF_TYPE_IPSECKEY, LDNS_RDF_TYPE_LOC, LDNS_RDF_TYPE_LONG_STR, LDNS_RDF_TYPE_NSEC, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_UNKNOWN, LDNS_RDF_TYPE_WKS, LDNS_RR_CLASS_IN, ldns_rr_descript(), ldns_rr_descriptor_field_type(), ldns_rr_descriptor_maximum(), ldns_rr_descriptor_minimum(), ldns_rr_free(), ldns_rr_new(), ldns_rr_owner(), ldns_rr_push_rdf(), ldns_rr_rd_count(), ldns_rr_rdf(), ldns_rr_set_class(), ldns_rr_set_owner(), ldns_rr_set_question(), ldns_rr_set_ttl(), ldns_rr_set_type(), LDNS_RR_TYPE_SOA, LDNS_STATUS_MEM_ERR, LDNS_STATUS_OK, LDNS_STATUS_SYNTAX_CLASS_ERR, LDNS_STATUS_SYNTAX_ERR, LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR, LDNS_STATUS_SYNTAX_RDATA_ERR, LDNS_STATUS_SYNTAX_TTL_ERR, LDNS_STATUS_SYNTAX_TYPE_ERR, ldns_str2period(), LDNS_SYNTAX_DATALEN, LDNS_TTL_DATALEN, ldns_wire2rdf(), and LDNS_XMALLOC.

ldns_status ldns_rr_new_frm_str | ( | ldns_rr ** | n,
|  | const char * | str,
|  | uint32_t | default_ttl,
|  | 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] | n | the rr to return
  [in] | str | the string to convert
  [in] | default_ttl | default ttl value for the rr. If 0 DEF_TTL will be used
  [in] | origin | when the owner is relative add this. The caller must ldns_rdf_deep_free it.
  [out] | prev | the 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 649 of file rr.c.

ldns_status ldns_rr_new_question_frm_str | ( | ldns_rr ** | n,
|  | const char * | str,
|  | 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] | n | the rr to return
  [in] | str | the string to convert
  [in] | origin | when the owner is relative add this. The caller must ldns_rdf_deep_free it.
  | prev | the 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 662 of file rr.c.

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] | rr | the new rr
  [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 The caller must ldns_rdf_deep_free it.
  [in] | prev | when 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 674 of file rr.c.

References 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] | rr | the new rr
  [in] | fp | the file pointer to use
  [in] | default_ttl | 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 The caller must ldns_rdf_deep_free it.
  [in] | line_nr | pointer to an integer containing the current line number (for debugging purposes)
  [in] | prev | when 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 680 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_rr_free(), ldns_rr_new_frm_str(), LDNS_STATUS_MEM_ERR, LDNS_STATUS_OK, LDNS_STATUS_SYNTAX_DNAME_ERR, LDNS_STATUS_SYNTAX_EMPTY, LDNS_STATUS_SYNTAX_ERR, LDNS_STATUS_SYNTAX_INCLUDE, LDNS_STATUS_SYNTAX_ORIGIN, LDNS_STATUS_SYNTAX_TTL, ldns_str2period(), and LDNS_XMALLOC.

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

Definition at line 768 of file rr.c.

References ldns_struct_rr::_owner.

void ldns_rr_set_question | ( | ldns_rr * | rr,
|  | bool | question
| ) |  |

Definition at line 774 of file rr.c.

References ldns_struct_rr::_rr_question.

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

Definition at line 780 of file rr.c.

References ldns_struct_rr::_ttl.

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

Definition at line 786 of file rr.c.

References ldns_struct_rr::_rd_count.

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

Definition at line 792 of file rr.c.

References ldns_struct_rr::_rr_type.

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

Definition at line 798 of file rr.c.

References ldns_struct_rr::_rr_class.

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] | *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

Definition at line 804 of file rr.c.

References ldns_struct_rr::_rdata_fields, and ldns_rr_rd_count().

bool 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] | *rr | rr to operate on
  [in] | *f | the data field member to set

Returns
  bool

Definition at line 821 of file rr.c.

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

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)

Definition at line 844 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_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 *

Definition at line 873 of file rr.c.

References ldns_struct_rr::_rdata_fields, and ldns_rr_rd_count().

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 *

Definition at line 883 of file rr.c.

References ldns_struct_rr::_owner.

bool ldns_rr_is_question | ( | const ldns_rr * | rr | ) |

returns the question flag of an rr structure.

Parameters

  [in] | *rr | rr to operate on

Returns
  bool true if question

Definition at line 889 of file rr.c.

References ldns_struct_rr::_rr_question.

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

Definition at line 895 of file rr.c.

References ldns_struct_rr::_ttl.

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

Definition at line 901 of file rr.c.

References ldns_struct_rr::_rd_count.

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

Definition at line 907 of file rr.c.

References ldns_struct_rr::_rr_type.

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

Definition at line 913 of file rr.c.

References ldns_struct_rr::_rr_class.

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_list | the rr_list to read from

Returns
  the number of rr's

Definition at line 921 of file rr.c.

References ldns_struct_rr_list::_rr_count.

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_list | the rr_list to use
  [in] | r | the rr to set
  [in] | count | index 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 931 of file rr.c.

References ldns_struct_rr_list::_rrs, ldns_rr_list_rr(), and ldns_rr_list_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_list | the rr_list to set the count on
  [in] | count | the number of rr in this list

Returns
  void

Definition at line 947 of file rr.c.

References ldns_struct_rr_list::_rr_count.

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_list | the rr_list to read from
  [in] | nr | return this rr

Returns
  the rr at position nr

Definition at line 954 of file rr.c.

References ldns_struct_rr_list::_rrs, and ldns_rr_list_rr_count().

ldns_rr_list* ldns_rr_list_new | ( | void |  | ) |

creates a new rr_list structure.

Returns
  a new rr_list structure

Definition at line 964 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.

void ldns_rr_list_free | ( | ldns_rr_list * | rr_list | ) |

frees an rr_list structure.

Parameters

  [in] | rr_list | the list to free

Definition at line 975 of file rr.c.

References ldns_struct_rr_list::_rrs, and LDNS_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_list | the list to free

Definition at line 984 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().

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

Definition at line 1000 of file rr.c.

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

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

Definition at line 1023 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* 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

Definition at line 1062 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().

bool ldns_rr_list_push_rr | ( | ldns_rr_list * | rr_list,
|  | const 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

Definition at line 1096 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.

bool 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_list | the rr_list to push to
  [in] | push_list | the rr_list to push

Returns
  false on error, otherwise true

Definition at line 1127 of file rr.c.

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

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

Definition at line 1141 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* 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_list | the rr_list to pop from
  [in] | size | the number of rr's to pop

Returns
  NULL if nothing to pop. Otherwise the popped rr_list

Definition at line 1173 of file rr.c.

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

bool ldns_rr_list_contains_rr | ( | const 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

Definition at line 1203 of file rr.c.

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

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

Definition at line 1222 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().

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

Definition at line 1257 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* 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

Definition at line 1305 of file rr.c.

References ldns_rr_list_pop_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

Definition at line 1311 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_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

Definition at line 1363 of file rr.c.

References ldns_rdf_clone(), ldns_rr_get_class(), ldns_rr_get_type(), ldns_rr_is_question(), ldns_rr_new(), ldns_rr_owner(), ldns_rr_push_rdf(), ldns_rr_rd_count(), ldns_rr_rdf(), ldns_rr_set_class(), ldns_rr_set_owner(), ldns_rr_set_question(), ldns_rr_set_ttl(), ldns_rr_set_type(), and ldns_rr_ttl().

ldns_rr_list* ldns_rr_list_clone | ( | const ldns_rr_list * | rrlist | ) |

clones an rrlist.

Parameters

  [in] | rrlist | the rrlist to clone

Returns
  the cloned rr list

Definition at line 1394 of file rr.c.

References ldns_buffer_free(), ldns_buffer_new(), ldns_rr2buffer_wire(), ldns_rr2canonical(), ldns_rr_clone(), ldns_rr_compare_no_rdata(), ldns_rr_compare_wire(), ldns_rr_free(), ldns_rr_list_deep_free(), ldns_rr_list_new(), ldns_rr_list_push_rr(), ldns_rr_list_rr(), ldns_rr_list_rr_count(), ldns_rr_uncompressed_size(), LDNS_SECTION_ANY, LDNS_STATUS_OK, ldns_schwartzian_compare_struct::original_object, and ldns_schwartzian_compare_struct::transformed_object.

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

Definition at line 1479 of file rr.c.

References ldns_struct_rr_list::_rrs, ldns_buffer_free(), 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.

int ldns_rr_compare_no_rdata | ( | const ldns_rr * | rr1,
|  | const ldns_rr * | rr2
| ) |  |

compares two rrs, up to the rdata.

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

Definition at line 1522 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().

int ldns_rr_compare_wire | ( | ldns_buffer * | rr1_buf,
|  | ldns_buffer * | rr2_buf
| ) |  |

compares the wireformat of two rrs, contained in the given buffers.

Parameters

  [in] | rr1_buf | the first one
  [in] | rr2_buf | the 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 1563 of file rr.c.

int ldns_rr_compare | ( | const ldns_rr * | rr1,
|  | const ldns_rr * | rr2
| ) |  |

compares two rrs.

The TTL is not looked at.

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

Definition at line 1601 of file rr.c.

References ldns_buffer_free(), ldns_buffer_new(), ldns_key_rr2ds(), ldns_rdf2native_int8(), ldns_rr2buffer_wire_canonical(), ldns_rr_compare(), ldns_rr_compare_no_rdata(), ldns_rr_compare_wire(), ldns_rr_free(), ldns_rr_get_type(), ldns_rr_rdf(), LDNS_RR_TYPE_DNSKEY, LDNS_RR_TYPE_DS, ldns_rr_uncompressed_size(), LDNS_SECTION_ANY, and LDNS_STATUS_OK.

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

Definition at line 1673 of file rr.c.

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

int ldns_rr_list_compare | ( | const ldns_rr_list * | rrl1,
|  | const ldns_rr_list * | rrl2
| ) |  |

compares two rr listss.

Parameters

  [in] | rrl1 | the first one
  [in] | rrl2 | the second one

Returns
  0 if equal -1 if rrl1 comes before rrl2 +1 if rrl2 comes before rrl1

Definition at line 1700 of file rr.c.

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

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

Definition at line 1727 of file rr.c.

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

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

Definition at line 1744 of file rr.c.

References ldns_dname2canonical(), ldns_rr_get_type(), ldns_rr_owner(), ldns_rr_rd_count(), ldns_rr_rdf(), LDNS_RR_TYPE_A6, LDNS_RR_TYPE_AFSDB, LDNS_RR_TYPE_CNAME, LDNS_RR_TYPE_DNAME, LDNS_RR_TYPE_KX, 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_NS, LDNS_RR_TYPE_NXT, LDNS_RR_TYPE_PTR, LDNS_RR_TYPE_PX, LDNS_RR_TYPE_RP, LDNS_RR_TYPE_RRSIG, LDNS_RR_TYPE_RT, LDNS_RR_TYPE_SIG, LDNS_RR_TYPE_SOA, and LDNS_RR_TYPE_SRV.

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

Definition at line 1796 of file rr.c.

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

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

Definition at line 1805 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_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_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_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_CAA, LDNS_RR_TYPE_CDS, LDNS_RR_TYPE_CERT, LDNS_RR_TYPE_CNAME, 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_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_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_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] | rdf | the constructed rdf

Returns
  LDNS_STATUS_OK if all went well.

Definition at line 2520 of file rr.c.

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] | rdf | the constructed rdf

Returns
  LDNS_STATUS_OK if all went well.

Definition at line 2526 of file rr.c.

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

Definition at line 2535 of file rr.c.

References LDNS_RDATA_FIELD_DESCRIPTORS_COMMON, and LDNS_RDATA_FIELD_DESCRIPTORS_COUNT.

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

Definition at line 2554 of file rr.c.

References ldns_struct_rr_descriptor::_minimum.

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

Definition at line 2564 of file rr.c.

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

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

Definition at line 2579 of file rr.c.

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

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

Definition at line 2593 of file rr.c.

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

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

Definition at line 2633 of file rr.c.

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

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 usefull in the case when inspecting the rrtype covered field of an RRSIG.

Parameters

  [in] | rd | the rdf to look at

Returns
  a ldns_rr_type with equivalent LDNS_RR_TYPE

Definition at line 2653 of file rr.c.

References ldns_rdf2native_int16(), ldns_rdf_get_type(), and LDNS_RDF_TYPE_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_list | The rr list

Returns
  rr_type of the first element, or 0 if the list is empty

Definition at line 2670 of file rr.c.

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

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_list | The rr list

Returns
  dname of the first element, or NULL if the list is empty

Definition at line 2680 of file rr.c.

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