OpenDNSSEC-signer  1.3.16
zonedata.h
Go to the documentation of this file.
1 /*
2  * $Id: zonedata.h 7161 2013-06-18 09:59:05Z 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_ZONEDATA_H
35 #define SIGNER_ZONEDATA_H
36 
37 #include "config.h"
38 #include "adapter/adapter.h"
39 #include "daemon/worker.h"
40 #include "scheduler/fifoq.h"
41 #include "shared/allocator.h"
42 #include "shared/status.h"
43 #include "signer/denial.h"
44 #include "signer/domain.h"
45 #include "signer/keys.h"
46 #include "signer/signconf.h"
47 #include "signer/stats.h"
48 #include "signer/nsec3params.h"
49 
50 #include <ldns/ldns.h>
51 #include <stdio.h>
52 
53 
61  ldns_rbtree_t* domains;
62  ldns_rbtree_t* denial_chain;
65  uint32_t default_ttl; /* fallback ttl */
66  uint32_t inbound_serial; /* last seen inbound soa serial */
67  uint32_t internal_serial; /* latest internal soa serial */
68  uint32_t outbound_serial; /* last written outbound soa serial */
69  uint32_t enforced_serial; /* enforce this serial */
70 };
71 
78 
86 
95 
103 /*
104 int zonedata_recover_rr_from_backup(zonedata_type* zd, ldns_rr* rr);
105 */
106 
116 /*
117 int zonedata_recover_rrsig_from_backup(zonedata_type* zd, ldns_rr* rrsig,
118  const char* locator, uint32_t flags);
119 */
120 
128 domain_type* zonedata_lookup_domain(zonedata_type* zd, ldns_rdf* name);
129 
138 
147 
155 denial_type* zonedata_lookup_denial(zonedata_type* zd, ldns_rdf* name);
156 
167  ldns_rdf* apex, nsec3params_type* nsec3params);
168 
177 
186 ods_status zonedata_examine(zonedata_type* zd, ldns_rdf* apex,
187  adapter_mode mode);
188 
197 
205 
212 
220 ods_status zonedata_entize(zonedata_type* zd, ldns_rdf* apex);
221 
231 ods_status zonedata_nsecify(zonedata_type* zd, ldns_rr_class klass,
232  uint32_t ttl, uint32_t* num_added);
233 
244 ods_status zonedata_nsecify3(zonedata_type* zd, ldns_rr_class klass,
245  uint32_t ttl, nsec3params_type* nsec3params, uint32_t* num_added);
246 
256  const char* zone_name);
257 
267  worker_type* worker);
268 
275 
282 
289 
296 void zonedata_backup(FILE* fd, zonedata_type* zd);
297 
306 
314 void log_rdf(ldns_rdf* rdf, const char* pre, int level);
315 
316 #endif /* SIGNER_ZONEDATA_H */
uint32_t outbound_serial
Definition: zonedata.h:68
denial_type * zonedata_lookup_denial(zonedata_type *zd, ldns_rdf *dname)
Definition: zonedata.c:440
void zonedata_cleanup(zonedata_type *zd)
Definition: zonedata.c:1564
ldns_rbtree_t * denial_chain
Definition: zonedata.h:62
int force_serial
Definition: zonedata.h:64
uint32_t internal_serial
Definition: zonedata.h:67
ods_status zonedata_entize(zonedata_type *zd, ldns_rdf *apex)
Definition: zonedata.c:913
zonedata_type * zonedata_create(allocator_type *allocator)
Definition: zonedata.c:165
denial_type * zonedata_del_denial(zonedata_type *zd, denial_type *denial)
Definition: zonedata.c:632
enum ods_enum_status ods_status
Definition: status.h:64
void zonedata_wipe_denial(zonedata_type *zd)
Definition: zonedata.c:1457
domain_type * zonedata_del_domain(zonedata_type *zd, domain_type *domain)
Definition: zonedata.c:388
ldns_rbtree_t * domains
Definition: zonedata.h:61
void zonedata_rollback(zonedata_type *zd)
Definition: zonedata.c:739
void zonedata_cleanup_chain(zonedata_type *zd)
Definition: zonedata.c:1548
uint32_t enforced_serial
Definition: zonedata.h:69
void log_rdf(ldns_rdf *rdf, const char *pre, int level)
Definition: zonedata.c:55
ods_status zonedata_nsecify(zonedata_type *zd, ldns_rr_class klass, uint32_t ttl, uint32_t *num_added)
Definition: zonedata.c:955
ods_status zonedata_diff(zonedata_type *zd, keylist_type *kl)
Definition: zonedata.c:658
void zonedata_backup(FILE *fd, zonedata_type *zd)
Definition: zonedata.c:1584
uint32_t default_ttl
Definition: zonedata.h:65
enum adapter_mode_enum adapter_mode
Definition: adapter.h:50
allocator_type * allocator
Definition: zonedata.h:60
ods_status zonedata_recover(zonedata_type *zd, FILE *fd)
Definition: zonedata.c:202
ods_status zonedata_examine(zonedata_type *zd, ldns_rdf *apex, adapter_mode mode)
Definition: zonedata.c:1408
uint32_t inbound_serial
Definition: zonedata.h:66
ods_status zonedata_commit(zonedata_type *zd)
Definition: zonedata.c:687
ods_status zonedata_update_serial(zonedata_type *zd, signconf_type *sc, const char *zone_name)
Definition: zonedata.c:1196
void zonedata_init_denial(zonedata_type *zd)
Definition: zonedata.c:137
ods_status zonedata_nsecify3(zonedata_type *zd, ldns_rr_class klass, uint32_t ttl, nsec3params_type *nsec3params, uint32_t *num_added)
Definition: zonedata.c:1048
domain_type * zonedata_lookup_domain(zonedata_type *zd, ldns_rdf *dname)
Definition: zonedata.c:314
ods_status zonedata_add_denial(zonedata_type *zd, domain_type *domain, ldns_rdf *apex, nsec3params_type *nsec3params)
Definition: zonedata.c:489
ods_status zonedata_queue(zonedata_type *zd, fifoq_type *q, worker_type *worker)
Definition: zonedata.c:1295
ods_status zonedata_print(FILE *fd, zonedata_type *zd)
Definition: zonedata.c:1609
domain_type * zonedata_add_domain(zonedata_type *zd, domain_type *domain)
Definition: zonedata.c:327