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