xref: /freebsd/share/man/man4/ip6.4 (revision 29fc4075e69fd27de0cded313ac6000165d99f8b)
1.\"	$KAME: ip6.4,v 1.23 2005/01/11 05:56:25 itojun Exp $
2.\"	$OpenBSD: ip6.4,v 1.21 2005/01/06 03:50:46 itojun Exp $
3.\"
4.\" Copyright (c) 1983, 1991, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" $FreeBSD$
32.\"
33.Dd July 24, 2022
34.Dt IP6 4
35.Os
36.Sh NAME
37.Nm ip6
38.Nd Internet Protocol version 6 (IPv6) network layer
39.Sh SYNOPSIS
40.In sys/socket.h
41.In netinet/in.h
42.Ft int
43.Fn socket AF_INET6 SOCK_RAW proto
44.Sh DESCRIPTION
45The IPv6 network layer is used by the IPv6 protocol family for
46transporting data.
47IPv6 packets contain an IPv6 header that is not provided as part of the
48payload contents when passed to an application.
49IPv6 header options affect the behavior of this protocol and may be used
50by high-level protocols (such as the
51.Xr tcp 4
52and
53.Xr udp 4
54protocols) as well as directly by
55.Dq raw sockets ,
56which process IPv6 messages at a lower-level and may be useful for
57developing new protocols and special-purpose applications.
58.Ss Header
59All IPv6 packets begin with an IPv6 header.
60When data received by the kernel are passed to the application, this
61header is not included in buffer, even when raw sockets are being used.
62Likewise, when data are sent to the kernel for transmit from the
63application, the buffer is not examined for an IPv6 header:
64the kernel always constructs the header.
65To directly access IPv6 headers from received packets and specify them
66as part of the buffer passed to the kernel, link-level access
67.Po
68.Xr bpf 4 ,
69for example
70.Pc
71must instead be utilized.
72.Pp
73The header has the following definition:
74.Bd -literal -offset indent
75struct ip6_hdr {
76     union {
77          struct ip6_hdrctl {
78               uint32_t ip6_un1_flow;	/* 20 bits of flow ID */
79               uint16_t ip6_un1_plen;	/* payload length */
80               uint8_t  ip6_un1_nxt;	/* next header */
81               uint8_t  ip6_un1_hlim;	/* hop limit */
82          } ip6_un1;
83          uint8_t ip6_un2_vfc;	/* version and class */
84     } ip6_ctlun;
85     struct in6_addr ip6_src;	/* source address */
86     struct in6_addr ip6_dst;	/* destination address */
87} __packed;
88
89#define ip6_vfc		ip6_ctlun.ip6_un2_vfc
90#define ip6_flow	ip6_ctlun.ip6_un1.ip6_un1_flow
91#define ip6_plen	ip6_ctlun.ip6_un1.ip6_un1_plen
92#define ip6_nxt		ip6_ctlun.ip6_un1.ip6_un1_nxt
93#define ip6_hlim	ip6_ctlun.ip6_un1.ip6_un1_hlim
94#define ip6_hops	ip6_ctlun.ip6_un1.ip6_un1_hlim
95.Ed
96.Pp
97All fields are in network-byte order.
98Any options specified (see
99.Sx Options
100below) must also be specified in network-byte order.
101.Pp
102.Va ip6_flow
103specifies the flow ID.
104.Va ip6_plen
105specifies the payload length.
106.Va ip6_nxt
107specifies the type of the next header.
108.Va ip6_hlim
109specifies the hop limit.
110.Pp
111The top 4 bits of
112.Va ip6_vfc
113specify the class and the bottom 4 bits specify the version.
114.Pp
115.Va ip6_src
116and
117.Va ip6_dst
118specify the source and destination addresses.
119.Pp
120The IPv6 header may be followed by any number of extension headers that start
121with the following generic definition:
122.Bd -literal -offset indent
123struct ip6_ext {
124     uint8_t ip6e_nxt;
125     uint8_t ip6e_len;
126} __packed;
127.Ed
128.Ss Options
129IPv6 allows header options on packets to manipulate the behavior of the
130protocol.
131These options and other control requests are accessed with the
132.Xr getsockopt 2
133and
134.Xr setsockopt 2
135system calls at level
136.Dv IPPROTO_IPV6
137and by using ancillary data in
138.Xr recvmsg 2
139and
140.Xr sendmsg 2 .
141They can be used to access most of the fields in the IPv6 header and
142extension headers.
143.Pp
144The following socket options are supported:
145.Bl -tag -width Ds
146.\" .It Dv IPV6_OPTIONS
147.It Dv IPV6_UNICAST_HOPS Fa "int *"
148Get or set the default hop limit header field for outgoing unicast
149datagrams sent on this socket.
150.\" .It Dv IPV6_RECVOPTS Fa "int *"
151.\" Get or set the status of whether all header options will be
152.\" delivered along with the datagram when it is received.
153.\" .It Dv IPV6_RECVRETOPTS Fa "int *"
154.\" Get or set the status of whether header options will be delivered
155.\" for reply.
156.\" .It Dv IPV6_RECVDSTADDR Fa "int *"
157.\" Get or set the status of whether datagrams are received with
158.\" destination addresses.
159.\" .It Dv IPV6_RETOPTS
160.\" Get or set IPv6 options.
161.It Dv IPV6_MULTICAST_IF Fa "u_int *"
162Get or set the interface from which multicast packets will be sent.
163For hosts with multiple interfaces, each multicast transmission is sent
164from the primary network interface.
165The interface is specified as its index as provided by
166.Xr if_nametoindex 3 .
167A value of zero specifies the default interface.
168.It Dv IPV6_MULTICAST_HOPS Fa "int *"
169Get or set the default hop limit header field for outgoing multicast
170datagrams sent on this socket.
171This option controls the scope of multicast datagram transmissions.
172.Pp
173Datagrams with a hop limit of 1 are not forwarded beyond the local
174network.
175Multicast datagrams with a hop limit of zero will not be transmitted on
176any network but may be delivered locally if the sending host belongs to
177the destination group and if multicast loopback (see below) has not been
178disabled on the sending socket.
179Multicast datagrams with a hop limit greater than 1 may be forwarded to
180the other networks if a multicast router (such as
181.Xr mrouted 8 Pq Pa ports/net/mrouted )
182is attached to the local network.
183.It Dv IPV6_MULTICAST_LOOP Fa "u_int *"
184Get or set the status of whether multicast datagrams will be looped back
185for local delivery when a multicast datagram is sent to a group to which
186the sending host belongs.
187.Pp
188This option improves performance for applications that may have no more
189than one instance on a single host (such as a router daemon) by
190eliminating the overhead of receiving their own transmissions.
191It should generally not be used by applications for which there may be
192more than one instance on a single host (such as a conferencing program)
193or for which the sender does not belong to the destination group
194(such as a time-querying program).
195.Pp
196A multicast datagram sent with an initial hop limit greater than 1 may
197be delivered to the sending host on a different interface from that on
198which it was sent if the host belongs to the destination group on that
199other interface.
200The multicast loopback control option has no effect on such delivery.
201.It Dv IPV6_JOIN_GROUP Fa "struct ipv6_mreq *"
202Join a multicast group.
203A host must become a member of a multicast group before it can receive
204datagrams sent to the group.
205.Bd -literal
206struct ipv6_mreq {
207	struct in6_addr	ipv6mr_multiaddr;
208	unsigned int	ipv6mr_interface;
209};
210.Ed
211.Pp
212.Va ipv6mr_interface
213may be set to zeroes to choose the default multicast interface or to the
214index of a particular multicast-capable interface if the host is
215multihomed.
216Membership is associated with a single interface; programs running on
217multihomed hosts may need to join the same group on more than one
218interface.
219.Pp
220If the multicast address is unspecified (i.e., all zeroes), messages
221from all multicast addresses will be accepted by this group.
222Note that setting to this value requires superuser privileges.
223.It Dv IPV6_LEAVE_GROUP Fa "struct ipv6_mreq *"
224Drop membership from the associated multicast group.
225Memberships are automatically dropped when the socket is closed or when
226the process exits.
227.It Dv IPV6_ORIGDSTADDR Fa "int *"
228Get or set whether a datagram's original destination address and port are
229returned as ancillary data along with the payload in subsequent
230.Xr recvmsg 2
231calls.
232The information is stored in the the ancillary data as a
233.Tn sockaddr_in6
234structure.
235.It Dv IPV6_PORTRANGE Fa "int *"
236Get or set the allocation policy of ephemeral ports for when the kernel
237automatically binds a local address to this socket.
238The following values are available:
239.Pp
240.Bl -tag -width IPV6_PORTRANGE_DEFAULT -compact
241.It Dv IPV6_PORTRANGE_DEFAULT
242Use the regular range of non-reserved ports (varies, see
243.Xr ip 4 ) .
244.It Dv IPV6_PORTRANGE_HIGH
245Use a high range (varies, see
246.Xr ip 4 ) .
247.It Dv IPV6_PORTRANGE_LOW
248Use a low, reserved range (600\-1023, see
249.Xr ip 4 ) .
250.El
251.It Dv IPV6_PKTINFO Fa "int *"
252Get or set whether additional information about subsequent packets will
253be provided as ancillary data along with the payload in subsequent
254.Xr recvmsg 2
255calls.
256The information is stored in the following structure in the ancillary
257data returned:
258.Bd -literal
259struct in6_pktinfo {
260	struct in6_addr ipi6_addr;    /* src/dst IPv6 address */
261	unsigned int    ipi6_ifindex; /* send/recv if index */
262};
263.Ed
264.It Dv IPV6_HOPLIMIT Fa "int *"
265Get or set whether the hop limit header field from subsequent packets
266will be provided as ancillary data along with the payload in subsequent
267.Xr recvmsg 2
268calls.
269The value is stored as an
270.Vt int
271in the ancillary data returned.
272.\" .It Dv IPV6_NEXTHOP Fa "int *"
273.\" Get or set whether the address of the next hop for subsequent
274.\" packets will be provided as ancillary data along with the payload in
275.\" subsequent
276.\" .Xr recvmsg 2
277.\" calls.
278.\" The option is stored as a
279.\" .Vt sockaddr
280.\" structure in the ancillary data returned.
281.\" .Pp
282.\" This option requires superuser privileges.
283.It Dv IPV6_HOPOPTS Fa "int *"
284Get or set whether the hop-by-hop options from subsequent packets will be
285provided as ancillary data along with the payload in subsequent
286.Xr recvmsg 2
287calls.
288The option is stored in the following structure in the ancillary data
289returned:
290.Bd -literal
291struct ip6_hbh {
292	uint8_t ip6h_nxt;	/* next header */
293	uint8_t ip6h_len;	/* length in units of 8 octets */
294/* followed by options */
295} __packed;
296.Ed
297.Pp
298The
299.Fn inet6_opt_init
300routine and family of routines may be used to manipulate this data.
301.Pp
302This option requires superuser privileges.
303.It Dv IPV6_DSTOPTS Fa "int *"
304Get or set whether the destination options from subsequent packets will
305be provided as ancillary data along with the payload in subsequent
306.Xr recvmsg 2
307calls.
308The option is stored in the following structure in the ancillary data
309returned:
310.Bd -literal
311struct ip6_dest {
312	uint8_t ip6d_nxt;	/* next header */
313	uint8_t ip6d_len;	/* length in units of 8 octets */
314/* followed by options */
315} __packed;
316.Ed
317.Pp
318The
319.Fn inet6_opt_init
320routine and family of routines may be used to manipulate this data.
321.Pp
322This option requires superuser privileges.
323.It Dv IPV6_TCLASS Fa "int *"
324Get or set the value of the traffic class field used for outgoing datagrams
325on this socket.
326The value must be between \-1 and 255.
327A value of \-1 resets to the default value.
328.It Dv IPV6_RECVTCLASS Fa "int *"
329Get or set the status of whether the traffic class header field will be
330provided as ancillary data along with the payload in subsequent
331.Xr recvmsg 2
332calls.
333The header field is stored as a single value of type
334.Vt int .
335.It Dv IPV6_RTHDR Fa "int *"
336Get or set whether the routing header from subsequent packets will be
337provided as ancillary data along with the payload in subsequent
338.Xr recvmsg 2
339calls.
340The header is stored in the following structure in the ancillary data
341returned:
342.Bd -literal
343struct ip6_rthdr {
344	uint8_t ip6r_nxt;	/* next header */
345	uint8_t ip6r_len;	/* length in units of 8 octets */
346	uint8_t ip6r_type;	/* routing type */
347	uint8_t ip6r_segleft;	/* segments left */
348/* followed by routing-type-specific data */
349} __packed;
350.Ed
351.Pp
352The
353.Fn inet6_opt_init
354routine and family of routines may be used to manipulate this data.
355.Pp
356This option requires superuser privileges.
357.It Dv IPV6_PKTOPTIONS Fa "struct cmsghdr *"
358Get or set all header options and extension headers at one time on the
359last packet sent or received on the socket.
360All options must fit within the size of an mbuf (see
361.Xr mbuf 9 ) .
362Options are specified as a series of
363.Vt cmsghdr
364structures followed by corresponding values.
365.Va cmsg_level
366is set to
367.Dv IPPROTO_IPV6 ,
368.Va cmsg_type
369to one of the other values in this list, and trailing data to the option
370value.
371When setting options, if the length
372.Va optlen
373to
374.Xr setsockopt 2
375is zero, all header options will be reset to their default values.
376Otherwise, the length should specify the size the series of control
377messages consumes.
378.Pp
379Instead of using
380.Xr sendmsg 2
381to specify option values, the ancillary data used in these calls that
382correspond to the desired header options may be directly specified as
383the control message in the series of control messages provided as the
384argument to
385.Xr setsockopt 2 .
386.It Dv IPV6_CHECKSUM Fa "int *"
387Get or set the byte offset into a packet where the 16-bit checksum is
388located.
389When set, this byte offset is where incoming packets will be expected
390to have checksums of their data stored and where outgoing packets will
391have checksums of their data computed and stored by the kernel.
392A value of \-1 specifies that no checksums will be checked on incoming
393packets and that no checksums will be computed or stored on outgoing
394packets.
395The offset of the checksum for ICMPv6 sockets cannot be relocated or
396turned off.
397.It Dv IPV6_V6ONLY Fa "int *"
398Get or set whether only IPv6 connections can be made to this socket.
399For wildcard sockets, this can restrict connections to IPv6 only.
400.\"With
401.\".Ox
402.\"IPv6 sockets are always IPv6-only, so the socket option is read-only
403.\"(not modifiable).
404.It Dv IPV6_USE_MIN_MTU Fa "int *"
405Get or set whether the minimal IPv6 maximum transmission unit (MTU) size
406will be used to avoid fragmentation from occurring for subsequent
407outgoing datagrams.
408.It Dv IPV6_AUTH_LEVEL Fa "int *"
409Get or set the
410.Xr ipsec 4
411authentication level.
412.It Dv IPV6_ESP_TRANS_LEVEL Fa "int *"
413Get or set the ESP transport level.
414.It Dv IPV6_ESP_NETWORK_LEVEL Fa "int *"
415Get or set the ESP encapsulation level.
416.It Dv IPV6_IPCOMP_LEVEL Fa "int *"
417Get or set the
418.Xr ipcomp 4
419level.
420.El
421.Pp
422The
423.Dv IPV6_PKTINFO ,
424.\" .Dv IPV6_NEXTHOP ,
425.Dv IPV6_HOPLIMIT ,
426.Dv IPV6_HOPOPTS ,
427.Dv IPV6_DSTOPTS ,
428.Dv IPV6_RTHDR ,
429and
430.Dv IPV6_ORIGDSTADDR
431options will return ancillary data along with payload contents in subsequent
432.Xr recvmsg 2
433calls with
434.Va cmsg_level
435set to
436.Dv IPPROTO_IPV6
437and
438.Va cmsg_type
439set to respective option name value (e.g.,
440.Dv IPV6_HOPTLIMIT ) .
441Some of these options may also be used directly as ancillary
442.Va cmsg_type
443values in
444.Xr sendmsg 2
445to set options on the packet being transmitted by the call.
446The
447.Va cmsg_level
448value must be
449.Dv IPPROTO_IPV6 .
450For these options, the ancillary data object value format is the same
451as the value returned as explained for each when received with
452.Xr recvmsg 2 .
453.Pp
454Note that using
455.Xr sendmsg 2
456to specify options on particular packets works only on UDP and raw sockets.
457To manipulate header options for packets on TCP sockets, only the socket
458options may be used.
459.Pp
460In some cases, there are multiple APIs defined for manipulating an IPv6
461header field.
462A good example is the outgoing interface for multicast datagrams, which
463can be set by the
464.Dv IPV6_MULTICAST_IF
465socket option, through the
466.Dv IPV6_PKTINFO
467option, and through the
468.Va sin6_scope_id
469field of the socket address passed to the
470.Xr sendto 2
471system call.
472.Pp
473Resolving these conflicts is implementation dependent.
474This implementation determines the value in the following way:
475options specified by using ancillary data (i.e.,
476.Xr sendmsg 2 )
477are considered first,
478options specified by using
479.Dv IPV6_PKTOPTIONS
480to set
481.Dq sticky
482options are considered second,
483options specified by using the individual, basic, and direct socket
484options (e.g.,
485.Dv IPV6_UNICAST_HOPS )
486are considered third,
487and options specified in the socket address supplied to
488.Xr sendto 2
489are the last choice.
490.Ss Multicasting
491IPv6 multicasting is supported only on
492.Dv AF_INET6
493sockets of type
494.Dv SOCK_DGRAM
495and
496.Dv SOCK_RAW ,
497and only on networks where the interface driver supports
498multicasting.
499Socket options (see above) that manipulate membership of
500multicast groups and other multicast options include
501.Dv IPV6_MULTICAST_IF ,
502.Dv IPV6_MULTICAST_HOPS ,
503.Dv IPV6_MULTICAST_LOOP ,
504.Dv IPV6_LEAVE_GROUP ,
505and
506.Dv IPV6_JOIN_GROUP .
507.Ss Raw Sockets
508Raw IPv6 sockets are connectionless and are normally used with the
509.Xr sendto 2
510and
511.Xr recvfrom 2
512calls, although the
513.Xr connect 2
514call may be used to fix the destination address for future outgoing
515packets so that
516.Xr send 2
517may instead be used and the
518.Xr bind 2
519call may be used to fix the source address for future outgoing
520packets instead of having the kernel choose a source address.
521.Pp
522By using
523.Xr connect 2
524or
525.Xr bind 2 ,
526raw socket input is constrained to only packets with their
527source address matching the socket destination address if
528.Xr connect 2
529was used and to packets with their destination address
530matching the socket source address if
531.Xr bind 2
532was used.
533.Pp
534If the
535.Ar proto
536argument to
537.Xr socket 2
538is zero, the default protocol
539.Pq Dv IPPROTO_RAW
540is used for outgoing packets.
541For incoming packets, protocols recognized by kernel are
542.Sy not
543passed to the application socket (e.g.,
544.Xr tcp 4
545and
546.Xr udp 4 )
547except for some ICMPv6 messages.
548The ICMPv6 messages not passed to raw sockets include echo, timestamp,
549and address mask requests.
550If
551.Ar proto
552is non-zero, only packets with this protocol will be passed to the
553socket.
554.Pp
555IPv6 fragments are also not passed to application sockets until
556they have been reassembled.
557If reception of all packets is desired, link-level access (such as
558.Xr bpf 4 )
559must be used instead.
560.Pp
561Outgoing packets automatically have an IPv6 header prepended to them
562(based on the destination address and the protocol number the socket
563was created with).
564Incoming packets are received by an application without the IPv6 header
565or any extension headers.
566.Pp
567Outgoing packets will be fragmented automatically by the kernel if they
568are too large.
569Incoming packets will be reassembled before being sent to the raw socket,
570so packet fragments or fragment headers will never be seen on a raw socket.
571.Sh EXAMPLES
572The following determines the hop limit on the next packet received:
573.Bd -literal
574struct iovec iov[2];
575u_char buf[BUFSIZ];
576struct cmsghdr *cm;
577struct msghdr m;
578int optval;
579bool found;
580u_char data[2048];
581
582/* Create socket. */
583
584(void)memset(&m, 0, sizeof(m));
585(void)memset(&iov, 0, sizeof(iov));
586
587iov[0].iov_base = data;		/* buffer for packet payload */
588iov[0].iov_len = sizeof(data);	/* expected packet length */
589
590m.msg_name = &from;		/* sockaddr_in6 of peer */
591m.msg_namelen = sizeof(from);
592m.msg_iov = iov;
593m.msg_iovlen = 1;
594m.msg_control = (caddr_t)buf;	/* buffer for control messages */
595m.msg_controllen = sizeof(buf);
596
597/*
598 * Enable the hop limit value from received packets to be
599 * returned along with the payload.
600 */
601optval = 1;
602if (setsockopt(s, IPPROTO_IPV6, IPV6_HOPLIMIT, &optval,
603    sizeof(optval)) == -1)
604	err(1, "setsockopt");
605
606found = false;
607do {
608	if (recvmsg(s, &m, 0) == -1)
609		err(1, "recvmsg");
610	for (cm = CMSG_FIRSTHDR(&m); cm != NULL;
611	     cm = CMSG_NXTHDR(&m, cm)) {
612		if (cm->cmsg_level == IPPROTO_IPV6 &&
613		    cm->cmsg_type == IPV6_HOPLIMIT &&
614		    cm->cmsg_len == CMSG_LEN(sizeof(int))) {
615			found = true;
616			(void)printf("hop limit: %d\en",
617			    *(int *)CMSG_DATA(cm));
618			break;
619		}
620	}
621} while (!found);
622.Ed
623.Sh DIAGNOSTICS
624A socket operation may fail with one of the following errors returned:
625.Bl -tag -width EADDRNOTAVAILxx
626.It Bq Er EISCONN
627when trying to establish a connection on a socket which
628already has one or when trying to send a datagram with the destination
629address specified and the socket is already connected.
630.It Bq Er ENOTCONN
631when trying to send a datagram, but
632no destination address is specified, and the socket has not been
633connected.
634.It Bq Er ENOBUFS
635when the system runs out of memory for
636an internal data structure.
637.It Bq Er EADDRNOTAVAIL
638when an attempt is made to create a
639socket with a network address for which no network interface
640exists.
641.It Bq Er EACCES
642when an attempt is made to create
643a raw IPv6 socket by a non-privileged process.
644.El
645.Pp
646The following errors specific to IPv6 may occur when setting or getting
647header options:
648.Bl -tag -width EADDRNOTAVAILxx
649.It Bq Er EINVAL
650An unknown socket option name was given.
651.It Bq Er EINVAL
652An ancillary data object was improperly formed.
653.El
654.Sh SEE ALSO
655.Xr getsockopt 2 ,
656.Xr recv 2 ,
657.Xr send 2 ,
658.Xr setsockopt 2 ,
659.Xr socket 2 ,
660.Xr CMSG_DATA 3 ,
661.Xr if_nametoindex 3 ,
662.Xr inet6_opt_init 3 ,
663.Xr bpf 4 ,
664.Xr icmp6 4 ,
665.Xr inet6 4 ,
666.Xr ip 4 ,
667.Xr netintro 4 ,
668.Xr tcp 4 ,
669.Xr udp 4
670.Rs
671.%A W. Stevens
672.%A M. Thomas
673.%T Advanced Sockets API for IPv6
674.%R RFC 2292
675.%D February 1998
676.Re
677.Rs
678.%A S. Deering
679.%A R. Hinden
680.%T Internet Protocol, Version 6 (IPv6) Specification
681.%R RFC 2460
682.%D December 1998
683.Re
684.Rs
685.%A R. Gilligan
686.%A S. Thomson
687.%A J. Bound
688.%A W. Stevens
689.%T Basic Socket Interface Extensions for IPv6
690.%R RFC 2553
691.%D March 1999
692.Re
693.Rs
694.%A R. Gilligan
695.%A S. Thomson
696.%A J. Bound
697.%A J. McCann
698.%A W. Stevens
699.%T Basic Socket Interface Extensions for IPv6
700.%R RFC 3493
701.%D February 2003
702.Re
703.Rs
704.%A W. Stevens
705.%A M. Thomas
706.%A E. Nordmark
707.%A T. Jinmei
708.%T Advanced Sockets Application Program Interface (API) for IPv6
709.%R RFC 3542
710.%D May 2003
711.Re
712.Rs
713.%A S. Deering
714.%A R. Hinden
715.%T Internet Protocol, Version 6 (IPv6) Specification
716.%R RFC 8200
717.%D July 2017
718.Re
719.Rs
720.%A W. Stevens
721.%A B. Fenner
722.%A A. Rudoff
723.%T UNIX Network Programming, 3rd Edition
724.%I Addison-Wesley Professional
725.%D November 2003
726.Re
727.Sh STANDARDS
728Most of the socket options are defined in RFC 2292 / 3542 or
729RFC 2553 / 3493.
730The
731.Dv IPV6_PORTRANGE
732socket option and the conflict resolution rule are not defined in the
733RFCs and should be considered implementation dependent.
734