dnssec_zone.c File Reference

Go to the source code of this file.

Data Structures

struct  dnssec_zone_rr_iter
 
struct  struct_zone_digester
 

Macros

#define FASTER_DNSSEC_ZONE_NEW_FRM_FP   1 /* Because of L2 cache efficiency */
 

Typedefs

typedef enum dnssec_zone_rr_iter_state dnssec_zone_rr_iter_state
 
typedef struct dnssec_zone_rr_iter dnssec_zone_rr_iter
 
typedef enum enum_zonemd_scheme zonemd_scheme
 
typedef enum enum_zonemd_hash zonemd_hash
 
typedef struct struct_zone_digester zone_digester
 

Enumerations

enum  dnssec_zone_rr_iter_state {
  DNSSEC_ZONE_RR_ITER_LT_RRSIG , DNSSEC_ZONE_RR_ITER_RRSIGs_NO_NSEC , DNSSEC_ZONE_RR_ITER_REST , DNSSEC_ZONE_RR_ITER_RRSIGs_NSEC ,
  DNSSEC_ZONE_RR_ITER_RRSIGs_NSEC_REST , DNSSEC_ZONE_RR_ITER_NSEC3 , DNSSEC_ZONE_RR_ITER_FINI
}
 
enum  enum_zonemd_scheme { ZONEMD_SCHEME_FIRST = 1 , ZONEMD_SCHEME_SIMPLE = 1 , ZONEMD_SCHEME_LAST = 1 }
 
enum  enum_zonemd_hash { ZONEMD_HASH_FIRST = 1 , ZONEMD_HASH_SHA384 = 1 , ZONEMD_HASH_SHA512 = 2 , ZONEMD_HASH_LAST = 2 }
 

Functions

ldns_dnssec_rrsldns_dnssec_rrs_new (void)
 Creates a new entry for 1 pointer to an rr and 1 pointer to the next rrs. More...
 
void ldns_dnssec_rrs_free (ldns_dnssec_rrs *rrs)
 Frees the list of rrs, but not the individual ldns_rr records contained in the list. More...
 
void ldns_dnssec_rrs_deep_free (ldns_dnssec_rrs *rrs)
 Frees the list of rrs, and the individual ldns_rr records contained in the list. More...
 
ldns_status ldns_dnssec_rrs_add_rr (ldns_dnssec_rrs *rrs, ldns_rr *rr)
 Adds an RR to the list of RRs. More...
 
void ldns_dnssec_rrs_print_fmt (FILE *out, const ldns_output_format *fmt, const ldns_dnssec_rrs *rrs)
 Prints the given rrs to the file descriptor. More...
 
void ldns_dnssec_rrs_print (FILE *out, const ldns_dnssec_rrs *rrs)
 Prints the given rrs to the file descriptor. More...
 
ldns_dnssec_rrsetsldns_dnssec_rrsets_new (void)
 Creates a new list (entry) of RRsets. More...
 
void ldns_dnssec_rrsets_free (ldns_dnssec_rrsets *rrsets)
 Frees the list of rrsets and their rrs, but not the ldns_rr records in the sets. More...
 
void ldns_dnssec_rrsets_deep_free (ldns_dnssec_rrsets *rrsets)
 Frees the list of rrsets and their rrs, and the ldns_rr records in the sets. More...
 
ldns_rr_type ldns_dnssec_rrsets_type (const ldns_dnssec_rrsets *rrsets)
 Returns the rr type of the rrset (that is head of the given list) More...
 
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) More...
 
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. More...
 
void ldns_dnssec_rrsets_print_fmt (FILE *out, const ldns_output_format *fmt, const ldns_dnssec_rrsets *rrsets, bool follow)
 Print the given list of rrsets to the given file descriptor. More...
 
void ldns_dnssec_rrsets_print (FILE *out, const ldns_dnssec_rrsets *rrsets, bool follow)
 Print the given list of rrsets to the given file descriptor. More...
 
ldns_dnssec_nameldns_dnssec_name_new (void)
 Create a new data structure for a dnssec name. More...
 
ldns_dnssec_nameldns_dnssec_name_new_frm_rr (ldns_rr *rr)
 Create a new data structure for a dnssec name for the given RR. More...
 
