- si->num_rx_mirror_ports = new_num_rx_mirror_ports;
- si->num_tx_mirror_ports = new_num_tx_mirror_ports;
+ switch (sf)
+ {
+ case SPAN_FEAT_DEVICE:
+ if (enable_rx || disable_rx)
+ vnet_feature_enable_disable ("device-input", "span-input",
+ src_sw_if_index, rx, 0, 0);
+ if (enable_tx || disable_tx)
+ vnet_feature_enable_disable ("interface-output", "span-output",
+ src_sw_if_index, tx, 0, 0);
+ break;
+ case SPAN_FEAT_L2:
+ if (enable_rx || disable_rx)
+ l2input_intf_bitmap_enable (src_sw_if_index, L2INPUT_FEAT_SPAN, rx);
+ if (enable_tx || disable_tx)
+ l2output_intf_bitmap_enable (src_sw_if_index, L2OUTPUT_FEAT_SPAN, tx);
+ break;
+ default:
+ return VNET_API_ERROR_UNIMPLEMENTED;
+ }