fix ip packet forwarding to not stomp on headers when fragmented;
[unix-history] / usr / src / sys / netinet / if_ether.h
CommitLineData
8ae4cebd 1/* if_ether.h 4.4 83/03/15 */
66b2ba82
SL
2
3/*
4 * Structure of a 10Mb/s Ethernet header.
5 */
3fa8d9bb
SL
6struct ether_header {
7 u_char ether_dhost[6];
8 u_char ether_shost[6];
9 u_short ether_type;
66b2ba82
SL
10};
11
b332a7f5
SL
12#define ETHERPUP_PUPTYPE 0x0400 /* PUP protocol */
13#define ETHERPUP_IPTYPE 0x0800 /* IP protocol */
8ae4cebd 14#define ETHERPUP_ARPTYPE 0x0806 /* Addr. resolution protocol */
66b2ba82
SL
15
16/*
3fa8d9bb
SL
17 * The ETHERPUP_NTRAILER packet types starting at ETHERPUP_TRAIL have
18 * (type-ETHERPUP_TRAIL)*512 bytes of data followed
66b2ba82
SL
19 * by a PUP type (as given above) and then the (variable-length) header.
20 */
b332a7f5 21#define ETHERPUP_TRAIL 0x1000 /* Trailer PUP */
3fa8d9bb
SL
22#define ETHERPUP_NTRAILER 16
23
24#define ETHERMTU 1500
25#define ETHERMIN (60-14)
8ae4cebd
SL
26
27u_char etherbroadcastaddr[6]; /* 6 bytes of 0xFF */
28
29/*
30 * Ethernet Address Resolution Protocol.
31 *
32 * See RFC 826 for protocol description. Structure below is adapted
33 * to resolving internet addresses. Field names used correspond to
34 * RFC 826.
35 */
36struct ether_arp {
37 u_short arp_hrd; /* format of hardware address */
38#define ARPHRD_ETHER 1 /* ethernet hardware address */
39 u_short arp_pro; /* format of proto. address (ETHERPUP_IPTYPE) */
40 u_char arp_hln; /* length of hardware address (6) */
41 u_char arp_pln; /* length of protocol address (4) */
42 u_short arp_op;
43#define ARPOP_REQUEST 1 /* request to resolve address */
44#define ARPOP_REPLY 2 /* response to previous request */
45 u_char arp_sha[6]; /* sender hardware address */
46 u_char arp_spa[4]; /* sender protocol address */
47 u_char arp_tha[6]; /* target hardware address */
48 u_char arp_tpa[4]; /* target protocol address */
49};
50
51#ifdef KERNEL
52/*
53 * Structure shared between the ethernet driver modules and
54 * the address resolution code. For example, each ec_softc or il_softc
55 * begins with this structure.
56 */
57struct arpcom {
58 struct ifnet ac_if; /* network-visible interface */
59 u_char ac_enaddr[6]; /* ethernet hardware address */
60 struct arpcom *ac_ac; /* link to next ether driver */
61};
62
63struct in_addr arpmyaddr();
64struct arptab *arptnew();
65#endif