Package org.onosproject.net.packet
Interface PacketContext
-
- All Known Implementing Classes:
DefaultPacketContext
public interface PacketContext
Represents context for processing an inbound packet, and (optionally) emitting a corresponding outbound packet.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
block()
Blocks the outbound packet from being sent from this point onward.InboundPacket
inPacket()
Returns the inbound packet being processed.boolean
isHandled()
Indicates whether the outbound packet is handled, i.e.OutboundPacket
outPacket()
Returns the view of the outbound packet.void
send()
Triggers the outbound packet to be sent.long
time()
Returns the time when the packet was received.TrafficTreatment.Builder
treatmentBuilder()
Returns a builder for constructing traffic treatment.
-
-
-
Method Detail
-
time
long time()
Returns the time when the packet was received.- Returns:
- the time in millis since start of epoch
-
inPacket
InboundPacket inPacket()
Returns the inbound packet being processed.- Returns:
- inbound packet
-
outPacket
OutboundPacket outPacket()
Returns the view of the outbound packet.- Returns:
- outbound packet
-
treatmentBuilder
TrafficTreatment.Builder treatmentBuilder()
Returns a builder for constructing traffic treatment.- Returns:
- traffic treatment builder
-
send
void send()
Triggers the outbound packet to be sent.
-
block
boolean block()
Blocks the outbound packet from being sent from this point onward.- Returns:
- whether the outbound packet is blocked.
-
isHandled
boolean isHandled()
Indicates whether the outbound packet is handled, i.e. sent or blocked.- Returns:
- true uf the packed is handled
-
-