1 .\" Copyright (C) 1999 WIDE Project.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the project nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" Copyright (c) 1986, 1991, 1993
29 .\" The Regents of the University of California. All rights reserved.
31 .\" Redistribution and use in source and binary forms, with or without
32 .\" modification, are permitted provided that the following conditions
34 .\" 1. Redistributions of source code must retain the above copyright
35 .\" notice, this list of conditions and the following disclaimer.
36 .\" 2. Redistributions in binary form must reproduce the above copyright
37 .\" notice, this list of conditions and the following disclaimer in the
38 .\" documentation and/or other materials provided with the distribution.
39 .\" 3. All advertising materials mentioning features or use of this software
40 .\" must display the following acknowledgement:
41 .\" This product includes software developed by the University of
42 .\" California, Berkeley and its contributors.
43 .\" 4. Neither the name of the University nor the names of its contributors
44 .\" may be used to endorse or promote products derived from this software
45 .\" without specific prior written permission.
47 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
48 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
51 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 .\" KAME $Id: icmp6.4,v 1.1 1999/12/17 09:47:01 itojun Exp $
60 .\" $FreeBSD: src/share/man/man4/icmp6.4,v 1.1.2.7 2001/12/17 11:30:12 ru Exp $
61 .\" $DragonFly: src/share/man/man4/icmp6.4,v 1.2 2003/06/17 04:36:59 dillon Exp $
69 .Nd Internet Control Message Protocol for IPv6
77 .Fn socket AF_INET6 SOCK_RAW proto
81 is the error and control message protocol used
84 and the Internet protocol family.
85 It may be accessed through a
87 for network monitoring and diagnostic functions.
90 parameter to the socket call to create an
92 socket is obtained from
93 .Xr getprotobyname 3 ,
97 sockets are connectionless, and are normally used with the
103 call may also be used to fix the destination for future packets
112 system calls may be used).
114 Outgoing packets automatically have an
116 header prepended to them
117 (based on the destination address).
119 pseudo header checksum field
121 will be filled automatically by the kernel.
122 Incoming packets are received without the
124 header nor IPv6 extension headers.
125 Notice that this behavior is opposite from
131 .Ss ICMPv6 type/code filter
134 raw socket has an associated filter whose datatype is defined as
135 .Li struct icmp6_filter ;
137 This structure, along with the macros and constants defined later in
138 this section, are defined as a result of including the
139 .Aq Li netinet/icmp6.h
142 The current filter is fetched and stored using
148 and an option name of
151 Six macros operate on an icmp6_filter structure:
152 .\" is "Fn" legal for macros?
153 .Bl -item -offset indent
156 .Fn ICMP6_FILTER_SETPASSALL "struct icmp6_filter *filterp"
159 .Fn ICMP6_FILTER_SETBLOCKALL "struct icmp6_filter *filterp"
162 .Fn ICMP6_FILTER_SETPASS "int type" "struct icmp6_filter *filterp"
165 .Fn ICMP6_FILTER_SETBLOCK "int type" "struct icmp6_filter *filterp"
168 .Fn ICMP6_FILTER_WILLPASS "int type" "const struct icmp6_filter *filterp"
171 .Fn ICMP6_FILTER_WILLBLOCK "int type" "const struct icmp6_filter *filterp"
174 The first argument to the last four macros
178 message type, between 0 and 255.
179 The pointer argument to all six
180 macros is a pointer to a filter that is modified by the first four
181 macros examined by the last two macros.
183 The first two macros,
190 messages are passed to the application or that all
192 messages are blocked from being passed to the application.
201 type should be passed to the application
202 or not passed to the application
205 The final two macros,
210 depending whether the specified message type is passed to the
211 application or blocked from being passed to the application by the
212 filter pointed to by the second argument.
216 raw socket is created, it will by default pass all
218 message types to the application.
220 For further discussions see RFC2292.
223 A socket operation may fail with one of the following errors returned:
226 when trying to establish a connection on a socket which
227 already has one, or when trying to send a datagram with the destination
228 address specified and the socket is already connected;
230 when trying to send a datagram, but
231 no destination address is specified, and the socket hasn't been
234 when the system runs out of memory for
235 an internal data structure;
236 .It Bq Er EADDRNOTAVAIL
237 when an attempt is made to create a
238 socket with a network address for which no network interface exists.
253 .%T "Advanced Sockets API for IPv6"
261 .%T "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification"
265 The implementation is based on KAME stack
266 (which is descendant of WIDE hydrangea IPv6 stack kit).
268 Part of the document was shamelessly copied from RFC2292.