logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

icmpv6.h (4300B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _LINUX_ICMPV6_H
  3. #define _LINUX_ICMPV6_H
  4. #include <linux/types.h>
  5. #include <asm/byteorder.h>
  6. struct icmp6hdr {
  7. __u8 icmp6_type;
  8. __u8 icmp6_code;
  9. __sum16 icmp6_cksum;
  10. union {
  11. __be32 un_data32[1];
  12. __be16 un_data16[2];
  13. __u8 un_data8[4];
  14. struct icmpv6_echo {
  15. __be16 identifier;
  16. __be16 sequence;
  17. } u_echo;
  18. struct icmpv6_nd_advt {
  19. #if defined(__LITTLE_ENDIAN_BITFIELD)
  20. __u32 reserved:5,
  21. override:1,
  22. solicited:1,
  23. router:1,
  24. reserved2:24;
  25. #elif defined(__BIG_ENDIAN_BITFIELD)
  26. __u32 router:1,
  27. solicited:1,
  28. override:1,
  29. reserved:29;
  30. #else
  31. #error "Please fix <asm/byteorder.h>"
  32. #endif
  33. } u_nd_advt;
  34. struct icmpv6_nd_ra {
  35. __u8 hop_limit;
  36. #if defined(__LITTLE_ENDIAN_BITFIELD)
  37. __u8 reserved:3,
  38. router_pref:2,
  39. home_agent:1,
  40. other:1,
  41. managed:1;
  42. #elif defined(__BIG_ENDIAN_BITFIELD)
  43. __u8 managed:1,
  44. other:1,
  45. home_agent:1,
  46. router_pref:2,
  47. reserved:3;
  48. #else
  49. #error "Please fix <asm/byteorder.h>"
  50. #endif
  51. __be16 rt_lifetime;
  52. } u_nd_ra;
  53. } icmp6_dataun;
  54. #define icmp6_identifier icmp6_dataun.u_echo.identifier
  55. #define icmp6_sequence icmp6_dataun.u_echo.sequence
  56. #define icmp6_pointer icmp6_dataun.un_data32[0]
  57. #define icmp6_mtu icmp6_dataun.un_data32[0]
  58. #define icmp6_unused icmp6_dataun.un_data32[0]
  59. #define icmp6_maxdelay icmp6_dataun.un_data16[0]
  60. #define icmp6_datagram_len icmp6_dataun.un_data8[0]
  61. #define icmp6_router icmp6_dataun.u_nd_advt.router
  62. #define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
  63. #define icmp6_override icmp6_dataun.u_nd_advt.override
  64. #define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
  65. #define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
  66. #define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
  67. #define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
  68. #define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
  69. #define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
  70. };
  71. #define ICMPV6_ROUTER_PREF_LOW 0x3
  72. #define ICMPV6_ROUTER_PREF_MEDIUM 0x0
  73. #define ICMPV6_ROUTER_PREF_HIGH 0x1
  74. #define ICMPV6_ROUTER_PREF_INVALID 0x2
  75. #define ICMPV6_DEST_UNREACH 1
  76. #define ICMPV6_PKT_TOOBIG 2
  77. #define ICMPV6_TIME_EXCEED 3
  78. #define ICMPV6_PARAMPROB 4
  79. #define ICMPV6_ERRMSG_MAX 127
  80. #define ICMPV6_INFOMSG_MASK 0x80
  81. #define ICMPV6_ECHO_REQUEST 128
  82. #define ICMPV6_ECHO_REPLY 129
  83. #define ICMPV6_MGM_QUERY 130
  84. #define ICMPV6_MGM_REPORT 131
  85. #define ICMPV6_MGM_REDUCTION 132
  86. #define ICMPV6_NI_QUERY 139
  87. #define ICMPV6_NI_REPLY 140
  88. #define ICMPV6_MLD2_REPORT 143
  89. #define ICMPV6_DHAAD_REQUEST 144
  90. #define ICMPV6_DHAAD_REPLY 145
  91. #define ICMPV6_MOBILE_PREFIX_SOL 146
  92. #define ICMPV6_MOBILE_PREFIX_ADV 147
  93. #define ICMPV6_MRDISC_ADV 151
  94. #define ICMPV6_MRDISC_SOL 152
  95. #define ICMPV6_MSG_MAX 255
  96. /*
  97. * Codes for Destination Unreachable
  98. */
  99. #define ICMPV6_NOROUTE 0
  100. #define ICMPV6_ADM_PROHIBITED 1
  101. #define ICMPV6_NOT_NEIGHBOUR 2
  102. #define ICMPV6_ADDR_UNREACH 3
  103. #define ICMPV6_PORT_UNREACH 4
  104. #define ICMPV6_POLICY_FAIL 5
  105. #define ICMPV6_REJECT_ROUTE 6
  106. /*
  107. * Codes for Time Exceeded
  108. */
  109. #define ICMPV6_EXC_HOPLIMIT 0
  110. #define ICMPV6_EXC_FRAGTIME 1
  111. /*
  112. * Codes for Parameter Problem
  113. */
  114. #define ICMPV6_HDR_FIELD 0
  115. #define ICMPV6_UNK_NEXTHDR 1
  116. #define ICMPV6_UNK_OPTION 2
  117. #define ICMPV6_HDR_INCOMP 3
  118. /* Codes for EXT_ECHO (PROBE) */
  119. #define ICMPV6_EXT_ECHO_REQUEST 160
  120. #define ICMPV6_EXT_ECHO_REPLY 161
  121. /*
  122. * constants for (set|get)sockopt
  123. */
  124. #define ICMPV6_FILTER 1
  125. /*
  126. * ICMPV6 filter
  127. */
  128. #define ICMPV6_FILTER_BLOCK 1
  129. #define ICMPV6_FILTER_PASS 2
  130. #define ICMPV6_FILTER_BLOCKOTHERS 3
  131. #define ICMPV6_FILTER_PASSONLY 4
  132. struct icmp6_filter {
  133. __u32 data[8];
  134. };
  135. /*
  136. * Definitions for MLDv2
  137. */
  138. #define MLD2_MODE_IS_INCLUDE 1
  139. #define MLD2_MODE_IS_EXCLUDE 2
  140. #define MLD2_CHANGE_TO_INCLUDE 3
  141. #define MLD2_CHANGE_TO_EXCLUDE 4
  142. #define MLD2_ALLOW_NEW_SOURCES 5
  143. #define MLD2_BLOCK_OLD_SOURCES 6
  144. #define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
  145. #endif /* _LINUX_ICMPV6_H */