OSDN Git Service

c772dc1af3720d48334da2d19c9b24c2bfed81ba
[linuxjm/LDP_man-pages.git] / draft / man7 / ipv6.7
1 .\" This man page is Copyright (C) 2000 Andi Kleen <ak@muc.de>.
2 .\" Permission is granted to distribute possibly modified copies
3 .\" of this page provided the header is included verbatim,
4 .\" and in case of nontrivial modification author and date
5 .\" of the modification is added to the header.
6 .\" $Id: ipv6.7,v 1.4 2001/08/15 18:01:06 hanataka Exp $
7 .\"
8 .\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved.
9 .\" Translated Sun 18 Feb 2001 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
10 .\" Updated Wed  4 Apr 2001 by Yuichi SATO <ysato@h4.dion.ne.jp>
11 .\" Updated Sat Dec 17 09:31:21 JST 2005 by Yuichi SATO <ysato444@yahoo.co.jp>
12 .\" Updated 2007-05-28, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.50
13 .\" Updated 2008-08-07, Akihiro MOTOKI, LDP v3.05
14 .\"
15 .\"WORD:        flow identifier         ¥Õ¥í¡¼»ØÄê»Ò
16 .\"WORD:        control message         À©¸æ¥á¥Ã¥»¡¼¥¸
17 .\"WORD:        incoming ¡Á             ¼õ¿® (¥Ñ¥±¥Ã¥È¡¢¥Ç¡¼¥¿¥°¥é¥à)
18 .\"WORD:        outgoing ¡Á             Á÷¿® (¥Ñ¥±¥Ã¥È¡¢¥Ç¡¼¥¿¥°¥é¥à)
19 .\"WORD:        asynchronous error      ÈóƱ´ü¥¨¥é¡¼
20 .\"
21 .TH IPV6 7 2009-02-28 "Linux" "Linux Programmer's Manual"
22 .\"O .SH NAME
23 .\"O ipv6, AF_INET6 \- Linux IPv6 protocol implementation
24 .SH Ì¾Á°
25 ipv6, AF_INET6 \- Linux ¤Î IPv6 ¥×¥í¥È¥³¥ë¼ÂÁõ
26 .\"O .SH SYNOPSIS
27 .SH ½ñ¼°
28 .B #include <sys/socket.h>
29 .br
30 .B #include <netinet/in.h>
31 .sp
32 .IB tcp6_socket " = socket(AF_INET6, SOCK_STREAM, 0);"
33 .br
34 .IB raw6_socket " = socket(AF_INET6, SOCK_RAW, " protocol ");"
35 .br
36 .IB udp6_socket " = socket(AF_INET6, SOCK_DGRAM, " protocol ");"
37 .\"O .SH DESCRIPTION
38 .SH ÀâÌÀ
39 .\"O Linux 2.2 optionally implements the Internet Protocol, version 6.
40 .\"O This man page contains a description of the IPv6 basic API as
41 .\"O implemented by the Linux kernel and glibc 2.1.
42 .\"O The interface
43 .\"O is based on the BSD sockets interface; see
44 .\"O .BR socket (7).
45 Linux 2.2 ¤Ç¤Ï¡¢Internet Protocol, version 6 ¤ò
46 ¥ª¥×¥·¥ç¥ó¤È¤·¤Æ¼ÂÁõ¤·¤Æ¤¤¤ë¡£
47 ¤³¤Î man ¥Ú¡¼¥¸¤Ç¤Ï¡¢Linux ¥«¡¼¥Í¥ë¤È glibc 2.1 ¤Ç¤Î¼ÂÁõ¤Ë´ð¤Å¤¤¤Æ¡¢
48 IPv6 ¤Î´ðËÜŪ¤Ê API ¤ò²òÀ⤹¤ë¡£
49 ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï BSD ¥½¥±¥Ã¥È¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò¤â¤È¤Ë¤·¤Æ¤¤¤ë¡£
50 .BR socket (7)
51 ¤ò»²¾È¡£
52 .PP
53 .\"O The IPv6 API aims to be mostly compatible with the
54 .\"O IPv4 API (see
55 .\"O .BR ip (7)).
56 .\"O Only differences are described in this man page.
57 IPv6 API ¤Ï¡¢
58 IPv4 API
59 .RB ( ip (7)
60 »²¾È) ¤È¤Û¤Ü¸ß´¹¤Ë¤Ê¤ë¤³¤È¤òÌܻؤ·¤Æ¤¤¤ë¡£
61 ¤³¤Î man ¥Ú¡¼¥¸¤Ç¤ÏÁê°ãÅÀ¤Î¤ß¤ò²òÀ⤹¤ë¡£
62 .PP
63 .\"O To bind an
64 .\"O .B AF_INET6
65 .\"O socket to any process, the local address should be copied from the
66 .\"O .I in6addr_any
67 .\"O variable which has
68 .\"O .I in6_addr
69 .\"O type.
70 .\"O In static initializations,
71 .\"O .B IN6ADDR_ANY_INIT
72 .\"O may also be used, which expands to a constant expression.
73 .\"O Both of them are in network byte order.
74 .B AF_INET6
75 ¥½¥±¥Ã¥È¤ò²¿¤é¤«¤Î¥×¥í¥»¥¹¤Ë¥Ð¥¤¥ó¥É¤¹¤ë¤Ë¤Ï¡¢
76 ¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ò
77 .I in6_addr
78 ·¿¤ÎÊÑ¿ô
79 .I in6addr_any
80 ¤«¤é¥³¥Ô¡¼¤·¤Æ¤¯¤ëɬÍפ¬¤¢¤ë¡£
81 static ¤Ê½é´üÃÍ
82 .B IN6ADDR_ANY_INIT
83 ¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤ÏÄê¿ô¼°¤ËŸ³«¤µ¤ì¤ë¡£
84 ¤³¤ì¤é¤Îξ¼Ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Ç¤¢¤ë¡£
85 .PP
86 .\"O The IPv6 loopback address (::1) is available in the global
87 .\"O .I in6addr_loopback
88 .\"O variable.
89 .\"O For initializations,
90 .\"O .B IN6ADDR_LOOPBACK_INIT
91 .\"O should be used.
92 IPv6 ¤Î¥ë¡¼¥×¥Ð¥Ã¥¯¥¢¥É¥ì¥¹ (::1) ¤Ï global ÊÑ¿ô
93 .I in6addr_loopback
94 ¤«¤é¼èÆÀ¤Ç¤­¤ë¡£½é´ü²½¤Ë¤Ï
95 .B IN6ADDR_LOOPBACK_INIT
96 ¤òÍѤ¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£
97 .PP
98 .\"O IPv4 connections can be handled with the v6 API by using the
99 .\"O v4-mapped-on-v6 address type;
100 .\"O thus a program only needs to support this API type to
101 .\"O support both protocols.
102 .\"O This is handled transparently by the address
103 .\"O handling functions in the C library.
104 v4-mapped-on-v6 ¥¢¥É¥ì¥¹·¿¤òÍѤ¤¤ë¤³¤È¤Ç¡¢
105 IPv4 Àܳ¤â v6 API ¤Ç°·¤¦¤³¤È¤¬¤Ç¤­¤ë¡£
106 ¤³¤¦¤¹¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤Ï v6 ¤Î API ¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤À¤±¤Ç¡¢
107 ξÊý¤Î¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤Ç¤­¤ë¡£
108 v4-mapped-on-v6 ¥¢¥É¥ì¥¹·¿¤Ï C ¥é¥¤¥Ö¥é¥êÆâÉô¤Î¥¢¥É¥ì¥¹¤ò
109 °·¤¦´Ø¿ô¤Ë¤è¤Ã¤ÆÆ©²áŪ¤Ë½èÍý¤µ¤ì¤ë¡£
110 .PP
111 .\"O IPv4 and IPv6 share the local port space.
112 .\"O When you get an IPv4 connection
113 .\"O or packet to a IPv6 socket, its source address will be mapped
114 .\"O to v6 and it will be mapped to v6.
115 IPv4 ¤È IPv6 ¤Ï¥í¡¼¥«¥ë¥Ý¡¼¥È¶õ´Ö¤ò¶¦Í­¤¹¤ë¡£
116 IPv4 ¤ÎÀܳ (¤Þ¤¿¤Ï¥Ñ¥±¥Ã¥È) ¤ò IPv6 ¥½¥±¥Ã¥È¤¬¼èÆÀ¤¹¤ë¤È¡¢
117 ȯ¿®¸µ¥¢¥É¥ì¥¹¤¬ v6 ¤Ë¥Þ¥Ã¥×¤µ¤ì¡¢¤½¤ÎÀܳ (¥Ñ¥±¥Ã¥È) ¤â v6 ¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£
118 .\"nakano: ºÇ¸å¤Î it ¤¬¤Ê¤Ë¤ò»Ø¤¹¤Î¤«¤ï¤«¤é¤ó¡£
119 .\"O
120 .\"O .SS Address Format
121 .SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È
122 .in +4n
123 .nf
124 struct sockaddr_in6 {
125     sa_family_t     sin6_family;   /* AF_INET6 */
126     in_port_t       sin6_port;     /* port number */
127     uint32_t        sin6_flowinfo; /* IPv6 flow information */
128     struct in6_addr sin6_addr;     /* IPv6 address */
129     uint32_t        sin6_scope_id; /* Scope ID (new in 2.4) */
130 };
131
132 struct in6_addr {
133     unsigned char   s6_addr[16];   /* IPv6 address */
134 };
135 .fi
136 .in
137 .sp
138 .\"O .I sin6_family
139 .\"O is always set to
140 .\"O .BR AF_INET6 ;
141 .\"O .I sin6_port
142 .\"O is the protocol port (see
143 .\"O .I sin_port
144 .\"O in
145 .\"O .BR ip (7));
146 .\"O .I sin6_flowinfo
147 .\"O is the IPv6 flow identifier;
148 .\"O .I sin6_addr
149 .\"O is the 128bit IPv6 address.
150 .\"O .I sin6_scope_id
151 .\"O is an ID depending on the scope of the address.
152 .\"O It is new in Linux 2.4.
153 .\"O Linux only supports it for link scope addresses, in that case
154 .\"O .I sin6_scope_id
155 .\"O contains the interface index (see
156 .\"O .BR netdevice (7))
157 .I sin6_family
158 ¤Ï¾ï¤Ë
159 .B AF_INET6
160 ¤ËÀßÄꤵ¤ì¤ë¡£
161 .I sin6_port
162 ¤Ï¥×¥í¥È¥³¥ë¥Ý¡¼¥È¤Ç¤¢¤ë
163 .RB ( ip (7)
164 ¤Î
165 .I sin_port
166 ¤ò»²¾È)¡£
167 .I sin6_flowinfo
168 ¤Ï IPv6 ¤Î¥Õ¥í¡¼»ØÄê»Ò (flow identifier) ¤Ç¤¢¤ë¡£
169 .I sin6_addr
170 ¤Ï 128 ¥Ó¥Ã¥È¤Î IPv6 ¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£
171 .I sin6_scope_id
172 ¤Ï¥¢¥É¥ì¥¹¤Î¥¹¥³¡¼¥×¤Ë°Í¸¤·¤¿ ID ¤Ç¤¢¤ë
173 (¤³¤ì¤Ï Linux 2.4 ¤ÇƳÆþ¤µ¤ì¤¿)¡£
174 Linux ¤Î¾ì¹ç¤Ï¡¢¤³¤ì¤Ï¥ê¥ó¥¯¥¹¥³¡¼¥×¥¢¥É¥ì¥¹¤Ç¤·¤«¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¡£
175 ¤³¤Î¾ì¹ç
176 .I sin6_scope_id
177 ¤Ë¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬´Þ¤Þ¤ì¤ë¤³¤È¤Ë¤Ê¤ë
178 .RB ( netdevice (7)
179 ¤ò»²¾È)¡£
180 .PP
181 .\"O IPv6 supports several address types: unicast to address a single
182 .\"O host, multicast to address a group of hosts,
183 .\"O anycast to address the nearest member of a group of hosts
184 .\"O (not implemented in Linux), IPv4-on-IPv6 to
185 .\"O address a IPv4 host, and other reserved address types.
186 IPv6 ¤Ï²¿¼ïÎफ¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
187 ñ°ì¤Î¥Û¥¹¥È¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î unicast¡¢
188 ¥Û¥¹¥È¤Î¥°¥ë¡¼¥×¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î multicast¡¢
189 ¥Û¥¹¥È¤Î¥°¥ë¡¼¥×Ãæ¤ÇºÇ¤â¶á¤¯¤Ë¤¤¤ë¤â¤Î¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î anycast
190 (¤³¤ì¤Ï Linux ¤Ç¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤)¡¢
191 IPv4 ¥Û¥¹¥È¤ò¥¢¥É¥ì¥¹¤¹¤ë¤¿¤á¤Î IPv4-on-IPv6¡£
192 ¾¤Ë¤âͽÌóºÑ¤ß¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤¬¤¢¤ë¡£
193 .PP
194 .\"O The address notation for IPv6 is a group of 16 2-digit hexadecimal
195 .\"O numbers, separated with a \(aq:\(aq.
196 .\"O \&"::" stands for a string of 0 bits.
197 .\"O Special addresses are ::1 for loopback and ::FFFF:<IPv4 address>
198 .\"O for IPv4-mapped-on-IPv6.
199 IPv6 ¤Ç¤Î¥¢¥É¥ì¥¹É½µ­¤Ï 2 ·å¤Î 16 ¿Ê¿ô 16 ¸Ä¤«¤é¤Ê¤ê¡¢
200 \(aq:\(aq ¤Ï¶èÀÚ¤êʸ»ú¤Ï¤Ç¡¢"::" ¤Ï 0 ¥Ó¥Ã¥È¤Îʸ»úÎó¤òɽ¤¹¡£
201 Æüì¤Ê¥¢¥É¥ì¥¹¤È¤·¤Æ¡¢¥ë¡¼¥×¥Ð¥Ã¥¯¤òɽ¤¹ ::1¡¢
202 IPv4-mapped-on-IPv6 ¤òɽ¤¹ ::FFFF::<IPv4 ¥¢¥É¥ì¥¹> ¤¬¤¢¤ë¡£
203 .PP
204 .\"O The port space of IPv6 is shared with IPv4.
205 IPv6 ¤Î¥Ý¡¼¥È¶õ´Ö¤Ï IPv4 ¤È¶¦Í­¤µ¤ì¤Æ¤¤¤ë¡£
206 .\"O .SS "Socket Options"
207 .SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó
208 .\"O IPv6 supports some protocol-specific socket options that can be set with
209 .\"O .BR setsockopt (2)
210 .\"O and read with
211 .\"O .BR getsockopt (2).
212 .\"O The socket option level for IPv6 is
213 .\"O .BR IPPROTO_IPV6 .
214 .\"O A boolean integer flag is zero when it is false, otherwise true.
215 IPv6 ¤Ï¥×¥í¥È¥³¥ë¸ÇÍ­¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤ò¤¤¤¯¤Ä¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
216 ¤³¤ì¤é¤Ï
217 .BR setsockopt (2)
218 ¤ÇÀßÄê¤Ç¤­¡¢
219 .BR getsockopt (2)
220 ¤Ç¼èÆÀ¤Ç¤­¤ë¡£
221 IPv6 ¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë¤Ï
222 .B IPPROTO_IPV6
223 ¤Ç¤¢¤ë¡£
224 ¥Ö¡¼¥ëÀ°¿ô¤Î¥Õ¥é¥°¤Ï¡¢0 ¤¬µ¶¤Ç¤¢¤ê¡¢¤½¤ì°Ê³°¤Ï¿¿¤Ç¤¢¤ë¡£
225 .TP
226 .B IPV6_ADDRFORM
227 .\"O Turn an
228 .\"O .B AF_INET6
229 .\"O socket into a socket of a different address family.
230 .\"O Only
231 .\"O .B AF_INET
232 .\"O is currently supported for that.
233 .\"O It is only allowed for IPv6 sockets
234 .\"O that are connected and bound to a v4-mapped-on-v6 address.
235 .\"O The argument is a pointer to an integer containing
236 .\"O .BR AF_INET .
237 .\"O This is useful to pass v4-mapped sockets as file descriptors to
238 .\"O programs that  don't know how to deal with the IPv6 API.
239 .B AF_INET6
240 ¥½¥±¥Ã¥È¤òÊ̤Υ¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥½¥±¥Ã¥È¤ËÊѤ¨¤ë¡£
241 ¸½ºß¤Ï
242 .B AF_INET
243 ¤Î¤ß¤¬Êѹ¹Àè¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤È¤·¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£
244 ¤³¤ì¤¬µö²Ä¤µ¤ì¤ë¤Î¤Ï¡¢IPv6 ¤¬Àܳ¤µ¤ì¡¢
245 v4-mapped-on-v6 ¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤¿¾ì¹ç¤Ë¸Â¤é¤ì¤ë¡£
246 °ú¤­¿ô¤Ï
247 .B AF_INET
248 ¤¬Æþ¤Ã¤Æ¤¤¤ëÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
249 v4-mapped ¥½¥±¥Ã¥È¤ò¡¢IPv6 API ¤ò°·¤¨¤Ê¤¤¥×¥í¥°¥é¥à¤ËÂФ·¤Æ
250 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤È¤·¤ÆÅϤ¹¾ì¹ç¤ËÊØÍø¡£
251 .TP
252 .B IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP
253 .\"O Control membership in multicast groups.
254 .\"O Argument is a pointer to a
255 .\"O .I struct ipv6_mreq
256 .\"O structure.
257 multicast ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤òÀ©¸æ¤¹¤ë¡£
258 °ú¤­¿ô¤Ï
259 .I struct ipv6_mreq
260 ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡£
261 .\"O .\" FIXME IPV6_CHECKSUM is not documented, and probably should be
262 .\"O .\" FIXME IPV6_JOIN_ANYCAST is not documented, and probably should be
263 .\"O .\" FIXME IPV6_LEAVE_ANYCAST is not documented, and probably should be
264 .\" FIXME IPV6_CHECKSUM ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£
265 .\" FIXME IPV6_JOIN_ANYCAST ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£
266 .\" FIXME IPV6_LEAVE_ANYCAST ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£
267 .\"O .\" FIXME IPV6_RECVPKTINFO is not documented, and probably should be
268 .\"O .\" FIXME IPV6_2292PKTINFO is not documented, and probably should be
269 .\"O .\" FIXME there are probably many other IPV6_* socket options that
270 .\"O .\" should be documented
271 .\" FIXME IPV6_RECVPKTINFO ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£
272 .\" FIXME IPV6_2292PKTINFO ¤Ïµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢µ­½Ò¤¹¤Ù¤­¤À¤í¤¦¡£
273 .\" FIXME Â¾¤Ë¤â¿¤¯¤Îµ­½Ò¤¹¤Ù¤­ IPV6_* ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë¤À¤í¤¦¡£
274 .TP
275 .B IPV6_MTU
276 .\"O Set the MTU to be used for the socket.
277 .\"O The MTU is limited by the device
278 .\"O MTU or the path mtu when path mtu discovery is enabled.
279 .\"O Argument is a pointer to integer.
280 ¤½¤Î¥½¥±¥Ã¥È¤ËÂФ·¤ÆÍѤ¤¤ë MTU ¤ÎÃͤòÀßÄꤹ¤ë¡£
281 MTU ¤ÎÂ礭¤µ¤Ï¡¢
282 ¤½¤Î¥Ç¥Ð¥¤¥¹¤Î MTU ¤Þ¤¿¤Ï (Path MTU Discovery
283 ¤¬²Äǽ¤Ê¤é) ¤½¤Î·ÐÏ©¤Î MTU ¤ÎÂ礭¤µ°Ê²¼¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
284 °ú¤­¿ô¤ÏÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¡£
285 .TP
286 .B IPV6_MTU_DISCOVER
287 .\"O Control path mtu discovery on the socket.
288 .\"O See
289 .\"O .B IP_MTU_DISCOVER
290 .\"O in
291 .\"O .BR ip (7)
292 .\"O for details.
293 ¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î Path MTU Discovery ¤òÀ©¸æ¤¹¤ë¡£
294 ¾ÜºÙ¤Ï
295 .BR ip (7)
296 ¤Î
297 .B IP_MTU_DISCOVER
298 ¤ò»²¾È¡£
299 .TP
300 .B IPV6_MULTICAST_HOPS
301 .\"O Set the multicast hop limit for the socket.
302 .\"O Argument is a pointer to an
303 .\"O integer.
304 .\"O \-1 in the value means use the route default, otherwise it should be
305 .\"O between 0 and 255.
306 ¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î multicast ¤Î hop ¿ô¤Î¾å¸ÂÃͤòÀßÄꤹ¤ë¡£
307 °ú¤­¿ô¤ÏÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
308 \-1 ¤ò»ØÄꤹ¤ë¤È·ÐÏ©¤Î¥Ç¥Õ¥©¥ë¥È¤òÍѤ¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
309 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤«¤é 255 ¤ÎÈϰϤò»ØÄꤹ¤ë¡£
310 .TP
311 .B IPV6_MULTICAST_IF
312 .\"O Set the device for outgoing multicast packets on the socket.
313 .\"O This is only allowed
314 .\"O for
315 .\"O .B SOCK_DGRAM
316 .\"O and
317 .\"O .B SOCK_RAW
318 .\"O socket.
319 .\"O The argument is a pointer to an interface index (see
320 .\"O .BR netdevice (7))
321 .\"O in an integer.
322 ¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î¡¢Á÷¿® multicast ¥Ñ¥±¥Ã¥È¤ËÍѤ¤¤ë¥Ç¥Ð¥¤¥¹¤òÀßÄꤹ¤ë¡£
323 ¤³¤ì¤Ï
324 .B SOCK_DGRAM
325 ¤ª¤è¤Ó
326 .B SOCK_RAW
327 ³Æ¥½¥±¥Ã¥È¤Ç¤Î¤ßµö¤µ¤ì¤ë¡£
328 °ú¤­¿ô¤Ï¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÀ°¿ôÃÍ
329 .RB ( netdevice (7)
330 ¤ò»²¾È) ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
331 .TP
332 .B IPV6_MULTICAST_LOOP
333 .\"O Control whether the socket sees multicast packets that it has send itself.
334 .\"O Argument is a pointer to boolean.
335 ¥½¥±¥Ã¥È¤¬¡¢¼«Ê¬¼«¿È¤ÎÁ÷¿®¤·¤¿
336 multicast ¥Ñ¥±¥Ã¥È¤ò´Æ»ë¤¹¤ë¤«¤É¤¦¤«¤òÀ©¸æ¤¹¤ë¡£
337 °ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤؤΥݥ¤¥ó¥¿¡£
338 .TP
339 .B IPV6_PKTINFO
340 .\"O Set delivery of the
341 .\"O .B IPV6_PKTINFO
342 .\"O control message on incoming datagrams.
343 .\"O Only allowed for
344 .\"O .B SOCK_DGRAM
345 .\"O or
346 .\"O .B SOCK_RAW
347 .\"O sockets.
348 .\"O Argument is a pointer to a boolean value in an integer.
349 ¥Ç¡¼¥¿¥°¥é¥à¤ÎÅþÃå»þ¤Ë¤ª¤±¤ë
350 .B IPV6_PKTINFO
351 À©¸æ¥á¥Ã¥»¡¼¥¸¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¤òÀßÄꤹ¤ë¡£
352 .B SOCK_DGRAM
353 ¥½¥±¥Ã¥È¤Þ¤¿¤Ï
354 .B SOCK_RAW
355 ¥½¥±¥Ã¥È¤ËÂФ·¤Æ¤Î¤ßµö²Ä¤µ¤ì¤ë¡£
356 °ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤÎÆþ¤Ã¤¿À°¿ô¡£
357 .TP
358 .nh
359 .B IPV6_RTHDR, IPV6_AUTHHDR, IPV6_DSTOPS, IPV6_HOPOPTS, IPV6_FLOWINFO, IPV6_HOPLIMIT
360 .hy
361 .\"O Set delivery of control messages for incoming datagrams containing
362 .\"O extension headers from the received packet.
363 ¼õ¿®¥Ñ¥±¥Ã¥È¤Î¥Ç¡¼¥¿¥°¥é¥à¤Ë³ÈÄ¥¥Ø¥Ã¥À¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¡¢
364 À©¸æ¥á¥Ã¥»¡¼¥¸¤ÎÇÛÁ÷¤òÀßÄꤹ¤ë¡£
365 .\"O .B IPV6_RTHDR
366 .\"O delivers the routing header,
367 .BR IPV6_RTHDR :
368 routing ¥Ø¥Ã¥À¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£
369 .\"O .B IPV6_AUTHHDR
370 .\"O delivers the authentication header,
371 .BR IPV6_AUTHHDR :
372 authentication ¥Ø¥Ã¥À¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£
373 .\"O .B IPV6_DSTOPTS
374 .\"O delivers the destination options,
375 .BR IPV6_DSTOPTS :
376 destination ¥ª¥×¥·¥ç¥ó¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£
377 .\"O .B IPV6_HOPOPTS
378 .\"O delivers the hop options,
379 .BR IPV6_HOPOPTS :
380 hop ¥ª¥×¥·¥ç¥ó¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£
381 .\"O .B IPV6_FLOWINFO
382 .\"O delivers an integer containing the flow ID,
383 .BR IPV6_FLOWINFO :
384 flow ID ¤ò´Þ¤àÀ°¿ô¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£
385 .\"O .B IPV6_HOPLIMIT
386 .\"O delivers an integer containing the hop count of the packet.
387 .BR IPV6_HOPLIMIT :
388 ¥Ñ¥±¥Ã¥È¤Î hop ¥«¥¦¥ó¥È¤ò´Þ¤àÀ°¿ô¤òÇÛÁ÷¤¹¤ë¤«¤É¤¦¤«¡£
389 .\"O The control messages have the same type as the socket option.
390 .\"O All these header options can also be set for outgoing packets
391 .\"O by putting the appropriate control message into the control buffer of
392 .\"O .BR sendmsg (2).
393 .\"O Only allowed for
394 .\"O .B SOCK_DGRAM
395 .\"O or
396 .\"O .B SOCK_RAW
397 .\"O sockets.
398 .\"O Argument is a pointer to a boolean value.
399 À©¸æ¥á¥Ã¥»¡¼¥¸¤Ï¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Î¤â¤Î¤ÈƱ¤¸¥¿¥¤¥×¤ò»ý¤Ä¡£
400 ¤³¤ì¤é¤Î¤¹¤Ù¤Æ¤Î¥Ø¥Ã¥À¥ª¥×¥·¥ç¥ó¤Ï¡¢
401 ŬÀÚ¤ÊÀ©¸æ¥á¥Ã¥»¡¼¥¸¤ò
402 .BR sendmsg (2)
403 ¤ÎÀ©¸æ¥Ð¥Ã¥Õ¥¡¡¼¤Ë½ñ¤­¤³¤á¤Ð¡¢
404 Á÷¿®¥Ñ¥±¥Ã¥È¤Ë¤Ç¤âÀßÄê¤Ç¤­¤ë¡£
405 .B SOCK_DGRAM
406 ¥½¥±¥Ã¥È¤Þ¤¿¤Ï
407 .B SOCK_RAW
408 ¥½¥±¥Ã¥È¤Ç¤Î¤ßµö¤µ¤ì¤ë¡£°ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤؤΥݥ¤¥ó¥¿¡£
409 .TP
410 .B IPV6_RECVERR
411 .\"O Control receiving of asynchronous error options.
412 .\"O See
413 .\"O .B IP_RECVERR
414 .\"O in
415 .\"O .BR ip (7)
416 .\"O for details.
417 .\"O Argument is a pointer to boolean.
418 ÈóƱ´ü¥¨¥é¡¼ (asynchronous error) ¥ª¥×¥·¥ç¥ó¤Î¼õ¿®¤òÀ©¸æ¤¹¤ë¡£
419 ¾ÜºÙ¤Ï
420 .BR ip (7)
421 ¤Î
422 .B IP_RECVERR
423 ¤ò»²¾È¡£
424 °ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤؤΥݥ¤¥ó¥¿¡£
425 .TP
426 .B IPV6_ROUTER_ALERT
427 .\"O Pass forwarded packets containing a router alert hop-by-hop option to
428 .\"O this socket.
429 .\"O Only allowed for SOCK_RAW sockets.
430 .\"O The tapped packets are not forwarded by the kernel, it is the
431 .\"O user's responsibility to send them out again.
432 ¤³¤Î¥½¥±¥Ã¥È¤Ç¡¢router alert hop-by-hop ¥ª¥×¥·¥ç¥ó¤ÎÉÕ¤¤¤¿Å¾Á÷¥Ñ¥±¥Ã¥È¤ò
433 Ä̤¹¤«¤É¤¦¤«¤òÀ©¸æ¤¹¤ë¡£
434 .B SOCK_RAW
435 ¥½¥±¥Ã¥È¤Ç¤Î¤ßµö²Ä¤µ¤ì¤ë¡£
436 tap ¤µ¤ì¤¿¥Ñ¥±¥Ã¥È¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¤ÏžÁ÷¤µ¤ì¤Ê¤¤¡£¤½¤¦¤·¤¿¥Ñ¥±¥Ã¥È¤ò
437 ºÆÅÙÁ÷¿®¤¹¤ë¤Î¤Ï¥æ¡¼¥¶¡¼¤ÎÀÕǤ¤Ç¤¢¤ë¡£
438 .\"O Argument is a pointer to an integer.
439 .\"O A positive integer indicates a router alert option value to intercept.
440 .\"O Packets carrying a router alert option with a value field containing
441 .\"O this integer will be delivered to the socket.
442 .\"O A negative integer disables delivery of packets with router alert options
443 .\"O to this socket.
444 °ú¤­¿ô¤ÏÀ°¿ô (integer) ¤Ø¤Î¥Ý¥¤¥ó¥¿¡£
445 Àµ¤ÎÀ°¿ô¤Ï˵¼õ¤ò¹Ô¤¦ router alert ¥ª¥×¥·¥ç¥óÃͤò¼¨¤¹¡£
446 ¥ª¥×¥·¥ç¥óÃͤ¬¤³¤ÎÀ°¿ô¤Ç¤¢¤ë router alert ¥ª¥×¥·¥ç¥ó¤ÎÉÕ¤¤¤¿¥Ñ¥±¥Ã¥È¤Ï
447 ¥½¥±¥Ã¥È¤ËÇÛÁ÷¤µ¤ì¤ë¡£Éé¤ÎÀ°¿ô¤ò»ØÄꤹ¤ë¤È¡¢¤³¤Î¥½¥±¥Ã¥È¤Ø¤Î
448 router alert ¥ª¥×¥·¥ç¥ó¤ÎÉÕ¤¤¤¿¥Ñ¥±¥Ã¥È¤ÎÇÛÁ÷¤¬¹Ô¤ï¤ì¤Ê¤¤¡£
449 .\" FLOWLABEL_MGR, FLOWINFO_SEND
450 .TP
451 .B IPV6_UNICAST_HOPS
452 .\"O Set the unicast hop limit for the socket.
453 .\"O Argument is a pointer to an integer.
454 .\"O \-1 in the value means use the route default,
455 .\"O otherwise it should be between 0 and 255.
456 ¤½¤Î¥½¥±¥Ã¥È¤Ç¤Î unicast ¤Î hop ¿ô¤Î¾å¸ÂÃͤòÀßÄꤹ¤ë¡£
457 °ú¤­¿ô¤ÏÀ°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
458 \-1 ¤ò»ØÄꤹ¤ë¤È·ÐÏ©¤Î¥Ç¥Õ¥©¥ë¥È¤òÍѤ¤¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
459 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤«¤é 255 ¤ÎÈϰϤò»ØÄꤹ¤ë¡£
460 .TP
461 .\"O .BR IPV6_V6ONLY " (since Linux 2.4.21 and 2.6)"
462 .BR IPV6_V6ONLY " (Linux 2.4.21 °Ê¹ß¤ª¤è¤Ó 2.6 °Ê¹ß)"
463 .\" See RFC 3493
464 .\"O If this flag is set to true (nonzero), then the socket is restricted
465 .\"O to sending and receiving IPv6 packets only.
466 .\"O In this case, an IPv4 and an IPv6 application can bind
467 .\"O to a single port at the same time.
468 ¤³¤Î¥Õ¥é¥°¤ò¿¿ (0 °Ê³°) ¤ËÀßÄꤹ¤ë¤È¡¢¤½¤Î¥½¥±¥Ã¥È¤Ï IPv6 ¥Ñ¥±¥Ã¥È¤À¤±¤ò
469 Á÷¼õ¿®¤¹¤ë¤è¤¦¤ËÀ©¸Â¤µ¤ì¤ë¡£
470 ¤³¤Î¾ì¹ç¡¢IPv4 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È IPv6 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Æ±»þ¤Ë
471 °ì¤Ä¤Î¥Ý¡¼¥È¤ò¥Ð¥¤¥ó¥É¤Ç¤­¤ë¡£
472
473 .\"O If this flag is set to false (zero),
474 .\"O then the socket can be used to send and receive packets
475 .\"O to and from an IPv6 address or an IPv4-mapped IPv6 address.
476 ¤³¤Î¥Õ¥é¥°¤òµ¶ (0) ¤ËÀßÄꤹ¤ë¤È¡¢¤½¤Î¥½¥±¥Ã¥È¤Ï¥Ñ¥±¥Ã¥È¤ÎÁ÷¼õ¿®¤Ë
477 IPv6 ¥¢¥É¥ì¥¹¤È IPv4-mapped IPv6 ¥¢¥É¥ì¥¹¤ÎξÊý¤ò»ÈÍѤǤ­¤ë¡£
478
479 .\"O The argument is a pointer to a boolean value in an integer.
480 °ú¤­¿ô¤Ï¥Ö¡¼¥ëÃͤÎÆþ¤Ã¤¿À°¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
481
482 .\"O The default value for this flag is defined by the contents of the file
483 .\"O .IR /proc/sys/net/ipv6/bindv6only .
484 .\"O The default value for that file is 0 (false).
485 ¤³¤Î¥Õ¥é¥°¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϥե¡¥¤¥ë
486 .I /proc/sys/net/ipv6/bindv6only
487 ¤ÎÆâÍƤˤè¤êÄêµÁ¤µ¤ì¤ë¡£
488 ¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϠ0 (µ¶) ¤Ç¤¢¤ë¡£
489 .\"O .SH VERSIONS
490 .SH ¥Ð¡¼¥¸¥ç¥ó
491 .\"O The older
492 .\"O .I libinet6
493 .\"O libc5 based IPv6 API implementation for Linux is not described here
494 .\"O and may vary in details.
495 IPv6 API ¤ò libc5 ¥Ù¡¼¥¹¤Ç Linux ¸þ¤±¤Ë¼ÂÁõ¤·¤¿¡¢°ÊÁ°¤Î
496 .I libinet6
497 ¤Ë¤Ä¤¤¤Æ¤Ï¤³¤³¤Ç¤Ïµ­½Ò¤·¤Æ¤¤¤Ê¤¤¡£
498 ¤ª¤½¤é¤¯ºÙ¤«¤¤¤È¤³¤í¤Ë¤ÏÁê°ãÅÀ¤¬¤¢¤ë¤À¤í¤¦¡£
499 .PP
500 .\"O Linux 2.4 will break binary compatibility for the
501 .\"O .I sockaddr_in6
502 .\"O for 64-bit
503 .\"O hosts by changing the alignment of
504 .\"O .I in6_addr
505 .\"O and adding an additional
506 .\"O .I sin6_scope_id
507 .\"O field.
508 .\"O The kernel interfaces stay compatible, but a program including
509 .\"O .I sockaddr_in6
510 .\"O or
511 .\"O .I in6_addr
512 .\"O into other structures may not be.
513 .\"O This is not
514 .\"O a problem for 32bit hosts like i386.
515 Linux 2.4 ¤Ç¤Ï 64 ¥Ó¥Ã¥È¤Î¥Û¥¹¥È¤ËÂФ·¤Æ
516 .I sockaddr_in6
517 ¤Î¥Ð¥¤¥Ê¥ê¸ß´¹À­¤¬Êݤ¿¤ì¤Æ¤¤¤Ê¤¤¡£
518 .I in6_addr
519 ¤Î¥¢¥é¥¤¥ó¥á¥ó¥È¤¬Êѹ¹¤µ¤ì¡¢¤Þ¤¿
520 .I sin6_scope_id
521 ¥Õ¥£¡¼¥ë¥É¤¬¿·¤¿¤ËÄɲ䵤줿¤«¤é¤Ç¤¢¤ë¡£
522 ¥«¡¼¥Í¥ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¸ß´¹À­¤ÏÊݤ¿¤ì¤Æ¤¤¤ë¤¬¡¢
523 .I sockaddr_in6
524 ¤ä
525 .I in6_addr
526 ¤ò¾¤Î¹½Â¤ÂΤ˴ޤó¤Ç¤¤¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¤Ï
527 Êݤ¿¤ì¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£
528 ¤³¤ì¤Ï i386 ¤Î¤è¤¦¤Ê 32 ¥Ó¥Ã¥È¤Î¥Û¥¹¥È¤Ç¤ÏÌäÂê¤Ë¤Ê¤é¤Ê¤¤¡£
529 .PP
530 .\"O The
531 .\"O .I sin6_flowinfo
532 .\"O field is new in Linux 2.4.
533 .\"O It is transparently passed/read by the kernel
534 .\"O when the passed address length contains it.
535 .\"O Some programs that pass a longer address buffer and then
536 .\"O check the outgoing address length may break.
537 .I sin6_flowinfo
538 ¥Õ¥£¡¼¥ë¥É¤Ï Linux 2.4 ¤ÇÅо줷¤¿¡£
539 ¤³¤ì¤¬ÅϤµ¤ì¤¿¥¢¥É¥ì¥¹Ä¹¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢
540 ¥«¡¼¥Í¥ë¤ËÆ©²áŪ¤ËÅϤµ¤ì¡¢Æɤޤì¤ë¡£
541 .\"nakano ¤³¤³¤ï¤«¤é¤Ê¤¤¤Ç¤¹...
542 ¤è¤êŤ¤¥¢¥É¥ì¥¹¥Ð¥Ã¥Õ¥¡¤òÅϤ·¡¢
543 ¤½¤·¤ÆÁ÷¿®¥¢¥É¥ì¥¹¤ÎŤµ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ï
544 ¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£
545 .\"O .SH "NOTES"
546 .SH Ãí°Õ
547 .\"O The
548 .\"O .I sockaddr_in6
549 .\"O structure is bigger than the generic
550 .\"O .IR sockaddr .
551 .\"O Programs that assume that all address types can be stored safely in a
552 .\"O .I struct sockaddr
553 .\"O need to be changed to use
554 .\"O .I struct sockaddr_storage
555 .\"O for that instead.
556 .I sockaddr_in6
557 ¹½Â¤ÂΤϥ¸¥§¥Í¥ê¥Ã¥¯¤Ê
558 .I sockaddr
559 ¤è¤ê¤âÂ礭¤¤¡£
560 ¤¹¤Ù¤Æ¤Î¥¢¥É¥ì¥¹¥¿¥¤¥×¤¬
561 .I struct sockaddr
562 ¤ÎÃæ¤Ë°ÂÁ´¤ËǼ¤á¤é¤ì¤ë¤È²¾Äꤷ¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ï¡¢Âå¤ï¤ê¤Ë
563 .I struct sockaddr_storage
564 ¤òÍѤ¤¤ë¤è¤¦¤ËÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ë¡£
565 .\"O .SH BUGS
566 .SH ¥Ð¥°
567 .\"O The IPv6 extended API as in RFC\ 2292 is currently only partly
568 .\"O implemented;
569 .\"O although the 2.2 kernel has near complete support for receiving options,
570 .\"O the macros for generating IPv6 options are missing in glibc 2.1.
571 IPv6 ³ÈÄ¥ API ¤Ï¡¢¸½ºß¤Þ¤À RFC\ 2292 ¤ò´°Á´¤Ë¤Ï¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡£
572 2.2 ¥«¡¼¥Í¥ë¤Ï¼õ¿®¥ª¥×¥·¥ç¥ó¤ò¤Û¤Ü´°Á´¤Ë¥µ¥Ý¡¼¥È¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤¬¡¢
573 glibc2.1 ¤Ë¤Ï IPv6 ¥ª¥×¥·¥ç¥ó¤òÀ¸À®¤¹¤ë¥Þ¥¯¥í¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¡£
574 .PP
575 .\"O IPSec support for EH and AH headers is missing.
576 EH ¤ª¤è¤Ó AH ¥Ø¥Ã¥À ¤Ç¤Î IPSec ¤Î¥µ¥Ý¡¼¥È¤Ï¸ºß¤·¤Ê¤¤¡£
577 .PP
578 .\"O Flow label management is not complete and not documented here.
579 ¥Õ¥í¡¼¥é¥Ù¥ë´ÉÍý¤Ï¤Þ¤À´°Á´¤Ç¤Ê¤¯¡¢¤³¤³¤Ë¤âµ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
580 .PP
581 .\"O This man page is not complete.
582 ¤³¤Î man ¥Ú¡¼¥¸¤Ï¤Þ¤À´°À®¤·¤Æ¤¤¤Ê¤¤¡£
583 .\"O .SH SEE ALSO
584 .SH ´ØÏ¢¹àÌÜ
585 .BR cmsg (3),
586 .BR ip (7)
587 .LP
588 RFC\ 2553: IPv6 BASIC API.
589 .\"O Linux tries to be compliant to this.
590 Linux ¤Ï¤³¤Î RFC ¤Ë½àµò¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤ë¡£
591 .LP
592 RFC\ 2460: IPv6 specification.