Skip to content

Commit

Permalink
include/netinet/if_ether.h: add ethhdr definition.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
zhhyu7 authored and xiaoxiang781216 committed Oct 29, 2024
1 parent 198dd93 commit 306cb33
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/netinet/if_ether.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 306cb33

Please sign in to comment.