Protocols icmp6(7P)
NAME
icmp6 - Internet Control Message Protocol for Internet Pro-
tocol Version 6
SYNOPSIS
#include
#include
#include
#include
s = socket(AFINET6, SOCKRAW, proto);
t = topen("/dev/icmp6", ORDWR);
DESCRIPTION
The ICMP6 protocol is the error and control message protocol
used with Version 6 of the Internet Protocol. It is used by
the kernel to handle and report errors in protocol process-
ing. It is also used for IPv6 neighbor and router discovery,
and for multicast group membership queries and reports. It
may also be accessed by programs using the socket interface
or the Transport Level Interface (TLI) for network monitor-
ing and diagnostic functions. When used with the socket
interface, a "raw socket" type is used. The protocol number
for ICMP6, used in the proto parameter to the socket call,
can be obtained from getprotobyname(3SOCKET). ICMP6 file
descriptors and sockets are connectionless and are normally
used with the tsndudata / trcvudata and the sendto() /
recvfrom() calls. They may also be used with the
sendmsg()/recvgmsg() calls when sending or receiving ancil-
lary data.
Outgoing packets automatically have an Internet Protocol
Version 6 (IPv6) header and zero or more IPv6 extension
headers prepended. These headers are prepended by the ker-
nel. Unlike ICMP for IPv4, the IPHDRINCL option is not sup-
ported for ICMP6, so ICMP6 applications neither build their
own outbound IPv6 headers, nor do they receive the inbound
IPv6 headers with received data. IPv6 extension headers and
relevant fields of the IPv6 header may be set or received as
ancillary data to a sendmsg(3SOCKET) or recvmsg(3SOCKET)
system call. Each of these fields and extension headers may
also be set on a per socket basis with the
setsockopt(3SOCKET) system call. Such "sticky" options are
used on all outgoing packets unless overridden by ancillary
data. When any ancillary data is present with a
sendmsg(3SOCKET) system call, all sticky options are ignored
for that system call, but subsequently remain configured.
SunOS 5.11 Last change: 10 Nov 1999 1
Protocols icmp6(7P)
ICMP6 is a datagram protocol layered above IPv6. Received
ICMP6 messages may be reflected back to users of higher-
level protocols such as TCP or UDP as error returns from
system calls. A copy of each ICMP6error message received by
the system is provided to every holder of an open ICMP6
socket or TLI descriptor.
SEE ALSO
getprotobyname(3SOCKET), recv(3SOCKET), recvmsg(3SOCKET),
send(3SOCKET), sendmsg(3SOCKET), setsockopt(3SOCKET),
trcvudata(3NSL), tsndudata(3NSL), inet6(7P), ip6(7P),
routing(7P)
Conta, A. and Deering, S., RFC 2463, Internet Control Mes-
sage Protocol (ICMPv6) for the Internet Protocol Version 6
(IPv6) Specification, The Internet Society, December 1998.
DIAGNOSTICS
A socket operation may fail with one of the following errors
returned:
EISCON An attempt was made to establish a connec-
tion on a socket which already has one, or
when trying to send a datagram with the
destination address specified and the
socket is already connected.
ENOTCON An attempt was made to send a datagram, but
no destination address is specified, and
the socket has not been connected.
ENOBUFS The system ran out of memory for an inter-
nal data structure.
EADRNOTAVAIL An attempt was made to create a socket with
a network address for which no network
interface exists.
ENOMEM The system was unable to allocate memory
for an internal data structure.
ENOPROTOPT An attempt was made to set an IPv4 socket
option on an IPv6 socket.
SunOS 5.11 Last change: 10 Nov 1999 2
Protocols icmp6(7P)
EINVAL An attempt was made to set an invalid or
malformed socket option.
EAFNOSUPORT An attempt was made to bind or connect to
an IPv4 or mapped address, or to specify an
IPv4 or mapped address as the next hop.
SunOS 5.11 Last change: 10 Nov 1999 3
|