iPXE
if_ether.h
Go to the documentation of this file.
1 #ifndef _IPXE_IF_ETHER_H
2 #define _IPXE_IF_ETHER_H
3 
4 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5 FILE_SECBOOT ( PERMITTED );
6 
7 #include <stdint.h>
8 
9 #define ETH_ALEN 6 /* Size of Ethernet address */
10 #define ETH_HLEN 14 /* Size of ethernet header */
11 #define ETH_ZLEN 60 /* Minimum packet */
12 #define ETH_FRAME_LEN 1514 /* Maximum packet */
13 #define ETH_DATA_ALIGN 2 /* Amount needed to align the data after an ethernet header */
14 #ifndef ETH_MAX_MTU
15 #define ETH_MAX_MTU (ETH_FRAME_LEN-ETH_HLEN)
16 #endif
17 
18 #define ETH_P_RAW 0x0000 /* Raw packet */
19 #define ETH_P_IP 0x0800 /* Internet Protocl Packet */
20 #define ETH_P_ARP 0x0806 /* Address Resolution Protocol */
21 #define ETH_P_RARP 0x8035 /* Reverse Address resolution Protocol */
22 #define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
23 #define ETH_P_IPV6 0x86DD /* IPv6 over blueblook */
24 #define ETH_P_SLOW 0x8809 /* Ethernet slow protocols */
25 #define ETH_P_EAPOL 0x888E /* 802.1X EAP over LANs */
26 #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
27 #define ETH_P_LLDP 0x88CC /* Link Layer Discovery Protocol */
28 #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
29 #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
30 
31 /** An Ethernet link-layer header */
32 struct ethhdr {
33  /** Destination MAC address */
35  /** Source MAC address */
37  /** Protocol ID */
39 } __attribute__ ((packed));
40 
41 #endif /* _IPXE_IF_ETHER_H */
uint16_t h_protocol
Protocol ID.
Definition: if_ether.h:38
unsigned short uint16_t
Definition: stdint.h:11
struct ethhdr __attribute__((packed))
uint8_t h_dest[ETH_ALEN]
Destination MAC address.
Definition: if_ether.h:34
FILE_SECBOOT(PERMITTED)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned char uint8_t
Definition: stdint.h:10
uint8_t h_source[ETH_ALEN]
Source MAC address.
Definition: if_ether.h:36
#define ETH_ALEN
Definition: if_ether.h:9
An Ethernet link-layer header.
Definition: if_ether.h:32