• Main Page
  • Data Structures
  • Files
  • File List
  • Globals

/build/buildd-opendnssec_1.3.2-1~bpo60+1-sparc-g2IJWF/opendnssec-1.3.2/signer/src/signer/domain.h

Go to the documentation of this file.
00001 /*
00002  * $Id: domain.h 4573 2011-03-16 09:18:42Z matthijs $
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_DOMAIN_H
00035 #define SIGNER_DOMAIN_H
00036 
00037 #include "config.h"
00038 #include "daemon/worker.h"
00039 #include "scheduler/fifoq.h"
00040 #include "shared/allocator.h"
00041 #include "shared/status.h"
00042 #include "signer/denial.h"
00043 #include "signer/keys.h"
00044 #include "signer/rrset.h"
00045 
00046 #include <ldns/ldns.h>
00047 #include <time.h>
00048 
00049 enum domain_status_enum {
00050     DOMAIN_STATUS_NONE = 0, /* initial domain status [UNSIGNED] */
00051     DOMAIN_STATUS_APEX,     /* apex domain, authoritative [SIGNED] */
00052     DOMAIN_STATUS_AUTH,     /* authoritative domain, non-apex [SIGNED] */
00053     DOMAIN_STATUS_NS,       /* unsigned delegation [UNSIGNED] */
00054     DOMAIN_STATUS_DS,       /* signed delegation [SIGNED] */
00055     DOMAIN_STATUS_ENT,      /* empty non-terminal [UNSIGNED] */
00056     DOMAIN_STATUS_OCCLUDED  /* occluded domain [UNSIGNED] */
00057 };
00058 typedef enum domain_status_enum domain_status;
00059 
00060 #define SE_NSEC_RDATA_NXT          0
00061 #define SE_NSEC_RDATA_BITMAP       1
00062 #define SE_NSEC3_RDATA_NSEC3PARAMS 4
00063 #define SE_NSEC3_RDATA_NXT         4
00064 #define SE_NSEC3_RDATA_BITMAP      5
00065 
00070 typedef struct domain_struct domain_type;
00071 struct domain_struct {
00072     /* General domain info */
00073     ldns_rdf* dname;
00074     domain_status dstatus;
00075     allocator_type* allocator;
00076 
00077     /* Family */
00078     domain_type* parent;
00079 
00080     /* Denial of Existence */
00081     denial_type* denial;
00082 
00083     /* RRsets */
00084     ldns_rbtree_t* rrsets;
00085 };
00086 
00093 domain_type* domain_create(ldns_rdf* dname);
00094 
00103 ods_status domain_recover(domain_type* domain, FILE* fd,
00104     domain_status dstatus);
00105 
00113 /*
00114 int domain_recover_rr_from_backup(domain_type* domain, ldns_rr* rr);
00115 */
00116 
00127 /*
00128 int domain_recover_rrsig_from_backup(domain_type* domain, ldns_rr* rrsig,
00129     ldns_rr_type type_covered, const char* locator, uint32_t flags);
00130 */
00131 
00138 size_t domain_count_rrset(domain_type* domain);
00139 
00147 rrset_type* domain_lookup_rrset(domain_type* domain, ldns_rr_type rrtype);
00148 
00156 rrset_type* domain_add_rrset(domain_type* domain, rrset_type* rrset);
00157 
00165 rrset_type* domain_del_rrset(domain_type* domain, rrset_type* rrset);
00166 
00174 ods_status domain_diff(domain_type* domain, keylist_type* kl);
00175 
00184 int domain_examine_data_exists(domain_type* domain, ldns_rr_type rrtype,
00185     int skip_glue);
00186 
00194 int domain_examine_ns_rdata(domain_type* domain, ldns_rdf* nsdname);
00195 
00202 int domain_examine_valid_zonecut(domain_type* domain);
00203 
00211 int domain_examine_rrset_is_alone(domain_type* domain, ldns_rr_type rrtype);
00212 
00220 int domain_examine_rrset_is_singleton(domain_type* domain, ldns_rr_type rrtype);
00221 
00228 ods_status domain_commit(domain_type* domain);
00229 
00235 void domain_rollback(domain_type* domain);
00236 
00242 void domain_dstatus(domain_type* domain);
00243 
00252 ods_status domain_queue(domain_type* domain, fifoq_type* q,
00253     worker_type* worker);
00254 
00260 void domain_cleanup(domain_type* domain);
00261 
00268 void domain_print(FILE* fd, domain_type* domain);
00269 
00276 void domain_backup(FILE* fd, domain_type* domain);
00277 
00278 #endif /* SIGNER_DOMAIN_H */

Generated on Sat Dec 17 2011 11:48:48 for OpenDNSSEC-signer by  doxygen 1.7.1