iPXE
if_ether.h
Go to the documentation of this file.
00001 #ifndef _IPXE_IF_ETHER_H
00002 #define _IPXE_IF_ETHER_H
00003 
00004 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00005 
00006 #include <stdint.h>
00007 
00008 #define ETH_ALEN                6       /* Size of Ethernet address */
00009 #define ETH_HLEN                14      /* Size of ethernet header */
00010 #define ETH_ZLEN                60      /* Minimum packet */
00011 #define ETH_FRAME_LEN           1514    /* Maximum packet */
00012 #define ETH_DATA_ALIGN          2       /* Amount needed to align the data after an ethernet header */
00013 #ifndef ETH_MAX_MTU
00014 #define ETH_MAX_MTU             (ETH_FRAME_LEN-ETH_HLEN)
00015 #endif
00016 
00017 #define ETH_P_RAW       0x0000  /* Raw packet */
00018 #define ETH_P_IP        0x0800  /* Internet Protocl Packet */
00019 #define ETH_P_ARP       0x0806  /* Address Resolution Protocol */
00020 #define ETH_P_RARP      0x8035  /* Reverse Address resolution Protocol */
00021 #define ETH_P_8021Q     0x8100  /* 802.1Q VLAN Extended Header */
00022 #define ETH_P_IPV6      0x86DD  /* IPv6 over blueblook */
00023 #define ETH_P_SLOW      0x8809  /* Ethernet slow protocols */
00024 #define ETH_P_EAPOL     0x888E  /* 802.1X EAP over LANs */
00025 #define ETH_P_AOE       0x88A2  /* ATA over Ethernet */
00026 #define ETH_P_FCOE      0x8906  /* Fibre Channel over Ethernet */
00027 #define ETH_P_FIP       0x8914  /* FCoE Initialization Protocol */
00028 
00029 /** An Ethernet link-layer header */
00030 struct ethhdr {
00031         /** Destination MAC address */
00032         uint8_t h_dest[ETH_ALEN];
00033         /** Source MAC address */
00034         uint8_t h_source[ETH_ALEN];
00035         /** Protocol ID */
00036         uint16_t h_protocol;
00037 } __attribute__ ((packed));
00038 
00039 #endif  /* _IPXE_IF_ETHER_H */