1/* Nonstandard header */ 2#ifndef _NET_IF_ARP_H 3#define _NET_IF_ARP_H 4#ifdef __cplusplus 5extern "C" { 6#endif 7 8#include <inttypes.h> 9#include <sys/types.h> 10#include <sys/socket.h> 11 12#define MAX_ADDR_LEN 7 13 14#define ARPOP_REQUEST 1 15#define ARPOP_REPLY 2 16#define ARPOP_RREQUEST 3 17#define ARPOP_RREPLY 4 18#define ARPOP_InREQUEST 8 19#define ARPOP_InREPLY 9 20#define ARPOP_NAK 10 21 22struct arphdr { 23 uint16_t ar_hrd; 24 uint16_t ar_pro; 25 uint8_t ar_hln; 26 uint8_t ar_pln; 27 uint16_t ar_op; 28}; 29 30 31#define ARPHRD_NETROM 0 32#define ARPHRD_ETHER 1 33#define ARPHRD_EETHER 2 34#define ARPHRD_AX25 3 35#define ARPHRD_PRONET 4 36#define ARPHRD_CHAOS 5 37#define ARPHRD_IEEE802 6 38#define ARPHRD_ARCNET 7 39#define ARPHRD_APPLETLK 8 40#define ARPHRD_DLCI 15 41#define ARPHRD_ATM 19 42#define ARPHRD_METRICOM 23 43#define ARPHRD_IEEE1394 24 44#define ARPHRD_EUI64 27 45#define ARPHRD_INFINIBAND 32 46#define ARPHRD_SLIP 256 47#define ARPHRD_CSLIP 257 48#define ARPHRD_SLIP6 258 49#define ARPHRD_CSLIP6 259 50#define ARPHRD_RSRVD 260 51#define ARPHRD_ADAPT 264 52#define ARPHRD_ROSE 270 53#define ARPHRD_X25 271 54#define ARPHRD_HWX25 272 55#define ARPHRD_CAN 280 56#define ARPHRD_PPP 512 57#define ARPHRD_CISCO 513 58#define ARPHRD_HDLC ARPHRD_CISCO 59#define ARPHRD_LAPB 516 60#define ARPHRD_DDCMP 517 61#define ARPHRD_RAWHDLC 518 62 63#define ARPHRD_TUNNEL 768 64#define ARPHRD_TUNNEL6 769 65#define ARPHRD_FRAD 770 66#define ARPHRD_SKIP 771 67#define ARPHRD_LOOPBACK 772 68#define ARPHRD_LOCALTLK 773 69#define ARPHRD_FDDI 774 70#define ARPHRD_BIF 775 71#define ARPHRD_SIT 776 72#define ARPHRD_IPDDP 777 73#define ARPHRD_IPGRE 778 74#define ARPHRD_PIMREG 779 75#define ARPHRD_HIPPI 780 76#define ARPHRD_ASH 781 77#define ARPHRD_ECONET 782 78#define ARPHRD_IRDA 783 79#define ARPHRD_FCPP 784 80#define ARPHRD_FCAL 785 81#define ARPHRD_FCPL 786 82#define ARPHRD_FCFABRIC 787 83#define ARPHRD_IEEE802_TR 800 84#define ARPHRD_IEEE80211 801 85#define ARPHRD_IEEE80211_PRISM 802 86#define ARPHRD_IEEE80211_RADIOTAP 803 87#define ARPHRD_IEEE802154 804 88#define ARPHRD_IEEE802154_MONITOR 805 89#define ARPHRD_PHONET 820 90#define ARPHRD_PHONET_PIPE 821 91#define ARPHRD_CAIF 822 92#define ARPHRD_IP6GRE 823 93#define ARPHRD_NETLINK 824 94#define ARPHRD_6LOWPAN 825 95 96#define ARPHRD_VOID 0xFFFF 97#define ARPHRD_NONE 0xFFFE 98 99struct arpreq { 100 struct sockaddr arp_pa; 101 struct sockaddr arp_ha; 102 int arp_flags; 103 struct sockaddr arp_netmask; 104 char arp_dev[16]; 105}; 106 107struct arpreq_old { 108 struct sockaddr arp_pa; 109 struct sockaddr arp_ha; 110 int arp_flags; 111 struct sockaddr arp_netmask; 112}; 113 114#define ATF_COM 0x02 115#define ATF_PERM 0x04 116#define ATF_PUBL 0x08 117#define ATF_USETRAILERS 0x10 118#define ATF_NETMASK 0x20 119#define ATF_DONTPUB 0x40 120#define ATF_MAGIC 0x80 121 122#define ARPD_UPDATE 0x01 123#define ARPD_LOOKUP 0x02 124#define ARPD_FLUSH 0x03 125 126struct arpd_request { 127 unsigned short req; 128 uint32_t ip; 129 unsigned long dev; 130 unsigned long stamp; 131 unsigned long updated; 132 unsigned char ha[MAX_ADDR_LEN]; 133}; 134 135 136 137#ifdef __cplusplus 138} 139#endif 140#endif 141