xref: /freebsd/contrib/tcpdump/ethertype.h (revision ee67461e56828dd1f8de165947ba83f6d9148a87)
14edb46e9SPaul Traina /*
24edb46e9SPaul Traina  * Copyright (c) 1993, 1994, 1996
34edb46e9SPaul Traina  *	The Regents of the University of California.  All rights reserved.
44edb46e9SPaul Traina  *
54edb46e9SPaul Traina  * Redistribution and use in source and binary forms, with or without
64edb46e9SPaul Traina  * modification, are permitted provided that: (1) source code distributions
74edb46e9SPaul Traina  * retain the above copyright notice and this paragraph in its entirety, (2)
84edb46e9SPaul Traina  * distributions including binary code include the above copyright notice and
94edb46e9SPaul Traina  * this paragraph in its entirety in the documentation or other materials
104edb46e9SPaul Traina  * provided with the distribution, and (3) all advertising materials mentioning
114edb46e9SPaul Traina  * features or use of this software display the following acknowledgement:
124edb46e9SPaul Traina  * ``This product includes software developed by the University of California,
134edb46e9SPaul Traina  * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
144edb46e9SPaul Traina  * the University nor the names of its contributors may be used to endorse
154edb46e9SPaul Traina  * or promote products derived from this software without specific prior
164edb46e9SPaul Traina  * written permission.
174edb46e9SPaul Traina  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
184edb46e9SPaul Traina  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
194edb46e9SPaul Traina  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
204edb46e9SPaul Traina  */
214edb46e9SPaul Traina 
22943ee2b1SBill Fenner /*
23*ee67461eSJoseph Mingrone  * Maximum length of the length field in an Ethernet header; any value
24*ee67461eSJoseph Mingrone  * greater than this is not a length value, so it's either an Ethernet
25*ee67461eSJoseph Mingrone  * type or an invalid value.
26*ee67461eSJoseph Mingrone  */
27*ee67461eSJoseph Mingrone #define	MAX_ETHERNET_LENGTH_VAL	1500
28*ee67461eSJoseph Mingrone 
29*ee67461eSJoseph Mingrone /*
30943ee2b1SBill Fenner  * Ethernet types.
31943ee2b1SBill Fenner  *
32943ee2b1SBill Fenner  * We wrap the declarations with #ifdef, so that if a file includes
33943ee2b1SBill Fenner  * <netinet/if_ether.h>, which may declare some of these, we don't
34943ee2b1SBill Fenner  * get a bunch of complaints from the C compiler about redefinitions
35943ee2b1SBill Fenner  * of these values.
36943ee2b1SBill Fenner  *
37943ee2b1SBill Fenner  * We declare all of them here so that no file has to include
38943ee2b1SBill Fenner  * <netinet/if_ether.h> if all it needs are ETHERTYPE_ values.
39943ee2b1SBill Fenner  */
404edb46e9SPaul Traina 
41c1ad1296SSam Leffler #ifndef ETHERTYPE_LEN
42c1ad1296SSam Leffler #define ETHERTYPE_LEN           2
43c1ad1296SSam Leffler #endif
44c1ad1296SSam Leffler 
45c1ad1296SSam Leffler #ifndef ETHERTYPE_GRE_ISO
46c1ad1296SSam Leffler #define ETHERTYPE_GRE_ISO       0x00FE  /* not really an ethertype only used in GRE */
47c1ad1296SSam Leffler #endif
48943ee2b1SBill Fenner #ifndef ETHERTYPE_PUP
49943ee2b1SBill Fenner #define	ETHERTYPE_PUP		0x0200	/* PUP protocol */
50943ee2b1SBill Fenner #endif
51943ee2b1SBill Fenner #ifndef ETHERTYPE_IP
52943ee2b1SBill Fenner #define	ETHERTYPE_IP		0x0800	/* IP protocol */
53943ee2b1SBill Fenner #endif
54943ee2b1SBill Fenner #ifndef ETHERTYPE_ARP
55943ee2b1SBill Fenner #define ETHERTYPE_ARP		0x0806	/* Addr. resolution protocol */
56943ee2b1SBill Fenner #endif
57943ee2b1SBill Fenner #ifndef ETHERTYPE_REVARP
58943ee2b1SBill Fenner #define ETHERTYPE_REVARP	0x8035	/* reverse Addr. resolution protocol */
59943ee2b1SBill Fenner #endif
604edb46e9SPaul Traina #ifndef ETHERTYPE_NS
614edb46e9SPaul Traina #define ETHERTYPE_NS		0x0600
624edb46e9SPaul Traina #endif
634edb46e9SPaul Traina #ifndef	ETHERTYPE_SPRITE
644edb46e9SPaul Traina #define	ETHERTYPE_SPRITE	0x0500
654edb46e9SPaul Traina #endif
664edb46e9SPaul Traina #ifndef ETHERTYPE_TRAIL
674edb46e9SPaul Traina #define ETHERTYPE_TRAIL		0x1000
684edb46e9SPaul Traina #endif
694edb46e9SPaul Traina #ifndef	ETHERTYPE_MOPDL
704edb46e9SPaul Traina #define	ETHERTYPE_MOPDL		0x6001
714edb46e9SPaul Traina #endif
724edb46e9SPaul Traina #ifndef	ETHERTYPE_MOPRC
734edb46e9SPaul Traina #define	ETHERTYPE_MOPRC		0x6002
744edb46e9SPaul Traina #endif
754edb46e9SPaul Traina #ifndef	ETHERTYPE_DN
764edb46e9SPaul Traina #define	ETHERTYPE_DN		0x6003
774edb46e9SPaul Traina #endif
784edb46e9SPaul Traina #ifndef	ETHERTYPE_LAT
794edb46e9SPaul Traina #define	ETHERTYPE_LAT		0x6004
804edb46e9SPaul Traina #endif
814edb46e9SPaul Traina #ifndef ETHERTYPE_SCA
824edb46e9SPaul Traina #define ETHERTYPE_SCA		0x6007
834edb46e9SPaul Traina #endif
8427df3f5dSRui Paulo #ifndef ETHERTYPE_TEB
8527df3f5dSRui Paulo #define ETHERTYPE_TEB		0x6558
8627df3f5dSRui Paulo #endif
874edb46e9SPaul Traina #ifndef	ETHERTYPE_LANBRIDGE
884edb46e9SPaul Traina #define	ETHERTYPE_LANBRIDGE	0x8038
894edb46e9SPaul Traina #endif
904edb46e9SPaul Traina #ifndef	ETHERTYPE_DECDNS
914edb46e9SPaul Traina #define	ETHERTYPE_DECDNS	0x803c
924edb46e9SPaul Traina #endif
934edb46e9SPaul Traina #ifndef	ETHERTYPE_DECDTS
944edb46e9SPaul Traina #define	ETHERTYPE_DECDTS	0x803e
954edb46e9SPaul Traina #endif
964edb46e9SPaul Traina #ifndef	ETHERTYPE_VEXP
974edb46e9SPaul Traina #define	ETHERTYPE_VEXP		0x805b
984edb46e9SPaul Traina #endif
994edb46e9SPaul Traina #ifndef	ETHERTYPE_VPROD
1004edb46e9SPaul Traina #define	ETHERTYPE_VPROD		0x805c
1014edb46e9SPaul Traina #endif
1024edb46e9SPaul Traina #ifndef ETHERTYPE_ATALK
1034edb46e9SPaul Traina #define ETHERTYPE_ATALK		0x809b
1044edb46e9SPaul Traina #endif
1054edb46e9SPaul Traina #ifndef ETHERTYPE_AARP
1064edb46e9SPaul Traina #define ETHERTYPE_AARP		0x80f3
1074edb46e9SPaul Traina #endif
108d09a7e67SXin LI #ifndef	ETHERTYPE_TIPC
109d09a7e67SXin LI #define	ETHERTYPE_TIPC		0x88ca
110d09a7e67SXin LI #endif
111a88113a8SBill Fenner #ifndef	ETHERTYPE_8021Q
112a88113a8SBill Fenner #define	ETHERTYPE_8021Q		0x8100
113a88113a8SBill Fenner #endif
114cac3dcd5SXin LI 
115cac3dcd5SXin LI /* see:
116*ee67461eSJoseph Mingrone         https://en.wikipedia.org/wiki/IEEE_802.1Q
117*ee67461eSJoseph Mingrone     and https://en.wikipedia.org/wiki/QinQ
118cac3dcd5SXin LI */
119cac3dcd5SXin LI #ifndef	ETHERTYPE_8021Q9100
120cac3dcd5SXin LI #define	ETHERTYPE_8021Q9100	0x9100
121cac3dcd5SXin LI #endif
122cac3dcd5SXin LI #ifndef	ETHERTYPE_8021Q9200
123cac3dcd5SXin LI #define	ETHERTYPE_8021Q9200	0x9200
124cac3dcd5SXin LI #endif
125cac3dcd5SXin LI #ifndef	ETHERTYPE_8021QinQ
126cac3dcd5SXin LI #define	ETHERTYPE_8021QinQ      0x88a8
127cac3dcd5SXin LI #endif
128*ee67461eSJoseph Mingrone #ifndef ETHERTYPE_MACSEC
129*ee67461eSJoseph Mingrone #define ETHERTYPE_MACSEC	0x88e5
130*ee67461eSJoseph Mingrone #endif
131d5a5022dSPaul Traina #ifndef ETHERTYPE_IPX
132d5a5022dSPaul Traina #define ETHERTYPE_IPX		0x8137
133d5a5022dSPaul Traina #endif
134a88113a8SBill Fenner #ifndef ETHERTYPE_IPV6
135a88113a8SBill Fenner #define ETHERTYPE_IPV6		0x86dd
136e8fdcab3SBrian Somers #endif
137a1c2090eSBill Fenner #ifndef ETHERTYPE_PPP
138a1c2090eSBill Fenner #define	ETHERTYPE_PPP		0x880b
139a1c2090eSBill Fenner #endif
140a5779b6eSRui Paulo #ifndef ETHERTYPE_MPCP
141a5779b6eSRui Paulo #define	ETHERTYPE_MPCP		0x8808
142a5779b6eSRui Paulo #endif
14317cb103cSSam Leffler #ifndef ETHERTYPE_SLOW
14417cb103cSSam Leffler #define	ETHERTYPE_SLOW		0x8809
14517cb103cSSam Leffler #endif
146a1c2090eSBill Fenner #ifndef	ETHERTYPE_MPLS
147a1c2090eSBill Fenner #define	ETHERTYPE_MPLS		0x8847
148a1c2090eSBill Fenner #endif
149a1c2090eSBill Fenner #ifndef	ETHERTYPE_MPLS_MULTI
150a1c2090eSBill Fenner #define	ETHERTYPE_MPLS_MULTI	0x8848
151a1c2090eSBill Fenner #endif
152a88113a8SBill Fenner #ifndef ETHERTYPE_PPPOED
153a88113a8SBill Fenner #define ETHERTYPE_PPPOED	0x8863
154a88113a8SBill Fenner #endif
155a88113a8SBill Fenner #ifndef ETHERTYPE_PPPOES
156a88113a8SBill Fenner #define ETHERTYPE_PPPOES	0x8864
157e8fdcab3SBrian Somers #endif
158*ee67461eSJoseph Mingrone #ifndef ETHERTYPE_NSH
159*ee67461eSJoseph Mingrone #define ETHERTYPE_NSH		0x894F
160*ee67461eSJoseph Mingrone #endif
161f1f9d42aSJulian Elischer #ifndef ETHERTYPE_PPPOED2
162f1f9d42aSJulian Elischer #define ETHERTYPE_PPPOED2	0x3c12
163f1f9d42aSJulian Elischer #endif
164f1f9d42aSJulian Elischer #ifndef ETHERTYPE_PPPOES2
165f1f9d42aSJulian Elischer #define ETHERTYPE_PPPOES2	0x3c13
166f1f9d42aSJulian Elischer #endif
167d03c0883SXin LI #ifndef ETHERTYPE_MS_NLB_HB
168d03c0883SXin LI #define ETHERTYPE_MS_NLB_HB	0x886f /* MS Network Load Balancing Heartbeat */
169d03c0883SXin LI #endif
170c1ad1296SSam Leffler #ifndef ETHERTYPE_JUMBO
171c1ad1296SSam Leffler #define ETHERTYPE_JUMBO         0x8870
172c1ad1296SSam Leffler #endif
173a5779b6eSRui Paulo #ifndef ETHERTYPE_LLDP
174a5779b6eSRui Paulo #define ETHERTYPE_LLDP          0x88cc
175a5779b6eSRui Paulo #endif
176c1ad1296SSam Leffler #ifndef ETHERTYPE_EAPOL
177c1ad1296SSam Leffler #define ETHERTYPE_EAPOL		0x888e
178c1ad1296SSam Leffler #endif
179*ee67461eSJoseph Mingrone #ifndef ETHERTYPE_REALTEK
180*ee67461eSJoseph Mingrone #define ETHERTYPE_REALTEK	0x8899	/* Realtek layer 2 protocols and switch tags */
181a5779b6eSRui Paulo #endif
1823c602fabSXin LI #ifndef ETHERTYPE_AOE
1833c602fabSXin LI #define ETHERTYPE_AOE		0x88a2
1843c602fabSXin LI #endif
185*ee67461eSJoseph Mingrone #ifndef ETHERTYPE_PTP
186*ee67461eSJoseph Mingrone #define ETHERTYPE_PTP		0x88f7
187*ee67461eSJoseph Mingrone #endif
1884edb46e9SPaul Traina #ifndef	ETHERTYPE_LOOPBACK
1894edb46e9SPaul Traina #define	ETHERTYPE_LOOPBACK	0x9000
1904edb46e9SPaul Traina #endif
191cc391cceSBruce M Simpson #ifndef	ETHERTYPE_VMAN
192cc391cceSBruce M Simpson #define	ETHERTYPE_VMAN	        0x9100 /* Extreme VMAN Protocol */
193cc391cceSBruce M Simpson #endif
194a5779b6eSRui Paulo #ifndef	ETHERTYPE_CFM_OLD
195a5779b6eSRui Paulo #define	ETHERTYPE_CFM_OLD       0xabcd /* 802.1ag depreciated */
196a5779b6eSRui Paulo #endif
197a5779b6eSRui Paulo #ifndef	ETHERTYPE_CFM
198a5779b6eSRui Paulo #define	ETHERTYPE_CFM           0x8902 /* 802.1ag */
199a5779b6eSRui Paulo #endif
2003c602fabSXin LI #ifndef	ETHERTYPE_IEEE1905_1
2013c602fabSXin LI #define	ETHERTYPE_IEEE1905_1    0x893a /* IEEE 1905.1 */
2023c602fabSXin LI #endif
203cc391cceSBruce M Simpson #ifndef	ETHERTYPE_ISO
204cc391cceSBruce M Simpson #define	ETHERTYPE_ISO           0xfefe  /* nonstandard - used in Cisco HDLC encapsulation */
205cc391cceSBruce M Simpson #endif
2063c602fabSXin LI #ifndef	ETHERTYPE_CALM_FAST
2073c602fabSXin LI #define	ETHERTYPE_CALM_FAST     0x1111  /* ISO CALM FAST */
2083c602fabSXin LI #endif
2093c602fabSXin LI #ifndef	ETHERTYPE_GEONET_OLD
2103c602fabSXin LI #define	ETHERTYPE_GEONET_OLD    0x0707  /* ETSI GeoNetworking (before Jan 2013) */
2113c602fabSXin LI #endif
2123c602fabSXin LI #ifndef	ETHERTYPE_GEONET
2133c602fabSXin LI #define	ETHERTYPE_GEONET        0x8947  /* ETSI GeoNetworking (Official IEEE registration from Jan 2013) */
2143c602fabSXin LI #endif
215*ee67461eSJoseph Mingrone #ifndef	ETHERTYPE_ARISTA
216*ee67461eSJoseph Mingrone #define	ETHERTYPE_ARISTA        0xd28b /*  Arista Networks vendor specific EtherType */
2173340d773SGleb Smirnoff #endif
218cc391cceSBruce M Simpson 
219cc391cceSBruce M Simpson extern const struct tok ethertype_values[];
220