OpenDNSSEC-signer  2.1.6
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 #include "datastructure.h"
56 #include "daemon/engine.h"
57 
58 struct schedule_struct;
59 
60 struct zone_struct {
61  ldns_rdf* apex; /* wire format zone name */
62  ldns_rr_class klass; /* class */
63  uint32_t default_ttl; /* ttl */
64  /* from conf.xml */
65  char *notify_command; /* placeholder for the whole notify command */
66  const char* notify_ns; /* master name server reload command */
67  char** notify_args; /* reload command arguments */
68  /* from zonelist.xml */
69  const char* name; /* string format zone name */
70  const char* policy_name; /* policy identifier */
71  const char* signconf_filename; /* signconf filename */
72  zone_zl_status zl_status; /* zonelist status */
73  /* adapters */
74  adapter_type* adinbound; /* inbound adapter */
75  adapter_type* adoutbound; /* outbound adapter */
76  /* from signconf.xml */
77  signconf_type* signconf; /* signer configuration values */
78  /* zone data */
81  /* zone transfers */
84  /* statistics */
86  pthread_mutex_t zone_lock;
87  pthread_mutex_t xfr_lock;
88  /* backing store for rrsigs (both domain as denial) */
89  collection_class rrstore;
90  int zoneconfigvalid; /* flag indicating whether the signconf has at least once been read */
91 };
92 
93 
101 zone_type* zone_create(char* name, ldns_rr_class klass);
102 
113 ods_status zone_load_signconf(zone_type* zone, signconf_type** new_signconf);
114 
123 ods_status zone_reschedule_task(zone_type* zone, schedule_type* taskq,
124  task_id what);
125 
132 ods_status zone_publish_dnskeys(zone_type* zone, int skip_hsm_access);
133 
139 void zone_rollback_dnskeys(zone_type* zone);
140 
147 ods_status zone_publish_nsec3param(zone_type* zone);
148 
155 
162 ods_status zone_prepare_keys(zone_type* zone);
163 
170 ods_status zone_update_serial(zone_type* zone);
171 
180 rrset_type* zone_lookup_rrset(zone_type* zone, ldns_rdf* owner,
181  ldns_rr_type type);
182 
194 ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats);
195 
207 ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats);
208 
213 ods_status zone_del_nsec3params(zone_type* zone);
214 
225 void zone_merge(zone_type* z1, zone_type* z2);
226 
232 void zone_cleanup(zone_type* zone);
233 
240 ods_status zone_backup2(zone_type* zone, time_t nextResign);
241 
247 ods_status zone_recover2(engine_type* engine, zone_type* zone);
248 
249 #endif /* SIGNER_ZONE_H */
ZONE_ZL_ADDED
@ ZONE_ZL_ADDED
Definition: zone.h:35
zone_reschedule_task
ods_status zone_reschedule_task(zone_type *zone, schedule_type *taskq, task_id what)
zone_publish_dnskeys
ods_status zone_publish_dnskeys(zone_type *zone, int skip_hsm_access)
Definition: zone.c:186
zone_add_rr
ods_status zone_add_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:531
zone_struct::notify_ns
const char * notify_ns
Definition: zone.h:66
zone_struct::default_ttl
uint32_t default_ttl
Definition: zone.h:63
ZONE_ZL_REMOVED
@ ZONE_ZL_REMOVED
Definition: zone.h:37
zone_lookup_rrset
rrset_type * zone_lookup_rrset(zone_type *zone, ldns_rdf *owner, ldns_rr_type type)
Definition: zone.c:512
notify.h
zone_struct::notify_args
char ** notify_args
Definition: zone.h:67
zone_struct
Definition: zone.h:60
zone_update_serial
ods_status zone_update_serial(zone_type *zone)
Definition: zone.c:436
zone_struct::zone_lock
pthread_mutex_t zone_lock
Definition: zone.h:86
adapter_struct
Definition: adapter.h:57
zone_struct::signconf_filename
const char * signconf_filename
Definition: zone.h:71
ixfr_struct
Definition: ixfr.h:62
ixfr.h
rrset_struct
Definition: rrset.h:59
zone_struct::xfrd
xfrd_type * xfrd
Definition: zone.h:82
ZONE_ZL_OK
@ ZONE_ZL_OK
Definition: zone.h:34
zone_load_signconf
ods_status zone_load_signconf(zone_type *zone, signconf_type **new_signconf)
Definition: zone.c:133
zone_struct::apex
ldns_rdf * apex
Definition: zone.h:61
zone_struct::klass
ldns_rr_class klass
Definition: zone.h:62
zone_struct::name
const char * name
Definition: zone.h:69
signconf.h
zone_struct::rrstore
collection_class rrstore
Definition: zone.h:89
notify_struct
Definition: notify.h:56
zone_cleanup
void zone_cleanup(zone_type *zone)
Definition: zone.c:761
zone_rollback_dnskeys
void zone_rollback_dnskeys(zone_type *zone)
Definition: zone.c:279
zone_del_nsec3params
ods_status zone_del_nsec3params(zone_type *zone)
Definition: zone.c:657
stats.h
zone_recover2
ods_status zone_recover2(engine_type *engine, zone_type *zone)
Definition: zone.c:794
zone_publish_nsec3param
ods_status zone_publish_nsec3param(zone_type *zone)
Definition: zone.c:307
namedb_struct
Definition: namedb.h:49
rrset.h
zone_struct::signconf
signconf_type * signconf
Definition: zone.h:77
ZONE_ZL_UPDATED
@ ZONE_ZL_UPDATED
Definition: zone.h:36
zone_struct::zoneconfigvalid
int zoneconfigvalid
Definition: zone.h:90
zone_merge
void zone_merge(zone_type *z1, zone_type *z2)
Definition: zone.c:696
stats_struct
Definition: stats.h:50
zone_struct::db
namedb_type * db
Definition: zone.h:79
buffer.h
zone_struct::stats
stats_type * stats
Definition: zone.h:85
zone_struct::policy_name
const char * policy_name
Definition: zone.h:70
signconf_struct
Definition: signconf.h:41
engine_struct
Definition: engine.h:51
zone_rollback_nsec3param
void zone_rollback_nsec3param(zone_type *zone)
Definition: zone.c:370
zone_zl_status_enum
zone_zl_status_enum
Definition: zone.h:33
zone_create
zone_type * zone_create(char *name, ldns_rr_class klass)
Definition: zone.c:55
xfrd.h
zone_prepare_keys
ods_status zone_prepare_keys(zone_type *zone)
Definition: zone.c:394
zone_struct::notify_command
char * notify_command
Definition: zone.h:65
xfrd_struct
Definition: xfrd.h:93
adapter.h
engine.h
namedb.h
zone_del_rr
ods_status zone_del_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:613
zone_struct::ixfr
ixfr_type * ixfr
Definition: zone.h:80
zone_struct::adoutbound
adapter_type * adoutbound
Definition: zone.h:75
zone_zl_status
enum zone_zl_status_enum zone_zl_status
Definition: zone.h:39
zone_struct::zl_status
zone_zl_status zl_status
Definition: zone.h:72
zone_backup2
ods_status zone_backup2(zone_type *zone, time_t nextResign)
Definition: zone.c:1042
zone_struct::adinbound
adapter_type * adinbound
Definition: zone.h:74
zone_struct::xfr_lock
pthread_mutex_t xfr_lock
Definition: zone.h:87
zone_struct::notify
notify_type * notify
Definition: zone.h:83