Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

if_ether.h 1.1KB

123456789101112131415161718192021222324252627282930313233
  1. #ifndef _GPXE_IF_ETHER_H
  2. #define _GPXE_IF_ETHER_H
  3. #include <stdint.h>
  4. #define ETH_ALEN 6 /* Size of Ethernet address */
  5. #define ETH_HLEN 14 /* Size of ethernet header */
  6. #define ETH_ZLEN 60 /* Minimum packet */
  7. #define ETH_FRAME_LEN 1514 /* Maximum packet */
  8. #define ETH_DATA_ALIGN 2 /* Amount needed to align the data after an ethernet header */
  9. #ifndef ETH_MAX_MTU
  10. #define ETH_MAX_MTU (ETH_FRAME_LEN-ETH_HLEN)
  11. #endif
  12. #define ETH_P_RAW 0x0000 /* Raw packet */
  13. #define ETH_P_IP 0x0800 /* Internet Protocl Packet */
  14. #define ETH_P_ARP 0x0806 /* Address Resolution Protocol */
  15. #define ETH_P_RARP 0x8035 /* Reverse Address resolution Protocol */
  16. #define ETH_P_IPV6 0x86DD /* IPv6 over blueblook */
  17. #define ETH_P_SLOW 0x8809 /* Ethernet slow protocols */
  18. #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
  19. /** An Ethernet link-layer header */
  20. struct ethhdr {
  21. /** Destination MAC address */
  22. uint8_t h_dest[ETH_ALEN];
  23. /** Source MAC address */
  24. uint8_t h_source[ETH_ALEN];
  25. /** Protocol ID */
  26. uint16_t h_protocol;
  27. } __attribute__ ((packed));
  28. #endif /* _GPXE_IF_ETHER_H */