Data Structures | Defines | Typedefs | Enumerations | Functions

/build/buildd-opendnssec_1.3.2-1~bpo60+1-s390-eF9Mr1/opendnssec-1.3.2/signer/src/signer/domain.h File Reference

#include "config.h"
#include "daemon/worker.h"
#include "scheduler/fifoq.h"
#include "shared/allocator.h"
#include "shared/status.h"
#include "signer/denial.h"
#include "signer/keys.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

Defines

#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 enum domain_status_enum domain_status
typedef struct domain_struct domain_type

Enumerations

enum  domain_status_enum {
  DOMAIN_STATUS_NONE = 0, DOMAIN_STATUS_APEX, DOMAIN_STATUS_AUTH, DOMAIN_STATUS_NS,
  DOMAIN_STATUS_DS, DOMAIN_STATUS_ENT, DOMAIN_STATUS_OCCLUDED
}

Functions

domain_typedomain_create (ldns_rdf *dname)
ods_status domain_recover (domain_type *domain, FILE *fd, domain_status dstatus)
size_t domain_count_rrset (domain_type *domain)
rrset_typedomain_lookup_rrset (domain_type *domain, ldns_rr_type rrtype)
rrset_typedomain_add_rrset (domain_type *domain, rrset_type *rrset)
rrset_typedomain_del_rrset (domain_type *domain, rrset_type *rrset)
ods_status domain_diff (domain_type *domain, keylist_type *kl)
int domain_examine_data_exists (domain_type *domain, ldns_rr_type rrtype, int skip_glue)
int domain_examine_ns_rdata (domain_type *domain, ldns_rdf *nsdname)
int domain_examine_valid_zonecut (domain_type *domain)
int domain_examine_rrset_is_alone (domain_type *domain, ldns_rr_type rrtype)
int domain_examine_rrset_is_singleton (domain_type *domain, ldns_rr_type rrtype)
ods_status domain_commit (domain_type *domain)
void domain_rollback (domain_type *domain)
void domain_dstatus (domain_type *domain)
ods_status domain_queue (domain_type *domain, fifoq_type *q, worker_type *worker)
void domain_cleanup (domain_type *domain)
void domain_print (FILE *fd, domain_type *domain)
void domain_backup (FILE *fd, domain_type *domain)

Define Documentation

#define SE_NSEC3_RDATA_BITMAP   5

Definition at line 64 of file domain.h.

#define SE_NSEC3_RDATA_NSEC3PARAMS   4

Definition at line 62 of file domain.h.

#define SE_NSEC3_RDATA_NXT   4

Definition at line 63 of file domain.h.

#define SE_NSEC_RDATA_BITMAP   1

Definition at line 61 of file domain.h.

#define SE_NSEC_RDATA_NXT   0

Definition at line 60 of file domain.h.


Typedef Documentation

Definition at line 58 of file domain.h.

typedef struct domain_struct domain_type

Domain.

Definition at line 70 of file domain.h.


Enumeration Type Documentation

Domain.

Enumerator:
DOMAIN_STATUS_NONE 
DOMAIN_STATUS_APEX 
DOMAIN_STATUS_AUTH 
DOMAIN_STATUS_NS 
DOMAIN_STATUS_DS 
DOMAIN_STATUS_ENT 
DOMAIN_STATUS_OCCLUDED 

Definition at line 49 of file domain.h.


Function Documentation

rrset_type* domain_add_rrset ( domain_type domain,
rrset_type rrset 
)

Add RRset to domain.

Parameters:
[in] domain domain
[in] rrset RRset
Returns:
rrset_type* added RRset

Add RRset to domain.

Definition at line 332 of file domain.c.

References ods_log_assert, ods_log_error(), and domain_struct::rrsets.

Referenced by zone_add_rr().

void domain_backup ( FILE *  fd,
domain_type domain 
)

Backup domain.

Parameters:
[in] fd file descriptor
[in] domain domain

Backup domain.

Definition at line 988 of file domain.c.

References domain_struct::denial, domain_struct::dname, domain_struct::dstatus, denial_struct::rrset, rrset_backup(), rrset_print(), and domain_struct::rrsets.

Referenced by zonedata_backup().

void domain_cleanup ( domain_type domain  ) 

Clean up domain.

Parameters:
[in] domain domain to cleanup

Clean up domain.

Definition at line 888 of file domain.c.

References domain_struct::allocator, allocator_cleanup(), allocator_deallocate(), domain_struct::dname, and domain_struct::rrsets.

