rrset.h
Go to the documentation of this file.
/*
* Copyright (c) 2009 NLNet Labs. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef SIGNER_RRSET_H
#define SIGNER_RRSET_H
#include "config.h"
#include <ldns/ldns.h>
typedef struct rrsig_struct rrsig_type;
typedef struct rr_struct rr_type;
typedef struct rrset_struct rrset_type;
#include "status.h"
#include "signer/stats.h"
#include "libhsm.h"
#include "domain.h"
#include "zone.h"
#include "datastructure.h"
struct rrsig_struct {
ldns_rr* rr;
domain_type* owner;
const char* key_locator;
uint32_t key_flags;
};
struct rr_struct {
ldns_rr* rr;
domain_type* owner;
unsigned exists : 1;
unsigned is_added : 1;
unsigned is_removed : 1;
};
struct rrset_struct {
rrset_type* next;
zone_type* zone;
domain_type* domain;
ldns_rr_type rrtype;
rr_type* rrs;
size_t rr_count;
collection_t rrsigs;
unsigned needs_signing : 1;
};
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(zone_type* zone, ldns_rr_type type);
rr_type* rrset_lookup_rr(rrset_type* rrset, ldns_rr* rr);
uint32_t rrset_lookup_ttl(rrset_type* rrset, uint32_t default_ttl);
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);
void rrset_add_rrsig(rrset_type* rrset, ldns_rr* rr,
const char* locator, uint32_t flags);
void rrset_drop_rrsigs(zone_type* zone, rrset_type* rrset);
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);
ods_status rrset_getliteralrr(ldns_rr** dnskey, const char *resourcerecord, uint32_t ttl, ldns_rdf* apex);
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);
collection_class rrset_store_initialize(void);
#endif /* SIGNER_RRSET_H */
rrset_cleanup
void rrset_cleanup(rrset_type *rrset)
Definition: rrset.c:925
rrset_diff
void rrset_diff(rrset_type *rrset, unsigned is_ixfr, unsigned more_coming)
Definition: rrset.c:366
rrset_struct::rr_count
size_t rr_count
Definition: rrset.h:65
rrsig_struct::key_flags
uint32_t key_flags
Definition: rrset.h:48
rrset_struct::rrsigs
collection_t rrsigs
Definition: rrset.h:66
rr_struct
Definition: rrset.h:51
rrset_print
void rrset_print(FILE *fd, rrset_type *rrset, int skip_rrsigs, ods_status *status)
Definition: rrset.c:868
zone_struct
Definition: zone.h:60
rrset_count_rr_is_added
size_t rrset_count_rr_is_added(rrset_type *rrset)
Definition: rrset.c:278
rrset_drop_rrsigs
void rrset_drop_rrsigs(zone_type *zone, rrset_type *rrset)
Definition: rrset.c:416
rrset_struct::rrtype
ldns_rr_type rrtype
Definition: rrset.h:63
rrset_struct::next
rrset_type * next
Definition: rrset.h:60
stats.h
rrset_backup2
void rrset_backup2(FILE *fd, rrset_type *rrset)
Definition: rrset.c:948
rrset_del_rr
void rrset_del_rr(rrset_type *rrset, uint16_t rrnum)
Definition: rrset.c:334
rr_struct::exists
unsigned exists
Definition: rrset.h:54
log_rrset
void log_rrset(ldns_rdf *dname, ldns_rr_type type, const char *pre, int level)
Definition: rrset.c:99
rrset_store_initialize
collection_class rrset_store_initialize(void)
Definition: rrset.c:223
rr_struct::is_removed
unsigned is_removed
Definition: rrset.h:56
rrset_struct::needs_signing
unsigned needs_signing
Definition: rrset.h:67
rrset_type2str
const char * rrset_type2str(ldns_rr_type type)
Definition: rrset.c:158
rrsig_struct::rr
ldns_rr * rr
Definition: rrset.h:45
domain_struct
Definition: domain.h:52
rrsig_struct::owner
domain_type * owner
Definition: rrset.h:46
rrsig_struct::key_locator
const char * key_locator
Definition: rrset.h:47
rr_struct::owner
domain_type * owner
Definition: rrset.h:53
rrset_struct::domain
domain_type * domain
Definition: rrset.h:62
rrset_add_rrsig
void rrset_add_rrsig(rrset_type *rrset, ldns_rr *rr, const char *locator, uint32_t flags)
Definition: rrset.c:435
rrset_add_rr
rr_type * rrset_add_rr(rrset_type *rrset, ldns_rr *rr)
Definition: rrset.c:299
rr_struct::rr
ldns_rr * rr
Definition: rrset.h:52
zone.h
rrset_struct
Definition: rrset.h:59
domain.h
rrset_lookup_ttl
uint32_t rrset_lookup_ttl(rrset_type *rrset, uint32_t default_ttl)
Definition: rrset.c:263
rrsig_struct
Definition: rrset.h:44
rrset_lookup_rr
rr_type * rrset_lookup_rr(rrset_type *rrset, ldns_rr *rr)
Definition: rrset.c:236
rr_struct::is_added
unsigned is_added
Definition: rrset.h:55
rrset_sign
ods_status rrset_sign(hsm_ctx_t *ctx, rrset_type *rrset, time_t signtime)
Definition: rrset.c:667
rrset_create
rrset_type * rrset_create(zone_type *zone, ldns_rr_type type)
Definition: rrset.c:199
log_rr
void log_rr(ldns_rr *rr, const char *pre, int level)
Definition: rrset.c:48
rrset_struct::rrs
rr_type * rrs
Definition: rrset.h:64
rrset_getliteralrr
ods_status rrset_getliteralrr(ldns_rr **dnskey, const char *resourcerecord, uint32_t ttl, ldns_rdf *apex)
Definition: rrset.c:848
rrset_struct::zone
zone_type * zone
Definition: rrset.h:61