xref: /csrg-svn/sys/netinet/if_ether.h (revision 11573)
1*11573Ssam /*	if_ether.h	4.4	83/03/15	*/
29744Ssam 
39744Ssam /*
49744Ssam  * Structure of a 10Mb/s Ethernet header.
59744Ssam  */
69746Ssam struct	ether_header {
79746Ssam 	u_char	ether_dhost[6];
89746Ssam 	u_char	ether_shost[6];
99746Ssam 	u_short	ether_type;
109744Ssam };
119744Ssam 
129748Ssam #define	ETHERPUP_PUPTYPE	0x0400		/* PUP protocol */
139748Ssam #define	ETHERPUP_IPTYPE		0x0800		/* IP protocol */
14*11573Ssam #define ETHERPUP_ARPTYPE	0x0806		/* Addr. resolution protocol */
159744Ssam 
169744Ssam /*
179746Ssam  * The ETHERPUP_NTRAILER packet types starting at ETHERPUP_TRAIL have
189746Ssam  * (type-ETHERPUP_TRAIL)*512 bytes of data followed
199744Ssam  * by a PUP type (as given above) and then the (variable-length) header.
209744Ssam  */
219748Ssam #define	ETHERPUP_TRAIL		0x1000		/* Trailer PUP */
229746Ssam #define	ETHERPUP_NTRAILER	16
239746Ssam 
249746Ssam #define	ETHERMTU	1500
259746Ssam #define	ETHERMIN	(60-14)
26*11573Ssam 
27*11573Ssam u_char etherbroadcastaddr[6];			/* 6 bytes of 0xFF */
28*11573Ssam 
29*11573Ssam /*
30*11573Ssam  * Ethernet Address Resolution Protocol.
31*11573Ssam  *
32*11573Ssam  * See RFC 826 for protocol description.  Structure below is adapted
33*11573Ssam  * to resolving internet addresses.  Field names used correspond to
34*11573Ssam  * RFC 826.
35*11573Ssam  */
36*11573Ssam struct	ether_arp {
37*11573Ssam 	u_short	arp_hrd;	/* format of hardware address */
38*11573Ssam #define ARPHRD_ETHER 	1	/* ethernet hardware address */
39*11573Ssam 	u_short	arp_pro;	/* format of proto. address (ETHERPUP_IPTYPE) */
40*11573Ssam 	u_char	arp_hln;	/* length of hardware address (6) */
41*11573Ssam 	u_char	arp_pln;	/* length of protocol address (4) */
42*11573Ssam 	u_short	arp_op;
43*11573Ssam #define	ARPOP_REQUEST	1	/* request to resolve address */
44*11573Ssam #define	ARPOP_REPLY	2	/* response to previous request */
45*11573Ssam 	u_char	arp_sha[6];	/* sender hardware address */
46*11573Ssam 	u_char	arp_spa[4];	/* sender protocol address */
47*11573Ssam 	u_char	arp_tha[6];	/* target hardware address */
48*11573Ssam 	u_char	arp_tpa[4];	/* target protocol address */
49*11573Ssam };
50*11573Ssam 
51*11573Ssam #ifdef	KERNEL
52*11573Ssam /*
53*11573Ssam  * Structure shared between the ethernet driver modules and
54*11573Ssam  * the address resolution code.  For example, each ec_softc or il_softc
55*11573Ssam  * begins with this structure.
56*11573Ssam  */
57*11573Ssam struct	arpcom {
58*11573Ssam 	struct 	ifnet ac_if;	/* network-visible interface */
59*11573Ssam 	u_char	ac_enaddr[6];	/* ethernet hardware address */
60*11573Ssam 	struct	arpcom *ac_ac;	/* link to next ether driver */
61*11573Ssam };
62*11573Ssam 
63*11573Ssam struct	in_addr arpmyaddr();
64*11573Ssam struct	arptab *arptnew();
65*11573Ssam #endif
66