ods_status domain_commit ( domain_type domain  ) 

Commit updates to domain.

Parameters:
[in] domain the domain
Returns:
ods_status status

Commit updates to domain.

Definition at line 663 of file domain.c.

References denial_struct::bitmap_changed, COUNT_ADD, COUNT_DEL, COUNT_RR, domain_struct::denial, domain_del_rrset(), rrset_struct::needs_signing, ods_log_warning(), ODS_STATUS_OK, rrset_struct::rr_type, rrset_struct::rrs, rrset_commit(), rrset_count_rr(), and domain_struct::rrsets.

Referenced by zonedata_commit().

size_t domain_count_rrset ( domain_type domain  ) 

Recover RR from backup.

Parameters:
[in] domain domain
[in] rr RR
Returns:
int 0 on success, 1 on error Recover RRSIG from backup.
Parameters:
[in] domain domain
[in] rrsig RRSIG
[in] type_covered RRtype that is covered by rrsig
[in] locator key locator
[in] flags key flags
Returns:
int 0 on success, 1 on error Count the number of RRsets at this domain.
Parameters:
[in] domain domain
Returns:
size_t number of RRsets

Count the number of RRsets at this domain.

Definition at line 401 of file domain.c.

References COUNT_RR, rrset_count_rr(), and domain_struct::rrsets.

Referenced by domain_dstatus(), domain_examine_rrset_is_alone(), zonedata_commit(), and zonedata_nsecify().

domain_type* domain_create ( ldns_rdf *  dname  ) 

Create empty domain.

Parameters:
[in] dname owner name
Returns:
domain_type* empty domain

Create empty domain.

Definition at line 67 of file domain.c.

References domain_struct::allocator, allocator_alloc(), allocator_cleanup(), allocator_create(), domain_struct::denial, domain_struct::dname, domain_struct::dstatus, ods_log_assert, ods_log_error(), domain_struct::parent, and domain_struct::rrsets.

Referenced by zone_add_rr().

rrset_type* domain_del_rrset ( domain_type domain,
rrset_type rrset 
)

Delete RRset from domain.

Parameters:
[in] domain domain
[in] rrset RRset
Returns:
rrset_type* RRset if failed

Delete RRset from domain.

Definition at line 364 of file domain.c.

References ods_log_assert, ods_log_error(), rrset_struct::rr_type, rrset_cleanup(), and domain_struct::rrsets.

Referenced by domain_commit().

ods_status domain_diff ( domain_type domain,
keylist_type kl 
)

Calculate differences at this domain between current and new RRsets.

Parameters:
[in] domain the domain
[in] kl current key list
Returns:
ods_status status

Calculate differences at this domain between current and new RRsets.

Definition at line 430 of file domain.c.

References ODS_STATUS_OK, rrset_struct::rr_type, rrset_diff(), and domain_struct::rrsets.

Referenced by zonedata_diff().

void domain_dstatus ( domain_type domain  ) 

Set domain status.

Parameters:
[in] domain the domain

Set domain status.

Definition at line 745 of file domain.c.

References domain_count_rrset(), domain_lookup_rrset(), DOMAIN_STATUS_APEX, domain_struct::dstatus, ods_log_error(), and domain_struct::parent.

Referenced by zonedata_entize().

int domain_examine_data_exists ( domain_type domain,
ldns_rr_type  rrtype,
int  skip_glue 
)

Examine domain and verify if data exists.

Parameters:
[in] domain domain
[in] rrtype RRtype look for a specific RRset
[in] skip_glue skip glue records int 0 if data is alone, 1 otherwise

Examine domain and verify if data exists.

Definition at line 465 of file domain.c.

References ods_log_assert, rrset_struct::rr_type, rrset_count_RR(), and domain_struct::rrsets.

int domain_examine_ns_rdata ( domain_type domain,
ldns_rdf *  nsdname 
)

Examine domain NS RRset and verify its RDATA.

Parameters:
[in] domain domain
[in] nsdname domain name that should match one of the NS RDATA
Returns:
int 1 if match, 0 otherwise

Examine domain NS RRset and verify its RDATA.

Definition at line 845 of file domain.c.

References domain_lookup_rrset(), and rrset_examine_ns_rdata().

int domain_examine_rrset_is_alone ( domain_type domain,
ldns_rr_type  rrtype 
)

Examine domain and verify if there is no other data next to a RRset.

Parameters:
[in] domain domain
[in] rrtype RRtype
Returns:
int 1 if the RRset is alone, 0 otherwise

