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 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