|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
22 #define foreach_gbp_itf_mode \
28 #define _(s,v) GBP_ITF_MODE_##s,
85 #define _(s,v,a) [GBP_ITF_L3_FEAT_POS_##s] = a,
91 #define _(s,v,a) [GBP_ITF_L3_FEAT_POS_##s] = v,
102 if (flags & GBP_ITF_L3_FEAT_##a) \
103 s = format (s, "%s ", b);
301 if (GBP_ITF_MODE_L2 == gi->
gi_mode)
330 memset (gi, 0,
sizeof (*gi));
339 u32 diff_fb, new_fb, *fb, feat;
344 if (NULL == gi || GBP_ITF_MODE_L3 != gi->
gi_mode)
386 u32 diff_fb, new_fb, *fb, feat;
391 if (NULL == gi || GBP_ITF_MODE_L2 != gi->
gi_mode)
432 u32 diff_fb, new_fb, *fb, feat;
437 if (NULL == gi || GBP_ITF_MODE_L2 != gi->
gi_mode)
483 case GBP_ITF_MODE_##a: \
484 return format(s, "%s", v);
498 return (
format (s,
"unset"));
502 s =
format (s,
"%U locks:%d mode:%U ",
507 if (GBP_ITF_MODE_L2 == gi->
gi_mode)
508 s =
format (s,
"gbp-bd:%d input-feats:[%U] output-feats:[%U]",
513 s =
format (s,
"gbp-rd:%d input-feats:[%U] output-feats:[%U]",
530 return format (s,
"INVALID");
562 .path =
"show gbp interface",
563 .short_help =
"show gbp interface\n",
static gbp_itf_hdl_t gbp_itf_l2_add_and_lock_i(u32 sw_if_index, index_t gbi, gbp_itf_free_fn_t ff)
void gbp_itf_l2_set_input_feature(gbp_itf_hdl_t gh, l2input_feat_masks_t feats)
enum gbp_ift_mode_t_ gbp_itf_mode_t
static u8 * format_gbp_itf_mode(u8 *s, va_list *args)
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
u32 gi_sw_if_index
The interface this wrapper is managing.
u8 * format_gbp_itf_l3_feat(u8 *s, va_list *args)
void ip4_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
void gbp_bridge_domain_itf_del(index_t gbdi, u32 sw_if_index, l2_bd_port_type_t type)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u8 * format_l2_output_features(u8 *s, va_list *args)
vl_api_tunnel_mode_t mode
A route Domain Representation.
static gbp_itf_t * gbp_itf_find_hdl(gbp_itf_hdl_t gh)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
gbp_itf_hdl_t gbp_itf_l2_add_and_lock_w_free(u32 sw_if_index, index_t gbi, gbp_itf_free_fn_t ff)
gbp_itf_hdl_t gbp_itf_l3_add_and_lock(u32 sw_if_index, index_t gri)
u32 grd_table_id[FIB_PROTOCOL_IP_MAX]
static gbp_itf_t * gbp_itf_pool
void gbp_itf_l2_set_output_feature(gbp_itf_hdl_t gh, l2output_feat_masks_t feats)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define hash_set(h, key, value)
u32 gi_locks
Number of references to this interface.
u32 gi_gbi
GBP BD or RD index.
void gbp_itf_hdl_reset(gbp_itf_hdl_t *gh)
static const char * gbp_itf_feat_bit_pos_to_arc[]
bool gbp_itf_hdl_is_valid(gbp_itf_hdl_t gh)
vnet_main_t * vnet_get_main(void)
gbp_itf_mode_t gi_mode
The mode of the interface.
enum gbp_itf_l3_feat_t_ gbp_itf_l3_feat_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
u32 gbp_itf_get_sw_if_index(gbp_itf_hdl_t hdl)
void gbp_itf_lock(gbp_itf_hdl_t gh)
u8 * format_gbp_itf_hdl(u8 *s, va_list *args)
#define foreach_set_bit(var, mask, body)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
#define foreach_gbp_itf_mode
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
void gbp_bridge_domain_itf_add(index_t gbdi, u32 sw_if_index, l2_bd_port_type_t type)
static uword * gbp_itf_db
const static gbp_itf_hdl_t GBP_ITF_HDL_INVALID
void gbp_itf_l3_set_input_feature(gbp_itf_hdl_t gh, gbp_itf_l3_feat_t feats)
#define vec_free(V)
Free vector's memory (no header).
static gbp_itf_t * gbp_itf_get(index_t gii)
#define pool_foreach_index(i, v)
void l2output_intf_bitmap_enable(u32 sw_if_index, l2output_feat_masks_t feature_bitmap, u32 enable)
Enable (or disable) the feature in the bitmap for the given interface.
format_function_t format_vnet_sw_if_index_name
description fragment has unexpected format
int ip_table_bind(fib_protocol_t fproto, u32 sw_if_index, u32 table_id, u8 is_api)
gbp_itf_hdl_t gbp_itf_l3_add_and_lock_w_free(u32 sw_if_index, index_t gri, gbp_itf_free_fn_t ff)
#define vec_foreach(var, vec)
Vector iterator.
gbp_itf_hdl_t gbp_itf_l2_add_and_lock(u32 sw_if_index, index_t gbi)
void ip6_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
gbp_route_domain_t * gbp_route_domain_get(index_t i)
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
#define hash_unset(h, key)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
static gbp_itf_t * gbp_itf_find(u32 sw_if_index)
#define pool_free(p)
Free a pool.
static const char * gbp_itf_feat_bit_pos_to_feat[]
static clib_error_t * gbp_itf_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static gbp_itf_hdl_t gbp_itf_mk_hdl(gbp_itf_t *gi)
Attributes and configurations attached to interfaces by GBP.
u32 * gi_users
Users of this interface - this is encoded in the user's handle.
u32 * gi_input_fbs
L2/L3 Features configured by each user.
void(* gbp_itf_free_fn_t)(u32 sw_if_index)
struct gbp_itf_t_ gbp_itf_t
Attributes and configurations attached to interfaces by GBP.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
gbp_itf_hdl_t gbp_itf_l3_add_and_lock_i(u32 sw_if_index, index_t gri, gbp_itf_free_fn_t ff)
vl_api_interface_index_t sw_if_index
gbp_itf_free_fn_t gi_free_fn
function to call when the interface is deleted.
static u8 * format_gbp_itf(u8 *s, va_list *args)
gbp_itf_hdl_t gbp_itf_clone_and_lock(gbp_itf_hdl_t gh)
void gbp_itf_unlock(gbp_itf_hdl_t *gh)
static vlib_cli_command_t gbp_contract_show_node
(constructor) VLIB_CLI_COMMAND (gbp_contract_show_node)
vl_api_wireguard_peer_flags_t flags