void ldns_dnssec_name_free (ldns_dnssec_name *name)
 Frees the name structure and its rrs and rrsets. More...
 
void ldns_dnssec_name_deep_free (ldns_dnssec_name *name)
 Frees the name structure and its rrs and rrsets. More...
 
ldns_rdfldns_dnssec_name_name (const ldns_dnssec_name *name)
 Returns the domain name of the given dnssec_name structure. More...
 
bool ldns_dnssec_name_is_glue (const ldns_dnssec_name *name)
 Returns if dnssec_name structure is marked as glue. More...
 
void ldns_dnssec_name_set_name (ldns_dnssec_name *rrset, ldns_rdf *dname)
 Sets the domain name of the given dnssec_name structure. More...
 
void ldns_dnssec_name_set_nsec (ldns_dnssec_name *rrset, ldns_rr *nsec)
 Sets the NSEC(3) RR of the given dnssec_name structure. More...
 
int ldns_dnssec_name_cmp (const void *a, const void *b)
 Compares the domain names of the two arguments in their canonical ordering. More...
 
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. More...
 
ldns_dnssec_rrsetsldns_dnssec_name_find_rrset (const ldns_dnssec_name *name, ldns_rr_type type)
 Find the RRset with the given type in within this name structure. More...
 
ldns_dnssec_rrsetsldns_dnssec_zone_find_rrset (const ldns_dnssec_zone *zone, const ldns_rdf *dname, ldns_rr_type type)
 Find the RRset with the given name and type in the zone. More...
 
void ldns_dnssec_name_print_fmt (FILE *out, const ldns_output_format *fmt, const ldns_dnssec_name *name)
 Prints the RRs in the dnssec name structure to the given file descriptor. More...
 
void ldns_dnssec_name_print (FILE *out, const ldns_dnssec_name *name)
 Prints the RRs in the dnssec name structure to the given file descriptor. More...
 
ldns_dnssec_zoneldns_dnssec_zone_new (void)
 Creates a new dnssec_zone structure. More...
 
ldns_status _ldns_rr_new_frm_fp_l_internal (ldns_rr **newrr, FILE *fp, uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev, int *line_nr, bool *explicit_ttl)
 
ldns_status ldns_dnssec_zone_new_frm_fp_l (ldns_dnssec_zone **z, FILE *fp, const ldns_rdf *origin, uint32_t default_ttl, ldns_rr_class c __attribute__((unused)), int *line_nr)
 
ldns_status ldns_dnssec_zone_new_frm_fp (ldns_dnssec_zone **z, FILE *fp, const ldns_rdf *origin, uint32_t ttl, ldns_rr_class c __attribute__((unused)))
 
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. More...
 
void ldns_dnssec_zone_deep_free (ldns_dnssec_zone *zone)
 Frees the given zone structure, and its rbtree of dnssec_names Individual ldns_rr RRs within those names are also freed. More...
 
int ldns_dname_compare_v (const void *a, const void *b)
 Given in dnssec_zone.c, also used in dnssec_sign.c:w. More...
 
ldns_status ldns_dnssec_zone_add_rr (ldns_dnssec_zone *zone, ldns_rr *rr)
 Adds the given RR to the zone. More...
 
void ldns_dnssec_zone_names_print_fmt (FILE *out, const ldns_output_format *fmt, const ldns_rbtree_t *tree, bool print_soa)
 Prints the rbtree of ldns_dnssec_name structures to the file descriptor. More...
 
void ldns_dnssec_zone_names_print (FILE *out, const ldns_rbtree_t *tree, bool print_soa)
 Prints the rbtree of ldns_dnssec_name structures to the file descriptor. More...
 
void ldns_dnssec_zone_print_fmt (FILE *out, const ldns_output_format *fmt, const ldns_dnssec_zone *zone)
 Prints the complete zone to the given file descriptor. More...
 
void ldns_dnssec_zone_print (FILE *out, const ldns_dnssec_zone *zone)
 Prints the complete zone to the given file descriptor. More...
 
ldns_status ldns_dnssec_zone_add_empty_nonterminals (ldns_dnssec_zone *zone)
 Adds explicit dnssec_name structures for the empty nonterminals in this zone. More...
 
