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 $
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
15 .\"WORD: flow identifier フロー指定子
16 .\"WORD: control message 制御メッセージ
17 .\"WORD: incoming 〜 受信 (パケット、データグラム)
18 .\"WORD: outgoing 〜 送信 (パケット、データグラム)
19 .\"WORD: asynchronous error 非同期エラー
21 .TH IPV6 7 2011-09-08 "Linux" "Linux Programmer's Manual"
23 .\"O ipv6, AF_INET6 \- Linux IPv6 protocol implementation
25 ipv6, AF_INET6 \- Linux の IPv6 プロトコル実装
28 .B #include <sys/socket.h>
30 .B #include <netinet/in.h>
32 .IB tcp6_socket " = socket(AF_INET6, SOCK_STREAM, 0);"
34 .IB raw6_socket " = socket(AF_INET6, SOCK_RAW, " protocol ");"
36 .IB udp6_socket " = socket(AF_INET6, SOCK_DGRAM, " protocol ");"
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.
43 .\"O is based on the BSD sockets interface; see
45 Linux 2.2 では、Internet Protocol, version 6 を
47 この man ページでは、Linux カーネルと glibc 2.1 での実装に基づいて、
49 インターフェースは BSD ソケットインターフェースをもとにしている。
53 .\"O The IPv6 API aims to be mostly compatible with the
56 .\"O Only differences are described in this man page.
60 参照) とほぼ互換になることを目指している。
61 この man ページでは相違点のみを解説する。
65 .\"O socket to any process, the local address should be copied from the
67 .\"O variable which has
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.
75 ソケットを何らかのプロセスにバインドするには、
83 も用いることができ、これは定数式に展開される。
84 これらの両者はネットワークバイトオーダーである。
86 .\"O The IPv6 loopback address (::1) is available in the global
87 .\"O .I in6addr_loopback
89 .\"O For initializations,
90 .\"O .B IN6ADDR_LOOPBACK_INIT
92 IPv6 のループバックアドレス (::1) は global 変数
95 .B IN6ADDR_LOOPBACK_INIT
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 をサポートするだけで、
108 v4-mapped-on-v6 アドレス型は C ライブラリ内部のアドレスを
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 がなにを指すのかわからん。
120 .\"O .SS Address Format
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) */
133 unsigned char s6_addr[16]; /* IPv6 address */
139 .\"O is always set to
142 .\"O is the protocol port (see
146 .\"O .I sin6_flowinfo
147 .\"O is the IPv6 flow identifier;
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))
168 は IPv6 のフロー指定子 (flow identifier) である。
170 は 128 ビットの IPv6 アドレスである。
172 はアドレスのスコープに依存した ID である
173 (これは Linux 2.4 で導入された)。
174 Linux の場合は、これはリンクスコープアドレスでしかサポートされない。
177 にはインターフェースのインデックスが含まれることになる
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。
194 .\"O The address notation for IPv6 is a group of 8 4-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 でのアドレス表記は 4 桁の 16 進数 8 個からなり、
200 \(aq:\(aq は区切り文字はで、"::" は 0 ビットの文字列を表す。
201 特殊なアドレスとして、ループバックを表す ::1、
202 IPv4-mapped-on-IPv6 を表す ::FFFF::<IPv4 アドレス> がある。
204 .\"O The port space of IPv6 is shared with IPv4.
205 IPv6 のポート空間は IPv4 と共有されている。
206 .\"O .SS "Socket Options"
208 .\"O IPv6 supports some protocol-specific socket options that can be set with
209 .\"O .BR setsockopt (2)
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 はプロトコル固有のソケットオプションをいくつかサポートしている。
224 ブール整数のフラグは、0 が偽であり、それ以外は真である。
229 .\"O socket into a socket of a different address family.
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
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.
240 ソケットを別のアドレスファミリーのソケットに変える。
243 のみが変更先のアドレスファミリーとしてサポートされている。
244 これが許可されるのは、IPv6 が接続され、
245 v4-mapped-on-v6 アドレスにバインドされた場合に限られる。
249 v4-mapped ソケットを、IPv6 API を扱えないプログラムに対して
250 ファイルディスクリプターとして渡す場合に便利。
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
257 multicast グループのメンバーを制御する。
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_* ソケットオプションがあるだろう。
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 の値を設定する。
282 そのデバイスの MTU または (Path MTU Discovery
283 が可能なら) その経路の MTU の大きさ以下でなければならない。
287 .\"O Control path-MTU discovery on the socket.
289 .\"O .B IP_MTU_DISCOVER
293 そのソケットでの Path MTU Discovery を制御する。
300 .B IPV6_MULTICAST_HOPS
301 .\"O Set the multicast hop limit for the socket.
302 .\"O Argument is a pointer to an
304 .\"O \-1 in the value means use the route default, otherwise it should be
305 .\"O between 0 and 255.
306 そのソケットでの multicast の hop 数の上限値を設定する。
308 \-1 を指定すると経路のデフォルトを用いることを意味する。
309 それ以外の場合は 0 から 255 の範囲を指定する。
312 .\"O Set the device for outgoing multicast packets on the socket.
313 .\"O This is only allowed
319 .\"O The argument is a pointer to an interface index (see
320 .\"O .BR netdevice (7))
322 そのソケットでの、送信 multicast パケットに用いるデバイスを設定する。
328 引き数はインターフェースのインデックスの整数値
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.
336 multicast パケットを監視するかどうかを制御する。
340 .\"O Set delivery of the
342 .\"O control message on incoming datagrams.
343 .\"O Only allowed for
348 .\"O Argument is a pointer to a boolean value in an integer.
351 制御メッセージを配送するかどうかを設定する。
359 .B IPV6_RTHDR, IPV6_AUTHHDR, IPV6_DSTOPTS, IPV6_HOPOPTS, IPV6_FLOWINFO, IPV6_HOPLIMIT
361 .\"O Set delivery of control messages for incoming datagrams containing
362 .\"O extension headers from the received packet.
363 受信パケットのデータグラムに拡張ヘッダが含まれている場合の、
366 .\"O delivers the routing header,
368 routing ヘッダを配送するかどうか。
370 .\"O delivers the authentication header,
372 authentication ヘッダを配送するかどうか。
374 .\"O delivers the destination options,
376 destination オプションを配送するかどうか。
378 .\"O delivers the hop options,
381 .\"O .B IPV6_FLOWINFO
382 .\"O delivers an integer containing the flow ID,
384 flow ID を含む整数を配送するかどうか。
385 .\"O .B IPV6_HOPLIMIT
386 .\"O delivers an integer containing the hop count of the packet.
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
398 .\"O Argument is a pointer to a boolean value.
399 制御メッセージはソケットオプションのものと同じタイプを持つ。
408 ソケットでのみ許される。引き数はブール値へのポインタ。
411 .\"O Control receiving of asynchronous error options.
417 .\"O Argument is a pointer to boolean.
418 非同期エラー (asynchronous error) オプションの受信を制御する。
427 .\"O Pass forwarded packets containing a router alert hop-by-hop option to
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 オプションの付いた転送パケットを
436 tap されたパケットはカーネルによっては転送されない。そうしたパケットを
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
444 引き数は整数 (integer) へのポインタ。
445 正の整数は傍受を行う router alert オプション値を示す。
446 オプション値がこの整数である router alert オプションの付いたパケットは
447 ソケットに配送される。負の整数を指定すると、このソケットへの
448 router alert オプションの付いたパケットの配送が行われない。
449 .\" FLOWLABEL_MGR, FLOWINFO_SEND
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 数の上限値を設定する。
458 \-1 を指定すると経路のデフォルトを用いることを意味する。
459 それ以外の場合は 0 から 255 の範囲を指定する。
461 .\"O .BR IPV6_V6ONLY " (since Linux 2.4.21 and 2.6)"
462 .BR IPV6_V6ONLY " (Linux 2.4.21 以降および 2.6 以降)"
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 パケットだけを
470 この場合、IPv4 アプリケーションと IPv6 アプリケーションが同時に
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 アドレスの両方を使用できる。
479 .\"O The argument is a pointer to a boolean value in an integer.
480 引き数はブール値の入った整数へのポインタである。
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).
486 .I /proc/sys/net/ipv6/bindv6only
488 このファイルのデフォルト値は 0 (偽) である。
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 向けに実装した、以前の
498 おそらく細かいところには相違点があるだろう。
500 .\"O Linux 2.4 will break binary compatibility for the
503 .\"O hosts by changing the alignment of
505 .\"O and adding an additional
506 .\"O .I sin6_scope_id
508 .\"O The kernel interfaces stay compatible, but a program including
512 .\"O into other structures may not be.
514 .\"O a problem for 32bit hosts like i386.
515 Linux 2.4 では 64 ビットのホストに対して
522 カーネルインターフェースの互換性は保たれているが、
526 を他の構造体に含んでいるようなプログラムでは
528 これは i386 のような 32 ビットのホストでは問題にならない。
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.
538 フィールドは Linux 2.4 で登場した。
539 これが渡されたアドレス長に含まれていると、
541 .\"nakano ここわからないです...
543 そして送信アドレスの長さをチェックするようなプログラムは
549 .\"O structure is bigger than the generic
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.
562 の中に安全に納められると仮定しているプログラムは、代わりに
563 .I struct sockaddr_storage
567 .\"O The IPv6 extended API as in RFC\ 2292 is currently only partly
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 オプションを生成するマクロが存在していない。
575 .\"O IPSec support for EH and AH headers is missing.
576 EH および AH ヘッダ での IPSec のサポートは存在しない。
578 .\"O Flow label management is not complete and not documented here.
579 フローラベル管理はまだ完全でなく、ここにも記述されていない。
581 .\"O This man page is not complete.
582 この man ページはまだ完成していない。
588 RFC\ 2553: IPv6 BASIC API.
589 .\"O Linux tries to be compliant to this.
590 Linux はこの RFC に準拠するようにしている。
592 RFC\ 2460: IPv6 specification.