OpenDNSSEC-signer  1.3.15
Functions
rrset.c File Reference
#include "config.h"
#include "daemon/worker.h"
#include "scheduler/fifoq.h"
#include "shared/allocator.h"
#include "shared/duration.h"
#include "shared/file.h"
#include "shared/hsm.h"
#include "shared/log.h"
#include "shared/status.h"
#include "shared/util.h"
#include "signer/rrset.h"
#include <ldns/ldns.h>
#include <stdlib.h>
#include <unistd.h>
Include dependency graph for rrset.c:

Go to the source code of this file.

Functions

void log_rr (ldns_rr *rr, const char *pre, int level)
 
rrset_typerrset_create (ldns_rr_type rrtype)
 
ods_status rrset_recover (rrset_type *rrset, ldns_rr *rrsig, const char *locator, uint32_t flags)
 
int rrset_examine_ns_rdata (rrset_type *rrset, ldns_rdf *nsdname)
 
size_t rrset_count_RR (rrset_type *rrset)
 
size_t rrset_count_rr (rrset_type *rrset, int which)
 
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)
 
void rrset_cleanup (rrset_type *rrset)
 
void rrset_print (FILE *fd, rrset_type *rrset, int skip_rrsigs)
 
void rrset_backup (FILE *fd, rrset_type *rrset)
 

Function Documentation

void log_rr ( ldns_rr *  rr,
const char *  pre,
int  level 
)
ldns_rr* rrset_add_rr ( rrset_type rrset,
ldns_rr *  rr 
)
void rrset_backup ( FILE *  fd,
rrset_type rrset 
)

Backup RRset.

Definition at line 1257 of file rrset.c.

References rrset_struct::rrsigs, and rrsigs_print().

Referenced by domain_backup().

void rrset_cleanup ( rrset_type rrset)
ods_status rrset_commit ( rrset_type rrset)
size_t rrset_count_RR ( rrset_type rrset)
size_t rrset_count_rr ( rrset_type rrset,
int  which 
)

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().

rrset_type* rrset_create ( ldns_rr_type  rrtype)
ldns_rr* rrset_del_rr ( rrset_type rrset,
ldns_rr *  rr,
int  dupallowed 
)
ods_status rrset_diff ( rrset_type rrset,
keylist_type kl 
)
int rrset_examine_ns_rdata ( rrset_type rrset,
ldns_rdf *  nsdname 
)

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.

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

Apparently the queue is full. Lets take a small break to not hog CPU. The worker will release the signq lock while sleeping and will automatically grab the lock when the queue is nonfull. Queue is nonfull at 10% of the queue size.

Definition at line 1130 of file rrset.c.

References fifoq_push(), worker_struct::jobs_appointed, lock_basic_lock, lock_basic_sleep, lock_basic_unlock, LOCKED_Q_WORKER, LOCKED_SLEEP_WORKER, LOCKED_WORKER_RRSET, 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_locked, fifoq_struct::q_nonfull, worker_struct::thread_num, worker_struct::worker_lock, and worker_struct::worker_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.

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.

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 
)
ods_status rrset_wipe_out ( rrset_type rrset)

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().