Electroneum
Toggle main menu visibility
Loading...
Searching...
No Matches
validator.h
Go to the documentation of this file.
1
/*
2
* validator/validator.h - secure validator DNS query response module
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
42
43
#ifndef VALIDATOR_VALIDATOR_H
44
#define VALIDATOR_VALIDATOR_H
45
#include "
util/module.h
"
46
#include "
util/data/msgreply.h
"
47
#include "
validator/val_utils.h
"
48
struct
val_anchors
;
49
struct
key_cache
;
50
struct
key_entry_key
;
51
struct
val_neg_cache
;
52
struct
config_strlist
;
53
59
#define NULL_KEY_TTL 60
/* seconds */
60
65
#define BOGUS_KEY_TTL 60
/* seconds */
66
68
#define VAL_MAX_RESTART_COUNT 5
69
71
#define SENTINEL_IS "root-key-sentinel-is-ta-"
73
#define SENTINEL_NOT "root-key-sentinel-not-ta-"
75
#define SENTINEL_KEYTAG_LEN 5
76
80
struct
val_env
{
83
struct
key_cache
*
kcache
;
84
86
struct
val_neg_cache
*
neg_cache
;
87
90
int32_t
date_override
;
91
93
int32_t
skew_min
;
94
96
int32_t
skew_max
;
97
101
uint32_t
bogus_ttl
;
102
107
int
nsec3_keyiter_count
;
108
113
size_t
*
nsec3_keysize
;
114
120
size_t
*
nsec3_maxiter
;
121
123
lock_basic_type
bogus_lock
;
125
size_t
num_rrset_bogus
;
126
};
127
131
enum
val_state
{
133
VAL_INIT_STATE
= 0,
135
VAL_FINDKEY_STATE
,
137
VAL_VALIDATE_STATE
,
139
VAL_FINISHED_STATE
,
141
VAL_DLVLOOKUP_STATE
142
};
143
147
struct
val_qstate
{
151
enum
val_state
state
;
152
156
struct
dns_msg
*
orig_msg
;
157
161
int
restart_count
;
163
struct
sock_list
*
chain_blacklist
;
164
168
struct
query_info
qchase
;
169
177
struct
reply_info
*
chase_reply
;
178
190
size_t
rrset_skip
;
191
193
uint8_t
*
trust_anchor_name
;
195
int
trust_anchor_labs
;
197
size_t
trust_anchor_len
;
198
200
struct
ub_packed_rrset_key
*
ds_rrset
;
201
203
uint8_t
*
empty_DS_name
;
205
size_t
empty_DS_len
;
206
208
struct
key_entry_key
*
key_entry
;
209
211
enum
val_classification
subtype
;
212
214
uint8_t
*
signer_name
;
216
size_t
signer_len
;
217
219
int
wait_prime_ta
;
220
222
int
dlv_checked
;
226
uint8_t
*
dlv_lookup_name
;
228
size_t
dlv_lookup_name_len
;
231
uint8_t
*
dlv_insecure_at
;
233
size_t
dlv_insecure_at_len
;
235
enum
dlv_status
{
236
dlv_error
,
/* server failure */
237
dlv_success
,
/* got a DLV */
238
dlv_ask_higher
,
/* ask again */
239
dlv_there_is_no_dlv
/* got no DLV, sure of it */
240
}
dlv_status
;
241
};
242
247
struct
module_func_block
*
val_get_funcblock
(
void
);
248
254
const
char
*
val_state_to_string
(
enum
val_state
state
);
255
257
int
val_init
(
struct
module_env
* env,
int
id
);
258
260
void
val_deinit
(
struct
module_env
* env,
int
id
);
261
263
void
val_operate
(
struct
module_qstate
* qstate,
enum
module_ev
event,
int
id
,
264
struct
outbound_entry
* outbound);
265
273
void
val_inform_super
(
struct
module_qstate
* qstate,
int
id
,
274
struct
module_qstate
* super);
275
277
void
val_clear
(
struct
module_qstate
* qstate,
int
id
);
278
286
size_t
val_get_mem
(
struct
module_env
* env,
int
id
);
287
288
#endif
/* VALIDATOR_VALIDATOR_H */
lock_basic_type
int lock_basic_type
Definition
locks.h:269
module.h
module_ev
module_ev
Definition
module.h:536
msgreply.h
uint32_t
unsigned int uint32_t
Definition
stdint.h:126
int32_t
signed int int32_t
Definition
stdint.h:123
uint8_t
unsigned char uint8_t
Definition
stdint.h:124
config_strlist
Definition
config_file.h:617
dns_msg
Definition
dns.h:61
key_cache
Definition
val_kcache.h:54
key_entry_key
Definition
val_kentry.h:55
module_env
Definition
module.h:307
module_func_block
Definition
module.h:642
module_qstate
Definition
module.h:571
outbound_entry
Definition
outbound_list.h:61
query_info
Definition
msgreply.h:69
reply_info
Definition
msgreply.h:125
sock_list
Definition
module.h:557
state
Definition
blake256.h:37
ub_packed_rrset_key
Definition
packed_rrset.h:107
val_anchors
Definition
val_anchor.h:60
val_env
Definition
validator.h:80
val_env::nsec3_keysize
size_t * nsec3_keysize
Definition
validator.h:113
val_env::skew_max
int32_t skew_max
Definition
validator.h:96
val_env::num_rrset_bogus
size_t num_rrset_bogus
Definition
validator.h:125
val_env::kcache
struct key_cache * kcache
Definition
validator.h:83
val_env::date_override
int32_t date_override
Definition
validator.h:90
val_env::neg_cache
struct val_neg_cache * neg_cache
Definition
validator.h:86
val_env::bogus_lock
lock_basic_type bogus_lock
Definition
validator.h:123
val_env::skew_min
int32_t skew_min
Definition
validator.h:93
val_env::nsec3_maxiter
size_t * nsec3_maxiter
Definition
validator.h:120
val_env::nsec3_keyiter_count
int nsec3_keyiter_count
Definition
validator.h:107
val_env::bogus_ttl
uint32_t bogus_ttl
Definition
validator.h:101
val_neg_cache
Definition
val_neg.h:67
val_qstate
Definition
validator.h:147
val_qstate::key_entry
struct key_entry_key * key_entry
Definition
validator.h:208
val_qstate::rrset_skip
size_t rrset_skip
Definition
validator.h:190
val_qstate::subtype
enum val_classification subtype
Definition
validator.h:211
val_qstate::empty_DS_name
uint8_t * empty_DS_name
Definition
validator.h:203
val_qstate::empty_DS_len
size_t empty_DS_len
Definition
validator.h:205
val_qstate::dlv_checked
int dlv_checked
Definition
validator.h:222
val_qstate::trust_anchor_len
size_t trust_anchor_len
Definition
validator.h:197
val_qstate::trust_anchor_name
uint8_t * trust_anchor_name
Definition
validator.h:193
val_qstate::dlv_lookup_name
uint8_t * dlv_lookup_name
Definition
validator.h:226
val_qstate::chain_blacklist
struct sock_list * chain_blacklist
Definition
validator.h:163
val_qstate::state
enum val_state state
Definition
validator.h:151
val_qstate::trust_anchor_labs
int trust_anchor_labs
Definition
validator.h:195
val_qstate::signer_name
uint8_t * signer_name
Definition
validator.h:214
val_qstate::dlv_status
dlv_status
Definition
validator.h:235
val_qstate::dlv_ask_higher
@ dlv_ask_higher
Definition
validator.h:238
val_qstate::dlv_error
@ dlv_error
Definition
validator.h:236
val_qstate::dlv_there_is_no_dlv
@ dlv_there_is_no_dlv
Definition
validator.h:239
val_qstate::dlv_success
@ dlv_success
Definition
validator.h:237
val_qstate::qchase
struct query_info qchase
Definition
validator.h:168
val_qstate::restart_count
int restart_count
Definition
validator.h:161
val_qstate::wait_prime_ta
int wait_prime_ta
Definition
validator.h:219
val_qstate::ds_rrset
struct ub_packed_rrset_key * ds_rrset
Definition
validator.h:200
val_qstate::dlv_insecure_at
uint8_t * dlv_insecure_at
Definition
validator.h:231
val_qstate::orig_msg
struct dns_msg * orig_msg
Definition
validator.h:156
val_qstate::dlv_insecure_at_len
size_t dlv_insecure_at_len
Definition
validator.h:233
val_qstate::signer_len
size_t signer_len
Definition
validator.h:216
val_qstate::dlv_lookup_name_len
size_t dlv_lookup_name_len
Definition
validator.h:228
val_qstate::chase_reply
struct reply_info * chase_reply
Definition
validator.h:177
val_utils.h
val_classification
val_classification
Definition
val_utils.h:61
val_get_funcblock
struct module_func_block * val_get_funcblock(void)
val_deinit
void val_deinit(struct module_env *env, int id)
val_clear
void val_clear(struct module_qstate *qstate, int id)
val_state_to_string
const char * val_state_to_string(enum val_state state)
val_state
val_state
Definition
validator.h:131
VAL_INIT_STATE
@ VAL_INIT_STATE
Definition
validator.h:133
VAL_FINISHED_STATE
@ VAL_FINISHED_STATE
Definition
validator.h:139
VAL_VALIDATE_STATE
@ VAL_VALIDATE_STATE
Definition
validator.h:137
VAL_FINDKEY_STATE
@ VAL_FINDKEY_STATE
Definition
validator.h:135
VAL_DLVLOOKUP_STATE
@ VAL_DLVLOOKUP_STATE
Definition
validator.h:141
val_operate
void val_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
val_init
int val_init(struct module_env *env, int id)
val_get_mem
size_t val_get_mem(struct module_env *env, int id)
val_inform_super
void val_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
external
unbound
validator
validator.h
Generated on
for Electroneum by
1.17.0