bool ldns_dnssec_zone_is_nsec3_optout (const ldns_dnssec_zone *zone)
 If a NSEC3PARAM is available in the apex, walks the zone and returns true on the first optout nsec3. More...
 
ldns_status ldns_dnssec_zone_verify_zonemd (ldns_dnssec_zone *zone)
 
ldns_status dnssec_zone_equip_zonemd (ldns_dnssec_zone *zone, ldns_rr_list *new_rrs, ldns_key_list *key_list, int signflags)
 

Macro Definition Documentation

◆ FASTER_DNSSEC_ZONE_NEW_FRM_FP

#define FASTER_DNSSEC_ZONE_NEW_FRM_FP   1 /* Because of L2 cache efficiency */

Definition at line 595 of file dnssec_zone.c.

Typedef Documentation

◆ dnssec_zone_rr_iter_state

◆ dnssec_zone_rr_iter

◆ zonemd_scheme

Definition at line 1498 of file dnssec_zone.c.

◆ zonemd_hash

Definition at line 1498 of file dnssec_zone.c.

◆ zone_digester

Definition at line 1498 of file dnssec_zone.c.

Enumeration Type Documentation

◆ dnssec_zone_rr_iter_state

Enumerator
DNSSEC_ZONE_RR_ITER_LT_RRSIG 
DNSSEC_ZONE_RR_ITER_RRSIGs_NO_NSEC 
DNSSEC_ZONE_RR_ITER_REST 
DNSSEC_ZONE_RR_ITER_RRSIGs_NSEC 
DNSSEC_ZONE_RR_ITER_RRSIGs_NSEC_REST 
DNSSEC_ZONE_RR_ITER_NSEC3 
DNSSEC_ZONE_RR_ITER_FINI 

Definition at line 1287 of file dnssec_zone.c.

◆ enum_zonemd_scheme

Enumerator
ZONEMD_SCHEME_FIRST 
ZONEMD_SCHEME_SIMPLE 
ZONEMD_SCHEME_LAST 

Definition at line 1527 of file dnssec_zone.c.

◆ enum_zonemd_hash

Enumerator
ZONEMD_HASH_FIRST 
ZONEMD_HASH_SHA384 
ZONEMD_HASH_SHA512 
ZONEMD_HASH_LAST 

Definition at line 1534 of file dnssec_zone.c.

Function Documentation

◆ ldns_dnssec_rrs_new()

ldns_dnssec_rrs* ldns_dnssec_rrs_new ( void  )

Creates a new entry for 1 pointer to an rr and 1 pointer to the next rrs.

Returns
the allocated data

Definition at line 10 of file dnssec_zone.c.

References LDNS_MALLOC, ldns_struct_dnssec_rrs::next, and ldns_struct_dnssec_rrs::rr.

◆ ldns_dnssec_rrs_free()

void ldns_dnssec_rrs_free ( ldns_dnssec_rrs rrs)

Frees the list of rrs, but not the individual ldns_rr records contained in the list.

Parameters
[in]rrsthe data structure to free

Definition at line 35 of file dnssec_zone.c.

◆ ldns_dnssec_rrs_deep_free()

void ldns_dnssec_rrs_deep_free ( ldns_dnssec_rrs rrs)

Frees the list of rrs, and the individual ldns_rr records contained in the list.

Parameters
[in]rrsthe data structure to free

Definition at line 41 of file dnssec_zone.c.

◆ ldns_dnssec_rrs_add_rr()

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. If an equal RR already exists, this RR will not be added.

Parameters
[in]rrsthe list to add to
[in]rrthe RR to add
Returns
LDNS_STATUS_OK on success

Definition at line 47 of file dnssec_zone.c.

References ldns_dnssec_rrs_new(), ldns_rr_compare(), LDNS_STATUS_ERR, LDNS_STATUS_OK, ldns_struct_dnssec_rrs::next, and ldns_struct_dnssec_rrs::rr.

◆ ldns_dnssec_rrs_print_fmt()

void ldns_dnssec_rrs_print_fmt ( FILE *  out,
const ldns_output_format fmt,
const ldns_dnssec_rrs rrs 
)

Prints the given rrs to the file descriptor.

