FD.io VPP  v21.01.1
Vector Packet Processing
mhash.h File Reference
+ Include dependency graph for mhash.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mhash_t
 

Macros

#define MHASH_VEC_STRING_KEY   0
 
#define MHASH_C_STRING_KEY   1
 
#define mhash_foreach(k, v, mh, body)
 

Functions

void mhash_init (mhash_t *h, uword n_value_bytes, uword n_key_bytes)
 
static void mhash_init_c_string (mhash_t *h, uword n_value_bytes)
 
static void mhash_init_vec_string (mhash_t *h, uword n_value_bytes)
 
static void * mhash_key_to_mem (mhash_t *h, uword key)
 
hash_pair_tmhash_get_pair (mhash_t *h, const void *key)
 
uword mhash_set_mem (mhash_t *h, void *key, uword *new_value, uword *old_value)
 
uword mhash_unset (mhash_t *h, void *key, uword *old_value)
 
static uwordmhash_get (mhash_t *h, const void *key)
 
static uword mhash_set (mhash_t *h, void *key, uword new_value, uword *old_value)
 
static uword mhash_unset_key (mhash_t *h, uword key, uword *old_value)
 
static uword mhash_value_bytes (mhash_t *m)
 
static uword mhash_elts (mhash_t *m)
 
static uword mhash_key_vector_is_heap (mhash_t *h)
 
static void mhash_free (mhash_t *h)
 

Variables

format_function_t format_mhash_key
 

Macro Definition Documentation

◆ MHASH_C_STRING_KEY

#define MHASH_C_STRING_KEY   1

Definition at line 62 of file mhash.h.

◆ mhash_foreach

#define mhash_foreach (   k,
  v,
  mh,
  body 
)
Value:
do { \
hash_pair_t * _mhash_foreach_p; \
hash_foreach_pair (_mhash_foreach_p, (mh)->hash, ({ \
(k) = mhash_key_to_mem ((mh), _mhash_foreach_p->key); \
(v) = &_mhash_foreach_p->value[0]; \
body; \
})); \
} while (0)
static void * mhash_key_to_mem(mhash_t *h, uword key)
Definition: mhash.h:90

Definition at line 159 of file mhash.h.

◆ MHASH_VEC_STRING_KEY

#define MHASH_VEC_STRING_KEY   0

Definition at line 61 of file mhash.h.

Function Documentation

◆ mhash_elts()

static uword mhash_elts ( mhash_t m)
inlinestatic

Definition at line 137 of file mhash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_free()

static void mhash_free ( mhash_t h)
inlinestatic

Definition at line 149 of file mhash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_get()

static uword* mhash_get ( mhash_t h,
const void *  key 
)
inlinestatic

Definition at line 110 of file mhash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_get_pair()

hash_pair_t* mhash_get_pair ( mhash_t h,
const void *  key 
)

Definition at line 247 of file mhash.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_init()

void mhash_init ( mhash_t h,
uword  n_value_bytes,
uword  n_key_bytes 
)

Definition at line 168 of file mhash.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_init_c_string()

static void mhash_init_c_string ( mhash_t h,
uword  n_value_bytes 
)
inlinestatic

Definition at line 78 of file mhash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_init_vec_string()

static void mhash_init_vec_string ( mhash_t h,
uword  n_value_bytes 
)
inlinestatic

Definition at line 84 of file mhash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_key_to_mem()

static void* mhash_key_to_mem ( mhash_t h,
uword  key 
)
inlinestatic

Definition at line 90 of file mhash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_key_vector_is_heap()

static uword mhash_key_vector_is_heap ( mhash_t h)
inlinestatic

Definition at line 143 of file mhash.h.

+ Here is the caller graph for this function:

◆ mhash_set()

static uword mhash_set ( mhash_t h,
void *  key,
uword  new_value,
uword old_value 
)
inlinestatic

Definition at line 117 of file mhash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_set_mem()

uword mhash_set_mem ( mhash_t h,
void *  key,
uword new_value,
uword old_value 
)

Definition at line 264 of file mhash.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_unset()

uword mhash_unset ( mhash_t h,
void *  key,
uword old_value 
)

Definition at line 346 of file mhash.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhash_unset_key()

static uword mhash_unset_key ( mhash_t h,
uword  key,
uword old_value 
)
inlinestatic

Definition at line 123 of file mhash.h.

+ Here is the call graph for this function:

◆ mhash_value_bytes()

static uword mhash_value_bytes ( mhash_t m)
inlinestatic

Definition at line 130 of file mhash.h.

+ Here is the call graph for this function:

Variable Documentation

◆ format_mhash_key

format_function_t format_mhash_key

Definition at line 169 of file mhash.h.