ethertype.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /*
  2. * Copyright (c) 1993, 1994, 1996
  3. * The Regents of the University of California. All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that: (1) source code distributions
  7. * retain the above copyright notice and this paragraph in its entirety, (2)
  8. * distributions including binary code include the above copyright notice and
  9. * this paragraph in its entirety in the documentation or other materials
  10. * provided with the distribution, and (3) all advertising materials mentioning
  11. * features or use of this software display the following acknowledgement:
  12. * ``This product includes software developed by the University of California,
  13. * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
  14. * the University nor the names of its contributors may be used to endorse
  15. * or promote products derived from this software without specific prior
  16. * written permission.
  17. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  18. * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  19. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  20. */
  21. /*
  22. * Ethernet types.
  23. *
  24. * We wrap the declarations with #ifdef, so that if a file includes
  25. * <netinet/if_ether.h>, which may declare some of these, we don't
  26. * get a bunch of complaints from the C compiler about redefinitions
  27. * of these values.
  28. *
  29. * We declare all of them here so that no file has to include
  30. * <netinet/if_ether.h> if all it needs are ETHERTYPE_ values.
  31. */
  32. #ifndef ETHERTYPE_LEN
  33. #define ETHERTYPE_LEN 2
  34. #endif
  35. #ifndef ETHERTYPE_GRE_ISO
  36. #define ETHERTYPE_GRE_ISO 0x00FE /* not really an ethertype only used in GRE */
  37. #endif
  38. #ifndef ETHERTYPE_PUP
  39. #define ETHERTYPE_PUP 0x0200 /* PUP protocol */
  40. #endif
  41. #ifndef ETHERTYPE_IP
  42. #define ETHERTYPE_IP 0x0800 /* IP protocol */
  43. #endif
  44. #ifndef ETHERTYPE_ARP
  45. #define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
  46. #endif
  47. #ifndef ETHERTYPE_REVARP
  48. #define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */
  49. #endif
  50. #ifndef ETHERTYPE_NS
  51. #define ETHERTYPE_NS 0x0600
  52. #endif
  53. #ifndef ETHERTYPE_SPRITE
  54. #define ETHERTYPE_SPRITE 0x0500
  55. #endif
  56. #ifndef ETHERTYPE_TRAIL
  57. #define ETHERTYPE_TRAIL 0x1000
  58. #endif
  59. #ifndef ETHERTYPE_MOPDL
  60. #define ETHERTYPE_MOPDL 0x6001
  61. #endif
  62. #ifndef ETHERTYPE_MOPRC
  63. #define ETHERTYPE_MOPRC 0x6002
  64. #endif
  65. #ifndef ETHERTYPE_DN
  66. #define ETHERTYPE_DN 0x6003
  67. #endif
  68. #ifndef ETHERTYPE_LAT
  69. #define ETHERTYPE_LAT 0x6004
  70. #endif
  71. #ifndef ETHERTYPE_SCA
  72. #define ETHERTYPE_SCA 0x6007
  73. #endif
  74. #ifndef ETHERTYPE_TEB
  75. #define ETHERTYPE_TEB 0x6558
  76. #endif
  77. #ifndef ETHERTYPE_LANBRIDGE
  78. #define ETHERTYPE_LANBRIDGE 0x8038
  79. #endif
  80. #ifndef ETHERTYPE_DECDNS
  81. #define ETHERTYPE_DECDNS 0x803c
  82. #endif
  83. #ifndef ETHERTYPE_DECDTS
  84. #define ETHERTYPE_DECDTS 0x803e
  85. #endif
  86. #ifndef ETHERTYPE_VEXP
  87. #define ETHERTYPE_VEXP 0x805b
  88. #endif
  89. #ifndef ETHERTYPE_VPROD
  90. #define ETHERTYPE_VPROD 0x805c
  91. #endif
  92. #ifndef ETHERTYPE_ATALK
  93. #define ETHERTYPE_ATALK 0x809b
  94. #endif
  95. #ifndef ETHERTYPE_AARP
  96. #define ETHERTYPE_AARP 0x80f3
  97. #endif
  98. #ifndef ETHERTYPE_TIPC
  99. #define ETHERTYPE_TIPC 0x88ca
  100. #endif
  101. #ifndef ETHERTYPE_8021Q
  102. #define ETHERTYPE_8021Q 0x8100
  103. #endif
  104. /* see:
  105. http://en.wikipedia.org/wiki/IEEE_802.1Q
  106. and http://en.wikipedia.org/wiki/QinQ
  107. */
  108. #ifndef ETHERTYPE_8021Q9100
  109. #define ETHERTYPE_8021Q9100 0x9100
  110. #endif
  111. #ifndef ETHERTYPE_8021Q9200
  112. #define ETHERTYPE_8021Q9200 0x9200
  113. #endif
  114. #ifndef ETHERTYPE_8021QinQ
  115. #define ETHERTYPE_8021QinQ 0x88a8
  116. #endif
  117. #ifndef ETHERTYPE_IPX
  118. #define ETHERTYPE_IPX 0x8137
  119. #endif
  120. #ifndef ETHERTYPE_IPV6
  121. #define ETHERTYPE_IPV6 0x86dd
  122. #endif
  123. #ifndef ETHERTYPE_PPP
  124. #define ETHERTYPE_PPP 0x880b
  125. #endif
  126. #ifndef ETHERTYPE_MPCP
  127. #define ETHERTYPE_MPCP 0x8808
  128. #endif
  129. #ifndef ETHERTYPE_SLOW
  130. #define ETHERTYPE_SLOW 0x8809
  131. #endif
  132. #ifndef ETHERTYPE_MPLS
  133. #define ETHERTYPE_MPLS 0x8847
  134. #endif
  135. #ifndef ETHERTYPE_MPLS_MULTI
  136. #define ETHERTYPE_MPLS_MULTI 0x8848
  137. #endif
  138. #ifndef ETHERTYPE_PPPOED
  139. #define ETHERTYPE_PPPOED 0x8863
  140. #endif
  141. #ifndef ETHERTYPE_PPPOES
  142. #define ETHERTYPE_PPPOES 0x8864
  143. #endif
  144. #ifndef ETHERTYPE_PPPOED2
  145. #define ETHERTYPE_PPPOED2 0x3c12
  146. #endif
  147. #ifndef ETHERTYPE_PPPOES2
  148. #define ETHERTYPE_PPPOES2 0x3c13
  149. #endif
  150. #ifndef ETHERTYPE_MS_NLB_HB
  151. #define ETHERTYPE_MS_NLB_HB 0x886f /* MS Network Load Balancing Heartbeat */
  152. #endif
  153. #ifndef ETHERTYPE_JUMBO
  154. #define ETHERTYPE_JUMBO 0x8870
  155. #endif
  156. #ifndef ETHERTYPE_LLDP
  157. #define ETHERTYPE_LLDP 0x88cc
  158. #endif
  159. #ifndef ETHERTYPE_EAPOL
  160. #define ETHERTYPE_EAPOL 0x888e
  161. #endif
  162. #ifndef ETHERTYPE_RRCP
  163. #define ETHERTYPE_RRCP 0x8899
  164. #endif
  165. #ifndef ETHERTYPE_AOE
  166. #define ETHERTYPE_AOE 0x88a2
  167. #endif
  168. #ifndef ETHERTYPE_LOOPBACK
  169. #define ETHERTYPE_LOOPBACK 0x9000
  170. #endif
  171. #ifndef ETHERTYPE_VMAN
  172. #define ETHERTYPE_VMAN 0x9100 /* Extreme VMAN Protocol */
  173. #endif
  174. #ifndef ETHERTYPE_CFM_OLD
  175. #define ETHERTYPE_CFM_OLD 0xabcd /* 802.1ag depreciated */
  176. #endif
  177. #ifndef ETHERTYPE_CFM
  178. #define ETHERTYPE_CFM 0x8902 /* 802.1ag */
  179. #endif
  180. #ifndef ETHERTYPE_IEEE1905_1
  181. #define ETHERTYPE_IEEE1905_1 0x893a /* IEEE 1905.1 */
  182. #endif
  183. #ifndef ETHERTYPE_ISO
  184. #define ETHERTYPE_ISO 0xfefe /* nonstandard - used in Cisco HDLC encapsulation */
  185. #endif
  186. #ifndef ETHERTYPE_CALM_FAST
  187. #define ETHERTYPE_CALM_FAST 0x1111 /* ISO CALM FAST */
  188. #endif
  189. #ifndef ETHERTYPE_GEONET_OLD
  190. #define ETHERTYPE_GEONET_OLD 0x0707 /* ETSI GeoNetworking (before Jan 2013) */
  191. #endif
  192. #ifndef ETHERTYPE_GEONET
  193. #define ETHERTYPE_GEONET 0x8947 /* ETSI GeoNetworking (Official IEEE registration from Jan 2013) */
  194. #endif
  195. #ifndef ETHERTYPE_MEDSA
  196. #define ETHERTYPE_MEDSA 0xdada /* Marvel Distributed Switch Architecture */
  197. #endif
  198. extern const struct tok ethertype_values[];