21 #define bier_error(n,s) BIER_INPUT_ERROR_##n, 28 #define bier_error(n,s) s, 47 if (
NULL == bier_bift_table)
57 clib_memset(bier_bift_table, 0,
sizeof(*bier_bift_table));
106 bier_bift_table =
NULL;
123 u32 n_left_from, next_index, * from, * to_next;
129 while (n_left_from > 0)
134 to_next, n_left_to_next);
136 while (n_left_from > 0 && n_left_to_next > 0)
153 bift0 = clib_net_to_host_u32(*biftp0);
178 to_next, n_left_to_next,
186 BIER_INPUT_ERROR_PKTS_VALID,
205 .name =
"bier-bift-input",
207 .vector_size =
sizeof (
u32),
220 u32 hdr_len,
set, sub_domain;
222 set = hdr_len = sub_domain = ~0;
225 if (
unformat (input,
"sd %d", &sub_domain)) {
227 }
else if (
unformat (input,
"set %d", &
set)) {
229 }
else if (
unformat (input,
"bsl %d", &hdr_len)) {
239 if (
NULL == bier_bift_table)
288 .path =
"show bier bift",
289 .short_help =
"show bier bift [set <value> sd <value> bsl <value>]",
void dpo_stack_from_node(u32 child_node_index, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child parent relationship.
bier_bfit_table_t * bier_bift_table
Global BIFT table.
struct bier_bift_input_trace_t_ bier_bift_input_trace_t
Packet trace record for BIER input.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u8 * format_bier_bift_id(u8 *s, va_list *ap)
void bier_bift_table_entry_add(bier_bift_id_t id, const dpo_id_t *dpo)
const dpo_id_t * drop_dpo_get(dpo_proto_t proto)
static char * bier_error_strings[]
bier_bift_id_t bier_bift_id_encode(bier_table_set_id_t set, bier_table_sub_domain_id_t sd, bier_hdr_len_id_t bsl)
Encode a BIFT-ID as per draft-wijnandsxu-bier-non-mpls-bift-encoding-00.txt.
static u32 vnet_mpls_uc_get_ttl(mpls_label_t label_exp_s_ttl)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static const dpo_id_t * bier_bift_dp_lookup(bier_bift_id_t key_host_order)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u32 vnet_mpls_uc_get_label(mpls_label_t label_exp_s_ttl)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
vlib_node_registration_t bier_bift_input_node
Forward declare the node.
#define VLIB_REGISTER_NODE(x,...)
static uword bier_bift_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
#define BIER_BIFT_N_ENTRIES
void udp_unregister_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u8 is_ip4)
enum bier_hdr_len_id_t_ bier_hdr_len_id_t
bier_hdr_len_id_t enumerator
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
u32 bier_bift_id_t
The BIER universal 'label'.
#define VLIB_CLI_COMMAND(x,...)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
void bier_bift_id_decode(bier_bift_id_t id, bier_table_set_id_t *set, bier_table_sub_domain_id_t *sd, bier_hdr_len_id_t *bsl)
static void clib_mem_free(void *p)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject
static vlib_main_t * vlib_get_main(void)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
u8 * format_bier_hdr_len_id(u8 *s, va_list *ap)
Format the header length field.
index_t dpoi_index
the index of objects of that type
dpo_id_t bblt_dpos[BIER_BIFT_N_ENTRIES]
Forwarding information for each BIFT ID.
static u8 * format_bier_bift_input_trace(u8 *s, va_list *args)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static void * clib_mem_alloc_aligned(uword size, uword align)
static bier_hdr_len_id_t bier_hdr_bit_len_to_id(u32 bytes)
int dpo_is_drop(const dpo_id_t *dpo)
The Drop DPO will drop all packets, no questions asked.
void bier_bift_table_entry_remove(bier_bift_id_t id)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
u32 bblt_n_entries
The number of entries in the table.
u16 dpoi_next_node
The next VLIB node to follow.
void udp_register_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u32 node_index, u8 is_ip4)
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
clib_error_t * show_bier_bift_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)