OpenDNSSEC-signer 1.2.1

/build/buildd-opendnssec_1.2.1.dfsg-1-mips-p9AT07/opendnssec-1.2.1.dfsg/signer/src/signer/rrset.h

Go to the documentation of this file.
00001 /*
00002  * $Id: rrset.h 4516 2011-02-24 09:20:32Z 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_RRSET_H
00035 #define SIGNER_RRSET_H
00036 
00037 #include "config.h"
00038 #include "signer/hsm.h"
00039 #include "signer/rrsigs.h"
00040 #include "signer/signconf.h"
00041 #include "signer/stats.h"
00042 
00043 #include <ldns/ldns.h>
00044 
00045 typedef struct rrset_struct rrset_type;
00046 struct rrset_struct {
00047     ldns_rr_type rr_type;
00048     uint32_t rr_count;
00049     uint32_t add_count;
00050     uint32_t del_count;
00051     uint32_t rrsig_count;
00052     uint32_t internal_serial;
00053     int initialized;
00054     ldns_dnssec_rrs* rrs;
00055     ldns_dnssec_rrs* add;
00056     ldns_dnssec_rrs* del;
00057     rrsigs_type* rrsigs;
00058     int drop_signatures;
00059 };
00060 
00067 rrset_type* rrset_create(ldns_rr_type rrtype);
00068 
00075 rrset_type* rrset_create_frm_rr(ldns_rr* rr);
00076 
00084 int rrset_update(rrset_type* rrset, uint32_t serial);
00085 
00093 int rrset_examine_ns_rdata(rrset_type* rrset, ldns_rdf* nsdname);
00094 
00100 void rrset_cancel_update(rrset_type* rrset);
00101 
00109 int rrset_add_rr(rrset_type* rrset, ldns_rr* rr);
00110 
00118 int rrset_del_rr(rrset_type* rrset, ldns_rr* rr);
00119 
00127 int rrset_recover_rr_from_backup(rrset_type* rrset, ldns_rr* rr);
00128 
00138 int rrset_recover_rrsig_from_backup(rrset_type* rrset, ldns_rr* rrsig,
00139     const char* locator, uint32_t flags);
00140 
00152 int rrset_sign(hsm_ctx_t* ctx, rrset_type* rrset, ldns_rdf* owner,
00153     signconf_type* sc, time_t signtime, stats_type* stats);
00154 
00161 int rrset_del_rrs(rrset_type* rrset);
00162 
00169 int rrset_count_rr(rrset_type* rrset);
00170 
00177 int rrset_count_add(rrset_type* rrset);
00178 
00185 int rrset_count_del(rrset_type* rrset);
00186 
00193 int rrset_count_RR(rrset_type* rrset);
00194 
00200 void rrset_cleanup(rrset_type* rrset);
00201 
00209 void log_rr(ldns_rr* rr, const char* pre, int level);
00210 
00218 void rrset_print(FILE* fd, rrset_type* rrset, int skip_rrsigs);
00219 
00226 void rrset_print_rrsig(FILE* fd, rrset_type* rrset);
00227 
00228 #endif /* SIGNER_RRSET_H */