39 #define BIER_IMP_ID_HLEN_SHIFT 24 56 return (bi - bier_imp_pool);
140 u32 indent = va_arg(*args,
u32);
146 s =
format(s,
"bier-imp:[%d]: tbl:[%U] hdr:[%U]",
223 u32 indent = va_arg(*ap,
u32);
292 .path =
"show bier imp",
293 .short_help =
"show bier imp [index]",
dpo_lock_fn_t dv_lock
A reference counting lock function.
u8 * format_bier_bit_string(u8 *string, va_list *args)
void bier_imp_contribute_forwarding(index_t bii, dpo_proto_t proto, dpo_id_t *dpo)
A virtual function table regisitered for a DPO type.
static bier_hdr_len_id_t bier_hdr_get_len_id(const bier_hdr_t *bier_hdr)
u8 * format_bier_table_id(u8 *s, va_list *ap)
Format a BIER table ID.
enum bier_show_flags_t_ bier_show_flags_t
Flags to control show output.
u32 bi_locks
number of locks
#define clib_memcpy_fast(a, b, c)
static void bier_imp_dpo_lock(dpo_id_t *dpo)
void bier_imp_lock(index_t bii)
static const char *const bier_imp_ip4_nodes[]
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
clib_error_t * bier_imp_db_module_init(vlib_main_t *vm)
#define pool_len(p)
Number of elements in pool vector.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
u16 bbs_len
The length of the string in BYTES.
A Variable length BitString.
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
bier_imposition : The BIER imposition object
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
void bier_table_contribute_forwarding(index_t bti, dpo_id_t *dpo)
static void bier_imp_dpo_unlock(dpo_id_t *dpo)
static bier_imp_t * bier_imp_get(index_t bii)
bier_hdr_t bi_hdr
The Header to impose.
u8 * format_bier_imp(u8 *s, va_list *args)
void fib_show_memory_usage(const char *name, u32 in_use_elts, u32 allocd_elts, size_t size_elt)
Show the memory usage for a type.
static void bier_imp_dpo_mem_show(void)
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
u32 bier_bp_t
A bit positon as assigned to egress PEs.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static void bier_hdr_hton(bier_hdr_t *bier_hdr)
bier_hdr_len_id_t bti_hdr_len
The size of the bit string processed by this table.
#define pool_put(P, E)
Free an object E in pool P.
index_t bier_imp_add_or_lock(const bier_table_id_t *bti, bier_bp_t sender, const bier_bit_string_t *bs)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
bier_imp_t * bier_imp_pool
bier_imposition : The BIER imposition object
static const char *const *const bier_imp_nodes[DPO_PROTO_NUM]
static const char *const bier_imp_ip6_nodes[]
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
static void bier_bit_string_init(bier_bit_string_t *bbs, bier_hdr_len_id_t len, bier_bit_mask_bucket_t *buckets)
#define VLIB_CLI_COMMAND(x,...)
void bier_table_unlock(const bier_table_id_t *bti)
static void bier_imp_lock_i(bier_imp_t *bi)
static u8 * format_bier_imp_dpo(u8 *s, va_list *ap)
bier_bit_mask_bucket_t * bbs_buckets
The buckets in the string.
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject
static index_t bier_imp_get_index(bier_imp_t *bi)
index_t bier_table_lock(const bier_table_id_t *btid)
static clib_error_t * show_bier_imp(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u8 bi_bits[BIER_HDR_BUCKETS_1024]
The bit string.
A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mp...
index_t dpoi_index
the index of objects of that type
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
u8 * format_bier_hdr(u8 *s, va_list *ap)
Format a BIER header.
bier_table_id_t bi_tbl
The BIER table into which to forward the post imposed packet.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define CLIB_CACHE_LINE_BYTES
dpo_id_t bi_dpo[FIB_PROTOCOL_IP_MAX]
The DPO contirubted from the resolving BIER table.
void bier_imp_unlock(index_t bii)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static void bier_hdr_ntoh(bier_hdr_t *bier_hdr)
static void bier_hdr_init(bier_hdr_t *bier_hdr, bier_hdr_version_t version, bier_hdr_proto_id_t proto, bier_hdr_len_id_t len, bier_hdr_entropy_t entropy, bier_bp_t src)
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child-parent relationship.
static uword pool_elts(void *v)
Number of active elements in a pool.