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.ByteBuffer
data()
Returns immutable view of the raw data to be sent.boolean
equals(java.lang.Object obj)
int
hashCode()
PortNumber
inPort()
Returns the input port of this packet.DeviceId
sendThrough()
Returns the identity of a device through which this packet should be sent.java.lang.String
toString()
TrafficTreatment
treatment()
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:OutboundPacket
Returns the identity of a device through which this packet should be sent.- Specified by:
sendThrough
in interfaceOutboundPacket
- Returns:
- device identity
-
treatment
public TrafficTreatment treatment()
Description copied from interface:OutboundPacket
Returns how the outbound packet should be treated.- Specified by:
treatment
in interfaceOutboundPacket
- Returns:
- output treatment
-
data
public java.nio.ByteBuffer data()
Description copied from interface:OutboundPacket
Returns immutable view of the raw data to be sent.- Specified by:
data
in interfaceOutboundPacket
- Returns:
- data to emit
-
inPort
public PortNumber inPort()
Description copied from interface:OutboundPacket
Returns 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:
inPort
in interfaceOutboundPacket
- Returns:
- the input port to be used for this packet.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-