netinet/if_ether.h: move #define ETH_XXX into if_ether.h

consistent with other operating systems

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2024-11-01 20:30:42 +08:00 committed by Xiang Xiao
parent ba56c6c102
commit 082bc17ab0
2 changed files with 12 additions and 16 deletions

View file

@ -35,7 +35,16 @@
* Pre-processor Definitions
****************************************************************************/
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_TLEN 2 /* Octets in ethernet type field */
#define ETH_HLEN 14 /* Total octets in header. */
#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
#define ETH_FCS_LEN 4 /* Octets in the FCS */
#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */
#define ETH_MAX_MTU 0xFFFFU /* 65535, same as IP_MAX_MTU */
#define ETH_P_IP ETHERTYPE_IP
#define ETH_P_ARP ETHERTYPE_ARP

View file

@ -39,25 +39,12 @@
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <netinet/if_ether.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
* and FCS/CRC (frame check sequence).
*/
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_TLEN 2 /* Octets in ethernet type field */
#define ETH_HLEN 14 /* Total octets in header. */
#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
#define ETH_FCS_LEN 4 /* Octets in the FCS */
#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */
#define ETH_MAX_MTU 0xFFFFU /* 65535, same as IP_MAX_MTU */
/* DS bit usage
*
* TA = transmitter address