1 #ifndef _NET_IF_ARP_H_ 2 #define _NET_IF_ARP_H_ 3 /* 4 * Interface to the Address Resolution Protocol 5 * 6 * Copyright © 1994-2000 AmiTCP/IP Group, 7 * Network Solutions Development, Inc. 8 * All rights reserved. 9 * 10 * $Id: if_arp.h,v 1.1.1.1 2005/03/15 16:00:46 laire Exp $ 11 */ 12 13 #pragma pack(2) 14 15 16 /* 17 * Address Resolution Protocol. 18 * 19 * See RFC 826 for protocol description. ARP packets are variable 20 * in size; the arphdr structure defines the fixed-length portion. 21 * Protocol type values are the same as those for 10 Mb/s Ethernet. 22 * It is followed by the variable-sized fields ar_sha, arp_spa, 23 * arp_tha and arp_tpa in that order, according to the lengths 24 * specified. Field names used correspond to RFC 826. 25 */ 26 struct arphdr { 27 u_short ar_hrd; /* format of hardware address */ 28 #define ARPHRD_ETHER 1 /* ethernet hardware address */ 29 #define ARPHRD_ARCNET 7 /* ARCNET hardware address */ 30 u_short ar_pro; /* format of protocol address */ 31 u_char ar_hln; /* length of hardware address */ 32 u_char ar_pln; /* length of protocol address */ 33 u_short ar_op; /* one of: */ 34 #define ARPOP_REQUEST 1 /* request to resolve address */ 35 #define ARPOP_REPLY 2 /* response to previous request */ 36 }; 37 38 #define MAXADDRARP 16 /* Maximum number of octets in hw address */ 39 40 /* 41 * ARP ioctl request. 42 */ 43 struct arpreq { 44 struct sockaddr arp_pa; /* protocol address */ 45 struct { /* hardware address */ 46 u_char sa_len; 47 u_char sa_family; 48 char sa_data[MAXADDRARP]; 49 } arp_ha; 50 int arp_flags; /* flags */ 51 }; 52 53 /* arp_flags and at_flags field values */ 54 #define ATF_INUSE 0x01 /* entry in use */ 55 #define ATF_COM 0x02 /* completed entry (enaddr valid) */ 56 #define ATF_PERM 0x04 /* permanent entry */ 57 #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ 58 #define ATF_USETRAILERS 0x10 /* has requested trailers */ 59 60 /* 61 * An AmiTCP/IP specific ARP table ioctl request 62 */ 63 struct arptabreq { 64 struct arpreq atr_arpreq; /* We want to identify the interface */ 65 long atr_size; /* # of elements in art_table */ 66 long atr_inuse; /* # of elements in use */ 67 struct arpreq *atr_table; 68 }; 69 70 71 #pragma pack() 72 73 #endif /* !_NET_IF_ARP_H_ */ 74 75