OpenDNSSEC-signer  1.3.9
rrset.h
Go to the documentation of this file.
1 /*
2  * $Id: rrset.h 5408 2011-08-16 08:15:16Z matthijs $
3  *
4  * Copyright (c) 2009 NLNet Labs. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
19  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
21  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
25  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  */
28 
34 #ifndef SIGNER_RRSET_H
35 #define SIGNER_RRSET_H
36 
37 #include "config.h"
38 #include "daemon/worker.h"
39 #include "scheduler/fifoq.h"
40 #include "shared/allocator.h"
41 #include "shared/hsm.h"
42 #include "shared/locks.h"
43 #include "shared/status.h"
44 #include "signer/keys.h"
45 #include "signer/rrsigs.h"
46 #include "signer/signconf.h"
47 #include "signer/stats.h"
48 
49 #include <ldns/ldns.h>
50 
51 #define COUNT_RR 0
52 #define COUNT_ADD 1
53 #define COUNT_DEL 2
54 
55 typedef struct rrset_struct rrset_type;
56 struct rrset_struct {
58  ldns_rr_type rr_type;
59  uint32_t rr_count;
60  uint32_t add_count;
61  uint32_t del_count;
62  uint32_t rrsig_count;
64  ldns_dnssec_rrs* rrs;
65  ldns_dnssec_rrs* add;
66  ldns_dnssec_rrs* del;
68 };
69 
76 rrset_type* rrset_create(ldns_rr_type rrtype);
77 
87 ods_status rrset_recover(rrset_type* rrset, ldns_rr* rrsig,
88  const char* locator, uint32_t flags);
89 
97 size_t rrset_count_rr(rrset_type* rrset, int which);
98 
105 size_t rrset_count_RR(rrset_type* rrset);
106 
114 ldns_rr* rrset_add_rr(rrset_type* rrset, ldns_rr* rr);
115 
124 ldns_rr* rrset_del_rr(rrset_type* rrset, ldns_rr* rr, int dupallowed);
125 
133 
142 
150 
156 void rrset_rollback(rrset_type* rrset);
157 
169 ods_status rrset_sign(hsm_ctx_t* ctx, rrset_type* rrset, ldns_rdf* owner,
170  signconf_type* sc, time_t signtime, stats_type* stats);
171 
181 
189 int rrset_examine_ns_rdata(rrset_type* rrset, ldns_rdf* nsdname);
190 
196 void rrset_cleanup(rrset_type* rrset);
197 
205 void log_rr(ldns_rr* rr, const char* pre, int level);
206 
214 void rrset_print(FILE* fd, rrset_type* rrset, int skip_rrsigs);
215 
222 void rrset_backup(FILE* fd, rrset_type* rrset);
223 
224 #endif /* SIGNER_RRSET_H */