IPStackProtocol

public protocol IPStackProtocol: class

The protocol defines an IP stack.

  • Input a packet into the stack.

    Declaration

    Swift

    func input(packet: Data, version: NSNumber?) -> Bool

    Parameters

    packet

    The IP packet.

    version

    The version of the IP packet, i.e., AF_INET, AF_INET6.

    Return Value

    If the stack takes in this packet. If the packet is taken in, then it won’t be processed by other IP stacks.

  • This is called when this stack decided to output some IP packet. This is set automatically when the stack is registered to some interface.

    The parameter is the safe as the inputPacket.

    Note

    This block is thread-safe.

    Declaration

    Swift

    var outputFunc: (([Data], [NSNumber]) -> Void)!
  • Undocumented

    Declaration

    Swift

    public protocol IPStackProtocol: class
  • stop() Default implementation

    Stop the stack from running.

    This is called when the interface this stack is registered to stop to processing packets and will be released soon.

    Default Implementation

    Declaration

    Swift

    func stop()