Contents

writePackets(_:withProtocols:)

Writes IP packets to the TUN interface.

Declaration

func writePackets(_ packets: [Data], withProtocols protocols: [NSNumber]) -> Bool

Parameters

  • packets:

    An array of NSData objects containing the IP packets to the written.

  • protocols:

    An array of NSNumber objects containing the protocol numbers (e.g. AF_INET or AF_INET6) of the IP packets in packets in host byte order.

Discussion

The number of NSData objects in packets must be exactly equal to the number of NSNumber objects in protocols.

See Also

Handling IP packets