|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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;
85 .bti_sub_domain = mp->
bt_tbl_id.bt_sub_domain,
86 .bti_hdr_len = mp->
bt_tbl_id.bt_hdr_len_id,
127 mp->_vl_msg_id =
ntohs(VL_API_BIER_TABLE_DETAILS);
163 vl_api_bier_route_add_del_reply_t *rmp;
177 rv = VNET_API_ERROR_BIER_BSL_UNSUP;
188 .bti_sub_domain = mp->
br_route.br_tbl_id.bt_sub_domain,
189 .bti_hdr_len = mp->
br_route.br_tbl_id.bt_hdr_len_id,
198 brpath = &brpaths[ii];
251 vl_api_fib_path_t *fp;
255 m_size =
sizeof(*mp) + (
n_paths *
sizeof(vl_api_fib_path_t));
261 mp->_vl_msg_id =
ntohs(VL_API_BIER_ROUTE_DETAILS);
297 .bti_sub_domain = mp->
br_tbl_id.bt_sub_domain,
298 .bti_hdr_len = mp->
br_tbl_id.bt_hdr_len_id,
326 rv = VNET_API_ERROR_BIER_BSL_UNSUP;
332 .bti_sub_domain = mp->
bi_tbl_id.bt_sub_domain,
333 .bti_hdr_len = mp->
bi_tbl_id.bt_hdr_len_id,
354 vl_api_bier_imp_del_reply_t *rmp;
384 mp->_vl_msg_id =
ntohs(VL_API_BIER_IMP_DETAILS);
417 vl_api_bier_disp_table_add_del_reply_t *rmp;
437 REPLY_MACRO (VL_API_BIER_DISP_TABLE_ADD_DEL_REPLY);
451 mp->_vl_msg_id =
ntohs(VL_API_BIER_DISP_TABLE_DETAILS);
478 vl_api_bier_disp_entry_add_del_reply_t *rmp;
505 brp->frp_sw_if_index = ntohl(mp->
bde_paths[ii].sw_if_index);
507 if (~0 != ntohl(mp->
bde_paths[ii].rpf_id))
510 brp->frp_rpf_id = ntohl(mp->
bde_paths[ii].rpf_id);
517 sizeof (brp->frp_addr.ip4));
523 sizeof (brp->frp_addr.ip6));
538 rv = VNET_API_ERROR_UNSUPPORTED;
563 brp->frp_fib_index = fti;
567 rv = VNET_API_ERROR_NO_SUCH_FIB;
593 REPLY_MACRO (VL_API_BIER_DISP_ENTRY_ADD_DEL_REPLY);
611 vl_api_fib_path_t *fp;
626 m_size =
sizeof(*mp) + (
n_paths *
sizeof(vl_api_fib_path_t));
632 mp->_vl_msg_id =
ntohs(VL_API_BIER_DISP_ENTRY_DETAILS);
676 #define vl_msg_name_crc_list
677 #include <vnet/bier/bier.api.h>
678 #undef vl_msg_name_crc_list
683 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
684 foreach_vl_msg_name_crc_bier;
694 vl_msg_api_set_handlers(VL_API_##N, #n, \
695 vl_api_##n##_t_handler, \
697 vl_api_##n##_t_endian, \
698 vl_api_##n##_t_print, \
699 sizeof(vl_api_##n##_t), 1);
@ BIER_HDR_PROTO_MPLS_UP_STREAM
#define FOR_EACH_BIER_HDR_PROTO(_proto)
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
fib_node_index_t bde_pl[BIER_HDR_N_PROTO]
The path-lists used by per-payload protocol parents.
vl_api_fib_path_t bde_paths[bde_n_paths]
#define foreach_bier_api_msg
static void vl_api_bier_disp_entry_dump_t_handler(vl_api_bier_disp_entry_dump_t *mp)
vl_api_bier_table_id_t bi_tbl_id
@ BIER_TABLE_MPLS_SPF
BIER over MPLS with SPF.
#define REPLY_MACRO2(t, body)
#define BIER_BP_MAX
The maximum BP that can be assigned.
#define clib_memcpy(d, s, n)
Path encode context to use when walking a path-list to encode paths.
static void send_bier_disp_entry_details(const bier_disp_table_t *bdt, const bier_disp_entry_t *bde, u16 bp, void *args)
index_t bier_table_add_or_lock(const bier_table_id_t *btid, mpls_label_t local_label)
static void vl_api_bier_disp_table_add_del_t_handler(vl_api_bier_disp_table_add_del_t *mp)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
vl_api_bier_table_id_t br_tbl_id
static void vl_api_bier_table_add_del_t_handler(vl_api_bier_table_add_del_t *mp)
VLIB_API_INIT_FUNCTION(bier_api_hookup)
@ BIER_HDR_PROTO_MPLS_DOWN_STREAM
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static void send_bier_imp_details(vl_api_registration_t *reg, u32 context, const bier_imp_t *bi)
static void vl_api_bier_table_dump_t_handler(vl_api_bier_table_dump_t *mp)
void bier_imp_unlock(index_t bii)
index_t bier_disp_table_add_or_lock(u32 table_id)
u32 bier_bp_t
A bit positon as assigned to egress PEs.
BIER Table Add / del route.
void fib_api_path_encode(const fib_route_path_t *rpath, vl_api_fib_path_t *out)
Encode and decode functions from the API types to internal types.
static void vl_api_bier_route_add_del_t_handler(vl_api_bier_route_add_del_t *mp)
u32 fib_path_list_get_n_paths(fib_node_index_t path_list_index)
static void bier_hdr_ntoh(bier_hdr_t *bier_hdr)
fib_route_path_t * rpaths
u16 bbs_len
The length of the string in BYTES.
static void send_bier_route_details(const bier_table_t *bt, const bier_entry_t *be, void *args)
vl_api_bier_table_id_t bt_tbl_id
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 bier_disp_table_unlock_w_table_id(u32 table_id)
#define pool_foreach(VAR, POOL)
Iterate through pool.
@ FIB_API_PATH_NH_PROTO_IP4
bier_imposition : The BIER imposition object
bier_disposition : The BIER disposition object
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void bier_table_walk(const bier_table_id_t *bti, bier_table_walk_fn_t fn, void *ctx)
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...
int bier_table_is_main(const bier_table_t *bt)
#define BIER_ECMP_TABLE_ID_MAIN
Definition of the ID of the BIER main table.
vl_api_registration_t * reg
struct bier_route_details_walk_t_ bier_route_details_walk_t
bier_table_id_t bi_tbl
The BIER table into which to forward the post imposed packet.
vnet_main_t * vnet_get_main(void)
An API client registration, only in vpp/vlib.
static void vl_api_bier_imp_del_t_handler(vl_api_bier_imp_del_t *mp)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
mpls_label_t bt_ll
Save the MPLS local label associated with the table.
static clib_error_t * bier_api_hookup(vlib_main_t *vm)
u32 fib_node_index_t
A typedef of a node index.
#define vec_foreach_index(var, v)
Iterate over vector indices.
void bier_table_route_path_update(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
static api_main_t * vlibapi_get_main(void)
vl_api_bier_table_id_t bt_tbl_id
vl_api_bier_table_id_t bi_tbl_id
static bier_hdr_len_id_t bier_hdr_get_len_id(const bier_hdr_t *bier_hdr)
@ BIER_HDR_PROTO_ETHERNET
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)
void bier_table_route_path_remove(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
@ FIB_ROUTE_PATH_RPF_ID
A local path with a RPF-ID => multicast traffic.
struct bier_disp_entry_details_walk_t_ bier_disp_entry_details_walk_t
vl_api_fib_path_t bde_paths[bde_n_paths]
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static void vl_api_bier_disp_entry_add_del_t_handler(vl_api_bier_disp_entry_add_del_t *mp)
index_t bier_imp_add_or_lock(const bier_table_id_t *bti, bier_bp_t sender, const bier_bit_string_t *bs)
bier_hdr_len_id_t bti_hdr_len
The size of the bit string processed by this table.
static void send_bier_disp_table_details(vl_api_registration_t *reg, u32 context, const bier_disp_table_t *bdt)
bier_hdr_t bi_hdr
The Header to impose.
bier_disp_table_t * bier_disp_table_pool
memory pool for disposition tables
static void vl_api_bier_route_dump_t_handler(vl_api_bier_route_dump_t *mp)
vl_api_bier_route_t br_route
static u8 ip46_address_is_zero(const ip46_address_t *ip46)
vnet_api_error_t api_errno
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)
enum bier_hdr_proto_id_t_ bier_hdr_proto_id_t
BIER header protocol payload types.
API main structure, used by both vpp and binary API clients.
#define vec_free(V)
Free vector's memory (no header).
u8 bi_bits[BIER_HDR_BUCKETS_1024]
The bit string.
@ BIER_HDR_LEN_2048
Bit-string lengths greater than 1024 are not supported due to the limited about pf space available in...
u32 mfib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
void bier_table_route_path_add(const bier_table_id_t *btid, bier_bp_t bp, fib_route_path_t *brps)
static void setup_message_id_table(api_main_t *am)
static void vl_api_bier_imp_dump_t_handler(vl_api_bier_imp_dump_t *mp)
@ FIB_API_PATH_NH_PROTO_IP6
static void vl_api_bier_imp_add_t_handler(vl_api_bier_imp_add_t *mp)
A representation of a path as described by a route producer.
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 *args)
#define vec_foreach(var, vec)
Vector iterator.
void bier_table_unlock(const bier_table_id_t *bti)
bier_table_id_t bt_id
The identity/key or the table.
void bier_table_route_delete(const bier_table_id_t *btid, bier_bp_t bp)
BIER Disposition Entry Add / del.
A protocol Independent IP multicast FIB table.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_bier_disp_table_dump_t_handler(vl_api_bier_disp_table_dump_t *mp)
bier_table_t * bier_table_pool
Memory pool of all the allocated tables.
void bier_disp_table_walk(u32 table_id, bier_disp_table_walk_fn_t fn, void *ctx)
static void send_bier_table_details(vl_api_registration_t *reg, u32 context, const bier_table_t *bt)
vl_api_registration_t * reg
A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mp...
A BIER Table is the bit-indexed forwarding table.
u32 mpls_label_t
A label value only, i.e.
vl_api_bier_route_t br_route
Reply for BIER route add / del request.
u32 bier_hdr_len_id_to_num_bytes(bier_hdr_len_id_t id)
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...
bier_imp_t * bier_imp_pool
bier_imposition : The BIER imposition object
fib_node_index_t be_path_list
the FIB path-list this entry resolves through.
#define MPLS_LABEL_INVALID
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
BIER Disposition Table Add / del route.
int fib_api_path_decode(vl_api_fib_path_t *in, fib_route_path_t *out)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
u32 bdt_table_id
Table ID (hash key) for this FIB.
A Variable length BitString.
static bier_hdr_src_id_t bier_hdr_get_src_id(const bier_hdr_t *bier_hdr)
bier_bp_t be_bp
the bit position this entry represents.
void * vl_msg_api_alloc(int nbytes)