Parameters
[in]outthe file descriptor to print to
[in]fmtthe format of the textual representation
[in]rrsthe list of RRs to print

Definition at line 80 of file dnssec_zone.c.

References ldns_struct_output_format::flags, LDNS_COMMENT_LAYOUT, ldns_rr_print_fmt(), ldns_struct_dnssec_rrs::next, and ldns_struct_dnssec_rrs::rr.

◆ ldns_dnssec_rrs_print()

void ldns_dnssec_rrs_print ( FILE *  out,
const ldns_dnssec_rrs rrs 
)

Prints the given rrs to the file descriptor.

Parameters
[in]outthe file descriptor to print to
[in]rrsthe list of RRs to print

Definition at line 97 of file dnssec_zone.c.

References ldns_dnssec_rrs_print_fmt(), and ldns_output_format_default.

◆ ldns_dnssec_rrsets_new()

ldns_dnssec_rrsets* ldns_dnssec_rrsets_new ( void  )

Creates a new list (entry) of RRsets.

Returns
the newly allocated structure

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

◆ ldns_dnssec_rrsets_free()

void ldns_dnssec_rrsets_free ( ldns_dnssec_rrsets rrsets)

Frees the list of rrsets and their rrs, but not the ldns_rr records in the sets.

Parameters
[in]rrsetsthe data structure to free

Definition at line 134 of file dnssec_zone.c.

◆ ldns_dnssec_rrsets_deep_free()

void ldns_dnssec_rrsets_deep_free ( ldns_dnssec_rrsets rrsets)

Frees the list of rrsets and their rrs, and the ldns_rr records in the sets.

Parameters
[in]rrsetsthe data structure to free

Definition at line 140 of file dnssec_zone.c.

◆ ldns_dnssec_rrsets_type()

ldns_rr_type ldns_dnssec_rrsets_type ( const ldns_dnssec_rrsets rrsets)

Returns the rr type of the rrset (that is head of the given list)

Parameters
[in]rrsetsthe rrset to get the type of
Returns
the rr type

Definition at line 146 of file dnssec_zone.c.

References ldns_struct_dnssec_rrsets::type.

◆ ldns_dnssec_rrsets_set_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)

Parameters
[in]rrsetsthe rrset to set the type of
[in]typethe type to set
Returns
LDNS_STATUS_OK on success

Definition at line 156 of file dnssec_zone.c.

References LDNS_STATUS_ERR, LDNS_STATUS_OK, and ldns_struct_dnssec_rrsets::type.

◆ ldns_dnssec_rrsets_add_rr()

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.

Parameters
[in]rrsetsthe list of rrsets to add the RR to
[in]rrthe rr to add to the list of rrsets
Returns
LDNS_STATUS_OK on success

Definition at line 193 of file dnssec_zone.c.

References ldns_dnssec_rrs_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.

◆ ldns_dnssec_rrsets_print_fmt()

void ldns_dnssec_rrsets_print_fmt ( FILE *  out,
const ldns_output_format fmt,
const ldns_dnssec_rrsets rrsets,
bool  follow 
)

Print the given list of rrsets to the given file descriptor.

Parameters
[in]outthe file descriptor to print to
[in]fmtthe format of the textual representation
[in]rrsetsthe list of RRsets to print
[in]followif set to false, only print the first RRset

Definition at line 302 of file dnssec_zone.c.

◆ ldns_dnssec_rrsets_print()

void ldns_dnssec_rrsets_print ( FILE *  out,
const ldns_dnssec_rrsets rrsets,
bool  follow 
)

Print the given list of rrsets to the given file descriptor.

Parameters
[in]outthe file descriptor to print to
[in]rrsetsthe list of RRsets to print
[in]followif set to false, only print the first RRset

Definition at line 310 of file dnssec_zone.c.

References ldns_dnssec_rrsets_print_fmt(), and ldns_output_format_default.

◆ ldns_dnssec_name_new()

ldns_dnssec_name* ldns_dnssec_name_new ( void  )

Create a new data structure for a dnssec name.

Returns
the allocated structure

Definition at line 317 of file dnssec_zone.c.

References LDNS_CALLOC.

◆ ldns_dnssec_name_new_frm_rr()

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.

