Electroneum
Toggle main menu visibility
Loading...
Searching...
No Matches
autotrust.h
Go to the documentation of this file.
1
/*
2
* validator/autotrust.h - RFC5011 trust anchor management for unbound.
3
*
4
* Copyright (c) 2009, 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_AUTOTRUST_H
43
#define VALIDATOR_AUTOTRUST_H
44
#include "
util/rbtree.h
"
45
#include "
util/data/packed_rrset.h
"
46
struct
val_anchors
;
47
struct
trust_anchor
;
48
struct
ub_packed_rrset_key
;
49
struct
module_env
;
50
struct
module_qstate
;
51
struct
val_env
;
52
struct
sldns_buffer
;
53
55
typedef
enum
{
56
AUTR_STATE_START
= 0,
57
AUTR_STATE_ADDPEND
= 1,
58
AUTR_STATE_VALID
= 2,
59
AUTR_STATE_MISSING
= 3,
60
AUTR_STATE_REVOKED
= 4,
61
AUTR_STATE_REMOVED
= 5
62
}
autr_state_type
;
63
67
struct
autr_ta
{
69
struct
autr_ta
*
next
;
71
uint8_t
*
rr
;
73
size_t
rr_len
,
dname_len
;
75
time_t
last_change
;
77
autr_state_type
s
;
79
uint8_t
pending_count
;
81
uint8_t
fetched
;
83
uint8_t
revoked
;
84
};
85
90
struct
autr_point_data
{
92
char
*
file
;
94
rbnode_type
pnode
;
95
97
struct
autr_ta
*
keys
;
98
104
time_t
last_queried
;
106
time_t
last_success
;
108
time_t
next_probe_time
;
109
111
time_t
query_interval
;
113
time_t
retry_time
;
114
119
uint8_t
query_failed
;
121
uint8_t
revoked
;
122
};
123
127
struct
autr_global_data
{
130
rbtree_type
probe
;
131
};
132
137
struct
autr_global_data
*
autr_global_create
(
void
);
138
143
void
autr_global_delete
(
struct
autr_global_data
* global);
144
150
size_t
autr_get_num_anchors
(
struct
val_anchors
* anchors);
151
158
time_t
autr_probe_timer
(
struct
module_env
* env);
159
161
int
probetree_cmp
(
const
void
* x,
const
void
* y);
162
169
int
autr_read_file
(
struct
val_anchors
* anchors,
const
char
* nm);
170
176
void
autr_write_file
(
struct
module_env
* env,
struct
trust_anchor
* tp);
177
183
void
autr_point_delete
(
struct
trust_anchor
* tp);
184
197
int
autr_process_prime
(
struct
module_env
* env,
struct
val_env
* ve,
198
struct
trust_anchor
* tp,
struct
ub_packed_rrset_key
* dnskey_rrset,
199
struct
module_qstate
* qstate);
200
205
void
autr_debug_print
(
struct
val_anchors
* anchors);
206
208
void
probe_answer_cb
(
void
* arg,
int
rcode,
struct
sldns_buffer
*
buf
,
209
enum
sec_status
sec,
char
*
errinf
);
210
211
#endif
/* VALIDATOR_AUTOTRUST_H */
autr_state_type
autr_state_type
Definition
autotrust.h:55
AUTR_STATE_START
@ AUTR_STATE_START
Definition
autotrust.h:56
AUTR_STATE_ADDPEND
@ AUTR_STATE_ADDPEND
Definition
autotrust.h:57
AUTR_STATE_REMOVED
@ AUTR_STATE_REMOVED
Definition
autotrust.h:61
AUTR_STATE_REVOKED
@ AUTR_STATE_REVOKED
Definition
autotrust.h:60
AUTR_STATE_MISSING
@ AUTR_STATE_MISSING
Definition
autotrust.h:59
AUTR_STATE_VALID
@ AUTR_STATE_VALID
Definition
autotrust.h:58
autr_write_file
void autr_write_file(struct module_env *env, struct trust_anchor *tp)
autr_probe_timer
time_t autr_probe_timer(struct module_env *env)
autr_global_create
struct autr_global_data * autr_global_create(void)
autr_debug_print
void autr_debug_print(struct val_anchors *anchors)
autr_get_num_anchors
size_t autr_get_num_anchors(struct val_anchors *anchors)
probetree_cmp
int probetree_cmp(const void *x, const void *y)
autr_point_delete
void autr_point_delete(struct trust_anchor *tp)
autr_read_file
int autr_read_file(struct val_anchors *anchors, const char *nm)
autr_global_delete
void autr_global_delete(struct autr_global_data *global)
autr_process_prime
int autr_process_prime(struct module_env *env, struct val_env *ve, struct trust_anchor *tp, struct ub_packed_rrset_key *dnskey_rrset, struct module_qstate *qstate)
probe_answer_cb
void probe_answer_cb(void *arg, int rcode, struct sldns_buffer *buf, enum sec_status sec, char *errinf)
errinf
void errinf(struct module_qstate *qstate, const char *str)
packed_rrset.h
sec_status
sec_status
Definition
packed_rrset.h:176
rbtree.h
buf
const char * buf
Definition
slow_memmem.cpp:74
uint8_t
unsigned char uint8_t
Definition
stdint.h:124
autr_global_data
Definition
autotrust.h:127
autr_global_data::probe
rbtree_type probe
Definition
autotrust.h:130
autr_point_data
Definition
autotrust.h:90
autr_point_data::pnode
rbnode_type pnode
Definition
autotrust.h:94
autr_point_data::file
char * file
Definition
autotrust.h:92
autr_point_data::keys
struct autr_ta * keys
Definition
autotrust.h:97
autr_point_data::retry_time
time_t retry_time
Definition
autotrust.h:113
autr_point_data::query_interval
time_t query_interval
Definition
autotrust.h:111
autr_point_data::next_probe_time
time_t next_probe_time
Definition
autotrust.h:108
autr_point_data::last_queried
time_t last_queried
Definition
autotrust.h:104
autr_point_data::revoked
uint8_t revoked
Definition
autotrust.h:121
autr_point_data::query_failed
uint8_t query_failed
Definition
autotrust.h:119
autr_point_data::last_success
time_t last_success
Definition
autotrust.h:106
autr_ta
Definition
autotrust.h:67
autr_ta::fetched
uint8_t fetched
Definition
autotrust.h:81
autr_ta::s
autr_state_type s
Definition
autotrust.h:77
autr_ta::dname_len
size_t dname_len
Definition
autotrust.h:73
autr_ta::revoked
uint8_t revoked
Definition
autotrust.h:83
autr_ta::rr
uint8_t * rr
Definition
autotrust.h:71
autr_ta::rr_len
size_t rr_len
Definition
autotrust.h:73
autr_ta::last_change
time_t last_change
Definition
autotrust.h:75
autr_ta::next
struct autr_ta * next
Definition
autotrust.h:69
autr_ta::pending_count
uint8_t pending_count
Definition
autotrust.h:79
module_env
Definition
module.h:307
module_qstate
Definition
module.h:571
rbnode_type
Definition
rbtree.h:55
rbtree_type
Definition
rbtree.h:76
sldns_buffer
Definition
sbuffer.h:117
trust_anchor
Definition
val_anchor.h:94
ub_packed_rrset_key
Definition
packed_rrset.h:107
val_anchors
Definition
val_anchor.h:60
val_env
Definition
validator.h:80
external
unbound
validator
autotrust.h
Generated on
for Electroneum by
1.17.0