xref: /csrg-svn/sys/netinet/if_ether.h (revision 11573)
1 /*	if_ether.h	4.4	83/03/15	*/
2 
3 /*
4  * Structure of a 10Mb/s Ethernet header.
5  */
6 struct	ether_header {
7 	u_char	ether_dhost[6];
8 	u_char	ether_shost[6];
9 	u_short	ether_type;
10 };
11 
12 #define	ETHERPUP_PUPTYPE	0x0400		/* PUP protocol */
13 #define	ETHERPUP_IPTYPE		0x0800		/* IP protocol */
14 #define ETHERPUP_ARPTYPE	0x0806		/* Addr. resolution protocol */
15 
16 /*
17  * The ETHERPUP_NTRAILER packet types starting at ETHERPUP_TRAIL have
18  * (type-ETHERPUP_TRAIL)*512 bytes of data followed
19  * by a PUP type (as given above) and then the (variable-length) header.
20  */
21 #define	ETHERPUP_TRAIL		0x1000		/* Trailer PUP */
22 #define	ETHERPUP_NTRAILER	16
23 
24 #define	ETHERMTU	1500
25 #define	ETHERMIN	(60-14)
26 
27 u_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  */
36 struct	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  */
57 struct	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 
63 struct	in_addr arpmyaddr();
64 struct	arptab *arptnew();
65 #endif
66