Parameters
[in]rrthe RR to derive properties from, and to add to the name

Definition at line 342 of file dnssec_zone.c.

References ldns_dnssec_name_add_rr(), ldns_dnssec_name_free(), ldns_dnssec_name_new(), ldns_rr_owner(), LDNS_STATUS_OK, and ldns_struct_dnssec_name::name.

◆ ldns_dnssec_name_free()

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

Parameters
[in]namethe structure to free

Definition at line 383 of file dnssec_zone.c.

◆ ldns_dnssec_name_deep_free()

void ldns_dnssec_name_deep_free ( ldns_dnssec_name name)

Frees the name structure and its rrs and rrsets.

Individual ldns_rr records contained in the name are also freed

Parameters
[in]namethe structure to free

Definition at line 389 of file dnssec_zone.c.

◆ ldns_dnssec_name_name()

ldns_rdf* ldns_dnssec_name_name ( const ldns_dnssec_name name)

Returns the domain name of the given dnssec_name structure.

Parameters
[in]namethe dnssec name to get the domain name from
Returns
the domain name

Definition at line 395 of file dnssec_zone.c.

References ldns_struct_dnssec_name::name.

◆ ldns_dnssec_name_is_glue()

bool ldns_dnssec_name_is_glue ( const ldns_dnssec_name name)

Returns if dnssec_name structure is marked as glue.

The ldns_dnssec_zone_mark_glue() function has to be called on a zone before using this function. Only names that have only glue rrsets will be marked. Names that have other occluded rrsets and names containing glue on the delegation point will NOT be marked!

Parameters
[in]namethe dnssec name to get the domain name from
Returns
true if the structure is marked as glue, false otherwise.

Definition at line 404 of file dnssec_zone.c.

References ldns_struct_dnssec_name::is_glue.

◆ ldns_dnssec_name_set_name()

void ldns_dnssec_name_set_name ( ldns_dnssec_name name,
ldns_rdf dname 
)

Sets the domain name of the given dnssec_name structure.

Parameters
[in]namethe dnssec name to set the domain name of
[in]dnamethe domain name to set it to. This data is not copied.

Definition at line 413 of file dnssec_zone.c.

References ldns_struct_dnssec_name::name.

◆ ldns_dnssec_name_set_nsec()

void ldns_dnssec_name_set_nsec ( ldns_dnssec_name name,
ldns_rr nsec 
)

Sets the NSEC(3) RR of the given dnssec_name structure.

Parameters
[in]namethe dnssec name to set the domain name of
[in]nsecthe nsec rr to set it to. This data is not copied.

Definition at line 423 of file dnssec_zone.c.

References ldns_struct_dnssec_name::nsec.

◆ ldns_dnssec_name_cmp()

int ldns_dnssec_name_cmp ( const void *  a,
const void *  b 
)

Compares the domain names of the two arguments in their canonical ordering.

Parameters
[in]aThe first dnssec_name to compare
[in]bThe second dnssec_name to compare
Returns
-1 if the domain name of a comes before that of b in canonical ordering, 1 if it is the other way around, and 0 if they are equal

Definition at line 431 of file dnssec_zone.c.

References ldns_dname_compare(), and ldns_dnssec_name_name().

◆ ldns_dnssec_name_add_rr()

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.

Parameters
[in]nameThe ldns_dnssec_name to add the RR to
[in]rrThe RR to add
Returns
LDNS_STATUS_OK on success, error code otherwise

Definition at line 449 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_rdf2rr_type(), 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_name_find_rrset()

ldns_dnssec_rrsets* ldns_dnssec_name_find_rrset ( const ldns_dnssec_name name,
ldns_rr_type  type 
)

Find the RRset with the given type in within this name structure.

Parameters
[in]namethe name to find the RRset in
[in]typethe type of the RRset to find
Returns
the RRset, or NULL if not present

Definition at line 493 of file dnssec_zone.c.

References ldns_struct_dnssec_rrsets::next, ldns_struct_dnssec_name::rrsets, and ldns_struct_dnssec_rrsets::type.

◆ ldns_dnssec_zone_find_rrset()

ldns_dnssec_rrsets* ldns_dnssec_zone_find_rrset ( const ldns_dnssec_zone zone,
const ldns_rdf dname,
ldns_rr_type  type 
)

