25 #define BIER_GET_STRING_POS(_bp, _byte, _bit, _str) \ 28 _byte = ((BIER_BBS_LEN_TO_BUCKETS((_str)->bbs_len) - 1 ) - \ 29 (_bp / BIER_BIT_MASK_BITS_PER_BUCKET)); \ 30 _bit = _bp % BIER_BIT_MASK_BITS_PER_BUCKET; \ 46 #define BIER_BIT_POS_IS_VALID(_bp, _str) \ 48 if (!bier_bit_pos_is_valid(_bp, _str)) return; \ 56 u16 byte_pos, bit_pos;
69 u16 byte_pos, bit_pos;
74 bit_string->
bbs_buckets[byte_pos] &= ~(1 << bit_pos);
82 int leading_marker = 0;
83 int suppress_zero = 0;
91 for (index = 0; index < (bs->
bbs_len/4); index++) {
93 if (!leading_marker) {
96 string =
format(
string,
":");
99 if (suppress_zero)
continue;
104 string =
format(
string,
"%s%X", index ?
":" :
"",
105 clib_net_to_host_u32(ptr[index]));
u8 * format_bier_bit_string(u8 *string, va_list *args)
void bier_bit_string_set_bit(bier_bit_string_t *bit_string, bier_bp_t bp)
u16 bbs_len
The length of the string in BYTES.
A Variable length BitString.
u32 bier_bp_t
A bit positon as assigned to egress PEs.
void bier_bit_string_clear_bit(bier_bit_string_t *bit_string, bier_bp_t bp)
#define BIER_GET_STRING_POS(_bp, _byte, _bit, _str)
#define BIER_BBS_LEN_TO_BITS(_len)
static int bier_bit_pos_is_valid(bier_bp_t bp, const bier_bit_string_t *bbs)
bier_bit_mask_bucket_t * bbs_buckets
The buckets in the string.
#define BIER_BIT_POS_IS_VALID(_bp, _str)
u8 bier_bit_mask_bucket_t
A bucket is a byte.