首先查看一下源代码
shell#>vim /usr/include/bits/socket.h
line 62 /* Protocol families. /
line 83 #define PF_PACKET 17 / Packet family. */
line 94 /* Address families. */
line115 #define AF_PACKET PF_PACKET
看来数值上是相等的,都是 0x0011。不同之处是,一个代表协议族,一个代表地址族。
原文链接:https://blog.csdn.net/Zuocheng_Liu/article/details/7382125