Find the RRset with the given name and type in the zone.

Parameters
[in]zonethe zone structure to find the RRset in
[in]dnamethe domain name of the RRset to find
[in]typethe type of the RRset to find
Returns
the RRset, or NULL if not present

Definition at line 509 of file dnssec_zone.c.

References ldns_rbnode_t::data, ldns_dnssec_name_find_rrset(), ldns_rbtree_search(), and ldns_struct_dnssec_zone::names.

◆ ldns_dnssec_name_print_fmt()

void ldns_dnssec_name_print_fmt ( FILE *  out,
const ldns_output_format fmt,
const ldns_dnssec_name name 
)

Prints the RRs in the dnssec name structure to the given file descriptor.

Parameters
[in]outthe file descriptor to print to
[in]fmtthe format of the textual representation
[in]namethe name structure to print the contents of

Definition at line 556 of file dnssec_zone.c.

◆ ldns_dnssec_name_print()

void ldns_dnssec_name_print ( FILE *  out,
const ldns_dnssec_name name 
)

Prints the RRs in the dnssec name structure to the given file descriptor.

Parameters
[in]outthe file descriptor to print to
[in]namethe name structure to print the contents of

Definition at line 563 of file dnssec_zone.c.

References ldns_dnssec_name_print_fmt(), and ldns_output_format_default.

◆ ldns_dnssec_zone_new()

ldns_dnssec_zone* ldns_dnssec_zone_new ( void  )

Creates a new dnssec_zone structure.

Returns
the allocated structure

Definition at line 570 of file dnssec_zone.c.

References ldns_struct_dnssec_zone::_nsec3params, ldns_struct_dnssec_zone::hashed_names, LDNS_MALLOC, ldns_struct_dnssec_zone::names, and ldns_struct_dnssec_zone::soa.

◆ _ldns_rr_new_frm_fp_l_internal()

ldns_status _ldns_rr_new_frm_fp_l_internal ( ldns_rr **  newrr,
FILE *  fp,
uint32_t *  default_ttl,
ldns_rdf **  origin,
ldns_rdf **  prev,
int *  line_nr,
bool explicit_ttl 
)

◆ ldns_dnssec_zone_new_frm_fp_l()

◆ ldns_dnssec_zone_new_frm_fp()

ldns_status ldns_dnssec_zone_new_frm_fp ( ldns_dnssec_zone **  z,
FILE *  fp,
const ldns_rdf origin,
uint32_t  ttl,
ldns_rr_class c   __attribute__(unused) 
)

Definition at line 842 of file dnssec_zone.c.

References ldns_dnssec_zone_new_frm_fp_l().

◆ ldns_dnssec_zone_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.

Parameters
[in]*zonethe zone to free

Definition at line 869 of file dnssec_zone.c.

References ldns_struct_dnssec_zone::hashed_names, and ldns_traverse_postorder().

◆ ldns_dnssec_zone_deep_free()

void ldns_dnssec_zone_deep_free ( ldns_dnssec_zone zone)

Frees the given zone structure, and its rbtree of dnssec_names Individual ldns_rr RRs within those names are also freed.

Parameters
[in]*zonethe zone to free

Definition at line 889 of file dnssec_zone.c.

References ldns_struct_dnssec_zone::hashed_names, and ldns_traverse_postorder().

◆ ldns_dname_compare_v()

int ldns_dname_compare_v ( const void *  a,
const void *  b 
)

Given in dnssec_zone.c, also used in dnssec_sign.c:w.

Definition at line 910 of file dnssec_zone.c.

References ldns_dname_compare().

◆ ldns_dnssec_zone_add_rr()

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

Parameters
[in]zonethe zone to add the RR to
[in]rrThe RR to add
Returns
LDNS_STATUS_OK on success, an error code otherwise

Definition at line 1006 of file dnssec_zone.c.

References ldns_dname_compare_v(), ldns_rbtree_create(), ldns_rdf2rr_type(), ldns_rr_get_type(), ldns_rr_rrsig_typecovered(), LDNS_RR_TYPE_NSEC3, LDNS_RR_TYPE_RRSIG, LDNS_STATUS_ERR, LDNS_STATUS_MEM_ERR, LDNS_STATUS_OK, and ldns_struct_dnssec_zone::names.

