在Mac OS X(Darwin)下相当于AF_PACKET [英] AF_PACKET equivalent under Mac OS X (Darwin)

查看:132
本文介绍了在Mac OS X(Darwin)下相当于AF_PACKET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在使用AF_PACKET套接字和libpcap的Mac OS X上编译C程序,在OS X中等效吗?

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?

推荐答案

与Mac OS X(以及其他带有BSD的OS,例如FreeBSD,NetBSD,OpenBSD,Dragonfly BSD等)中的AF_PACKET套接字最接近. )是BPF,但与AF_PACKET套接字不太一样;参见"man bpf".

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

在Mac OS X(和其他BSD风格的UN * Xes)中,与libpcap完全相同的是libpcap. (libpcap在许多其他UN * Xes中也完全等同于libpcap,但它并不是所有这些UN * Xes的标准部分,而它确实却是所有UN * Xes的标准部分. Mac OS X和其他带有BSD风格的UN * X.)

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

这篇关于在Mac OS X(Darwin)下相当于AF_PACKET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