37 if (dst_sw_if_index == ~0)
59 return VNET_API_ERROR_UNIMPLEMENTED;
61 if ((src_sw_if_index == ~0) || (dst_sw_if_index == ~0 && state > 0)
62 || (src_sw_if_index == dst_sw_if_index))
63 return VNET_API_ERROR_INVALID_INTERFACE;
87 if (enable_rx || disable_rx)
89 src_sw_if_index, rx, 0, 0);
90 if (enable_tx || disable_tx)
92 src_sw_if_index, tx, 0, 0);
95 if (enable_rx || disable_rx)
97 if (enable_tx || disable_tx)
101 return VNET_API_ERROR_UNIMPLEMENTED;
133 u32 src_sw_if_index = ~0;
134 u32 dst_sw_if_index = ~0;
161 if (rv == VNET_API_ERROR_INVALID_INTERFACE)
168 .path =
"set interface span",
169 .short_help =
"set interface span <if-name> [l2] {disable | destination <if-name> [both|rx|tx]}",
183 static const char *states[] = {
224 states[device], states[l2]);
239 .path =
"show interface span",
240 .short_help =
"Shows SPAN mirror table",
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...)
vhost_vring_state_t state
#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
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.
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)
#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)