OpenDNSSEC-signer  1.4.10
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 
32 #ifndef SIGNER_ZONE_H
33 #define SIGNER_ZONE_H
34 
35 #include "config.h"
36 #include "adapter/adapter.h"
37 #include "scheduler/schedule.h"
38 #include "shared/allocator.h"
39 #include "shared/locks.h"
40 #include "shared/status.h"
41 #include "signer/ixfr.h"
42 #include "signer/namedb.h"
43 #include "signer/signconf.h"
44 #include "signer/stats.h"
45 #include "wire/buffer.h"
46 #include "wire/notify.h"
47 #include "wire/xfrd.h"
48 
49 #include <ldns/ldns.h>
50 
51 struct schedule_struct;
52 
58 };
60 
65 typedef struct zone_struct zone_type;
66 struct zone_struct {
67  allocator_type* allocator; /* memory allocator */
68  ldns_rdf* apex; /* wire format zone name */
69  ldns_rr_class klass; /* class */
70  uint32_t default_ttl; /* ttl */
71  /* from conf.xml */
72  char *notify_command; /* placeholder for the whole notify command */
73  const char* notify_ns; /* master name server reload command */
74  char** notify_args; /* reload command arguments */
75  /* from zonelist.xml */
76  const char* name; /* string format zone name */
77  const char* policy_name; /* policy identifier */
78  const char* signconf_filename; /* signconf filename */
79  zone_zl_status zl_status; /* zonelist status */
80  /* adapters */
81  adapter_type* adinbound; /* inbound adapter */
82  adapter_type* adoutbound; /* outbound adapter */
83  /* from signconf.xml */
84  signconf_type* signconf; /* signer configuration values */
85  /* zone data */
88  /* zone transfers */
91  /* worker variables */
92  void* task; /* next assigned task */
93  /* statistics */
97 };
98 
106 zone_type* zone_create(char* name, ldns_rr_class klass);
107 
119 
129  task_id what);
130 
138 
144 void zone_rollback_dnskeys(zone_type* zone);
145 
153 
160 
168 
176 
185 rrset_type* zone_lookup_rrset(zone_type* zone, ldns_rdf* owner,
186  ldns_rr_type type);
187 
199 ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats);
200 
212 ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats);
213 
219 
230 void zone_merge(zone_type* z1, zone_type* z2);
231 
237 void zone_cleanup(zone_type* zone);
238 
246 
253 
254 #endif /* SIGNER_ZONE_H */
uint32_t default_ttl
Definition: zone.h:70
zone_zl_status_enum
Definition: zone.h:53
char * notify_command
Definition: zone.h:72
void zone_merge(zone_type *z1, zone_type *z2)
Definition: zone.c:732
enum ods_enum_status ods_status
Definition: status.h:90
lock_basic_type zone_lock
Definition: zone.h:95
zone_zl_status zl_status
Definition: zone.h:79
ods_status zone_load_signconf(zone_type *zone, signconf_type **new_signconf)
Definition: zone.c:136
ods_status zone_update_serial(zone_type *zone)
Definition: zone.c:472
ods_status zone_add_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:567
ods_status zone_recover2(zone_type *zone)
Definition: zone.c:836
enum task_id_enum task_id
Definition: task.h:48
adapter_type * adoutbound
Definition: zone.h:82
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:335
ods_status zone_del_nsec3params(zone_type *zone)
Definition: zone.c:693
void zone_cleanup(zone_type *zone)
Definition: zone.c:798
namedb_type * db
Definition: zone.h:86
rrset_type * zone_lookup_rrset(zone_type *zone, ldns_rdf *owner, ldns_rr_type type)
Definition: zone.c:548
ixfr_type * ixfr
Definition: zone.h:87
int lock_basic_type
Definition: locks.h:91
ods_status zone_prepare_keys(zone_type *zone)
Definition: zone.c:432
signconf_type * signconf
Definition: zone.h:84
adapter_type * adinbound
Definition: zone.h:81
char ** notify_args
Definition: zone.h:74
ods_status zone_reschedule_task(zone_type *zone, schedule_type *taskq, task_id what)
Definition: zone.c:187
const char * signconf_filename
Definition: zone.h:78
allocator_type * allocator
Definition: zone.h:67
enum zone_zl_status_enum zone_zl_status
Definition: zone.h:59
const char * notify_ns
Definition: zone.h:73
void zone_rollback_dnskeys(zone_type *zone)
Definition: zone.c:305
ldns_rr_class klass
Definition: zone.h:69
void zone_rollback_nsec3param(zone_type *zone)
Definition: zone.c:407
const char * name
Definition: zone.h:76
ods_status zone_publish_dnskeys(zone_type *zone)
Definition: zone.c:231
ods_status zone_backup2(zone_type *zone)
Definition: zone.c:1087
ods_status zone_del_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:649
notify_type * notify
Definition: zone.h:90
void * task
Definition: zone.h:92
const char * policy_name
Definition: zone.h:77
xfrd_type * xfrd
Definition: zone.h:89
ldns_rdf * apex
Definition: zone.h:68
stats_type * stats
Definition: zone.h:94
lock_basic_type xfr_lock
Definition: zone.h:96