Electroneum
val_kentry.h
Go to the documentation of this file.
1 /*
2  * validator/val_kentry.h - validator key entry definition.
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 #ifndef VALIDATOR_VAL_KENTRY_H
43 #define VALIDATOR_VAL_KENTRY_H
44 struct packed_rrset_data;
45 struct regional;
46 struct ub_packed_rrset_key;
47 #include "util/storage/lruhash.h"
48 
55 struct key_entry_key {
61  size_t namelen;
64 };
65 
78  time_t ttl;
82  char* reason;
89 };
90 
92 size_t key_entry_sizefunc(void* key, void* data);
93 
95 int key_entry_compfunc(void* k1, void* k2);
96 
98 void key_entry_delkeyfunc(void* key, void* userarg);
99 
101 void key_entry_deldatafunc(void* data, void* userarg);
102 
106 void key_entry_hash(struct key_entry_key* kk);
107 
115  struct regional* region);
116 
122 struct key_entry_key* key_entry_copy(struct key_entry_key* kkey);
123 
129 int key_entry_isnull(struct key_entry_key* kkey);
130 
136 int key_entry_isgood(struct key_entry_key* kkey);
137 
143 int key_entry_isbad(struct key_entry_key* kkey);
144 
151 void key_entry_set_reason(struct key_entry_key* kkey, char* reason);
152 
159 char* key_entry_get_reason(struct key_entry_key* kkey);
160 
171 struct key_entry_key* key_entry_create_null(struct regional* region,
172  uint8_t* name, size_t namelen, uint16_t dclass, time_t ttl,
173  time_t now);
174 
186 struct key_entry_key* key_entry_create_rrset(struct regional* region,
187  uint8_t* name, size_t namelen, uint16_t dclass,
188  struct ub_packed_rrset_key* rrset, uint8_t* sigalg, time_t now);
189 
200 struct key_entry_key* key_entry_create_bad(struct regional* region,
201  uint8_t* name, size_t namelen, uint16_t dclass, time_t ttl,
202  time_t now);
203 
211  struct regional* region);
212 
218 size_t key_entry_keysize(struct key_entry_key* kkey);
219 
220 #endif /* VALIDATOR_VAL_KENTRY_H */
struct key_entry_key * key_entry_create_rrset(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, struct ub_packed_rrset_key *rrset, uint8_t *sigalg, time_t now)
int key_entry_isgood(struct key_entry_key *kkey)
void key_entry_set_reason(struct key_entry_key *kkey, char *reason)
char * reason
Definition: val_kentry.h:82
const char * key
Definition: hmac_keccak.cpp:39
time_t ttl
Definition: val_kentry.h:78
unsigned short uint16_t
Definition: stdint.h:125
void key_entry_deldatafunc(void *data, void *userarg)
uint8_t * name
Definition: val_kentry.h:59
uint8_t * algo
Definition: val_kentry.h:84
unsigned char uint8_t
Definition: stdint.h:124
struct key_entry_key * key_entry_create_bad(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, time_t ttl, time_t now)
const char * name
struct key_entry_key * key_entry_copy(struct key_entry_key *kkey)
struct packed_rrset_data * rrset_data
Definition: val_kentry.h:80
uint16_t key_class
Definition: val_kentry.h:63
size_t key_entry_keysize(struct key_entry_key *kkey)
void key_entry_hash(struct key_entry_key *kk)
int key_entry_isbad(struct key_entry_key *kkey)
struct key_entry_key * key_entry_create_null(struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, time_t ttl, time_t now)
Definition: val_kentry.h:76
int key_entry_isnull(struct key_entry_key *kkey)
struct lruhash_entry entry
Definition: val_kentry.h:57
void key_entry_delkeyfunc(void *key, void *userarg)
int key_entry_compfunc(void *k1, void *k2)
uint8_t isbad
Definition: val_kentry.h:88
char * key_entry_get_reason(struct key_entry_key *kkey)
struct ub_packed_rrset_key * key_entry_get_rrset(struct key_entry_key *kkey, struct regional *region)
struct key_entry_key * key_entry_copy_toregion(struct key_entry_key *kkey, struct regional *region)
size_t key_entry_sizefunc(void *key, void *data)
Definition: val_kentry.h:55
Definition: lruhash.h:203
size_t namelen
Definition: val_kentry.h:61
uint16_t rrset_type
Definition: val_kentry.h:86