[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

creating socket



Hi

In this

#define TO16(x)    ((((x) >> 8) & 0x00FF) | (((x) << 8) & 0xFF00))

sockid = socket(AF_INET, SOCK_PACKET, TO16(ETH_P_ALL))


what does SOCK_PACKET mean. In went through W.R Stevens, but I am unable to
find SOCK_PACKET type. Similarly I am not able to understand what is
ETH_P_ALL and the necessity of the bit operations on it. Any help will be
appreciated.


Thanks in advance

Devan