Package org.onosproject.net.packet
Interface PacketContext
-
- All Known Implementing Classes:
DefaultPacketContext
public interface PacketContextRepresents 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 booleanblock()Blocks the outbound packet from being sent from this point onward.InboundPacketinPacket()Returns the inbound packet being processed.booleanisHandled()Indicates whether the outbound packet is handled, i.e.OutboundPacketoutPacket()Returns the view of the outbound packet.voidsend()Triggers the outbound packet to be sent.longtime()Returns the time when the packet was received.TrafficTreatment.BuildertreatmentBuilder()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
-
-