|
| 1 | +/**************************************************************************** |
| 2 | + * include/net/if_arp.h |
| 3 | + * |
| 4 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 5 | + * contributor license agreements. See the NOTICE file distributed with |
| 6 | + * this work for additional information regarding copyright ownership. The |
| 7 | + * ASF licenses this file to you under the Apache License, Version 2.0 (the |
| 8 | + * "License"); you may not use this file except in compliance with the |
| 9 | + * License. You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 16 | + * License for the specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + * |
| 19 | + ****************************************************************************/ |
| 20 | + |
| 21 | +#ifndef __INCLUDE_NET_IF_ARP_H |
| 22 | +#define __INCLUDE_NET_IF_ARP_H |
| 23 | + |
| 24 | +/**************************************************************************** |
| 25 | + * Pre-processor Definitions |
| 26 | + ****************************************************************************/ |
| 27 | + |
| 28 | +/* ARP protocol HARDWARE identifiers. */ |
| 29 | + |
| 30 | +#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */ |
| 31 | +#define ARPHRD_ETHER 1 /* Ethernet */ |
| 32 | +#define ARPHRD_EETHER 2 /* Experimental Ethernet */ |
| 33 | +#define ARPHRD_AX25 3 /* AX.25 Level 2 */ |
| 34 | +#define ARPHRD_PRONET 4 /* PROnet token ring */ |
| 35 | +#define ARPHRD_CHAOS 5 /* Chaosnet */ |
| 36 | +#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */ |
| 37 | +#define ARPHRD_ARCNET 7 /* ARCnet */ |
| 38 | +#define ARPHRD_APPLETLK 8 /* APPLEtalk */ |
| 39 | +#define ARPHRD_DLCI 15 /* Frame Relay DLCI */ |
| 40 | +#define ARPHRD_ATM 19 /* ATM */ |
| 41 | +#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */ |
| 42 | +#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */ |
| 43 | +#define ARPHRD_EUI64 27 /* EUI-64 */ |
| 44 | +#define ARPHRD_INFINIBAND 32 /* InfiniBand */ |
| 45 | + |
| 46 | +/* Dummy types for non ARP hardware */ |
| 47 | +#define ARPHRD_SLIP 256 |
| 48 | +#define ARPHRD_CSLIP 257 |
| 49 | +#define ARPHRD_SLIP6 258 |
| 50 | +#define ARPHRD_CSLIP6 259 |
| 51 | +#define ARPHRD_RSRVD 260 /* Notional KISS type */ |
| 52 | +#define ARPHRD_ADAPT 264 |
| 53 | +#define ARPHRD_ROSE 270 |
| 54 | +#define ARPHRD_X25 271 /* CCITT X.25 */ |
| 55 | +#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */ |
| 56 | +#define ARPHRD_CAN 280 /* Controller Area Network */ |
| 57 | +#define ARPHRD_PPP 512 |
| 58 | +#define ARPHRD_CISCO 513 /* Cisco HDLC */ |
| 59 | +#define ARPHRD_HDLC ARPHRD_CISCO |
| 60 | +#define ARPHRD_LAPB 516 /* LAPB */ |
| 61 | +#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */ |
| 62 | +#define ARPHRD_RAWHDLC 518 /* Raw HDLC */ |
| 63 | +#define ARPHRD_RAWIP 519 /* Raw IP */ |
| 64 | +#define ARPHRD_TUNNEL 768 /* IPIP tunnel */ |
| 65 | +#define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */ |
| 66 | +#define ARPHRD_FRAD 770 /* Frame Relay Access Device */ |
| 67 | +#define ARPHRD_SKIP 771 /* SKIP vif */ |
| 68 | +#define ARPHRD_LOOPBACK 772 /* Loopback device */ |
| 69 | +#define ARPHRD_LOCALTLK 773 /* Localtalk device */ |
| 70 | +#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */ |
| 71 | +#define ARPHRD_BIF 775 /* AP1000 BIF */ |
| 72 | +#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */ |
| 73 | +#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */ |
| 74 | +#define ARPHRD_IPGRE 778 /* GRE over IP */ |
| 75 | +#define ARPHRD_PIMREG 779 /* PIMSM register interface */ |
| 76 | +#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */ |
| 77 | +#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */ |
| 78 | +#define ARPHRD_ECONET 782 /* Acorn Econet */ |
| 79 | +#define ARPHRD_IRDA 783 /* Linux-IrDA */ |
| 80 | + |
| 81 | +/* ARP works differently on different FC media .. so */ |
| 82 | + |
| 83 | +#define ARPHRD_FCPP 784 /* Point to point fibrechannel */ |
| 84 | +#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */ |
| 85 | +#define ARPHRD_FCPL 786 /* Fibrechannel public loop */ |
| 86 | +#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */ |
| 87 | + |
| 88 | +/* 787->799 reserved for fibrechannel media types */ |
| 89 | + |
| 90 | +#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ |
| 91 | +#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ |
| 92 | +#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ |
| 93 | +#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ |
| 94 | +#define ARPHRD_IEEE802154 804 /* IEEE 802.15.4 */ |
| 95 | +#define ARPHRD_IEEE802154_MONITOR 805 /* IEEE 802.15.4 network monitor */ |
| 96 | + |
| 97 | +#define ARPHRD_PHONET 820 /* PhoNet media type */ |
| 98 | +#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ |
| 99 | +#define ARPHRD_CAIF 822 /* CAIF media type */ |
| 100 | +#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */ |
| 101 | +#define ARPHRD_NETLINK 824 /* Netlink header */ |
| 102 | +#define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */ |
| 103 | +#define ARPHRD_VSOCKMON 826 /* Vsock monitor header */ |
| 104 | + |
| 105 | +#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ |
| 106 | +#define ARPHRD_NONE 0xFFFE /* zero header length */ |
| 107 | + |
| 108 | +/* ARP protocol opcodes. */ |
| 109 | + |
| 110 | +#define ARPOP_REQUEST 1 /* ARP request */ |
| 111 | +#define ARPOP_REPLY 2 /* ARP reply */ |
| 112 | +#define ARPOP_RREQUEST 3 /* RARP request */ |
| 113 | +#define ARPOP_RREPLY 4 /* RARP reply */ |
| 114 | +#define ARPOP_InREQUEST 8 /* InARP request */ |
| 115 | +#define ARPOP_InREPLY 9 /* InARP reply */ |
| 116 | +#define ARPOP_NAK 10 /* (ATM)ARP NAK */ |
| 117 | + |
| 118 | +/* See RFC 826 for protocol description. ARP packets are variable |
| 119 | + * in size; the arphdr structure defines the fixed-length portion. |
| 120 | + * Protocol type values are the same as those for 10 Mb/s Ethernet. |
| 121 | + * It is followed by the variable-sized fields ar_sha, arp_spa, |
| 122 | + * arp_tha and arp_tpa in that order, according to the lengths |
| 123 | + * specified. Field names used correspond to RFC 826. |
| 124 | + */ |
| 125 | + |
| 126 | +struct arphdr |
| 127 | +{ |
| 128 | + unsigned short int ar_hrd; /* Format of hardware address. */ |
| 129 | + unsigned short int ar_pro; /* Format of protocol address. */ |
| 130 | + unsigned char ar_hln; /* Length of hardware address. */ |
| 131 | + unsigned char ar_pln; /* Length of protocol address. */ |
| 132 | + unsigned short int ar_op; /* ARP opcode (command). */ |
| 133 | +}; |
| 134 | + |
| 135 | +#endif /* __INCLUDE_NET_IF_ARP_H */ |
0 commit comments