• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*	$NetBSD: icmp6.h,v 1.47 2013/07/01 12:43:15 christos Exp $	*/
2 /*	$KAME: icmp6.h,v 1.84 2003/04/23 10:26:51 itojun Exp $	*/
3 
4 
5 /*
6  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. Neither the name of the project nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  */
33 
34 /*
35  * Copyright (c) 1982, 1986, 1993
36  *	The Regents of the University of California.  All rights reserved.
37  *
38  * Redistribution and use in source and binary forms, with or without
39  * modification, are permitted provided that the following conditions
40  * are met:
41  * 1. Redistributions of source code must retain the above copyright
42  *    notice, this list of conditions and the following disclaimer.
43  * 2. Redistributions in binary form must reproduce the above copyright
44  *    notice, this list of conditions and the following disclaimer in the
45  *    documentation and/or other materials provided with the distribution.
46  * 3. Neither the name of the University nor the names of its contributors
47  *    may be used to endorse or promote products derived from this software
48  *    without specific prior written permission.
49  *
50  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
51  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
54  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
56  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
58  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60  * SUCH DAMAGE.
61  *
62  *	@(#)ip_icmp.h	8.1 (Berkeley) 6/10/93
63  */
64 
65 #ifndef _NETINET_ICMP6_H_
66 #define _NETINET_ICMP6_H_
67 
68 #include <netinet/in.h> /* android-added: glibc source compatibility. */
69 #include <sys/cdefs.h>
70 
71 #define ICMPV6_PLD_MAXLEN	1232	/* IPV6_MMTU - sizeof(struct ip6_hdr)
72 					   - sizeof(struct icmp6_hdr) */
73 
74 struct icmp6_hdr {
75 	u_int8_t	icmp6_type;	/* type field */
76 	u_int8_t	icmp6_code;	/* code field */
77 	u_int16_t	icmp6_cksum;	/* checksum field */
78 	union {
79 		u_int32_t	icmp6_un_data32[1]; /* type-specific field */
80 		u_int16_t	icmp6_un_data16[2]; /* type-specific field */
81 		u_int8_t	icmp6_un_data8[4];  /* type-specific field */
82 	} icmp6_dataun;
83 } __packed;
84 
85 #define icmp6_data32	icmp6_dataun.icmp6_un_data32
86 #define icmp6_data16	icmp6_dataun.icmp6_un_data16
87 #define icmp6_data8	icmp6_dataun.icmp6_un_data8
88 #define icmp6_pptr	icmp6_data32[0]		/* parameter prob */
89 #define icmp6_mtu	icmp6_data32[0]		/* packet too big */
90 #define icmp6_id	icmp6_data16[0]		/* echo request/reply */
91 #define icmp6_seq	icmp6_data16[1]		/* echo request/reply */
92 #define icmp6_maxdelay	icmp6_data16[0]		/* mcast group membership */
93 
94 #define ICMP6_DST_UNREACH		1	/* dest unreachable, codes: */
95 #define ICMP6_PACKET_TOO_BIG		2	/* packet too big */
96 #define ICMP6_TIME_EXCEEDED		3	/* time exceeded, code: */
97 #define ICMP6_PARAM_PROB		4	/* ip6 header bad */
98 
99 #define ICMP6_ECHO_REQUEST		128	/* echo service */
100 #define ICMP6_ECHO_REPLY		129	/* echo reply */
101 #define MLD_LISTENER_QUERY		130 	/* multicast listener query */
102 #define MLD_LISTENER_REPORT		131	/* multicast listener report */
103 #define MLD_LISTENER_DONE		132	/* multicast listener done */
104 #define MLD_LISTENER_REDUCTION MLD_LISTENER_DONE /* RFC3542 definition */
105 
106 /* RFC2292 decls */
107 #define ICMP6_MEMBERSHIP_QUERY		130	/* group membership query */
108 #define ICMP6_MEMBERSHIP_REPORT		131	/* group membership report */
109 #define ICMP6_MEMBERSHIP_REDUCTION	132	/* group membership termination */
110 
111 #define ND_ROUTER_SOLICIT		133	/* router solicitation */
112 #define ND_ROUTER_ADVERT		134	/* router advertisement */
113 #define ND_NEIGHBOR_SOLICIT		135	/* neighbor solicitation */
114 #define ND_NEIGHBOR_ADVERT		136	/* neighbor advertisement */
115 #define ND_REDIRECT			137	/* redirect */
116 
117 #define ICMP6_ROUTER_RENUMBERING	138	/* router renumbering */
118 
119 #define ICMP6_WRUREQUEST		139	/* who are you request */
120 #define ICMP6_WRUREPLY			140	/* who are you reply */
121 #define ICMP6_FQDN_QUERY		139	/* FQDN query */
122 #define ICMP6_FQDN_REPLY		140	/* FQDN reply */
123 #define ICMP6_NI_QUERY			139	/* node information request */
124 #define ICMP6_NI_REPLY			140	/* node information reply */
125 #define MLDV2_LISTENER_REPORT		143	/* RFC3810 listener report */
126 
127 /* The definitions below are experimental. TBA */
128 #define MLD_MTRACE_RESP			200	/* mtrace response(to sender) */
129 #define MLD_MTRACE			201	/* mtrace messages */
130 
131 #define ICMP6_MAXTYPE			201
132 
133 #define ICMP6_DST_UNREACH_NOROUTE	0	/* no route to destination */
134 #define ICMP6_DST_UNREACH_ADMIN	 	1	/* administratively prohibited */
135 #define ICMP6_DST_UNREACH_NOTNEIGHBOR	2	/* not a neighbor(obsolete) */
136 #define ICMP6_DST_UNREACH_BEYONDSCOPE	2	/* beyond scope of source address */
137 #define ICMP6_DST_UNREACH_ADDR		3	/* address unreachable */
138 #define ICMP6_DST_UNREACH_NOPORT	4	/* port unreachable */
139 #define ICMP6_DST_UNREACH_POLICY	5	/* source address failed ingress/egress policy */
140 #define ICMP6_DST_UNREACH_REJROUTE	6	/* reject route to destination */
141 #define ICMP6_DST_UNREACH_SOURCERT	7	/* error in source routing header */
142 
143 #define ICMP6_TIME_EXCEED_TRANSIT 	0	/* ttl==0 in transit */
144 #define ICMP6_TIME_EXCEED_REASSEMBLY	1	/* ttl==0 in reass */
145 
146 #define ICMP6_PARAMPROB_HEADER 	 	0	/* erroneous header field */
147 #define ICMP6_PARAMPROB_NEXTHEADER	1	/* unrecognized next header */
148 #define ICMP6_PARAMPROB_OPTION		2	/* unrecognized option */
149 
150 #define ICMP6_INFOMSG_MASK		0x80	/* all informational messages */
151 
152 #define ICMP6_NI_SUBJ_IPV6	0	/* Query Subject is an IPv6 address */
153 #define ICMP6_NI_SUBJ_FQDN	1	/* Query Subject is a Domain name */
154 #define ICMP6_NI_SUBJ_IPV4	2	/* Query Subject is an IPv4 address */
155 
156 #define ICMP6_NI_SUCCESS	0	/* node information successful reply */
157 #define ICMP6_NI_REFUSED	1	/* node information request is refused */
158 #define ICMP6_NI_UNKNOWN	2	/* unknown Qtype */
159 
160 #define ICMP6_ROUTER_RENUMBERING_COMMAND  0	/* rr command */
161 #define ICMP6_ROUTER_RENUMBERING_RESULT   1	/* rr result */
162 #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET   255	/* rr seq num reset */
163 
164 /* Used in kernel only */
165 #define ND_REDIRECT_ONLINK	0	/* redirect to an on-link node */
166 #define ND_REDIRECT_ROUTER	1	/* redirect to a better router */
167 
168 /*
169  * Multicast Listener Discovery
170  */
171 struct mld_hdr {
172 	struct icmp6_hdr	mld_icmp6_hdr;
173 	struct in6_addr		mld_addr; /* multicast address */
174 } __packed;
175 
176 /* shortcut macro definitions */
177 #define mld_type	mld_icmp6_hdr.icmp6_type
178 #define mld_code	mld_icmp6_hdr.icmp6_code
179 #define mld_cksum	mld_icmp6_hdr.icmp6_cksum
180 #define mld_maxdelay	mld_icmp6_hdr.icmp6_data16[0]
181 #define mld_reserved	mld_icmp6_hdr.icmp6_data16[1]
182 
183 #define MLD_MINLEN			24
184 
185 /*
186  * Neighbor Discovery
187  */
188 
189 struct nd_router_solicit {	/* router solicitation */
190 	struct icmp6_hdr 	nd_rs_hdr;
191 	/* could be followed by options */
192 } __packed;
193 
194 #define nd_rs_type	nd_rs_hdr.icmp6_type
195 #define nd_rs_code	nd_rs_hdr.icmp6_code
196 #define nd_rs_cksum	nd_rs_hdr.icmp6_cksum
197 #define nd_rs_reserved	nd_rs_hdr.icmp6_data32[0]
198 
199 struct nd_router_advert {	/* router advertisement */
200 	struct icmp6_hdr	nd_ra_hdr;
201 	u_int32_t		nd_ra_reachable;	/* reachable time */
202 	u_int32_t		nd_ra_retransmit;	/* retransmit timer */
203 	/* could be followed by options */
204 } __packed;
205 
206 #define nd_ra_type		nd_ra_hdr.icmp6_type
207 #define nd_ra_code		nd_ra_hdr.icmp6_code
208 #define nd_ra_cksum		nd_ra_hdr.icmp6_cksum
209 #define nd_ra_curhoplimit	nd_ra_hdr.icmp6_data8[0]
210 #define nd_ra_flags_reserved	nd_ra_hdr.icmp6_data8[1]
211 #define ND_RA_FLAG_MANAGED	0x80
212 #define ND_RA_FLAG_OTHER	0x40
213 #define ND_RA_FLAG_HOME_AGENT	0x20
214 
215 /*
216  * Router preference values based on RFC4191.
217  */
218 #define ND_RA_FLAG_RTPREF_MASK	0x18 /* 00011000 */
219 
220 #define ND_RA_FLAG_RTPREF_HIGH	0x08 /* 00001000 */
221 #define ND_RA_FLAG_RTPREF_MEDIUM	0x00 /* 00000000 */
222 #define ND_RA_FLAG_RTPREF_LOW	0x18 /* 00011000 */
223 #define ND_RA_FLAG_RTPREF_RSV	0x10 /* 00010000 */
224 
225 #define nd_ra_router_lifetime	nd_ra_hdr.icmp6_data16[1]
226 
227 struct nd_neighbor_solicit {	/* neighbor solicitation */
228 	struct icmp6_hdr	nd_ns_hdr;
229 	struct in6_addr		nd_ns_target;	/*target address */
230 	/* could be followed by options */
231 } __packed;
232 
233 #define nd_ns_type		nd_ns_hdr.icmp6_type
234 #define nd_ns_code		nd_ns_hdr.icmp6_code
235 #define nd_ns_cksum		nd_ns_hdr.icmp6_cksum
236 #define nd_ns_reserved		nd_ns_hdr.icmp6_data32[0]
237 
238 struct nd_neighbor_advert {	/* neighbor advertisement */
239 	struct icmp6_hdr	nd_na_hdr;
240 	struct in6_addr		nd_na_target;	/* target address */
241 	/* could be followed by options */
242 } __packed;
243 
244 #define nd_na_type		nd_na_hdr.icmp6_type
245 #define nd_na_code		nd_na_hdr.icmp6_code
246 #define nd_na_cksum		nd_na_hdr.icmp6_cksum
247 #define nd_na_flags_reserved	nd_na_hdr.icmp6_data32[0]
248 #define ND_NA_FLAG_ROUTER		0x80
249 #define ND_NA_FLAG_SOLICITED		0x40
250 #define ND_NA_FLAG_OVERRIDE		0x20
251 
252 struct nd_redirect {		/* redirect */
253 	struct icmp6_hdr	nd_rd_hdr;
254 	struct in6_addr		nd_rd_target;	/* target address */
255 	struct in6_addr		nd_rd_dst;	/* destination address */
256 	/* could be followed by options */
257 } __packed;
258 
259 #define nd_rd_type		nd_rd_hdr.icmp6_type
260 #define nd_rd_code		nd_rd_hdr.icmp6_code
261 #define nd_rd_cksum		nd_rd_hdr.icmp6_cksum
262 #define nd_rd_reserved		nd_rd_hdr.icmp6_data32[0]
263 
264 struct nd_opt_hdr {		/* Neighbor discovery option header */
265 	u_int8_t	nd_opt_type;
266 	u_int8_t	nd_opt_len;
267 	/* followed by option specific data*/
268 } __packed;
269 
270 #define ND_OPT_SOURCE_LINKADDR		1
271 #define ND_OPT_TARGET_LINKADDR		2
272 #define ND_OPT_PREFIX_INFORMATION	3
273 #define ND_OPT_REDIRECTED_HEADER	4
274 #define ND_OPT_MTU			5
275 #define ND_OPT_ADVINTERVAL		7
276 #define ND_OPT_HOMEAGENT_INFO		8
277 #define ND_OPT_SOURCE_ADDRLIST		9
278 #define ND_OPT_TARGET_ADDRLIST		10
279 #define ND_OPT_MAP			23	/* RFC 5380 */
280 #define ND_OPT_ROUTE_INFO		24	/* RFC 4191 */
281 #define ND_OPT_RDNSS			25	/* RFC 6016 */
282 #define ND_OPT_DNSSL			31	/* RFC 6016 */
283 
284 struct nd_opt_route_info {	/* route info */
285 	u_int8_t	nd_opt_rti_type;
286 	u_int8_t	nd_opt_rti_len;
287 	u_int8_t	nd_opt_rti_prefixlen;
288 	u_int8_t	nd_opt_rti_flags;
289 	u_int32_t	nd_opt_rti_lifetime;
290 	/* prefix follows */
291 };
292 
293 struct nd_opt_prefix_info {	/* prefix information */
294 	u_int8_t	nd_opt_pi_type;
295 	u_int8_t	nd_opt_pi_len;
296 	u_int8_t	nd_opt_pi_prefix_len;
297 	u_int8_t	nd_opt_pi_flags_reserved;
298 	u_int32_t	nd_opt_pi_valid_time;
299 	u_int32_t	nd_opt_pi_preferred_time;
300 	u_int32_t	nd_opt_pi_reserved2;
301 	struct in6_addr	nd_opt_pi_prefix;
302 } __packed;
303 
304 #define ND_OPT_PI_FLAG_ONLINK		0x80
305 #define ND_OPT_PI_FLAG_AUTO		0x40
306 
307 struct nd_opt_rd_hdr {		/* redirected header */
308 	u_int8_t	nd_opt_rh_type;
309 	u_int8_t	nd_opt_rh_len;
310 	u_int16_t	nd_opt_rh_reserved1;
311 	u_int32_t	nd_opt_rh_reserved2;
312 	/* followed by IP header and data */
313 } __packed;
314 
315 struct nd_opt_mtu {		/* MTU option */
316 	u_int8_t	nd_opt_mtu_type;
317 	u_int8_t	nd_opt_mtu_len;
318 	u_int16_t	nd_opt_mtu_reserved;
319 	u_int32_t	nd_opt_mtu_mtu;
320 } __packed;
321 
322 struct nd_opt_rdnss {		/* RDNSS option RFC 6106 */
323 	u_int8_t	nd_opt_rdnss_type;
324 	u_int8_t	nd_opt_rdnss_len;
325 	u_int16_t	nd_opt_rdnss_reserved;
326 	u_int32_t	nd_opt_rdnss_lifetime;
327 	/* followed by list of IP prefixes */
328 } __packed;
329 
330 struct nd_opt_dnssl {		/* DNSSL option RFC 6106 */
331 	u_int8_t	nd_opt_dnssl_type;
332 	u_int8_t	nd_opt_dnssl_len;
333 	u_int16_t	nd_opt_dnssl_reserved;
334 	u_int32_t	nd_opt_dnssl_lifetime;
335 	/* followed by list of IP prefixes */
336 } __packed;
337 
338 /*
339  * icmp6 namelookup
340  */
341 
342 struct icmp6_namelookup {
343 	struct icmp6_hdr 	icmp6_nl_hdr;
344 	u_int8_t	icmp6_nl_nonce[8];
345 	int32_t		icmp6_nl_ttl;
346 #if 0
347 	u_int8_t	icmp6_nl_len;
348 	u_int8_t	icmp6_nl_name[3];
349 #endif
350 	/* could be followed by options */
351 } __packed;
352 
353 /*
354  * icmp6 node information
355  */
356 struct icmp6_nodeinfo {
357 	struct icmp6_hdr icmp6_ni_hdr;
358 	u_int8_t icmp6_ni_nonce[8];
359 	/* could be followed by reply data */
360 } __packed;
361 
362 /*
363  * BEGIN android-removed: glibc doesn't have these, and external/ping declares them itself.
364 #define ni_type		icmp6_ni_hdr.icmp6_type
365 #define ni_code		icmp6_ni_hdr.icmp6_code
366 #define ni_cksum	icmp6_ni_hdr.icmp6_cksum
367 #define ni_qtype	icmp6_ni_hdr.icmp6_data16[0]
368 #define ni_flags	icmp6_ni_hdr.icmp6_data16[1]
369  * END android-removed
370  */
371 
372 #define NI_QTYPE_NOOP		0 /* NOOP  */
373 #define NI_QTYPE_SUPTYPES	1 /* Supported Qtypes */
374 #define NI_QTYPE_FQDN		2 /* FQDN (draft 04) */
375 #define NI_QTYPE_DNSNAME	2 /* DNS Name */
376 #define NI_QTYPE_NODEADDR	3 /* Node Addresses */
377 #define NI_QTYPE_IPV4ADDR	4 /* IPv4 Addresses */
378 
379 #define NI_SUPTYPE_FLAG_COMPRESS	0x0100
380 #define NI_FQDN_FLAG_VALIDTTL		0x0100
381 
382 #ifdef NAME_LOOKUPS_04
383 #define NI_NODEADDR_FLAG_LINKLOCAL	0x0100
384 #define NI_NODEADDR_FLAG_SITELOCAL	0x0200
385 #define NI_NODEADDR_FLAG_GLOBAL		0x0400
386 #define NI_NODEADDR_FLAG_ALL		0x0800
387 #define NI_NODEADDR_FLAG_TRUNCATE	0x1000
388 #define NI_NODEADDR_FLAG_ANYCAST	0x2000 /* just experimental. not in spec */
389 #else  /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */
390 #define NI_NODEADDR_FLAG_TRUNCATE	0x0100
391 #define NI_NODEADDR_FLAG_ALL		0x0200
392 #define NI_NODEADDR_FLAG_COMPAT		0x0400
393 #define NI_NODEADDR_FLAG_LINKLOCAL	0x0800
394 #define NI_NODEADDR_FLAG_SITELOCAL	0x1000
395 #define NI_NODEADDR_FLAG_GLOBAL		0x2000
396 #define NI_NODEADDR_FLAG_ANYCAST	0x4000 /* just experimental. not in spec */
397 #endif
398 
399 struct ni_reply_fqdn {
400 	u_int32_t ni_fqdn_ttl;	/* TTL */
401 	u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
402 	u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
403 } __packed;
404 
405 /*
406  * Router Renumbering. as router-renum-08.txt
407  */
408 struct icmp6_router_renum {	/* router renumbering header */
409 	struct icmp6_hdr	rr_hdr;
410 	u_int8_t	rr_segnum;
411 	u_int8_t	rr_flags;
412 	u_int16_t	rr_maxdelay;
413 	u_int32_t	rr_reserved;
414 } __packed;
415 
416 #define ICMP6_RR_FLAGS_TEST		0x80
417 #define ICMP6_RR_FLAGS_REQRESULT	0x40
418 #define ICMP6_RR_FLAGS_FORCEAPPLY	0x20
419 #define ICMP6_RR_FLAGS_SPECSITE		0x10
420 #define ICMP6_RR_FLAGS_PREVDONE		0x08
421 
422 #define rr_type		rr_hdr.icmp6_type
423 #define rr_code		rr_hdr.icmp6_code
424 #define rr_cksum	rr_hdr.icmp6_cksum
425 #define rr_seqnum 	rr_hdr.icmp6_data32[0]
426 
427 struct rr_pco_match {		/* match prefix part */
428 	u_int8_t	rpm_code;
429 	u_int8_t	rpm_len;
430 	u_int8_t	rpm_ordinal;
431 	u_int8_t	rpm_matchlen;
432 	u_int8_t	rpm_minlen;
433 	u_int8_t	rpm_maxlen;
434 	u_int16_t	rpm_reserved;
435 	struct	in6_addr	rpm_prefix;
436 } __packed;
437 
438 #define RPM_PCO_ADD		1
439 #define RPM_PCO_CHANGE		2
440 #define RPM_PCO_SETGLOBAL	3
441 #define RPM_PCO_MAX		4
442 
443 struct rr_pco_use {		/* use prefix part */
444 	u_int8_t	rpu_uselen;
445 	u_int8_t	rpu_keeplen;
446 	u_int8_t	rpu_ramask;
447 	u_int8_t	rpu_raflags;
448 	u_int32_t	rpu_vltime;
449 	u_int32_t	rpu_pltime;
450 	u_int32_t	rpu_flags;
451 	struct	in6_addr rpu_prefix;
452 } __packed;
453 #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK	0x80
454 #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO	0x40
455 
456 #define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME     0x80
457 #define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME     0x40
458 
459 struct rr_result {		/* router renumbering result message */
460 	u_int16_t	rrr_flags;
461 	u_int8_t	rrr_ordinal;
462 	u_int8_t	rrr_matchedlen;
463 	u_int32_t	rrr_ifid;
464 	struct	in6_addr rrr_prefix;
465 } __packed;
466 #define ICMP6_RR_RESULT_FLAGS_OOB		0x0200
467 #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN		0x0100
468 
469 /*
470  * icmp6 filter structures.
471  */
472 
473 struct icmp6_filter {
474 	u_int32_t icmp6_filt[8];
475 };
476 
477 /*
478  * BEGIN android-changed
479  * Linux and *BSD kernels use opposite values to indicate pass/block in ICMPv6
480  * filters, and assign a different value to the ICMP6_FILTER sockopt.
481  */
482 #define ICMP6_FILTER 1
483 
484 #define	ICMP6_FILTER_SETPASSALL(filterp) \
485 	(void)memset(filterp, 0x00, sizeof(struct icmp6_filter))
486 #define	ICMP6_FILTER_SETBLOCKALL(filterp) \
487 	(void)memset(filterp, 0xff, sizeof(struct icmp6_filter))
488 #define	ICMP6_FILTER_SETPASS(type, filterp) \
489 	(((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))
490 #define	ICMP6_FILTER_SETBLOCK(type, filterp) \
491 	(((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))
492 #define	ICMP6_FILTER_WILLPASS(type, filterp) \
493 	((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
494 #define	ICMP6_FILTER_WILLBLOCK(type, filterp) \
495 	((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
496 /*
497  * END android-changed
498  */
499 
500 #endif /* !_NETINET_ICMP6_H_ */
501