OpenDNSSEC-signer 1.3.0rc3
|
00001 /* 00002 * $Id: zone.h 5227 2011-06-12 08:51:24Z jakob $ 00003 * 00004 * Copyright (c) 2009 NLNet Labs. All rights reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions 00008 * are met: 00009 * 1. Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * 2. Redistributions in binary form must reproduce the above copyright 00012 * notice, this list of conditions and the following disclaimer in the 00013 * documentation and/or other materials provided with the distribution. 00014 * 00015 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00016 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00017 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00018 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 00019 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00020 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 00021 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00022 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00023 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00024 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 00025 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 * 00027 */ 00028 00034 #ifndef SIGNER_ZONE_H 00035 #define SIGNER_ZONE_H 00036 00037 #include "config.h" 00038 #include "adapter/adapter.h" 00039 #include "scheduler/task.h" 00040 #include "shared/allocator.h" 00041 #include "shared/locks.h" 00042 #include "shared/status.h" 00043 #include "signer/nsec3params.h" 00044 #include "signer/signconf.h" 00045 #include "signer/stats.h" 00046 #include "signer/zonedata.h" 00047 00048 #include <ldns/ldns.h> 00049 00050 struct schedule_struct; 00051 00056 typedef struct zone_struct zone_type; 00057 struct zone_struct { 00058 allocator_type* allocator; /* memory allocator */ 00059 ldns_rdf* dname; /* wire format zone name */ 00060 ldns_rr_class klass; /* class */ 00061 00062 /* from conf.xml */ 00063 const char* notify_ns; /* master name server reload command */ 00064 int fetch; /* zone fetcher enabled */ 00065 00066 /* from zonelist.xml */ 00067 const char* name; /* string format zone name */ 00068 const char* policy_name; /* policy identifier */ 00069 const char* signconf_filename; /* signconf filename */ 00070 int just_added; 00071 int just_updated; 00072 int tobe_removed; 00073 int processed; 00074 int prepared; 00075 00076 /* adapters */ 00077 adapter_type* adinbound; /* inbound adapter */ 00078 adapter_type* adoutbound; /* outbound adapter */ 00079 00080 /* from signconf.xml */ 00081 signconf_type* signconf; /* signer configuration values */ 00082 nsec3params_type* nsec3params; /* NSEC3 parameters */ 00083 00084 /* zone data */ 00085 zonedata_type* zonedata; 00086 00087 /* worker variables */ 00088 void* task; /* next assigned task */ 00089 00090 /* statistics */ 00091 stats_type* stats; 00092 00093 lock_basic_type zone_lock; 00094 }; 00095 00103 zone_type* zone_create(char* name, ldns_rr_class klass); 00104 00113 ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats); 00114 00123 ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats); 00124 00132 ods_status zone_load_signconf(zone_type* zone, task_id* tbs); 00133 00141 ods_status zone_publish_dnskeys(zone_type* zone, int recover); 00142 00150 ods_status zone_prepare_nsec3(zone_type* zone, int recover); 00151 00158 ods_status zone_backup(zone_type* zone); 00159 00165 ods_status zone_recover(zone_type* zone); 00166 00173 void zone_merge(zone_type* z1, zone_type* z2); 00174 00181 ods_status zone_update_serial(zone_type* zone); 00182 00189 ods_status zone_print(FILE* fd, zone_type* zone); 00190 00197 ods_status zone_examine(zone_type* zone); 00198 00204 void zone_cleanup(zone_type* zone); 00205 00206 #endif /* SIGNER_ZONE_H */