OutboundPacket: add inPort method

Allows to provide a different input port to be considered when emitting
the packet. It is useful on OpenFlow devices so one can use ALL or FLOOD
actions as output and not have the packet sent back on the input port.

Default is controller port, as it was before.

The required changes were also implemented in OpenFlowPacketProvider

Change-Id: I0a050b983b5de9935254599e8093dc59ad7a4ccf
diff --git a/core/api/src/main/java/org/onosproject/net/packet/OutboundPacket.java b/core/api/src/main/java/org/onosproject/net/packet/OutboundPacket.java
index 93d754b..30b32fe 100644
--- a/core/api/src/main/java/org/onosproject/net/packet/OutboundPacket.java
+++ b/core/api/src/main/java/org/onosproject/net/packet/OutboundPacket.java
@@ -16,6 +16,7 @@
 package org.onosproject.net.packet;
 
 import org.onosproject.net.DeviceId;
+import org.onosproject.net.PortNumber;
 import org.onosproject.net.flow.TrafficTreatment;
 
 import java.nio.ByteBuffer;
@@ -48,4 +49,15 @@
      */
     ByteBuffer data();
 
+    /**
+     * Returns the input port of this packet.
+     *
+     * Defaults to controller port. This is useful for actions that involve the input port
+     * such as ALL or FLOOD.
+     *
+     * @return the input port to be used for this packet.
+     */
+    default PortNumber inPort() {
+        return PortNumber.CONTROLLER;
+    }
 }