OpenDNSSEC-signer  1.4.5
Data Structures | Typedefs | Functions
rrset.h File Reference
#include "config.h"
#include "shared/status.h"
#include "signer/stats.h"
#include <ldns/ldns.h>
#include <libhsm.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  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_typerrset_create (void *zoneptr, ldns_rr_type type)
 
rr_typerrset_lookup_rr (rrset_type *rrset, ldns_rr *rr)
 
size_t rrset_count_rr_is_added (rrset_type *rrset)
 
rr_typerrset_add_rr (rrset_type *rrset, ldns_rr *rr)
 
void rrset_del_rr (rrset_type *rrset, uint16_t rrnum)
 
rrsig_typerrset_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 Documentation

typedef struct rr_struct rr_type

RR.

Definition at line 58 of file rrset.h.

typedef struct rrset_struct rrset_type

RRset.

Definition at line 71 of file rrset.h.

typedef struct rrsig_struct rrsig_type

RRset. RRSIG.

Definition at line 46 of file rrset.h.

Function Documentation

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 
)
rr_type* rrset_add_rr ( rrset_type rrset,
ldns_rr *  rr 
)
rrsig_type* rrset_add_rrsig ( rrset_type rrset,
ldns_rr *  rr,
const char *  locator,
uint32_t  flags 
)

Add RRSIG to RRset.

Parameters
[in]rrsetRRset
[in]rrRRSIG
[in]locatorkey locator
[in]flagskey flags
Returns
rr_type* added RRSIG

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.

Parameters
[in]fdfile descriptor
[in]rrsetRRset

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)
size_t rrset_count_rr_is_added ( rrset_type rrset)

Count the number of RRs in this RRset that have is_added.

Parameters
[in]rrsetRRset
Returns
size_t number of RRs

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.

Parameters
[in]zoneptrzone reference
[in]typeRRtype
Returns
rrset_type* RRset

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.

Parameters
[in]rrsetRRset
[in]rrnumposition 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.

Parameters
[in]rrsetRRset
[in]rrnumposition 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.

Parameters
[in]rrsetRRset
[in]is_ixfrtrue if incremental change
[in]more_comingmore 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.

Parameters
[in]rrsetRRset
[in]rrRR
Returns
rr_type* RR if found

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.

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

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 
)
const char* rrset_type2str ( ldns_rr_type  type)

Get the string-format of RRtype.

Parameters
[in]typeRRtype
Returns
const char* string-format of RRtype

Get the string-format of RRtype.

Definition at line 160 of file rrset.c.

Referenced by domain_del_rrset(), and log_rrset().