Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ethernet: add ETHERTYPE define #9169

Merged
merged 1 commit into from May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions include/net/ethernet.h
Expand Up @@ -33,6 +33,19 @@

#define ETHER_ADDR_LEN 6

/* Ethernet protocol ID's */
#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
#define ETHERTYPE_SPRITE 0x0500 /* Sprite */
#define ETHERTYPE_IP 0x0800 /* IP */
#define ETHERTYPE_ARP 0x0806 /* Address resolution */
#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
#define ETHERTYPE_AT 0x809B /* AppleTalk protocol */
#define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */
#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */
#define ETHERTYPE_IPX 0x8137 /* IPX */
#define ETHERTYPE_IPV6 0x86dd /* IP protocol version 6 */
#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */

/****************************************************************************
* Public Type Definitions
****************************************************************************/
Expand Down
8 changes: 4 additions & 4 deletions include/nuttx/net/ethernet.h
Expand Up @@ -55,17 +55,17 @@

/* Recognized values of the type bytes in the Ethernet header */

#define ETHTYPE_ARP 0x0806 /* Address resolution protocol */
#define ETHTYPE_IP 0x0800 /* IP protocol */
#define ETHTYPE_IP6 0x86dd /* IP protocol version 6 */
#define ETHTYPE_ARP ETHERTYPE_ARP /* Address resolution protocol */
#define ETHTYPE_IP ETHERTYPE_IP /* IP protocol */
#define ETHTYPE_IP6 ETHERTYPE_IPV6 /* IP protocol version 6 */

/* Tag protocol identifier (TPID) of 0x8100 identifies the frame as an
* IEEE 802.1Q-tagged frame. This field is located at the same position as
* the Ethernet type field in untagged frames and is thus used to
* distinguish the frame from untagged frames.
*/

#define TPID_8021QVLAN 0x8100
#define TPID_8021QVLAN ETHERTYPE_VLAN

/* These are some of the types associated with QVLAN tagged
* Ethernet packets.
Expand Down