OpenDNSSEC-signer  2.0.2
zone.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 NLNet Labs. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
19  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
21  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
23  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  */
26 
27 #ifndef SIGNER_ZONE_H
28 #define SIGNER_ZONE_H
29 
30 #include "config.h"
31 #include <ldns/ldns.h>
32 
38 };
40 
41 typedef struct zone_struct zone_type;
42 
43 #include "adapter/adapter.h"
44 #include "scheduler/schedule.h"
45 #include "locks.h"
46 #include "status.h"
47 #include "signer/ixfr.h"
48 #include "signer/namedb.h"
49 #include "signer/signconf.h"
50 #include "signer/stats.h"
51 #include "signer/rrset.h"
52 #include "wire/buffer.h"
53 #include "wire/notify.h"
54 #include "wire/xfrd.h"
55 
56 struct schedule_struct;
57 
58 struct zone_struct {
59  ldns_rdf* apex; /* wire format zone name */
60  ldns_rr_class klass; /* class */
61  uint32_t default_ttl; /* ttl */
62  /* from conf.xml */
63  char *notify_command; /* placeholder for the whole notify command */
64  const char* notify_ns; /* master name server reload command */
65  char** notify_args; /* reload command arguments */
66  /* from zonelist.xml */
67  const char* name; /* string format zone name */
68  const char* policy_name; /* policy identifier */
69  const char* signconf_filename; /* signconf filename */
70  zone_zl_status zl_status; /* zonelist status */
71  /* adapters */
72  adapter_type* adinbound; /* inbound adapter */
73  adapter_type* adoutbound; /* outbound adapter */
74  /* from signconf.xml */
75  signconf_type* signconf; /* signer configuration values */
76  /* zone data */
79  /* zone transfers */
82  /* worker variables */
83  task_type* task; /* next assigned task */
84  /* statistics */
86  lock_basic_type zone_lock;
87  lock_basic_type xfr_lock;
88  /* backing store for rrsigs (both domain as denial) */
89  collection_class rrstore;
90 };
91 
99 zone_type* zone_create(char* name, ldns_rr_class klass);
100 
111 ods_status zone_load_signconf(zone_type* zone, signconf_type** new_signconf);
112 
121 ods_status zone_reschedule_task(zone_type* zone, schedule_type* taskq,
122  task_id what);
123 
130 ods_status zone_publish_dnskeys(zone_type* zone);
131 
137 void zone_rollback_dnskeys(zone_type* zone);
138 
145 ods_status zone_publish_nsec3param(zone_type* zone);
146 
153 
160 ods_status zone_prepare_keys(zone_type* zone);
161 
168 ods_status zone_update_serial(zone_type* zone);
169 
178 rrset_type* zone_lookup_rrset(zone_type* zone, ldns_rdf* owner,
179  ldns_rr_type type);
180 
192 ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats);
193 
205 ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats);
206 
211 ods_status zone_del_nsec3params(zone_type* zone);
212 
223 void zone_merge(zone_type* z1, zone_type* z2);
224 
230 void zone_cleanup(zone_type* zone);
231 
238 ods_status zone_backup2(zone_type* zone);
239 
245 ods_status zone_recover2(zone_type* zone);
246 
247 #endif /* SIGNER_ZONE_H */
uint32_t default_ttl
Definition: zone.h:61
task_type * task
Definition: zone.h:83
zone_zl_status_enum
Definition: zone.h:33
char * notify_command
Definition: zone.h:63
void zone_merge(zone_type *z1, zone_type *z2)
Definition: zone.c:742
lock_basic_type zone_lock
Definition: zone.h:86
zone_zl_status zl_status
Definition: zone.h:70
ods_status zone_load_signconf(zone_type *zone, signconf_type **new_signconf)
Definition: zone.c:132
ods_status zone_update_serial(zone_type *zone)
Definition: zone.c:481
ods_status zone_add_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:576
ods_status zone_recover2(zone_type *zone)
Definition: zone.c:838
enum task_id_enum task_id
Definition: task.h:46
adapter_type * adoutbound
Definition: zone.h:73
zone_type * zone_create(char *name, ldns_rr_class klass)
Definition: zone.c:54
ods_status zone_publish_nsec3param(zone_type *zone)
Definition: zone.c:343
ods_status zone_del_nsec3params(zone_type *zone)
Definition: zone.c:703
void zone_cleanup(zone_type *zone)
Definition: zone.c:807
namedb_type * db
Definition: zone.h:77
rrset_type * zone_lookup_rrset(zone_type *zone, ldns_rdf *owner, ldns_rr_type type)
Definition: zone.c:557
ixfr_type * ixfr
Definition: zone.h:78
ods_status zone_prepare_keys(zone_type *zone)
Definition: zone.c:439
signconf_type * signconf
Definition: zone.h:75
adapter_type * adinbound
Definition: zone.h:72
char ** notify_args
Definition: zone.h:65
ods_status zone_reschedule_task(zone_type *zone, schedule_type *taskq, task_id what)
Definition: zone.c:186
const char * signconf_filename
Definition: zone.h:69
enum zone_zl_status_enum zone_zl_status
Definition: zone.h:39
const char * notify_ns
Definition: zone.h:64
void zone_rollback_dnskeys(zone_type *zone)
Definition: zone.c:315
ldns_rr_class klass
Definition: zone.h:60
collection_class rrstore
Definition: zone.h:89
void zone_rollback_nsec3param(zone_type *zone)
Definition: zone.c:415
const char * name
Definition: zone.h:67
ods_status zone_publish_dnskeys(zone_type *zone)
Definition: zone.c:230
ods_status zone_backup2(zone_type *zone)
Definition: zone.c:1092
ods_status zone_del_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:659
notify_type * notify
Definition: zone.h:81
const char * policy_name
Definition: zone.h:68
xfrd_type * xfrd
Definition: zone.h:80
ldns_rdf * apex
Definition: zone.h:59
stats_type * stats
Definition: zone.h:85
lock_basic_type xfr_lock
Definition: zone.h:87