- def set_span_mirroring(node, src_if, dst_if):
- """Set Span mirroring on the specified node.
+ def vpp_get_span_configuration(node, is_l2=False):
+ """Get full SPAN configuration from VPP node.
+
+ Used by Honeycomb.
+
+ :param node: DUT node.
+ :type node: dict
+
+ :returns: Full SPAN configuration as list. One list entry for every
+ source/destination interface pair.
+ :rtype: list of dict
+ """
+ args = dict(
+ is_l2=1 if is_l2 else 0
+ )
+ with PapiExecutor(node) as papi_exec:
+ dump = papi_exec.add("sw_interface_span_dump", **args). \
+ get_dump().reply[0]["api_reply"]
+
+ return dump
+
+ @staticmethod
+ def vpp_get_span_configuration_by_interface(node, dst_interface,
+ ret_format="sw_if_index"):
+ """Get a list of all interfaces currently being mirrored
+ to the specified interface.
+
+ Used by Honeycomb.