00001 /** 00002 * 00003 00004 * INET An implementation of the TCP/IP protocol suite for the LINUX 00005 * operating system. INET is implemented using the BSD Socket 00006 * interface as the means of communication with the user level. 00007 * 00008 * Global definitions for the ARP (RFC 826) protocol. 00009 * 00010 * Version: @(#)if_arp.h 1.0.1 04/16/93 00011 * 00012 * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988 00013 * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source. 00014 * Ross Biro, <bir7@leland.Stanford.Edu> 00015 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 00016 * 00017 * This program is free software; you can redistribute it and/or 00018 * modify it under the terms of the GNU General Public License 00019 * as published by the Free Software Foundation; either version 00020 * 2 of the License, or (at your option) any later version. 00021 00022 00023 */ 00024 #ifndef _LINUX_IF_ARP_H 00025 #define _LINUX_IF_ARP_H 00026 00027 /// ARP protocol HARDWARE identifiers. 00028 #define ARPHRD_NETROM 0 ///< from KA9Q: NET/ROM pseudo 00029 #define ARPHRD_ETHER 1 ///< Ethernet 10Mbps 00030 #define ARPHRD_EETHER 2 ///< Experimental Ethernet 00031 #define ARPHRD_AX25 3 ///< AX.25 Level 2 00032 #define ARPHRD_PRONET 4 ///< PROnet token ring 00033 #define ARPHRD_CHAOS 5 ///< Chaosnet 00034 #define ARPHRD_IEEE802 6 ///< IEEE 802.2 Ethernet- huh? 00035 #define ARPHRD_ARCNET 7 ///< ARCnet 00036 #define ARPHRD_APPLETLK 8 ///< APPLEtalk 00037 00038 /// ARP protocol opcodes. 00039 #define ARPOP_REQUEST 1 ///< ARP request 00040 #define ARPOP_REPLY 2 ///< ARP reply 00041 #define ARPOP_RREQUEST 3 ///< RARP request 00042 #define ARPOP_RREPLY 4 ///< RARP reply 00043 00044 00045 /** 00046 * 00047 00048 * Address Resolution Protocol. 00049 * 00050 * See RFC 826 for protocol description. ARP packets are variable 00051 * in size; the arphdr structure defines the fixed-length portion. 00052 * Protocol type values are the same as those for 10 Mb/s Ethernet. 00053 * It is followed by the variable-sized fields ar_sha, arp_spa, 00054 * arp_tha and arp_tpa in that order, according to the lengths 00055 * specified. Field names used correspond to RFC 826. 00056 00057 00058 */ 00059 struct arphdr { 00060 unsigned short ar_hrd; ///< format of hardware address 00061 unsigned short ar_pro; ///< format of protocol address 00062 unsigned char ar_hln; ///< length of hardware address 00063 unsigned char ar_pln; ///< length of protocol address 00064 unsigned short ar_op; ///< ARP opcode (command) 00065 00066 /// The rest is variable in size, according to the sizes above. 00067 #if 0 00068 unsigned char ar_sha[]; ///< sender hardware address 00069 unsigned char ar_spa[]; ///< sender protocol address 00070 unsigned char ar_tha[]; ///< target hardware address 00071 unsigned char ar_tpa[]; ///< target protocol address 00072 #endif // not actually included! 00073 }; 00074 00075 00076 /// ARP ioctl request. 00077 struct arpreq { 00078 struct sockaddr arp_pa; ///< protocol address 00079 struct sockaddr arp_ha; ///< hardware address 00080 int arp_flags; ///< flags 00081 }; 00082 00083 /// ARP Flag values. 00084 #define ATF_INUSE 0x01 ///< entry in use 00085 #define ATF_COM 0x02 ///< completed entry (ha valid) 00086 #define ATF_PERM 0x04 ///< permanent entry 00087 #define ATF_PUBL 0x08 ///< publish entry 00088 #define ATF_USETRAILERS 0x10 ///< has requested trailers 00089 00090 00091 #endif // _LINUX_IF_ARP_H
1.4.6-5