fix count on bzero
[unix-history] / usr / src / sys / netinet / if_ether.h
CommitLineData
187456a2
MK
1/* if_ether.h 6.3 84/03/20 */
2
3/*
4 * Ethernet address - 6 octets
5 */
6struct ether_addr {
7 u_char ether_addr_octet[6];
8};
66b2ba82
SL
9
10/*
11 * Structure of a 10Mb/s Ethernet header.
12 */
3fa8d9bb 13struct ether_header {
187456a2
MK
14 struct ether_addr ether_dhost;
15 struct ether_addr ether_shost;
3fa8d9bb 16 u_short ether_type;
66b2ba82
SL
17};
18
c24a8a35 19#define ETHERPUP_PUPTYPE 0x0200 /* PUP protocol */
b332a7f5 20#define ETHERPUP_IPTYPE 0x0800 /* IP protocol */
8ae4cebd 21#define ETHERPUP_ARPTYPE 0x0806 /* Addr. resolution protocol */
66b2ba82
SL
22
23/*
3fa8d9bb
SL
24 * The ETHERPUP_NTRAILER packet types starting at ETHERPUP_TRAIL have
25 * (type-ETHERPUP_TRAIL)*512 bytes of data followed
66b2ba82
SL
26 * by a PUP type (as given above) and then the (variable-length) header.
27 */
b332a7f5 28#define ETHERPUP_TRAIL 0x1000 /* Trailer PUP */
3fa8d9bb
SL
29#define ETHERPUP_NTRAILER 16
30
31#define ETHERMTU 1500
32#define ETHERMIN (60-14)
8ae4cebd 33
8ae4cebd
SL
34/*
35 * Ethernet Address Resolution Protocol.
36 *
37 * See RFC 826 for protocol description. Structure below is adapted
38 * to resolving internet addresses. Field names used correspond to
39 * RFC 826.
40 */
41struct ether_arp {
42 u_short arp_hrd; /* format of hardware address */
43#define ARPHRD_ETHER 1 /* ethernet hardware address */
44 u_short arp_pro; /* format of proto. address (ETHERPUP_IPTYPE) */
45 u_char arp_hln; /* length of hardware address (6) */
46 u_char arp_pln; /* length of protocol address (4) */
47 u_short arp_op;
48#define ARPOP_REQUEST 1 /* request to resolve address */
49#define ARPOP_REPLY 2 /* response to previous request */
187456a2
MK
50 u_char arp_xsha[6]; /* sender hardware address */
51 u_char arp_xspa[4]; /* sender protocol address */
52 u_char arp_xtha[6]; /* target hardware address */
53 u_char arp_xtpa[4]; /* target protocol address */
8ae4cebd 54};
187456a2
MK
55#define arp_sha(ea) (*(struct ether_addr *)(ea)->arp_xsha)
56#define arp_spa(ea) (*(struct in_addr *)(ea)->arp_xspa)
57#define arp_tha(ea) (*(struct ether_addr *)(ea)->arp_xtha)
58#define arp_tpa(ea) (*(struct in_addr *)(ea)->arp_xtpa)
8ae4cebd 59
8ae4cebd
SL
60/*
61 * Structure shared between the ethernet driver modules and
62 * the address resolution code. For example, each ec_softc or il_softc
63 * begins with this structure.
64 */
65struct arpcom {
66 struct ifnet ac_if; /* network-visible interface */
187456a2
MK
67 struct ether_addr ac_enaddr; /* ethernet hardware address */
68};
69
70/*
71 * Internet to ethernet address resolution table.
72 */
73struct arptab {
74 struct in_addr at_iaddr; /* internet address */
75 struct ether_addr at_enaddr; /* ethernet address */
76 struct mbuf *at_hold; /* last packet until resolved/timeout */
77 u_char at_timer; /* minutes since last reference */
78 u_char at_flags; /* flags */
8ae4cebd
SL
79};
80
5ebce7c6 81#ifdef KERNEL
187456a2 82struct ether_addr etherbroadcastaddr;
8ae4cebd
SL
83struct arptab *arptnew();
84#endif