1607ca46eSDavid Howells /* 2607ca46eSDavid Howells * INET An implementation of the TCP/IP protocol suite for the LINUX 3607ca46eSDavid Howells * operating system. INET is implemented using the BSD Socket 4607ca46eSDavid Howells * interface as the means of communication with the user level. 5607ca46eSDavid Howells * 6607ca46eSDavid Howells * Global definitions for the ARP (RFC 826) protocol. 7607ca46eSDavid Howells * 8607ca46eSDavid Howells * Version: @(#)if_arp.h 1.0.1 04/16/93 9607ca46eSDavid Howells * 10607ca46eSDavid Howells * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988 11607ca46eSDavid Howells * Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source. 12607ca46eSDavid Howells * Ross Biro 13607ca46eSDavid Howells * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 14607ca46eSDavid Howells * Florian La Roche, 15607ca46eSDavid Howells * Jonathan Layes <layes@loran.com> 16607ca46eSDavid Howells * Arnaldo Carvalho de Melo <acme@conectiva.com.br> ARPHRD_HWX25 17607ca46eSDavid Howells * 18607ca46eSDavid Howells * This program is free software; you can redistribute it and/or 19607ca46eSDavid Howells * modify it under the terms of the GNU General Public License 20607ca46eSDavid Howells * as published by the Free Software Foundation; either version 21607ca46eSDavid Howells * 2 of the License, or (at your option) any later version. 22607ca46eSDavid Howells */ 23607ca46eSDavid Howells #ifndef _UAPI_LINUX_IF_ARP_H 24607ca46eSDavid Howells #define _UAPI_LINUX_IF_ARP_H 25607ca46eSDavid Howells 26607ca46eSDavid Howells #include <linux/netdevice.h> 27607ca46eSDavid Howells 28607ca46eSDavid Howells /* ARP protocol HARDWARE identifiers. */ 29607ca46eSDavid Howells #define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */ 30607ca46eSDavid Howells #define ARPHRD_ETHER 1 /* Ethernet 10Mbps */ 31607ca46eSDavid Howells #define ARPHRD_EETHER 2 /* Experimental Ethernet */ 32607ca46eSDavid Howells #define ARPHRD_AX25 3 /* AX.25 Level 2 */ 33607ca46eSDavid Howells #define ARPHRD_PRONET 4 /* PROnet token ring */ 34607ca46eSDavid Howells #define ARPHRD_CHAOS 5 /* Chaosnet */ 35607ca46eSDavid Howells #define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */ 36607ca46eSDavid Howells #define ARPHRD_ARCNET 7 /* ARCnet */ 37607ca46eSDavid Howells #define ARPHRD_APPLETLK 8 /* APPLEtalk */ 38607ca46eSDavid Howells #define ARPHRD_DLCI 15 /* Frame Relay DLCI */ 39607ca46eSDavid Howells #define ARPHRD_ATM 19 /* ATM */ 40607ca46eSDavid Howells #define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */ 41607ca46eSDavid Howells #define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */ 42607ca46eSDavid Howells #define ARPHRD_EUI64 27 /* EUI-64 */ 43607ca46eSDavid Howells #define ARPHRD_INFINIBAND 32 /* InfiniBand */ 44607ca46eSDavid Howells 45607ca46eSDavid Howells /* Dummy types for non ARP hardware */ 46607ca46eSDavid Howells #define ARPHRD_SLIP 256 47607ca46eSDavid Howells #define ARPHRD_CSLIP 257 48607ca46eSDavid Howells #define ARPHRD_SLIP6 258 49607ca46eSDavid Howells #define ARPHRD_CSLIP6 259 50607ca46eSDavid Howells #define ARPHRD_RSRVD 260 /* Notional KISS type */ 51607ca46eSDavid Howells #define ARPHRD_ADAPT 264 52607ca46eSDavid Howells #define ARPHRD_ROSE 270 53607ca46eSDavid Howells #define ARPHRD_X25 271 /* CCITT X.25 */ 54607ca46eSDavid Howells #define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */ 55607ca46eSDavid Howells #define ARPHRD_CAN 280 /* Controller Area Network */ 56607ca46eSDavid Howells #define ARPHRD_PPP 512 57607ca46eSDavid Howells #define ARPHRD_CISCO 513 /* Cisco HDLC */ 58607ca46eSDavid Howells #define ARPHRD_HDLC ARPHRD_CISCO 59607ca46eSDavid Howells #define ARPHRD_LAPB 516 /* LAPB */ 60607ca46eSDavid Howells #define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */ 61607ca46eSDavid Howells #define ARPHRD_RAWHDLC 518 /* Raw HDLC */ 62607ca46eSDavid Howells 63607ca46eSDavid Howells #define ARPHRD_TUNNEL 768 /* IPIP tunnel */ 64607ca46eSDavid Howells #define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */ 65607ca46eSDavid Howells #define ARPHRD_FRAD 770 /* Frame Relay Access Device */ 66607ca46eSDavid Howells #define ARPHRD_SKIP 771 /* SKIP vif */ 67607ca46eSDavid Howells #define ARPHRD_LOOPBACK 772 /* Loopback device */ 68607ca46eSDavid Howells #define ARPHRD_LOCALTLK 773 /* Localtalk device */ 69607ca46eSDavid Howells #define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */ 70607ca46eSDavid Howells #define ARPHRD_BIF 775 /* AP1000 BIF */ 71607ca46eSDavid Howells #define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */ 72607ca46eSDavid Howells #define ARPHRD_IPDDP 777 /* IP over DDP tunneller */ 73607ca46eSDavid Howells #define ARPHRD_IPGRE 778 /* GRE over IP */ 74607ca46eSDavid Howells #define ARPHRD_PIMREG 779 /* PIMSM register interface */ 75607ca46eSDavid Howells #define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */ 76607ca46eSDavid Howells #define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */ 77607ca46eSDavid Howells #define ARPHRD_ECONET 782 /* Acorn Econet */ 78607ca46eSDavid Howells #define ARPHRD_IRDA 783 /* Linux-IrDA */ 79607ca46eSDavid Howells /* ARP works differently on different FC media .. so */ 80607ca46eSDavid Howells #define ARPHRD_FCPP 784 /* Point to point fibrechannel */ 81607ca46eSDavid Howells #define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */ 82607ca46eSDavid Howells #define ARPHRD_FCPL 786 /* Fibrechannel public loop */ 83607ca46eSDavid Howells #define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */ 84607ca46eSDavid Howells /* 787->799 reserved for fibrechannel media types */ 85607ca46eSDavid Howells #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ 86607ca46eSDavid Howells #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ 87607ca46eSDavid Howells #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ 88607ca46eSDavid Howells #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ 89607ca46eSDavid Howells #define ARPHRD_IEEE802154 804 90607ca46eSDavid Howells #define ARPHRD_IEEE802154_MONITOR 805 /* IEEE 802.15.4 network monitor */ 91607ca46eSDavid Howells 92607ca46eSDavid Howells #define ARPHRD_PHONET 820 /* PhoNet media type */ 93607ca46eSDavid Howells #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ 94607ca46eSDavid Howells #define ARPHRD_CAIF 822 /* CAIF media type */ 95607ca46eSDavid Howells #define ARPHRD_IP6GRE 823 /* GRE over IPv6 */ 96*77e2af03SDaniel Borkmann #define ARPHRD_NETLINK 824 /* Netlink header */ 97607ca46eSDavid Howells 98607ca46eSDavid Howells #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ 99607ca46eSDavid Howells #define ARPHRD_NONE 0xFFFE /* zero header length */ 100607ca46eSDavid Howells 101607ca46eSDavid Howells /* ARP protocol opcodes. */ 102607ca46eSDavid Howells #define ARPOP_REQUEST 1 /* ARP request */ 103607ca46eSDavid Howells #define ARPOP_REPLY 2 /* ARP reply */ 104607ca46eSDavid Howells #define ARPOP_RREQUEST 3 /* RARP request */ 105607ca46eSDavid Howells #define ARPOP_RREPLY 4 /* RARP reply */ 106607ca46eSDavid Howells #define ARPOP_InREQUEST 8 /* InARP request */ 107607ca46eSDavid Howells #define ARPOP_InREPLY 9 /* InARP reply */ 108607ca46eSDavid Howells #define ARPOP_NAK 10 /* (ATM)ARP NAK */ 109607ca46eSDavid Howells 110607ca46eSDavid Howells 111607ca46eSDavid Howells /* ARP ioctl request. */ 112607ca46eSDavid Howells struct arpreq { 113607ca46eSDavid Howells struct sockaddr arp_pa; /* protocol address */ 114607ca46eSDavid Howells struct sockaddr arp_ha; /* hardware address */ 115607ca46eSDavid Howells int arp_flags; /* flags */ 116607ca46eSDavid Howells struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ 117607ca46eSDavid Howells char arp_dev[16]; 118607ca46eSDavid Howells }; 119607ca46eSDavid Howells 120607ca46eSDavid Howells struct arpreq_old { 121607ca46eSDavid Howells struct sockaddr arp_pa; /* protocol address */ 122607ca46eSDavid Howells struct sockaddr arp_ha; /* hardware address */ 123607ca46eSDavid Howells int arp_flags; /* flags */ 124607ca46eSDavid Howells struct sockaddr arp_netmask; /* netmask (only for proxy arps) */ 125607ca46eSDavid Howells }; 126607ca46eSDavid Howells 127607ca46eSDavid Howells /* ARP Flag values. */ 128607ca46eSDavid Howells #define ATF_COM 0x02 /* completed entry (ha valid) */ 129607ca46eSDavid Howells #define ATF_PERM 0x04 /* permanent entry */ 130607ca46eSDavid Howells #define ATF_PUBL 0x08 /* publish entry */ 131607ca46eSDavid Howells #define ATF_USETRAILERS 0x10 /* has requested trailers */ 132607ca46eSDavid Howells #define ATF_NETMASK 0x20 /* want to use a netmask (only 133607ca46eSDavid Howells for proxy entries) */ 134607ca46eSDavid Howells #define ATF_DONTPUB 0x40 /* don't answer this addresses */ 135607ca46eSDavid Howells 136607ca46eSDavid Howells /* 137607ca46eSDavid Howells * This structure defines an ethernet arp header. 138607ca46eSDavid Howells */ 139607ca46eSDavid Howells 140607ca46eSDavid Howells struct arphdr { 141607ca46eSDavid Howells __be16 ar_hrd; /* format of hardware address */ 142607ca46eSDavid Howells __be16 ar_pro; /* format of protocol address */ 143607ca46eSDavid Howells unsigned char ar_hln; /* length of hardware address */ 144607ca46eSDavid Howells unsigned char ar_pln; /* length of protocol address */ 145607ca46eSDavid Howells __be16 ar_op; /* ARP opcode (command) */ 146607ca46eSDavid Howells 147607ca46eSDavid Howells #if 0 148607ca46eSDavid Howells /* 149607ca46eSDavid Howells * Ethernet looks like this : This bit is variable sized however... 150607ca46eSDavid Howells */ 151607ca46eSDavid Howells unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */ 152607ca46eSDavid Howells unsigned char ar_sip[4]; /* sender IP address */ 153607ca46eSDavid Howells unsigned char ar_tha[ETH_ALEN]; /* target hardware address */ 154607ca46eSDavid Howells unsigned char ar_tip[4]; /* target IP address */ 155607ca46eSDavid Howells #endif 156607ca46eSDavid Howells 157607ca46eSDavid Howells }; 158607ca46eSDavid Howells 159607ca46eSDavid Howells 160607ca46eSDavid Howells #endif /* _UAPI_LINUX_IF_ARP_H */ 161