OSDN Git Service

0dc3b4ef30d679251e8d88706af1df7ca84b9c34
[linuxjm/LDP_man-pages.git] / draft / man7 / ip.7
1 '\" t
2 .\" Don't change the line above. it tells man that tbl is needed.
3 .\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>.
4 .\" Permission is granted to distribute possibly modified copies
5 .\" of this page provided the header is included verbatim,
6 .\" and in case of nontrivial modification author and date
7 .\" of the modification is added to the header.
8 .\" $Id: ip.7,v 1.19 2000/12/20 18:10:31 ak Exp $
9 .\"
10 .\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved.
11 .\" Translated 1999-12-06, NAKANO Takeo <nakano@apm.seikei.ac.jp>
12 .\" Updated 2001-02-14, Kentaro Shirakata <argrath@ub32.org>
13 .\" Updated 2001-04-04, Yuichi SATO <ysato@h4.dion.ne.jp>
14 .\" Updated & Modified 2003-10-16, Yuichi SATO <ysato444@yahoo.co.jp>
15 .\" Updated & Modified 2005-01-22, Yuichi SATO
16 .\" Updated & Modified 2005-09-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
17 .\" Updated & Modified 2005-10-06, Akihiro MOTOKI
18 .\" Updated 2007-01-05, Akihiro MOTOKI, Catch up to LDP man-pages 2.43
19 .\" Updated 2007-05-28, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.48
20 .\" Updated 2008-12-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.14
21 .\"
22 .\"WORD         ancillary message       補助メッセージ
23 .\"WORD         ... oriented            〜指向の
24 .\"WORD         capability              権限
25 .\"WORD         payload                 ペイロード
26 .\"WORD         drop(ped)       (パケットを) 落とす、(受動の場合) 到着しない
27 .\"WORD         tap                     タップ(する)
28 .\"
29 .TH IP  7 2009-02-28 "Linux" "Linux Programmer's Manual"
30 .\"O .SH NAME
31 .SH 名前
32 .\"O ip \- Linux IPv4 protocol implementation
33 ip \- Linux IPv4 プロトコルの実装
34 .\"O .SH SYNOPSIS
35 .SH 書式
36 .B #include <sys/socket.h>
37 .br
38 .\" .B #include <net/netinet.h> -- does not exist anymore
39 .\" .B #include <linux/errqueue.h> -- never include <linux/foo.h>
40 .B #include <netinet/in.h>
41 .br
42 .\"O .B #include <netinet/ip.h>        \fR/* superset of previous */
43 .B #include <netinet/ip.h>        \fR/* 上記のスーパーセット */
44 .sp
45 .IB tcp_socket " = socket(AF_INET, SOCK_STREAM, 0);"
46 .br
47 .IB udp_socket " = socket(AF_INET, SOCK_DGRAM, 0);"
48 .br
49 .IB raw_socket " = socket(AF_INET, SOCK_RAW, " protocol ");"
50 .\"O .SH DESCRIPTION
51 .SH 説明
52 .\"O Linux implements the Internet Protocol, version 4,
53 .\"O described in RFC\ 791 and RFC\ 1122.
54 .\"O .B ip
55 .\"O contains a level 2 multicasting implementation conforming to RFC\ 1112.
56 .\"O It also contains an IP router including a packet filter.
57 Linux は RFC\ 791 と RFC\ 1122 で記述されている
58 Internet Protocol, version 4 を実装している。
59 .B ip
60 には RFC\ 1112 に準拠した level 2 マルチキャストの実装が含まれている。
61 またパケットフィルタ機能を含む IP ルーターも実装されている。
62 .\" FIXME has someone verified that 2.1 is really 1812 compliant?
63 .PP
64 .\"O The programming interface is BSD-sockets compatible.
65 .\"O For more information on sockets, see
66 .\"O .BR socket (7).
67 プログラミング・インターフェースは BSD ソケットと互換である。
68 ソケットに関するより詳細な情報は
69 .BR socket (7)
70 を参照のこと。
71 .PP
72 .\"O An IP socket is created by calling the
73 .\"O .BR socket (2)
74 .\"O function as
75 .\"O .BR "socket(AF_INET, socket_type, protocol)" .
76 IP ソケットは、
77 .BR socket (2)
78 関数を
79 .B "socket(AF_INET, socket_type, protocol)"
80 のように呼び出すことで生成される。
81 .\"O Valid socket types are
82 .\"O .B SOCK_STREAM
83 .\"O to open a
84 .\"O .BR tcp (7)
85 .\"O socket,
86 .\"O .B SOCK_DGRAM
87 .\"O to open a
88 .\"O .BR udp (7)
89 .\"O socket, or
90 .\"O .B SOCK_RAW
91 .\"O to open a
92 .\"O .BR raw (7)
93 .\"O socket to access the IP protocol directly.
94 指定できるソケットタイプは 3 つあり、
95 .BR tcp (7)
96 ソケットをオープンする場合
97 .BR SOCK_STREAM 、
98 .BR udp (7)
99 ソケットをオープンする場合
100 .BR SOCK_DGRAM 、
101 IP プロトコルに直接アクセスするために
102 .BR raw (7)
103 ソケットをオープンする場合には
104 .B SOCK_RAW
105 である。
106 .\"O .I protocol
107 .\"O is the IP protocol in the IP header to be received or sent.
108 .\"O The only valid values for
109 .\"O .I protocol
110 .\"O are 0 and
111 .\"O .B IPPROTO_TCP
112 .\"O for TCP sockets, and 0 and
113 .\"O .B IPPROTO_UDP
114 .\"O for UDP sockets.
115 .\"O For
116 .\"O .B SOCK_RAW
117 .\"O you may specify a valid IANA IP protocol defined in
118 .\"O RFC\ 1700 assigned numbers.
119 .I protocol
120 は送受信される IP ヘッダに書かれる IP プロトコルである。
121 指定できる値は、
122 TCP ソケットには 0 か
123 .BR IPPROTO_TCP 、
124 UDP ソケットには 0 か
125 .B IPPROTO_UDP
126 に限られる。
127 .B SOCK_RAW
128 に対しては、 RFC\ 1700 で定義されている有効な IANA IP プロトコルを、
129 割り当てられている番号で指定することができる。
130 .PP
131 .\" FIXME ip current does an autobind in listen, but I'm not sure
132 .\" if that should be documented.
133 .\"O When a process wants to receive new incoming packets or connections, it
134 .\"O should bind a socket to a local interface address using
135 .\"O .BR bind (2).
136 .\"O Only one IP socket may be bound to any given local (address, port) pair.
137 .\"O When
138 .\"O .B INADDR_ANY
139 .\"O is specified in the bind call, the socket will be bound to
140 .\"O .I all
141 .\"O local interfaces.
142 .\"O When
143 .\"O .BR listen (2)
144 .\"O or
145 .\"O .BR connect (2)
146 .\"O are called on an unbound socket, it is automatically bound to a
147 .\"O random free port with the local address set to
148 .\"O .BR INADDR_ANY .
149 あるプロセスで、やってくるパケットを受信したり
150 接続要求を受けたりしたい場合には、
151 そのプロセスはローカルなインターフェースアドレスに、
152 .BR bind (2)
153 を用いてソケットをバインドしなければならない。
154 あるローカルな「アドレスとポート」のペアに対してバインドできる
155 IP ソケットは一つに限られる。
156 .BR bind (2)
157 の呼び出しで
158 .B INADDR_ANY
159 が指定されていた場合は、ソケットはローカルなインターフェースの
160 \fIすべて\fPにバインドされる。
161 .BR listen (2)
162 または
163 .BR connect (2)
164 がバインドされていないソケットでコールされると、
165 そのソケットは自動的にローカルなアドレスを
166 .B INADDR_ANY
167 にセットし、空いているポートをランダムに選んでバインドする。
168
169 .\"O A TCP local socket address that has been bound is unavailable for
170 .\"O some time after closing, unless the
171 .\"O .B SO_REUSEADDR
172 .\"O flag has been set.
173 .\"O Care should be taken when using this flag as it makes TCP less reliable.
174 .B SO_REUSEADDR
175 フラグがセットされていない場合には、
176 バインドされていた TCP ローカルソケットアドレスは
177 クローズされた後しばらくの間使えなくなる。
178 .B SO_REUSEADDR
179 フラグを使うと TCP の信頼性を低下させるので、
180 使うときには注意が必要である。
181 .\"O .SS Address Format
182 .SS アドレスのフォーマット
183 .\"O An IP socket address is defined as a combination of an IP interface
184 .\"O address and a 16-bit port number.
185 .\"O The basic IP protocol does not supply port numbers, they
186 .\"O are implemented by higher level protocols like
187 .\"O .BR udp (7)
188 .\"O and
189 .\"O .BR tcp (7).
190 .\"O On raw sockets
191 .\"O .I sin_port
192 .\"O is set to the IP protocol.
193 IP ソケットアドレスは、 IP インターフェースアドレスと
194 16ビットのポート番号の組み合わせで定義される。
195 IP プロトコルそのものはポート番号を扱わない。
196 ポート番号は、
197 .BR udp (7)
198
199 .BR tcp (7)
200 といった、上位のプロトコルで実装される。
201 raw ソケットでは、
202 .I sin_port
203 が IP プロトコルにセットされる。
204 .PP
205 .in +4n
206 .nf
207 struct sockaddr_in {
208     sa_family_t    sin_family; /* address family: AF_INET */
209     in_port_t      sin_port;   /* port in network byte order */
210     struct in_addr sin_addr;   /* internet address */
211 };
212
213 /* Internet address. */
214 struct in_addr {
215     uint32_t       s_addr;     /* address in network byte order */
216 };
217 .fi
218 .in
219 .PP
220 .\"O .I sin_family
221 .\"O is always set to
222 .\"O .BR AF_INET .
223 .\"O This is required; in Linux 2.2 most networking functions return
224 .\"O .B EINVAL
225 .\"O when this setting is missing.
226 .\"O .I sin_port
227 .\"O contains the port in network byte order.
228 .\"O The port numbers below 1024 are called
229 .\"O .IR "privileged ports"
230 .\"O (or sometimes:
231 .\"O .IR "reserved ports" ).
232 .\"O Only privileged processes (i.e., those having the
233 .\"O .B CAP_NET_BIND_SERVICE
234 .\"O capability) may
235 .\"O .BR bind (2)
236 .\"O to these sockets.
237 .\"O Note that the raw IPv4 protocol as such has no concept of a
238 .\"O port, they are only implemented by higher protocols like
239 .\"O .BR tcp (7)
240 .\"O and
241 .\"O .BR udp (7).
242 .I sin_familiy
243 には常に
244 .B AF_INET
245 をセットする。これは必須である。 Linux 2.2 では、このセットを忘れると
246 ほとんどのネットワーク関数は
247 .B EINVAL
248 を返すようになっている。
249 .I sin_port
250 にはポート番号をネットワークバイトオーダーで指定する。
251 1024 未満のポート番号は
252 .I "特権ポート (privileged ports)"
253 と呼ばれる
254 .RI ( "予約ポート (reserved ports)"
255 とも時々呼ばれる)。
256 特権プロセス
257 .RB ( CAP_NET_BIND_SERVICE
258 ケーパビリティを持つプロセス) 以外のプロセスは、これらのポートには
259 .BR bind (2)
260 できない。 IPv4 プロトコルそのものにはポートに関する概念がない。
261 ポートは、
262 .BR tcp (7)
263
264 .BR udp (7)
265 といった、上位のプロトコルにおいて実装される。
266 .PP
267 .\"O .I sin_addr
268 .\"O is the IP host address.
269 .\"O The
270 .\"O .I s_addr
271 .\"O member of
272 .\"O .I struct in_addr
273 .\"O contains the host interface address in network byte order.
274 .I sin_addr
275 は IP ホストアドレスである。
276 .I struct in_addr
277
278 .I s_addr
279 メンバには、ホストのインターフェースアドレスを
280 ネットワークバイトオーダーで指定する。
281 .\"O .I in_addr
282 .\"O should be assigned one of the INADDR_* values (e.g.,
283 .\"O .BR INADDR_ANY )
284 .\"O or set using the
285 .\"O .BR inet_aton (3),
286 .\"O .BR inet_addr (3),
287 .\"O .BR inet_makeaddr (3)
288 .\"O library functions or directly with the name resolver (see
289 .\"O .BR gethostbyname (3)).
290 .I in_addr
291 は、INADDR_* の一つ (例えば
292 .BR INADDR_ANY )
293 を代入する、
294 ライブラリ関数
295 .BR inet_aton (3),
296 .BR inet_addr (3),
297 .BR inet_makeaddr (3)
298 を用いる、あるいは名前解決機構 (name resolver)
299 を直接用いる、のどれかで設定すべきである。
300 .RB ( gethostbyname (3)
301 を見よ)。
302
303 .\"O IPv4 addresses are divided into unicast, broadcast
304 .\"O and multicast addresses.
305 .\"O Unicast addresses specify a single interface of a host,
306 .\"O broadcast addresses specify all hosts on a network and multicast
307 .\"O addresses address all hosts in a multicast group.
308 .\"O Datagrams to broadcast addresses can be only sent or received when the
309 .\"O .B SO_BROADCAST
310 .\"O socket flag is set.
311 IPv4 アドレスには、ユニキャストアドレス、
312 ブロードキャストアドレス、マルチキャストアドレスがある。
313 ユニキャストアドレスは、あるホストの一つのアドレスを指定する。
314 ブロードキャストアドレスは、あるネットワーク上の全てのホストを指定する。
315 マルチキャストアドレスは、マルチキャストグループに所属する
316 全てのホストを指定する。ブロードキャストアドレスへのデータグラムは、
317 .B SO_BROADCAST
318 ソケットフラグがセットされていないと送信・受信できない。
319 .\"O In the current implementation, connection oriented sockets are only allowed
320 .\"O to use unicast addresses.
321 現在の実装では、接続指向のソケットにはユニキャストアドレスしか使えない。
322 .\" Leave a loophole for XTP @)
323
324 .\"O Note that the address and the port are always stored in
325 .\"O network byte order.
326 .\"O In particular, this means that you need to call
327 .\"O .BR htons (3)
328 .\"O on the number that is assigned to a port.
329 .\"O All address/port manipulation
330 .\"O functions in the standard library work in network byte order.
331 アドレスとポートは常にネットワークバイトオーダーで格納されることに注意せよ。
332 具体的には、ポートを指定する数値には
333 .BR htons (3)
334 を呼び出す必要がある。
335 標準ライブラリにあるアドレス/ポート操作関数は
336 すべてネットワークバイトオーダーで動作する。
337
338 .\"O There are several special addresses:
339 .\"O .B INADDR_LOOPBACK
340 .\"O (127.0.0.1)
341 .\"O always refers to the local host via the loopback device;
342 .\"O .B INADDR_ANY
343 .\"O (0.0.0.0)
344 .\"O means any address for binding;
345 .\"O .B INADDR_BROADCAST
346 .\"O (255.255.255.255)
347 .\"O means any host and has the same effect on bind as
348 .\"O .B INADDR_ANY
349 .\"O for historical reasons.
350 特別なアドレスがいくつか存在する:
351 .TP
352 .BR INADDR_LOOPBACK (127.0.0.1)
353 loopback デバイスを通して常にローカルなホストを参照する。
354 .TP
355 .BR INADDR_ANY (0.0.0.0)
356 バインドに用いる任意のアドレス。
357 .TP
358 .BR INADDR_BROADCAST (255.255.255.255)
359 任意のホスト。歴史的理由から、バインドの際には
360 .B INADDR_ANY
361 と同じ効果になる。
362 .\"O .SS Socket Options
363 .SS ソケットオプション
364 .\"O IP supports some protocol-specific socket options that can be set with
365 .\"O .BR setsockopt (2)
366 .\"O and read with
367 .\"O .BR getsockopt (2).
368 .\"O The socket option level for IP is
369 .\"O .BR IPPROTO_IP .
370 .\"O .\" or SOL_IP on Linux
371 .\"O A boolean integer flag is zero when it is false, otherwise true.
372 IP にはプロトコル固有のソケットオプションがいくつか存在し、
373 .BR setsockopt (2)
374 で設定が、
375 .BR getsockopt (2)
376 で取得ができる。 IP のソケットオプションレベルは
377 .B IPPROTO_IP
378 .\" Linux では SOL_IP も可
379 である。
380 ブール整数値のフラグでは、 0 は偽、それ以外は真を意味する。
381 .\"
382 .\" FIXME Document IP_FREEBIND
383 .\" Boolean
384 .\" Since Linux 2.4.0-test10
385 .\"
386 .TP
387 .\"O .BR IP_ADD_MEMBERSHIP " (since Linux 1.2)"
388 .BR IP_ADD_MEMBERSHIP " (Linux 1.2 以降)"
389 .\"O Join a multicast group.
390 .\"O Argument is an
391 .\"O .I ip_mreqn
392 .\"O structure.
393 マルチキャストグループに参加する。
394 引き数は
395 .I ip_mreqn
396 構造体である。
397 .sp
398 .in +4n
399 .nf
400 struct ip_mreqn {
401     struct in_addr imr_multiaddr; /* IP multicast group
402                                      address */
403     struct in_addr imr_address;   /* IP address of local
404                                      interface */
405     int            imr_ifindex;   /* interface index */
406 };
407 .fi
408 .in
409 .sp
410 .\"O .I imr_multiaddr
411 .\"O contains the address of the multicast group the application
412 .\"O wants to join or leave.
413 .\"O It must be a valid multicast address
414 .\"O .\" (i.e., within the 224.0.0.0-239.255.255.255 range)
415 .\"O (or
416 .\"O .BR setsockopt (2)
417 .\"O fails with the error
418 .\"O .BR EINVAL ).
419 .\"O .I imr_address
420 .\"O is the address of the local interface with which the system
421 .\"O should join the multicast group; if it is equal to
422 .\"O .B INADDR_ANY
423 .\"O an appropriate interface is chosen by the system.
424 .\"O .I imr_ifindex
425 .\"O is the interface index of the interface that should join/leave the
426 .\"O .I imr_multiaddr
427 .\"O group, or 0 to indicate any interface.
428 .I imr_multiaddr
429 には、アプリケーションが参加または撤退したい
430 マルチキャストグループのアドレスが入る。
431 指定するアドレスは有効なマルチキャストアドレスでなければならない
432 .\" (つまり、224.0.0.0-239.255.255.255 の範囲内)
433 (さもなければ
434 .BR setsockopt (2)
435 がエラー
436 .B EINVAL
437 で失敗する)。
438 .I imr_address
439 はシステムがマルチキャストグループに参加する際に用いる
440 ローカルなインターフェースのアドレスである。
441 これが
442 .B INADDR_ANY
443 であった場合には、適切なインターフェースがシステムによって選択される。
444 .I imr_ifindex
445
446 .I imr_multiaddr
447 グループに参加/撤退するインターフェースの interface index である。
448 どのインターフェースでもよい場合は 0 にする。
449 .IP
450 .\"O The
451 .\"O .I ip_mreqn
452 .\"O is available only since Linux 2.2.
453 .\"O For compatibility, the old
454 .\"O .I ip_mreq
455 .\"O structure (present since Linux 1.2) is still supported.
456 .\"O It differs from
457 .\"O .I ip_mreqn
458 .\"O only by not including the
459 .\"O .I imr_ifindex
460 .\"O field.
461 .\"O Only valid as a
462 .\"O .BR setsockopt (2).
463 .I ip_mreqn
464 は Linux 2.2 以降でのみ利用可能である。
465 互換性のため、古い
466 .I ip_mreq
467 構造体 (Linux 1.2 以降で存在する) もまだサポートされている。
468 .I ip_mreqn
469 との違いは、
470 .I imr_ifindex
471 フィールドを含まないことだけである。
472 .BR setsockopt (2)
473 でのみ使える。
474 .\"
475 .TP
476 .\"O .BR IP_DROP_MEMBERSHIP " (since Linux 1.2)"
477 .BR IP_DROP_MEMBERSHIP " (Linux 1.2 以降)"
478 .\"O Leave a multicast group.
479 .\"O Argument is an
480 .\"O .I ip_mreqn
481 .\"O or
482 .\"O .I ip_mreq
483 .\"O structure similar to
484 .\"O .BR IP_ADD_MEMBERSHIP .
485 マルチキャストグループから抜ける。引き数は
486 .B IP_ADD_MEMBERSHIP
487 と同様に
488 .I ip_mreqn
489 または
490 .I ip_mreq
491 構造体である。
492 .TP
493 .\"O .BR IP_HDRINCL " (since Linux 2.0)"
494 .BR IP_HDRINCL " (Linux 2.0 以降)"
495 .\"O If enabled,
496 .\"O the user supplies an IP header in front of the user data.
497 .\"O Only valid for
498 .\"O .B SOCK_RAW
499 .\"O sockets.
500 .\"O See
501 .\"O .BR raw (7)
502 .\"O for more information.
503 .\"O When this flag is enabled the values set by
504 .\"O .BR IP_OPTIONS ,
505 .\"O .B IP_TTL
506 .\"O and
507 .\"O .B IP_TOS
508 .\"O are ignored.
509 有効になっていると、ユーザは IP ヘッダをユーザーデータの前に与える。
510 .B SOCK_RAW
511 ソケットでのみ有効である。詳細は
512 .BR raw (7)
513 を見よ。このフラグが有効になっていると、
514 .BR IP_OPTIONS ,
515 .BR IP_TTL ,
516 .B IP_TOS
517 は無視される。
518 .\" FIXME Document IP_IPSEC_POLICY
519 .\" Since Linux 2.5.47
520 .\" Needs CAP_NET_ADMIN
521 .TP
522 .\"O .BR IP_MTU " (since Linux 2.2)"
523 .BR IP_MTU " (Linux 2.2 以降)"
524 .\" Precisely: 2.1.124
525 .\"O Retrieve the current known path MTU of the current socket.
526 .\"O Only valid when the socket has been connected.
527 .\"O Returns an integer.
528 .\"O Only valid as a
529 .\"O .BR getsockopt (2).
530 ソケットの、既知の path MTU を取得する。
531 ソケットが接続している場合のみ有効である。
532 .BR getsockopt (2)
533 でのみ使える。
534 .TP
535 .\"O .BR IP_MTU_DISCOVER " (since Linux 2.2)"
536 .BR IP_MTU_DISCOVER " (Linux 2.2 以降)"
537 .\" Precisely: 2.1.124
538 .\"O Set or receive the Path MTU Discovery setting for a socket.
539 .\"O When enabled, Linux will perform Path MTU Discovery
540 .\"O as defined in RFC\ 1191
541 .\"O on this socket.
542 .\"O The don't-fragment flag is set on all outgoing datagrams.
543 .\"O The system-wide default is controlled by the
544 .\"O .I /proc/sys/net/ipv4/ip_no_pmtu_disc
545 .\"O file for
546 .\"O .B SOCK_STREAM
547 .\"O sockets, and disabled on all others.
548 .\"O For
549 .\"O .RB non- SOCK_STREAM
550 .\"O sockets, it is the user's responsibility to packetize the data
551 .\"O in MTU sized chunks and to do the retransmits if necessary.
552 .\"O The kernel will reject packets that are bigger than the known
553 .\"O path MTU if this flag is set (with
554 .\"O .B EMSGSIZE
555 .\"O ).
556 ソケットの Path MTU Discovery の設定をセット・取得する。
557 有効になっていると、 Linux はこのソケットに対して
558 RFC\ 1191 で定義されている Path MTU Discovery を行う。
559 発信データグラムには、全て「フラグメント不許可」フラグがセットされる。
560 システム全体に対するデフォルトは、
561 .B SOCK_STREAM
562 ソケットに対しては
563 .I /proc/sys/net/ipv4/ip_no_pmtu_disc
564 ファイルにより制御できる。
565 その他については無効となっている。
566 .B SOCK_STREAM
567 でないソケットに対しては、
568 ユーザーがデータを MTU のサイズの塊にパケット化したり、
569 必要な場合には再送したりしなければならない。
570 このフラグがセットされていると、
571 カーネルは既知の path MTU より大きなパケットを拒否する
572 .RB ( EMSGSIZE
573 となる)。
574 .TS
575 tab(:);
576 c l
577 l l.
578 .\"O Path MTU discovery flags:Meaning
579 .\"O IP_PMTUDISC_WANT:Use per-route settings.
580 .\"O IP_PMTUDISC_DONT:Never do Path MTU Discovery.
581 .\"O IP_PMTUDISC_DO:Always do Path MTU Discovery.
582 .\"O IP_PMTUDISC_PROBE:Set DF but ignore Path MTU.
583 Path MTU discovery フラグ:意味
584 IP_PMTUDISC_WANT:ルートごとの設定を用いる。
585 IP_PMTUDISC_DONT:Path MTU Discovery を行わない。
586 IP_PMTUDISC_DO:常に Path MTU Discovery を行う。
587 IP_PMTUDISC_PROBE:DFビットをセットするが、Path MTU を無視する。
588 .TE
589
590 .\"O When PMTU discovery is enabled, the kernel automatically keeps track of
591 .\"O the path MTU per destination host.
592 .\"O When it is connected to a specific peer with
593 .\"O .BR connect (2),
594 .\"O the currently known path MTU can be retrieved conveniently using the
595 .\"O .B IP_MTU
596 .\"O socket option (e.g., after a
597 .\"O .B EMSGSIZE
598 .\"O error occurred).
599 .\"O It may change over time.
600 .\"O For connectionless sockets with many destinations,
601 .\"O the new MTU for a given destination can also be accessed using the
602 .\"O error queue (see
603 .\"O .BR IP_RECVERR ).
604 .\"O A new error will be queued for every incoming MTU update.
605 path MTU discovery が有効になっていると、カーネルは宛先ホストごとに
606 自動的に path MTU を処理する。特定の相手に
607 .BR connect (2)
608 で接続した場合には、
609 .B IP_MTU
610 ソケットオプションを用いれば、既知の path MTU の取得に便利である
611 (たとえば
612 .B EMSGSIZE
613 エラーが起きた後など)。これは時間とともに変化するかもしれない。
614 宛先がたくさんあるコネクションレスなソケットでは、
615 与えられた宛先に対する新しい MTU にも、
616 エラーキューを用いてアクセスすることができる
617 .RB ( IP_RECVERR
618 を見よ)。
619 MTU 更新が到着するごとに、新たなエラーがキューイングされる。
620
621 .\"O While MTU discovery is in progress, initial packets from datagram sockets
622 .\"O may be dropped.
623 .\"O Applications using UDP should be aware of this and not
624 .\"O take it into account for their packet retransmit strategy.
625 MTU discovery の進行中には、データグラムソケットからの初期パケットは
626 到着しないかもしれない。 UDP を用いるアプリケーションでは、
627 このことを気にかけておき、
628 パケットの再送アルゴリズムにこの分を除外させるべきである。
629
630 .\"O To bootstrap the path MTU discovery process on unconnected sockets, it
631 .\"O is possible to start with a big datagram size
632 .\"O (up to 64K-headers bytes long) and let it shrink by updates of the path MTU.
633 接続していないソケットに対して
634 path MTU discovery プロセスを立ち上げるには、
635 大きなデータグラムサイズ (最大 64K ヘッダバイト長) からはじめて、
636 path MTU が更新されるまでサイズを縮めていくことも可能である。
637 .\" FIXME this is an ugly hack
638
639 .\"O To get an initial estimate of the
640 .\"O path MTU, connect a datagram socket to the destination address using
641 .\"O .BR connect (2)
642 .\"O and retrieve the MTU by calling
643 .\"O .BR getsockopt (2)
644 .\"O with the
645 .\"O .B IP_MTU
646 .\"O option.
647 path MTU の値をまず見積もってみるには、宛先アドレスに
648 .BR connect (2)
649 を使ってデータグラムソケットを接続し、
650 .BR getsockopt (2)
651
652 .B IP_MTU
653 オプションとともに呼び、 MTU を取得することである。
654
655 .\"O It is possible to implement RFC 4821 MTU probing with
656 .\"O .B SOCK_DGRAM
657 .\"O or
658 .\"O .B SOCK_RAW
659 .\"O sockets by setting a value of
660 .\"O .BR IP_PMTUDISC_PROBE
661 .\"O (available since Linux 2.6.22).
662 .\"O This is also particularly useful for diagnostic tools such as
663 .\"O .BR tracepath (8)
664 .\"O that wish to deliberately send probe packets larger than
665 .\"O the observed Path MTU.
666 .B IP_PMTUDISC_PROBE
667 (Linux 2.6.22 以降で利用可能) を設定することで、
668 .B SOCK_DGRAM
669
670 .B SOCK_RAW
671 のソケットで RFC 4821 の MTU 探索を実装することが可能である。
672 また、この機能は、
673 .BR tracepath (8)
674 のような診断ツールで特に有用である。これらのツールでは、
675 観測された Path MTU よりも大きな探索パケットを意図的に
676 送信しようとする。
677 .TP
678 .\"O .BR IP_MULTICAST_IF " (since Linux 1.2)"
679 .BR IP_MULTICAST_IF " (Linux 1.2 以降)"
680 .\"O Set the local device for a multicast socket.
681 .\"O Argument is an
682 .\"O .I ip_mreqn
683 .\"O or
684 .\"O .I ip_mreq
685 .\"O structure similar to
686 .\"O .BR IP_ADD_MEMBERSHIP .
687 ローカルデバイスをマルチキャストソケットとして設定する。引き数は
688 .B IP_ADD_MEMBERSHIP
689 と同様に
690 .I ip_mreqn
691 または
692 .I ip_mreq
693 構造体である。
694 .IP
695 .\"O When an invalid socket option is passed,
696 .\"O .B ENOPROTOOPT
697 .\"O is returned.
698 不正なソケットオプションが渡されると、
699 .B ENOPROTOOPT
700 が返される。
701 .TP
702 .\"O .BR IP_MULTICAST_LOOP " (since Linux 1.2)"
703 .BR IP_MULTICAST_LOOP " (Linux 1.2 以降)"
704 .\"O Set or read a boolean integer argument that determines whether
705 .\"O sent multicast packets should be looped back to the local sockets.
706 マルチキャストパケットをローカルなソケットにループバックするかどうかを
707 定めるブール値の整数引き数を設定・取得する。
708 .TP
709 .\"O .BR IP_MULTICAST_TTL " (since Linux 1.2)"
710 .BR IP_MULTICAST_TTL " (Linux 1.2 以降)"
711 .\"O Set or read the time-to-live value of outgoing multicast packets for this
712 .\"O socket.
713 .\"O It is very important for multicast packets to set the smallest TTL possible.
714 .\"O The default is 1 which means that multicast packets don't leave the local
715 .\"O network unless the user program explicitly requests it.
716 .\"O Argument is an integer.
717 このソケットから発信されるマルチキャストパケットの
718 time-to-live 値を設定・取得する。
719 マルチキャストパケットに対しては、できるだけ小さな
720 TTL に設定することがとても重要である。デフォルトは 1 で、
721 ユーザープログラムが明示的に要求しない限り
722 マルチキャストパケットはローカルなネットワークから出ないことになる。
723 引き数に整数を取る。
724 .TP
725 .\"O .BR IP_OPTIONS " (since Linux 2.0)"
726 .BR IP_OPTIONS " (Linux 2.0 以降)"
727 .\" Precisely: 1.3.30
728 .\"O Set or get the IP options to be sent with every packet from this socket.
729 .\"O The arguments are a pointer to a memory buffer containing the options
730 .\"O and the option length.
731 このソケットから送られるパケット全てに付随する IP オプションを
732 設定・取得する。オプションを保存しているメモリバッファへのポインタと
733 オプションの長さとを引き数に取る。
734 .\"O The
735 .\"O .BR setsockopt (2)
736 .\"O call sets the IP options associated with a socket.
737 .\"O The maximum option size for IPv4 is 40 bytes.
738 .\"O See RFC\ 791 for the allowed options.
739 .\"O When the initial connection request packet for a
740 .\"O .B SOCK_STREAM
741 .\"O socket contains IP options, the IP options will be set automatically
742 .\"O to the options from the initial packet with routing headers reversed.
743 .\"O Incoming packets are not allowed to change options after the connection
744 .\"O is established.
745 .BR setsockopt (2)
746 を呼び出すと、ソケットに関連づけられる IP オプションを設定できる。
747 IPv4 におけるオプションのサイズの最大値は 40 バイトである。
748 用いることのできるオプションについては RFC\ 791 を見よ。
749 .B SOCK_STREAM
750 ソケットに対する初期接続要求パケットに IP オプションが含まれていると、
751 ルーティングヘッダを付けて戻されてくる初期パケットの
752 IP オプションに同じオプションがセットされる。接続が確立された後、
753 やってきたパケットのオプションを変更することはできない。
754 .\"O The processing of all incoming source routing options
755 .\"O is disabled by default and can be enabled by using the
756 .\"O .I accept_source_route
757 .\"O .I /proc
758 .\"O interface.
759 .\"O Other options like timestamps are still handled.
760 .\"O For datagram sockets, IP options can be only set by the local user.
761 .\"O Calling
762 .\"O .BR getsockopt (2)
763 .\"O with
764 .\"O .B IP_OPTIONS
765 .\"O puts the current IP options used for sending into the supplied buffer.
766 デフォルトでは。外部から受信したパケットの全ての source routing オプション
767 の処理は無効となっており、
768 .I /proc
769 インタフェースの
770 .I accept_source_route
771 を使うとこれを有効にできる。これを無効にしていても timestamps など
772 の他のオプションの処理は行われる。データグラムソケットでは、
773 IP オプションはローカルユーザーしか設定できない。
774 .BR getsockopt (2)
775
776 .B IP_OPTIONS
777 をつけて呼ぶと、現在送信に用いられている IP オプションを
778 引き数に与えたバッファに取得できる。
779 .\" FIXME Document IP_PASSSEC
780 .\" Boolean
781 .\" Since Linux 2.6.17
782 .\" commit 2c7946a7bf45ae86736ab3b43d0085e43947945c
783 .\" Author: Catherine Zhang <cxzhang@watson.ibm.com>
784 .TP
785 .\"O .BR IP_PKTINFO " (since Linux 2.2)"
786 .BR IP_PKTINFO " (Linux 2.2 以降)"
787 .\" Precisely: 2.1.68
788 .\"O Pass an
789 .\"O .B IP_PKTINFO
790 .\"O ancillary message that contains a
791 .\"O .I pktinfo
792 .\"O structure that supplies some information about the incoming packet.
793 .\"O This only works for datagram oriented sockets.
794 .B IP_PKTINFO
795 補助メッセージを渡す。これには到着パケットに関する情報を提供する
796 .I pktinfo
797 構造体が含まれている。
798 データグラム指向のソケットでしか動作しない。
799 .\"O The argument is a flag that tells the socket whether the
800 .\"O .B IP_PKTINFO
801 .\"O message should be passed or not.
802 .\"O The message itself can only be sent/retrieved
803 .\"O as control message with a packet using
804 .\"O .BR recvmsg (2)
805 .\"O or
806 .\"O .BR sendmsg (2).
807 引き数は
808 .B IP_PKTINFO
809 メッセージを通過させるかどうかをソケットに知らせるフラグである。
810 メッセージ自身は
811 .BR recvmsg (2)
812 または
813 .BR sendmsg (2)
814 を用いたパケットの制御メッセージとしてのみ送受信できる。
815
816 .IP
817 .in +4n
818 .nf
819 struct in_pktinfo {
820     unsigned int   ipi_ifindex;  /* Interface index */
821     struct in_addr ipi_spec_dst; /* Local address */
822     struct in_addr ipi_addr;     /* Header Destination
823                                     address */
824 };
825 .fi
826 .in
827 .IP
828 .\" FIXME elaborate on that.
829 .\"O .I ipi_ifindex
830 .\"O is the unique index of the interface the packet was received on.
831 .I ipi_ifindex
832 はパケットが受信されたインターフェースの、他と重ならないインデックスである。
833 .\"O .I ipi_spec_dst
834 .\"O is the local address of the packet and
835 .\"O .I ipi_addr
836 .\"O is the destination address in the packet header.
837 .I ipi_spec_dst
838 はパケットのローカルアドレスである。
839 .I ipi_addr
840 はパケットヘッダにある宛先アドレスである。
841 .\"O If
842 .\"O .B IP_PKTINFO
843 .\"O is passed to
844 .\"O .BR sendmsg (2)
845 .\"O and
846 .\"O .\" This field is grossly misnamed
847 .\"O .I ipi_spec_dst
848 .\"O is not zero, then it is used as the local source address for the routing
849 .\"O table lookup and for setting up IP source route options.
850 .B IP_PKTINFO
851
852 .BR sendmsg (2)
853 に渡されて、かつ
854 .\" このフィールドは、名前の付け方が明らかに間違っているのだが
855 .I ipi_spec_dst
856 が 0 以外の場合、
857 .I ipi_spec_dst
858 はルーティングテーブルを検索する際にローカルな送信元アドレスとして使用され、
859 IP source route オプションを設定するのにも使用される。
860 .\"O When
861 .\"O .I ipi_ifindex
862 .\"O is not zero, the primary local address of the interface specified by the
863 .\"O index overwrites
864 .\"O .I ipi_spec_dst
865 .\"O for the routing table lookup.
866 .I ipi_ifindex
867 が 0 以外の場合、このインデックスによって指定されるインターフェースの
868 プライマリローカルアドレスで
869 .I ipi_spec_dst
870 を上書きし、ルーティングテーブルを検索する。
871 .TP
872 .\"O .BR IP_RECVERR " (since Linux 2.2)"
873 .BR IP_RECVERR " (Linux 2.2 以降)"
874 .\" Precisely: 2.1.15
875 .\"O Enable extended reliable error message passing.
876 .\"O When enabled on a datagram socket, all
877 .\"O generated errors will be queued in a per-socket error queue.
878 .\"O When the user receives an error from a socket operation,
879 .\"O the errors can be received by calling
880 .\"O .BR recvmsg (2)
881 .\"O with the
882 .\"O .B MSG_ERRQUEUE
883 .\"O flag set.
884 .\"O The
885 .\"O .I sock_extended_err
886 .\"O structure describing the error will be passed in an ancillary message with
887 .\"O the type
888 .\"O .B IP_RECVERR
889 .\"O and the level
890 .\"O .BR IPPROTO_IP .
891 .\"O .\" or SOL_IP on Linux
892 .\"O This is useful for reliable error handling on unconnected sockets.
893 .\"O The received data portion of the error queue contains the error packet.
894 エラーメッセージの受け渡しに、信頼性の高い拡張された方法を有効にする。
895 データグラムソケットに対して有効になっていると、
896 発生したエラーは全てソケットごとのエラーキューに保存される。
897 ユーザーはソケット操作からエラーを受け取ったとき、
898 .BR recvmsg (2)
899
900 .B MSG_ERRQUEUE
901 フラグとともに呼べばそのエラーを取得できる。
902 そのエラーを記述する
903 .I sock_extended_err
904 構造体が、タイプ
905 .BR IP_RECVERR ・
906 レベル
907 .B IPPROTO_IP
908 .\" Linux では SOL_IP も可
909 の補助メッセージとして渡される。
910 これは接続志向でないソケットで信頼性の高いエラー処理を行いたい場合に
911 有用である。エラーキューの受信データフラグメントには
912 エラーパケットが含まれる。
913 .\"NAKANO portion をフラグメントって言っちゃっていいのか?
914 .IP
915 .\"O The
916 .\"O .B IP_RECVERR
917 .\"O control message contains a
918 .\"O .I sock_extended_err
919 .\"O structure:
920 .B IP_RECVERR
921 制御メッセージには
922 .I sock_extended_err
923 構造体が含まれる:
924 .IP
925 .in +4n
926 .ne 18
927 .nf
928 #define SO_EE_ORIGIN_NONE    0
929 #define SO_EE_ORIGIN_LOCAL   1
930 #define SO_EE_ORIGIN_ICMP    2
931 #define SO_EE_ORIGIN_ICMP6   3
932
933 struct sock_extended_err {
934     uint32_t ee_errno;   /* error number */
935     uint8_t  ee_origin;  /* where the error originated */
936     uint8_t  ee_type;    /* type */
937     uint8_t  ee_code;    /* code */
938     uint8_t  ee_pad;
939     uint32_t ee_info;    /* additional information */
940     uint32_t ee_data;    /* other data */
941     /* More data may follow */
942 };
943
944 struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);
945 .fi
946 .in
947 .IP
948 .\"O .I ee_errno
949 .\"O contains the
950 .\"O .I errno
951 .\"O number of the queued error.
952 .\"O .I ee_origin
953 .\"O is the origin code of where the error originated.
954 .I ee_errno
955 にはキューに入っているエラーの
956 .I errno
957 番号が入る。
958 .I ee_origin
959 にはエラーが発生した場所を示すコードが入る。
960 .\"O The other fields are protocol-specific.
961 .\"O The macro
962 .\"O .B SO_EE_OFFENDER
963 .\"O returns a pointer to the address of the network object
964 .\"O where the error originated from given a pointer to the ancillary message.
965 その他のフィールドはプロトコル依存である。
966 .B SO_EE_OFFENDER
967 マクロは与えられた補助メッセージへのポインタから
968 エラーの発生したネットワークオブジェクトのアドレスへのポインタを返す。
969 .\"O If this address is not known, the
970 .\"O .I sa_family
971 .\"O member of the
972 .\"O .I sockaddr
973 .\"O contains
974 .\"O .B AF_UNSPEC
975 .\"O and the other fields of the
976 .\"O .I sockaddr
977 .\"O are undefined.
978 アドレスが不明な場合、
979 .I sockaddr
980 構造体の
981 .I sa_family
982 フィールドは
983 .B AF_UNSPEC
984 となり、その他のフィールド値は不定である。
985 .IP
986 .\"O IP uses the
987 .\"O .I sock_extended_err
988 .\"O structure as follows:
989 IP は以下のような
990 .I sock_extended_err
991 構造体を用いる:
992 .\"O .I ee_origin
993 .\"O is set to
994 .\"O .B SO_EE_ORIGIN_ICMP
995 .\"O for errors received as an ICMP packet, or
996 .\"O .B SO_EE_ORIGIN_LOCAL
997 .\"O for locally generated errors.
998 .\"O Unknown values should be ignored.
999 .I ee_origin
1000 は、
1001 エラーが ICMP パケットとして受信された場合には
1002 .B SO_EE_ORIGIN_ICMP
1003 にセットされ、ローカルで起こった場合には
1004 .B SO_EE_ORIGIN_LOCAL
1005 にセットされる。
1006 不明な値は無視される。
1007 .\"O .I ee_type
1008 .\"O and
1009 .\"O .I ee_code
1010 .\"O are set from the type and code fields of the ICMP header.
1011 .I ee_type
1012
1013 .I ee_code
1014 は ICMP ヘッダの type フィールドと code フィールドの値にセットされる。
1015 .\"O .I ee_info
1016 .\"O contains the discovered MTU for
1017 .\"O .B EMSGSIZE
1018 .\"O errors.
1019 .\"O The message also contains the
1020 .\"O .I sockaddr_in of the node
1021 .\"O caused the error, which can be accessed with the
1022 .\"O .B SO_EE_OFFENDER
1023 .\"O macro.
1024 .\"O The
1025 .\"O .I sin_family
1026 .\"O field of the SO_EE_OFFENDER address is
1027 .\"O .B AF_UNSPEC
1028 .\"O when the source was unknown.
1029 .I ee_info
1030 には
1031 .B EMSGSIZE
1032 エラーに対する discover された MTU が入る。
1033 メッセージにはエラーを引き起こしたノードの
1034 .I sockaddr_in
1035 構造体も含まれる。
1036 これには
1037 .B SO_EE_OFFENDER
1038 マクロを使ってアクセスできる。
1039 ソースが不明の場合、
1040 SO_EE_OFFENDER アドレスの
1041 .I sin_family
1042 フィールドは
1043 .B AF_UNSPEC
1044 となる。
1045 .\"O When the error originated from the network, all IP options
1046 .\"O .RI ( IP_OPTIONS ", " IP_TTL ", "
1047 .\"O etc.) enabled on the socket and contained in the
1048 .\"O error packet are passed as control messages.
1049 .\"O The payload of the packet causing the error is returned as normal payload.
1050 エラーがネットワークで起きた場合には、
1051 ソケットで有効になっていたすべての IP オプション
1052 .RB ( IP_OPTIONS ", " IP_TTL
1053 など) とエラーパケットに含まれていたすべての IP オプションとが、
1054 制御メッセージとして渡される。
1055 エラーを起こしたパケットのペイロード (payload) は
1056 普通のペイロードとして返される。
1057 .\" FIXME . is it a good idea to document that? It is a dubious feature.
1058 .\"O .\" On
1059 .\"O .\" .B SOCK_STREAM
1060 .\"O .\" sockets,
1061 .\"O .\" .B IP_RECVERR
1062 .\"O .\" has slightly different semantics. Instead of
1063 .\"O .\" saving the errors for the next timeout, it passes all incoming
1064 .\"O .\" errors immediately to the user.
1065 .\"O .\" This might be useful for very short-lived TCP connections which
1066 .\"O .\" need fast error handling. Use this option with care:
1067 .\"O .\" it makes TCP unreliable
1068 .\"O .\" by not allowing it to recover properly from routing
1069 .\"O .\" shifts and other normal
1070 .\"O .\" conditions and breaks the protocol specification.
1071 .\" .B SOCK_STREAM
1072 .\" ソケットでは、
1073 .\" .B IP_RECVERR
1074 .\" はやや異なる意味を持つ。次のタイムアウトまでデータを保持するのでなく、
1075 .\" やってきたエラーは全てただちにユーザーに渡される。これは、
1076 .\" 高速なエラー処理が必要となるような、極端に寿命の短い
1077 .\" TCP 接続に対して有用である。このオプションは注意して用いること。
1078 .\" 経路が変わったり、その他通常の状況に対して、適切な回復が不可能となり、
1079 .\" TCP の信頼性を低くしてしまう。またプロトコルの仕様に反してしまう。
1080 .\"O Note that TCP has no error queue;
1081 .\"O .B MSG_ERRQUEUE
1082 .\"O is not permitted on
1083 .\"O .B SOCK_STREAM
1084 .\"O sockets.
1085 .\"O .B IP_RECVERR
1086 .\"O is valid for TCP, but all errors are returned by socket function return or
1087 .\"O .B SO_ERROR
1088 .\"O only.
1089 TCP にはエラーキューがないことに注意してほしい。
1090 .B MSG_ERRQUEUE
1091
1092 .B SOCK_STREAM
1093 ソケットに対しては使えない。
1094 TCP では
1095 .B IP_RECVERR
1096 だけが有効だが、ソケット関数から返されるエラーは
1097 .B SO_ERROR
1098 だけになる。
1099 .IP
1100 .\"O For raw sockets,
1101 .\"O .B IP_RECVERR
1102 .\"O enables passing of all received ICMP errors to the
1103 .\"O application, otherwise errors are only reported on connected sockets
1104 raw ソケットに対して
1105 .B IP_RECVERR
1106 を指定すると、受信したすべての ICMP エラーをアプリケーションに
1107 渡すようになる。指定しないと、
1108 接続済みのソケットに対するエラーだけを報告する。
1109 .IP
1110 .\"O It sets or retrieves an integer boolean flag.
1111 .\"O .B IP_RECVERR
1112 .\"O defaults to off.
1113 このオプションはブール値のフラグを設定・取得する。
1114 .B IP_RECVERR
1115 はデフォルトではオフになっている。
1116 .TP
1117 .\"O .BR IP_RECVOPTS " (since Linux 2.2)"
1118 .BR IP_RECVOPTS " (Linux 2.2 以降)"
1119 .\" Precisely: 2.1.15
1120 .\"O Pass all incoming IP options to the user in a
1121 .\"O .B IP_OPTIONS
1122 .\"O control message.
1123 .\"O The routing header and other options are already filled in
1124 .\"O for the local host.
1125 .\"O Not supported for
1126 .\"O .B SOCK_STREAM
1127 .\"O sockets.
1128 到着した全ての IP オプションを
1129 .B IP_OPTION
1130 コントロールメッセージに入れてユーザーに渡す。
1131 ルーティングヘッダとその他のオプションとは、
1132 ローカルホストに対してはあらかじめ記入されている。
1133 .B SOCK_STREAM
1134 ソケットではサポートされていない。
1135 .TP
1136 .\"O .BR IP_RECVTOS " (since Linux 2.2)"
1137 .BR IP_RECVTOS " (Linux 2.2 以降)"
1138 .\" Precisely: 2.1.68
1139 .\"O If enabled the
1140 .\"O .B IP_TOS
1141 .\"O ancillary message is passed with incoming packets.
1142 .\"O It contains a byte which specifies the Type of Service/Precedence
1143 .\"O field of the packet header.
1144 .\"O Expects a boolean integer flag.
1145 有効になっていると、
1146 .B IP_TOS
1147 補助メッセージが到着パケットとともに渡される。
1148 これにはパケットヘッダの Service/Precedence
1149 フィールドのタイプを指定するバイトデータが含まれている。
1150 ブール整数値のフラグをとる。
1151 .TP
1152 .\"O .BR IP_RECVTTL " (since Linux 2.2)"
1153 .BR IP_RECVTTL " (Linux 2.2 以降)"
1154 .\" Precisely: 2.1.68
1155 .\"O When this flag is set, pass a
1156 .\"O .B IP_TTL
1157 .\"O control message with the time to live
1158 .\"O field of the received packet as a byte.
1159 .\"O Not supported for
1160 .\"O .B SOCK_STREAM
1161 .\"O sockets.
1162 このフラグがセットされていると、
1163 .B IP_TTL
1164 コントロールメッセージが受信パケットの
1165 time-to-live フィールドのバイトデータとともに渡される。
1166 .B SOCK_STREAM
1167 ソケットではサポートされていない。
1168 .TP
1169 .B IP_RETOPTS
1170 .\"O .BR IP_RETOPTS " (since Linux 2.2)"
1171 .BR IP_RETOPTS " (Linux 2.2 以降)"
1172 .\" Precisely: 2.1.15
1173 .\"O Identical to
1174 .\"O .BR IP_RECVOPTS ,
1175 .\"O but returns raw unprocessed options with timestamp and route record
1176 .\"O options not filled in for this hop.
1177 .B IP_RECVOPTS
1178 と等価だが、未処理の生のオプションを、
1179 この hop では記入されない timestamp レコードと route レコードとともに返す。
1180 .\"NAKANO 意味不明...(^^;
1181 .TP
1182 .\"O .BR IP_ROUTER_ALERT " (since Linux 2.2)"
1183 .BR IP_ROUTER_ALERT " (Linux 2.2 以降)"
1184 .\" Precisely: 2.1.68
1185 .\"O Pass all to-be forwarded packets with the
1186 .\"O IP Router Alert option set to this socket.
1187 .\"O Only valid for raw sockets.
1188 .\"O This is useful, for instance, for user-space RSVP daemons.
1189 .\"O The tapped packets are not forwarded by the kernel; it is
1190 .\"O the user's responsibility to send them out again.
1191 .\"O Socket binding is ignored,
1192 .\"O such packets are only filtered by protocol.
1193 .\"O Expects an integer flag.
1194 フォワードすべきパケットを IP Router Alert オプションをつけて
1195 このソケットに渡す。
1196 raw ソケットに対してのみ有効である。これはたとえばユーザー空間の
1197 RSVP デーモンに対して便利である。タップされたパケットは
1198 カーネルによってはフォワードされないので、これらを再送するのは
1199 ユーザーの責任となる。ソケットのバインドは無視され、
1200 このようなパケットはプロトコルによってのみフィルタリングされる。
1201 整数値のフラグを取る。
1202 .\"NAKANO Socket binding... の文、意味わからん。
1203 .TP
1204 .\"O .BR IP_TOS " (since Linux 1.0)"
1205 .BR IP_TOS " (Linux 1.0 以降)"
1206 .\"O Set or receive the Type-Of-Service (TOS) field that is sent
1207 .\"O with every IP packet originating from this socket.
1208 .\"O It is used to prioritize packets on the network.
1209 .\"O TOS is a byte.
1210 .\"O There are some standard TOS flags defined:
1211 .\"O .B IPTOS_LOWDELAY
1212 .\"O to minimize delays for interactive traffic,
1213 .\"O .B IPTOS_THROUGHPUT
1214 .\"O to optimize throughput,
1215 .\"O .B IPTOS_RELIABILITY
1216 .\"O to optimize for reliability,
1217 .\"O .B IPTOS_MINCOST
1218 .\"O should be used for "filler data" where slow transmission doesn't matter.
1219 このソケットから送信されるすべての IP パケットに適用される
1220 Type-Of-Service (TOS) フィールドを設定・取得する。
1221 これはネットワーク上でのパケットの優先度を決めるために用いられる。
1222 TOS はバイトデータである。標準の TOS フラグがいくつか定義されている。
1223 .B IPTOS_LOWDELAY
1224 はインタラクティブなトラフィックの遅延を最小にする。
1225 .B IPTOS_THROUGHPUT
1226 はスループットを最大にする。
1227 .B IPTOS_RELIABILITY
1228 は信頼性を最高にする。
1229 .B IPTOS_MINCOST
1230 は転送速度が遅くてもかまわないとき、「データを詰め込む」のに用いられる。
1231 .\"O At most one of these TOS values can be specified.
1232 .\"O Other bits are invalid and shall be cleared.
1233 これらのうち、 1 つまでだけを設定できる。
1234 他のビットは無効で、クリアされる。
1235 .\"NAKANO ↑訳あってる?
1236 .\"O Linux sends
1237 .\"O .B IPTOS_LOWDELAY
1238 .\"O datagrams first by default,
1239 .\"O but the exact behavior depends on the configured queueing discipline.
1240 Linux はデフォルトでは
1241 .B IPTOS_LOWDELAY
1242 データグラムを最初に送信する。
1243 しかし、正確な振る舞いはキュー処理の設定に依存する。
1244 .\" FIXME elaborate on this
1245 .\"O Some high priority levels may require superuser privileges (the
1246 .\"O .B CAP_NET_ADMIN
1247 .\"O capability).
1248 .\"O The priority can also be set in a protocol independent way by the
1249 .\"O .RB ( SOL_SOCKET ", " SO_PRIORITY )
1250 .\"O socket option (see
1251 .\"O .BR socket (7)).
1252 高い優先度にするにはスーパーユーザー権限
1253 .RB ( CAP_NET_ADMIN
1254 ケーパビリティ) が必要となるかもしれない。
1255 優先度は
1256 .RB ( SOL_SOCKET ", " SO_PRIORITY )
1257 ソケットオプションを用いれば、
1258 プロトコルに依存しない形でも設定できる
1259 .RB ( socket (7)
1260 を見よ)。
1261 .\" FIXME Document IP_TRANSPARENT
1262 .\" Needs CAP_NET_ADMIN
1263 .\" Boolean
1264 .\" Since Linux 2.6.27
1265 .\" commit f5715aea4564f233767ea1d944b2637a5fd7cd2e
1266 .\" Author: KOVACS Krisztian <hidden@sch.bme.hu>
1267 .TP
1268 .\"O .BR IP_TTL " (since Linux 1.0)"
1269 .BR IP_TTL " (Linux 1.0 以降)"
1270 .\"O Set or retrieve the current time-to-live field that is used in every packet
1271 .\"O sent from this socket.
1272 time-to-live フィールドの値を設定または取得する。
1273 この値はこのソケットから送信されるすべてのパケットに用いられる。
1274 .\" FIXME Document IP_XFRM_POLICY
1275 .\" Since Linux 2.5.48
1276 .\" Needs CAP_NET_ADMIN
1277 .\"O .SS /proc interfaces
1278 .SS /proc インタフェース
1279 .\"O The IP protocol
1280 .\"O supports a set of
1281 .\"O .I /proc
1282 .\"O interfaces to configure some global parameters.
1283 .\"O The parameters can be accessed by reading or writing files in the directory
1284 .\"O .IR /proc/sys/net/ipv4/ .
1285 IP プロトコルでは、いくつかのグローバルパラメータを設定するための
1286 .I /proc
1287 ファイル群が用意されている。
1288 これらのパラメータには、
1289 .I /proc/sys/net/ipv4/
1290 ディレクトリ内のファイルの読み書きでアクセスできる。
1291 .\" FIXME As at 2.6.12, 14 Jun 2005, the following are undocumented:
1292 .\"     ip_queue_maxlen
1293 .\"     ip_conntrack_max
1294 .\"O Interfaces described as
1295 .\"O .I Boolean
1296 .\"O take an integer value, with a nonzero value ("true") meaning that
1297 .\"O the corresponding option is enabled, and a zero value ("false")
1298 .\"O meaning that the option is disabled.
1299 .I Boolean
1300 と書かれたインタフェースは整数値をとり、
1301 0 以外の値 ("true") は対応するオプションが有効、
1302 0 値 ("false") は無効、であることを意味する。
1303 .\"
1304 .TP
1305 .\"O .IR ip_always_defrag " (Boolean; since Linux 2.2.13)"
1306 .IR ip_always_defrag " (Boolean; Linux 2.2.13 以降)"
1307 .\"O [New with kernel 2.2.13; in earlier kernel versions this feature
1308 .\"O was controlled at compile time by the
1309 .\"O .B CONFIG_IP_ALWAYS_DEFRAG
1310 .\"O option; this option is not present in 2.4.x and later]
1311 [2.2.13 で新規登場。以前のバージョンのカーネルでは、この機能は
1312 コンパイル時に
1313 .B CONFIG_IP_ALWAYS_DEFRAG
1314 オプションによって制御されていた;
1315 このファイルは 2.4.x 以降では存在しない]
1316
1317 .\"O When this boolean flag is enabled (not equal 0), incoming fragments
1318 .\"O (parts of IP packets
1319 .\"O that arose when some host between origin and destination decided
1320 .\"O that the packets were too large and cut them into pieces) will be
1321 .\"O reassembled (defragmented) before being processed, even if they are
1322 .\"O about to be forwarded.
1323 このブール値のフラグが有効になっている (0 以外になっている) と、
1324 到着したフラグメント (IP パケットの一部で、
1325 発信元と発信先の間のどこかのホストで、そのパケットが
1326 大きすぎると判断され、分割された場合に生じる)
1327 は、たとえフォワードされる場合であっても
1328 処理前に再構築 (デフラグメント) される。
1329
1330 .\"O Only enable if running either a firewall that is the sole link
1331 .\"O to your network or a transparent proxy; never ever use it for a
1332 .\"O normal router or host.
1333 .\"O Otherwise fragmented communication can be disturbed
1334 .\"O if the fragments travel over different links.
1335 .\"O Defragmentation also has a large memory and CPU time cost.
1336 ファイアウォールがローカル側のネットワークに唯一のリンクを持っている
1337 場合や、透過プロクシの場合に限って有効にすべきである。
1338 通常のルーターやホストでは決して使用することのないように。
1339 さもないとフラグメントが別のリンクを経由して伝わる場合に、
1340 通信のフラグメント化ができなくなってしまう。
1341 またフラグメント再構築処理はメモリと CPU 時間のコストが非常に大きい。
1342
1343 .\"O This is automagically turned on when masquerading or transparent
1344 .\"O proxying are configured.
1345 これはマスカレードや透過プロクシが設定されると、
1346 不思議な仕組みによって自動的に有効になる。
1347 .\"
1348 .TP
1349 .\"O .IR ip_autoconfig " (since Linux 2.2 to 2.6.17)"
1350 .IR ip_autoconfig " (Linux 2.2 以降 2.6.17 まで)"
1351 .\" Precisely: since 2.1.68
1352 .\" FIXME document ip_autoconfig
1353 .\"O Not documented.
1354 まだ記述していない。
1355 .\"
1356 .TP
1357 .\"O .IR ip_default_ttl " (integer; default: 64; since Linux 2.2)"
1358 .IR ip_default_ttl " (integer; default: 64; Linux 2.2 以降)"
1359 .\" Precisely: 2.1.15
1360 .\"O Set the default time-to-live value of outgoing packets.
1361 .\"O This can be changed per socket with the
1362 .\"O .B IP_TTL
1363 .\"O option.
1364 送出されるパケットの time-to-live 値のデフォルトをセットする。
1365 これは
1366 .B IP_TTL
1367 オプションを用いれば、パケットごとに変えることもできる。
1368 .\"
1369 .TP
1370 .\"O .IR ip_dynaddr " (Boolean; default: disabled; since Linux 2.0.31)"
1371 .IR ip_dynaddr " (Boolean; default: disabled; Linux 2.0.31 以降)"
1372 .\"O Enable dynamic socket address and masquerading entry rewriting on interface
1373 .\"O address change.
1374 .\"O This is useful for dialup interface with changing IP addresses.
1375 .\"O 0 means no rewriting, 1 turns it on and 2 enables verbose mode.
1376 動的ソケットアドレスと、インターフェースアドレスが変更された際の
1377 マスカレードエントリの再書き込みを有効にする。
1378 ダイアルアップインターフェースで、
1379 IP アドレスが変更される場合に便利である。
1380 .\"
1381 .TP
1382 .\"O .IR ip_forward " (Boolean; default: disabled; since Linux 1.2)"
1383 .IR ip_forward " (Boolean; default: disabled; Linux 1.2 以降)"
1384 .\"O Enable IP forwarding with a boolean flag.
1385 .\"O IP forwarding can be also set on a per-interface basis.
1386 IP forwarding を有効にするかどうかのブール値フラグ。
1387 IP forwarding するかどうかはインターフェースごとにも設定できる。
1388 .\"
1389 .TP
1390 .\"O .IR ip_local_port_range " (since Linux 2.2)"
1391 .IR ip_local_port_range " (Linux 2.2 以降)"
1392 .\" Precisely: since 2.1.68
1393 .\"O Contains two integers that define the default local port range
1394 .\"O allocated to sockets.
1395 .\"O Allocation starts with the first number and ends with the second number.
1396 .\"O Note that these should not conflict with the ports used by masquerading
1397 .\"O (although the case is handled).
1398 .\"O Also arbitrary choices may cause problems with some firewall packet
1399 .\"O filters that make assumptions about the local ports in use.
1400 .\"O First number should be at least greater than 1024,
1401 .\"O or better greater than 4096, to avoid clashes
1402 .\"O with well known ports and to minimize firewall problems.
1403 ソケットに割り当てられているデフォルトのローカルポートの範囲を定める
1404 二つの整数を与える。割り当ては 1 番目の番号から始まり、 2 番目の番号で終わる。
1405 これらはマスカレードで用いられているポートと重なってはならない
1406 (その場合も取り扱われるが)。
1407 ファイアウォールのパケットフィルターが「利用中のローカルポート」
1408 について何らかの仮定をしている場合には、
1409 番号を勝手に決めてしまうと問題が起きるかもしれない。
1410 1 番目の番号は少なくとも 1024 より大きくすべきである。
1411 良く使われるポートとの衝突を避けたり、ファイアウォールの問題を
1412 回避したければ、 4096 よりも大きくするほうが良いだろう。
1413 .\"
1414 .TP
1415 .\"O .IR ip_no_pmtu_disc " (Boolean; default: disabled; since Linux 2.2)"
1416 .IR ip_no_pmtu_disc " (Boolean; default: disabled; Linux 2.2 以降)"
1417 .\" Precisely: 2.1.15
1418 .\"O If enabled, don't do Path MTU Discovery for TCP sockets by default.
1419 .\"O Path MTU discovery may fail if misconfigured firewalls (that drop
1420 .\"O all ICMP packets) or misconfigured interfaces (e.g., a point-to-point
1421 .\"O link where the both ends don't agree on the MTU) are on the path.
1422 .\"O It is better to fix the broken routers on the path than to turn off
1423 .\"O Path MTU Discovery globally, because not doing it incurs a high cost
1424 .\"O to the network.
1425 有効になっていると、デフォルトで TCP ソケットに対する
1426 Path MTU Discoverty を行わない。
1427 Path MTU Discovery は、
1428 正しく設定されていない (ICMP パケットを全てドロップする) ファイアウォールや、
1429 (point-to-point リンクで双方の MTU が一致していない場合など)
1430 正しく設定されていないインターフェースが経路上に存在すると失敗してしまう。
1431 Path MTU Discovery をグローバルに無効にするよりは、
1432 壊れているルータを直すほうが良い。
1433 Path MTU Discovery を無効にするとネットワークのコストが
1434 大きくなってしまうからである。
1435 .\"
1436 .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
1437 .TP
1438 .\"O .IR ip_nonlocal_bind " (Boolean; default: disabled; since Linux 2.4)"
1439 .IR ip_nonlocal_bind " (Boolean; default: disabled; Linux 2.4 以降)"
1440 .\" Precisely: patch-2.4.0-test10
1441 .\"O If set, allows processes to
1442 .\"O .BR bind (2)
1443 .\"O to nonlocal IP addresses,
1444 .\"O which can be quite useful, but may break some applications.
1445 セットされていれば、プロセスが自分以外の IP アドレスを
1446 .BR bind (2)
1447 できるようになる。これはかなり便利だが、うまく動かないアプリケーションもある。
1448 .\"
1449 .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
1450 .TP
1451 .IR ip6frag_time " (integer; default 30)"
1452 .\"O Time in seconds to keep an IPv6 fragment in memory.
1453 IPv6 フラグメントをメモリに保持しておく時間 (秒単位)。
1454 .\"
1455 .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
1456 .TP
1457 .IR ip6frag_secret_interval " (integer; default 600)"
1458 .\"O Regeneration interval (in seconds) of the hash secret (or lifetime
1459 .\"O for the hash secret) for IPv6 fragments.
1460 IPv6 フラグメントの hash secret の生成間隔 (hash secret の寿命)
1461 (秒単位)。
1462 .TP
1463 .IR ipfrag_high_thresh " (integer), " ipfrag_low_thresh " (integer)"
1464 .\"O If the amount of queued IP fragments reaches
1465 .\"O .IR ipfrag_high_thresh ,
1466 .\"O the queue is pruned down to
1467 .\"O .IR ipfrag_low_thresh .
1468 .\"O Contains an integer with the number of bytes.
1469 キューイングされている IP フラグメントの量が
1470 .I ipfrag_high_thresh
1471 に達すると、キューの内容は
1472 .I ipfrag_low_thresh
1473 にまで切り捨てられる。それぞれの大きさを
1474 バイト単位で表す整数値が入っている。
1475 .TP
1476 .I neigh/*
1477 .\"O See
1478 .\"O .BR arp (7).
1479 .BR arp (7)
1480 を見よ。
1481 .\" FIXME Document the conf/*/* interfaces
1482 .\" FIXME Document the route/* interfaces
1483 .\" FIXME document them all
1484 .\"O .SS Ioctls
1485 .SS ioctl
1486 .\"O All ioctls described in
1487 .\"O .BR socket (7)
1488 .\"O apply to
1489 .\"O .BR ip .
1490 .BR socket (7)
1491 に記述されている ioctl は、すべて
1492 .B ip
1493 にも適用される。
1494 .\" 2006-04-02, mtk
1495 .\" commented out the following because ipchains is obsolete
1496 .\" .PP
1497 .\"O .\" The ioctls to configure firewalling are documented in
1498 .\"O .\" .BR ipfw (4)
1499 .\"O .\" from the
1500 .\"O .\" .B ipchains
1501 .\"O .\" package.
1502 .\" ファイアウォール関係の設定に関する ioctl については
1503 .\" .B ipchains
1504 .\" パッケージの
1505 .\" .BR ipfw (4)
1506 .\" に記述されている。
1507 .PP
1508 .\"O Ioctls to configure generic device parameters are described in
1509 .\"O .BR netdevice (7).
1510 ジェネリックデバイスのパラメータを設定する ioctl については
1511 .BR netdevice (7)
1512 に記述されている。
1513 .\" FIXME Add a discussion of multicasting
1514 .\"O .SH ERRORS
1515 .SH エラー
1516 .\" FIXME document all errors.
1517 .\"     We should really fix the kernels to give more uniform
1518 .\"     error returns (ENOMEM vs ENOBUFS, EPERM vs EACCES etc.)
1519 .TP
1520 .B EACCES
1521 .\"O The user tried to execute an operation without the necessary permissions.
1522 .\"O These include:
1523 .\"O sending a packet to a broadcast address without having the
1524 .\"O .B SO_BROADCAST
1525 .\"O flag set;
1526 .\"O sending a packet via a
1527 .\"O .I prohibit
1528 .\"O route;
1529 .\"O modifying firewall settings without superuser privileges (the
1530 .\"O .B CAP_NET_ADMIN
1531 .\"O capability);
1532 .\"O binding to a privileged port without superuser privileges (the
1533 .\"O .B CAP_NET_BIND_SERVICE
1534 .\"O capability).
1535 必要な権限のないユーザーが操作を実行しようとした。
1536 以下のような場合が考えられる:
1537 .B SO_BROADCAST
1538 フラグを設定していない状態でブロードキャストアドレスに
1539 パケットを送ろうとした。
1540 .I prohibit
1541 なルートを通してパケットを送ろうとした。
1542 スーパーユーザー権限
1543 .RB ( CAP_NET_ADMIN
1544 ケーパビリティ) なしでファイアウォールの設定を変更しようとした。
1545 スーパーユーザー権限
1546 .RB ( CAP_NET_BIND_SERVICE
1547 ケーパビリティ) なしで特権ポートにバインドしようとした。
1548 .TP
1549 .B EADDRINUSE
1550 .\"O Tried to bind to an address already in use.
1551 既に使われているアドレスにバインドしようとした。
1552 .TP
1553 .B EADDRNOTAVAIL
1554 .\"O A nonexistent interface was requested or the requested source
1555 .\"O address was not local.
1556 存在しないソケットが要求された。または要求された
1557 ソースアドレスがローカルでない。
1558 .TP
1559 .B EAGAIN
1560 .\"O Operation on a nonblocking socket would block.
1561 非ブロッキングソケットに対してブロックする操作を行った。
1562 .TP
1563 .B EALREADY
1564 .\"O An connection operation on a nonblocking socket is already in progress.
1565 非ブロッキングソケットに対する接続操作が既に実行中である。
1566 .TP
1567 .B ECONNABORTED
1568 .\"O A connection was closed during an
1569 .\"O .BR accept (2).
1570 .BR accept (2)
1571 の最中に接続がクローズされた。
1572 .TP
1573 .B EHOSTUNREACH
1574 .\"O No valid routing table entry matches the destination address.
1575 .\"O This error can be caused by a ICMP message from a remote router or
1576 .\"O for the local routing table.
1577 宛先アドレスにマッチする有効なエントリがルーティングテーブルに
1578 存在しない。このエラーはリモートルータからの、
1579 あるいはローカルルーティングテーブルへの
1580 ICMP メッセージによって引き起こされることがある。
1581 .TP
1582 .B EINVAL
1583 .\"O Invalid argument passed.
1584 .\"O For send operations this can be caused by sending to a
1585 .\"O .I blackhole
1586 .\"O route.
1587 不正な引き数が渡された。送信操作において、
1588 .I blackhole
1589 ルートに送信しようとするとこのエラーが起こることがある。
1590 .TP
1591 .B EISCONN
1592 .\"O .BR connect (2)
1593 .\"O was called on an already connected socket.
1594 .BR connect (2)
1595 が、既に接続済みのソケットに対して呼ばれた。
1596 .TP
1597 .B EMSGSIZE
1598 .\"O Datagram is bigger than an MTU on the path and it cannot be fragmented.
1599 データグラムが path MTU よりも大きく、フラグメント化もできない。
1600 .TP
1601 .BR ENOBUFS ", " ENOMEM
1602 .\"O Not enough free memory.
1603 .\"O This often means that the memory allocation is limited by the socket
1604 .\"O buffer limits, not by the system memory, but this is not 100% consistent.
1605 空きメモリが足りない。
1606 このエラーは、メモリアロケーションがソケットバッファの
1607 大きさによって制限されていることを意味しているのが通常であるが、
1608 100% そうだというわけではない。
1609 .TP
1610 .B ENOENT
1611 .\"O .B SIOCGSTAMP
1612 .\"O was called on a socket where no packet arrived.
1613 パケットが全く到着していないソケットに対して
1614 .B SIOCGSTAMP
1615 が呼ばれた。
1616 .TP
1617 .B ENOPKG
1618 .\"O A kernel subsystem was not configured.
1619 カーネルサブシステムが設定されていない。
1620 .TP
1621 .\"O .BR ENOPROTOOPT " and " EOPNOTSUPP
1622 .BR ENOPROTOOPT " と " EOPNOTSUPP
1623 .\"O Invalid socket option passed.
1624 不正なソケットオプションが渡された。
1625 .TP
1626 .B ENOTCONN
1627 .\"O The operation is only defined on a connected socket, but the socket wasn't
1628 .\"O connected.
1629 接続されていないソケットに対して、
1630 接続状態でしか定義されていない操作を行おうとした。
1631 .TP
1632 .B EPERM
1633 .\"O User doesn't have permission to set high priority, change configuration,
1634 .\"O or send signals to the requested process or group.
1635 高い優先度を設定したり、設定を変更したり、要求されたプロセスや
1636 プロセスグループにシグナルを送ったりするのに必要な権限を、
1637 ユーザーが持っていない。
1638 .TP
1639 .B EPIPE
1640 .\"O The connection was unexpectedly closed or shut down by the other end.
1641 接続が先方から期待していなかったやり方で
1642 クローズあるいはシャットダウンされた。
1643 .TP
1644 .B ESOCKTNOSUPPORT
1645 .\"O The socket is not configured or an unknown socket type was requested.
1646 ソケットが未設定であるか、知らないソケットタイプが要求された。
1647 .PP
1648 .\"O Other errors may be generated by the overlaying protocols; see
1649 他のエラーが上層のプロトコルによって生じるかもしれない。
1650 .\"O .BR tcp (7),
1651 .\"O .BR raw (7),
1652 .\"O .BR udp (7)
1653 .\"O and
1654 .\"O .BR socket (7).
1655 .BR tcp (7),
1656 .BR raw (7),
1657 .BR udp (7),
1658 .BR socket (7)
1659 などを参照のこと。
1660 .\"O .SH NOTES
1661 .SH 注意
1662 .\"O .BR IP_MTU ,
1663 .\"O .BR IP_MTU_DISCOVER ,
1664 .\"O .BR IP_PKTINFO ,
1665 .\"O .B IP_RECVERR
1666 .\"O and
1667 .\"O .B IP_ROUTER_ALERT
1668 .BR IP_MTU ,
1669 .BR IP_MTU_DISCOVER ,
1670 .BR IP_PKTINFO ,
1671 .BR IP_RECVERR ,
1672 .B IP_ROUTER_ALERT
1673 .\"O are Linux-specific and should not be used in
1674 .\"O programs intended to be portable.
1675 は Linux 固有であり、移植性を考慮したプログラムでは
1676 用いるべきではない。
1677 .\" IP_PASSSEC is Linux-specific
1678 .\" IP_TRANSPARENT is Linux-specific
1679 .\" IP_FREEBIND is Linux-specific
1680 .\" IP_XFRM_POLICY is Linux-specific
1681 .\" IP_IPSEC_POLICY is a nonstandard extension, also present on some BSDs
1682 .\"O Be very careful with the
1683 .\"O .B SO_BROADCAST
1684 .\"O option \- it is not privileged in Linux.
1685 .\"O It is easy to overload the network
1686 .\"O with careless broadcasts.
1687 .\"O For new application protocols
1688 .\"O it is better to use a multicast group instead of broadcasting.
1689 .\"O Broadcasting is discouraged.
1690 .B SO_BROADCAST
1691 オプションの利用には、くれぐれも注意すること。
1692 これは Linux では特権操作ではない。
1693 不注意なブロードキャストを行うと、ネットワークは簡単に過負荷状態になる。
1694 新しいアプリケーションプロトコルには、ブロードキャストではなく
1695 マルチキャストグループを用いるほうがよい。
1696 ブロードキャストは推奨されない。
1697 .PP
1698 .\"O Some other BSD sockets implementations provide
1699 .\"O .B IP_RCVDSTADDR
1700 .\"O and
1701 .\"O .B IP_RECVIF
1702 .\"O socket options to get the destination address and the interface of
1703 .\"O received datagrams.
1704 .\"O Linux has the more general
1705 .\"O .B IP_PKTINFO
1706 .\"O for the same task.
1707 他の BSD のソケット実装では、
1708 .B IP_RCVDSTADDR
1709
1710 .B IP_RECVIF
1711 といったソケットオプションがサポートされており、
1712 宛先アドレスや受信データグラムのインターフェースが取得できるように
1713 なっていることもある。
1714 Linux で同じことをやらせるには、より一般的な
1715 .B IP_PKTINFO
1716 が使える。
1717 .PP
1718 .\"O Some BSD sockets implementations also provide an
1719 .\"O .B IP_RECVTTL
1720 .\"O option, but an ancillary message with type
1721 .\"O .B IP_RECVTTL
1722 .\"O is passed with the incoming packet.
1723 .\"O This is different from the
1724 .\"O .B IP_TTL
1725 .\"O option used in Linux.
1726 いくつかの BSD のソケット実装では
1727 .B IP_RECVTTL
1728 オプションも提供されているが、タイプ
1729 .B IP_RECVTTL
1730 の補助メッセージは受信パケットとともに渡される。
1731 これは Linux で使われている
1732 .B IP_TTL
1733 オプションとは異なる動作である。
1734 .PP
1735 .\"O Using
1736 .\"O .B SOL_IP
1737 .\"O socket options level isn't portable, BSD-based stacks use
1738 .\"O .B IPPROTO_IP
1739 .\"O level.
1740 .B SOL_IP
1741 ソケットオプションレベルは移植性がない。
1742 BSD ベースのプロトコルスタックでは
1743 .B IPPROTO_IP
1744 レベルが使用されている。
1745 .\"O .SS Compatibility
1746 .SS 移植性
1747 .\"O For compatibility with Linux 2.0, the obsolete
1748 .\"O .BI "socket(AF_INET, SOCK_PACKET, " protocol )
1749 .\"O syntax is still supported to open a
1750 .\"O .BR packet (7)
1751 .\"O socket.
1752 .\"O This is deprecated and should be replaced by
1753 .\"O .BI "socket(AF_PACKET, SOCK_RAW, " protocol )
1754 .\"O instead.
1755 .\"O The main difference is the
1756 .\"O new
1757 .\"O .I sockaddr_ll
1758 .\"O address structure for generic link layer information instead of the old
1759 .\"O .BR sockaddr_pkt .
1760 Linux 2.0 との互換性のために、 obsolete な
1761 .BI "socket(AF_INET, SOCK_PACKET, " protocol )
1762 という書式でも
1763 .BR packet (7)
1764 をオープンできるようになっているが、これはお勧めできない。今後は
1765 .BI "socket(AF_PACKET, SOCK_RAW, " protocol )
1766 を代わりに用いるべきである。主な違いは、ジェネリックなリンク層用の
1767 .I sockaddr_ll
1768 アドレス構造体が、古い
1769 .B sockaddr_pkt
1770 に変わって用いられるようになったことである。
1771 .\"O .SH BUGS
1772 .SH バグ
1773 .\"O There are too many inconsistent error values.
1774 エラーの値が全く首尾一貫していない。
1775 .PP
1776 .\"O The ioctls to configure IP-specific interface options and ARP tables are
1777 .\"O not described.
1778 IP 固有のインターフェースオプションを指定するための ioctl と
1779 ARP テーブルのことが記述されていない。
1780 .PP
1781 .\"O Some versions of glibc forget to declare
1782 .\"O .IR in_pktinfo .
1783 .\"O Workaround currently is to copy it into your program from this man page.
1784 glibc のバージョンによっては
1785 .I in_pktinfo
1786 の定義を忘れているものがある。
1787 現時点でのとりあえずの対策としては、この man ページにある定義をプログラム中に
1788 コピーすることである。
1789 .PP
1790 .\"O Receiving the original destination address with
1791 .\"O .B MSG_ERRQUEUE
1792 .\"O in
1793 .\"O .I msg_name
1794 .\"O by
1795 .\"O .BR recvmsg (2)
1796 .\"O does not work in some 2.2 kernels.
1797 .BR recvmsg (2)
1798
1799 .I msg_name
1800
1801 .B MSG_ERRQUEUE
1802 を指定して、受信パケットに入っていた宛先アドレスを取得する方法は
1803 2.2 カーネルの一部でうまく動かない。
1804 .\"O .\" .SH AUTHORS
1805 .\" .SH 著者
1806 .\"O .\" This man page was written by Andi Kleen.
1807 .\" この man ページは Andi Kleen が書いた。
1808 .\"O .SH SEE ALSO
1809 .SH 関連項目
1810 .BR recvmsg (2),
1811 .BR sendmsg (2),
1812 .BR byteorder (3),
1813 .BR ipfw (4),
1814 .BR capabilities (7),
1815 .BR netlink (7),
1816 .BR raw (7),
1817 .BR socket (7),
1818 .BR tcp (7),
1819 .BR udp (7)
1820 .PP
1821 .\"O RFC\ 791 for the original IP specification.
1822 .BR RFC\ 791 :
1823 オリジナルの IP の仕様
1824 .br
1825 .\"O RFC\ 1122 for the IPv4 host requirements.
1826 .BR RFC\ 1122 :
1827 IPv4 ホストの必要条件
1828 .br
1829 .\"O RFC\ 1812 for the IPv4 router requirements.
1830 .BR RFC\ 1812 :
1831 IPv4 ルータの必要条件
1832 .\" FIXME autobind INADDR REUSEADDR