netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
hash.c File Reference
#include "hash.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
Include dependency graph for hash.c:

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 *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)
 

Function Documentation

int hashtable_add ( struct hashtable table,
struct hashtable_node n,
int  id 
)
unsigned int hashtable_counter ( const struct hashtable table)
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 n 
)
void hashtable_destroy ( struct hashtable h)
struct hashtable_node* hashtable_find ( const struct hashtable table,
const void *  data,
int  id 
)
int hashtable_flush ( struct hashtable table)
int hashtable_hash ( const struct hashtable table,
const void *  data 
)
int hashtable_iterate ( struct hashtable table,
void *  data,
int(*)(void *data1, void *n)  iterate 
)

References hashtable_iterate_limit().

Here is the call graph for this function:

int hashtable_iterate_limit ( struct hashtable table,
void *  data,
uint32_t  from,
uint32_t  steps,
int(*)(void *data1, void *n)  iterate 
)

Referenced by hashtable_iterate().

Here is the caller graph for this function: