xref: /OK3568_Linux_fs/kernel/include/uapi/linux/if_arp.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * INET		An implementation of the TCP/IP protocol suite for the LINUX
4*4882a593Smuzhiyun  *		operating system.  INET is implemented using the  BSD Socket
5*4882a593Smuzhiyun  *		interface as the means of communication with the user level.
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  *		Global definitions for the ARP (RFC 826) protocol.
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  * Version:	@(#)if_arp.h	1.0.1	04/16/93
10*4882a593Smuzhiyun  *
11*4882a593Smuzhiyun  * Authors:	Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
12*4882a593Smuzhiyun  *		Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source.
13*4882a593Smuzhiyun  *		Ross Biro
14*4882a593Smuzhiyun  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
15*4882a593Smuzhiyun  *		Florian La Roche,
16*4882a593Smuzhiyun  *		Jonathan Layes <layes@loran.com>
17*4882a593Smuzhiyun  *		Arnaldo Carvalho de Melo <acme@conectiva.com.br> ARPHRD_HWX25
18*4882a593Smuzhiyun  *
19*4882a593Smuzhiyun  *		This program is free software; you can redistribute it and/or
20*4882a593Smuzhiyun  *		modify it under the terms of the GNU General Public License
21*4882a593Smuzhiyun  *		as published by the Free Software Foundation; either version
22*4882a593Smuzhiyun  *		2 of the License, or (at your option) any later version.
23*4882a593Smuzhiyun  */
24*4882a593Smuzhiyun #ifndef _UAPI_LINUX_IF_ARP_H
25*4882a593Smuzhiyun #define _UAPI_LINUX_IF_ARP_H
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #include <linux/netdevice.h>
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun /* ARP protocol HARDWARE identifiers. */
30*4882a593Smuzhiyun #define ARPHRD_NETROM	0		/* from KA9Q: NET/ROM pseudo	*/
31*4882a593Smuzhiyun #define ARPHRD_ETHER 	1		/* Ethernet 10Mbps		*/
32*4882a593Smuzhiyun #define	ARPHRD_EETHER	2		/* Experimental Ethernet	*/
33*4882a593Smuzhiyun #define	ARPHRD_AX25	3		/* AX.25 Level 2		*/
34*4882a593Smuzhiyun #define	ARPHRD_PRONET	4		/* PROnet token ring		*/
35*4882a593Smuzhiyun #define	ARPHRD_CHAOS	5		/* Chaosnet			*/
36*4882a593Smuzhiyun #define	ARPHRD_IEEE802	6		/* IEEE 802.2 Ethernet/TR/TB	*/
37*4882a593Smuzhiyun #define	ARPHRD_ARCNET	7		/* ARCnet			*/
38*4882a593Smuzhiyun #define	ARPHRD_APPLETLK	8		/* APPLEtalk			*/
39*4882a593Smuzhiyun #define ARPHRD_DLCI	15		/* Frame Relay DLCI		*/
40*4882a593Smuzhiyun #define ARPHRD_ATM	19		/* ATM 				*/
41*4882a593Smuzhiyun #define ARPHRD_METRICOM	23		/* Metricom STRIP (new IANA id)	*/
42*4882a593Smuzhiyun #define	ARPHRD_IEEE1394	24		/* IEEE 1394 IPv4 - RFC 2734	*/
43*4882a593Smuzhiyun #define ARPHRD_EUI64	27		/* EUI-64                       */
44*4882a593Smuzhiyun #define ARPHRD_INFINIBAND 32		/* InfiniBand			*/
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun /* Dummy types for non ARP hardware */
47*4882a593Smuzhiyun #define ARPHRD_SLIP	256
48*4882a593Smuzhiyun #define ARPHRD_CSLIP	257
49*4882a593Smuzhiyun #define ARPHRD_SLIP6	258
50*4882a593Smuzhiyun #define ARPHRD_CSLIP6	259
51*4882a593Smuzhiyun #define ARPHRD_RSRVD	260		/* Notional KISS type 		*/
52*4882a593Smuzhiyun #define ARPHRD_ADAPT	264
53*4882a593Smuzhiyun #define ARPHRD_ROSE	270
54*4882a593Smuzhiyun #define ARPHRD_X25	271		/* CCITT X.25			*/
55*4882a593Smuzhiyun #define ARPHRD_HWX25	272		/* Boards with X.25 in firmware	*/
56*4882a593Smuzhiyun #define ARPHRD_CAN	280		/* Controller Area Network      */
57*4882a593Smuzhiyun #define ARPHRD_PPP	512
58*4882a593Smuzhiyun #define ARPHRD_CISCO	513		/* Cisco HDLC	 		*/
59*4882a593Smuzhiyun #define ARPHRD_HDLC	ARPHRD_CISCO
60*4882a593Smuzhiyun #define ARPHRD_LAPB	516		/* LAPB				*/
61*4882a593Smuzhiyun #define ARPHRD_DDCMP    517		/* Digital's DDCMP protocol     */
62*4882a593Smuzhiyun #define ARPHRD_RAWHDLC	518		/* Raw HDLC			*/
63*4882a593Smuzhiyun #define ARPHRD_RAWIP    519		/* Raw IP                       */
64*4882a593Smuzhiyun 
65*4882a593Smuzhiyun #define ARPHRD_TUNNEL	768		/* IPIP tunnel			*/
66*4882a593Smuzhiyun #define ARPHRD_TUNNEL6	769		/* IP6IP6 tunnel       		*/
67*4882a593Smuzhiyun #define ARPHRD_FRAD	770             /* Frame Relay Access Device    */
68*4882a593Smuzhiyun #define ARPHRD_SKIP	771		/* SKIP vif			*/
69*4882a593Smuzhiyun #define ARPHRD_LOOPBACK	772		/* Loopback device		*/
70*4882a593Smuzhiyun #define ARPHRD_LOCALTLK 773		/* Localtalk device		*/
71*4882a593Smuzhiyun #define ARPHRD_FDDI	774		/* Fiber Distributed Data Interface */
72*4882a593Smuzhiyun #define ARPHRD_BIF      775             /* AP1000 BIF                   */
73*4882a593Smuzhiyun #define ARPHRD_SIT	776		/* sit0 device - IPv6-in-IPv4	*/
74*4882a593Smuzhiyun #define ARPHRD_IPDDP	777		/* IP over DDP tunneller	*/
75*4882a593Smuzhiyun #define ARPHRD_IPGRE	778		/* GRE over IP			*/
76*4882a593Smuzhiyun #define ARPHRD_PIMREG	779		/* PIMSM register interface	*/
77*4882a593Smuzhiyun #define ARPHRD_HIPPI	780		/* High Performance Parallel Interface */
78*4882a593Smuzhiyun #define ARPHRD_ASH	781		/* Nexus 64Mbps Ash		*/
79*4882a593Smuzhiyun #define ARPHRD_ECONET	782		/* Acorn Econet			*/
80*4882a593Smuzhiyun #define ARPHRD_IRDA 	783		/* Linux-IrDA			*/
81*4882a593Smuzhiyun /* ARP works differently on different FC media .. so  */
82*4882a593Smuzhiyun #define ARPHRD_FCPP	784		/* Point to point fibrechannel	*/
83*4882a593Smuzhiyun #define ARPHRD_FCAL	785		/* Fibrechannel arbitrated loop */
84*4882a593Smuzhiyun #define ARPHRD_FCPL	786		/* Fibrechannel public loop	*/
85*4882a593Smuzhiyun #define ARPHRD_FCFABRIC	787		/* Fibrechannel fabric		*/
86*4882a593Smuzhiyun 	/* 787->799 reserved for fibrechannel media types */
87*4882a593Smuzhiyun #define ARPHRD_IEEE802_TR 800		/* Magic type ident for TR	*/
88*4882a593Smuzhiyun #define ARPHRD_IEEE80211 801		/* IEEE 802.11			*/
89*4882a593Smuzhiyun #define ARPHRD_IEEE80211_PRISM 802	/* IEEE 802.11 + Prism2 header  */
90*4882a593Smuzhiyun #define ARPHRD_IEEE80211_RADIOTAP 803	/* IEEE 802.11 + radiotap header */
91*4882a593Smuzhiyun #define ARPHRD_IEEE802154	  804
92*4882a593Smuzhiyun #define ARPHRD_IEEE802154_MONITOR 805	/* IEEE 802.15.4 network monitor */
93*4882a593Smuzhiyun 
94*4882a593Smuzhiyun #define ARPHRD_PHONET	820		/* PhoNet media type		*/
95*4882a593Smuzhiyun #define ARPHRD_PHONET_PIPE 821		/* PhoNet pipe header		*/
96*4882a593Smuzhiyun #define ARPHRD_CAIF	822		/* CAIF media type		*/
97*4882a593Smuzhiyun #define ARPHRD_IP6GRE	823		/* GRE over IPv6		*/
98*4882a593Smuzhiyun #define ARPHRD_NETLINK	824		/* Netlink header		*/
99*4882a593Smuzhiyun #define ARPHRD_6LOWPAN	825		/* IPv6 over LoWPAN             */
100*4882a593Smuzhiyun #define ARPHRD_VSOCKMON	826		/* Vsock monitor header		*/
101*4882a593Smuzhiyun 
102*4882a593Smuzhiyun #define ARPHRD_VOID	  0xFFFF	/* Void type, nothing is known */
103*4882a593Smuzhiyun #define ARPHRD_NONE	  0xFFFE	/* zero header length */
104*4882a593Smuzhiyun 
105*4882a593Smuzhiyun /* ARP protocol opcodes. */
106*4882a593Smuzhiyun #define	ARPOP_REQUEST	1		/* ARP request			*/
107*4882a593Smuzhiyun #define	ARPOP_REPLY	2		/* ARP reply			*/
108*4882a593Smuzhiyun #define	ARPOP_RREQUEST	3		/* RARP request			*/
109*4882a593Smuzhiyun #define	ARPOP_RREPLY	4		/* RARP reply			*/
110*4882a593Smuzhiyun #define	ARPOP_InREQUEST	8		/* InARP request		*/
111*4882a593Smuzhiyun #define	ARPOP_InREPLY	9		/* InARP reply			*/
112*4882a593Smuzhiyun #define	ARPOP_NAK	10		/* (ATM)ARP NAK			*/
113*4882a593Smuzhiyun 
114*4882a593Smuzhiyun 
115*4882a593Smuzhiyun /* ARP ioctl request. */
116*4882a593Smuzhiyun struct arpreq {
117*4882a593Smuzhiyun 	struct sockaddr	arp_pa;		/* protocol address		 */
118*4882a593Smuzhiyun 	struct sockaddr	arp_ha;		/* hardware address		 */
119*4882a593Smuzhiyun 	int		arp_flags;	/* flags			 */
120*4882a593Smuzhiyun 	struct sockaddr arp_netmask;    /* netmask (only for proxy arps) */
121*4882a593Smuzhiyun 	char		arp_dev[IFNAMSIZ];
122*4882a593Smuzhiyun };
123*4882a593Smuzhiyun 
124*4882a593Smuzhiyun struct arpreq_old {
125*4882a593Smuzhiyun 	struct sockaddr	arp_pa;		/* protocol address		 */
126*4882a593Smuzhiyun 	struct sockaddr	arp_ha;		/* hardware address		 */
127*4882a593Smuzhiyun 	int		arp_flags;	/* flags			 */
128*4882a593Smuzhiyun 	struct sockaddr	arp_netmask;    /* netmask (only for proxy arps) */
129*4882a593Smuzhiyun };
130*4882a593Smuzhiyun 
131*4882a593Smuzhiyun /* ARP Flag values. */
132*4882a593Smuzhiyun #define ATF_COM		0x02		/* completed entry (ha valid)	*/
133*4882a593Smuzhiyun #define	ATF_PERM	0x04		/* permanent entry		*/
134*4882a593Smuzhiyun #define	ATF_PUBL	0x08		/* publish entry		*/
135*4882a593Smuzhiyun #define	ATF_USETRAILERS	0x10		/* has requested trailers	*/
136*4882a593Smuzhiyun #define ATF_NETMASK     0x20            /* want to use a netmask (only
137*4882a593Smuzhiyun 					   for proxy entries) */
138*4882a593Smuzhiyun #define ATF_DONTPUB	0x40		/* don't answer this addresses	*/
139*4882a593Smuzhiyun 
140*4882a593Smuzhiyun /*
141*4882a593Smuzhiyun  *	This structure defines an ethernet arp header.
142*4882a593Smuzhiyun  */
143*4882a593Smuzhiyun 
144*4882a593Smuzhiyun struct arphdr {
145*4882a593Smuzhiyun 	__be16		ar_hrd;		/* format of hardware address	*/
146*4882a593Smuzhiyun 	__be16		ar_pro;		/* format of protocol address	*/
147*4882a593Smuzhiyun 	unsigned char	ar_hln;		/* length of hardware address	*/
148*4882a593Smuzhiyun 	unsigned char	ar_pln;		/* length of protocol address	*/
149*4882a593Smuzhiyun 	__be16		ar_op;		/* ARP opcode (command)		*/
150*4882a593Smuzhiyun 
151*4882a593Smuzhiyun #if 0
152*4882a593Smuzhiyun 	 /*
153*4882a593Smuzhiyun 	  *	 Ethernet looks like this : This bit is variable sized however...
154*4882a593Smuzhiyun 	  */
155*4882a593Smuzhiyun 	unsigned char		ar_sha[ETH_ALEN];	/* sender hardware address	*/
156*4882a593Smuzhiyun 	unsigned char		ar_sip[4];		/* sender IP address		*/
157*4882a593Smuzhiyun 	unsigned char		ar_tha[ETH_ALEN];	/* target hardware address	*/
158*4882a593Smuzhiyun 	unsigned char		ar_tip[4];		/* target IP address		*/
159*4882a593Smuzhiyun #endif
160*4882a593Smuzhiyun 
161*4882a593Smuzhiyun };
162*4882a593Smuzhiyun 
163*4882a593Smuzhiyun 
164*4882a593Smuzhiyun #endif /* _UAPI_LINUX_IF_ARP_H */
165