icmp6.h revision 1.59 1 1.59 knakahar /* $NetBSD: icmp6.h,v 1.59 2022/08/29 09:14:02 knakahara Exp $ */
2 1.26 itojun /* $KAME: icmp6.h,v 1.84 2003/04/23 10:26:51 itojun Exp $ */
3 1.26 itojun
4 1.3 thorpej
5 1.2 itojun /*
6 1.2 itojun * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7 1.2 itojun * All rights reserved.
8 1.9 itojun *
9 1.2 itojun * Redistribution and use in source and binary forms, with or without
10 1.2 itojun * modification, are permitted provided that the following conditions
11 1.2 itojun * are met:
12 1.2 itojun * 1. Redistributions of source code must retain the above copyright
13 1.2 itojun * notice, this list of conditions and the following disclaimer.
14 1.2 itojun * 2. Redistributions in binary form must reproduce the above copyright
15 1.2 itojun * notice, this list of conditions and the following disclaimer in the
16 1.2 itojun * documentation and/or other materials provided with the distribution.
17 1.2 itojun * 3. Neither the name of the project nor the names of its contributors
18 1.2 itojun * may be used to endorse or promote products derived from this software
19 1.2 itojun * without specific prior written permission.
20 1.9 itojun *
21 1.2 itojun * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22 1.2 itojun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.2 itojun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.2 itojun * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25 1.2 itojun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.2 itojun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.2 itojun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.2 itojun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.2 itojun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.2 itojun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.2 itojun * SUCH DAMAGE.
32 1.2 itojun */
33 1.2 itojun
34 1.4 itojun /*
35 1.4 itojun * Copyright (c) 1982, 1986, 1993
36 1.4 itojun * The Regents of the University of California. All rights reserved.
37 1.4 itojun *
38 1.4 itojun * Redistribution and use in source and binary forms, with or without
39 1.4 itojun * modification, are permitted provided that the following conditions
40 1.4 itojun * are met:
41 1.4 itojun * 1. Redistributions of source code must retain the above copyright
42 1.4 itojun * notice, this list of conditions and the following disclaimer.
43 1.4 itojun * 2. Redistributions in binary form must reproduce the above copyright
44 1.4 itojun * notice, this list of conditions and the following disclaimer in the
45 1.4 itojun * documentation and/or other materials provided with the distribution.
46 1.28 agc * 3. Neither the name of the University nor the names of its contributors
47 1.4 itojun * may be used to endorse or promote products derived from this software
48 1.4 itojun * without specific prior written permission.
49 1.4 itojun *
50 1.4 itojun * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
51 1.4 itojun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52 1.4 itojun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53 1.4 itojun * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
54 1.4 itojun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55 1.4 itojun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
56 1.4 itojun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 1.4 itojun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
58 1.4 itojun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59 1.4 itojun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60 1.4 itojun * SUCH DAMAGE.
61 1.4 itojun *
62 1.4 itojun * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
63 1.4 itojun */
64 1.4 itojun
65 1.2 itojun #ifndef _NETINET_ICMP6_H_
66 1.2 itojun #define _NETINET_ICMP6_H_
67 1.2 itojun
68 1.4 itojun #define ICMPV6_PLD_MAXLEN 1232 /* IPV6_MMTU - sizeof(struct ip6_hdr)
69 1.4 itojun - sizeof(struct icmp6_hdr) */
70 1.4 itojun
71 1.4 itojun struct icmp6_hdr {
72 1.4 itojun u_int8_t icmp6_type; /* type field */
73 1.4 itojun u_int8_t icmp6_code; /* code field */
74 1.4 itojun u_int16_t icmp6_cksum; /* checksum field */
75 1.4 itojun union {
76 1.4 itojun u_int32_t icmp6_un_data32[1]; /* type-specific field */
77 1.4 itojun u_int16_t icmp6_un_data16[2]; /* type-specific field */
78 1.4 itojun u_int8_t icmp6_un_data8[4]; /* type-specific field */
79 1.4 itojun } icmp6_dataun;
80 1.57 roy };
81 1.4 itojun
82 1.4 itojun #define icmp6_data32 icmp6_dataun.icmp6_un_data32
83 1.4 itojun #define icmp6_data16 icmp6_dataun.icmp6_un_data16
84 1.4 itojun #define icmp6_data8 icmp6_dataun.icmp6_un_data8
85 1.4 itojun #define icmp6_pptr icmp6_data32[0] /* parameter prob */
86 1.4 itojun #define icmp6_mtu icmp6_data32[0] /* packet too big */
87 1.4 itojun #define icmp6_id icmp6_data16[0] /* echo request/reply */
88 1.4 itojun #define icmp6_seq icmp6_data16[1] /* echo request/reply */
89 1.4 itojun #define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */
90 1.4 itojun
91 1.4 itojun #define ICMP6_DST_UNREACH 1 /* dest unreachable, codes: */
92 1.4 itojun #define ICMP6_PACKET_TOO_BIG 2 /* packet too big */
93 1.4 itojun #define ICMP6_TIME_EXCEEDED 3 /* time exceeded, code: */
94 1.4 itojun #define ICMP6_PARAM_PROB 4 /* ip6 header bad */
95 1.4 itojun
96 1.4 itojun #define ICMP6_ECHO_REQUEST 128 /* echo service */
97 1.4 itojun #define ICMP6_ECHO_REPLY 129 /* echo reply */
98 1.27 itojun #define MLD_LISTENER_QUERY 130 /* multicast listener query */
99 1.27 itojun #define MLD_LISTENER_REPORT 131 /* multicast listener report */
100 1.27 itojun #define MLD_LISTENER_DONE 132 /* multicast listener done */
101 1.47 christos #define MLD_LISTENER_REDUCTION MLD_LISTENER_DONE /* RFC3542 definition */
102 1.27 itojun
103 1.27 itojun /* RFC2292 decls */
104 1.4 itojun #define ICMP6_MEMBERSHIP_QUERY 130 /* group membership query */
105 1.4 itojun #define ICMP6_MEMBERSHIP_REPORT 131 /* group membership report */
106 1.4 itojun #define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */
107 1.26 itojun
108 1.26 itojun #ifndef _KERNEL
109 1.26 itojun /* the followings are for backward compatibility to old KAME apps. */
110 1.26 itojun #define MLD6_LISTENER_QUERY MLD_LISTENER_QUERY
111 1.26 itojun #define MLD6_LISTENER_REPORT MLD_LISTENER_REPORT
112 1.26 itojun #define MLD6_LISTENER_DONE MLD_LISTENER_DONE
113 1.26 itojun #endif
114 1.4 itojun
115 1.4 itojun #define ND_ROUTER_SOLICIT 133 /* router solicitation */
116 1.35 wiz #define ND_ROUTER_ADVERT 134 /* router advertisement */
117 1.4 itojun #define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */
118 1.35 wiz #define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisement */
119 1.4 itojun #define ND_REDIRECT 137 /* redirect */
120 1.4 itojun
121 1.4 itojun #define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */
122 1.4 itojun
123 1.4 itojun #define ICMP6_WRUREQUEST 139 /* who are you request */
124 1.4 itojun #define ICMP6_WRUREPLY 140 /* who are you reply */
125 1.4 itojun #define ICMP6_FQDN_QUERY 139 /* FQDN query */
126 1.4 itojun #define ICMP6_FQDN_REPLY 140 /* FQDN reply */
127 1.4 itojun #define ICMP6_NI_QUERY 139 /* node information request */
128 1.4 itojun #define ICMP6_NI_REPLY 140 /* node information reply */
129 1.45 spz #define MLDV2_LISTENER_REPORT 143 /* RFC3810 listener report */
130 1.4 itojun
131 1.4 itojun /* The definitions below are experimental. TBA */
132 1.26 itojun #define MLD_MTRACE_RESP 200 /* mtrace response(to sender) */
133 1.26 itojun #define MLD_MTRACE 201 /* mtrace messages */
134 1.26 itojun
135 1.26 itojun #ifndef _KERNEL
136 1.26 itojun /* the followings are for backward compatibility to old KAME apps. */
137 1.26 itojun #define MLD6_MTRACE_RESP MLD_MTRACE_RESP
138 1.26 itojun #define MLD6_MTRACE MLD_MTRACE
139 1.26 itojun #endif
140 1.4 itojun
141 1.21 itojun #define ICMP6_MAXTYPE 201
142 1.4 itojun
143 1.4 itojun #define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
144 1.4 itojun #define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
145 1.4 itojun #define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */
146 1.4 itojun #define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
147 1.4 itojun #define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
148 1.4 itojun #define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */
149 1.45 spz #define ICMP6_DST_UNREACH_POLICY 5 /* source address failed ingress/egress policy */
150 1.45 spz #define ICMP6_DST_UNREACH_REJROUTE 6 /* reject route to destination */
151 1.45 spz #define ICMP6_DST_UNREACH_SOURCERT 7 /* error in source routing header */
152 1.4 itojun
153 1.4 itojun #define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */
154 1.4 itojun #define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */
155 1.4 itojun
156 1.4 itojun #define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */
157 1.4 itojun #define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */
158 1.4 itojun #define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */
159 1.51 maxv #define ICMP6_PARAMPROB_FRAGMENT 3 /* incomplete chain in frag */
160 1.4 itojun
161 1.4 itojun #define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */
162 1.4 itojun
163 1.9 itojun #define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */
164 1.9 itojun #define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
165 1.9 itojun #define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
166 1.9 itojun
167 1.12 itojun #define ICMP6_NI_SUCCESS 0 /* node information successful reply */
168 1.4 itojun #define ICMP6_NI_REFUSED 1 /* node information request is refused */
169 1.4 itojun #define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
170 1.4 itojun
171 1.4 itojun #define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */
172 1.4 itojun #define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */
173 1.4 itojun #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */
174 1.4 itojun
175 1.4 itojun /* Used in kernel only */
176 1.4 itojun #define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */
177 1.4 itojun #define ND_REDIRECT_ROUTER 1 /* redirect to a better router */
178 1.4 itojun
179 1.4 itojun /*
180 1.4 itojun * Multicast Listener Discovery
181 1.4 itojun */
182 1.26 itojun struct mld_hdr {
183 1.26 itojun struct icmp6_hdr mld_icmp6_hdr;
184 1.26 itojun struct in6_addr mld_addr; /* multicast address */
185 1.57 roy };
186 1.4 itojun
187 1.26 itojun /* definitions to provide backward compatibility to old KAME applications */
188 1.26 itojun #ifndef _KERNEL
189 1.26 itojun #define mld6_hdr mld_hdr
190 1.26 itojun #define mld6_type mld_type
191 1.26 itojun #define mld6_code mld_code
192 1.26 itojun #define mld6_cksum mld_cksum
193 1.26 itojun #define mld6_maxdelay mld_maxdelay
194 1.26 itojun #define mld6_reserved mld_reserved
195 1.26 itojun #define mld6_addr mld_addr
196 1.26 itojun #endif
197 1.26 itojun
198 1.26 itojun /* shortcut macro definitions */
199 1.26 itojun #define mld_type mld_icmp6_hdr.icmp6_type
200 1.26 itojun #define mld_code mld_icmp6_hdr.icmp6_code
201 1.26 itojun #define mld_cksum mld_icmp6_hdr.icmp6_cksum
202 1.26 itojun #define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0]
203 1.26 itojun #define mld_reserved mld_icmp6_hdr.icmp6_data16[1]
204 1.4 itojun
205 1.34 rpaulo #define MLD_MINLEN 24
206 1.34 rpaulo
207 1.4 itojun /*
208 1.4 itojun * Neighbor Discovery
209 1.4 itojun */
210 1.4 itojun
211 1.4 itojun struct nd_router_solicit { /* router solicitation */
212 1.4 itojun struct icmp6_hdr nd_rs_hdr;
213 1.4 itojun /* could be followed by options */
214 1.57 roy };
215 1.4 itojun
216 1.4 itojun #define nd_rs_type nd_rs_hdr.icmp6_type
217 1.4 itojun #define nd_rs_code nd_rs_hdr.icmp6_code
218 1.4 itojun #define nd_rs_cksum nd_rs_hdr.icmp6_cksum
219 1.4 itojun #define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
220 1.4 itojun
221 1.4 itojun struct nd_router_advert { /* router advertisement */
222 1.4 itojun struct icmp6_hdr nd_ra_hdr;
223 1.4 itojun u_int32_t nd_ra_reachable; /* reachable time */
224 1.4 itojun u_int32_t nd_ra_retransmit; /* retransmit timer */
225 1.4 itojun /* could be followed by options */
226 1.57 roy };
227 1.4 itojun
228 1.4 itojun #define nd_ra_type nd_ra_hdr.icmp6_type
229 1.4 itojun #define nd_ra_code nd_ra_hdr.icmp6_code
230 1.4 itojun #define nd_ra_cksum nd_ra_hdr.icmp6_cksum
231 1.4 itojun #define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
232 1.4 itojun #define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
233 1.4 itojun #define ND_RA_FLAG_MANAGED 0x80
234 1.4 itojun #define ND_RA_FLAG_OTHER 0x40
235 1.34 rpaulo #define ND_RA_FLAG_HOME_AGENT 0x20
236 1.56 roy #define ND_RA_FLAG_PROXY 0x04
237 1.34 rpaulo
238 1.34 rpaulo /*
239 1.41 spz * Router preference values based on RFC4191.
240 1.34 rpaulo */
241 1.34 rpaulo #define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
242 1.34 rpaulo
243 1.34 rpaulo #define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */
244 1.34 rpaulo #define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */
245 1.34 rpaulo #define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */
246 1.34 rpaulo #define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */
247 1.34 rpaulo
248 1.4 itojun #define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
249 1.4 itojun
250 1.4 itojun struct nd_neighbor_solicit { /* neighbor solicitation */
251 1.4 itojun struct icmp6_hdr nd_ns_hdr;
252 1.4 itojun struct in6_addr nd_ns_target; /*target address */
253 1.4 itojun /* could be followed by options */
254 1.57 roy };
255 1.4 itojun
256 1.4 itojun #define nd_ns_type nd_ns_hdr.icmp6_type
257 1.4 itojun #define nd_ns_code nd_ns_hdr.icmp6_code
258 1.4 itojun #define nd_ns_cksum nd_ns_hdr.icmp6_cksum
259 1.4 itojun #define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
260 1.4 itojun
261 1.4 itojun struct nd_neighbor_advert { /* neighbor advertisement */
262 1.4 itojun struct icmp6_hdr nd_na_hdr;
263 1.4 itojun struct in6_addr nd_na_target; /* target address */
264 1.4 itojun /* could be followed by options */
265 1.57 roy };
266 1.4 itojun
267 1.4 itojun #define nd_na_type nd_na_hdr.icmp6_type
268 1.4 itojun #define nd_na_code nd_na_hdr.icmp6_code
269 1.4 itojun #define nd_na_cksum nd_na_hdr.icmp6_cksum
270 1.4 itojun #define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
271 1.4 itojun #if BYTE_ORDER == BIG_ENDIAN
272 1.4 itojun #define ND_NA_FLAG_ROUTER 0x80000000
273 1.4 itojun #define ND_NA_FLAG_SOLICITED 0x40000000
274 1.4 itojun #define ND_NA_FLAG_OVERRIDE 0x20000000
275 1.4 itojun #else
276 1.4 itojun #if BYTE_ORDER == LITTLE_ENDIAN
277 1.4 itojun #define ND_NA_FLAG_ROUTER 0x80
278 1.4 itojun #define ND_NA_FLAG_SOLICITED 0x40
279 1.4 itojun #define ND_NA_FLAG_OVERRIDE 0x20
280 1.4 itojun #endif
281 1.4 itojun #endif
282 1.4 itojun
283 1.4 itojun struct nd_redirect { /* redirect */
284 1.4 itojun struct icmp6_hdr nd_rd_hdr;
285 1.4 itojun struct in6_addr nd_rd_target; /* target address */
286 1.4 itojun struct in6_addr nd_rd_dst; /* destination address */
287 1.4 itojun /* could be followed by options */
288 1.57 roy };
289 1.4 itojun
290 1.4 itojun #define nd_rd_type nd_rd_hdr.icmp6_type
291 1.4 itojun #define nd_rd_code nd_rd_hdr.icmp6_code
292 1.4 itojun #define nd_rd_cksum nd_rd_hdr.icmp6_cksum
293 1.4 itojun #define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
294 1.4 itojun
295 1.4 itojun struct nd_opt_hdr { /* Neighbor discovery option header */
296 1.4 itojun u_int8_t nd_opt_type;
297 1.4 itojun u_int8_t nd_opt_len;
298 1.4 itojun /* followed by option specific data*/
299 1.57 roy };
300 1.4 itojun
301 1.4 itojun #define ND_OPT_SOURCE_LINKADDR 1
302 1.4 itojun #define ND_OPT_TARGET_LINKADDR 2
303 1.4 itojun #define ND_OPT_PREFIX_INFORMATION 3
304 1.4 itojun #define ND_OPT_REDIRECTED_HEADER 4
305 1.4 itojun #define ND_OPT_MTU 5
306 1.40 christos #define ND_OPT_ADVINTERVAL 7
307 1.40 christos #define ND_OPT_HOMEAGENT_INFO 8
308 1.40 christos #define ND_OPT_SOURCE_ADDRLIST 9
309 1.40 christos #define ND_OPT_TARGET_ADDRLIST 10
310 1.50 roy #define ND_OPT_NONCE 14 /* RFC 3971 */
311 1.44 roy #define ND_OPT_MAP 23 /* RFC 5380 */
312 1.44 roy #define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */
313 1.44 roy #define ND_OPT_RDNSS 25 /* RFC 6016 */
314 1.44 roy #define ND_OPT_DNSSL 31 /* RFC 6016 */
315 1.50 roy #define ND_OPT_MAX 31
316 1.40 christos
317 1.40 christos struct nd_opt_route_info { /* route info */
318 1.40 christos u_int8_t nd_opt_rti_type;
319 1.40 christos u_int8_t nd_opt_rti_len;
320 1.40 christos u_int8_t nd_opt_rti_prefixlen;
321 1.40 christos u_int8_t nd_opt_rti_flags;
322 1.40 christos u_int32_t nd_opt_rti_lifetime;
323 1.40 christos /* prefix follows */
324 1.40 christos };
325 1.4 itojun
326 1.4 itojun struct nd_opt_prefix_info { /* prefix information */
327 1.4 itojun u_int8_t nd_opt_pi_type;
328 1.4 itojun u_int8_t nd_opt_pi_len;
329 1.4 itojun u_int8_t nd_opt_pi_prefix_len;
330 1.4 itojun u_int8_t nd_opt_pi_flags_reserved;
331 1.4 itojun u_int32_t nd_opt_pi_valid_time;
332 1.4 itojun u_int32_t nd_opt_pi_preferred_time;
333 1.4 itojun u_int32_t nd_opt_pi_reserved2;
334 1.4 itojun struct in6_addr nd_opt_pi_prefix;
335 1.57 roy };
336 1.4 itojun
337 1.4 itojun #define ND_OPT_PI_FLAG_ONLINK 0x80
338 1.4 itojun #define ND_OPT_PI_FLAG_AUTO 0x40
339 1.55 roy #define ND_OPT_PI_FLAG_ROUTER 0x20
340 1.4 itojun
341 1.26 itojun struct nd_opt_rd_hdr { /* redirected header */
342 1.4 itojun u_int8_t nd_opt_rh_type;
343 1.4 itojun u_int8_t nd_opt_rh_len;
344 1.4 itojun u_int16_t nd_opt_rh_reserved1;
345 1.4 itojun u_int32_t nd_opt_rh_reserved2;
346 1.4 itojun /* followed by IP header and data */
347 1.57 roy };
348 1.4 itojun
349 1.4 itojun struct nd_opt_mtu { /* MTU option */
350 1.4 itojun u_int8_t nd_opt_mtu_type;
351 1.4 itojun u_int8_t nd_opt_mtu_len;
352 1.4 itojun u_int16_t nd_opt_mtu_reserved;
353 1.4 itojun u_int32_t nd_opt_mtu_mtu;
354 1.57 roy };
355 1.4 itojun
356 1.50 roy #define ND_OPT_NONCE_LEN ((1 * 8) - 2)
357 1.50 roy #if ((ND_OPT_NONCE_LEN + 2) % 8) != 0
358 1.50 roy #error "(ND_OPT_NONCE_LEN + 2) must be a multiple of 8."
359 1.50 roy #endif
360 1.50 roy struct nd_opt_nonce {
361 1.50 roy u_int8_t nd_opt_nonce_type;
362 1.50 roy u_int8_t nd_opt_nonce_len;
363 1.50 roy u_int8_t nd_opt_nonce[ND_OPT_NONCE_LEN];
364 1.57 roy };
365 1.50 roy
366 1.44 roy struct nd_opt_rdnss { /* RDNSS option RFC 6106 */
367 1.39 cyber u_int8_t nd_opt_rdnss_type;
368 1.39 cyber u_int8_t nd_opt_rdnss_len;
369 1.39 cyber u_int16_t nd_opt_rdnss_reserved;
370 1.39 cyber u_int32_t nd_opt_rdnss_lifetime;
371 1.39 cyber /* followed by list of IP prefixes */
372 1.57 roy };
373 1.39 cyber
374 1.44 roy struct nd_opt_dnssl { /* DNSSL option RFC 6106 */
375 1.44 roy u_int8_t nd_opt_dnssl_type;
376 1.44 roy u_int8_t nd_opt_dnssl_len;
377 1.44 roy u_int16_t nd_opt_dnssl_reserved;
378 1.44 roy u_int32_t nd_opt_dnssl_lifetime;
379 1.44 roy /* followed by list of IP prefixes */
380 1.57 roy };
381 1.44 roy
382 1.4 itojun /*
383 1.4 itojun * icmp6 namelookup
384 1.4 itojun */
385 1.4 itojun
386 1.4 itojun struct icmp6_namelookup {
387 1.4 itojun struct icmp6_hdr icmp6_nl_hdr;
388 1.4 itojun u_int8_t icmp6_nl_nonce[8];
389 1.9 itojun int32_t icmp6_nl_ttl;
390 1.4 itojun #if 0
391 1.4 itojun u_int8_t icmp6_nl_len;
392 1.4 itojun u_int8_t icmp6_nl_name[3];
393 1.4 itojun #endif
394 1.4 itojun /* could be followed by options */
395 1.57 roy };
396 1.4 itojun
397 1.4 itojun /*
398 1.4 itojun * icmp6 node information
399 1.4 itojun */
400 1.4 itojun struct icmp6_nodeinfo {
401 1.4 itojun struct icmp6_hdr icmp6_ni_hdr;
402 1.4 itojun u_int8_t icmp6_ni_nonce[8];
403 1.4 itojun /* could be followed by reply data */
404 1.57 roy };
405 1.4 itojun
406 1.4 itojun #define ni_type icmp6_ni_hdr.icmp6_type
407 1.4 itojun #define ni_code icmp6_ni_hdr.icmp6_code
408 1.4 itojun #define ni_cksum icmp6_ni_hdr.icmp6_cksum
409 1.4 itojun #define ni_qtype icmp6_ni_hdr.icmp6_data16[0]
410 1.4 itojun #define ni_flags icmp6_ni_hdr.icmp6_data16[1]
411 1.4 itojun
412 1.4 itojun #define NI_QTYPE_NOOP 0 /* NOOP */
413 1.4 itojun #define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */
414 1.13 itojun #define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */
415 1.13 itojun #define NI_QTYPE_DNSNAME 2 /* DNS Name */
416 1.12 itojun #define NI_QTYPE_NODEADDR 3 /* Node Addresses */
417 1.12 itojun #define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
418 1.4 itojun
419 1.4 itojun #if BYTE_ORDER == BIG_ENDIAN
420 1.4 itojun #define NI_SUPTYPE_FLAG_COMPRESS 0x1
421 1.4 itojun #define NI_FQDN_FLAG_VALIDTTL 0x1
422 1.7 itojun #elif BYTE_ORDER == LITTLE_ENDIAN
423 1.7 itojun #define NI_SUPTYPE_FLAG_COMPRESS 0x0100
424 1.7 itojun #define NI_FQDN_FLAG_VALIDTTL 0x0100
425 1.7 itojun #endif
426 1.7 itojun
427 1.7 itojun #ifdef NAME_LOOKUPS_04
428 1.7 itojun #if BYTE_ORDER == BIG_ENDIAN
429 1.4 itojun #define NI_NODEADDR_FLAG_LINKLOCAL 0x1
430 1.4 itojun #define NI_NODEADDR_FLAG_SITELOCAL 0x2
431 1.4 itojun #define NI_NODEADDR_FLAG_GLOBAL 0x4
432 1.4 itojun #define NI_NODEADDR_FLAG_ALL 0x8
433 1.4 itojun #define NI_NODEADDR_FLAG_TRUNCATE 0x10
434 1.4 itojun #define NI_NODEADDR_FLAG_ANYCAST 0x20 /* just experimental. not in spec */
435 1.4 itojun #elif BYTE_ORDER == LITTLE_ENDIAN
436 1.4 itojun #define NI_NODEADDR_FLAG_LINKLOCAL 0x0100
437 1.4 itojun #define NI_NODEADDR_FLAG_SITELOCAL 0x0200
438 1.4 itojun #define NI_NODEADDR_FLAG_GLOBAL 0x0400
439 1.4 itojun #define NI_NODEADDR_FLAG_ALL 0x0800
440 1.4 itojun #define NI_NODEADDR_FLAG_TRUNCATE 0x1000
441 1.4 itojun #define NI_NODEADDR_FLAG_ANYCAST 0x2000 /* just experimental. not in spec */
442 1.7 itojun #endif
443 1.7 itojun #else /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */
444 1.7 itojun #if BYTE_ORDER == BIG_ENDIAN
445 1.7 itojun #define NI_NODEADDR_FLAG_TRUNCATE 0x1
446 1.7 itojun #define NI_NODEADDR_FLAG_ALL 0x2
447 1.7 itojun #define NI_NODEADDR_FLAG_COMPAT 0x4
448 1.7 itojun #define NI_NODEADDR_FLAG_LINKLOCAL 0x8
449 1.7 itojun #define NI_NODEADDR_FLAG_SITELOCAL 0x10
450 1.7 itojun #define NI_NODEADDR_FLAG_GLOBAL 0x20
451 1.7 itojun #define NI_NODEADDR_FLAG_ANYCAST 0x40 /* just experimental. not in spec */
452 1.7 itojun #elif BYTE_ORDER == LITTLE_ENDIAN
453 1.7 itojun #define NI_NODEADDR_FLAG_TRUNCATE 0x0100
454 1.7 itojun #define NI_NODEADDR_FLAG_ALL 0x0200
455 1.7 itojun #define NI_NODEADDR_FLAG_COMPAT 0x0400
456 1.7 itojun #define NI_NODEADDR_FLAG_LINKLOCAL 0x0800
457 1.7 itojun #define NI_NODEADDR_FLAG_SITELOCAL 0x1000
458 1.7 itojun #define NI_NODEADDR_FLAG_GLOBAL 0x2000
459 1.7 itojun #define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */
460 1.7 itojun #endif
461 1.4 itojun #endif
462 1.4 itojun
463 1.4 itojun struct ni_reply_fqdn {
464 1.4 itojun u_int32_t ni_fqdn_ttl; /* TTL */
465 1.4 itojun u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
466 1.4 itojun u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
467 1.57 roy };
468 1.4 itojun
469 1.4 itojun /*
470 1.4 itojun * Router Renumbering. as router-renum-08.txt
471 1.4 itojun */
472 1.4 itojun struct icmp6_router_renum { /* router renumbering header */
473 1.4 itojun struct icmp6_hdr rr_hdr;
474 1.10 itojun u_int8_t rr_segnum;
475 1.10 itojun u_int8_t rr_flags;
476 1.10 itojun u_int16_t rr_maxdelay;
477 1.10 itojun u_int32_t rr_reserved;
478 1.57 roy };
479 1.17 itojun
480 1.17 itojun #define ICMP6_RR_FLAGS_TEST 0x80
481 1.17 itojun #define ICMP6_RR_FLAGS_REQRESULT 0x40
482 1.17 itojun #define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
483 1.17 itojun #define ICMP6_RR_FLAGS_SPECSITE 0x10
484 1.17 itojun #define ICMP6_RR_FLAGS_PREVDONE 0x08
485 1.10 itojun
486 1.10 itojun #define rr_type rr_hdr.icmp6_type
487 1.10 itojun #define rr_code rr_hdr.icmp6_code
488 1.10 itojun #define rr_cksum rr_hdr.icmp6_cksum
489 1.10 itojun #define rr_seqnum rr_hdr.icmp6_data32[0]
490 1.4 itojun
491 1.4 itojun struct rr_pco_match { /* match prefix part */
492 1.4 itojun u_int8_t rpm_code;
493 1.4 itojun u_int8_t rpm_len;
494 1.4 itojun u_int8_t rpm_ordinal;
495 1.4 itojun u_int8_t rpm_matchlen;
496 1.4 itojun u_int8_t rpm_minlen;
497 1.4 itojun u_int8_t rpm_maxlen;
498 1.4 itojun u_int16_t rpm_reserved;
499 1.10 itojun struct in6_addr rpm_prefix;
500 1.57 roy };
501 1.4 itojun
502 1.4 itojun #define RPM_PCO_ADD 1
503 1.4 itojun #define RPM_PCO_CHANGE 2
504 1.4 itojun #define RPM_PCO_SETGLOBAL 3
505 1.4 itojun #define RPM_PCO_MAX 4
506 1.4 itojun
507 1.4 itojun struct rr_pco_use { /* use prefix part */
508 1.4 itojun u_int8_t rpu_uselen;
509 1.4 itojun u_int8_t rpu_keeplen;
510 1.10 itojun u_int8_t rpu_ramask;
511 1.10 itojun u_int8_t rpu_raflags;
512 1.4 itojun u_int32_t rpu_vltime;
513 1.4 itojun u_int32_t rpu_pltime;
514 1.10 itojun u_int32_t rpu_flags;
515 1.10 itojun struct in6_addr rpu_prefix;
516 1.57 roy };
517 1.10 itojun #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
518 1.10 itojun #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
519 1.10 itojun
520 1.10 itojun #if BYTE_ORDER == BIG_ENDIAN
521 1.10 itojun #define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
522 1.10 itojun #define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
523 1.4 itojun #elif BYTE_ORDER == LITTLE_ENDIAN
524 1.10 itojun #define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
525 1.10 itojun #define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
526 1.10 itojun #endif
527 1.4 itojun
528 1.4 itojun struct rr_result { /* router renumbering result message */
529 1.10 itojun u_int16_t rrr_flags;
530 1.4 itojun u_int8_t rrr_ordinal;
531 1.4 itojun u_int8_t rrr_matchedlen;
532 1.4 itojun u_int32_t rrr_ifid;
533 1.10 itojun struct in6_addr rrr_prefix;
534 1.57 roy };
535 1.10 itojun #if BYTE_ORDER == BIG_ENDIAN
536 1.10 itojun #define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
537 1.10 itojun #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
538 1.4 itojun #elif BYTE_ORDER == LITTLE_ENDIAN
539 1.18 itojun #define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
540 1.18 itojun #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
541 1.10 itojun #endif
542 1.4 itojun
543 1.4 itojun /*
544 1.4 itojun * icmp6 filter structures.
545 1.4 itojun */
546 1.4 itojun
547 1.4 itojun struct icmp6_filter {
548 1.8 itojun u_int32_t icmp6_filt[8];
549 1.4 itojun };
550 1.4 itojun
551 1.4 itojun #define ICMP6_FILTER_SETPASSALL(filterp) \
552 1.31 christos (void)memset(filterp, 0xff, sizeof(struct icmp6_filter))
553 1.4 itojun #define ICMP6_FILTER_SETBLOCKALL(filterp) \
554 1.31 christos (void)memset(filterp, 0x00, sizeof(struct icmp6_filter))
555 1.4 itojun #define ICMP6_FILTER_SETPASS(type, filterp) \
556 1.8 itojun (((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))
557 1.4 itojun #define ICMP6_FILTER_SETBLOCK(type, filterp) \
558 1.8 itojun (((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))
559 1.4 itojun #define ICMP6_FILTER_WILLPASS(type, filterp) \
560 1.8 itojun ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
561 1.4 itojun #define ICMP6_FILTER_WILLBLOCK(type, filterp) \
562 1.8 itojun ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
563 1.4 itojun
564 1.4 itojun /*
565 1.4 itojun * Variables related to this implementation
566 1.4 itojun * of the internet control message protocol version 6.
567 1.4 itojun */
568 1.10 itojun
569 1.37 thorpej /*
570 1.37 thorpej * IPv6 ICMP statistics.
571 1.37 thorpej * Each counter is an unsigned 64-bit value.
572 1.37 thorpej */
573 1.37 thorpej #define ICMP6_STAT_ERROR 0 /* # of calls to icmp6_error */
574 1.37 thorpej #define ICMP6_STAT_CANTERROR 1 /* no error (old was icmp) */
575 1.37 thorpej #define ICMP6_STAT_TOOFREQ 2 /* no error (rate limitation) */
576 1.37 thorpej #define ICMP6_STAT_OUTHIST 3 /* # of output messages */
577 1.37 thorpej /* space for 256 counters */
578 1.37 thorpej #define ICMP6_STAT_BADCODE 259 /* icmp6_code out of range */
579 1.37 thorpej #define ICMP6_STAT_TOOSHORT 260 /* packet < sizeof(struct icmp6_hdr) */
580 1.37 thorpej #define ICMP6_STAT_CHECKSUM 261 /* bad checksum */
581 1.37 thorpej #define ICMP6_STAT_BADLEN 262 /* calculated bound mismatch */
582 1.21 itojun /*
583 1.37 thorpej * number of responses; this member is inherited from the netinet code,
584 1.37 thorpej * but for netinet6 code, it is already available in outhist[].
585 1.21 itojun */
586 1.37 thorpej #define ICMP6_STAT_REFLECT 263
587 1.37 thorpej #define ICMP6_STAT_INHIST 264 /* # of input messages */
588 1.37 thorpej /* space for 256 counters */
589 1.37 thorpej #define ICMP6_STAT_ND_TOOMANYOPT 520 /* too many ND options */
590 1.37 thorpej #define ICMP6_STAT_OUTERRHIST 521
591 1.37 thorpej /* space for 13 counters */
592 1.37 thorpej #define ICMP6_STAT_PMTUCHG 534 /* path MTU changes */
593 1.37 thorpej #define ICMP6_STAT_ND_BADOPT 535 /* bad ND options */
594 1.37 thorpej #define ICMP6_STAT_BADNS 536 /* bad neighbor solicititation */
595 1.37 thorpej #define ICMP6_STAT_BADNA 537 /* bad neighbor advertisement */
596 1.37 thorpej #define ICMP6_STAT_BADRS 538 /* bad router solicitiation */
597 1.37 thorpej #define ICMP6_STAT_BADRA 539 /* bad router advertisement */
598 1.37 thorpej #define ICMP6_STAT_BADREDIRECT 540 /* bad redirect message */
599 1.42 spz #define ICMP6_STAT_DROPPED_RAROUTE 541 /* discarded routes from router advertisement */
600 1.37 thorpej
601 1.42 spz #define ICMP6_NSTATS 542
602 1.37 thorpej
603 1.37 thorpej #define ICMP6_ERRSTAT_DST_UNREACH_NOROUTE 0
604 1.37 thorpej #define ICMP6_ERRSTAT_DST_UNREACH_ADMIN 1
605 1.37 thorpej #define ICMP6_ERRSTAT_DST_UNREACH_BEYONDSCOPE 2
606 1.37 thorpej #define ICMP6_ERRSTAT_DST_UNREACH_ADDR 3
607 1.37 thorpej #define ICMP6_ERRSTAT_DST_UNREACH_NOPORT 4
608 1.37 thorpej #define ICMP6_ERRSTAT_PACKET_TOO_BIG 5
609 1.37 thorpej #define ICMP6_ERRSTAT_TIME_EXCEED_TRANSIT 6
610 1.37 thorpej #define ICMP6_ERRSTAT_TIME_EXCEED_REASSEMBLY 7
611 1.37 thorpej #define ICMP6_ERRSTAT_PARAMPROB_HEADER 8
612 1.37 thorpej #define ICMP6_ERRSTAT_PARAMPROB_NEXTHEADER 9
613 1.37 thorpej #define ICMP6_ERRSTAT_PARAMPROB_OPTION 10
614 1.37 thorpej #define ICMP6_ERRSTAT_REDIRECT 11
615 1.37 thorpej #define ICMP6_ERRSTAT_UNKNOWN 12
616 1.4 itojun
617 1.4 itojun /*
618 1.4 itojun * Names for ICMP sysctl objects
619 1.4 itojun */
620 1.4 itojun #define ICMPV6CTL_STATS 1
621 1.4 itojun #define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */
622 1.4 itojun #define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */
623 1.11 itojun #if 0 /*obsoleted*/
624 1.4 itojun #define ICMPV6CTL_ERRRATELIMIT 5 /* ICMPv6 error rate limitation */
625 1.11 itojun #endif
626 1.4 itojun #define ICMPV6CTL_ND6_PRUNE 6
627 1.4 itojun #define ICMPV6CTL_ND6_DELAY 8
628 1.4 itojun #define ICMPV6CTL_ND6_UMAXTRIES 9
629 1.4 itojun #define ICMPV6CTL_ND6_MMAXTRIES 10
630 1.4 itojun #define ICMPV6CTL_ND6_USELOOPBACK 11
631 1.5 itojun /*#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here */
632 1.4 itojun #define ICMPV6CTL_NODEINFO 13
633 1.10 itojun #define ICMPV6CTL_ERRPPSLIMIT 14 /* ICMPv6 error pps limitation */
634 1.10 itojun #define ICMPV6CTL_ND6_MAXNUDHINT 15
635 1.16 itojun #define ICMPV6CTL_MTUDISC_HIWAT 16
636 1.16 itojun #define ICMPV6CTL_MTUDISC_LOWAT 17
637 1.19 itojun #define ICMPV6CTL_ND6_DEBUG 18
638 1.54 roy #ifdef _KERNEL
639 1.54 roy #define OICMPV6CTL_ND6_DRLIST 19
640 1.54 roy #define OICMPV6CTL_ND6_PRLIST 20
641 1.54 roy #endif
642 1.34 rpaulo #define ICMPV6CTL_ND6_MAXQLEN 24
643 1.58 knakahar #define ICMPV6CTL_REFLECT_PMTU 25
644 1.59 knakahar #define ICMPV6CTL_DYNAMIC_RT_MSG 26
645 1.4 itojun
646 1.4 itojun #ifdef _KERNEL
647 1.4 itojun struct rtentry;
648 1.29 matt
649 1.30 itojun void icmp6_init(void);
650 1.30 itojun void icmp6_paramerror(struct mbuf *, int);
651 1.30 itojun void icmp6_error(struct mbuf *, int, int, int);
652 1.53 roy void icmp6_error2(struct mbuf *, int, int, int, struct ifnet *,
653 1.53 roy struct in6_addr *);
654 1.30 itojun int icmp6_input(struct mbuf **, int *, int);
655 1.30 itojun void icmp6_fasttimo(void);
656 1.30 itojun void icmp6_prepare(struct mbuf *);
657 1.30 itojun void icmp6_redirect_output(struct mbuf *, struct rtentry *);
658 1.30 itojun int icmp6_sysctl(int *, u_int, void *, size_t *, void *, size_t);
659 1.15 itojun
660 1.38 thorpej void icmp6_statinc(u_int);
661 1.38 thorpej
662 1.15 itojun struct ip6ctlparam;
663 1.30 itojun void icmp6_mtudisc_update(struct ip6ctlparam *, int);
664 1.30 itojun void icmp6_mtudisc_callback_register(void (*)(struct in6_addr *));
665 1.4 itojun
666 1.4 itojun /* XXX: is this the right place for these macros? */
667 1.4 itojun #define icmp6_ifstat_inc(ifp, tag) \
668 1.4 itojun do { \
669 1.22 itojun if (ifp) \
670 1.22 itojun ((struct in6_ifextra *)((ifp)->if_afdata[AF_INET6]))->icmp6_ifstat->tag++; \
671 1.25 perry } while (/*CONSTCOND*/ 0)
672 1.4 itojun
673 1.4 itojun #define icmp6_ifoutstat_inc(ifp, type, code) \
674 1.4 itojun do { \
675 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_msg); \
676 1.4 itojun switch(type) { \
677 1.4 itojun case ICMP6_DST_UNREACH: \
678 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_dstunreach); \
679 1.4 itojun if (code == ICMP6_DST_UNREACH_ADMIN) \
680 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_adminprohib); \
681 1.4 itojun break; \
682 1.4 itojun case ICMP6_PACKET_TOO_BIG: \
683 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_pkttoobig); \
684 1.4 itojun break; \
685 1.4 itojun case ICMP6_TIME_EXCEEDED: \
686 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_timeexceed); \
687 1.4 itojun break; \
688 1.4 itojun case ICMP6_PARAM_PROB: \
689 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_paramprob); \
690 1.4 itojun break; \
691 1.4 itojun case ICMP6_ECHO_REQUEST: \
692 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_echo); \
693 1.4 itojun break; \
694 1.4 itojun case ICMP6_ECHO_REPLY: \
695 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_echoreply); \
696 1.4 itojun break; \
697 1.26 itojun case MLD_LISTENER_QUERY: \
698 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_mldquery); \
699 1.4 itojun break; \
700 1.26 itojun case MLD_LISTENER_REPORT: \
701 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_mldreport); \
702 1.4 itojun break; \
703 1.26 itojun case MLD_LISTENER_DONE: \
704 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_mlddone); \
705 1.4 itojun break; \
706 1.4 itojun case ND_ROUTER_SOLICIT: \
707 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_routersolicit); \
708 1.4 itojun break; \
709 1.4 itojun case ND_ROUTER_ADVERT: \
710 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_routeradvert); \
711 1.4 itojun break; \
712 1.4 itojun case ND_NEIGHBOR_SOLICIT: \
713 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); \
714 1.4 itojun break; \
715 1.4 itojun case ND_NEIGHBOR_ADVERT: \
716 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert); \
717 1.4 itojun break; \
718 1.4 itojun case ND_REDIRECT: \
719 1.4 itojun icmp6_ifstat_inc(ifp, ifs6_out_redirect); \
720 1.4 itojun break; \
721 1.4 itojun } \
722 1.25 perry } while (/*CONSTCOND*/ 0)
723 1.4 itojun
724 1.4 itojun extern int icmp6_rediraccept; /* accept/process redirects */
725 1.4 itojun extern int icmp6_redirtimeout; /* cache time for redirect routes */
726 1.4 itojun #endif /* _KERNEL */
727 1.2 itojun
728 1.45 spz #ifdef ICMP6_STRINGS
729 1.45 spz /* Info: http://www.iana.org/assignments/icmpv6-parameters */
730 1.45 spz
731 1.45 spz static const char * const icmp6_type_err[] = {
732 1.46 spz "reserved0", "unreach", "packet_too_big", "timxceed", "paramprob",
733 1.45 spz NULL
734 1.45 spz };
735 1.45 spz
736 1.45 spz static const char * const icmp6_type_info[] = {
737 1.45 spz "echo", "echoreply",
738 1.45 spz "mcastlistenq", "mcastlistenrep", "mcastlistendone",
739 1.45 spz "rtsol", "rtadv", "neighsol", "neighadv", "redirect",
740 1.45 spz "routerrenum", "nodeinfoq", "nodeinfor", "invneighsol", "invneighrep",
741 1.45 spz "mcastlistenrep2", "haad_req", "haad_rep",
742 1.45 spz "mobile_psol", "mobile_padv", "cga_sol", "cga_adv",
743 1.45 spz "experimental150", "mcast_rtadv", "mcast_rtsol", "mcast_rtterm",
744 1.45 spz "fmipv6_msg", "rpl_control", NULL
745 1.45 spz };
746 1.45 spz
747 1.45 spz static const char * const icmp6_code_none[] = { "none", NULL };
748 1.45 spz
749 1.45 spz static const char * const icmp6_code_unreach[] = {
750 1.46 spz "noroute", "admin", "beyondscope", "addr", "port",
751 1.45 spz "srcaddr_policy", "reject_route", "source_route_err", NULL
752 1.45 spz };
753 1.45 spz
754 1.45 spz static const char * const icmp6_code_timxceed[] = {
755 1.46 spz "intrans", "reass", NULL
756 1.45 spz };
757 1.45 spz
758 1.45 spz static const char * const icmp6_code_paramprob[] = {
759 1.46 spz "hdr_field", "nxthdr_type", "option", NULL
760 1.45 spz };
761 1.45 spz
762 1.45 spz /* not all informational icmps that have codes have a names array */
763 1.45 spz #endif
764 1.45 spz
765 1.32 elad #endif /* !_NETINET_ICMP6_H_ */
766