OpenDNSSEC-signer  1.4.5
domain.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 NLNet Labs. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
19  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
21  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
23  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  */
26 
32 #ifndef SIGNER_DOMAIN_H
33 #define SIGNER_DOMAIN_H
34 
35 #include "config.h"
36 #include "shared/allocator.h"
37 #include "shared/status.h"
38 #include "signer/rrset.h"
39 
40 #include <ldns/ldns.h>
41 #include <time.h>
42 
43 #define SE_NSEC_RDATA_NXT 0
44 #define SE_NSEC_RDATA_BITMAP 1
45 #define SE_NSEC3_RDATA_NSEC3PARAMS 4
46 #define SE_NSEC3_RDATA_NXT 4
47 #define SE_NSEC3_RDATA_BITMAP 5
48 
53 typedef struct domain_struct domain_type;
54 struct domain_struct {
55  void* zone;
56  void* denial;
57  ldns_rbnode_t* node;
58  ldns_rdf* dname;
61  unsigned is_new : 1;
62  unsigned is_apex : 1; /* apex */
63 };
64 
72 void log_dname(ldns_rdf* rdf, const char* pre, int level);
73 
81 domain_type* domain_create(void* zoneptr, ldns_rdf* dname);
82 
89 size_t domain_count_rrset(domain_type* domain);
90 
98 
106 rrset_type* domain_lookup_rrset(domain_type* domain, ldns_rr_type rrtype);
107 
114 void domain_add_rrset(domain_type* domain, rrset_type* rrset);
115 
123 rrset_type* domain_del_rrset(domain_type* domain, ldns_rr_type rrtype);
124 
132 void domain_diff(domain_type* domain, unsigned is_ixfr, unsigned more_coming);
133 
140 void domain_rollback(domain_type* domain, int keepsc);
141 
149 
159 ldns_rr_type domain_is_delegpt(domain_type* domain);
160 
170 ldns_rr_type domain_is_occluded(domain_type* domain);
171 
179 void domain_print(FILE* fd, domain_type* domain, ods_status* status);
180 
186 void domain_cleanup(domain_type* domain);
187 
195 void domain_backup2(FILE* fd, domain_type* domain, int sigs);
196 
197 #endif /* SIGNER_DOMAIN_H */
ldns_rr_type domain_is_delegpt(domain_type *domain)
Definition: domain.c:439
size_t domain_count_rrset(domain_type *domain)
Definition: domain.c:126
enum ods_enum_status ods_status
Definition: status.h:90
void log_dname(ldns_rdf *rdf, const char *pre, int level)
Definition: domain.c:48
domain_type * domain_create(void *zoneptr, ldns_rdf *dname)
Definition: domain.c:89
void domain_rollback(domain_type *domain, int keepsc)
Definition: domain.c:331
void domain_cleanup(domain_type *domain)
Definition: domain.c:561
domain_type * parent
Definition: domain.h:59
void domain_add_rrset(domain_type *domain, rrset_type *rrset)
Definition: domain.c:189
rrset_type * domain_lookup_rrset(domain_type *domain, ldns_rr_type rrtype)
Definition: domain.c:170
unsigned is_apex
Definition: domain.h:62
void domain_print(FILE *fd, domain_type *domain, ods_status *status)
Definition: domain.c:493
unsigned is_new
Definition: domain.h:61
rrset_type * domain_del_rrset(domain_type *domain, ldns_rr_type rrtype)
Definition: domain.c:220
void domain_backup2(FILE *fd, domain_type *domain, int sigs)
Definition: domain.c:580
void domain_diff(domain_type *domain, unsigned is_ixfr, unsigned more_coming)
Definition: domain.c:279
ldns_rr_type domain_is_occluded(domain_type *domain)
Definition: domain.c:464
size_t domain_count_rrset_is_added(domain_type *domain)
Definition: domain.c:147
ldns_rbnode_t * node
Definition: domain.h:57
rrset_type * rrsets
Definition: domain.h:60
int domain_ent2unsignedns(domain_type *domain)
Definition: domain.c:405
void * denial
Definition: domain.h:56
ldns_rdf * dname
Definition: domain.h:58
void * zone
Definition: domain.h:55