| 1 | /*	$NetBSD: aarp.h,v 1.3 2011/05/08 13:51:31 bouyer Exp $	*/ |
| 2 | |
| 3 | /* |
| 4 | * Copyright (c) 1990,1991 Regents of The University of Michigan. |
| 5 | * All Rights Reserved. |
| 6 | * |
| 7 | * Permission to use, copy, modify, and distribute this software and |
| 8 | * its documentation for any purpose and without fee is hereby granted, |
| 9 | * provided that the above copyright notice appears in all copies and |
| 10 | * that both that copyright notice and this permission notice appear |
| 11 | * in supporting documentation, and that the name of The University |
| 12 | * of Michigan not be used in advertising or publicity pertaining to |
| 13 | * distribution of the software without specific, written prior |
| 14 | * permission. This software is supplied as is without expressed or |
| 15 | * implied warranties of any kind. |
| 16 | * |
| 17 | * This product includes software developed by the University of |
| 18 | * California, Berkeley and its contributors. |
| 19 | * |
| 20 | *	Research Systems Unix Group |
| 21 | *	The University of Michigan |
| 22 | *	c/o Wesley Craig |
| 23 | *	535 W. William Street |
| 24 | *	Ann Arbor, Michigan |
| 25 | *	+1-313-764-2278 |
| 26 | *	netatalk@umich.edu |
| 27 | */ |
| 28 | #ifndef _NETATALK_AARP_H_ |
| 29 | #define _NETATALK_AARP_H_ |
| 30 | /* |
| 31 | * This structure is used for both phase 1 and 2. Under phase 1 |
| 32 | * the net is not filled in. It is in phase 2. In both cases, the |
| 33 | * hardware address length is (for some unknown reason) 4. If |
| 34 | * anyone at Apple could program their way out of paper bag, it |
| 35 | * would be 1 and 3 respectively for phase 1 and 2. |
| 36 | */ |
| 37 | union aapa { |
| 38 | 	u_int8_t ap_pa[4]; |
| 39 | 	struct ap_node { |
| 40 | 		u_int8_t an_zero; |
| 41 | 		u_int8_t an_net[2]; |
| 42 | 		u_int8_t an_node; |
| 43 | 	} ap_node; |
| 44 | }; |
| 45 | |
| 46 | struct ether_aarp { |
| 47 | 	struct arphdr eaa_hdr; |
| 48 | 	u_int8_t aarp_sha[6]; |
| 49 | 	union aapa aarp_spu; |
| 50 | 	u_int8_t aarp_tha[6]; |
| 51 | 	union aapa aarp_tpu; |
| 52 | }; |
| 53 | #define aarp_hrd	eaa_hdr.ar_hrd |
| 54 | #define aarp_pro	eaa_hdr.ar_pro |
| 55 | #define aarp_hln	eaa_hdr.ar_hln |
| 56 | #define aarp_pln	eaa_hdr.ar_pln |
| 57 | #define aarp_op		eaa_hdr.ar_op |
| 58 | #define aarp_spa	aarp_spu.ap_node.an_node |
| 59 | #define aarp_tpa	aarp_tpu.ap_node.an_node |
| 60 | #define aarp_spnet	aarp_spu.ap_node.an_net |
| 61 | #define aarp_tpnet	aarp_tpu.ap_node.an_net |
| 62 | #define aarp_spnode	aarp_spu.ap_node.an_node |
| 63 | #define aarp_tpnode	aarp_tpu.ap_node.an_node |
| 64 | |
| 65 | struct aarptab { |
| 66 | 	struct at_addr aat_ataddr; |
| 67 | 	u_int8_t aat_enaddr[6]; |
| 68 | 	u_int8_t aat_timer; |
| 69 | 	u_int8_t aat_flags; |
| 70 | 	struct mbuf *aat_hold; |
| 71 | }; |
| 72 | |
| 73 | #define AARPHRD_ETHER	0x0001 |
| 74 | |
| 75 | #define AARPOP_REQUEST	0x01 |
| 76 | #define AARPOP_RESPONSE	0x02 |
| 77 | #define AARPOP_PROBE	0x03 |
| 78 | |
| 79 | extern struct mowner aarp_mowner; |
| 80 | |
| 81 | #endif /* !_NETATALK_AARP_H_ */ |