FD.io VPP
v19.08.3-2-gbabecb413
Vector Packet Processing
|
Bitmaps built as vectors of machine words. More...
Go to the source code of this file.
Macros | |
#define | clib_bitmap_dup(v) vec_dup(v) |
Duplicate a bitmap. More... | |
#define | clib_bitmap_free(v) vec_free(v) |
Free a bitmap. More... | |
#define | clib_bitmap_bytes(v) vec_bytes(v) |
Number of bytes in a bitmap. More... | |
#define | clib_bitmap_zero(v) vec_zero(v) |
Clear a bitmap. More... | |
#define | clib_bitmap_alloc(v, n_bits) v = vec_new (uword, ((n_bits) + BITS (uword) - 1) / BITS (uword)) |
Allocate a bitmap with the supplied number of bits. More... | |
#define | clib_bitmap_vec_validate(v, i) vec_validate_aligned((v),(i),sizeof(uword)) |
#define | clib_bitmap_validate(v, n_bits) clib_bitmap_vec_validate ((v), ((n_bits) - 1) / BITS (uword)) |
#define | clib_bitmap_foreach(i, ai, body) |
Macro to iterate across set bits in a bitmap. More... | |
Typedefs | |
typedef uword | clib_bitmap_t |
Functions | |
static uword | clib_bitmap_is_zero (uword *ai) |
predicate function; is an entire bitmap empty? More... | |
static uword | clib_bitmap_is_equal (uword *a, uword *b) |
predicate function; are two bitmaps equal? More... | |
static uword | clib_bitmap_set_no_check (uword *a, uword i, uword new_value) |
Sets the ith bit of a bitmap to new_value. More... | |
static uword * | clib_bitmap_set (uword *ai, uword i, uword value) |
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. More... | |
static uword | clib_bitmap_get (uword *ai, uword i) |
Gets the ith bit value from a bitmap. More... | |
static uword | clib_bitmap_get_no_check (uword *ai, uword i) |
Gets the ith bit value from a bitmap Does not sanity-check the bit position. More... | |
static uword | clib_bitmap_get_multiple_no_check (uword *ai, uword i, uword n_bits) |
static uword | clib_bitmap_get_multiple (uword *bitmap, uword i, uword n_bits) |
Gets the ith through ith + n_bits bit values from a bitmap. More... | |
static uword * | clib_bitmap_set_multiple (uword *bitmap, uword i, uword value, uword n_bits) |
sets the ith through ith + n_bits bits in a bitmap More... | |
static uword * | clib_bitmap_set_region (uword *bitmap, uword i, uword value, uword n_bits) |
static uword | clib_bitmap_first_set (uword *ai) |
Return the lowest numbered set bit in a bitmap. More... | |
static uword | clib_bitmap_last_set (uword *ai) |
Return the higest numbered set bit in a bitmap. More... | |
static uword | clib_bitmap_first_clear (uword *ai) |
Return the lowest numbered clear bit in a bitmap. More... | |
static uword | clib_bitmap_count_set_bits (uword *ai) |
Return the number of set bits in a bitmap. More... | |
static uword * | clib_bitmap_and (uword *ai, uword *bi) |
Logical operator across two bitmaps. More... | |
static uword * | clib_bitmap_andnot (uword *ai, uword *bi) |
Logical operator across two bitmaps. More... | |
static uword * | clib_bitmap_or (uword *ai, uword *bi) |
Logical operator across two bitmaps. More... | |
static uword * | clib_bitmap_xor (uword *ai, uword *bi) |
Logical operator across two bitmaps. More... | |
static uword * | clib_bitmap_dup_and (uword *ai, uword *bi) |
Logical operator across two bitmaps which duplicates the first bitmap. More... | |
static uword * | clib_bitmap_dup_andnot (uword *ai, uword *bi) |
Logical operator across two bitmaps which duplicates the first bitmap. More... | |
static uword * | clib_bitmap_dup_or (uword *ai, uword *bi) |
Logical operator across two bitmaps which duplicates the first bitmap. More... | |
static uword * | clib_bitmap_dup_xor (uword *ai, uword *bi) |
Logical operator across two bitmaps which duplicates the first bitmap. More... | |
Variables | |
a = a & ~b | |
Bitmaps built as vectors of machine words.
Definition in file bitmap.h.
#define clib_bitmap_bytes | ( | v | ) | vec_bytes(v) |
#define clib_bitmap_dup | ( | v | ) | vec_dup(v) |
#define clib_bitmap_foreach | ( | i, | |
ai, | |||
body | |||
) |
Macro to iterate across set bits in a bitmap.
i | - the current set bit |
ai | - the bitmap |
body | - the expression to evaluate for each set bit |
#define clib_bitmap_free | ( | v | ) | vec_free(v) |
#define clib_bitmap_validate | ( | v, | |
n_bits | |||
) | clib_bitmap_vec_validate ((v), ((n_bits) - 1) / BITS (uword)) |
#define clib_bitmap_vec_validate | ( | v, | |
i | |||
) | vec_validate_aligned((v),(i),sizeof(uword)) |
#define clib_bitmap_zero | ( | v | ) | vec_zero(v) |
typedef uword clib_bitmap_t |
Logical operator across two bitmaps.
ai | - pointer to the destination bitmap |
bi | - pointer to the source bitmap |
Logical operator across two bitmaps.
ai | - pointer to the destination bitmap |
bi | - pointer to the source bitmap |
Logical operator across two bitmaps which duplicates the first bitmap.
ai | - pointer to the destination bitmap |
bi | - pointer to the source bitmap |
Logical operator across two bitmaps which duplicates the first bitmap.
ai | - pointer to the destination bitmap |
bi | - pointer to the source bitmap |
Logical operator across two bitmaps which duplicates the first bitmap.
ai | - pointer to the destination bitmap |
bi | - pointer to the source bitmap |
Logical operator across two bitmaps which duplicates the first bitmap.
ai | - pointer to the destination bitmap |
bi | - pointer to the source bitmap |
Gets the ith through ith + n_bits bit values from a bitmap.
bitmap | - pointer to the bitmap |
i | - the first bit position to retrieve |
n_bits | - the number of bit positions to retrieve |
Definition at line 235 of file bitmap.h.
Gets the ith bit value from a bitmap Does not sanity-check the bit position.
Be careful.
ai | - pointer to the bitmap |
i | - the bit position to interrogate |
Definition at line 212 of file bitmap.h.
Logical operator across two bitmaps.
ai | - pointer to the destination bitmap |
bi | - pointer to the source bitmap |
ai | - pointer to the destination bitmap |
bi | - pointer to the source bitmap |
|
inlinestatic |
sets the ith through ith + n_bits bits in a bitmap
bitmap | - pointer to the bitmap |
i | - the first bit position to retrieve |
value | - the values to set |
n_bits | - the number of bit positions to set |
Definition at line 275 of file bitmap.h.
Logical operator across two bitmaps.
ai | - pointer to the destination bitmap |
bi | - pointer to the source bitmap |