Package org.onosproject.net.packet
Class DefaultOutboundPacket
- java.lang.Object
-
- org.onosproject.net.packet.DefaultOutboundPacket
-
- All Implemented Interfaces:
OutboundPacket
public final class DefaultOutboundPacket extends java.lang.Object implements OutboundPacket
Default implementation of an immutable outbound packet.
-
-
Constructor Summary
Constructors Constructor Description DefaultOutboundPacket(DeviceId sendThrough, TrafficTreatment treatment, java.nio.ByteBuffer data)Creates an immutable outbound packet.DefaultOutboundPacket(DeviceId sendThrough, TrafficTreatment treatment, java.nio.ByteBuffer data, PortNumber inPort)Creates an immutable outbound packet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBufferdata()Returns immutable view of the raw data to be sent.booleanequals(java.lang.Object obj)inthashCode()PortNumberinPort()Returns the input port of this packet.DeviceIdsendThrough()Returns the identity of a device through which this packet should be sent.java.lang.StringtoString()TrafficTreatmenttreatment()Returns how the outbound packet should be treated.
-
-
-
Constructor Detail
-
DefaultOutboundPacket
public DefaultOutboundPacket(DeviceId sendThrough, TrafficTreatment treatment, java.nio.ByteBuffer data)
Creates an immutable outbound packet.- Parameters:
sendThrough- identifier through which to send the packettreatment- list of packet treatmentsdata- raw packet data
-
DefaultOutboundPacket
public DefaultOutboundPacket(DeviceId sendThrough, TrafficTreatment treatment, java.nio.ByteBuffer data, PortNumber inPort)
Creates an immutable outbound packet.- Parameters:
sendThrough- identifier through which to send the packettreatment- list of packet treatmentsdata- raw packet datainPort- input port to be used for the packet
-
-
Method Detail
-
sendThrough
public DeviceId sendThrough()
Description copied from interface:OutboundPacketReturns the identity of a device through which this packet should be sent.- Specified by:
sendThroughin interfaceOutboundPacket- Returns:
- device identity
-
treatment
public TrafficTreatment treatment()
Description copied from interface:OutboundPacketReturns how the outbound packet should be treated.- Specified by:
treatmentin interfaceOutboundPacket- Returns:
- output treatment
-
data
public java.nio.ByteBuffer data()
Description copied from interface:OutboundPacketReturns immutable view of the raw data to be sent.- Specified by:
datain interfaceOutboundPacket- Returns:
- data to emit
-
inPort
public PortNumber inPort()
Description copied from interface:OutboundPacketReturns the input port of this packet. Defaults to controller port. This is useful for actions that involve the input port such as ALL or FLOOD.- Specified by:
inPortin interfaceOutboundPacket- Returns:
- the input port to be used for this packet.
-
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
-
-