◆ ldns_dnssec_zone_names_print_fmt()

void ldns_dnssec_zone_names_print_fmt ( FILE *  out,
const ldns_output_format fmt,
const ldns_rbtree_t tree,
bool  print_soa 
)

Prints the rbtree of ldns_dnssec_name structures to the file descriptor.

Parameters
[in]outthe file descriptor to print the names to
[in]fmtthe format of the textual representation
[in]treethe tree of ldns_dnssec_name structures to print
[in]print_soaif true, print SOA records, if false, skip them

Definition at line 1060 of file dnssec_zone.c.

References ldns_rbnode_t::data, ldns_rbtree_first(), and LDNS_RBTREE_NULL.

◆ ldns_dnssec_zone_names_print()

void ldns_dnssec_zone_names_print ( FILE *  out,
const ldns_rbtree_t tree,
bool  print_soa 
)

Prints the rbtree of ldns_dnssec_name structures to the file descriptor.

Parameters
[in]outthe file descriptor to print the names to
[in]treethe tree of ldns_dnssec_name structures to print
[in]print_soaif true, print SOA records, if false, skip them

Definition at line 1078 of file dnssec_zone.c.

References ldns_dnssec_zone_names_print_fmt(), and ldns_output_format_default.

◆ ldns_dnssec_zone_print_fmt()

void ldns_dnssec_zone_print_fmt ( FILE *  out,
const ldns_output_format fmt,
const ldns_dnssec_zone zone 
)

Prints the complete zone to the given file descriptor.

Parameters
[in]outthe file descriptor to print to
[in]fmtthe format of the textual representation
[in]zonethe dnssec_zone to print

Definition at line 1085 of file dnssec_zone.c.

References ldns_struct_output_format::flags, LDNS_COMMENT_LAYOUT, ldns_dnssec_name_find_rrset(), ldns_dnssec_name_name(), ldns_dnssec_rrsets_print_fmt(), ldns_dnssec_zone_names_print_fmt(), ldns_rdf_print(), LDNS_RR_TYPE_SOA, ldns_struct_dnssec_zone::names, and ldns_struct_dnssec_zone::soa.

◆ ldns_dnssec_zone_print()

void ldns_dnssec_zone_print ( FILE *  out,
const ldns_dnssec_zone zone 
)

Prints the complete zone to the given file descriptor.

Parameters
[in]outthe file descriptor to print to
[in]zonethe dnssec_zone to print

Definition at line 1113 of file dnssec_zone.c.

References ldns_dnssec_zone_print_fmt(), and ldns_output_format_default.

◆ ldns_dnssec_zone_add_empty_nonterminals()

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)

Parameters
[in]zonethe zone to check for empty nonterminals return LDNS_STATUS_OK on success.

Definition at line 1258 of file dnssec_zone.c.

◆ ldns_dnssec_zone_is_nsec3_optout()

bool ldns_dnssec_zone_is_nsec3_optout ( const ldns_dnssec_zone zone)

If a NSEC3PARAM is available in the apex, walks the zone and returns true on the first optout nsec3.

Parameters
[in]zonethe zone to check for nsec3 optout records return true when the zone has at least one nsec3 optout record.

Definition at line 1264 of file dnssec_zone.c.

References ldns_rbnode_t::data, ldns_dnssec_name_find_rrset(), ldns_nsec3_optout(), ldns_rbtree_first(), ldns_rbtree_next(), LDNS_RBTREE_NULL, ldns_rr_get_type(), LDNS_RR_TYPE_NSEC3, LDNS_RR_TYPE_NSEC3PARAM, ldns_struct_dnssec_zone::names, and ldns_struct_dnssec_zone::soa.

◆ ldns_dnssec_zone_verify_zonemd()

◆ dnssec_zone_equip_zonemd()

ldns_status dnssec_zone_equip_zonemd ( ldns_dnssec_zone zone,
ldns_rr_list new_rrs,
ldns_key_list key_list,
int  signflags 
)

Definition at line 1918 of file dnssec_zone.c.

References LDNS_STATUS_OK.