netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
hash.h File Reference
#include <unistd.h>
#include "linuxlist.h"
#include <stdint.h>
Include dependency graph for hash.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  hashtable
 
struct  hashtable_node
 

Functions

struct hashtablehashtable_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_nodehashtable_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 *node)
 
int hashtable_flush (struct hashtable *table)
 
int hashtable_iterate (struct hashtable *table, void *data, int(*iterate)(void *data, void *n))
 
int hashtable_iterate_limit (struct hashtable *table, void *data, uint32_t from, uint32_t steps, int(*iterate)(void *data1, void *n))
 
unsigned int hashtable_counter (const struct hashtable *table)
 

Function Documentation

int hashtable_add ( struct hashtable table,
struct hashtable_node n,
int  id 
)
unsigned int hashtable_counter ( const struct hashtable table)

References hashtable::count.

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 
)
void hashtable_del ( struct hashtable table,
struct hashtable_node node 
)
void hashtable_destroy ( struct hashtable h)
struct hashtable_node* hashtable_find ( const struct hashtable table,
const void *  data,
int  id 
)
int hashtable_hash ( const struct hashtable table,
const void *  data 
)

References hashtable::hash.

int hashtable_iterate ( struct hashtable table,
void *  data,
int(*)(void *data, void *n)  iterate 
)
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 hashtable_iterate().

Here is the caller graph for this function: