CS350 COS
COS
Loading...
Searching...
No Matches
ethernet.h
Go to the documentation of this file.
1
2#ifndef __NET_ETHERNET_H__
3#define __NET_ETHERNET_H__
4
5#include <sys/cdefs.h>
6
7#define ETHER_ADDR_LEN 6
8#define ETHER_TYPE_LEN 2
9#define ETHER_CRC_LEN 4
10
11#define ETHER_HDR_LEN (2*ETHER_ADDR_LEN + ETHER_TYPE_LEN)
12
18
19struct ether_addr {
21} PACKED;
22
23#define ETHERTYPE_IP 0x0800 /* IP */
24#define ETHERTYPE_ARP 0x0806 /* ARP */
25#define ETHERTYPE_REVARP 0x8036 /* Reverse ARP */
26#define ETHERTYPE_IPV6 0x86DD /* IPv6 */
27
28#endif /* __NET_ETHERNET_H__ */
29
uint8_t ether_shost[ETHER_ADDR_LEN]
Definition: ethernet.h:15
uint16_t ether_type
Definition: ethernet.h:16
struct ether_header PACKED
uint8_t octet[ETHER_ADDR_LEN]
Definition: ethernet.h:20
uint8_t ether_dhost[ETHER_ADDR_LEN]
Definition: ethernet.h:14
#define ETHER_ADDR_LEN
Definition: ethernet.h:7
unsigned short uint16_t
Definition: types.h:11
unsigned char uint8_t
Definition: types.h:10