Contents

NEFilterPacketHandler

A type for Swift closures or ObjectiveC blocks that make filtering decisions about network packets.

Declaration

typealias NEFilterPacketHandler = (NEFilterPacketContext, nw_interface_t, NETrafficDirection, UnsafeRawPointer, Int) -> NEFilterPacketProvider.Verdict

Parameters

  • context:

    The current filtering context.

  • interface:

    The ingress or egress interface of the packet.

  • direction:

    The direction the packet is flowing.

  • packetBytes:

    The packet’s bytes.

  • packetLength:

    The length of the packet’s bytes.

Return Value

A verdict on whether the framework should allow, drop, or delay the packet. If the verdict is NEFilterPacketProvider.Verdict.delay, the framework assumes the handler already called delayCurrentPacket(_:).

See Also

Filtering packets