Skip to content

Commit 306cb33

Browse files
zhhyu7xiaoxiang781216
authored andcommitted
include/netinet/if_ether.h: add ethhdr definition.
adapts to third-party code compilation. in the process of porting EtherCAT, we encounter some situations where the structure is not defined, or the returned data types do not match the expectations. Refer to the EtherCAT implementation of other systems and add relevant definitions. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
1 parent 198dd93 commit 306cb33

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/netinet/if_ether.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@
4040
#define ETH_P_IP ETHERTYPE_IP
4141
#define ETH_P_ARP ETHERTYPE_ARP
4242

43+
/****************************************************************************
44+
* Public Type Definitions
45+
****************************************************************************/
46+
47+
struct ethhdr
48+
{
49+
uint8_t h_dest[ETH_ALEN]; /* destination eth addr */
50+
uint8_t h_source[ETH_ALEN]; /* source ether addr */
51+
uint16_t h_proto; /* packet type ID field */
52+
};
53+
4354
/* Ethernet Address Resolution Protocol.
4455
*
4556
* See RFC 826 for protocol description. Structure below is adapted

0 commit comments

Comments
 (0)