ONOS-6605 PI flow rule translator implementation
Change-Id: Icac66f17677c494152207f4b52355ad647e1227b
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 443c15b..8d06100 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
@@ -18,15 +18,17 @@
import com.google.common.annotations.Beta;
import org.onosproject.net.driver.HandlerBehaviour;
+import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.flow.criteria.Criterion;
import org.onosproject.net.pi.runtime.PiHeaderFieldId;
import org.onosproject.net.pi.runtime.PiTableAction;
+import org.onosproject.net.pi.runtime.PiTableId;
import java.util.Optional;
/**
- * An interpreter of a protocol-independent pipeline.
+ * An interpreter of a protocol-independent pipeline model.
*/
@Beta
public interface PiPipelineInterpreter extends HandlerBehaviour {
@@ -52,6 +54,16 @@
Optional<Criterion.Type> mapPiHeaderFieldId(PiHeaderFieldId headerFieldId);
/**
+ * Returns a protocol-independent table id equivalent to the given numeric table id (as in
+ * {@link FlowRule#tableId()}). If not present, it means that the given numeric table id cannot
+ * be mapped to any table of the pipeline model.
+ *
+ * @param flowRuleTableId a numeric table id
+ * @return a protocol-independent table id
+ */
+ Optional<PiTableId> mapFlowRuleTableId(int flowRuleTableId);
+
+ /**
* Returns a table action of a protocol-independent pipeline that is functionally equivalent to
* the given ONOS traffic treatment for the given pipeline configuration.
*
@@ -72,4 +84,4 @@
super(message);
}
}
-}
+}
\ No newline at end of file