31 #define GBP_EXT_ITF_ID 0x00000080 38 #define GBP_EXT_ITF_DBG(...) \ 39 vlib_log_debug (gx_logger, __VA_ARGS__); 46 return (
format (s,
"%U%s in %U",
71 return (VNET_API_ERROR_NO_SUCH_ENTRY);
78 return (VNET_API_ERROR_NO_SUCH_ENTRY);
103 L2INPUT_FEAT_GBP_LPM_ANON_CLASSIFY |
106 L2OUTPUT_FEAT_GBP_POLICY_LPM);
118 return (VNET_API_ERROR_ENTRY_ALREADY_EXISTS);
128 return (VNET_API_ERROR_INVALID_SW_IF_INDEX);
147 return (VNET_API_ERROR_NO_SUCH_ENTRY);
176 else if (
unformat (line_input,
"anon-l3-out"))
184 if (~0 == sw_if_index)
202 case VNET_API_ERROR_ENTRY_ALREADY_EXISTS:
204 case VNET_API_ERROR_NO_SUCH_ENTRY:
205 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
224 .path =
"gbp ext-itf",
225 .short_help =
"gbp ext-itf [del] <interface> bd <ID> rd <ID> [anon-l3-out]\n",
271 .path =
"show gbp ext-itf",
272 .short_help =
"show gbp ext-itf\n",
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
void gbp_route_domain_unlock(index_t index)
vl_api_wireguard_peer_flags_t flags
vnet_main_t * vnet_get_main(void)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
#define pool_foreach(VAR, POOL)
Iterate through pool.
index_t * gbp_ext_itf_db
external interface configs keyed by sw_if_index
void gbp_itf_l2_set_output_feature(gbp_itf_hdl_t gh, l2output_feat_masks_t feats)
gbp_ext_itf_t * gbp_ext_itf_pool
Pool of GBP ext_itfs.
void gbp_itf_unlock(gbp_itf_hdl_t *gh)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static walk_rc_t gbp_ext_itf_show_one(gbp_ext_itf_t *gx, void *ctx)
static clib_error_t * gbp_ext_itf_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
unformat_function_t unformat_vnet_sw_interface
gbp_itf_hdl_t gx_itf
The interface.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
enum walk_rc_t_ walk_rc_t
Walk return code.
void gbp_bridge_domain_unlock(index_t gbdi)
#define VLIB_INIT_FUNCTION(x)
static clib_error_t * gbp_ext_itf_add_del_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
description fragment has unexpected format
walk_rc_t(* gbp_ext_itf_cb_t)(gbp_ext_itf_t *gbpe, void *ctx)
u32 gx_fib_index[DPO_PROTO_NUM]
cached FIB indices from the RD
#define clib_error_return(e, args...)
index_t gx_bd
The BD this external interface is a member of.
int gbp_ext_itf_delete(u32 sw_if_index)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define pool_put(P, E)
Free an object E in pool P.
An external interface maps directly to an oflex L3ExternalInterface.
void gbp_itf_hdl_reset(gbp_itf_hdl_t *gh)
static clib_error_t * gbp_ext_itf_init(vlib_main_t *vm)
vlib_log_class_t gx_logger
logger
gbp_itf_hdl_t gbp_itf_l2_add_and_lock(u32 sw_if_index, index_t gbi)
u8 * format_gbp_bridge_domain(u8 *s, va_list *args)
u32 grd_fib_index[FIB_PROTOCOL_IP_MAX]
index_t gx_rd
The RD this external interface is a member of.
index_t gbp_bridge_domain_find_and_lock(u32 bd_id)
#define VLIB_CLI_COMMAND(x,...)
gbp_route_domain_t * gbp_route_domain_get(index_t i)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u8 * format_gbp_itf_hdl(u8 *s, va_list *args)
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
#define GBP_EXT_ITF_DBG(...)
void gbp_itf_l2_set_input_feature(gbp_itf_hdl_t gh, l2input_feat_masks_t feats)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
A route Domain Representation.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
u32 gx_flags
The associated flags.
void gbp_ext_itf_walk(gbp_ext_itf_cb_t cb, void *ctx)
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
u8 * format_gbp_ext_itf(u8 *s, va_list *args)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
int gbp_ext_itf_add(u32 sw_if_index, u32 bd_id, u32 rd_id, u32 flags)
vl_api_interface_index_t sw_if_index
index_t gbp_route_domain_find_and_lock(u32 rd_id)