OpenDNSSEC-signer 2.1.12
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
41typedef 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
58struct schedule_struct;
59
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
101extern zone_type* zone_create(char* name, ldns_rr_class klass);
102
113extern ods_status zone_load_signconf(zone_type* zone, signconf_type** new_signconf);
114
123extern ods_status zone_reschedule_task(zone_type* zone, schedule_type* taskq,
124 task_id what);
125
132extern ods_status zone_publish_dnskeys(zone_type* zone, int skip_hsm_access);
133
139extern void zone_rollback_dnskeys(zone_type* zone);
140
147extern ods_status zone_publish_nsec3param(zone_type* zone);
148
154extern void zone_rollback_nsec3param(zone_type* zone);
155
162extern ods_status zone_prepare_keys(zone_type* zone);
163
170extern ods_status zone_update_serial(zone_type* zone);
171
180extern rrset_type* zone_lookup_rrset(zone_type* zone, ldns_rdf* owner,
181 ldns_rr_type type);
182
194extern ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats);
195
207extern ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats);
208
213extern ods_status zone_del_nsec3params(zone_type* zone);
214
225extern void zone_merge(zone_type* z1, zone_type* z2);
226
232extern void zone_cleanup(zone_type* zone);
233
240extern ods_status zone_backup2(zone_type* zone, time_t nextResign);
241
247extern ods_status zone_recover2(engine_type* engine, zone_type* zone);
248
249#endif /* SIGNER_ZONE_H */
char * notify_command
Definition: zone.h:65
collection_class rrstore
Definition: zone.h:89
signconf_type * signconf
Definition: zone.h:77
notify_type * notify
Definition: zone.h:83
char ** notify_args
Definition: zone.h:67
uint32_t default_ttl
Definition: zone.h:63
const char * notify_ns
Definition: zone.h:66
const char * policy_name
Definition: zone.h:70
stats_type * stats
Definition: zone.h:85
namedb_type * db
Definition: zone.h:79
pthread_mutex_t xfr_lock
Definition: zone.h:87
ldns_rr_class klass
Definition: zone.h:62
adapter_type * adinbound
Definition: zone.h:74
ldns_rdf * apex
Definition: zone.h:61
ixfr_type * ixfr
Definition: zone.h:80
const char * signconf_filename
Definition: zone.h:71
zone_zl_status zl_status
Definition: zone.h:72
int zoneconfigvalid
Definition: zone.h:90
xfrd_type * xfrd
Definition: zone.h:82
const char * name
Definition: zone.h:69
pthread_mutex_t zone_lock
Definition: zone.h:86
adapter_type * adoutbound
Definition: zone.h:75
ods_status zone_backup2(zone_type *zone, time_t nextResign)
Definition: zone.c:1040
void zone_rollback_nsec3param(zone_type *zone)
Definition: zone.c:369
ods_status zone_update_serial(zone_type *zone)
Definition: zone.c:434
ods_status zone_publish_dnskeys(zone_type *zone, int skip_hsm_access)
Definition: zone.c:186
zone_zl_status_enum
Definition: zone.h:33
@ ZONE_ZL_REMOVED
Definition: zone.h:37
@ ZONE_ZL_ADDED
Definition: zone.h:35
@ ZONE_ZL_OK
Definition: zone.h:34
@ ZONE_ZL_UPDATED
Definition: zone.h:36
ods_status zone_add_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:529
void zone_rollback_dnskeys(zone_type *zone)
Definition: zone.c:279
ods_status zone_del_nsec3params(zone_type *zone)
Definition: zone.c:655
ods_status zone_reschedule_task(zone_type *zone, schedule_type *taskq, task_id what)
void zone_merge(zone_type *z1, zone_type *z2)
Definition: zone.c:694
enum zone_zl_status_enum zone_zl_status
Definition: zone.h:39
ods_status zone_load_signconf(zone_type *zone, signconf_type **new_signconf)
Definition: zone.c:133
ods_status zone_del_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:611
void zone_cleanup(zone_type *zone)
Definition: zone.c:759
ods_status zone_prepare_keys(zone_type *zone)
Definition: zone.c:393
ods_status zone_publish_nsec3param(zone_type *zone)
Definition: zone.c:306
zone_type * zone_create(char *name, ldns_rr_class klass)
Definition: zone.c:55
ods_status zone_recover2(engine_type *engine, zone_type *zone)
Definition: zone.c:792
rrset_type * zone_lookup_rrset(zone_type *zone, ldns_rdf *owner, ldns_rr_type type)
Definition: zone.c:510