I was recently trying to write my own TCP stack to solidify my networking knowledge, similar to Julia Evans's efforts [1]. I got frustrated working with raw sockets on my mac, because they don't provide the same level of control as raw sockets on linux [2]. Is pcap a better level of abstraction that is cross-platform? I don't really care about windows, but it would be nice to work on linux and osx.
[1] http://jvns.ca/blog/2014/08/12/what-happens-if-you-write-a-t...
[2] http://stackoverflow.com/questions/6878603/strange-raw-socke...