diff options
author | Michael Brown | 2006-04-19 03:52:41 +0200 |
---|---|---|
committer | Michael Brown | 2006-04-19 03:52:41 +0200 |
commit | 49f933fbc3a55071e1cac362f7e1b5f2fd41b657 (patch) | |
tree | ab0dfc2aa03215ff20b8f774da68a5dc3d217ac7 /src/include/gpxe/if_ether.h | |
parent | First version. ARP protocol independence in less than the size of uIP's (diff) | |
download | ipxe-49f933fbc3a55071e1cac362f7e1b5f2fd41b657.tar.gz ipxe-49f933fbc3a55071e1cac362f7e1b5f2fd41b657.tar.xz ipxe-49f933fbc3a55071e1cac362f7e1b5f2fd41b657.zip |
Moved if_ether.h and if_arp.h to include/gpxe, for consistency with Linux
kernel.
Removed obsolete struct arprequest from if_arp.h and put it in nic.c so
that nic.c will still compile. ARP will very shortly be handled by
net/arp.c instead.
Diffstat (limited to 'src/include/gpxe/if_ether.h')
-rw-r--r-- | src/include/gpxe/if_ether.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/include/gpxe/if_ether.h b/src/include/gpxe/if_ether.h new file mode 100644 index 00000000..7f0abacb --- /dev/null +++ b/src/include/gpxe/if_ether.h @@ -0,0 +1,31 @@ +#ifndef _IF_ETHER_H +#define _IF_ETHER_H + +#include <stdint.h> + +#define ETH_ALEN 6 /* Size of Ethernet address */ +#define ETH_HLEN 14 /* Size of ethernet header */ +#define ETH_ZLEN 60 /* Minimum packet */ +#define ETH_FRAME_LEN 1514 /* Maximum packet */ +#define ETH_DATA_ALIGN 2 /* Amount needed to align the data after an ethernet header */ +#ifndef ETH_MAX_MTU +#define ETH_MAX_MTU (ETH_FRAME_LEN-ETH_HLEN) +#endif + +#define ETH_P_IP 0x0800 /* Internet Protocl Packet */ +#define ETH_P_ARP 0x0806 /* Address Resolution Protocol */ +#define ETH_P_RARP 0x8035 /* Reverse Address resolution Protocol */ +#define ETH_P_IPV6 0x86DD /* IPv6 over blueblook */ +#define ETH_P_SLOW 0x8809 /* Ethernet slow protocols */ + +/** An Ethernet link-layer header */ +struct ethhdr { + /** Destination MAC address */ + uint8_t h_dest[ETH_ALEN]; + /** Source MAC address */ + uint8_t h_source[ETH_ALEN]; + /** Protocol ID */ + uint16_t h_protocol; +} __attribute__ ((packed)); + +#endif /* _IF_ETHER_H */ |