28 u32 new_num_rx_mirror_ports, new_num_tx_mirror_ports;
31 return VNET_API_ERROR_UNIMPLEMENTED;
33 if ((src_sw_if_index == ~0) || (dst_sw_if_index == ~0 && state > 0)
34 || (src_sw_if_index == dst_sw_if_index))
35 return VNET_API_ERROR_INVALID_INTERFACE;
41 return VNET_API_ERROR_UNIMPLEMENTED;
57 src_sw_if_index, 1, 0, 0);
61 src_sw_if_index, 0, 0, 0);
65 src_sw_if_index, 1, 0, 0);
69 src_sw_if_index, 0, 0, 0);
86 u32 src_sw_if_index = ~0;
87 u32 dst_sw_if_index = ~0;
98 else if (
unformat (input,
"disable"))
112 if (rv == VNET_API_ERROR_INVALID_INTERFACE)
119 .path =
"set interface span",
120 .short_help =
"set interface span <if-name> [disable | destination <if-name> [both|rx|tx]]",
134 char *states[] = {
"none",
"rx",
"tx",
"both" };
147 "Mirror interface (direction)");
172 .path =
"show interfaces span",
173 .short_help =
"Shows SPAN mirror table",
sll srl srl sll sra u16x4 i
int span_add_delete_entry(vlib_main_t *vm, u32 src_sw_if_index, u32 dst_sw_if_index, u8 state)
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. ...
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
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 vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
vnet_main_t * vnet_get_main(void)
#define VLIB_INIT_FUNCTION(x)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
span_interface_t * interfaces
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
clib_bitmap_t * tx_mirror_ports
#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 clib_error_t * span_init(vlib_main_t *vm)
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.
clib_bitmap_t * rx_mirror_ports
vnet_sw_interface_type_t type
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_error_return(e, args...)
#define CLIB_CACHE_LINE_BYTES
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)