SOCK_TYPE 和 ETH_P_IP

 两处都有sock_type的定义,

http://lxr.linux.no/linux-bk+v2.6.11.5/include/asm-mips/socket.h#L90

http://lxr.linux.no/linux-bk+v2.6.11.5/include/linux/net.h#L83

  80enum sock_type {
  81        SOCK_STREAM     = 1,
  82        SOCK_DGRAM      = 2,
  83        SOCK_RAW        = 3,
  84        SOCK_RDM        = 4,
  85        SOCK_SEQPACKET  = 5,
  86        SOCK_PACKET     = 10,
  87};

 

上面是我昨天查到的,不知道怎么查到了2.6.11版本的, 今天查到最新版2.6.31的类型变成7个了:

 http://lxr.linux.no/linux+v2.6.31/include/linux/net.h#L91

  88enum sock_type {
89 SOCK_STREAM = 1,
90 SOCK_DGRAM = 2,
91 SOCK_RAW = 3,
92 SOCK_RDM = 4,
93 SOCK_SEQPACKET = 5,
94 SOCK_DCCP = 6,
95 SOCK_PACKET = 10,
96};

 


ETH_P_IP 的定义:

http://lxr.linux.no/#linux+v2.6.31/include/linux/if_ether.h#L45

 

  38/*
39 * These are the defined Ethernet Protocol ID's.
40 */
41
42#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
43#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
44#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
45#define ETH_P_IP 0x0800 /* Internet Protocol packet */
46#define ETH_P_X25 0x0805 /* CCITT X.25 */
47#define ETH_P_ARP 0x0806 /* Address Resolution packet */


 

你可能感兴趣的:(type)