xref: /csrg-svn/sys/net/if_arp.h (revision 44464)
125972Skarels /*
225972Skarels  * Copyright (c) 1986 Regents of the University of California.
333183Sbostic  * All rights reserved.
425972Skarels  *
5*44464Sbostic  * %sccs.include.redist.c%
633183Sbostic  *
7*44464Sbostic  *	@(#)if_arp.h	7.4 (Berkeley) 06/28/90
825972Skarels  */
925972Skarels 
1025972Skarels /*
1125972Skarels  * Address Resolution Protocol.
1225972Skarels  *
1325972Skarels  * See RFC 826 for protocol description.  ARP packets are variable
1425972Skarels  * in size; the arphdr structure defines the fixed-length portion.
1525972Skarels  * Protocol type values are the same as those for 10 Mb/s Ethernet.
1625972Skarels  * It is followed by the variable-sized fields ar_sha, arp_spa,
1725972Skarels  * arp_tha and arp_tpa in that order, according to the lengths
1825972Skarels  * specified.  Field names used correspond to RFC 826.
1925972Skarels  */
2025972Skarels struct	arphdr {
2125972Skarels 	u_short	ar_hrd;		/* format of hardware address */
2225972Skarels #define ARPHRD_ETHER 	1	/* ethernet hardware address */
2325972Skarels 	u_short	ar_pro;		/* format of protocol address */
2425972Skarels 	u_char	ar_hln;		/* length of hardware address */
2525972Skarels 	u_char	ar_pln;		/* length of protocol address */
2625972Skarels 	u_short	ar_op;		/* one of: */
2725972Skarels #define	ARPOP_REQUEST	1	/* request to resolve address */
2825972Skarels #define	ARPOP_REPLY	2	/* response to previous request */
2925972Skarels /*
3025972Skarels  * The remaining fields are variable in size,
3125972Skarels  * according to the sizes above.
3225972Skarels  */
3325972Skarels /*	u_char	ar_sha[];	/* sender hardware address */
3425972Skarels /*	u_char	ar_spa[];	/* sender protocol address */
3525972Skarels /*	u_char	ar_tha[];	/* target hardware address */
3625972Skarels /*	u_char	ar_tpa[];	/* target protocol address */
3725972Skarels };
3825972Skarels 
3925972Skarels /*
4025972Skarels  * ARP ioctl request
4125972Skarels  */
4225972Skarels struct arpreq {
4325972Skarels 	struct	sockaddr arp_pa;		/* protocol address */
4425972Skarels 	struct	sockaddr arp_ha;		/* hardware address */
4525972Skarels 	int	arp_flags;			/* flags */
4625972Skarels };
4725972Skarels /*  arp_flags and at_flags field values */
4825972Skarels #define	ATF_INUSE	0x01	/* entry in use */
4925972Skarels #define ATF_COM		0x02	/* completed entry (enaddr valid) */
5025972Skarels #define	ATF_PERM	0x04	/* permanent entry */
5125972Skarels #define	ATF_PUBL	0x08	/* publish entry (respond for other host) */
5225972Skarels #define	ATF_USETRAILERS	0x10	/* has requested trailers */
53