OpenDNSSEC-signer  1.4.1
domain.h
Go to the documentation of this file.
1 /*
2  * $Id: domain.h 6870 2012-11-27 13:01:48Z 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_DOMAIN_H
35 #define SIGNER_DOMAIN_H
36 
37 #include "config.h"
38 #include "shared/allocator.h"
39 #include "shared/status.h"
40 #include "signer/rrset.h"
41 
42 #include <ldns/ldns.h>
43 #include <time.h>
44 
45 #define SE_NSEC_RDATA_NXT 0
46 #define SE_NSEC_RDATA_BITMAP 1
47 #define SE_NSEC3_RDATA_NSEC3PARAMS 4
48 #define SE_NSEC3_RDATA_NXT 4
49 #define SE_NSEC3_RDATA_BITMAP 5
50 
55 typedef struct domain_struct domain_type;
56 struct domain_struct {
57  void* zone;
58  void* denial;
59  ldns_rbnode_t* node;
60  ldns_rdf* dname;
63  unsigned is_new : 1;
64  unsigned is_apex : 1; /* apex */
65 };
66 
74 void log_dname(ldns_rdf* rdf, const char* pre, int level);
75 
83 domain_type* domain_create(void* zoneptr, ldns_rdf* dname);
84 
91 size_t domain_count_rrset(domain_type* domain);
92 
100 
108 rrset_type* domain_lookup_rrset(domain_type* domain, ldns_rr_type rrtype);
109 
116 void domain_add_rrset(domain_type* domain, rrset_type* rrset);
117 
125 rrset_type* domain_del_rrset(domain_type* domain, ldns_rr_type rrtype);
126 
134 void domain_diff(domain_type* domain, unsigned is_ixfr, unsigned more_coming);
135 
142 void domain_rollback(domain_type* domain, int keepsc);
143 
151 
161 ldns_rr_type domain_is_delegpt(domain_type* domain);
162 
172 ldns_rr_type domain_is_occluded(domain_type* domain);
173 
181 void domain_print(FILE* fd, domain_type* domain, ods_status* status);
182 
188 void domain_cleanup(domain_type* domain);
189 
197 void domain_backup2(FILE* fd, domain_type* domain, int sigs);
198 
199 #endif /* SIGNER_DOMAIN_H */