OpenDNSSEC-signer  1.3.9
zone.h
Go to the documentation of this file.
1 /*
2  * $Id: zone.h 5432 2011-08-22 12:55:04Z matthijs $
3  *
4  * Copyright (c) 2009 NLNet Labs. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
19  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
21  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
25  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  */
28 
34 #ifndef SIGNER_ZONE_H
35 #define SIGNER_ZONE_H
36 
37 #include "config.h"
38 #include "adapter/adapter.h"
39 #include "scheduler/task.h"
40 #include "shared/allocator.h"
41 #include "shared/locks.h"
42 #include "shared/status.h"
43 #include "signer/nsec3params.h"
44 #include "signer/signconf.h"
45 #include "signer/stats.h"
46 #include "signer/zonedata.h"
47 
48 #include <ldns/ldns.h>
49 
50 struct schedule_struct;
51 
56 typedef struct zone_struct zone_type;
57 struct zone_struct {
58  allocator_type* allocator; /* memory allocator */
59  ldns_rdf* dname; /* wire format zone name */
60  ldns_rr_class klass; /* class */
61 
62  /* from conf.xml */
63  const char* notify_ns; /* master name server reload command */
64  int fetch; /* zone fetcher enabled */
65 
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 */
73  int processed;
74  int prepared;
75 
76  /* adapters */
77  adapter_type* adinbound; /* inbound adapter */
78  adapter_type* adoutbound; /* outbound adapter */
79 
80  /* from signconf.xml */
81  signconf_type* signconf; /* signer configuration values */
82  nsec3params_type* nsec3params; /* NSEC3 parameters */
83 
84  /* zone data */
86 
87  /* worker variables */
88  void* task; /* next assigned task */
89 
90  /* statistics */
92 
94 };
95 
103 zone_type* zone_create(char* name, ldns_rr_class klass);
104 
116 ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats);
117 
129 ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats);
130 
142 
150 ods_status zone_publish_dnskeys(zone_type* zone, int recover);
151 
159 ods_status zone_prepare_nsec3(zone_type* zone, int recover);
160 
168 
175 
186 void zone_merge(zone_type* z1, zone_type* z2);
187 
195 
202 ods_status zone_print(FILE* fd, zone_type* zone);
203 
211 
217 void zone_cleanup(zone_type* zone);
218 
219 #endif /* SIGNER_ZONE_H */