FD.io VPP  v16.06
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)
 
always_inline void mhash_init_c_string (mhash_t *h, uword n_value_bytes)
 
always_inline void mhash_init_vec_string (mhash_t *h, uword n_value_bytes)
 
always_inline voidmhash_key_to_mem (mhash_t *h, uword key)
 
hash_pair_tmhash_get_pair (mhash_t *h, 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)
 
always_inline uwordmhash_get (mhash_t *h, void *key)
 
always_inline uword mhash_set (mhash_t *h, void *key, uword new_value, uword *old_value)
 
always_inline uword mhash_unset_key (mhash_t *h, uword key, uword *old_value)
 
always_inline uword mhash_value_bytes (mhash_t *m)
 
always_inline uword mhash_elts (mhash_t *m)
 
always_inline uword mhash_key_vector_is_heap (mhash_t *h)
 
always_inline void mhash_free (mhash_t *h)
 

Variables

format_function_t format_mhash_key
 

Macro Definition Documentation

#define MHASH_C_STRING_KEY   1

Definition at line 61 of file mhash.h.

#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)
always_inline void * mhash_key_to_mem(mhash_t *h, uword key)
Definition: mhash.h:85
#define hash_foreach_pair(p, v, body)
Definition: hash.h:311

Definition at line 147 of file mhash.h.

#define MHASH_VEC_STRING_KEY   0

Definition at line 60 of file mhash.h.

Function Documentation

always_inline uword mhash_elts ( mhash_t m)

Definition at line 129 of file mhash.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void mhash_free ( mhash_t h)

Definition at line 137 of file mhash.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword* mhash_get ( mhash_t h,
void key 
)

Definition at line 104 of file mhash.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

hash_pair_t* mhash_get_pair ( mhash_t h,
void key 
)

Definition at line 257 of file mhash.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 169 of file mhash.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void mhash_init_c_string ( mhash_t h,
uword  n_value_bytes 
)

Definition at line 77 of file mhash.h.

+ Here is the call graph for this function:

always_inline void mhash_init_vec_string ( mhash_t h,
uword  n_value_bytes 
)

Definition at line 81 of file mhash.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* mhash_key_to_mem ( mhash_t h,
uword  key 
)

Definition at line 85 of file mhash.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword mhash_key_vector_is_heap ( mhash_t h)

Definition at line 133 of file mhash.h.

+ Here is the caller graph for this function:

always_inline uword mhash_set ( mhash_t h,
void key,
uword  new_value,
uword old_value 
)

Definition at line 111 of file mhash.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 272 of file mhash.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 350 of file mhash.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword mhash_unset_key ( mhash_t h,
uword  key,
uword old_value 
)

Definition at line 115 of file mhash.h.

+ Here is the call graph for this function:

always_inline uword mhash_value_bytes ( mhash_t m)

Definition at line 122 of file mhash.h.

+ Here is the call graph for this function:

Variable Documentation

format_function_t format_mhash_key

Definition at line 157 of file mhash.h.