46 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 53 #define foreach_bier_api_msg \ 54 _(BIER_TABLE_ADD_DEL, bier_table_add_del) \ 55 _(BIER_TABLE_DUMP, bier_table_dump) \ 56 _(BIER_ROUTE_ADD_DEL, bier_route_add_del) \ 57 _(BIER_ROUTE_DUMP, bier_route_dump) \ 58 _(BIER_IMP_ADD, bier_imp_add) \ 59 _(BIER_IMP_DEL, bier_imp_del) \ 60 _(BIER_IMP_DUMP, bier_imp_dump) \ 61 _(BIER_DISP_TABLE_ADD_DEL, bier_disp_table_add_del) \ 62 _(BIER_DISP_TABLE_DUMP, bier_disp_table_dump) \ 63 _(BIER_DISP_ENTRY_ADD_DEL, bier_disp_entry_add_del) \ 64 _(BIER_DISP_ENTRY_DUMP, bier_disp_entry_dump) 69 vl_api_bier_table_add_del_reply_t *rmp;
92 if ((0 == label) || (~0 == label))
118 memset(mp, 0,
sizeof(*mp));
119 mp->_vl_msg_id = ntohs(VL_API_BIER_TABLE_DETAILS);
155 vl_api_bier_route_add_del_reply_t *rmp;
165 bp = ntohl(mp->
br_bp);
186 brpath = &brpaths[ii];
187 memset(brpath, 0,
sizeof(*brpath));
230 rv = VNET_API_ERROR_NO_SUCH_FIB;
276 memset(mp, 0, m_size);
277 mp->_vl_msg_id = ntohs(VL_API_BIER_ROUTE_DETAILS);
291 fp->
weight = api_rpath->rpath.frp_weight;
292 fp->
preference = api_rpath->rpath.frp_preference;
293 fp->
sw_if_index = htonl (api_rpath->rpath.frp_sw_if_index);
361 vl_api_bier_imp_del_reply_t *rmp;
390 memset(mp, 0,
sizeof(*mp)+n_bytes);
391 mp->_vl_msg_id = ntohs(VL_API_BIER_IMP_DETAILS);
425 vl_api_bier_disp_table_add_del_reply_t *rmp;
445 REPLY_MACRO (VL_API_BIER_DISP_TABLE_ADD_DEL_REPLY);
458 memset(mp, 0,
sizeof(*mp));
459 mp->_vl_msg_id = ntohs(VL_API_BIER_DISP_TABLE_DETAILS);
486 vl_api_bier_disp_entry_add_del_reply_t *rmp;
525 sizeof (brp->frp_addr.ip4));
531 sizeof (brp->frp_addr.ip6));
546 rv = VNET_API_ERROR_UNSUPPORTED;
571 brp->frp_fib_index = fti;
575 rv = VNET_API_ERROR_NO_SUCH_FIB;
601 REPLY_MACRO (VL_API_BIER_DISP_ENTRY_ADD_DEL_REPLY);
634 memset(mp, 0, m_size);
635 mp->_vl_msg_id = ntohs(VL_API_BIER_DISP_ENTRY_DETAILS);
648 fp->
weight = api_rpath->rpath.frp_weight;
649 fp->
preference = api_rpath->rpath.frp_preference;
650 fp->
sw_if_index = htonl (api_rpath->rpath.frp_sw_if_index);
679 #define vl_msg_name_crc_list 680 #include <vnet/bier/bier.api.h> 681 #undef vl_msg_name_crc_list 686 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 687 foreach_vl_msg_name_crc_bier;
697 vl_msg_api_set_handlers(VL_API_##N, #n, \ 698 vl_api_##n##_t_handler, \ 700 vl_api_##n##_t_endian, \ 701 vl_api_##n##_t_print, \ 702 sizeof(vl_api_##n##_t), 1); #define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static void vl_api_bier_imp_del_t_handler(vl_api_bier_imp_del_t *mp)
#define vec_foreach_index(var, v)
Iterate over vector indices.
ip46_address_t frp_addr
The next-hop address.
unix_shared_memory_queue_t * q
A representation of a fib path for fib_path_encode to convey the information to the caller...
static bier_hdr_len_id_t bier_hdr_get_len_id(const bier_hdr_t *bier_hdr)
fib_node_index_t bde_pl[BIER_HDR_N_PROTO]
The path-lists used by per-payload protocol parents.
struct bier_route_details_walk_t_ bier_route_details_walk_t
vl_api_bier_table_id_t bt_tbl_id
A representation of a path as described by a route producer.
static void vl_api_bier_table_dump_t_handler(vl_api_bier_table_dump_t *mp)
vnet_main_t * vnet_get_main(void)
static void vl_api_bier_table_add_del_t_handler(vl_api_bier_table_add_del_t *mp)
vl_api_bier_table_id_t bi_tbl_id
#define REPLY_MACRO2(t, body)
bier_disp_table_t * bier_disp_table_pool
memory pool for disposition tables
u32 mpls_label_t
A label value only, i.e.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static void setup_message_id_table(api_main_t *am)
static void vl_api_bier_route_add_del_t_handler(vl_api_bier_route_add_del_t *mp)
fib_node_index_t be_path_list
the FIB path-list this entry resolves through.
Reply for BIER route add / del request.
void fib_path_list_walk(fib_node_index_t path_list_index, fib_path_list_walk_fn_t func, void *ctx)
bier_bit_mask_4096_t bi_bits
The bit string.
void bier_disp_table_entry_path_remove(u32 table_id, bier_bp_t src, bier_hdr_proto_id_t payload_proto, const fib_route_path_t *rpath)
dpo_proto_t frp_proto
The protocol of the address below.
u32 bier_hdr_len_id_to_num_bytes(bier_hdr_len_id_t id)
static void send_bier_disp_table_details(unix_shared_memory_queue_t *q, u32 context, const bier_disp_table_t *bdt)
static void send_bier_route_details(const bier_table_t *bt, const bier_entry_t *be, void *args)
void bier_disp_table_entry_path_add(u32 table_id, bier_bp_t src, bier_hdr_proto_id_t payload_proto, const fib_route_path_t *rpaths)
vl_api_bier_table_id_t br_tbl_id
bier_bp_t be_bp
the bit position this entry represents.
bier_dispositon : The BIER dispositon object
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
u16 bbs_len
The length of the string in BYTES.
A Variable length BitString.
A local path with a RPF-ID => multicast traffic.
VLIB_API_INIT_FUNCTION(bier_api_hookup)
bier_bit_mask_bucket_t bits[BIER_HDR_BUCKETS_4096]
bier_imposition : The BIER imposition object
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
u32 frp_sw_if_index
The interface.
mpls_label_t * frp_label_stack
The outgoing MPLS label Stack.
int bier_table_is_main(const bier_table_t *bt)
bier_hdr_t bi_hdr
The Header to impose.
bier_table_set_id_t bti_set
The SET-ID The control plane divdies the bit-position space into sets in the case the max bit-positio...
static clib_error_t * bier_api_hookup(vlib_main_t *vm)
vl_api_bier_table_id_t bi_tbl_id
A path via a UDP encap object.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
#define foreach_bier_api_msg
mpls_label_t bt_ll
Save the MPLS local label associated with the table.
u32 bier_bp_t
A bit positon as assigned to egress PEs.
void * vl_msg_api_alloc(int nbytes)
static void vl_api_bier_imp_dump_t_handler(vl_api_bier_imp_dump_t *mp)
vnet_api_error_t api_errno
bier_hdr_len_id_t bti_hdr_len
The size of the bit string processed by this table.
struct bier_disp_entry_details_walk_t_ bier_disp_entry_details_walk_t
static bier_hdr_src_id_t bier_hdr_get_src_id(const bier_hdr_t *bier_hdr)
index_t bier_table_add_or_lock(const bier_table_id_t *btid, mpls_label_t local_label)
BIER Table Add / del route.
void bier_table_route_add(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
vl_api_bier_table_id_t br_tbl_id
index_t bier_imp_add_or_lock(const bier_table_id_t *bti, bier_bp_t sender, const bier_bit_string_t *bs)
static void vl_api_bier_route_dump_t_handler(vl_api_bier_route_dump_t *mp)
API main structure, used by both vpp and binary API clients.
BIER Disposition Table Add / del route.
static void vl_api_bier_disp_entry_dump_t_handler(vl_api_bier_disp_entry_dump_t *mp)
vl_api_fib_path3_t bde_paths[bde_n_paths]
static void send_bier_imp_details(unix_shared_memory_queue_t *q, u32 context, const bier_imp_t *bi)
static void vl_api_bier_disp_table_dump_t_handler(vl_api_bier_disp_table_dump_t *mp)
vl_api_fib_path3_t br_paths[br_n_paths]
static void vl_api_bier_imp_add_t_handler(vl_api_bier_imp_add_t *mp)
bier_imp_t * bier_imp_pool
bier_imposition : The BIER imposition object
#define MPLS_LABEL_INVALID
#define vec_free(V)
Free vector's memory (no header).
static void send_bier_disp_entry_details(const bier_disp_table_t *bdt, const bier_disp_entry_t *bde, u16 bp, void *args)
#define clib_memcpy(a, b, c)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
u32 fib_path_list_get_n_paths(fib_node_index_t path_list_index)
u32 fib_node_index_t
A typedef of a node index.
enum bier_hdr_proto_id_t_ bier_hdr_proto_id_t
BIER header protocol payload types.
index_t bier_disp_table_find(u32 table_id)
void bier_table_walk(const bier_table_id_t *bti, bier_table_walk_fn_t fn, void *ctx)
bier_table_t * bier_table_pool
Memory pool of all the allocated tables.
static void send_bier_table_details(unix_shared_memory_queue_t *q, u32 context, const bier_table_t *bt)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
void bier_table_unlock(const bier_table_id_t *bti)
fib_path_list_walk_rc_t fib_path_encode(fib_node_index_t path_list_index, fib_node_index_t path_index, void *ctx)
#define FOR_EACH_BIER_HDR_PROTO(_proto)
fib_route_path_flags_t frp_flags
flags on the path
vl_api_fib_path3_t bde_paths[bde_n_paths]
vl_api_bier_table_id_t br_tbl_id
#define BIER_BP_MAX
The maximum BP that can be assigned.
BIER Disposition Entry Add / del.
bier_table_id_t bt_id
The identity/key or the table.
static void vl_api_bier_disp_table_add_del_t_handler(vl_api_bier_disp_table_add_del_t *mp)
A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mp...
unix_shared_memory_queue_t * q
void bier_disp_table_unlock_w_table_id(u32 table_id)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
void bier_table_route_remove(const bier_table_id_t *bti, bier_bp_t bp, fib_route_path_t *brps)
A BIER Table is the bit-indexed forwarding table.
u32 mfib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
bier_table_sub_domain_id_t bti_sub_domain
The Sub-Domain-ID The control plane has the configuration option to specify multiple domains or topol...
A protocol Independent IP multicast FIB table.
void copy_fib_next_hop(fib_route_path_encode_t *api_rpath, void *fp_arg)
vl_api_bier_table_id_t bt_tbl_id
#define BIER_ECMP_TABLE_ID_MAIN
Definition of the ID of the BIER main table.
static void vl_api_bier_disp_entry_add_del_t_handler(vl_api_bier_disp_entry_add_del_t *mp)
bier_table_id_t bi_tbl
The BIER table into which to forward the post imposed packet.
#define vec_foreach(var, vec)
Vector iterator.
void bier_disp_table_walk(u32 table_id, bier_disp_table_walk_fn_t fn, void *ctx)
vl_api_fib_path3_t br_paths[br_n_paths]
u32 frp_udp_encap_id
UDP encap ID.
#define ip46_address_is_zero(ip46)
void bier_imp_unlock(index_t bii)
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
static void bier_hdr_ntoh(bier_hdr_t *bier_hdr)
BIER Route Add / del route.
u32 bdt_table_id
Table ID (hash key) for this FIB.
struct _unix_shared_memory_queue unix_shared_memory_queue_t
index_t bier_disp_table_add_or_lock(u32 table_id)