Electroneum
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 
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 {
63 
67 struct autr_ta {
69  struct autr_ta* next;
73  size_t rr_len, dname_len;
75  time_t last_change;
84 };
85 
92  char* file;
95 
97  struct autr_ta* keys;
98 
104  time_t last_queried;
106  time_t last_success;
109 
113  time_t retry_time;
114 
122 };
123 
131 };
132 
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 */
struct autr_global_data * autr_global_create(void)
uint8_t revoked
Definition: autotrust.h:121
time_t query_interval
Definition: autotrust.h:111
struct autr_ta * next
Definition: autotrust.h:69
int probetree_cmp(const void *x, const void *y)
time_t retry_time
Definition: autotrust.h:113
size_t dname_len
Definition: autotrust.h:73
uint8_t revoked
Definition: autotrust.h:83
unsigned char uint8_t
Definition: stdint.h:124
void probe_answer_cb(void *arg, int rcode, struct sldns_buffer *buf, enum sec_status sec, char *errinf)
void autr_global_delete(struct autr_global_data *global)
uint8_t fetched
Definition: autotrust.h:81
void errinf(struct module_qstate *qstate, const char *str)
time_t last_success
Definition: autotrust.h:106
size_t autr_get_num_anchors(struct val_anchors *anchors)
struct autr_ta * keys
Definition: autotrust.h:97
void autr_point_delete(struct trust_anchor *tp)
rbtree_type probe
Definition: autotrust.h:130
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)
sec_status
Definition: packed_rrset.h:176
autr_state_type s
Definition: autotrust.h:77
autr_state_type
Definition: autotrust.h:55
void autr_write_file(struct module_env *env, struct trust_anchor *tp)
size_t rr_len
Definition: autotrust.h:73
const char * buf
Definition: slow_memmem.cpp:74
time_t last_change
Definition: autotrust.h:75
int autr_read_file(struct val_anchors *anchors, const char *nm)
time_t autr_probe_timer(struct module_env *env)
rbnode_type pnode
Definition: autotrust.h:94
uint8_t pending_count
Definition: autotrust.h:79
time_t last_queried
Definition: autotrust.h:104
time_t next_probe_time
Definition: autotrust.h:108
uint8_t query_failed
Definition: autotrust.h:119
void autr_debug_print(struct val_anchors *anchors)
uint8_t * rr
Definition: autotrust.h:71