blob: 2931c3e28783580e5fba6777481e97ace9fdd7af [file] [log] [blame]
tom613d8142014-09-11 15:09:37 -07001package org.onlab.onos.net.packet;
2
3import org.onlab.onos.net.ConnectPoint;
4import org.onlab.packet.Ethernet;
5
6import java.nio.ByteBuffer;
7
8/**
9 * Represents a data packet intercepted from an infrastructure device.
10 */
11public 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}