OpenDNSSEC-signer  1.4.3
Data Structures | Macros | Typedefs | Functions
domain.h File Reference
#include "config.h"
#include "shared/allocator.h"
#include "shared/status.h"
#include "signer/rrset.h"
#include <ldns/ldns.h>
#include <time.h>
Include dependency graph for domain.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  domain_struct
 

Macros

#define SE_NSEC_RDATA_NXT   0
 
#define SE_NSEC_RDATA_BITMAP   1
 
#define SE_NSEC3_RDATA_NSEC3PARAMS   4
 
#define SE_NSEC3_RDATA_NXT   4
 
#define SE_NSEC3_RDATA_BITMAP   5
 

Typedefs

typedef struct domain_struct domain_type
 

Functions

void log_dname (ldns_rdf *rdf, const char *pre, int level)
 
domain_typedomain_create (void *zoneptr, ldns_rdf *dname)
 
size_t domain_count_rrset (domain_type *domain)
 
size_t domain_count_rrset_is_added (domain_type *domain)
 
rrset_typedomain_lookup_rrset (domain_type *domain, ldns_rr_type rrtype)
 
void domain_add_rrset (domain_type *domain, rrset_type *rrset)
 
rrset_typedomain_del_rrset (domain_type *domain, ldns_rr_type rrtype)
 
void domain_diff (domain_type *domain, unsigned is_ixfr, unsigned more_coming)
 
void domain_rollback (domain_type *domain, int keepsc)
 
int domain_ent2unsignedns (domain_type *domain)
 
ldns_rr_type domain_is_delegpt (domain_type *domain)
 
ldns_rr_type domain_is_occluded (domain_type *domain)
 
void domain_print (FILE *fd, domain_type *domain, ods_status *status)
 
void domain_cleanup (domain_type *domain)
 
void domain_backup2 (FILE *fd, domain_type *domain, int sigs)
 

Macro Definition Documentation

#define SE_NSEC3_RDATA_BITMAP   5

Definition at line 49 of file domain.h.

#define SE_NSEC3_RDATA_NSEC3PARAMS   4

Definition at line 47 of file domain.h.

#define SE_NSEC3_RDATA_NXT   4

Definition at line 48 of file domain.h.

#define SE_NSEC_RDATA_BITMAP   1

Definition at line 46 of file domain.h.

#define SE_NSEC_RDATA_NXT   0

Domain.

Definition at line 45 of file domain.h.

Typedef Documentation

typedef struct domain_struct domain_type

Domain.

Definition at line 55 of file domain.h.

Function Documentation

void domain_add_rrset ( domain_type domain,
rrset_type rrset 
)

Add RRset to domain.

Parameters
[in]domaindomain
[in]rrsetRRset

Add RRset to domain.

Definition at line 191 of file domain.c.

References denial_struct::bitmap_changed, domain_struct::denial, domain_struct::dname, rrset_struct::domain, LOG_DEEEBUG, log_rrset(), rrset_struct::next, ods_log_assert, domain_struct::rrsets, and rrset_struct::rrtype.

Referenced by zone_add_rr().

void domain_backup2 ( FILE *  fd,
domain_type domain,
int  sigs 
)

Backup domain.

Parameters
[in]fdfile descriptor
[in]domaindomain
[in]sigsdo RRSIGS if true, otherwise do RRset

Backup domain.

Definition at line 582 of file domain.c.

References domain_lookup_rrset(), domain_struct::is_apex, rrset_struct::next, rrset_backup2(), rrset_print(), domain_struct::rrsets, and rrset_struct::rrtype.

Referenced by namedb_backup2().

void domain_cleanup ( domain_type domain)

Clean up domain.

Parameters
[in]domaindomain to cleanup

Clean up domain.

Definition at line 563 of file domain.c.

References zone_struct::allocator, allocator_deallocate(), domain_struct::dname, rrset_cleanup(), domain_struct::rrsets, and domain_struct::zone.

Referenced by namedb_add_domain().

size_t domain_count_rrset ( domain_type domain)

Count the number of RRsets at this domain.

Parameters
[in]domaindomain
Returns
size_t number of RRsets

Count the number of RRsets at this domain.

Definition at line 128 of file domain.c.

References rrset_struct::next, and domain_struct::rrsets.

size_t domain_count_rrset_is_added ( domain_type domain)

Count the number of RRsets at this domain with RRs that have is_added.

Parameters
[in]domaindomain
Returns
size_t number of RRsets

Count the number of RRsets at this domain with RRs that have is_added.

Definition at line 149 of file domain.c.

References rrset_struct::next, rrset_count_rr_is_added(), and domain_struct::rrsets.

Referenced by namedb_examine().

domain_type* domain_create ( void *  zoneptr,
ldns_rdf *  dname 
)

Create domain.

Parameters
[in]zoneptrzone reference
[in]dnameowner name
Returns
domain_type* domain

Create domain.

Definition at line 91 of file domain.c.

