16617cf57SGeorge V. Neville-Neil.\" $KAME: icmp6.4,v 1.6 2004/12/27 05:30:56 itojun Exp $ 26617cf57SGeorge V. Neville-Neil.\" $OpenBSD: icmp6.4,v 1.19 2004/12/23 20:33:03 jaredy Exp $ 36617cf57SGeorge V. Neville-Neil.\" 46617cf57SGeorge V. Neville-Neil.\" Copyright (c) 1986, 1991, 1993 56617cf57SGeorge V. Neville-Neil.\" The Regents of the University of California. All rights reserved. 66617cf57SGeorge V. Neville-Neil.\" 76617cf57SGeorge V. Neville-Neil.\" Redistribution and use in source and binary forms, with or without 86617cf57SGeorge V. Neville-Neil.\" modification, are permitted provided that the following conditions 96617cf57SGeorge V. Neville-Neil.\" are met: 106617cf57SGeorge V. Neville-Neil.\" 1. Redistributions of source code must retain the above copyright 116617cf57SGeorge V. Neville-Neil.\" notice, this list of conditions and the following disclaimer. 126617cf57SGeorge V. Neville-Neil.\" 2. Redistributions in binary form must reproduce the above copyright 136617cf57SGeorge V. Neville-Neil.\" notice, this list of conditions and the following disclaimer in the 146617cf57SGeorge V. Neville-Neil.\" documentation and/or other materials provided with the distribution. 156617cf57SGeorge V. Neville-Neil.\" 3. Neither the name of the University nor the names of its contributors 166617cf57SGeorge V. Neville-Neil.\" may be used to endorse or promote products derived from this software 176617cf57SGeorge V. Neville-Neil.\" without specific prior written permission. 186617cf57SGeorge V. Neville-Neil.\" 196617cf57SGeorge V. Neville-Neil.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 206617cf57SGeorge V. Neville-Neil.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 216617cf57SGeorge V. Neville-Neil.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 226617cf57SGeorge V. Neville-Neil.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 236617cf57SGeorge V. Neville-Neil.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 246617cf57SGeorge V. Neville-Neil.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 256617cf57SGeorge V. Neville-Neil.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 266617cf57SGeorge V. Neville-Neil.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 276617cf57SGeorge V. Neville-Neil.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 286617cf57SGeorge V. Neville-Neil.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 296617cf57SGeorge V. Neville-Neil.\" SUCH DAMAGE. 306b806d21SRuslan Ermilov.\" 31*7f98104dSDag-Erling Smørgrav.Dd November 1, 2018 326617cf57SGeorge V. Neville-Neil.Dt ICMP6 4 336617cf57SGeorge V. Neville-Neil.Os 346617cf57SGeorge V. Neville-Neil.Sh NAME 356617cf57SGeorge V. Neville-Neil.Nm icmp6 366617cf57SGeorge V. Neville-Neil.Nd Internet Control Message Protocol for IPv6 376617cf57SGeorge V. Neville-Neil.Sh SYNOPSIS 386617cf57SGeorge V. Neville-Neil.In sys/socket.h 396617cf57SGeorge V. Neville-Neil.In netinet/in.h 406617cf57SGeorge V. Neville-Neil.In netinet/icmp6.h 416617cf57SGeorge V. Neville-Neil.Ft int 426617cf57SGeorge V. Neville-Neil.Fn socket AF_INET6 SOCK_RAW IPPROTO_ICMPV6 436617cf57SGeorge V. Neville-Neil.Sh DESCRIPTION 446617cf57SGeorge V. Neville-NeilICMPv6 is the error and control message protocol used by IPv6 and the 456617cf57SGeorge V. Neville-NeilIPv6 protocol family (see 466617cf57SGeorge V. Neville-Neil.Xr ip6 4 476617cf57SGeorge V. Neville-Neiland 486617cf57SGeorge V. Neville-Neil.Xr inet6 4 ) . 496617cf57SGeorge V. Neville-NeilIt may be accessed through a 506617cf57SGeorge V. Neville-Neil.Dq raw socket 516617cf57SGeorge V. Neville-Neilfor network monitoring and diagnostic functions. 526617cf57SGeorge V. Neville-Neil.Pp 536617cf57SGeorge V. Neville-NeilThe 546617cf57SGeorge V. Neville-Neil.Fa proto 556617cf57SGeorge V. Neville-Neilparameter to the 566617cf57SGeorge V. Neville-Neil.Xr socket 2 576617cf57SGeorge V. Neville-Neilcall to create an ICMPv6 socket may be obtained from 586617cf57SGeorge V. Neville-Neil.Xr getprotobyname 3 . 596617cf57SGeorge V. Neville-NeilICMPv6 sockets are connectionless, and are normally used with the 606617cf57SGeorge V. Neville-Neil.Xr sendto 2 616617cf57SGeorge V. Neville-Neiland 626617cf57SGeorge V. Neville-Neil.Xr recvfrom 2 636617cf57SGeorge V. Neville-Neilcalls, though the 646617cf57SGeorge V. Neville-Neil.Xr connect 2 656617cf57SGeorge V. Neville-Neilcall may also be used to fix the destination for future packets 666617cf57SGeorge V. Neville-Neil(in which case 676617cf57SGeorge V. Neville-Neil.Xr read 2 686617cf57SGeorge V. Neville-Neilor 696617cf57SGeorge V. Neville-Neil.Xr recv 2 706617cf57SGeorge V. Neville-Neiland 716617cf57SGeorge V. Neville-Neil.Xr write 2 726617cf57SGeorge V. Neville-Neilor 736617cf57SGeorge V. Neville-Neil.Xr send 2 746617cf57SGeorge V. Neville-Neilsystem calls may be used). 756617cf57SGeorge V. Neville-Neil.Pp 766617cf57SGeorge V. Neville-NeilOutgoing packets automatically have an IPv6 header prepended to them 776617cf57SGeorge V. Neville-Neil(based on the destination address). 786617cf57SGeorge V. Neville-NeilIncoming packets on the socket are received with the IPv6 header and any 796617cf57SGeorge V. Neville-Neilextension headers removed. 806617cf57SGeorge V. Neville-Neil.Ss Types 816617cf57SGeorge V. Neville-NeilICMPv6 messages are classified according to the type and code fields 826617cf57SGeorge V. Neville-Neilpresent in the ICMPv6 header. 836617cf57SGeorge V. Neville-NeilThe abbreviations for the types and codes may be used in rules in 846617cf57SGeorge V. Neville-Neil.Xr pf.conf 5 . 856617cf57SGeorge V. Neville-NeilThe following types are defined: 866617cf57SGeorge V. Neville-Neil.Bl -column x xxxxxxxxxxxx -offset indent 876617cf57SGeorge V. Neville-Neil.It Sy Num Ta Sy Abbrev. Ta Sy Description 886617cf57SGeorge V. Neville-Neil.It 1 Ta unreach Ta "Destination unreachable" 896617cf57SGeorge V. Neville-Neil.It 2 Ta toobig Ta "Packet too big" 906617cf57SGeorge V. Neville-Neil.It 3 Ta timex Ta "Time exceeded" 916617cf57SGeorge V. Neville-Neil.It 4 Ta paramprob Ta "Invalid IPv6 header" 926617cf57SGeorge V. Neville-Neil.It 128 Ta echoreq Ta "Echo service request" 936617cf57SGeorge V. Neville-Neil.It 129 Ta echorep Ta "Echo service reply" 946617cf57SGeorge V. Neville-Neil.It 130 Ta groupqry Ta "Group membership query" 956617cf57SGeorge V. Neville-Neil.It 130 Ta listqry Ta "Multicast listener query" 966617cf57SGeorge V. Neville-Neil.It 131 Ta grouprep Ta "Group membership report" 976617cf57SGeorge V. Neville-Neil.It 131 Ta listenrep Ta "Multicast listener report" 986617cf57SGeorge V. Neville-Neil.It 132 Ta groupterm Ta "Group membership termination" 99b06cfd40SJoel Dahl.It 132 Ta listendone Ta "Multicast listener done" 1006617cf57SGeorge V. Neville-Neil.It 133 Ta routersol Ta "Router solicitation" 1016617cf57SGeorge V. Neville-Neil.It 134 Ta routeradv Ta "Router advertisement" 1026617cf57SGeorge V. Neville-Neil.It 135 Ta neighbrsol Ta "Neighbor solicitation" 1036617cf57SGeorge V. Neville-Neil.It 136 Ta neighbradv Ta "Neighbor advertisement" 1046617cf57SGeorge V. Neville-Neil.It 137 Ta redir Ta "Shorter route exists" 1056617cf57SGeorge V. Neville-Neil.It 138 Ta routrrenum Ta "Route renumbering" 1066617cf57SGeorge V. Neville-Neil.It 139 Ta fqdnreq Ta "FQDN query" 1076617cf57SGeorge V. Neville-Neil.It 139 Ta niqry Ta "Node information query" 1086617cf57SGeorge V. Neville-Neil.It 139 Ta wrureq Ta "Who-are-you request" 1096617cf57SGeorge V. Neville-Neil.It 140 Ta fqdnrep Ta "FQDN reply" 1106617cf57SGeorge V. Neville-Neil.It 140 Ta nirep Ta "Node information reply" 1116617cf57SGeorge V. Neville-Neil.It 140 Ta wrurep Ta "Who-are-you reply" 1126617cf57SGeorge V. Neville-Neil.It 200 Ta mtraceresp Ta "mtrace response" 1136617cf57SGeorge V. Neville-Neil.It 201 Ta mtrace Ta "mtrace messages" 1146617cf57SGeorge V. Neville-Neil.El 1156617cf57SGeorge V. Neville-Neil.Pp 1166617cf57SGeorge V. Neville-NeilThe following codes are defined: 1176617cf57SGeorge V. Neville-Neil.Bl -column x xxxxxxxxxxxx xxxxxxxx -offset indent 1186617cf57SGeorge V. Neville-Neil.It Sy Num Ta Sy Abbrev. Ta Sy Type Ta 1196617cf57SGeorge V. Neville-Neil.Sy Description 1206617cf57SGeorge V. Neville-Neil.It 0 Ta noroute-unr Ta unreach Ta "No route to destination" 1216617cf57SGeorge V. Neville-Neil.It 1 Ta admin-unr Ta unreach Ta "Administratively prohibited" 1226617cf57SGeorge V. Neville-Neil.It 2 Ta beyond-unr Ta unreach Ta "Beyond scope of source address" 123b06cfd40SJoel Dahl.It 2 Ta notnbr-unr Ta unreach Ta "Not a neighbor (obsolete)" 1246617cf57SGeorge V. Neville-Neil.It 3 Ta addr-unr Ta unreach Ta "Address unreachable" 1256617cf57SGeorge V. Neville-Neil.It 4 Ta port-unr Ta unreach Ta "Port unreachable" 1266617cf57SGeorge V. Neville-Neil.It 0 Ta transit Ta timex Ta "Time exceeded in transit" 1276617cf57SGeorge V. Neville-Neil.It 1 Ta reassemb Ta timex Ta "Time exceeded in reassembly" 1286617cf57SGeorge V. Neville-Neil.It 0 Ta badhead Ta paramprob Ta "Erroneous header field" 1296617cf57SGeorge V. Neville-Neil.It 1 Ta nxthdr Ta paramprob Ta "Unrecognized next header" 1306617cf57SGeorge V. Neville-Neil.It 2 Ta "" Ta redir Ta "Unrecognized option" 1316617cf57SGeorge V. Neville-Neil.It 0 Ta redironlink Ta redir Ta "Redirection to on-link node" 1326617cf57SGeorge V. Neville-Neil.It 1 Ta redirrouter Ta redir Ta "Redirection to better router" 1336617cf57SGeorge V. Neville-Neil.El 1346617cf57SGeorge V. Neville-Neil.Ss Headers 1356617cf57SGeorge V. Neville-NeilAll ICMPv6 messages are prefixed with an ICMPv6 header. 1366617cf57SGeorge V. Neville-NeilThis header corresponds to the 1376617cf57SGeorge V. Neville-Neil.Vt icmp6_hdr 1386617cf57SGeorge V. Neville-Neilstructure and has the following definition: 1396617cf57SGeorge V. Neville-Neil.Bd -literal -offset indent 1406617cf57SGeorge V. Neville-Neilstruct icmp6_hdr { 1416b99842aSEd Schouten uint8_t icmp6_type; /* type field */ 1426b99842aSEd Schouten uint8_t icmp6_code; /* code field */ 1436b99842aSEd Schouten uint16_t icmp6_cksum; /* checksum field */ 1446617cf57SGeorge V. Neville-Neil union { 1456b99842aSEd Schouten uint32_t icmp6_un_data32[1]; /* type-specific */ 1466b99842aSEd Schouten uint16_t icmp6_un_data16[2]; /* type-specific */ 1476b99842aSEd Schouten uint8_t icmp6_un_data8[4]; /* type-specific */ 1486617cf57SGeorge V. Neville-Neil } icmp6_dataun; 1496617cf57SGeorge V. Neville-Neil} __packed; 1506617cf57SGeorge V. Neville-Neil 1516617cf57SGeorge V. Neville-Neil#define icmp6_data32 icmp6_dataun.icmp6_un_data32 1526617cf57SGeorge V. Neville-Neil#define icmp6_data16 icmp6_dataun.icmp6_un_data16 1536617cf57SGeorge V. Neville-Neil#define icmp6_data8 icmp6_dataun.icmp6_un_data8 1546617cf57SGeorge V. Neville-Neil#define icmp6_pptr icmp6_data32[0] /* parameter prob */ 1556617cf57SGeorge V. Neville-Neil#define icmp6_mtu icmp6_data32[0] /* packet too big */ 1566617cf57SGeorge V. Neville-Neil#define icmp6_id icmp6_data16[0] /* echo request/reply */ 1576617cf57SGeorge V. Neville-Neil#define icmp6_seq icmp6_data16[1] /* echo request/reply */ 1586617cf57SGeorge V. Neville-Neil#define icmp6_maxdelay icmp6_data16[0] /* mcast group membership*/ 1596617cf57SGeorge V. Neville-Neil.Ed 1606617cf57SGeorge V. Neville-Neil.Pp 1616617cf57SGeorge V. Neville-Neil.Va icmp6_type 1626617cf57SGeorge V. Neville-Neildescribes the type of the message. 1636617cf57SGeorge V. Neville-NeilSuitable values are defined in 1646617cf57SGeorge V. Neville-Neil.Aq Pa netinet/icmp6.h . 1656617cf57SGeorge V. Neville-Neil.Va icmp6_code 1666617cf57SGeorge V. Neville-Neildescribes the sub-type of the message and depends on 1676617cf57SGeorge V. Neville-Neil.Va icmp6_type . 1686617cf57SGeorge V. Neville-Neil.Va icmp6_cksum 1696617cf57SGeorge V. Neville-Neilcontains the checksum for the message and is filled in by the 1706617cf57SGeorge V. Neville-Neilkernel on outgoing messages. 1716617cf57SGeorge V. Neville-NeilThe other fields are used for type-specific purposes. 1726617cf57SGeorge V. Neville-Neil.Ss Filters 1736617cf57SGeorge V. Neville-NeilBecause of the extra functionality of ICMPv6 in comparison to ICMPv4, 1746617cf57SGeorge V. Neville-Neila larger number of messages may be potentially received on an ICMPv6 1756617cf57SGeorge V. Neville-Neilsocket. 1766617cf57SGeorge V. Neville-NeilInput filters may therefore be used to restrict input to a subset of the 1776617cf57SGeorge V. Neville-Neilincoming ICMPv6 messages so only interesting messages are returned by the 1786617cf57SGeorge V. Neville-Neil.Xr recv 2 1796617cf57SGeorge V. Neville-Neilfamily of calls to an application. 1806617cf57SGeorge V. Neville-Neil.Pp 1816617cf57SGeorge V. Neville-NeilThe 1826617cf57SGeorge V. Neville-Neil.Vt icmp6_filter 1836617cf57SGeorge V. Neville-Neilstructure may be used to refine the input message set according to the 1846617cf57SGeorge V. Neville-NeilICMPv6 type. 1856617cf57SGeorge V. Neville-NeilBy default, all messages types are allowed on newly created raw ICMPv6 1866617cf57SGeorge V. Neville-Neilsockets. 1876617cf57SGeorge V. Neville-NeilThe following macros may be used to refine the input set: 1886617cf57SGeorge V. Neville-Neil.Bl -tag -width Ds 189*7f98104dSDag-Erling Smørgrav.It Ft void Fn ICMP6_FILTER_SETPASSALL "struct icmp6_filter *filterp" 1906617cf57SGeorge V. Neville-NeilAllow all incoming messages. 1916617cf57SGeorge V. Neville-Neil.Va filterp 1926617cf57SGeorge V. Neville-Neilis modified to allow all message types. 193*7f98104dSDag-Erling Smørgrav.It Ft void Fn ICMP6_FILTER_SETBLOCKALL "struct icmp6_filter *filterp" 1946617cf57SGeorge V. Neville-NeilIgnore all incoming messages. 1956617cf57SGeorge V. Neville-Neil.Va filterp 1966617cf57SGeorge V. Neville-Neilis modified to ignore all message types. 1974f068961SRuslan Ermilov.It Xo 1984f068961SRuslan Ermilov.Ft void 1994f068961SRuslan Ermilov.Fn ICMP6_FILTER_SETPASS "int type" "struct icmp6_filter *filterp" 2004f068961SRuslan Ermilov.Xc 2016617cf57SGeorge V. Neville-NeilAllow ICMPv6 messages with the given 2026617cf57SGeorge V. Neville-Neil.Fa type . 2036617cf57SGeorge V. Neville-Neil.Va filterp 2046617cf57SGeorge V. Neville-Neilis modified to allow such messages. 2054f068961SRuslan Ermilov.It Xo 2064f068961SRuslan Ermilov.Ft void 207*7f98104dSDag-Erling Smørgrav.Fn ICMP6_FILTER_SETBLOCK "int type" "struct icmp6_filter *filterp" 2084f068961SRuslan Ermilov.Xc 2096617cf57SGeorge V. Neville-NeilIgnore ICMPv6 messages with the given 2106617cf57SGeorge V. Neville-Neil.Fa type . 2116617cf57SGeorge V. Neville-Neil.Va filterp 2126617cf57SGeorge V. Neville-Neilis modified to ignore such messages. 2134f068961SRuslan Ermilov.It Xo 2144f068961SRuslan Ermilov.Ft int 215*7f98104dSDag-Erling Smørgrav.Fn ICMP6_FILTER_WILLPASS "int type" "const struct icmp6_filter *filterp" 2164f068961SRuslan Ermilov.Xc 2176617cf57SGeorge V. Neville-NeilDetermine if the given filter will allow an ICMPv6 message of the given 2186617cf57SGeorge V. Neville-Neiltype. 2194f068961SRuslan Ermilov.It Xo 2204f068961SRuslan Ermilov.Ft int 221*7f98104dSDag-Erling Smørgrav.Fn ICMP6_FILTER_WILLBLOCK "int type" "const struct icmp6_filter *filterp" 2224f068961SRuslan Ermilov.Xc 2236617cf57SGeorge V. Neville-NeilDetermine if the given filter will ignore an ICMPv6 message of the given 2246617cf57SGeorge V. Neville-Neiltype. 2256617cf57SGeorge V. Neville-Neil.El 2266617cf57SGeorge V. Neville-Neil.Pp 2276617cf57SGeorge V. Neville-NeilThe 2286617cf57SGeorge V. Neville-Neil.Xr getsockopt 2 2296617cf57SGeorge V. Neville-Neiland 2306617cf57SGeorge V. Neville-Neil.Xr setsockopt 2 2316617cf57SGeorge V. Neville-Neilcalls may be used to obtain and install the filter on ICMPv6 sockets at 2326617cf57SGeorge V. Neville-Neiloption level 2336617cf57SGeorge V. Neville-Neil.Dv IPPROTO_ICMPV6 2346617cf57SGeorge V. Neville-Neiland name 2352c862c97SXin LI.Dv ICMP6_FILTER 2366617cf57SGeorge V. Neville-Neilwith a pointer to the 2376617cf57SGeorge V. Neville-Neil.Vt icmp6_filter 2386617cf57SGeorge V. Neville-Neilstructure as the option value. 2396617cf57SGeorge V. Neville-Neil.Sh SEE ALSO 2406617cf57SGeorge V. Neville-Neil.Xr getsockopt 2 , 2416617cf57SGeorge V. Neville-Neil.Xr recv 2 , 2426617cf57SGeorge V. Neville-Neil.Xr send 2 , 2436617cf57SGeorge V. Neville-Neil.Xr setsockopt 2 , 2446617cf57SGeorge V. Neville-Neil.Xr socket 2 , 2456617cf57SGeorge V. Neville-Neil.Xr getprotobyname 3 , 2466617cf57SGeorge V. Neville-Neil.Xr inet6 4 , 2476617cf57SGeorge V. Neville-Neil.Xr ip6 4 , 2486617cf57SGeorge V. Neville-Neil.Xr netintro 4 2496617cf57SGeorge V. Neville-Neil.Rs 2506617cf57SGeorge V. Neville-Neil.%A W. Stevens 2516617cf57SGeorge V. Neville-Neil.%A M. Thomas 2526617cf57SGeorge V. Neville-Neil.%T Advanced Sockets API for IPv6 2536617cf57SGeorge V. Neville-Neil.%N RFC 2292 2546617cf57SGeorge V. Neville-Neil.%D February 1998 2556617cf57SGeorge V. Neville-Neil.Re 2566617cf57SGeorge V. Neville-Neil.Rs 2576617cf57SGeorge V. Neville-Neil.%A A. Conta 2586617cf57SGeorge V. Neville-Neil.%A S. Deering 2596617cf57SGeorge V. Neville-Neil.%T "Internet Control Message Protocol (ICMPv6) for the Internet" \ 2606617cf57SGeorge V. Neville-Neil "Protocol Version 6 (IPv6) Specification" 2616617cf57SGeorge V. Neville-Neil.%N RFC 2463 2626617cf57SGeorge V. Neville-Neil.%D December 1998 2636617cf57SGeorge V. Neville-Neil.Re 264*7f98104dSDag-Erling Smørgrav.Rs 265*7f98104dSDag-Erling Smørgrav.%A W. Stevens 266*7f98104dSDag-Erling Smørgrav.%A M. Thomas 267*7f98104dSDag-Erling Smørgrav.%A E. Nordmark 268*7f98104dSDag-Erling Smørgrav.%A T. Jinmei 269*7f98104dSDag-Erling Smørgrav.%T "Advanced Sockets Application Program Interface (API) for IPv6" 270*7f98104dSDag-Erling Smørgrav.%R RFC 3542 271*7f98104dSDag-Erling Smørgrav.%D May 2003 272*7f98104dSDag-Erling Smørgrav.Re 273*7f98104dSDag-Erling Smørgrav.Rs 274*7f98104dSDag-Erling Smørgrav.%A A. Conta 275*7f98104dSDag-Erling Smørgrav.%A S. Deering 276*7f98104dSDag-Erling Smørgrav.%A M. Gupta 277*7f98104dSDag-Erling Smørgrav.%T "Internet Control Message Protocol (ICMPv6) for the Internet" \ 278*7f98104dSDag-Erling Smørgrav "Protocol Version 6 (IPv6) Specification" 279*7f98104dSDag-Erling Smørgrav.%R RFC 4443 280*7f98104dSDag-Erling Smørgrav.%D March 2006 281*7f98104dSDag-Erling Smørgrav.Re 282