OpenDNSSEC-signer  2.1.4
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 */
uint32_t default_ttl
Definition: zone.h:63
zone_zl_status_enum
Definition: zone.h:33
char * notify_command
Definition: zone.h:65
void zone_merge(zone_type *z1, zone_type *z2)
Definition: zone.c:696
int zoneconfigvalid
Definition: zone.h:90
zone_zl_status zl_status
Definition: zone.h:72
ods_status zone_load_signconf(zone_type *zone, signconf_type **new_signconf)
Definition: zone.c:133
ods_status zone_update_serial(zone_type *zone)
Definition: zone.c:436
ods_status zone_add_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:531
adapter_type * adoutbound
Definition: zone.h:75
ods_status zone_backup2(zone_type *zone, time_t nextResign)
Definition: zone.c:1042
zone_type * zone_create(char *name, ldns_rr_class klass)
Definition: zone.c:55
ods_status zone_publish_nsec3param(zone_type *zone)
Definition: zone.c:307
pthread_mutex_t zone_lock
Definition: zone.h:86
ods_status zone_del_nsec3params(zone_type *zone)
Definition: zone.c:657
void zone_cleanup(zone_type *zone)
Definition: zone.c:761
namedb_type * db
Definition: zone.h:79
rrset_type * zone_lookup_rrset(zone_type *zone, ldns_rdf *owner, ldns_rr_type type)
Definition: zone.c:512
ixfr_type * ixfr
Definition: zone.h:80
ods_status zone_prepare_keys(zone_type *zone)
Definition: zone.c:394
signconf_type * signconf
Definition: zone.h:77
adapter_type * adinbound
Definition: zone.h:74
ods_status zone_publish_dnskeys(zone_type *zone, int skip_hsm_access)
Definition: zone.c:186
char ** notify_args
Definition: zone.h:67
ods_status zone_reschedule_task(zone_type *zone, schedule_type *taskq, task_id what)
const char * signconf_filename
Definition: zone.h:71
enum zone_zl_status_enum zone_zl_status
Definition: zone.h:39
const char * notify_ns
Definition: zone.h:66
void zone_rollback_dnskeys(zone_type *zone)
Definition: zone.c:279
ldns_rr_class klass
Definition: zone.h:62
collection_class rrstore
Definition: zone.h:89
void zone_rollback_nsec3param(zone_type *zone)
Definition: zone.c:370
pthread_mutex_t xfr_lock
Definition: zone.h:87
const char * name
Definition: zone.h:69
ods_status zone_del_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:613
ods_status zone_recover2(engine_type *engine, zone_type *zone)
Definition: zone.c:794
notify_type * notify
Definition: zone.h:83
const char * policy_name
Definition: zone.h:70
xfrd_type * xfrd
Definition: zone.h:82
ldns_rdf * apex
Definition: zone.h:61
stats_type * stats
Definition: zone.h:85