Implement support for packetIn through p4Runtime

Change-Id: I92cc1a2bd7edde8916aad61c20d7411f93368612
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 394b787..a85d80c 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
@@ -17,9 +17,11 @@
 package org.onosproject.net.pi.model;
 
 import com.google.common.annotations.Beta;
+import org.onosproject.net.DeviceId;
 import org.onosproject.net.driver.HandlerBehaviour;
 import org.onosproject.net.flow.TrafficTreatment;
 import org.onosproject.net.flow.criteria.Criterion;
+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.PiHeaderFieldId;
@@ -86,6 +88,17 @@
             throws PiInterpreterException;
 
     /**
+     * Returns a InboundPacket equivalent to the given packet operation.
+     *
+     * @param deviceId          the device that originated the packet-in
+     * @param packetInOperation the packet operation
+     * @return an ONOS inbound packet
+     * @throws PiInterpreterException if the port can't be extracted from the packet metadata
+     */
+    InboundPacket mapInboundPacket(DeviceId deviceId, PiPacketOperation packetInOperation)
+            throws PiInterpreterException;
+
+    /**
      * Signals that an error was encountered while executing the interpreter.
      */
     @Beta
diff --git a/core/net/src/test/java/org/onosproject/net/pi/impl/MockInterpreter.java b/core/net/src/test/java/org/onosproject/net/pi/impl/MockInterpreter.java
index 04535aa..f13c1d9 100644
--- a/core/net/src/test/java/org/onosproject/net/pi/impl/MockInterpreter.java
+++ b/core/net/src/test/java/org/onosproject/net/pi/impl/MockInterpreter.java
@@ -19,11 +19,13 @@
 import com.google.common.collect.ImmutableBiMap;
 import com.google.common.collect.ImmutableList;
 import org.onlab.util.ImmutableByteSequence;
+import org.onosproject.net.DeviceId;
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.driver.AbstractHandlerBehaviour;
 import org.onosproject.net.flow.TrafficTreatment;
 import org.onosproject.net.flow.criteria.Criterion;
 import org.onosproject.net.flow.instructions.Instruction;
+import org.onosproject.net.packet.InboundPacket;
 import org.onosproject.net.packet.OutboundPacket;
 import org.onosproject.net.pi.model.PiPipelineInterpreter;
 import org.onosproject.net.pi.runtime.PiAction;
@@ -106,6 +108,12 @@
         return ImmutableList.of();
     }
 
+    @Override
+    public InboundPacket mapInboundPacket(DeviceId deviceId, PiPacketOperation packetInOperation)
+            throws PiInterpreterException {
+        return null;
+    }
+
     /**
      * Returns an action instance with no runtime parameters.
      */