AF_PACKET equivalent under Mac OS X (Darwin)
Asked Answered
B

1

12

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?

Buttermilk answered 2/9, 2011 at 14:22 Comment(1)
RelatedJohnathon
Y
9

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

Yeorgi answered 19/10, 2011 at 8:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.