OpenDNSSEC-signer 1.2.1
|
00001 /* 00002 * $Id: zone.h 4294 2011-01-13 19:58:29Z 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/locks.h" 00040 #include "signer/nsec3params.h" 00041 #include "signer/signconf.h" 00042 #include "signer/stats.h" 00043 #include "signer/zonedata.h" 00044 00045 #include <ldns/ldns.h> 00046 00047 struct task_struct; 00048 struct tasklist_struct; 00049 00054 typedef struct zone_struct zone_type; 00055 struct zone_struct { 00056 const char* name; /* string format zone name */ 00057 ldns_rdf* dname; /* wire format zone name */ 00058 ldns_rr_class klass; /* class */ 00059 nsec3params_type* nsec3params; /* NSEC3 parameters */ 00060 zonedata_type* zonedata; /* zone data */ 00061 00062 /* from conf.xml */ 00063 const char* notify_ns; /* master name server reload command */ 00064 int fetch; /* zone fetcher enabled */ 00065 00066 /* from signconf.xml */ 00067 signconf_type* signconf; /* signer configuration values */ 00068 00069 /* from zonelist.xml */ 00070 const char* policy_name; /* policy identifier */ 00071 const char* signconf_filename; /* signer configuration filename */ 00072 adapter_type* inbound_adapter; /* inbound adapter */ 00073 adapter_type* outbound_adapter; /* outbound adapter */ 00074 int just_added; 00075 int just_updated; 00076 int tobe_removed; 00077 int processed; 00078 00079 /* worker variables */ 00080 struct task_struct* task; /* current scheduled task */ 00081 time_t backoff; /* backoff value if there is something failing */ 00082 int in_progress; /* in progress (check with active worker?) */ 00083 00084 /* statistics */ 00085 stats_type* stats; 00086 00087 lock_basic_type zone_lock; 00088 }; 00089 00097 zone_type* zone_create(const char* name, ldns_rr_class klass); 00098 00105 void zone_update_zonelist(zone_type* z1, zone_type* z2); 00106 00115 int zone_update_signconf(zone_type* zone, struct tasklist_struct* tl, 00116 char* buf); 00117 00124 int zone_update_zonedata(zone_type* zone); 00125 00132 int zone_add_dnskeys(zone_type* zone); 00133 00142 int zone_add_rr(zone_type* zone, ldns_rr* rr, int recover); 00143 00151 int zone_del_rr(zone_type* zone, ldns_rr* rr); 00152 00159 int zone_nsecify(zone_type* zone); 00160 00167 int zone_sign(zone_type* zone); 00168 00175 int zone_backup_state(zone_type* zone); 00176 00183 void zone_recover_from_backup(zone_type* zone, struct tasklist_struct* tl); 00184 00190 void zone_cleanup(zone_type* zone); 00191 00198 void zone_print(FILE* fd, zone_type* zone); 00199 00200 #endif /* SIGNER_ZONE_H */