PF_PACKET和AF_PACKET的不同

首先查看一下源代码
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。不同之处是,一个代表协议族,一个代表地址族。

你可能感兴趣的:(c)