• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

sw-host/ether.h (r4864/r225)

Go to the documentation of this file.
00001 #ifndef ETHER_H
00002 #define ETHER_H
00003 
00004 #include "xbasic_types.h"
00005 
00006 //Ethernet CRC and padding is done by xilinx driver
00007 #define ETHER_CRC_SIZE 4
00008 #define MAX_ETHER_FRAME_SIZE (1518 - ETHER_CRC_SIZE)
00009 #define MIN_ETHER_FRAME_SIZE (64 - ETHER_CRC_SIZE)
00010 
00011 #define ETHER_ADDR_LEN 6
00012 #define ETHERTYPE_IP   0x0800
00013 #define ETHERTYPE_ARP   0x0806
00014 
00015 struct ether_header {
00016    Xuint8 dest_addr[ETHER_ADDR_LEN];
00017    Xuint8 src_addr[ETHER_ADDR_LEN];
00018    Xuint16 ether_type;
00019 };
00020 
00021 #define ETHER_HEADER_OFFSET 0
00022 #define ETHER_PAYLOAD_OFFSET ETHER_HEADER_OFFSET + sizeof(struct ether_header)
00023 #define MAX_ETHER_PAYLOAD MAX_ETHER_FRAME_SIZE - sizeof(struct ether_header)
00024 
00025 void cpy_ether_addr(Xuint8 *dest, Xuint8 *src);
00026 int ether_addr_equal(Xuint8 *one, Xuint8 *two);
00027 
00028 #endif

Generated on Tue Dec 10 2013 04:52:24 for ROCsoft by  doxygen 1.7.1