if_arp.h 6.4 KB

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