OpenDNSSEC-signer  1.3.9
Data Structures | Macros | Typedefs | Functions
rrset.h File Reference
#include "config.h"
#include "daemon/worker.h"
#include "scheduler/fifoq.h"
#include "shared/allocator.h"
#include "shared/hsm.h"
#include "shared/locks.h"
#include "shared/status.h"
#include "signer/keys.h"
#include "signer/rrsigs.h"
#include "signer/signconf.h"
#include "signer/stats.h"
#include <ldns/ldns.h>
Include dependency graph for rrset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rrset_struct

Macros

#define COUNT_RR   0
#define COUNT_ADD   1
#define COUNT_DEL   2

Typedefs

typedef struct rrset_struct rrset_type

Functions

rrset_typerrset_create (ldns_rr_type rrtype)
ods_status rrset_recover (rrset_type *rrset, ldns_rr *rrsig, const char *locator, uint32_t flags)
size_t rrset_count_rr (rrset_type *rrset, int which)
size_t rrset_count_RR (rrset_type *rrset)
ldns_rr * rrset_add_rr (rrset_type *rrset, ldns_rr *rr)
ldns_rr * rrset_del_rr (rrset_type *rrset, ldns_rr *rr, int dupallowed)
ods_status rrset_wipe_out (rrset_type *rrset)
ods_status rrset_diff (rrset_type *rrset, keylist_type *kl)
ods_status rrset_commit (rrset_type *rrset)
void rrset_rollback (rrset_type *rrset)
ods_status rrset_sign (hsm_ctx_t *ctx, rrset_type *rrset, ldns_rdf *owner, signconf_type *sc, time_t signtime, stats_type *stats)
ods_status rrset_queue (rrset_type *rrset, fifoq_type *q, worker_type *worker)
int rrset_examine_ns_rdata (rrset_type *rrset, ldns_rdf *nsdname)
void rrset_cleanup (rrset_type *rrset)
void log_rr (ldns_rr *rr, const char *pre, int level)
void rrset_print (FILE *fd, rrset_type *rrset, int skip_rrsigs)
void rrset_backup (FILE *fd, rrset_type *rrset)

Macro Definition Documentation

#define COUNT_ADD   1

Definition at line 52 of file rrset.h.

Referenced by domain_commit(), and rrset_count_rr().

#define COUNT_DEL   2

Definition at line 53 of file rrset.h.

Referenced by domain_commit(), and rrset_count_rr().

#define COUNT_RR   0

RRset.

Definition at line 51 of file rrset.h.

Referenced by domain_commit(), domain_count_rrset(), and rrset_count_rr().


Typedef Documentation

typedef struct rrset_struct rrset_type

Definition at line 55 of file rrset.h.


Function Documentation

void log_rr ( ldns_rr *  rr,
const char *  pre,
int  level 
)

Log RR.

Parameters:
[in]rrRR
[in]prestring to log before RR
[in]levellog level

Log RR.

Definition at line 58 of file rrset.c.

References ods_log_debug(), ods_log_deeebug(), ods_log_error(), ods_log_get_level(), ods_log_info(), ods_log_verbose(), and ods_log_warning().

Referenced by domain_examine_rrset_is_alone(), rrset_add_rr(), rrset_del_rr(), rrset_recover(), and rrset_sign().

ldns_rr* rrset_add_rr ( rrset_type rrset,
ldns_rr *  rr 
)

Add RR to RRset.

Parameters:
[in]rrsetRRset
[in]rrRR
Returns:
ldns_rr* added RR

Add RR to RRset.

Definition at line 265 of file rrset.c.

References rrset_struct::add, rrset_struct::add_count, log_rr(), ods_log_assert, ods_log_error(), ods_log_warning(), rrset_struct::rr_type, and util_dnssec_rrs_add_rr().

Referenced by denial_nsecify(), denial_nsecify3(), domain_recover(), and zone_add_rr().

void rrset_backup ( FILE *  fd,
rrset_type rrset 
)

Backup RRset.

Parameters:
[in]fdfile descriptor
[in]rrsetRRset

Backup RRset.

Definition at line 1246 of file rrset.c.

References rrset_struct::rrsigs, and rrsigs_print().

