If you delay the packet then you’ll get back an
NEPacket
object. That has a
metadata
property and you may be able to get info from that (I’ve never actually tried this myself).
However, you have to be careful here. A filter packet provider is extremely performance sensitive, so it’s unwise to delay every packet. You’ll need some mechanism to ensure that most packets go via the fast path (that is, your
NEFilterPacketHandler
returning
.allow
or
.drop
). For example:
You might choose to only delay packets that meet specific criteria.
You might maintain a flow cache, and only delay the first packet, or first few packets, of any given flow.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
ps DTS is closed 21 Dec through 1 Jan.