Electroneum
Toggle main menu visibility
Loading...
Searching...
No Matches
val_anchor.h
Go to the documentation of this file.
1
/*
2
* validator/val_anchor.h - validator trust anchor storage.
3
*
4
* Copyright (c) 2007, NLnet Labs. All rights reserved.
5
*
6
* This software is open source.
7
*
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions
10
* are met:
11
*
12
* Redistributions of source code must retain the above copyright notice,
13
* this list of conditions and the following disclaimer.
14
*
15
* Redistributions in binary form must reproduce the above copyright notice,
16
* this list of conditions and the following disclaimer in the documentation
17
* and/or other materials provided with the distribution.
18
*
19
* Neither the name of the NLNET LABS nor the names of its contributors may
20
* be used to endorse or promote products derived from this software without
21
* specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
*/
35
41
42
#ifndef VALIDATOR_VAL_ANCHOR_H
43
#define VALIDATOR_VAL_ANCHOR_H
44
#include "
util/rbtree.h
"
45
#include "
util/locks.h
"
46
struct
trust_anchor
;
47
struct
config_file
;
48
struct
ub_packed_rrset_key
;
49
struct
autr_point_data
;
50
struct
autr_global_data
;
51
struct
sldns_buffer
;
52
60
struct
val_anchors
{
62
lock_basic_type
lock
;
69
rbtree_type
*
tree
;
71
struct
trust_anchor
*
dlv_anchor
;
73
struct
autr_global_data
*
autr
;
74
};
75
79
struct
ta_key
{
81
struct
ta_key
*
next
;
83
uint8_t
*
data
;
85
size_t
len
;
87
uint16_t
type
;
88
};
89
94
struct
trust_anchor
{
96
rbnode_type
node
;
98
lock_basic_type
lock
;
100
uint8_t
*
name
;
102
size_t
namelen
;
104
int
namelabs
;
106
struct
trust_anchor
*
parent
;
110
struct
ta_key
*
keylist
;
112
struct
autr_point_data
*
autr
;
114
size_t
numDS
;
116
size_t
numDNSKEY
;
118
struct
ub_packed_rrset_key
*
ds_rrset
;
120
struct
ub_packed_rrset_key
*
dnskey_rrset
;
122
uint16_t
dclass
;
123
};
124
129
struct
val_anchors
*
anchors_create
(
void
);
130
135
void
anchors_delete
(
struct
val_anchors
* anchors);
136
143
int
anchors_apply_cfg
(
struct
val_anchors
* anchors,
struct
config_file
* cfg);
144
153
void
anchors_init_parents_locked
(
struct
val_anchors
* anchors);
154
165
struct
trust_anchor
*
anchors_lookup
(
struct
val_anchors
* anchors,
166
uint8_t
* qname,
size_t
qname_len,
uint16_t
qclass);
167
177
struct
trust_anchor
*
anchor_find
(
struct
val_anchors
* anchors,
178
uint8_t
*
name
,
int
namelabs
,
size_t
namelen
,
uint16_t
dclass
);
179
187
struct
trust_anchor
*
anchor_store_str
(
struct
val_anchors
* anchors,
188
struct
sldns_buffer
* buffer,
const
char
* str);
189
195
size_t
anchors_get_mem
(
struct
val_anchors
* anchors);
196
198
int
anchor_cmp
(
const
void
* k1,
const
void
* k2);
199
207
int
anchors_add_insecure
(
struct
val_anchors
* anchors,
uint16_t
c,
uint8_t
* nm);
208
216
void
anchors_delete_insecure
(
struct
val_anchors
* anchors,
uint16_t
c,
217
uint8_t
* nm);
218
228
size_t
anchor_list_keytags
(
struct
trust_anchor
* ta,
uint16_t
* list,
size_t
num);
229
242
int
anchor_has_keytag
(
struct
val_anchors
* anchors,
uint8_t
*
name
,
int
namelabs
,
243
size_t
namelen
,
uint16_t
dclass
,
uint16_t
keytag);
244
245
#endif
/* VALIDATOR_VAL_ANCHOR_H */
locks.h
lock_basic_type
int lock_basic_type
Definition
locks.h:269
rbtree.h
uint16_t
unsigned short uint16_t
Definition
stdint.h:125
uint8_t
unsigned char uint8_t
Definition
stdint.h:124
autr_global_data
Definition
autotrust.h:127
autr_point_data
Definition
autotrust.h:90
config_file
Definition
config_file.h:68
rbnode_type
Definition
rbtree.h:55
rbtree_type
Definition
rbtree.h:76
sldns_buffer
Definition
sbuffer.h:117
ta_key
Definition
val_anchor.h:79
ta_key::next
struct ta_key * next
Definition
val_anchor.h:81
ta_key::len
size_t len
Definition
val_anchor.h:85
ta_key::type
uint16_t type
Definition
val_anchor.h:87
ta_key::data
uint8_t * data
Definition
val_anchor.h:83
trust_anchor
Definition
val_anchor.h:94
trust_anchor::numDNSKEY
size_t numDNSKEY
Definition
val_anchor.h:116
trust_anchor::dnskey_rrset
struct ub_packed_rrset_key * dnskey_rrset
Definition
val_anchor.h:120
trust_anchor::dclass
uint16_t dclass
Definition
val_anchor.h:122
trust_anchor::keylist
struct ta_key * keylist
Definition
val_anchor.h:110
trust_anchor::autr
struct autr_point_data * autr
Definition
val_anchor.h:112
trust_anchor::numDS
size_t numDS
Definition
val_anchor.h:114
trust_anchor::node
rbnode_type node
Definition
val_anchor.h:96
trust_anchor::namelen
size_t namelen
Definition
val_anchor.h:102
trust_anchor::ds_rrset
struct ub_packed_rrset_key * ds_rrset
Definition
val_anchor.h:118
trust_anchor::name
uint8_t * name
Definition
val_anchor.h:100
trust_anchor::namelabs
int namelabs
Definition
val_anchor.h:104
trust_anchor::lock
lock_basic_type lock
Definition
val_anchor.h:98
trust_anchor::parent
struct trust_anchor * parent
Definition
val_anchor.h:106
ub_packed_rrset_key
Definition
packed_rrset.h:107
val_anchors
Definition
val_anchor.h:60
val_anchors::dlv_anchor
struct trust_anchor * dlv_anchor
Definition
val_anchor.h:71
val_anchors::lock
lock_basic_type lock
Definition
val_anchor.h:62
val_anchors::autr
struct autr_global_data * autr
Definition
val_anchor.h:73
val_anchors::tree
rbtree_type * tree
Definition
val_anchor.h:69
anchors_delete_insecure
void anchors_delete_insecure(struct val_anchors *anchors, uint16_t c, uint8_t *nm)
anchors_create
struct val_anchors * anchors_create(void)
anchors_get_mem
size_t anchors_get_mem(struct val_anchors *anchors)
anchors_init_parents_locked
void anchors_init_parents_locked(struct val_anchors *anchors)
anchor_store_str
struct trust_anchor * anchor_store_str(struct val_anchors *anchors, struct sldns_buffer *buffer, const char *str)
anchor_cmp
int anchor_cmp(const void *k1, const void *k2)
anchor_has_keytag
int anchor_has_keytag(struct val_anchors *anchors, uint8_t *name, int namelabs, size_t namelen, uint16_t dclass, uint16_t keytag)
anchor_find
struct trust_anchor * anchor_find(struct val_anchors *anchors, uint8_t *name, int namelabs, size_t namelen, uint16_t dclass)
anchors_delete
void anchors_delete(struct val_anchors *anchors)
anchors_apply_cfg
int anchors_apply_cfg(struct val_anchors *anchors, struct config_file *cfg)
anchors_add_insecure
int anchors_add_insecure(struct val_anchors *anchors, uint16_t c, uint8_t *nm)
anchor_list_keytags
size_t anchor_list_keytags(struct trust_anchor *ta, uint16_t *list, size_t num)
anchors_lookup
struct trust_anchor * anchors_lookup(struct val_anchors *anchors, uint8_t *qname, size_t qname_len, uint16_t qclass)
external
unbound
validator
val_anchor.h
Generated on
for Electroneum by
1.17.0