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.booleanequals(Object obj)inthashCode()Ethernetparsed()Returns the parsed form of the packet.ConnectPointreceivedFrom()Returns the device and port from where the packet was received.StringtoString()ByteBufferunparsed()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:InboundPacketReturns the device and port from where the packet was received.- Specified by:
receivedFromin interfaceInboundPacket- Returns:
- connection point where received
-
parsed
public Ethernet parsed()
Description copied from interface:InboundPacketReturns the parsed form of the packet.- Specified by:
parsedin 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:InboundPacketUnparsed packet data.- Specified by:
unparsedin interfaceInboundPacket- Returns:
- raw packet bytes
-
cookie
public Optional<Long> cookie()
Description copied from interface:InboundPacketReturns the cookie in the packet in message.- Specified by:
cookiein interfaceInboundPacket- Returns:
- optional flow cookie
-
-