FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | clib_llist_anchor |
Macros | |||
#define | CLIB_LLIST_INVALID_INDEX ((u32)~0) | ||
#define | clib_llist_entry_index(LP, E) ((E) - (LP)) | ||
Get list entry index. More... | |||
#define | clib_llist_get(LP, E) pool_get (LP, E) | ||
Alloc new element. More... | |||
#define | clib_llist_put(LP, E) pool_put (LP, E) | ||
Free element. More... | |||
#define | clib_llist_free(LP) pool_free (LP) | ||
Free list supporting container. More... | |||
#define | clib_llist_elt(LP, EI) pool_elt_at_index (LP, EI) | ||
Get list elt at index. More... | |||
#define | clib_llist_elts(LP) pool_elts (LP) | ||
Get number of elements in supporting container. More... | |||
list anchor name | |||
Get next list entry index
| |||
#define | clib_llist_prev_index(E, name) _lprev(E,name) | ||
#define | clib_llist_next_index(E, name) _lnext(E,name) | ||
#define | clib_llist_next(LP, name, E) pool_elt_at_index((LP),_lnext((E),name)) | ||
Get next pool entry. More... | |||
#define | clib_llist_prev(LP, name, E) pool_elt_at_index((LP),_lprev((E),name)) | ||
Get previous pool entry. More... | |||
#define | clib_llist_anchor_init(LP, name, E) | ||
Initialize element in llist for entry. More... | |||
#define | clib_llist_make_head(LP, name) | ||
Initialize llist head. More... | |||
#define | clib_llist_is_empty(LP, name, H) (clib_llist_entry_index (LP,H) == (H)->name.next) | ||
Check is list is empty. More... | |||
#define | clib_llist_elt_is_linked(E, name) | ||
Check if element is linked in a list. More... | |||
#define | clib_llist_insert(LP, name, E, P) | ||
Insert entry after previous. More... | |||
#define | clib_llist_add(LP, name, E, H) clib_llist_insert ((LP),name,(E),(H)) | ||
Add entry after head. More... | |||
#define | clib_llist_add_tail(LP, name, E, H) | ||
Add entry after tail. More... | |||
#define | clib_llist_remove(LP, name, E) | ||
Remove entry from list. More... | |||
#define | clib_llist_pop_first(LP, name, E, H) | ||
Removes and returns the first element in the list. More... | |||
#define | clib_llist_splice(LP, name, P, H) | ||
Splice two lists at a given position. More... | |||
#define | clib_llist_foreach(LP, name, H, E, body) | ||
Walk list starting at head. More... | |||
#define | clib_llist_foreach_safe(LP, name, H, E, body) | ||
Walk list starting at head safe. More... | |||
#define | clib_llist_foreach_reverse(LP, name, H, E, body) | ||
Walk list starting at head in reverse order. More... | |||
Typedefs | |
typedef u32 | clib_llist_index_t |
typedef struct clib_llist_anchor | clib_llist_anchor_t |
#define clib_llist_add | ( | LP, | |
name, | |||
E, | |||
H | |||
) | clib_llist_insert ((LP),name,(E),(H)) |
#define clib_llist_add_tail | ( | LP, | |
name, | |||
E, | |||
H | |||
) |
#define clib_llist_anchor_init | ( | LP, | |
name, | |||
E | |||
) |
#define clib_llist_elt | ( | LP, | |
EI | |||
) | pool_elt_at_index (LP, EI) |
#define clib_llist_elt_is_linked | ( | E, | |
name | |||
) |
Check if element is linked in a list.
E | list element |
name | list anchor name |
#define clib_llist_elts | ( | LP | ) | pool_elts (LP) |
#define clib_llist_entry_index | ( | LP, | |
E | |||
) | ((E) - (LP)) |
#define clib_llist_foreach | ( | LP, | |
name, | |||
H, | |||
E, | |||
body | |||
) |
Walk list starting at head.
LP | linked list pool |
name | list anchor name |
H | head entry |
E | entry iterator |
body | code to be executed |
#define clib_llist_foreach_reverse | ( | LP, | |
name, | |||
H, | |||
E, | |||
body | |||
) |
Walk list starting at head in reverse order.
LP | linked list pool |
name | list anchor name |
H | head entry |
E | entry iterator |
body | code to be executed |
#define clib_llist_foreach_safe | ( | LP, | |
name, | |||
H, | |||
E, | |||
body | |||
) |
Walk list starting at head safe.
LP | linked list pool |
name | list anchor name |
HI | head index |
EI | entry index iterator |
body | code to be executed |
#define clib_llist_free | ( | LP | ) | pool_free (LP) |
#define clib_llist_get | ( | LP, | |
E | |||
) | pool_get (LP, E) |
#define clib_llist_is_empty | ( | LP, | |
name, | |||
H | |||
) | (clib_llist_entry_index (LP,H) == (H)->name.next) |
#define clib_llist_make_head | ( | LP, | |
name | |||
) |
#define clib_llist_next | ( | LP, | |
name, | |||
E | |||
) | pool_elt_at_index((LP),_lnext((E),name)) |
#define clib_llist_pop_first | ( | LP, | |
name, | |||
E, | |||
H | |||
) |
Removes and returns the first element in the list.
The element is not freed. It's the responsability of the caller to free it.
LP | linked list pool |
name | list anchor name |
E | storage the first entry |
H | list head entry |
#define clib_llist_prev | ( | LP, | |
name, | |||
E | |||
) | pool_elt_at_index((LP),_lprev((E),name)) |
#define clib_llist_put | ( | LP, | |
E | |||
) | pool_put (LP, E) |
#define clib_llist_remove | ( | LP, | |
name, | |||
E | |||
) |
Remove entry from list.
LP | linked list pool |
name | list anchor name |
E | entry to be removed |
Splice two lists at a given position.
List spliced into destination list is left with 0 entries, i.e., head is made to point to itself.
LP | linked list pool |
name | list anchor name |
P | position in destination where source list is spliced |
H | head of source list that will be spliced into destination |
typedef struct clib_llist_anchor clib_llist_anchor_t |
typedef u32 clib_llist_index_t |