ONOS-7001 Support for direct counters
Currently Bmv2 returns UNKNOWN error when reading direct counters.
Change-Id: I834d7b5a8627181c6888500545e1bdbfe9af8dc1
diff --git a/core/api/src/main/java/org/onosproject/net/pi/model/PiPipelineInterpreter.java b/core/api/src/main/java/org/onosproject/net/pi/model/PiPipelineInterpreter.java
index 6b93f5d..738996f 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/model/PiPipelineInterpreter.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/model/PiPipelineInterpreter.java
@@ -24,6 +24,7 @@
import org.onosproject.net.packet.InboundPacket;
import org.onosproject.net.packet.OutboundPacket;
import org.onosproject.net.pi.runtime.PiAction;
+import org.onosproject.net.pi.runtime.PiCounterId;
import org.onosproject.net.pi.runtime.PiHeaderFieldId;
import org.onosproject.net.pi.runtime.PiPacketOperation;
import org.onosproject.net.pi.runtime.PiTableId;
@@ -88,6 +89,15 @@
throws PiInterpreterException;
/**
+ * Returns a protocol-independent direct counter identifier for the given table, if present. If not present, it
+ * means that the given table does not support direct counters.
+ *
+ * @param piTableId table identifier
+ * @return optional direct counter identifier
+ */
+ Optional<PiCounterId> mapTableCounter(PiTableId piTableId);
+
+ /**
* Returns a collection of packet operations equivalent to the given OutboundPacket.
*
* @param packet a ONOS outbound packet