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