if_arp.h 2.9 KB

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