References zone_struct::allocator, allocator_alloc(), allocator_deallocate(), domain_struct::denial, domain_struct::dname, domain_struct::is_apex, domain_struct::is_new, domain_struct::node, ods_log_error(), domain_struct::parent, domain_struct::rrsets, and domain_struct::zone.

Referenced by namedb_add_domain().

rrset_type* domain_del_rrset ( domain_type domain,
ldns_rr_type  rrtype 
)

Delete RRset from domain.

Parameters
[in]domaindomain
[in]rrtypeRRtype of RRset
Returns
rrset_type* deleted RRset

Delete RRset from domain.

Definition at line 222 of file domain.c.

References denial_struct::bitmap_changed, domain_struct::denial, domain_struct::dname, rrset_struct::domain, LOG_DEEEBUG, log_rrset(), rrset_struct::next, ods_log_assert, ods_log_error(), rrset_type2str(), domain_struct::rrsets, and rrset_struct::rrtype.

void domain_diff ( domain_type domain,
unsigned  is_ixfr,
unsigned  more_coming 
)

Apply differences at domain.

Parameters
[in]domaindomain
[in]is_ixfrtrue if incremental change
[in]more_comingmore transactions possible

Apply differences at domain.

Definition at line 281 of file domain.c.

References denial_struct::bitmap_changed, domain_struct::denial, domain_struct::dname, LOG_DEEEBUG, log_rrset(), rrset_struct::next, rrset_struct::rr_count, rrset_cleanup(), rrset_diff(), domain_struct::rrsets, and rrset_struct::rrtype.

Referenced by namedb_diff().

int domain_ent2unsignedns ( domain_type domain)

Check whether a domain is an empty non-terminal to an unsigned delegation.

Parameters
[in]domaindomain
Returns
int yes or no

Check whether a domain is an empty non-terminal to unsigned delegation.

Definition at line 407 of file domain.c.

References domain_struct::dname, domain_is_delegpt(), domain_is_occluded(), domain_struct::node, ods_log_assert, and domain_struct::rrsets.

ldns_rr_type domain_is_delegpt ( domain_type domain)

Check whether a domain is a delegation, regardless of parent.

Parameters
[in]domaindomain
Returns
ldns_rr_type RRtype that hints whether the domain is occluded. LDNS_RR_TYPE_NS Unsigned delegation LDNS_RR_TYPE_DS Signed delegation LDNS_RR_TYPE_SOA Authoritative data (or signed delegation)

Check whether the domain is a delegation point.

Definition at line 441 of file domain.c.

References domain_lookup_rrset(), domain_struct::is_apex, and ods_log_assert.

Referenced by domain_ent2unsignedns(), and rrset_sign().

ldns_rr_type domain_is_occluded ( domain_type domain)

Check whether the domain is occluded.

Parameters
[in]domaindomain
Returns
ldns_rr_type RRtype that hints whether the domain is occluded. LDNS_RR_TYPE_DNAME Occluded LDNS_RR_TYPE_A Glue LDNS_RR_TYPE_SOA Authoritative data or delegation

Check whether the domain is occluded.

Definition at line 466 of file domain.c.

References domain_lookup_rrset(), domain_struct::is_apex, ods_log_assert, and domain_struct::parent.

Referenced by domain_ent2unsignedns(), and rrset_sign().

rrset_type* domain_lookup_rrset ( domain_type domain,
ldns_rr_type  rrtype 
)

Look up RRset at this domain.

Parameters
[in]domainthe domain
[in]rrtypeRRtype
Returns
rrset_type* RRset, if found

Look up RRset at this domain.

Definition at line 172 of file domain.c.

References rrset_struct::next, domain_struct::rrsets, and rrset_struct::rrtype.

Referenced by domain_backup2(), domain_is_delegpt(), domain_is_occluded(), domain_print(), namedb_examine(), zone_add_rr(), zone_del_rr(), and zone_lookup_rrset().

void domain_print ( FILE *  fd,
domain_type domain,
ods_status status 
)

Print domain.

Parameters
[in]fdfile descriptor
[in]domaindomain
[out]statusstatus

Print domain.

Definition at line 495 of file domain.c.

References domain_struct::denial, denial_print(), domain_struct::dname, domain_lookup_rrset(), domain_struct::is_apex, rrset_struct::next, ods_log_crit(), ods_status2str(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, rrset_print(), domain_struct::rrsets, and rrset_struct::rrtype.

Referenced by namedb_export().

void domain_rollback ( domain_type domain,
int  keepsc 
)

Rollback differences at domain.

Parameters
[in]domaindomain
[in]keepsckeep RRs that did not came from the adapter

Rollback differences at domain.

Definition at line 333 of file domain.c.

References denial_struct::bitmap_changed, domain_struct::denial, domain_struct::dname, rr_struct::exists, rr_struct::is_added, rr_struct::is_removed, LOG_DEEEBUG, log_rrset(), rrset_struct::next, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, rrset_cleanup(), rrset_del_rr(), domain_struct::rrsets, and rrset_struct::rrtype.

Referenced by namedb_rollback().

void log_dname ( ldns_rdf *  rdf,
const char *  pre,
int  level 
)