xref: /dflybsd-src/contrib/tcpdump/ethertype.h (revision 59c07fbdf8168fa08c76c515186d561b5a92690c)
141c99275SPeter Avalos /*
241c99275SPeter Avalos  * Copyright (c) 1993, 1994, 1996
341c99275SPeter Avalos  *	The Regents of the University of California.  All rights reserved.
441c99275SPeter Avalos  *
541c99275SPeter Avalos  * Redistribution and use in source and binary forms, with or without
641c99275SPeter Avalos  * modification, are permitted provided that: (1) source code distributions
741c99275SPeter Avalos  * retain the above copyright notice and this paragraph in its entirety, (2)
841c99275SPeter Avalos  * distributions including binary code include the above copyright notice and
941c99275SPeter Avalos  * this paragraph in its entirety in the documentation or other materials
1041c99275SPeter Avalos  * provided with the distribution, and (3) all advertising materials mentioning
1141c99275SPeter Avalos  * features or use of this software display the following acknowledgement:
1241c99275SPeter Avalos  * ``This product includes software developed by the University of California,
1341c99275SPeter Avalos  * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
1441c99275SPeter Avalos  * the University nor the names of its contributors may be used to endorse
1541c99275SPeter Avalos  * or promote products derived from this software without specific prior
1641c99275SPeter Avalos  * written permission.
1741c99275SPeter Avalos  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
1841c99275SPeter Avalos  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
1941c99275SPeter Avalos  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2041c99275SPeter Avalos  */
2141c99275SPeter Avalos 
2241c99275SPeter Avalos /*
23*ed775ee7SAntonio Huete Jimenez  * Maximum length of the length field in an Ethernet header; any value
24*ed775ee7SAntonio Huete Jimenez  * greater than this is not a length value, so it's either an Ethernet
25*ed775ee7SAntonio Huete Jimenez  * type or an invalid value.
26*ed775ee7SAntonio Huete Jimenez  */
27*ed775ee7SAntonio Huete Jimenez #define	MAX_ETHERNET_LENGTH_VAL	1500
28*ed775ee7SAntonio Huete Jimenez 
29*ed775ee7SAntonio Huete Jimenez /*
3041c99275SPeter Avalos  * Ethernet types.
3141c99275SPeter Avalos  *
3241c99275SPeter Avalos  * We wrap the declarations with #ifdef, so that if a file includes
3341c99275SPeter Avalos  * <netinet/if_ether.h>, which may declare some of these, we don't
3441c99275SPeter Avalos  * get a bunch of complaints from the C compiler about redefinitions
3541c99275SPeter Avalos  * of these values.
3641c99275SPeter Avalos  *
3741c99275SPeter Avalos  * We declare all of them here so that no file has to include
3841c99275SPeter Avalos  * <netinet/if_ether.h> if all it needs are ETHERTYPE_ values.
3941c99275SPeter Avalos  */
4041c99275SPeter Avalos 
4141c99275SPeter Avalos #ifndef ETHERTYPE_LEN
4241c99275SPeter Avalos #define ETHERTYPE_LEN           2
4341c99275SPeter Avalos #endif
4441c99275SPeter Avalos 
4541c99275SPeter Avalos #ifndef ETHERTYPE_GRE_ISO
4641c99275SPeter Avalos #define ETHERTYPE_GRE_ISO       0x00FE  /* not really an ethertype only used in GRE */
4741c99275SPeter Avalos #endif
4841c99275SPeter Avalos #ifndef ETHERTYPE_PUP
4941c99275SPeter Avalos #define	ETHERTYPE_PUP		0x0200	/* PUP protocol */
5041c99275SPeter Avalos #endif
5141c99275SPeter Avalos #ifndef ETHERTYPE_IP
5241c99275SPeter Avalos #define	ETHERTYPE_IP		0x0800	/* IP protocol */
5341c99275SPeter Avalos #endif
5441c99275SPeter Avalos #ifndef ETHERTYPE_ARP
5541c99275SPeter Avalos #define ETHERTYPE_ARP		0x0806	/* Addr. resolution protocol */
5641c99275SPeter Avalos #endif
5741c99275SPeter Avalos #ifndef ETHERTYPE_REVARP
5841c99275SPeter Avalos #define ETHERTYPE_REVARP	0x8035	/* reverse Addr. resolution protocol */
5941c99275SPeter Avalos #endif
6041c99275SPeter Avalos #ifndef ETHERTYPE_NS
6141c99275SPeter Avalos #define ETHERTYPE_NS		0x0600
6241c99275SPeter Avalos #endif
6341c99275SPeter Avalos #ifndef	ETHERTYPE_SPRITE
6441c99275SPeter Avalos #define	ETHERTYPE_SPRITE	0x0500
6541c99275SPeter Avalos #endif
6641c99275SPeter Avalos #ifndef ETHERTYPE_TRAIL
6741c99275SPeter Avalos #define ETHERTYPE_TRAIL		0x1000
6841c99275SPeter Avalos #endif
6941c99275SPeter Avalos #ifndef	ETHERTYPE_MOPDL
7041c99275SPeter Avalos #define	ETHERTYPE_MOPDL		0x6001
7141c99275SPeter Avalos #endif
7241c99275SPeter Avalos #ifndef	ETHERTYPE_MOPRC
7341c99275SPeter Avalos #define	ETHERTYPE_MOPRC		0x6002
7441c99275SPeter Avalos #endif
7541c99275SPeter Avalos #ifndef	ETHERTYPE_DN
7641c99275SPeter Avalos #define	ETHERTYPE_DN		0x6003
7741c99275SPeter Avalos #endif
7841c99275SPeter Avalos #ifndef	ETHERTYPE_LAT
7941c99275SPeter Avalos #define	ETHERTYPE_LAT		0x6004
8041c99275SPeter Avalos #endif
8141c99275SPeter Avalos #ifndef ETHERTYPE_SCA
8241c99275SPeter Avalos #define ETHERTYPE_SCA		0x6007
8341c99275SPeter Avalos #endif
8427bfbee1SPeter Avalos #ifndef ETHERTYPE_TEB
8527bfbee1SPeter Avalos #define ETHERTYPE_TEB		0x6558
8627bfbee1SPeter Avalos #endif
8741c99275SPeter Avalos #ifndef	ETHERTYPE_LANBRIDGE
8841c99275SPeter Avalos #define	ETHERTYPE_LANBRIDGE	0x8038
8941c99275SPeter Avalos #endif
9041c99275SPeter Avalos #ifndef	ETHERTYPE_DECDNS
9141c99275SPeter Avalos #define	ETHERTYPE_DECDNS	0x803c
9241c99275SPeter Avalos #endif
9341c99275SPeter Avalos #ifndef	ETHERTYPE_DECDTS
9441c99275SPeter Avalos #define	ETHERTYPE_DECDTS	0x803e
9541c99275SPeter Avalos #endif
9641c99275SPeter Avalos #ifndef	ETHERTYPE_VEXP
9741c99275SPeter Avalos #define	ETHERTYPE_VEXP		0x805b
9841c99275SPeter Avalos #endif
9941c99275SPeter Avalos #ifndef	ETHERTYPE_VPROD
10041c99275SPeter Avalos #define	ETHERTYPE_VPROD		0x805c
10141c99275SPeter Avalos #endif
10241c99275SPeter Avalos #ifndef ETHERTYPE_ATALK
10341c99275SPeter Avalos #define ETHERTYPE_ATALK		0x809b
10441c99275SPeter Avalos #endif
10541c99275SPeter Avalos #ifndef ETHERTYPE_AARP
10641c99275SPeter Avalos #define ETHERTYPE_AARP		0x80f3
10741c99275SPeter Avalos #endif
1086263709fSPeter Avalos #ifndef	ETHERTYPE_TIPC
1096263709fSPeter Avalos #define	ETHERTYPE_TIPC		0x88ca
1106263709fSPeter Avalos #endif
11141c99275SPeter Avalos #ifndef	ETHERTYPE_8021Q
11241c99275SPeter Avalos #define	ETHERTYPE_8021Q		0x8100
11341c99275SPeter Avalos #endif
11427bfbee1SPeter Avalos 
11527bfbee1SPeter Avalos /* see:
116*ed775ee7SAntonio Huete Jimenez         https://en.wikipedia.org/wiki/IEEE_802.1Q
117*ed775ee7SAntonio Huete Jimenez     and https://en.wikipedia.org/wiki/QinQ
11827bfbee1SPeter Avalos */
11927bfbee1SPeter Avalos #ifndef	ETHERTYPE_8021Q9100
12027bfbee1SPeter Avalos #define	ETHERTYPE_8021Q9100	0x9100
12127bfbee1SPeter Avalos #endif
12227bfbee1SPeter Avalos #ifndef	ETHERTYPE_8021Q9200
12327bfbee1SPeter Avalos #define	ETHERTYPE_8021Q9200	0x9200
12427bfbee1SPeter Avalos #endif
12527bfbee1SPeter Avalos #ifndef	ETHERTYPE_8021QinQ
12627bfbee1SPeter Avalos #define	ETHERTYPE_8021QinQ      0x88a8
12727bfbee1SPeter Avalos #endif
128*ed775ee7SAntonio Huete Jimenez #ifndef ETHERTYPE_MACSEC
129*ed775ee7SAntonio Huete Jimenez #define ETHERTYPE_MACSEC	0x88e5
130*ed775ee7SAntonio Huete Jimenez #endif
13141c99275SPeter Avalos #ifndef ETHERTYPE_IPX
13241c99275SPeter Avalos #define ETHERTYPE_IPX		0x8137
13341c99275SPeter Avalos #endif
13441c99275SPeter Avalos #ifndef ETHERTYPE_IPV6
13541c99275SPeter Avalos #define ETHERTYPE_IPV6		0x86dd
13641c99275SPeter Avalos #endif
13741c99275SPeter Avalos #ifndef ETHERTYPE_PPP
13841c99275SPeter Avalos #define	ETHERTYPE_PPP		0x880b
13941c99275SPeter Avalos #endif
140ea7b4bf5SPeter Avalos #ifndef ETHERTYPE_MPCP
141ea7b4bf5SPeter Avalos #define	ETHERTYPE_MPCP		0x8808
142ea7b4bf5SPeter Avalos #endif
14341c99275SPeter Avalos #ifndef ETHERTYPE_SLOW
14441c99275SPeter Avalos #define	ETHERTYPE_SLOW		0x8809
14541c99275SPeter Avalos #endif
14641c99275SPeter Avalos #ifndef	ETHERTYPE_MPLS
14741c99275SPeter Avalos #define	ETHERTYPE_MPLS		0x8847
14841c99275SPeter Avalos #endif
14941c99275SPeter Avalos #ifndef	ETHERTYPE_MPLS_MULTI
15041c99275SPeter Avalos #define	ETHERTYPE_MPLS_MULTI	0x8848
15141c99275SPeter Avalos #endif
15241c99275SPeter Avalos #ifndef ETHERTYPE_PPPOED
15341c99275SPeter Avalos #define ETHERTYPE_PPPOED	0x8863
15441c99275SPeter Avalos #endif
15541c99275SPeter Avalos #ifndef ETHERTYPE_PPPOES
15641c99275SPeter Avalos #define ETHERTYPE_PPPOES	0x8864
15741c99275SPeter Avalos #endif
158*ed775ee7SAntonio Huete Jimenez #ifndef ETHERTYPE_NSH
159*ed775ee7SAntonio Huete Jimenez #define ETHERTYPE_NSH		0x894F
160*ed775ee7SAntonio Huete Jimenez #endif
16127bfbee1SPeter Avalos #ifndef ETHERTYPE_PPPOED2
16227bfbee1SPeter Avalos #define ETHERTYPE_PPPOED2	0x3c12
16327bfbee1SPeter Avalos #endif
16427bfbee1SPeter Avalos #ifndef ETHERTYPE_PPPOES2
16527bfbee1SPeter Avalos #define ETHERTYPE_PPPOES2	0x3c13
16627bfbee1SPeter Avalos #endif
167411677aeSAaron LI #ifndef ETHERTYPE_MS_NLB_HB
168411677aeSAaron LI #define ETHERTYPE_MS_NLB_HB	0x886f /* MS Network Load Balancing Heartbeat */
169411677aeSAaron LI #endif
17041c99275SPeter Avalos #ifndef ETHERTYPE_JUMBO
17141c99275SPeter Avalos #define ETHERTYPE_JUMBO         0x8870
17241c99275SPeter Avalos #endif
173ea7b4bf5SPeter Avalos #ifndef ETHERTYPE_LLDP
174ea7b4bf5SPeter Avalos #define ETHERTYPE_LLDP          0x88cc
175ea7b4bf5SPeter Avalos #endif
17641c99275SPeter Avalos #ifndef ETHERTYPE_EAPOL
17741c99275SPeter Avalos #define ETHERTYPE_EAPOL  	0x888e
17841c99275SPeter Avalos #endif
179ea7b4bf5SPeter Avalos #ifndef ETHERTYPE_RRCP
180ea7b4bf5SPeter Avalos #define ETHERTYPE_RRCP  	0x8899
181ea7b4bf5SPeter Avalos #endif
182411677aeSAaron LI #ifndef ETHERTYPE_AOE
183411677aeSAaron LI #define ETHERTYPE_AOE  		0x88a2
184411677aeSAaron LI #endif
185*ed775ee7SAntonio Huete Jimenez #ifndef ETHERTYPE_PTP
186*ed775ee7SAntonio Huete Jimenez #define ETHERTYPE_PTP  		0x88f7
187*ed775ee7SAntonio Huete Jimenez #endif
18841c99275SPeter Avalos #ifndef	ETHERTYPE_LOOPBACK
18941c99275SPeter Avalos #define	ETHERTYPE_LOOPBACK	0x9000
19041c99275SPeter Avalos #endif
19141c99275SPeter Avalos #ifndef	ETHERTYPE_VMAN
19241c99275SPeter Avalos #define	ETHERTYPE_VMAN	        0x9100 /* Extreme VMAN Protocol */
19341c99275SPeter Avalos #endif
194ea7b4bf5SPeter Avalos #ifndef	ETHERTYPE_CFM_OLD
195ea7b4bf5SPeter Avalos #define	ETHERTYPE_CFM_OLD       0xabcd /* 802.1ag depreciated */
196ea7b4bf5SPeter Avalos #endif
197ea7b4bf5SPeter Avalos #ifndef	ETHERTYPE_CFM
198ea7b4bf5SPeter Avalos #define	ETHERTYPE_CFM           0x8902 /* 802.1ag */
199ea7b4bf5SPeter Avalos #endif
200411677aeSAaron LI #ifndef	ETHERTYPE_IEEE1905_1
201411677aeSAaron LI #define	ETHERTYPE_IEEE1905_1    0x893a /* IEEE 1905.1 */
202411677aeSAaron LI #endif
20341c99275SPeter Avalos #ifndef	ETHERTYPE_ISO
20441c99275SPeter Avalos #define	ETHERTYPE_ISO           0xfefe  /* nonstandard - used in Cisco HDLC encapsulation */
20541c99275SPeter Avalos #endif
206411677aeSAaron LI #ifndef	ETHERTYPE_CALM_FAST
207411677aeSAaron LI #define	ETHERTYPE_CALM_FAST     0x1111  /* ISO CALM FAST */
208411677aeSAaron LI #endif
209411677aeSAaron LI #ifndef	ETHERTYPE_GEONET_OLD
210411677aeSAaron LI #define	ETHERTYPE_GEONET_OLD    0x0707  /* ETSI GeoNetworking (before Jan 2013) */
211411677aeSAaron LI #endif
212411677aeSAaron LI #ifndef	ETHERTYPE_GEONET
213411677aeSAaron LI #define	ETHERTYPE_GEONET        0x8947  /* ETSI GeoNetworking (Official IEEE registration from Jan 2013) */
214411677aeSAaron LI #endif
215*ed775ee7SAntonio Huete Jimenez #ifndef	ETHERTYPE_ARISTA
216*ed775ee7SAntonio Huete Jimenez #define	ETHERTYPE_ARISTA        0xd28b /*  Arista Networks vendor specific EtherType */
217411677aeSAaron LI #endif
21841c99275SPeter Avalos 
21941c99275SPeter Avalos extern const struct tok ethertype_values[];
220