OpenVPN
|
Go to the source code of this file.
Macros | |
#define | mix(a, b, c) |
Functions | |
struct hash * | hash_init (const int n_buckets, const uint32_t iv, uint32_t(*hash_function)(const void *key, uint32_t iv), bool(*compare_function)(const void *key1, const void *key2)) |
void | hash_free (struct hash *hash) |
struct hash_element * | hash_lookup_fast (struct hash *hash, struct hash_bucket *bucket, const void *key, uint32_t hv) |
bool | hash_remove_fast (struct hash *hash, struct hash_bucket *bucket, const void *key, uint32_t hv) |
bool | hash_add (struct hash *hash, const void *key, void *value, bool replace) |
void | hash_remove_by_value (struct hash *hash, void *value) |
static void | hash_remove_marked (struct hash *hash, struct hash_bucket *bucket) |
void | hash_iterator_init_range (struct hash *hash, struct hash_iterator *hi, int start_bucket, int end_bucket) |
void | hash_iterator_init (struct hash *hash, struct hash_iterator *hi) |
static void | hash_iterator_lock (struct hash_iterator *hi, struct hash_bucket *b) |
static void | hash_iterator_unlock (struct hash_iterator *hi) |
static void | hash_iterator_advance (struct hash_iterator *hi) |
void | hash_iterator_free (struct hash_iterator *hi) |
struct hash_element * | hash_iterator_next (struct hash_iterator *hi) |
void | hash_iterator_delete_element (struct hash_iterator *hi) |
uint32_t | hash_func (const uint8_t *k, uint32_t length, uint32_t initval) |
#define mix | ( | a, | |
b, | |||
c | |||
) |
Definition at line 575 of file list.c.
Referenced by hash_func().
bool hash_add | ( | struct hash * | hash, |
const void * | key, | ||
void * | value, | ||
bool | replace | ||
) |
Definition at line 149 of file list.c.
References hash::buckets, hash_add_fast(), hash_lookup_fast(), hash_value(), hash::mask, and hash_element::value.
Referenced by hash_iterator_delete_element(), multi_create_instance(), multi_process_float(), and multi_schedule_context_wakeup().
void hash_free | ( | struct hash * | hash | ) |
Definition at line 65 of file list.c.
References hash::buckets, free, hash_bucket::list, hash::n_buckets, and hash_element::next.
Referenced by hash_iterator_delete_element(), and multi_uninit().
uint32_t hash_func | ( | const uint8_t * | k, |
uint32_t | length, | ||
uint32_t | initval | ||
) |
Definition at line 589 of file list.c.
References mix.
Referenced by hash_iterator_delete_element(), and mroute_addr_hash_function().
struct hash* hash_init | ( | const int | n_buckets, |
const uint32_t | iv, | ||
uint32_t(*)(const void *key, uint32_t iv) | hash_function, | ||
bool(*)(const void *key1, const void *key2) | compare_function | ||
) |
Definition at line 40 of file list.c.
References adjust_power_of_2(), ALLOC_ARRAY, ALLOC_OBJ_CLEAR, ASSERT, hash::buckets, hash::compare_function, hash::hash_function, hash::iv, hash_bucket::list, hash::mask, and hash::n_buckets.
Referenced by hash_iterator_delete_element(), and multi_init().
|
inlinestatic |
Definition at line 278 of file list.c.
References hash_iterator::elem, hash_iterator::last, and hash_element::next.
Referenced by hash_iterator_next().
void hash_iterator_delete_element | ( | struct hash_iterator * | hi | ) |
Definition at line 323 of file list.c.
References ALLOC_OBJ_GC, ASSERT, hash_iterator::bucket_marked, gc_free(), gc_new(), get_random(), hash_add(), hash_free(), hash_func(), hash_init(), hash_iterator_free(), hash_iterator_init(), hash_iterator_init_range(), hash_iterator_next(), hash_lookup(), hash_n_buckets(), hash_n_elements(), hash_remove(), hash_remove_by_value(), hash_element::key, hash_iterator::last, hash::mask, hash::n_buckets, random, string_alloc(), and hash_element::value.
Referenced by check_stale_routes(), hash_remove_by_value(), multi_delete_dup(), and multi_reap_range().
void hash_iterator_free | ( | struct hash_iterator * | hi | ) |
Definition at line 285 of file list.c.
References hash_iterator_unlock().
Referenced by check_stale_routes(), hash_iterator_delete_element(), hash_remove_by_value(), management_callback_kill_by_addr(), management_callback_kill_by_cn(), multi_bcast(), multi_delete_dup(), multi_print_status(), multi_push_restart_schedule_exit(), multi_reap_range(), and multi_uninit().
void hash_iterator_init | ( | struct hash * | hash, |
struct hash_iterator * | hi | ||
) |
Definition at line 248 of file list.c.
References hash_iterator_init_range(), and hash::n_buckets.
Referenced by hash_iterator_delete_element(), hash_remove_by_value(), management_callback_kill_by_addr(), management_callback_kill_by_cn(), multi_bcast(), multi_delete_dup(), multi_print_status(), multi_push_restart_schedule_exit(), and multi_uninit().
void hash_iterator_init_range | ( | struct hash * | hash, |
struct hash_iterator * | hi, | ||
int | start_bucket, | ||
int | end_bucket | ||
) |
Definition at line 225 of file list.c.
References ASSERT, hash_iterator::bucket, hash_iterator::bucket_index, hash_iterator::bucket_index_end, hash_iterator::bucket_index_start, hash_iterator::bucket_marked, hash_iterator::elem, hash_iterator::hash, hash_iterator::last, and hash::n_buckets.
Referenced by check_stale_routes(), hash_iterator_delete_element(), hash_iterator_init(), and multi_reap_range().
|
inlinestatic |
Definition at line 255 of file list.c.
References hash_iterator::bucket, hash_iterator::bucket_marked, and hash_iterator::last.
Referenced by hash_iterator_next().
struct hash_element* hash_iterator_next | ( | struct hash_iterator * | hi | ) |
Definition at line 291 of file list.c.
References hash_iterator::bucket_index, hash_iterator::bucket_index_end, hash::buckets, hash_iterator::elem, hash_iterator::hash, hash_iterator_advance(), hash_iterator_lock(), hash_iterator_unlock(), and hash_bucket::list.
Referenced by check_stale_routes(), hash_iterator_delete_element(), hash_remove_by_value(), management_callback_kill_by_addr(), management_callback_kill_by_cn(), multi_bcast(), multi_delete_dup(), multi_print_status(), multi_push_restart_schedule_exit(), multi_reap_range(), and multi_uninit().
|
inlinestatic |
Definition at line 263 of file list.c.
References hash_iterator::bucket, hash_iterator::bucket_marked, hash_iterator::hash, hash_remove_marked(), and hash_iterator::last.
Referenced by hash_iterator_free(), and hash_iterator_next().
struct hash_element* hash_lookup_fast | ( | struct hash * | hash, |
struct hash_bucket * | bucket, | ||
const void * | key, | ||
uint32_t | hv | ||
) |
Definition at line 85 of file list.c.
References hash::compare_function, hash_element::hash_value, hash_element::key, hash_bucket::list, and hash_element::next.
Referenced by hash_add(), hash_lookup(), multi_create_instance_tcp(), multi_get_create_instance_udp(), multi_learn_addr(), and multi_process_float().
void hash_remove_by_value | ( | struct hash * | hash, |
void * | value | ||
) |
Definition at line 177 of file list.c.
References hash_iterator_delete_element(), hash_iterator_free(), hash_iterator_init(), hash_iterator_next(), and hash_element::value.
Referenced by hash_iterator_delete_element().
bool hash_remove_fast | ( | struct hash * | hash, |
struct hash_bucket * | bucket, | ||
const void * | key, | ||
uint32_t | hv | ||
) |
Definition at line 116 of file list.c.
References hash::compare_function, free, hash_element::hash_value, hash_element::key, hash_bucket::list, hash::n_elements, and hash_element::next.
Referenced by hash_remove().
|
static |
Definition at line 194 of file list.c.
References free, hash_element::key, hash_bucket::list, hash::n_elements, and hash_element::next.
Referenced by hash_iterator_unlock().