Move eth_type definition to iana.h

This commit is contained in:
Dirk Ziegelmeier 2017-08-15 13:35:30 +02:00
parent 772bf96752
commit 2013f4cbd4
2 changed files with 40 additions and 38 deletions

View File

@ -38,6 +38,7 @@
#define LWIP_HDR_PROT_ETHERNET_H
#include "lwip/arch.h"
#include "lwip/prot/iana.h"
#ifdef __cplusplus
extern "C" {
@ -106,44 +107,6 @@ PACK_STRUCT_END
#define SIZEOF_VLAN_HDR 4
#define VLAN_ID(vlan_hdr) (lwip_htons((vlan_hdr)->prio_vid) & 0xFFF)
/**
* @ingroup ethernet
* A list of often ethtypes (although lwIP does not use all of them): */
enum eth_type {
/** Internet protocol v4 */
ETHTYPE_IP = 0x0800U,
/** Address resolution protocol */
ETHTYPE_ARP = 0x0806U,
/** Wake on lan */
ETHTYPE_WOL = 0x0842U,
/** RARP */
ETHTYPE_RARP = 0x8035U,
/** Virtual local area network */
ETHTYPE_VLAN = 0x8100U,
/** Internet protocol v6 */
ETHTYPE_IPV6 = 0x86DDU,
/** PPP Over Ethernet Discovery Stage */
ETHTYPE_PPPOEDISC = 0x8863U,
/** PPP Over Ethernet Session Stage */
ETHTYPE_PPPOE = 0x8864U,
/** Jumbo Frames */
ETHTYPE_JUMBO = 0x8870U,
/** Process field network */
ETHTYPE_PROFINET = 0x8892U,
/** Ethernet for control automation technology */
ETHTYPE_ETHERCAT = 0x88A4U,
/** Link layer discovery protocol */
ETHTYPE_LLDP = 0x88CCU,
/** Serial real-time communication system */
ETHTYPE_SERCOS = 0x88CDU,
/** Media redundancy protocol */
ETHTYPE_MRP = 0x88E3U,
/** Precision time protocol */
ETHTYPE_PTP = 0x88F7U,
/** Q-in-Q, 802.1ad */
ETHTYPE_QINQ = 0x9100U
};
/** The 24-bit IANA IPv4-multicast OUI is 01-00-5e: */
#define LL_IP4_MULTICAST_ADDR_0 0x01
#define LL_IP4_MULTICAST_ADDR_1 0x00

View File

@ -57,4 +57,43 @@
#define LWIP_IANA_PORT_MDNS 5353
#define LWIP_IANA_PORT_SEQURE_MQTT 8883
/**
* A list of often ethtypes (although lwIP does not use all of them).
* https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml#ieee-802-numbers-1
*/
enum eth_type {
/** Internet protocol v4 */
ETHTYPE_IP = 0x0800U,
/** Address resolution protocol */
ETHTYPE_ARP = 0x0806U,
/** Wake on lan */
ETHTYPE_WOL = 0x0842U,
/** RARP */
ETHTYPE_RARP = 0x8035U,
/** Virtual local area network */
ETHTYPE_VLAN = 0x8100U,
/** Internet protocol v6 */
ETHTYPE_IPV6 = 0x86DDU,
/** PPP Over Ethernet Discovery Stage */
ETHTYPE_PPPOEDISC = 0x8863U,
/** PPP Over Ethernet Session Stage */
ETHTYPE_PPPOE = 0x8864U,
/** Jumbo Frames */
ETHTYPE_JUMBO = 0x8870U,
/** Process field network */
ETHTYPE_PROFINET = 0x8892U,
/** Ethernet for control automation technology */
ETHTYPE_ETHERCAT = 0x88A4U,
/** Link layer discovery protocol */
ETHTYPE_LLDP = 0x88CCU,
/** Serial real-time communication system */
ETHTYPE_SERCOS = 0x88CDU,
/** Media redundancy protocol */
ETHTYPE_MRP = 0x88E3U,
/** Precision time protocol */
ETHTYPE_PTP = 0x88F7U,
/** Q-in-Q, 802.1ad */
ETHTYPE_QINQ = 0x9100U
};
#endif /* LWIP_HDR_PROT_IANA_H */