Examine domain and verify if there is no other data next to a RRset.

Definition at line 505 of file domain.c.

References rrset_struct::add, domain_struct::dname, domain_count_rrset(), domain_lookup_rrset(), log_rr(), ods_log_assert, ods_log_error(), rrset_struct::rr_type, rrset_struct::rrs, rrset_count_RR(), and domain_struct::rrsets.

Referenced by zonedata_examine().

int domain_examine_rrset_is_singleton ( domain_type domain,
ldns_rr_type  rrtype 
)

Examine domain and verify if the RRset is a singleton.

Parameters:
[in] domain domain
[in] rrtype RRtype
Returns:
int 1 if the RRset is a singleton, 0 otherwise

Examine domain and verify if the RRset is a singleton.

Definition at line 626 of file domain.c.

References domain_struct::dname, domain_lookup_rrset(), ods_log_assert, ods_log_error(), and rrset_count_RR().

Referenced by zonedata_examine().

int domain_examine_valid_zonecut ( domain_type domain  ) 

Examine domain and verify if it is a valid zonecut (or no NS RRs).

Parameters:
[in] domain domain int 1 if the RRset is a valid zonecut (or no zonecut), 0 otherwise

Examine domain and verify if there is no occluded data next to a delegation.

Definition at line 570 of file domain.c.

References domain_lookup_rrset(), ods_log_assert, ods_log_error(), rrset_struct::rr_type, rrset_count_RR(), and domain_struct::rrsets.

rrset_type* domain_lookup_rrset ( domain_type domain,
ldns_rr_type  rrtype 
)

Look up RRset at this domain.

Parameters:
[in] domain the domain
[in] rrtype RRtype
Returns:
rrset_type* RRset, if found

Look up RRset at this domain.

Definition at line 318 of file domain.c.

References domain_struct::rrsets.

Referenced by domain_dstatus(), domain_examine_ns_rdata(), domain_examine_rrset_is_alone(), domain_examine_rrset_is_singleton(), domain_examine_valid_zonecut(), domain_print(), domain_recover(), zone_add_rr(), zone_del_rr(), zone_prepare_nsec3(), and zone_update_serial().

void domain_print ( FILE *  fd,
domain_type domain 
)

Print domain.

Parameters:
[in] fd file descriptor
[in] domain domain

Print domain.

Definition at line 917 of file domain.c.

References domain_struct::denial, domain_lookup_rrset(), DOMAIN_STATUS_APEX, DOMAIN_STATUS_OCCLUDED, domain_struct::dstatus, ods_log_assert, rrset_struct::rr_type, denial_struct::rrset, rrset_print(), and domain_struct::rrsets.

Referenced by zonedata_print().

ods_status domain_queue ( domain_type domain,
fifoq_type q,
worker_type worker 
)

Queue all RRsets at this domain.

Parameters:
[in] domain the domain
[in] q queue
[in] worker owner of data
Returns:
ods_status status

Queue all RRsets at this domain.

Definition at line 790 of file domain.c.

References domain_struct::denial, DOMAIN_STATUS_APEX, DOMAIN_STATUS_DS, DOMAIN_STATUS_NONE, DOMAIN_STATUS_NS, DOMAIN_STATUS_OCCLUDED, domain_struct::dstatus, ODS_STATUS_OK, rrset_struct::rr_type, denial_struct::rrset, rrset_queue(), and domain_struct::rrsets.

Referenced by zonedata_queue().

ods_status domain_recover ( domain_type domain,
FILE *  fd,
domain_status  dstatus 
)

Recover domain from backup.

Parameters:
[in] domain domain
[in] fd backup file descriptor
[in] dstatus domain status
Returns:
ods_status status

Recover domain from backup.

Definition at line 115 of file domain.c.

References backup_read_check_str(), backup_read_str(), backup_read_uint32_t(), domain_struct::denial, denial_create(), denial_struct::domain, domain_lookup_rrset(), domain_struct::dstatus, ods_log_assert, ods_log_error(), ODS_STATUS_OK, ods_strcmp(), denial_struct::rrset, rrset_add_rr(), rrset_commit(), rrset_create(), and rrset_recover().

Referenced by zonedata_recover().

void domain_rollback ( domain_type domain  ) 

Rollback updates from domain.

Parameters:
[in] domain the domain

Rollback updates from domain.

Definition at line 720 of file domain.c.

References rrset_rollback(), and domain_struct::rrsets.

Referenced by zonedata_rollback().