1 /* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Global definitions for the ARP (RFC 826) protocol. 7 * 8 * Version: @(#)if_arp.h 1.0.1 04/16/93 9 * 10 * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988 11 * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source. 12 * Ross Biro, <bir7@leland.Stanford.Edu> 13 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 14 * Florian La Roche, 15 * Jonathan Layes <layes@loran.com> 16 * 17 * This program is free software; you can redistribute it and/or 18 * modify it under the terms of the GNU General Public License 19 * as published by the Free Software Foundation; either version 20 * 2 of the License, or (at your option) any later version. 21 */ 22 #ifndef _LINUX_IF_ARP_H 23 #define _LINUX_IF_ARP_H 24 25 /* ARP protocol HARDWARE identifiers. */ 26 #define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */ 27 #define ARPHRD_ETHER 1 /* Ethernet 10Mbps */ 28 #define ARPHRD_EETHER 2 /* Experimental Ethernet */ 29 #define ARPHRD_AX25 3 /* AX.25 Level 2 */ 30 #define ARPHRD_PRONET 4 /* PROnet token ring */ 31 #define ARPHRD_CHAOS 5 /* Chaosnet */ 32 #define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */ 33 #define ARPHRD_ARCNET 7 /* ARCnet */ 34 #define ARPHRD_APPLETLK 8 /* APPLEtalk */ 35 #define ARPHRD_DLCI 15 /* Frame Relay DLCI */ 36 37 /* Dummy types for non ARP hardware */ 38 #define ARPHRD_SLIP 256 39 #define ARPHRD_CSLIP 257 40 #define ARPHRD_SLIP6 258 41 #define ARPHRD_CSLIP6 259 42 #define ARPHRD_RSRVD 260 /* Notional KISS type */ 43 #define ARPHRD_ADAPT 264 44 #define ARPHRD_PPP 512 45 46 #define ARPHRD_TUNNEL 768 /* IPIP tunnel */ 47 #define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */ 48 #define ARPHRD_FRAD 770 /* Frame Relay Access Device */ 49 #define ARPHRD_SKIP 771 /* SKIP vif */ 50 #define ARPHRD_LOOPBACK 772 /* Loopback device */ 51 #define ARPHRD_LOCALTLK 773 /* Localtalk device */ 52 53 /* ARP protocol opcodes. */ 54 #define ARPOP_REQUEST 1 /* ARP request */ 55 #define ARPOP_REPLY 2 /* ARP reply */ 56 #define ARPOP_RREQUEST 3 /* RARP request */ 57 #define ARPOP_RREPLY 4 /* RARP reply */ 58 59 60 /* ARP ioctl request. */ 61 struct arpreq { 62 struct sockaddr arp_pa; /* protocol address */ 63 struct sockaddr arp_ha; /* hardware address */ 64 int arp_flags; /* flags */ 65 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ 66 char arp_dev[16]; 67 }; 68 69 struct arpreq_old { 70 struct sockaddr arp_pa; /* protocol address */ 71 struct sockaddr arp_ha; /* hardware address */ 72 int arp_flags; /* flags */ 73 struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ 74 }; 75 76 /* ARP Flag values. */ 77 #define ATF_COM 0x02 /* completed entry (ha valid) */ 78 #define ATF_PERM 0x04 /* permanent entry */ 79 #define ATF_PUBL 0x08 /* publish entry */ 80 #define ATF_USETRAILERS 0x10 /* has requested trailers */ 81 #define ATF_NETMASK 0x20 /* want to use a netmask (only 82 for proxy entries) */ 83 84 /* 85 * This structure defines an ethernet arp header. 86 */ 87 88 struct arphdr 89 { 90 unsigned short ar_hrd; /* format of hardware address */ 91 unsigned short ar_pro; /* format of protocol address */ 92 unsigned char ar_hln; /* length of hardware address */ 93 unsigned char ar_pln; /* length of protocol address */ 94 unsigned short ar_op; /* ARP opcode (command) */ 95 96 #if 0 97 /* 98 * Ethernet looks like this : This bit is variable sized however... 99 */ 100 unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */ 101 unsigned char ar_sip[4]; /* sender IP address */ 102 unsigned char ar_tha[ETH_ALEN]; /* target hardware address */ 103 unsigned char ar_tip[4]; /* target IP address */ 104 #endif 105 106 }; 107 108 /* Support for the user space arp daemon, arpd */ 109 110 #define ARPD_UPDATE 0x01 111 #define ARPD_LOOKUP 0x02 112 113 struct arpd_request 114 { 115 unsigned short req; /* request type */ 116 __u32 ip; /* ip address of entry */ 117 __u32 mask; /* netmask - used for proxy */ 118 unsigned char ha[MAX_ADDR_LEN]; /* Hardware address */ 119 unsigned long last_used; /* For expiry */ 120 unsigned long last_updated; /* For expiry */ 121 unsigned int flags; /* Control status */ 122 struct device *dev; /* Device entry is tied to */ 123 int loc; /* Debugging call location */ 124 }; 125 126 #endif /* _LINUX_IF_ARP_H */