46 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 54 #define foreach_bier_api_msg \ 55 _(BIER_TABLE_ADD_DEL, bier_table_add_del) \ 56 _(BIER_TABLE_DUMP, bier_table_dump) \ 57 _(BIER_ROUTE_ADD_DEL, bier_route_add_del) \ 58 _(BIER_ROUTE_DUMP, bier_route_dump) \ 59 _(BIER_IMP_ADD, bier_imp_add) \ 60 _(BIER_IMP_DEL, bier_imp_del) \ 61 _(BIER_IMP_DUMP, bier_imp_dump) \ 62 _(BIER_DISP_TABLE_ADD_DEL, bier_disp_table_add_del) \ 63 _(BIER_DISP_TABLE_DUMP, bier_disp_table_dump) \ 64 _(BIER_DISP_ENTRY_ADD_DEL, bier_disp_entry_add_del) \ 65 _(BIER_DISP_ENTRY_DUMP, bier_disp_entry_dump) 70 vl_api_bier_table_add_del_reply_t *rmp;
79 rv = VNET_API_ERROR_BIER_BSL_UNSUP;
99 if ((0 == label) || (~0 == label))
127 mp->_vl_msg_id = ntohs(VL_API_BIER_TABLE_DETAILS);
163 vl_api_bier_route_add_del_reply_t *rmp;
172 bp = ntohl(mp->
br_bp);
177 rv = VNET_API_ERROR_BIER_BSL_UNSUP;
198 brpath = &brpaths[ii];
258 mp->_vl_msg_id = ntohs(VL_API_BIER_ROUTE_DETAILS);
322 rv = VNET_API_ERROR_BIER_BSL_UNSUP;
350 vl_api_bier_imp_del_reply_t *rmp;
380 mp->_vl_msg_id = ntohs(VL_API_BIER_IMP_DETAILS);
413 vl_api_bier_disp_table_add_del_reply_t *rmp;
433 REPLY_MACRO (VL_API_BIER_DISP_TABLE_ADD_DEL_REPLY);
447 mp->_vl_msg_id = ntohs(VL_API_BIER_DISP_TABLE_DETAILS);
474 vl_api_bier_disp_entry_add_del_reply_t *rmp;
513 sizeof (brp->frp_addr.ip4));
519 sizeof (brp->frp_addr.ip6));
534 rv = VNET_API_ERROR_UNSUPPORTED;
559 brp->frp_fib_index = fti;
563 rv = VNET_API_ERROR_NO_SUCH_FIB;
589 REPLY_MACRO (VL_API_BIER_DISP_ENTRY_ADD_DEL_REPLY);
623 mp->_vl_msg_id = ntohs(VL_API_BIER_DISP_ENTRY_DETAILS);
666 #define vl_msg_name_crc_list 667 #include <vnet/bier/bier.api.h> 668 #undef vl_msg_name_crc_list 673 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 674 foreach_vl_msg_name_crc_bier;
684 vl_msg_api_set_handlers(VL_API_##N, #n, \ 685 vl_api_##n##_t_handler, \ 687 vl_api_##n##_t_endian, \ 688 vl_api_##n##_t_print, \ 689 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.
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.
vl_api_fib_path_t br_paths[br_n_paths]
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 clib_memcpy_fast(a, b, c)
#define REPLY_MACRO2(t, body)
bier_disp_table_t * bier_disp_table_pool
memory pool for disposition tables
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
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.
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
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)
u32 bier_hdr_len_id_to_num_bytes(bier_hdr_len_id_t id)
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)
void * vl_msg_api_alloc(int nbytes)
vl_api_bier_table_id_t br_tbl_id
bier_bp_t be_bp
the bit position this entry represents.
bier_disposition : The BIER disposition 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_imposition : The BIER imposition object
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
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)
void bier_table_route_path_remove(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
vl_api_bier_table_id_t bi_tbl_id
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.
static void vl_api_bier_imp_dump_t_handler(vl_api_bier_imp_dump_t *mp)
vnet_api_error_t api_errno
Bit-string lengths greater than 1024 are not supported due to the limited about pf space available in...
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)
vl_api_registration_t * reg
static void send_bier_imp_details(vl_api_registration_t *reg, u32 context, const bier_imp_t *bi)
BIER Table Add / del route.
vl_api_fib_path_t bde_paths[bde_n_paths]
vl_api_bier_table_id_t br_tbl_id
vl_api_fib_path_t br_paths[br_n_paths]
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)
An API client registration, only in vpp/vlib.
static void vl_api_bier_disp_table_dump_t_handler(vl_api_bier_disp_table_dump_t *mp)
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)
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.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
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.
void bier_table_unlock(const bier_table_id_t *bti)
vl_api_fib_path_t bde_paths[bde_n_paths]
static void send_bier_table_details(vl_api_registration_t *reg, u32 context, const bier_table_t *bt)
void bier_table_route_delete(const bier_table_id_t *btid, bier_bp_t bp)
#define FOR_EACH_BIER_HDR_PROTO(_proto)
void fib_api_path_encode(const fib_route_path_encode_t *api_rpath, vl_api_fib_path_t *out)
vl_api_bier_table_id_t br_tbl_id
#define BIER_BP_MAX
The maximum BP that can be assigned.
vl_api_registration_t * reg
BIER Disposition Entry Add / del.
bier_table_id_t bt_id
The identity/key or the table.
u8 bi_bits[BIER_HDR_BUCKETS_1024]
The bit string.
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...
void bier_disp_table_unlock_w_table_id(u32 table_id)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void bier_table_route_path_add(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
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...
static void send_bier_disp_table_details(vl_api_registration_t *reg, u32 context, const bier_disp_table_t *bdt)
A protocol Independent IP multicast FIB table.
vl_api_bier_table_id_t bt_tbl_id
#define BIER_ECMP_TABLE_ID_MAIN
Definition of the ID of the BIER main table.
int fib_path_api_parse(const vl_api_fib_path_t *in, fib_route_path_t *out)
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.
fib_path_list_walk_rc_t fib_path_encode(fib_node_index_t path_list_index, fib_node_index_t path_index, const fib_path_ext_t *path_ext, void *ctx)
void bier_disp_table_walk(u32 table_id, bier_disp_table_walk_fn_t fn, void *ctx)
void fib_path_list_walk_w_ext(fib_node_index_t path_list_index, const fib_path_ext_list_t *ext_list, fib_path_list_walk_w_ext_fn_t func, void *ctx)
#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)
void bier_table_route_path_update(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
BIER Route Add / del route.
u32 bdt_table_id
Table ID (hash key) for this FIB.
index_t bier_disp_table_add_or_lock(u32 table_id)