35 if (dst_sw_if_index == ~0)
57 return VNET_API_ERROR_UNIMPLEMENTED;
59 if ((src_sw_if_index == ~0) || (dst_sw_if_index == ~0 && state > 0)
60 || (src_sw_if_index == dst_sw_if_index))
61 return VNET_API_ERROR_INVALID_INTERFACE;
85 if (enable_rx || disable_rx)
87 src_sw_if_index, rx, 0, 0);
88 if (enable_tx || disable_tx)
90 src_sw_if_index, tx, 0, 0);
93 if (enable_rx || disable_rx)
95 if (enable_tx || disable_tx)
99 return VNET_API_ERROR_UNIMPLEMENTED;
131 u32 src_sw_if_index = ~0;
132 u32 dst_sw_if_index = ~0;
159 if (rv == VNET_API_ERROR_INVALID_INTERFACE)
166 .path =
"set interface span",
167 .short_help =
"set interface span <if-name> [l2] {disable | destination <if-name> [both|rx|tx]}",
181 static const char *states[] = {
222 states[device], states[l2]);
237 .path =
"show interface span",
238 .short_help =
"Shows SPAN mirror table",
sll srl srl sll sra u16x4 i
span_mirror_t mirror_rxtx[SPAN_FEAT_N][VLIB_N_RX_TX]
static heap_elt_t * last(heap_header_t *h)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
unformat_function_t unformat_vnet_sw_interface
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
format_function_t format_vnet_sw_if_index_name
#define clib_bitmap_zero(v)
Clear a bitmap.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
clib_bitmap_t * mirror_ports
#define static_always_inline
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define clib_error_return(e, args...)
void l2output_intf_bitmap_enable(u32 sw_if_index, u32 feature_bitmap, u32 enable)
Enable (or disable) the feature in the bitmap for the given interface.
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
static uword unformat_span_state(unformat_input_t *input, va_list *args)
span_interface_t * interfaces
int span_add_delete_entry(vlib_main_t *vm, u32 src_sw_if_index, u32 dst_sw_if_index, u8 state, span_feat_t sf)
#define vec_free(V)
Free vector's memory (no header).
static clib_error_t * set_interface_span_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static uword * clib_bitmap_dup_or(uword *ai, uword *bi)
Logical operator across two bitmaps which duplicates the first bitmap.
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
#define VLIB_CLI_COMMAND(x,...)
static_always_inline u32 span_dst_set(span_mirror_t *sm, u32 dst_sw_if_index, int enable)
vhost_vring_state_t state
#define clib_bitmap_free(v)
Free a bitmap.
static uword clib_bitmap_count_set_bits(uword *ai)
Return the number of set bits in a bitmap.
static clib_error_t * show_interfaces_span_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_foreach(var, vec)
Vector iterator.
#define CLIB_CACHE_LINE_BYTES
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
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)