This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 306cb3301b include/netinet/if_ether.h: add ethhdr definition.
306cb3301b is described below
commit 306cb3301b19ffe342ddedcea06793bd04b78b9f
Author: zhanghongyu <[email protected]>
AuthorDate: Sat Oct 26 00:30:03 2024 +0800
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 <[email protected]>
---
include/netinet/if_ether.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h
index 7ed3aa5ba1..85c86c3297 100644
--- a/include/netinet/if_ether.h
+++ b/include/netinet/if_ether.h
@@ -40,6 +40,17 @@
#define ETH_P_IP ETHERTYPE_IP
#define ETH_P_ARP ETHERTYPE_ARP
+/****************************************************************************
+ * Public Type Definitions
+ ****************************************************************************/
+
+struct ethhdr
+{
+ uint8_t h_dest[ETH_ALEN]; /* destination eth addr */
+ uint8_t h_source[ETH_ALEN]; /* source ether addr */
+ uint16_t h_proto; /* packet type ID field */
+};
+
/* Ethernet Address Resolution Protocol.
*
* See RFC 826 for protocol description. Structure below is adapted