Referenced by domain_backup().

void rrset_cleanup ( rrset_type rrset)

Clean up RRset.

Parameters:
[in]rrsetRRset to be cleaned up

Clean up RRset.

Definition at line 1178 of file rrset.c.

References rrset_struct::add, rrset_struct::allocator, allocator_cleanup(), allocator_deallocate(), rrset_struct::del, rrset_struct::rrs, rrset_struct::rrsigs, and rrsigs_cleanup().

Referenced by denial_cleanup(), domain_del_rrset(), and zonedata_wipe_denial().

ods_status rrset_commit ( rrset_type rrset)

Commit updates from RRset.

Parameters:
[in]rrsetRRset
Returns:
ods_status status

Commit updates from RRset.

Definition at line 653 of file rrset.c.

References rrset_struct::add, rrset_struct::add_count, rrset_struct::del, rrset_struct::del_count, rrset_struct::needs_signing, ods_log_alert(), ods_log_assert, ods_status2str(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, and rrset_struct::rr_type.

Referenced by denial_nsecify(), denial_nsecify3(), domain_commit(), and domain_recover().

size_t rrset_count_rr ( rrset_type rrset,
int  which 
)

Count the number of RRs in this RRset.

Parameters:
[in]rrsetRRset
[in]whichwhich RRset to be counted
Returns:
size_t number of RRs

Count the number of RRs in this RRset.

Definition at line 241 of file rrset.c.

References rrset_struct::add_count, COUNT_ADD, COUNT_DEL, COUNT_RR, rrset_struct::del_count, and rrset_struct::rr_count.

Referenced by domain_commit(), and domain_count_rrset().

size_t rrset_count_RR ( rrset_type rrset)

Return the number of RRs in RRset after an update.

Parameters:
[in]rrsetRRset
Returns:
size_t number of RRs after an update

Return the number of RRs in RRset after an update.

Definition at line 229 of file rrset.c.

References rrset_struct::add_count, rrset_struct::del_count, ods_log_assert, and rrset_struct::rr_count.

Referenced by domain_examine_data_exists(), domain_examine_rrset_is_alone(), domain_examine_rrset_is_singleton(), and domain_examine_valid_zonecut().

rrset_type* rrset_create ( ldns_rr_type  rrtype)
ldns_rr* rrset_del_rr ( rrset_type rrset,
ldns_rr *  rr,
int  dupallowed 
)

Delete RR from RRset.

Parameters:
[in]rrsetRRset
[in]rrRR
[in]dupallowedif true, allow duplicate deletions
Returns:
ldns_rr* RR if failed

Delete RR from RRset.

Definition at line 326 of file rrset.c.

References rrset_struct::del, rrset_struct::del_count, log_rr(), ods_log_assert, ods_log_error(), ods_log_warning(), rrset_struct::rr_type, and util_dnssec_rrs_add_rr().

Referenced by rrset_diff(), rrset_wipe_out(), and zone_del_rr().

ods_status rrset_diff ( rrset_type rrset,
keylist_type kl 
)

Calculate differences between the current RRset and the pending new one.

Parameters:
[in]rrsetRRset
[in]klcurrent key list
Returns:
ods_status status

Calculate differences between the current RRset and the pending new one.

Definition at line 427 of file rrset.c.

References rrset_struct::add, rrset_struct::add_count, keylist_lookup_by_dnskey(), rrset_struct::needs_signing, ods_log_assert, ods_log_error(), ODS_STATUS_ERR, ODS_STATUS_OK, rrset_struct::rr_type, rrset_struct::rrs, rrset_del_rr(), and util_dnssec_rrs_compare().

Referenced by domain_diff().

int rrset_examine_ns_rdata ( rrset_type rrset,
ldns_rdf *  nsdname 
)

Examine NS RRset and verify its RDATA.

Parameters:
[in]rrsetNS RRset
[in]nsdnamedomain name that should match NS RDATA
Returns:
int 1 if match, 0 otherwise

Examine NS RRset and verify its RDATA.

Definition at line 209 of file rrset.c.

References rrset_struct::add, rrset_struct::del, rrset_struct::rr_type, and rrset_struct::rrs.

Referenced by domain_examine_ns_rdata().

void rrset_print ( FILE *  fd,
rrset_type rrset,
int  skip_rrsigs 
)

Print RRset.

Parameters:
[in]fdfile descriptor
[in]rrsetRRset to be printed
[in]skip_rrsigsif true, don't print RRSIG records

Print RRset.

Definition at line 1215 of file rrset.c.

References ods_log_assert, rrset_struct::rr_type, rrset_struct::rrs, rrset_struct::rrsigs, and rrsigs_print().

Referenced by domain_backup(), and domain_print().

ods_status rrset_queue ( rrset_type rrset,
fifoq_type q,
worker_type worker 
)

Queue RRset.

Parameters:
[in]rrsetRRset
[in]qqueue
[in]workerowner of RRset
Returns:
ods_status status

Queue RRset.

If tries are 0 they we have tries FIFOQ_TRIES_COUNT times, lets take a small break to not hog CPU.

Definition at line 1128 of file rrset.c.

References fifoq_push(), worker_struct::jobs_appointed, lock_basic_lock, lock_basic_unlock, worker_struct::need_to_exit, ods_log_assert, ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, fifoq_struct::q_lock, fifoq_struct::q_nonfull, worker_struct::worker_lock, and worker_wait_timeout_locked().

Referenced by domain_queue().

ods_status rrset_recover ( rrset_type rrset,
ldns_rr *  rrsig,
const char *  locator,
uint32_t  flags 
)

Recover RRSIG from backup.

Parameters:
[in]rrsetRRset
[in]rrsigRRSIG
[in]locatorkey locator
[in]flagskey flags
Returns:
ods_status status

Recover RRSIG from backup.

This RRset was recovered, no need for signing. If the signature is about to expire, the recycle logic will catch that.

Definition at line 149 of file rrset.c.

References log_rr(), rrset_struct::needs_signing, ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, rrset_struct::rrsig_count, rrset_struct::rrsigs, rrsigs_add_sig(), and rrsigs_create().

Referenced by domain_recover().

void rrset_rollback ( rrset_type rrset)

Rollback updates from RRset.

Parameters:
[in]rrsetRRset

Rollback updates from RRset.

Definition at line 708 of file rrset.c.

References rrset_struct::add, rrset_struct::add_count, rrset_struct::del, and rrset_struct::del_count.

Referenced by domain_rollback().

ods_status rrset_sign ( hsm_ctx_t *  ctx,
rrset_type rrset,
ldns_rdf *  owner,
signconf_type sc,
time_t  signtime,
stats_type stats 
)

Sign RRset.

Parameters:
[in]ctxHSM context
[in]rrsetRRset
[in]ownerowner of the zone
[in]scsigner configuration
[in]signtimetime when the zone is being signed
[out]statsupdate statistics
Returns:
ods_status status

Sign RRset.

currently, there is no rule that the number of signatures over this RRset equals the number of active keys.

Definition at line 957 of file rrset.c.

References key_struct::algorithm, keylist_struct::first_key, key_struct::flags, rrsigs_struct::key_flags, rrsigs_struct::key_locator, signconf_struct::keys, key_struct::ksk, lhsm_sign(), key_struct::locator, lock_basic_lock, lock_basic_unlock, log_rr(), rrsigs_struct::next, key_struct::next, ods_log_assert, ods_log_deeebug(), ods_log_error(), ods_log_warning(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, rrsigs_struct::rr, rrset_struct::rr_type, rrset_struct::rrsig_count, rrset_struct::rrsigs, rrsigs_add_sig(), rrsigs_cleanup(), rrsigs_create(), stats_struct::sig_count, stats_struct::sig_reuse, stats_struct::sig_soa_count, stats_struct::stats_lock, and key_struct::zsk.

ods_status rrset_wipe_out ( rrset_type rrset)

Wipe out current RRs in RRset.

Parameters:
[in]rrsetRRset
Returns:
ods_status status

Wipe out current RRs in RRset.

Definition at line 390 of file rrset.c.

References ods_log_error(), ODS_STATUS_ERR, ODS_STATUS_OK, rrset_struct::rr_type, rrset_struct::rrs, and rrset_del_rr().

Referenced by denial_nsecify(), and denial_nsecify3().