OpenDNSSEC-signer
1.4.7
|
#include "config.h"
#include "shared/status.h"
#include "signer/stats.h"
#include <ldns/ldns.h>
#include <libhsm.h>
Go to the source code of this file.
Data Structures | |
struct | rrsig_struct |
struct | rr_struct |
struct | rrset_struct |
Typedefs | |
typedef struct rrsig_struct | rrsig_type |
typedef struct rr_struct | rr_type |
typedef struct rrset_struct | rrset_type |
Functions | |
void | log_rr (ldns_rr *rr, const char *pre, int level) |
void | log_rrset (ldns_rdf *dname, ldns_rr_type type, const char *pre, int level) |
const char * | rrset_type2str (ldns_rr_type type) |
rrset_type * | rrset_create (void *zoneptr, ldns_rr_type type) |
rr_type * | rrset_lookup_rr (rrset_type *rrset, ldns_rr *rr) |
size_t | rrset_count_rr_is_added (rrset_type *rrset) |
rr_type * | rrset_add_rr (rrset_type *rrset, ldns_rr *rr) |
void | rrset_del_rr (rrset_type *rrset, uint16_t rrnum) |
rrsig_type * | rrset_add_rrsig (rrset_type *rrset, ldns_rr *rr, const char *locator, uint32_t flags) |
void | rrset_del_rrsig (rrset_type *rrset, uint16_t rrnum) |
void | rrset_diff (rrset_type *rrset, unsigned is_ixfr, unsigned more_coming) |
ods_status | rrset_sign (hsm_ctx_t *ctx, rrset_type *rrset, time_t signtime) |
void | rrset_print (FILE *fd, rrset_type *rrset, int skip_rrsigs, ods_status *status) |
void | rrset_cleanup (rrset_type *rrset) |
void | rrset_backup2 (FILE *fd, rrset_type *rrset) |
typedef struct rrset_struct rrset_type |
typedef struct rrsig_struct rrsig_type |
void log_rr | ( | ldns_rr * | rr, |
const char * | pre, | ||
int | level | ||
) |
Log RR.
[in] | rr | RR |
[in] | pre | log message |
[in] | level | log level |
Log RR.
Definition at line 48 of file rrset.c.
References LOG_ALERT, LOG_CRIT, LOG_DEBUG, LOG_DEEEBUG, LOG_EMERG, LOG_ERR, LOG_INFO, LOG_NOTICE, LOG_WARNING, ods_fatal_exit(), ods_log_alert(), ods_log_crit(), 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 rrset_add_rr(), rrset_add_rrsig(), rrset_del_rr(), and rrset_del_rrsig().
void log_rrset | ( | ldns_rdf * | dname, |
ldns_rr_type | type, | ||
const char * | pre, | ||
int | level | ||
) |
Log RRset.
[in] | dname | domain name |
[in] | type | RRtype |
[in] | pre | log message |
[in] | level | log level |
Log RRset.
Definition at line 100 of file rrset.c.
References LOG_ALERT, LOG_CRIT, LOG_DEBUG, LOG_DEEEBUG, LOG_EMERG, LOG_ERR, LOG_INFO, LOG_NOTICE, LOG_WARNING, ods_fatal_exit(), ods_log_alert(), ods_log_crit(), ods_log_debug(), ods_log_deeebug(), ods_log_error(), ods_log_get_level(), ods_log_info(), ods_log_verbose(), ods_log_warning(), and rrset_type2str().
Referenced by domain_add_rrset(), domain_del_rrset(), domain_diff(), domain_rollback(), namedb_examine(), rrset_print(), and rrset_sign().
rr_type* rrset_add_rr | ( | rrset_type * | rrset, |
ldns_rr * | rr | ||
) |
Add RR to RRset.
[in] | rrset | RRset |
[in] | rr | RR |
Add RR to RRset.
Definition at line 269 of file rrset.c.
References zone_struct::allocator, allocator_alloc(), allocator_deallocate(), rrset_struct::domain, rr_struct::exists, rr_struct::is_added, rr_struct::is_removed, LOG_DEEEBUG, log_rr(), rrset_struct::needs_signing, ods_fatal_exit(), ods_log_assert, rr_struct::owner, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, rrset_struct::rrtype, and rrset_struct::zone.
Referenced by denial_add_rr(), zone_add_rr(), and zone_update_serial().
rrsig_type* rrset_add_rrsig | ( | rrset_type * | rrset, |
ldns_rr * | rr, | ||
const char * | locator, | ||
uint32_t | flags | ||
) |
Add RRSIG to RRset.
[in] | rrset | RRset |
[in] | rr | RRSIG |
[in] | locator | key locator |
[in] | flags | key flags |
Add RRSIG to RRset.
Definition at line 400 of file rrset.c.
References zone_struct::allocator, allocator_alloc(), allocator_deallocate(), rrset_struct::domain, rrsig_struct::key_flags, rrsig_struct::key_locator, LOG_DEEEBUG, log_rr(), ods_fatal_exit(), ods_log_assert, rrsig_struct::owner, rrsig_struct::rr, rrset_struct::rrsig_count, rrset_struct::rrsigs, and rrset_struct::zone.
Referenced by backup_read_namedb(), and rrset_sign().
void rrset_backup2 | ( | FILE * | fd, |
rrset_type * | rrset | ||
) |
Backup RRset.
[in] | fd | file descriptor |
[in] | rrset | RRset |
Backup RRset.
Definition at line 885 of file rrset.c.
References rrsig_struct::key_flags, rrsig_struct::key_locator, rrsig_struct::rr, rrset_struct::rrsig_count, and rrset_struct::rrsigs.
Referenced by domain_backup2(), and namedb_backup2().
void rrset_cleanup | ( | rrset_type * | rrset | ) |
Clean up RRset.
[in] | rrset | RRset to be cleaned up |
Clean up RRset.
Definition at line 852 of file rrset.c.
References zone_struct::allocator, allocator_deallocate(), rrset_struct::domain, rrsig_struct::key_locator, rrset_struct::next, rrsig_struct::owner, rr_struct::owner, rrsig_struct::rr, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, rrset_cleanup(), rrset_struct::rrsig_count, rrset_struct::rrsigs, and rrset_struct::zone.
Referenced by denial_cleanup(), domain_cleanup(), domain_diff(), domain_rollback(), namedb_wipe_denial(), and rrset_cleanup().
size_t rrset_count_rr_is_added | ( | rrset_type * | rrset | ) |
Count the number of RRs in this RRset that have is_added.
[in] | rrset | RRset |
Count the number of RRs in this RRset that have is_added.
Definition at line 248 of file rrset.c.
References rr_struct::is_added, rrset_struct::rr_count, and rrset_struct::rrs.
Referenced by domain_count_rrset_is_added(), and namedb_examine().
rrset_type* rrset_create | ( | void * | zoneptr, |
ldns_rr_type | type | ||
) |
Create RRset.
[in] | zoneptr | zone reference |
[in] | type | RRtype |
Create RRset.
Definition at line 187 of file rrset.c.
References zone_struct::allocator, allocator_alloc(), rrset_struct::domain, rrset_struct::needs_signing, rrset_struct::next, ods_log_error(), rrset_struct::rr_count, rrset_struct::rrs, rrset_struct::rrsig_count, rrset_struct::rrsigs, rrset_struct::rrtype, and rrset_struct::zone.
Referenced by denial_add_rr(), and zone_add_rr().
void rrset_del_rr | ( | rrset_type * | rrset, |
uint16_t | rrnum | ||
) |
Delete RR from RRset.
[in] | rrset | RRset |
[in] | rrnum | position of RR |
Delete RR from RRset.
Definition at line 307 of file rrset.c.
References zone_struct::allocator, allocator_alloc(), allocator_deallocate(), LOG_DEEEBUG, log_rr(), rrset_struct::needs_signing, ods_fatal_exit(), ods_log_assert, rr_struct::owner, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, and rrset_struct::zone.
Referenced by domain_rollback(), namedb_wipe_denial(), and rrset_diff().
void rrset_del_rrsig | ( | rrset_type * | rrset, |
uint16_t | rrnum | ||
) |
Delete RRSIG from RRset.
[in] | rrset | RRset |
[in] | rrnum | position of RRSIG |
Delete RRSIG from RRset.
Definition at line 436 of file rrset.c.
References zone_struct::allocator, allocator_alloc(), allocator_deallocate(), rrsig_struct::key_locator, LOG_DEEEBUG, log_rr(), ods_fatal_exit(), ods_log_assert, rrsig_struct::owner, rrsig_struct::rr, rrset_struct::rrsig_count, rrset_struct::rrsigs, and rrset_struct::zone.
Referenced by namedb_wipe_denial(), and rrset_diff().
void rrset_diff | ( | rrset_type * | rrset, |
unsigned | is_ixfr, | ||
unsigned | more_coming | ||
) |
Apply differences at RRset.
[in] | rrset | RRset |
[in] | is_ixfr | true if incremental change |
[in] | more_coming | more transactions possible |
Apply differences at RRset.
Definition at line 344 of file rrset.c.
References rr_struct::exists, rr_struct::is_added, rr_struct::is_removed, zone_struct::ixfr, ixfr_add_rr(), ixfr_del_rr(), ixfr_struct::ixfr_lock, lock_basic_lock, lock_basic_unlock, rrsig_struct::rr, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, rrset_del_rr(), rrset_del_rrsig(), rrset_struct::rrsig_count, rrset_struct::rrsigs, rrset_struct::rrtype, and rrset_struct::zone.
Referenced by denial_diff(), domain_diff(), and zone_update_serial().
rr_type* rrset_lookup_rr | ( | rrset_type * | rrset, |
ldns_rr * | rr | ||
) |
Lookup RR in RRset.
[in] | rrset | RRset |
[in] | rr | RR |
Lookup RR in RRset.
Definition at line 219 of file rrset.c.
References ods_log_error(), rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, and util_dnssec_rrs_compare().
Referenced by zone_add_rr(), zone_del_rr(), zone_publish_dnskeys(), zone_publish_nsec3param(), zone_rollback_dnskeys(), and zone_rollback_nsec3param().
void rrset_print | ( | FILE * | fd, |
rrset_type * | rrset, | ||
int | skip_rrsigs, | ||
ods_status * | status | ||
) |
Print RRset.
[in] | fd | file descriptor |
[in] | rrset | RRset to be printed |
[in] | skip_rrsigs | if true, don't print RRSIG records |
[out] | status | status |
Print RRset.
Definition at line 797 of file rrset.c.
References zone_struct::adoutbound, adapter_struct::error, rr_struct::exists, LOG_CRIT, log_rrset(), ods_log_crit(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, rrsig_struct::rr, rr_struct::rr, rrset_struct::rr_count, rrset_struct::rrs, rrset_struct::rrsig_count, rrset_struct::rrsigs, rrset_struct::rrtype, util_rr_print(), and rrset_struct::zone.
Referenced by adapi_printaxfr(), adapi_printixfr(), denial_print(), domain_backup2(), domain_print(), and namedb_backup2().
ods_status rrset_sign | ( | hsm_ctx_t * | ctx, |
rrset_type * | rrset, | ||
time_t | signtime | ||
) |
Sign RRset.
[in] | ctx | HSM context |
[in] | rrset | RRset |
[in] | signtime | time when the zone is being signed |
Sign RRset.
currently, there is no rule that the number of signatures over this RRset equals the number of active keys.
Definition at line 662 of file rrset.c.
References key_struct::algorithm, zone_struct::allocator, allocator_strdup(), zone_struct::apex, keylist_struct::count, rrset_struct::domain, domain_is_delegpt(), domain_is_occluded(), key_struct::flags, zone_struct::ixfr, ixfr_add_rr(), ixfr_struct::ixfr_lock, signconf_struct::keys, keylist_struct::keys, key_struct::ksk, lhsm_sign(), key_struct::locator, lock_basic_lock, lock_basic_unlock, LOG_DEEEBUG, log_rrset(), rrset_struct::needs_signing, ods_log_assert, ods_log_crit(), ods_log_deeebug(), ods_log_error(), ODS_STATUS_HSM_ERR, ODS_STATUS_MALLOC_ERR, ODS_STATUS_OK, rrsig_struct::rr, rr_struct::rr, rrset_struct::rrs, rrset_add_rrsig(), rrset_struct::rrtype, stats_struct::sig_count, stats_struct::sig_reuse, stats_struct::sig_soa_count, zone_struct::signconf, zone_struct::stats, stats_struct::stats_lock, rrset_struct::zone, and key_struct::zsk.
const char* rrset_type2str | ( | ldns_rr_type | type | ) |
Get the string-format of RRtype.
[in] | type | RRtype |
Get the string-format of RRtype.
Definition at line 160 of file rrset.c.
Referenced by domain_del_rrset(), and log_rrset().