Package org.onosproject.net.packet
Class DefaultInboundPacket
- java.lang.Object
-
- org.onosproject.net.packet.DefaultInboundPacket
-
- All Implemented Interfaces:
InboundPacket
public final class DefaultInboundPacket extends Object implements InboundPacket
Default implementation of an immutable inbound packet.
-
-
Constructor Summary
Constructors Constructor Description DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, ByteBuffer unparsed)
Creates an immutable inbound packet.DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, ByteBuffer unparsed, Optional<Long> cookie)
Creates an immutable inbound packet with cookie.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Long>
cookie()
Returns the cookie in the packet in message.boolean
equals(Object obj)
int
hashCode()
Ethernet
parsed()
Returns the parsed form of the packet.ConnectPoint
receivedFrom()
Returns the device and port from where the packet was received.String
toString()
ByteBuffer
unparsed()
Unparsed packet data.
-
-
-
Constructor Detail
-
DefaultInboundPacket
public DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, ByteBuffer unparsed)
Creates an immutable inbound packet.- Parameters:
receivedFrom
- connection point where receivedparsed
- parsed ethernet frameunparsed
- unparsed raw bytes
-
DefaultInboundPacket
public DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, ByteBuffer unparsed, Optional<Long> cookie)
Creates an immutable inbound packet with cookie.- Parameters:
receivedFrom
- connection point where receivedparsed
- parsed ethernet frameunparsed
- unparsed raw bytescookie
- cookie
-
-
Method Detail
-
receivedFrom
public ConnectPoint receivedFrom()
Description copied from interface:InboundPacket
Returns the device and port from where the packet was received.- Specified by:
receivedFrom
in interfaceInboundPacket
- Returns:
- connection point where received
-
parsed
public Ethernet parsed()
Description copied from interface:InboundPacket
Returns the parsed form of the packet.- Specified by:
parsed
in interfaceInboundPacket
- Returns:
- parsed Ethernet frame; null if the packet is not an Ethernet frame or one for which there is no parser
-
unparsed
public ByteBuffer unparsed()
Description copied from interface:InboundPacket
Unparsed packet data.- Specified by:
unparsed
in interfaceInboundPacket
- Returns:
- raw packet bytes
-
cookie
public Optional<Long> cookie()
Description copied from interface:InboundPacket
Returns the cookie in the packet in message.- Specified by:
cookie
in interfaceInboundPacket
- Returns:
- optional flow cookie
-
-