unbound: lruhash_entry Struct Reference

unbound 0.1

Data Fields
lruhash_entry Struct Reference

An entry into the hash table. More...

`#include <lruhash.h>`

## Data Fields
lock_rw_type | lock
| rwlock for access to the contents of the entry Note that it does not cover the lru_ and overflow_ ptrs.
struct lruhash_entry * | overflow_next
| next entry in overflow chain.
struct lruhash_entry * | lru_next
| next entry in lru chain.
struct lruhash_entry * | lru_prev
| prev entry in lru chain.
hashvalue_type | hash
| hash value of the key.
void * | key
| key
void * | data
| data

## Detailed Description

An entry into the hash table.

To change overflow_next you need to hold the bin lock. To change the lru items you need to hold the hashtable lock. This structure is designed as part of key struct. And key pointer helps to get the surrounding structure. Data should be allocated on its own.

## Field Documentation

## ◆ lock

lock_rw_type lruhash_entry::lock

rwlock for access to the contents of the entry Note that it does not cover the lru_ and overflow_ ptrs.

Even with a writelock, you cannot change hash and key. You need to delete it to change hash or key.

Referenced by add_soa(), alloc_clear_special_list(), alloc_get_mem(), alloc_setup_special(), bin_clear(), cache_fill_missing(), delkey(), delkey(), delkey(), dns_cache_find_delegation(), dns_cache_lookup(), dns_cache_prefetch_adjust(), dnsc_nonce_cache_insert(), dnsc_nonces_sizefunc(), dnsc_shared_secret_cache_insert(), dnsc_shared_secrets_sizefunc(), do_expire_message(), dump_msg_lruhash(), dump_rrset_lruhash(), error_response_cache(), fill_any(), find_add_addrs(), find_add_ds(), find_closest_of_type(), grab_nsec(), infra_create_ratedata(), infra_edns_update(), infra_get_host_rto(), infra_get_lame_rtt(), infra_host(), infra_ip_create_ratedata(), infra_rtt_update(), infra_set_lame(), infra_test(), infra_update_tcp_works(), invalidateQueryInCache(), iter_lookup_parent_glue_from_cache(), iter_lookup_parent_NS_from_cache(), key_cache_obtain(), key_entry_copy(), key_entry_sizefunc(), load_ref(), lruhash_insert(), lruhash_insert_or_retrieve(), lruhash_traverse(), mesh_serve_expired_lookup(), msg_cache_lookup(), msgreply_sizefunc(), new_entry(), newkey(), newkey(), query_info_entrysetup(), reclaim_space(), rrset_cache_expired_above(), rrset_cache_lookup(), rrset_cache_remove_above(), rrset_cache_touch(), rrset_cache_update(), rrset_check_sec_status(), rrset_update_id(), rrset_update_sec_status(), store_rrsets(), test_short_table(), test_short_table(), testlookup(), testlookup(), testlookup_unlim(), testlookup_unlim(), ub_rrset_sizefunc(), val_find_DS(), val_neg_getmsg(), and worker_handle_request().

## ◆ overflow_next

struct lruhash_entry* lruhash_entry::overflow_next

next entry in overflow chain.

Covered by hashlock and binlock.

Referenced by bin_clear(), bin_delete(), bin_find_entry(), bin_overflow_remove(), bin_split(), lruhash_insert(), lruhash_insert_or_retrieve(), lruhash_status(), lruhash_traverse(), lruhash_update_space_used(), reclaim_space(), and test_bin_find_entry().

## ◆ lru_next

struct lruhash_entry* lruhash_entry::lru_next

next entry in lru chain.

covered by hashlock.

Referenced by check_lru_table(), check_table(), dump_msg_lruhash(), dump_rrset_lruhash(), lru_demote(), and reclaim_space().

## ◆ lru_prev

struct lruhash_entry* lruhash_entry::lru_prev

prev entry in lru chain.

covered by hashlock.

Referenced by check_lru_table(), check_table(), lru_front(), and reclaim_space().

## ◆ hash

hashvalue_type lruhash_entry::hash

hash value of the key.

It may not change, until entry deleted.

Referenced by auth_packed_rrset_copy_region(), az_change_dnames(), bin_find_entry(), bin_split(), dns64_adjust_a(), dnsc_nonce_cache_insert(), dnsc_nonces_lookup(), dnsc_shared_secret_cache_insert(), dnsc_shared_secrets_lookup(), dnscrypt_server_uncurve(), infra_create_ratedata(), infra_edns_update(), infra_find_ip_ratedata(), infra_find_ratedata(), infra_host(), infra_ip_create_ratedata(), infra_lookup_nottl(), infra_rtt_update(), infra_set_lame(), iter_store_parentside_neg(), iter_store_parentside_rrset(), key_cache_insert(), key_cache_remove(), key_cache_search(), key_entry_hash(), local_data_answer(), lruhash_insert(), lruhash_insert_or_retrieve(), make_soa_ubrrset(), move_into_cache(), new_entry(), newkey(), newkey(), packed_rrset_copy_alloc(), packed_rrset_copy_region(), parse_copy_decompress_rrset(), query_info_entrysetup(), reclaim_space(), repinfo_copy_rrsets(), respip_copy_rrset(), rrset_cache_lookup(), rrset_cache_remove(), rrset_cache_touch(), rrset_cache_update(), rrset_cache_update_wildcard(), rrset_check_sec_status(), rrset_update_sec_status(), slabhash_lookup(), slabhash_remove(), slabhash_update_space_used(), synth_dname_msg(), and test_bin_find_entry().

The documentation for this struct was generated from the following file:

- util/storage/lruhash.h