xref: /haiku/headers/private/net/ethernet.h (revision bc3955fea5b07e2e94a27fc05e4bb58fe6f0319b)
1 /*
2  * Copyright 2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef ETHERNET_H
6 #define ETHERNET_H
7 
8 
9 #include <SupportDefs.h>
10 
11 
12 #define ETHER_ADDRESS_LENGTH	6
13 #define ETHER_CRC_LENGTH		4
14 #define ETHER_HEADER_LENGTH		14
15 
16 #define ETHER_MIN_FRAME_SIZE	64
17 #define ETHER_MAX_FRAME_SIZE	1514
18 
19 struct ether_header {
20 	uint8	destination[ETHER_ADDRESS_LENGTH];
21 	uint8	source[ETHER_ADDRESS_LENGTH];
22 	uint16	type;
23 } _PACKED;
24 
25 #define ETHER_FRAME_TYPE			0x00010000
26 
27 // ethernet types
28 #define ETHER_TYPE_IP				0x0800
29 #define ETHER_TYPE_ARP				0x0806
30 #define ETHER_TYPE_IPX				0x8137
31 #define	ETHER_TYPE_IPV6				0x86dd
32 #define	ETHER_TYPE_PPPOE_DISCOVERY	0x8863	// PPPoE discovery stage
33 #define	ETHER_TYPE_PPPOE			0x8864	// PPPoE session stage
34 
35 #endif	// ETHERNET_H
36