-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathethernet.h
26 lines (24 loc) · 991 Bytes
/
ethernet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//********************************************************************************************
//
// File : ethernet.h implement for Ethernet Protocol
//
//********************************************************************************************
#define ETH_TYPE_ARP_V 0x0806
#define ETH_TYPE_ARP_H_V 0x08
#define ETH_TYPE_ARP_L_V 0x06
#define ETH_TYPE_IP_V 0x0800
#define ETH_TYPE_IP_H_V 0x08
#define ETH_TYPE_IP_L_V 0x00
#define ETH_HEADER_LEN 14
#define ETH_DST_MAC_P 0
#define ETH_SRC_MAC_P 6
#define ETH_TYPE_H_P 12
#define ETH_TYPE_L_P 13
//********************************************************************************************
//
// Prototype function
//
//********************************************************************************************
//void eth_generate_packet ( ETH_HEADER eth_header );
extern WORD software_checksum( BYTE *rxtx_buffer, WORD len, DWORD sum);
extern void eth_generate_header ( BYTE *rxtx_buffer, WORD_BYTES type, BYTE *dest_mac );