Package org.onosproject.net.packet
Class DefaultInboundPacket
- java.lang.Object
-
- org.onosproject.net.packet.DefaultInboundPacket
-
- All Implemented Interfaces:
InboundPacket
public final class DefaultInboundPacket extends java.lang.Object implements InboundPacket
Default implementation of an immutable inbound packet.
-
-
Constructor Summary
Constructors Constructor Description DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, java.nio.ByteBuffer unparsed)Creates an immutable inbound packet.DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, java.nio.ByteBuffer unparsed, java.util.Optional<java.lang.Long> cookie)Creates an immutable inbound packet with cookie.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.Long>cookie()Returns the cookie in the packet in message.booleanequals(java.lang.Object obj)inthashCode()Ethernetparsed()Returns the parsed form of the packet.ConnectPointreceivedFrom()Returns the device and port from where the packet was received.java.lang.StringtoString()java.nio.ByteBufferunparsed()Unparsed packet data.
-
-
-
Constructor Detail
-
DefaultInboundPacket
public DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, java.nio.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, java.nio.ByteBuffer unparsed, java.util.Optional<java.lang.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 java.nio.ByteBuffer unparsed()
Description copied from interface:InboundPacketUnparsed packet data.- Specified by:
unparsedin interfaceInboundPacket- Returns:
- raw packet bytes
-
cookie
public java.util.Optional<java.lang.Long> cookie()
Description copied from interface:InboundPacketReturns the cookie in the packet in message.- Specified by:
cookiein interfaceInboundPacket- Returns:
- optional flow cookie
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-