Electroneum
Loading...
Searching...
No Matches
val_kentry.h File Reference
Include dependency graph for val_kentry.h:

Go to the source code of this file.

Classes

struct  key_entry_key
struct  key_entry_data

Functions

size_t key_entry_sizefunc (void *key, void *data)
int key_entry_compfunc (void *k1, void *k2)
void key_entry_delkeyfunc (void *key, void *userarg)
void key_entry_deldatafunc (void *data, void *userarg)
void key_entry_hash (struct key_entry_key *kk)
struct key_entry_key * key_entry_copy_toregion (struct key_entry_key *kkey, struct regional *region)
struct key_entry_key * key_entry_copy (struct key_entry_key *kkey)
int key_entry_isnull (struct key_entry_key *kkey)
int key_entry_isgood (struct key_entry_key *kkey)
int key_entry_isbad (struct key_entry_key *kkey)
void key_entry_set_reason (struct key_entry_key *kkey, char *reason)
char * key_entry_get_reason (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)
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)
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)
struct ub_packed_rrset_key * key_entry_get_rrset (struct key_entry_key *kkey, struct regional *region)
size_t key_entry_keysize (struct key_entry_key *kkey)

Detailed Description

This file contains functions for dealing with validator key entries.

Definition in file val_kentry.h.

Function Documentation

◆ key_entry_compfunc()

int key_entry_compfunc ( void * k1,
void * k2 )

function for lruhash operation

Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_copy()

struct key_entry_key * key_entry_copy ( struct key_entry_key * kkey)

Copy a key entry, malloced.

Parameters
kkeythe key entry key (and data pointer) to copy.
Returns
newly allocated entry or NULL on a failure to allocate memory.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_copy_toregion()

struct key_entry_key * key_entry_copy_toregion ( struct key_entry_key * kkey,
struct regional * region )

Copy a key entry, to be region-allocated.

Parameters
kkeythe key entry key (and data pointer) to copy.
regionwhere to allocate it
Returns
newly region-allocated entry or NULL on a failure to allocate.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_create_bad()

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 )

Create a bad entry, in the given region.

Parameters
regionwhere to allocate
namethe key name
namelenlength of name
dclassclass of key entry. (host order);
ttlwhat ttl should the key have. relative.
nowcurrent time (added to ttl).
Returns
new key entry or NULL on alloc failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_create_null()

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 )

Create a null entry, in the given region.

Parameters
regionwhere to allocate
namethe key name
namelenlength of name
dclassclass of key entry. (host order);
ttlwhat ttl should the key have. relative.
nowcurrent time (added to ttl).
Returns
new key entry or NULL on alloc failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_create_rrset()

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 )

Create a key entry from an rrset, in the given region.

Parameters
regionwhere to allocate.
namethe key name
namelenlength of name
dclassclass of key entry. (host order);
rrsetdata for key entry. This is copied to the region.
sigalgsignalled algorithm list (or NULL).
nowcurrent time (added to ttl of rrset)
Returns
new key entry or NULL on alloc failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_deldatafunc()

void key_entry_deldatafunc ( void * data,
void * userarg )

function for lruhash operation

Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_delkeyfunc()

void key_entry_delkeyfunc ( void * key,
void * userarg )

function for lruhash operation

Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_get_reason()

char * key_entry_get_reason ( struct key_entry_key * kkey)

Get reason why a key is bad.

Parameters
kkeybad key
Returns
pointer to string. String is part of key entry and is deleted with it.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_get_rrset()

struct ub_packed_rrset_key * key_entry_get_rrset ( struct key_entry_key * kkey,
struct regional * region )

Obtain rrset from a key entry, allocated in region.

Parameters
kkeykey entry to convert to a rrset.
regionwhere to allocate rrset
Returns
rrset copy; if no rrset or alloc error returns NULL.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_hash()

void key_entry_hash ( struct key_entry_key * kk)

calculate hash for key entry

Parameters
kkkey entry. The lruhash entry.hash value is filled in.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_isbad()

int key_entry_isbad ( struct key_entry_key * kkey)

See if this entry is bad. Does not do locking.

Parameters
kkeymust have data pointer set correctly
Returns
true if it is bad.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_isgood()

int key_entry_isgood ( struct key_entry_key * kkey)

See if this entry is good. Does not do locking.

Parameters
kkeymust have data pointer set correctly
Returns
true if it is good.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_isnull()

int key_entry_isnull ( struct key_entry_key * kkey)

See if this is a null entry. Does not do locking.

Parameters
kkeymust have data pointer set correctly
Returns
true if it is a NULL rrset entry.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_keysize()

size_t key_entry_keysize ( struct key_entry_key * kkey)

Get keysize of the keyentry.

Parameters
kkeykey, must be a good key, with contents.
Returns
size in bits of the key.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_set_reason()

void key_entry_set_reason ( struct key_entry_key * kkey,
char * reason )

Set reason why a key is bad.

Parameters
kkeybad key.
reasonstring to attach, you must allocate it. Not safe to call twice unless you deallocate it yourself.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_entry_sizefunc()

size_t key_entry_sizefunc ( void * key,
void * data )

function for lruhash operation

Here is the call graph for this function:
Here is the caller graph for this function: