#include "ulogd/hash.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
Functions | |
struct hashtable * | hashtable_create (int hashsize, int limit, uint32_t(*hash)(const void *data, const struct hashtable *table), int(*compare)(const void *data1, const void *data2)) |
void | hashtable_destroy (struct hashtable *h) |
int | hashtable_hash (const struct hashtable *table, const void *data) |
struct hashtable_node * | hashtable_find (const struct hashtable *table, const void *data, int id) |
int | hashtable_add (struct hashtable *table, struct hashtable_node *n, int id) |
void | hashtable_del (struct hashtable *table, struct hashtable_node *n) |
int | hashtable_flush (struct hashtable *table) |
int | hashtable_iterate_limit (struct hashtable *table, void *data, uint32_t from, uint32_t steps, int(*iterate)(void *data1, void *n)) |
int | hashtable_iterate (struct hashtable *table, void *data, int(*iterate)(void *data1, void *n)) |
unsigned int | hashtable_counter (const struct hashtable *table) |
int hashtable_add | ( | struct hashtable * | table, |
struct hashtable_node * | n, | ||
int | id | ||
) |
References hashtable::count, hashtable_node::head, hashtable::limit, and hashtable::members.
Referenced by ct_filter_add_ip().
References hashtable::count.
Referenced by cache_stats_extended().
struct hashtable* hashtable_create | ( | int | hashsize, |
int | limit, | ||
uint32_t(*)(const void *data, const struct hashtable *table) | hash, | ||
int(*)(const void *data1, const void *data2) | compare | ||
) |
References hashtable::compare, hashtable::hash, hashtable::hashsize, INIT_LIST_HEAD, INIT_LLIST_HEAD, hashtable::limit, hashtable::members, NULL, and size.
Referenced by cache_create(), and ct_filter_create().
void hashtable_del | ( | struct hashtable * | table, |
struct hashtable_node * | n | ||
) |
References hashtable::count, and hashtable_node::head.
struct hashtable_node* hashtable_find | ( | const struct hashtable * | table, |
const void * | data, | ||
int | id | ||
) |
References hashtable::compare, hashtable_node::head, list_entry, list_for_each, llist_entry, llist_for_each, hashtable::members, and NULL.
Referenced by cache_find(), and ct_filter_add_ip().
References hashtable::hash.
Referenced by cache_find(), and ct_filter_add_ip().
int hashtable_iterate_limit | ( | struct hashtable * | table, |
void * | data, | ||
uint32_t | from, | ||
uint32_t | steps, | ||
int(*)(void *data1, void *n) | iterate | ||
) |
References hashtable::hashsize, hashtable_node::head, list_entry, list_for_each_safe, llist_entry, llist_for_each_safe, and hashtable::members.
Referenced by cache_iterate_limit().