I am trying to compile a C program on Mac OS X that uses AF_PACKET sockets and libpcap, what is the equivalent in OS X?
AF_PACKET equivalent under Mac OS X (Darwin)
The closest equivalent to AF_PACKET sockets in Mac OS X (and in other BSD-flavored OSes, such as FreeBSD, NetBSD, OpenBSD, Dragonfly BSD, and so on) is BPF, but it doesn't work very much like AF_PACKET sockets; see "man bpf".
The exact equivalent to libpcap in Mac OS X (and in other BSD-flavored UN*Xes) is, well, libpcap. (libpcap is also the exact equivalent to libpcap in many other UN*Xes, but it doesn't ship as a standard part of all of those UN*Xes, whereas it does ship as a standard part of Mac OS X and the other BSD-flavored UN*Xes.)
© 2022 - 2024 — McMap. All rights reserved.