|
OpenVPN
|

Go to the source code of this file.
Functions | |
| struct hash * | hash_init (const uint32_t n_buckets, uint64_t(*hash_function)(const void *key, const uint8_t hash_key[HASH_KEY_LEN]), 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, uint64_t hv) |
| bool | hash_remove_fast (struct hash *hash, struct hash_bucket *bucket, const void *key, uint64_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, uint32_t start_bucket, uint32_t 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) |
| bool hash_add | ( | struct hash * | hash, |
| const void * | key, | ||
| void * | value, | ||
| bool | replace | ||
| ) |
Definition at line 139 of file list.c.
References hash::buckets, hash_add_fast(), hash_lookup_fast(), hash_value(), hash::mask, and hash_element::value.
Referenced by multi_create_instance(), multi_process_float(), and test_list().
| void hash_free | ( | struct hash * | hash | ) |
Definition at line 62 of file list.c.
References hash::buckets, hash_bucket::list, hash::n_buckets, and hash_element::next.
Referenced by multi_uninit(), and test_list().
| struct hash * hash_init | ( | const uint32_t | n_buckets, |
| uint64_t(*)(const void *key, const uint8_t hash_key[HASH_KEY_LEN]) | hash_function, | ||
| bool(*)(const void *key1, const void *key2) | compare_function | ||
| ) |
Definition at line 36 of file list.c.
References adjust_power_of_2(), ALLOC_ARRAY, ALLOC_OBJ_CLEAR, ASSERT, hash::buckets, hash::compare_function, hash::hash_function, hash::hash_key, hash_bucket::list, hash::mask, hash::n_buckets, and prng_bytes().
Referenced by multi_init(), and test_list().
|
inlinestatic |
Definition at line 265 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 310 of file list.c.
References ASSERT, hash_iterator::bucket_marked, hash_element::key, and hash_iterator::last.
Referenced by check_stale_routes(), hash_remove_by_value(), and multi_reap_range().
| void hash_iterator_free | ( | struct hash_iterator * | hi | ) |
Definition at line 272 of file list.c.
References hash_iterator_unlock().
Referenced by check_stale_routes(), hash_lookup_by_value(), hash_remove_by_value(), management_check_bytecount_server(), multi_print_status(), multi_reap_range(), and test_list().
| void hash_iterator_init | ( | struct hash * | hash, |
| struct hash_iterator * | hi | ||
| ) |
Definition at line 236 of file list.c.
References hash_iterator_init_range(), and hash::n_buckets.
Referenced by hash_lookup_by_value(), hash_remove_by_value(), management_check_bytecount_server(), and multi_print_status().
| void hash_iterator_init_range | ( | struct hash * | hash, |
| struct hash_iterator * | hi, | ||
| uint32_t | start_bucket, | ||
| uint32_t | end_bucket | ||
| ) |
Definition at line 215 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_init(), multi_reap_range(), and test_list().
|
inlinestatic |
Definition at line 242 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 278 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_lookup_by_value(), hash_remove_by_value(), management_check_bytecount_server(), multi_print_status(), multi_reap_range(), and test_list().
|
inlinestatic |
Definition at line 250 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, | ||
| uint64_t | hv | ||
| ) |
Definition at line 81 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_check_dest_addr_allowed(), multi_create_instance_tcp(), multi_get_instance_udp_real(), multi_learn_addr(), and multi_unlearn_addr().
| void hash_remove_by_value | ( | struct hash * | hash, |
| void * | value | ||
| ) |
Definition at line 167 of file list.c.
References hash_iterator_delete_element(), hash_iterator_free(), hash_iterator_init(), hash_iterator_next(), and hash_element::value.
Referenced by multi_unlearn_addr(), and test_list().
| bool hash_remove_fast | ( | struct hash * | hash, |
| struct hash_bucket * | bucket, | ||
| const void * | key, | ||
| uint64_t | hv | ||
| ) |
Definition at line 109 of file list.c.
References hash::compare_function, 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 184 of file list.c.
References hash_element::key, hash_bucket::list, hash::n_elements, and hash_element::next.
Referenced by hash_iterator_unlock().