Instance Method

writePackets(_:withProtocols:)

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software