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