tom | 613d814 | 2014-09-11 15:09:37 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.packet; |
| 2 | |
| 3 | import org.onlab.onos.net.ConnectPoint; |
| 4 | import org.onlab.packet.Ethernet; |
| 5 | |
| 6 | import java.nio.ByteBuffer; |
| 7 | |
| 8 | /** |
| 9 | * Represents a data packet intercepted from an infrastructure device. |
| 10 | */ |
| 11 | public interface InboundPacket { |
| 12 | |
| 13 | /** |
| 14 | * Returns the device and port from where the packet was received. |
| 15 | * |
| 16 | * @return connection point where received |
| 17 | */ |
| 18 | ConnectPoint receivedFrom(); |
| 19 | |
| 20 | /** |
| 21 | * Returns the parsed form of the packet. |
| 22 | * |
| 23 | * @return parsed Ethernet frame; null if the packet is not an Ethernet |
| 24 | * frame or one for which there is no parser |
| 25 | */ |
| 26 | Ethernet parsed(); |
| 27 | |
| 28 | /** |
| 29 | * Unparsed packet data. |
| 30 | * |
| 31 | * @return raw packet bytes |
| 32 | */ |
| 33 | ByteBuffer unparsed(); |
| 34 | |
| 35 | } |