1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _UAPI_LINUX_ICMPV6_H
3 #define _UAPI_LINUX_ICMPV6_H
5 #include <linux/types.h>
6 #include <asm/byteorder.h>
25 struct icmpv6_nd_advt
{
26 #if defined(__LITTLE_ENDIAN_BITFIELD)
32 #elif defined(__BIG_ENDIAN_BITFIELD)
38 #error "Please fix <asm/byteorder.h>"
44 #if defined(__LITTLE_ENDIAN_BITFIELD)
51 #elif defined(__BIG_ENDIAN_BITFIELD)
58 #error "Please fix <asm/byteorder.h>"
65 #define icmp6_identifier icmp6_dataun.u_echo.identifier
66 #define icmp6_sequence icmp6_dataun.u_echo.sequence
67 #define icmp6_pointer icmp6_dataun.un_data32[0]
68 #define icmp6_mtu icmp6_dataun.un_data32[0]
69 #define icmp6_unused icmp6_dataun.un_data32[0]
70 #define icmp6_maxdelay icmp6_dataun.un_data16[0]
71 #define icmp6_router icmp6_dataun.u_nd_advt.router
72 #define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
73 #define icmp6_override icmp6_dataun.u_nd_advt.override
74 #define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
75 #define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
76 #define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
77 #define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
78 #define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
79 #define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
83 #define ICMPV6_ROUTER_PREF_LOW 0x3
84 #define ICMPV6_ROUTER_PREF_MEDIUM 0x0
85 #define ICMPV6_ROUTER_PREF_HIGH 0x1
86 #define ICMPV6_ROUTER_PREF_INVALID 0x2
88 #define ICMPV6_DEST_UNREACH 1
89 #define ICMPV6_PKT_TOOBIG 2
90 #define ICMPV6_TIME_EXCEED 3
91 #define ICMPV6_PARAMPROB 4
93 #define ICMPV6_INFOMSG_MASK 0x80
95 #define ICMPV6_ECHO_REQUEST 128
96 #define ICMPV6_ECHO_REPLY 129
97 #define ICMPV6_MGM_QUERY 130
98 #define ICMPV6_MGM_REPORT 131
99 #define ICMPV6_MGM_REDUCTION 132
101 #define ICMPV6_NI_QUERY 139
102 #define ICMPV6_NI_REPLY 140
104 #define ICMPV6_MLD2_REPORT 143
106 #define ICMPV6_DHAAD_REQUEST 144
107 #define ICMPV6_DHAAD_REPLY 145
108 #define ICMPV6_MOBILE_PREFIX_SOL 146
109 #define ICMPV6_MOBILE_PREFIX_ADV 147
112 * Codes for Destination Unreachable
114 #define ICMPV6_NOROUTE 0
115 #define ICMPV6_ADM_PROHIBITED 1
116 #define ICMPV6_NOT_NEIGHBOUR 2
117 #define ICMPV6_ADDR_UNREACH 3
118 #define ICMPV6_PORT_UNREACH 4
119 #define ICMPV6_POLICY_FAIL 5
120 #define ICMPV6_REJECT_ROUTE 6
123 * Codes for Time Exceeded
125 #define ICMPV6_EXC_HOPLIMIT 0
126 #define ICMPV6_EXC_FRAGTIME 1
129 * Codes for Parameter Problem
131 #define ICMPV6_HDR_FIELD 0
132 #define ICMPV6_UNK_NEXTHDR 1
133 #define ICMPV6_UNK_OPTION 2
136 * constants for (set|get)sockopt
139 #define ICMPV6_FILTER 1
145 #define ICMPV6_FILTER_BLOCK 1
146 #define ICMPV6_FILTER_PASS 2
147 #define ICMPV6_FILTER_BLOCKOTHERS 3
148 #define ICMPV6_FILTER_PASSONLY 4
150 struct icmp6_filter
{
155 * Definitions for MLDv2
157 #define MLD2_MODE_IS_INCLUDE 1
158 #define MLD2_MODE_IS_EXCLUDE 2
159 #define MLD2_CHANGE_TO_INCLUDE 3
160 #define MLD2_CHANGE_TO_EXCLUDE 4
161 #define MLD2_ALLOW_NEW_SOURCES 5
162 #define MLD2_BLOCK_OLD_SOURCES 6
164 #define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
167 #endif /* _UAPI_LINUX_ICMPV6_H */