Go to the source code of this file.
Functions | |
ldns_dnssec_rrs * | ldns_dnssec_rrs_new () |
Creates a new entry for 1 pointer to an rr and 1 pointer to the next rrs. | |
void | ldns_dnssec_rrs_free (ldns_dnssec_rrs *rrs) |
Frees the list of rrs, but *not* its data. | |
ldns_status | ldns_dnssec_rrs_add_rr (ldns_dnssec_rrs *rrs, ldns_rr *rr) |
Adds an RR to the list of RRs. | |
void | ldns_dnssec_rrs_print (FILE *out, ldns_dnssec_rrs *rrs) |
Prints the given rrs to the file descriptor. | |
ldns_dnssec_rrsets * | ldns_dnssec_rrsets_new () |
Creates a new list (entry) of RRsets. | |
void | ldns_dnssec_rrsets_free (ldns_dnssec_rrsets *rrsets) |
Frees the list of rrsets and their rrs, but *not* their data. | |
ldns_rr_type | ldns_dnssec_rrsets_type (ldns_dnssec_rrsets *rrsets) |
Returns the rr type of the rrset (that is head of the given list). | |
ldns_status | ldns_dnssec_rrsets_set_type (ldns_dnssec_rrsets *rrsets, ldns_rr_type type) |
Sets the RR type of the rrset (that is head of the given list). | |
ldns_status | ldns_dnssec_rrsets_add_rr (ldns_dnssec_rrsets *rrsets, ldns_rr *rr) |
Add an ldns_rr to the corresponding RRset in the given list of RRsets. | |
void | ldns_dnssec_rrsets_print_soa (FILE *out, ldns_dnssec_rrsets *rrsets, bool follow, bool show_soa) |
void | ldns_dnssec_rrsets_print (FILE *out, ldns_dnssec_rrsets *rrsets, bool follow) |
Print the given list of rrsets to the fiven file descriptor. | |
ldns_dnssec_name * | ldns_dnssec_name_new () |
Create a new data structure for a dnssec name. | |
ldns_dnssec_name * | ldns_dnssec_name_new_frm_rr (ldns_rr *rr) |
Create a new data structure for a dnssec name for the given RR. | |
void | ldns_dnssec_name_free (ldns_dnssec_name *name) |
Frees the name structure and its rrs and rrsets. | |
ldns_rdf * | ldns_dnssec_name_name (ldns_dnssec_name *name) |
Returns the domain name of the given dnssec_name structure. | |
void | ldns_dnssec_name_set_name (ldns_dnssec_name *rrset, ldns_rdf *dname) |
Sets the domain name of the given dnssec_name structure. | |
ldns_rr * | ldns_dnssec_name_nsec (ldns_dnssec_name *rrset) |
void | ldns_dnssec_name_set_nsec (ldns_dnssec_name *rrset, ldns_rr *nsec) |
Sets the NSEC(3) RR of the given dnssec_name structure. | |
int | ldns_dnssec_name_cmp (const void *a, const void *b) |
Compares the domain names of the two arguments in their canonical ordening. | |
ldns_status | ldns_dnssec_name_add_rr (ldns_dnssec_name *name, ldns_rr *rr) |
Inserts the given rr at the right place in the current dnssec_name No checking is done whether the name matches. | |
ldns_dnssec_rrsets * | ldns_dnssec_name_find_rrset (ldns_dnssec_name *name, ldns_rr_type type) |
Find the RRset with the given type in within this name structure. | |
ldns_dnssec_rrsets * | ldns_dnssec_zone_find_rrset (ldns_dnssec_zone *zone, ldns_rdf *dname, ldns_rr_type type) |
Find the RRset with the given name and type in the zone. | |
void | ldns_dnssec_name_print_soa (FILE *out, ldns_dnssec_name *name, bool show_soa) |
void | ldns_dnssec_name_print (FILE *out, ldns_dnssec_name *name) |
Prints the RRs in the dnssec name structure to the given file descriptor. | |
ldns_dnssec_zone * | ldns_dnssec_zone_new () |
Creates a new dnssec_zone structure. | |
void | ldns_dnssec_name_node_free (ldns_rbnode_t *node, void *arg) |
void | ldns_dnssec_zone_free (ldns_dnssec_zone *zone) |
Frees the given zone structure, and its rbtree of dnssec_names Individual ldns_rr RRs within those names are *not* freed. | |
int | ldns_dname_compare_v (const void *a, const void *b) |
ldns_status | ldns_dnssec_zone_add_rr (ldns_dnssec_zone *zone, ldns_rr *rr) |
Adds the given RR to the zone. | |
void | ldns_dnssec_zone_names_print (FILE *out, ldns_rbtree_t *tree, bool print_soa) |
Prints the rbtree of ldns_dnssec_name structures to the file descriptor. | |
void | ldns_dnssec_zone_print (FILE *out, ldns_dnssec_zone *zone) |
Prints the complete zone to the given file descriptor. | |
ldns_status | ldns_dnssec_zone_add_empty_nonterminals (ldns_dnssec_zone *zone) |
Adds explicit dnssec_name structures for the empty nonterminals in this zone. |
ldns_dnssec_rrs* ldns_dnssec_rrs_new | ( | ) |
Creates a new entry for 1 pointer to an rr and 1 pointer to the next rrs.
Definition at line 10 of file dnssec_zone.c.
References LDNS_MALLOC, ldns_struct_dnssec_rrs::next, and ldns_struct_dnssec_rrs::rr.
void ldns_dnssec_rrs_free | ( | ldns_dnssec_rrs * | rrs | ) |
Frees the list of rrs, but *not* its data.
[in] | rrs | the data structure to free |
Definition at line 20 of file dnssec_zone.c.
References ldns_dnssec_rrs_free(), LDNS_FREE, and ldns_struct_dnssec_rrs::next.
ldns_status ldns_dnssec_rrs_add_rr | ( | ldns_dnssec_rrs * | rrs, | |
ldns_rr * | rr | |||
) |
Adds an RR to the list of RRs.
The list will remain ordered
[in] | rrs | the list to add to |
[in] | rr | the RR to add |
Definition at line 31 of file dnssec_zone.c.
References ldns_dnssec_rrs_add_rr(), ldns_dnssec_rrs_new(), ldns_rr_compare(), LDNS_STATUS_ERR, LDNS_STATUS_OK, ldns_struct_dnssec_rrs::next, and ldns_struct_dnssec_rrs::rr.
void ldns_dnssec_rrs_print | ( | FILE * | out, | |
ldns_dnssec_rrs * | rrs | |||
) |
Prints the given rrs to the file descriptor.
[in] | out | the file descriptor to print to |
[in] | rrs | the list of RRs to print |
Definition at line 65 of file dnssec_zone.c.
References ldns_dnssec_rrs_print(), ldns_rr_print(), ldns_struct_dnssec_rrs::next, and ldns_struct_dnssec_rrs::rr.
ldns_dnssec_rrsets* ldns_dnssec_rrsets_new | ( | ) |
Creates a new list (entry) of RRsets.
Definition at line 80 of file dnssec_zone.c.
References LDNS_MALLOC, ldns_struct_dnssec_rrsets::next, ldns_struct_dnssec_rrsets::rrs, ldns_struct_dnssec_rrsets::signatures, and ldns_struct_dnssec_rrsets::type.
void ldns_dnssec_rrsets_free | ( | ldns_dnssec_rrsets * | rrsets | ) |
Frees the list of rrsets and their rrs, but *not* their data.
[in] | rrsets | the data structure to free |
Definition at line 92 of file dnssec_zone.c.
References ldns_dnssec_rrs_free(), ldns_dnssec_rrsets_free(), LDNS_FREE, ldns_struct_dnssec_rrsets::next, ldns_struct_dnssec_rrsets::rrs, and ldns_struct_dnssec_rrsets::signatures.
ldns_rr_type ldns_dnssec_rrsets_type | ( | ldns_dnssec_rrsets * | rrsets | ) |
Returns the rr type of the rrset (that is head of the given list).
[in] | rrsets | the rrset to get the type of |
Definition at line 109 of file dnssec_zone.c.
References ldns_struct_dnssec_rrsets::type.
ldns_status ldns_dnssec_rrsets_set_type | ( | ldns_dnssec_rrsets * | rrsets, | |
ldns_rr_type | type | |||
) |
Sets the RR type of the rrset (that is head of the given list).
[in] | rrsets | the rrset to set the type of |
[in] | type | the type to set |
Definition at line 119 of file dnssec_zone.c.
References LDNS_STATUS_ERR, LDNS_STATUS_OK, and ldns_struct_dnssec_rrsets::type.
ldns_status ldns_dnssec_rrsets_add_rr | ( | ldns_dnssec_rrsets * | rrsets, | |
ldns_rr * | rr | |||
) |
Add an ldns_rr to the corresponding RRset in the given list of RRsets.
If it is not present, add it as a new RRset with 1 record.
[in] | rrsets | the list of rrsets to add the RR to |
[in] | rr | the rr to add to the list of rrsets |
Definition at line 131 of file dnssec_zone.c.
References ldns_dnssec_rrs_add_rr(), ldns_dnssec_rrs_new(), ldns_dnssec_rrsets_add_rr(), ldns_dnssec_rrsets_new(), ldns_dnssec_rrsets_type(), ldns_rdf2rr_type(), ldns_rr_get_type(), ldns_rr_rrsig_typecovered(), LDNS_RR_TYPE_RRSIG, LDNS_STATUS_ERR, LDNS_STATUS_OK, ldns_struct_dnssec_rrsets::next, ldns_struct_dnssec_rrs::rr, ldns_struct_dnssec_rrsets::rrs, ldns_struct_dnssec_rrsets::signatures, and ldns_struct_dnssec_rrsets::type.
void ldns_dnssec_rrsets_print_soa | ( | FILE * | out, | |
ldns_dnssec_rrsets * | rrsets, | |||
bool | follow, | |||
bool | show_soa | |||
) |
Definition at line 197 of file dnssec_zone.c.
References ldns_dnssec_rrs_print(), ldns_rr_get_type(), LDNS_RR_TYPE_SOA, ldns_struct_dnssec_rrsets::next, ldns_struct_dnssec_rrs::rr, ldns_struct_dnssec_rrsets::rrs, and ldns_struct_dnssec_rrsets::signatures.
void ldns_dnssec_rrsets_print | ( | FILE * | out, | |
ldns_dnssec_rrsets * | rrsets, | |||
bool | follow | |||
) |
Print the given list of rrsets to the fiven file descriptor.
[in] | out | the file descriptor to print to |
[in] | rrsets | the list of RRsets to print |
[in] | follow | if set to false, only print the first RRset |
Definition at line 222 of file dnssec_zone.c.
References ldns_dnssec_rrsets_print_soa().
ldns_dnssec_name* ldns_dnssec_name_new | ( | ) |
Create a new data structure for a dnssec name.
Definition at line 228 of file dnssec_zone.c.
References LDNS_MALLOC, ldns_struct_dnssec_name::name_alloced, ldns_struct_dnssec_name::nsec, ldns_struct_dnssec_name::nsec_signatures, and ldns_struct_dnssec_name::rrsets.
ldns_dnssec_name* ldns_dnssec_name_new_frm_rr | ( | ldns_rr * | rr | ) |
Create a new data structure for a dnssec name for the given RR.
[in] | rr | the RR to derive properties from, and to add to the name |
Definition at line 246 of file dnssec_zone.c.
References ldns_dnssec_name_add_rr(), ldns_dnssec_name_new(), ldns_rr_owner(), and ldns_struct_dnssec_name::name.
void ldns_dnssec_name_free | ( | ldns_dnssec_name * | name | ) |
Frees the name structure and its rrs and rrsets.
Individual ldns_rr records therein are not freed
[in] | name | the structure to free |
Definition at line 257 of file dnssec_zone.c.
References ldns_dnssec_rrs_free(), ldns_dnssec_rrsets_free(), LDNS_FREE, ldns_rdf_deep_free(), ldns_struct_dnssec_name::name, ldns_struct_dnssec_name::name_alloced, ldns_struct_dnssec_name::nsec_signatures, and ldns_struct_dnssec_name::rrsets.
ldns_rdf* ldns_dnssec_name_name | ( | ldns_dnssec_name * | name | ) |
Returns the domain name of the given dnssec_name structure.
[in] | name | the dnssec name to get the domain name from |
Definition at line 274 of file dnssec_zone.c.
References ldns_struct_dnssec_name::name.
void ldns_dnssec_name_set_name | ( | ldns_dnssec_name * | name, | |
ldns_rdf * | dname | |||
) |
Sets the domain name of the given dnssec_name structure.
[in] | name | the dnssec name to set the domain name of |
[in] | dname | the domain name to set it to. This data is *not* copied. |
Definition at line 283 of file dnssec_zone.c.
References ldns_struct_dnssec_name::name.
ldns_rr* ldns_dnssec_name_nsec | ( | ldns_dnssec_name * | rrset | ) |
void ldns_dnssec_name_set_nsec | ( | ldns_dnssec_name * | name, | |
ldns_rr * | nsec | |||
) |
Sets the NSEC(3) RR of the given dnssec_name structure.
[in] | name | the dnssec name to set the domain name of |
[in] | nsec | the nsec rr to set it to. This data is *not* copied. |
Definition at line 301 of file dnssec_zone.c.
References ldns_struct_dnssec_name::nsec.
int ldns_dnssec_name_cmp | ( | const void * | a, | |
const void * | b | |||
) |
Compares the domain names of the two arguments in their canonical ordening.
[in] | a | The first dnssec_name to compare |
[in] | b | The second dnssec_name to compare |
Definition at line 309 of file dnssec_zone.c.
References ldns_dname_compare(), and ldns_dnssec_name_name().
ldns_status ldns_dnssec_name_add_rr | ( | ldns_dnssec_name * | name, | |
ldns_rr * | rr | |||
) |
Inserts the given rr at the right place in the current dnssec_name No checking is done whether the name matches.
[in] | name | The ldns_dnssec_name to add the RR to |
[in] | rr | The RR to add |
Definition at line 328 of file dnssec_zone.c.
References ldns_dnssec_name_name(), ldns_dnssec_rrs_add_rr(), ldns_dnssec_rrs_new(), ldns_dnssec_rrsets_add_rr(), ldns_dnssec_rrsets_new(), ldns_nsec3_hash_name_frm_nsec3(), ldns_rdf2rr_type(), ldns_rdf_deep_free(), ldns_rr_get_type(), ldns_rr_rrsig_typecovered(), LDNS_RR_TYPE_NSEC, LDNS_RR_TYPE_NSEC3, LDNS_RR_TYPE_RRSIG, LDNS_STATUS_ERR, LDNS_STATUS_OK, ldns_struct_dnssec_name::nsec, ldns_struct_dnssec_name::nsec_signatures, ldns_struct_dnssec_rrs::rr, and ldns_struct_dnssec_name::rrsets.
ldns_dnssec_rrsets* ldns_dnssec_name_find_rrset | ( | ldns_dnssec_name * | name, | |
ldns_rr_type | type | |||
) |
Find the RRset with the given type in within this name structure.
[in] | name | the name to find the RRset in |
[in] | type | the type of the RRset to find |
Definition at line 390 of file dnssec_zone.c.
References ldns_struct_dnssec_rrsets::next, ldns_struct_dnssec_name::rrsets, and ldns_struct_dnssec_rrsets::type.
ldns_dnssec_rrsets* ldns_dnssec_zone_find_rrset | ( | ldns_dnssec_zone * | zone, | |
ldns_rdf * | dname, | |||
ldns_rr_type | type | |||
) |
Find the RRset with the given name and type in the zone.
[in] | zone | the zone structure to find the RRset in |
[in] | dname | the domain name of the RRset to find |
[in] | type | the type of the RRset to find |
Definition at line 406 of file dnssec_zone.c.
References ldns_rbnode_t::data, ldns_dnssec_name_find_rrset(), ldns_rbtree_search(), and ldns_struct_dnssec_zone::names.
void ldns_dnssec_name_print_soa | ( | FILE * | out, | |
ldns_dnssec_name * | name, | |||
bool | show_soa | |||
) |
Definition at line 435 of file dnssec_zone.c.
References ldns_dnssec_rrs_print(), ldns_dnssec_rrsets_print_soa(), ldns_rdf_print(), ldns_rr_print(), ldns_struct_dnssec_name::name, ldns_struct_dnssec_name::nsec, ldns_struct_dnssec_name::nsec_signatures, and ldns_struct_dnssec_name::rrsets.
void ldns_dnssec_name_print | ( | FILE * | out, | |
ldns_dnssec_name * | name | |||
) |
Prints the RRs in the dnssec name structure to the given file descriptor.
[in] | out | the file descriptor to print to |
[in] | name | the name structure to print the contents of |
Definition at line 457 of file dnssec_zone.c.
References ldns_dnssec_name_print_soa().
ldns_dnssec_zone* ldns_dnssec_zone_new | ( | ) |
Creates a new dnssec_zone structure.
Definition at line 463 of file dnssec_zone.c.
References LDNS_MALLOC, ldns_struct_dnssec_zone::names, and ldns_struct_dnssec_zone::soa.
void ldns_dnssec_name_node_free | ( | ldns_rbnode_t * | node, | |
void * | arg | |||
) |
Definition at line 473 of file dnssec_zone.c.
References ldns_rbnode_t::data, and ldns_dnssec_name_free().
void ldns_dnssec_zone_free | ( | ldns_dnssec_zone * | zone | ) |
Frees the given zone structure, and its rbtree of dnssec_names Individual ldns_rr RRs within those names are *not* freed.
[in] | zone | the zone to free |
Definition at line 480 of file dnssec_zone.c.
References ldns_dnssec_name_node_free(), LDNS_FREE, ldns_traverse_postorder(), and ldns_struct_dnssec_zone::names.
int ldns_dname_compare_v | ( | const void * | a, | |
const void * | b | |||
) |
ldns_status ldns_dnssec_zone_add_rr | ( | ldns_dnssec_zone * | zone, | |
ldns_rr * | rr | |||
) |
Adds the given RR to the zone.
It find whether there is a dnssec_name with that name present. If so, add it to that, if not create a new one. Special handling of NSEC and RRSIG provided
[in] | zone | the zone to add the RR to |
[in] | rr | The RR to add |
Definition at line 501 of file dnssec_zone.c.
References ldns_rbnode_t::data, ldns_rbnode_t::key, ldns_dname_compare_v(), ldns_dnssec_name_add_rr(), ldns_dnssec_name_new_frm_rr(), LDNS_MALLOC, ldns_rbtree_create(), ldns_rbtree_insert(), ldns_rbtree_search(), ldns_rr_get_type(), ldns_rr_owner(), ldns_rr_print(), LDNS_RR_TYPE_SOA, LDNS_STATUS_ERR, LDNS_STATUS_OK, ldns_struct_dnssec_zone::names, and ldns_struct_dnssec_zone::soa.
void ldns_dnssec_zone_names_print | ( | FILE * | out, | |
ldns_rbtree_t * | tree, | |||
bool | print_soa | |||
) |
Prints the rbtree of ldns_dnssec_name structures to the file descriptor.
[in] | out | the file descriptor to print the names to |
[in] | tree | the tree of ldns_dnssec_name structures to print |
[in] | print_soa | if true, print SOA records, if false, skip them |
Definition at line 543 of file dnssec_zone.c.
References ldns_rbnode_t::data, ldns_dnssec_name_print_soa(), ldns_rbtree_first(), ldns_rbtree_next(), and LDNS_RBTREE_NULL.
void ldns_dnssec_zone_print | ( | FILE * | out, | |
ldns_dnssec_zone * | zone | |||
) |
Prints the complete zone to the given file descriptor.
[in] | out | the file descriptor to print to |
[in] | zone | the dnssec_zone to print |
Definition at line 558 of file dnssec_zone.c.
References ldns_dnssec_name_find_rrset(), ldns_dnssec_name_name(), ldns_dnssec_rrsets_print(), ldns_dnssec_zone_names_print(), ldns_rdf_print(), LDNS_RR_TYPE_SOA, ldns_struct_dnssec_zone::names, and ldns_struct_dnssec_zone::soa.
ldns_status ldns_dnssec_zone_add_empty_nonterminals | ( | ldns_dnssec_zone * | zone | ) |
Adds explicit dnssec_name structures for the empty nonterminals in this zone.
(this is needed for NSEC3 generation)
[in] | zone | the zone to check for empty nonterminals return LDNS_STATUS_OK on success. |
Definition at line 579 of file dnssec_zone.c.
References ldns_rbnode_t::data, ldns_rbnode_t::key, ldns_dname_cat_clone(), ldns_dname_compare(), ldns_dname_label(), ldns_dname_label_count(), ldns_dname_new_frm_str(), ldns_dnssec_name_new(), LDNS_MALLOC, ldns_rbtree_first(), ldns_rbtree_insert(), ldns_rbtree_next(), LDNS_RBTREE_NULL, ldns_rdf_clone(), ldns_rdf_deep_free(), LDNS_STATUS_ERR, LDNS_STATUS_OK, ldns_struct_dnssec_name::name, ldns_struct_dnssec_name::name_alloced, ldns_struct_dnssec_zone::names, and ldns_struct_dnssec_zone::soa.