xref: /csrg-svn/sys/netinet/if_ether.h (revision 12459)
1*12459Ssam /*	if_ether.h	4.5	83/05/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 */
1411573Ssam #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)
2611573Ssam 
2711573Ssam /*
2811573Ssam  * Ethernet Address Resolution Protocol.
2911573Ssam  *
3011573Ssam  * See RFC 826 for protocol description.  Structure below is adapted
3111573Ssam  * to resolving internet addresses.  Field names used correspond to
3211573Ssam  * RFC 826.
3311573Ssam  */
3411573Ssam struct	ether_arp {
3511573Ssam 	u_short	arp_hrd;	/* format of hardware address */
3611573Ssam #define ARPHRD_ETHER 	1	/* ethernet hardware address */
3711573Ssam 	u_short	arp_pro;	/* format of proto. address (ETHERPUP_IPTYPE) */
3811573Ssam 	u_char	arp_hln;	/* length of hardware address (6) */
3911573Ssam 	u_char	arp_pln;	/* length of protocol address (4) */
4011573Ssam 	u_short	arp_op;
4111573Ssam #define	ARPOP_REQUEST	1	/* request to resolve address */
4211573Ssam #define	ARPOP_REPLY	2	/* response to previous request */
4311573Ssam 	u_char	arp_sha[6];	/* sender hardware address */
4411573Ssam 	u_char	arp_spa[4];	/* sender protocol address */
4511573Ssam 	u_char	arp_tha[6];	/* target hardware address */
4611573Ssam 	u_char	arp_tpa[4];	/* target protocol address */
4711573Ssam };
4811573Ssam 
4911573Ssam /*
5011573Ssam  * Structure shared between the ethernet driver modules and
5111573Ssam  * the address resolution code.  For example, each ec_softc or il_softc
5211573Ssam  * begins with this structure.
5311573Ssam  */
5411573Ssam struct	arpcom {
5511573Ssam 	struct 	ifnet ac_if;	/* network-visible interface */
5611573Ssam 	u_char	ac_enaddr[6];	/* ethernet hardware address */
5711573Ssam 	struct	arpcom *ac_ac;	/* link to next ether driver */
5811573Ssam };
5911573Ssam 
60*12459Ssam #ifdef	KERNEL
61*12459Ssam u_char etherbroadcastaddr[6];			/* 6 bytes of 0xFF */
6211573Ssam struct	in_addr arpmyaddr();
6311573Ssam struct	arptab *arptnew();
6411573Ssam #endif
65