xref: /csrg-svn/sys/net/if_arp.h (revision 55584)
125972Skarels /*
225972Skarels  * Copyright (c) 1986 Regents of the University of California.
333183Sbostic  * All rights reserved.
425972Skarels  *
544464Sbostic  * %sccs.include.redist.c%
633183Sbostic  *
7*55584Sbostic  *	@(#)if_arp.h	7.5 (Berkeley) 07/23/92
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  */
33*55584Sbostic #ifdef COMMENT_ONLY
34*55584Sbostic 	u_char	ar_sha[];	/* sender hardware address */
35*55584Sbostic 	u_char	ar_spa[];	/* sender protocol address */
36*55584Sbostic 	u_char	ar_tha[];	/* target hardware address */
37*55584Sbostic 	u_char	ar_tpa[];	/* target protocol address */
38*55584Sbostic #endif
3925972Skarels };
4025972Skarels 
4125972Skarels /*
4225972Skarels  * ARP ioctl request
4325972Skarels  */
4425972Skarels struct arpreq {
4525972Skarels 	struct	sockaddr arp_pa;		/* protocol address */
4625972Skarels 	struct	sockaddr arp_ha;		/* hardware address */
4725972Skarels 	int	arp_flags;			/* flags */
4825972Skarels };
4925972Skarels /*  arp_flags and at_flags field values */
5025972Skarels #define	ATF_INUSE	0x01	/* entry in use */
5125972Skarels #define ATF_COM		0x02	/* completed entry (enaddr valid) */
5225972Skarels #define	ATF_PERM	0x04	/* permanent entry */
5325972Skarels #define	ATF_PUBL	0x08	/* publish entry (respond for other host) */
5425972Skarels #define	ATF_USETRAILERS	0x10	/* has requested trailers */
55