1 .\" This man page is Copyright (C) 1999 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: udp.7,v 1.7 2000/01/22 01:55:05 freitag Exp $
8 .\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved.
9 .\" Translated 1999-12-06, NAKANO Takeo <nakano@apm.seikei.ac.jp>
10 .\" Updated 2005-10-09, Kentaro Shirakata <argrath@ub32.org>
11 .\" Updated 2007-01-05, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.43
12 .\" Updated 2008-12-29, Akihiro MOTOKI, LDP v3.14
13 .\" Updated 2010-04-10, Akihiro MOTOKI, LDP v3.24
15 .TH UDP 7 2009-09-30 "Linux" "Linux Programmer's Manual"
17 .\"O udp \- User Datagram Protocol for IPv4
19 udp \- IPv4 ¤Î ¥æ¡¼¥¶¡¼¥Ç¡¼¥¿¥°¥é¥à¥×¥í¥È¥³¥ë
22 .B #include <sys/socket.h>
24 .B #include <netinet/in.h>
26 .B udp_socket = socket(AF_INET, SOCK_DGRAM, 0);
29 .\"O This is an implementation of the User Datagram Protocol
30 .\"O described in RFC\ 768.
31 .\"O It implements a connectionless, unreliable datagram packet service.
32 .\"O Packets may be reordered or duplicated before they arrive.
33 .\"O UDP generates and checks checksums to catch transmission errors.
34 ¤³¤ì¤Ï RFC\ 768 ¤Çµ½Ò¤µ¤ì¤Æ¤¤¤ë User Datagram Protocol ¤Î¼ÂÁõ¤Ç¤¢¤ë¡£
35 UDP ¤Ï¥³¥Í¥¯¥·¥ç¥ó¥ì¥¹¤Î¡¢¿®ÍêÀ¤ÎÄ㤤¥Ç¡¼¥¿¥Ñ¥±¥Ã¥È¥µ¡¼¥Ó¥¹¤Ç¤¢¤ë¡£
36 ¥Ñ¥±¥Ã¥È¤ÏÅþÃåÁ°¤ËʤÓÂؤ¨¤é¤ì¤¿¤êÊ£À½¤µ¤ì¤¿¤ê¤¹¤ë¡£
37 UDP ¤ÏžÁ÷¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ë¤¿¤á¤Ë¥Á¥§¥Ã¥¯¥µ¥à¤òÀ¸À®¡¦¥Á¥§¥Ã¥¯¤¹¤ë¡£
39 .\"O When a UDP socket is created,
40 .\"O its local and remote addresses are unspecified.
41 .\"O Datagrams can be sent immediately using
45 .\"O with a valid destination address as an argument.
48 .\"O is called on the socket, the default destination address is set and
49 .\"O datagrams can now be sent using
53 .\"O without specifying a destination address.
54 UDP ¥½¥±¥Ã¥È¤¬À¸À®¤µ¤ì¤ë¤È¤¡¢
55 ¥í¡¼¥«¥ë¥¢¥É¥ì¥¹¤ä¥ê¥â¡¼¥È¥¢¥É¥ì¥¹¤Ï»ØÄꤵ¤ì¤Ê¤¤¡£
56 Àµ¤·¤¤¹Ô¤À襢¥É¥ì¥¹¤ò°ú¿ô¤È¤·¤Æ
60 ¤ò¸Æ¤Ù¤Ð¡¢¥Ç¡¼¥¿¥°¥é¥à¤Ï¤¿¤À¤Á¤ËÁ÷¿®¤µ¤ì¤ë¡£
63 ¤ò¸Æ¤Ö¤È¡¢¥Ç¥Õ¥©¥ë¥È¤Î¹Ô¤À襢¥É¥ì¥¹¤¬ÀßÄꤵ¤ì¡¢
67 ¤ò»È¤Ã¤Æ¡¢¹Ô¤À襢¥É¥ì¥¹¤Î»ØÄê¤Ê¤·¤Ë¥Ç¡¼¥¿¥°¥é¥à¤òÁ÷¿®¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ë¡£
68 .\"O It is still possible to send to other destinations by passing an
73 ¤³¤Î¾ì¹ç¤Ç¤â¡¢¹Ô¤À襢¥É¥ì¥¹¤ò
77 ¤ËÅϤ»¤Ð¡¢¥Ç¥Õ¥©¥ë¥È°Ê³°¤Î¥¢¥É¥ì¥¹¤ËÁ÷¿®²Äǽ¤Ç¤¢¤ë¡£
78 .\"O In order to receive packets, the socket can be bound to a local
79 .\"O address first by using
81 ¥Ñ¥±¥Ã¥È¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¡¢¤Þ¤º¥½¥±¥Ã¥È¤ò
83 ¤òÍѤ¤¤Æ¥í¡¼¥«¥ë¤Ê¥¢¥É¥ì¥¹¤Ë¥Ð¥¤¥ó¥É¤µ¤»¤ë¤³¤È¤â¤Ç¤¤ë¡£
84 .\"O Otherwise the socket layer will automatically assign
85 .\"O a free local port out of the range defined by
86 .\"O .I /proc/sys/net/ipv4/ip_local_port_range
87 .\"O and bind the socket to
89 ¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢¥½¥±¥Ã¥ÈÁؤϼ«Æ°Åª¤Ë
90 .I /proc/sys/net/ipv4/ip_local_port_range
91 ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÈϰϤγ°¤Ç¶õ¤¤¤Æ¤¤¤ë¥í¡¼¥«¥ë¤Ê¥Ý¡¼¥È¤ò³ä¤êÅö¤Æ¡¢
96 .\"O All receive operations return only one packet.
97 .\"O When the packet is smaller than the passed buffer, only that much
98 .\"O data is returned, when it is bigger, the packet is truncated and the
101 ¼õ¿®Æ°ºî¤Ï¥Ñ¥±¥Ã¥È¤ò°ì¤Ä¤À¤±ÊÖ¤¹¡£ÅϤ·¤¿¥Ð¥Ã¥Õ¥¡¤è¤ê¤â¥Ñ¥±¥Ã¥È¤¬
102 ¾®¤µ¤±¤ì¤Ð¡¢¤½¤Î¥Ñ¥±¥Ã¥È¤ÎÂ礤µ¤Î¥Ç¡¼¥¿¤À¤±¤¬ÊÖ¤µ¤ì¤ë¡£
103 µÕ¤Ë¥Ð¥Ã¥Õ¥¡¤è¤ê¤âÂ礤¤¾ì¹ç¤Ï¥Ñ¥±¥Ã¥È¤Ï´Ý¤á¤é¤ì¡¢
105 ¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£
107 .\"O is not supported.
109 ¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£
111 .\"O IP options may be sent or received using the socket options described in
113 .\"O They are only processed by the kernel when the appropriate
116 .\"O is enabled (but still passed to the user even when it is turned off).
121 ¤Ëµ½Ò¤µ¤ì¤Æ¤¤¤ë¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ÆÆɤ߽ñ¤¤Ç¤¤ë¡£
124 ¥Ñ¥é¥á¡¼¥¿¤¬Í¸ú¤Ê¾ì¹ç¤Ë¸Â¤Ã¤Æ¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ½èÍý¤µ¤ì¤ë
125 (¤·¤«¤·Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¥æ¡¼¥¶¡¼¤Ë¤ÏÅϤµ¤ì¤ë)¡£
130 .\"O .B MSG_DONTROUTE
131 .\"O flag is set on sending, the destination address must refer to a local
132 .\"O interface address and the packet is only sent to that interface.
134 ¥Õ¥é¥°¤¬Á÷¿®»þ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
135 ¹Ô¤À襢¥É¥ì¥¹¤Ï¥í¡¼¥«¥ë¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥¢¥É¥ì¥¹¤«¤é
136 »²¾È¤Ç¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¥Ñ¥±¥Ã¥È¤Ï¤½¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤·¤«Á÷¤é¤ì¤Ê¤¤¡£
138 .\"O By default, Linux UDP does path MTU (Maximum Transmission Unit) discovery.
139 .\"O This means the kernel
140 .\"O will keep track of the MTU to a specific target IP address and return
142 .\"O when a UDP packet write exceeds it.
143 .\"O When this happens, the application should decrease the packet size.
144 .\"O Path MTU discovery can be also turned off using the
145 .\"O .B IP_MTU_DISCOVER
146 .\"O socket option or the
147 .\"O .I /proc/sys/net/ipv4/ip_no_pmtu_disc
151 .\"O When turned off, UDP will fragment outgoing UDP packets
152 .\"O that exceed the interface MTU.
153 .\"O However, disabling it is not recommended
154 .\"O for performance and reliability reasons.
155 ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Linux ¤Î UDP ¤Ï Path MTU Discovery ¤ò¹Ô¤¦¡£
156 ¤Ä¤Þ¤ê¡¢¥«¡¼¥Í¥ë¤ÏÆÃÄê¤Î°¸Àè IP ¥¢¥É¥ì¥¹¤Î MTU (Maximum Transmission Unit;
157 ºÇÂçžÁ÷ñ°Ì) ¤òµÏ¿¤·¡¢UDP ¥Ñ¥±¥Ã¥È¤Î½ñ¤¹þ¤ß¤¬ MTU ¤òĶ¤¨¤¿¾ì¹ç
161 ¤òÊÖ¤µ¤ì¤¿¾ì¹ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤ò¾®¤µ¤¯¤¹¤Ù¤¤Ç¤¢¤ë¡£
165 .I /proc/sys/net/ipv4/ip_no_pmtu_disc
166 ¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ Path MTU Discovery ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤â¤Ç¤¤ë
170 Path MTU Discovery ¤ò̵¸ú¤Ë¤·¤¿¾ì¹ç¤Ï¡¢¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤¬
171 ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î MTU ¤è¤ê¤âÂ礤¤¤È UDP ¤Ï¤½¤Î¥Ñ¥±¥Ã¥È¤ò
172 ¥Õ¥é¥°¥á¥ó¥È²½¤·¤ÆÁ÷½Ð¤¹¤ë¡£
173 ¤·¤«¤·¤Ê¤¬¤é¡¢Àǽ¤È¿®ÍêÀ¤ÎÍýͳ¤«¤é Path MTU Discovery ¤ò
174 ̵¸ú¤Ë¤¹¤ë¤Î¤Ï¿ä¾©¤Ç¤¤Ê¤¤¡£
175 .\"O .SS Address Format
176 .SS ¥¢¥É¥ì¥¹¤Î¥Õ¥©¡¼¥Þ¥Ã¥È
177 .\"O UDP uses the IPv4
179 .\"O address format described in
183 ¥¢¥É¥ì¥¹¥Õ¥©¡¼¥Þ¥Ã¥È¤òÍѤ¤¤ë¡£¤³¤ì¤Ï
186 .\"O .SS Error Handling
188 .\"O All fatal errors will be passed to the user as an error return even
189 .\"O when the socket is not connected.
190 .\"O This includes asynchronous errors
191 .\"O received from the network.
192 .\"O You may get an error for an earlier packet
193 .\"O that was sent on the same socket.
194 Ã×̿Ū¤Ê¥¨¥é¡¼¤Ï¡¢¤¿¤È¤¨¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢
195 ¤¹¤Ù¤Æ¥¨¥é¡¼Ìá¤êÃͤȤ·¤Æ¥æ¡¼¥¶¡¼¤ËÅϤµ¤ì¤ë¡£
196 ¤³¤ì¤Ë¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é¼õ¤±¼è¤ëÈóƱ´ü¥¨¥é¡¼¤â´Þ¤Þ¤ì¤ë¡£
197 Ʊ¤¸¥½¥±¥Ã¥È¤ò»È¤Ã¤ÆÁ÷¿®¤·¤¿ÀΤΥѥ±¥Ã¥È¤Ë´Ø¤¹¤ë¥¨¥é¡¼¤ò¼õ¤±¼è¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
198 .\"O This behavior differs from many other BSD socket implementations
199 .\"O which don't pass any errors unless the socket is connected.
200 .\"O Linux's behavior is mandated by
202 ¤³¤Î¿¶¤ëÉñ¤¤¤Ï¾¤Î BSD ¥½¥±¥Ã¥È¤Î¼ÂÁõ¤Î¿¤¯¤È¤Ï°Û¤Ê¤ë¡£
203 ¤³¤ì¤é¤Ç¤Ï¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¥¨¥é¡¼¤òÁ´¤¯ÊÖ¤µ¤Ê¤¤¡£
206 ¤Ç¤Î»ØÄê¤Ë½¾¤Ã¤¿¤â¤Î¤Ç¤¢¤ë¡£
208 .\"O For compatibility with legacy code, in Linux 2.0 and 2.2
209 .\"O it was possible to set the
212 .\"O option to receive remote errors only when the socket has been
213 .\"O connected (except for
217 .\"O Locally generated errors are always passed.
218 .\"O Support for this socket option was removed in later kernels; see
220 .\"O for further information.
221 Linux 2.0 ¤È 2.2 ¤Ç¤Ï¡¢¸Å¤¤¥³¡¼¥É¤È¤Î¸ß´¹À¤Î¤¿¤á¤Ë¡¢
224 ¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ì¤Ð¡¢¥½¥±¥Ã¥È¤¬Àܳ¤µ¤ì¤Æ¤¤¤ë
225 ¾ì¹ç¤Ë¸Â¤Ã¤Æ¥ê¥â¡¼¥È¤Î¥¨¥é¡¼¤ò¼õ¿®¤¹¤ë¤è¤¦¤Ë¤Ç¤¤¿
226 .RB ( EPROTO " ¤È " EMSGSIZE
228 ¥í¡¼¥«¥ë¤ÇÀ¸À®¤µ¤ì¤¿¥¨¥é¡¼¤Ï¾ï¤ËÅϤµ¤ì¤ë¡£
229 ¤³¤Î¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤Î¥µ¥Ý¡¼¥È¤Ï¤½¤ì°Ê¹ß¤Î¥Ð¡¼¥¸¥ç¥ó¤Î Linux ¤Ç
236 .\"O option is enabled, all errors are stored in the socket error queue
237 .\"O and can be received by
243 ¥ª¥×¥·¥ç¥ó¤¬Í¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢
244 ¤¹¤Ù¤Æ¤Î¥¨¥é¡¼¤Ï¥½¥±¥Ã¥È¤Î¥¨¥é¡¼¥¥å¡¼¤ËÊݸ¤µ¤ì¤ë¡£
250 .\"O .SS /proc interfaces
251 .SS /proc ¥¤¥ó¥¿¥Õ¥§¡¼¥¹
252 .\"O System-wide UDP parameter settings can be accessed by files in the directory
253 .\"O .IR /proc/sys/net/ipv4/ .
254 ¥·¥¹¥Æ¥àÁ´ÂΤΠUDP ¥Ñ¥é¥á¡¼¥¿ÀßÄê¤Ë¤Ï¡¢
255 .I /proc/sys/net/ipv4/
256 ¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤¤Ç¥¢¥¯¥»¥¹¤Ç¤¤ë¡£
258 .\"O .IR udp_mem " (since Linux 2.6.25)"
259 .IR udp_mem " (Linux 2.6.25 °Ê¹ß)"
260 .\"O This is a vector of three integers governing the number
261 .\"O of pages allowed for queueing by all UDP sockets.
262 ¤³¤ì¤Ï 3 ¤Ä¤ÎÀ°¿ô¤«¤é¤Ê¤ë¥Ù¥¯¥È¥ëÃͤǡ¢
263 UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥¥å¡¼¤ÇÍøÍѲÄǽ¤Ê¥Ú¡¼¥¸¿ô¤òÀ©¸æ¤¹¤ë¡£
267 .\"O Below this number of pages, UDP is not bothered about its
268 .\"O memory appetite.
269 .\"O When the amount of memory allocated by UDP exceeds
270 .\"O this number, UDP starts to moderate memory usage.
271 ¤³¤Î¥Ú¡¼¥¸¿ô¤è¤ê¾¯¤Ê¤±¤ì¤Ð¡¢UDP ¤Ï¤½¤Î¥á¥â¥ê»ÈÍѤ˴ؤ·¤Æ
273 UDP ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥êÁíÎ̤¬¤³¤ÎÃͤòĶ²á¤¹¤ë¤È¡¢
274 UDP ¤Ï¥á¥â¥ê»ÈÍÑÎ̤òÄ´À°¤·»Ï¤á¤ë¡£
277 .\"O This value was introduced to follow the format of
285 »²¾È) ¤È¹ç¤ï¤»¤ë¤¿¤á¤ËƳÆþ¤µ¤ì¤¿
288 .\"O Number of pages allowed for queueing by all UDP sockets.
289 UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥¥å¡¼¤ÇÍøÍѲÄǽ¤Ê¥Ú¡¼¥¸¿ô¡£
292 .\"O Defaults values for these three items are
293 .\"O calculated at boot time from the amount of available memory.
294 ¤³¤ì¤é¤Î 3 ¤Ä¤ÎÃͤΥǥե©¥ë¥ÈÃͤϡ¢
295 ¥Ö¡¼¥È»þ¤ËÍøÍѲÄǽ¤Ê¥á¥â¥êÁíÎ̤«¤é·×»»¤µ¤ì¤ë¡£
297 .\"O .IR udp_rmem_min " (integer; default value: PAGE_SIZE; since Linux 2.6.25)"
298 .IR udp_rmem_min " (integer; ¥Ç¥Õ¥©¥ë¥ÈÃÍ: PAGE_SIZE; Linux 2.6.25 °Ê¹ß)"
299 .\"O Minimal size, in bites, of receive buffers used by UDP sockets in moderation.
300 .\"O Each UDP socket is able to use the size for receiving data,
301 .\"O even if total pages of UDP sockets exceed
304 ¥á¥â¥ê»ÈÍÑÎ̤ÎÄ´À°Ãæ¤Ë¡¢UDP ¥½¥±¥Ã¥È¤¬»ÈÍѤǤ¤ë¼õ¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®ÃÍ
306 UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥Ú¡¼¥¸»ÈÍÑÎ̤ιç·×¤¬
308 pressure ¤òĶ²á¤·¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢
309 ³Æ UDP ¥½¥±¥Ã¥È¤Ï¥Ç¡¼¥¿¤Î¼õ¿®¤Ë¤³¤Î¥µ¥¤¥ºÊ¬¤À¤±¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£
311 .\"O .IR udp_wmem_min " (integer; default value: PAGE_SIZE; since Linux 2.6.25)"
312 .IR udp_wmem_min " (integer; ¥Ç¥Õ¥©¥ë¥ÈÃÍ: PAGE_SIZE; Linux 2.6.25 °Ê¹ß)"
313 .\"O Minimal size, in bytes, of send buffer used by UDP sockets in moderation.
314 .\"O Each UDP socket is able to use the size for sending data,
315 .\"O even if total pages of UDP sockets exceed
318 ¥á¥â¥ê»ÈÍÑÎ̤ÎÄ´À°Ãæ¤Ë¡¢UDP ¥½¥±¥Ã¥È¤¬»ÈÍѤǤ¤ëÁ÷¿®¥Ð¥Ã¥Õ¥¡¤ÎºÇ¾®ÃÍ
320 UDP ¤ÎÁ´¥½¥±¥Ã¥È¤Î¥Ú¡¼¥¸»ÈÍÑÎ̤ιç·×¤¬
322 pressure ¤òĶ²á¤·¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢
323 ³Æ UDP ¥½¥±¥Ã¥È¤Ï¥Ç¡¼¥¿¤ÎÁ÷¿®¤Ë¤³¤Î¥µ¥¤¥ºÊ¬¤À¤±¤Ï»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£
324 .\"O \"O .SS "Socket Options"
325 .SS ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó
326 .\"O To set or get a UDP socket option, call
327 .\"O .BR getsockopt (2)
329 .\"O .BR setsockopt (2)
330 .\"O to write the option with the option level argument set to
331 .\"O .BR IPPROTO_UDP .
332 UDP ¥½¥±¥Ã¥È¥ª¥×¥·¥ç¥ó¤òÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢
337 ¤ò¥ª¥×¥·¥ç¥ó¥ì¥Ù¥ë°ú¿ô¤Ë
341 .\"O .BR UDP_CORK " (since Linux 2.5.44)"
342 .BR UDP_CORK " (Linux 2.5.44 °Ê¹ß)"
343 .\"O If this option is enabled, then all data output on this socket
344 .\"O is accumulated into a single datagram that is transmitted when
345 .\"O the option is disabled.
346 .\"O This option should not be used in code intended to be
348 ¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¤È¡¢¤³¤Î¥½¥±¥Ã¥È¤ÎÁ´¤Æ¤Î¥Ç¡¼¥¿½ÐÎϤÏ
349 °ì¤Ä¤Î¥Ç¡¼¥¿¥°¥é¥à¤ËÃßÀѤµ¤ì¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤¬Ìµ¸ú²½¤µ¤ì¤¿»þ¤Ë
351 ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï°Ü¿¢À¤ò¹Íθ¤·¤¿¥³¡¼¥É¤Ç¤ÏÍѤ¤¤ë¤Ù¤¤Ç¤Ï¤Ê¤¤¡£
352 .\" FIXME document UDP_ENCAP (new in kernel 2.5.67)
353 .\" From include/linux/udp.h:
354 .\" /* UDP encapsulation types */
355 .\" #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
356 .\" #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
357 .\" #define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
360 .\"O These ioctls can be accessed using
364 ¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤Ç¤¤ë¡£
365 .\"O The correct syntax is:
366 Àµ¤·¤¤Ê¸Ë¡¤Ï°Ê²¼¤ÎÄ̤ꡣ
371 .IB error " = ioctl(" udp_socket ", " ioctl_type ", &" value ");"
375 .BR FIONREAD " (" SIOCINQ )
376 .\"O Gets a pointer to an integer as argument.
377 .\"O Returns the size of the next pending datagram in the integer in bytes,
378 .\"O or 0 when no datagram is pending.
379 integer ¤Î¥Ý¥¤¥ó¥¿¤ò°ú¿ô¤È¤·¤Æ¼è¤ë¡£
380 ¼¡¤ËÂÔµ¡¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥°¥é¥à¤Î¥µ¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤ÎÀ°¿ô¤ÇÊÖ¤¹¡£
381 ÂÔµ¡¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥°¥é¥à¤¬¤Ê¤¤¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
383 .BR TIOCOUTQ " (" SIOCOUTQ )
384 .\"O Returns the number of data bytes in the local send queue.
385 .\"O Only supported with Linux 2.4 and above.
386 ¥í¡¼¥«¥ëÁ÷¿®¥¥å¡¼¤Ë¤¢¤ë¥Ç¡¼¥¿¥µ¥¤¥º¤ò¥Ð¥¤¥Èñ°Ì¤ÇÊÖ¤¹¡£
387 Linux 2.4 °Ê¾å¤Ç¤Î¤ßÂбþ¤·¤Æ¤¤¤ë¡£
389 .\"O In addition all ioctls documented in
398 ¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î ioctl ¤âÂбþ¤·¤Æ¤¤¤ë¡£
401 .\"O All errors documented for
405 .\"O may be returned by a send or receive on a UDP socket.
409 ¤Ëµ½Ò¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥¨¥é¡¼¤¬¡¢
410 UDP ¥½¥±¥Ã¥È¤ÎÁ÷¼õ¿®¤ÇÊÖ¤µ¤ì¤ë²ÄǽÀ¤¬¤¢¤ë¡£
413 .\"O No receiver was associated with the destination address.
414 .\"O This might be caused by a previous packet sent over the socket.
415 ¹Ô¤À襢¥É¥ì¥¹¤Ë´ØÏ¢¤Å¤±¤é¤ì¤Æ¤¤¤ë¼õ¿®¼Ô¤¬¤¤¤Ê¤¤¡£
416 ¤³¤ì¤Ï°ÊÁ°¤Î¥Ñ¥±¥Ã¥È¤¬¤½¤Î¥Ñ¥±¥Ã¥È¤ò
417 ¾å½ñ¤Á÷¿®¤·¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¤³¤È¤¬Â¿¤¤¡£
421 .\"O is a new feature in Linux 2.2.
423 ¤Ï Linux 2.2 ¤Î¿·¤·¤¤µ¡Ç½¤Ç¤¢¤ë¡£
426 .\"O .\" This man page was written by Andi Kleen.
427 .\" ¤³¤Î man ¥Ú¡¼¥¸¤Ï Andi Kleen ¤¬½ñ¤¤¤¿¡£
435 .\"O RFC\ 768 for the User Datagram Protocol.
436 RFC\ 768 : User Datagram Protocol
438 .\"O RFC\ 1122 for the host requirements.
439 RFC\ 1122 : ¥Û¥¹¥È¤ÎɬÍ×¾ò·ï
441 .\"O RFC\ 1191 for a description of path MTU discovery.
442 RFC\ 1191 : path MTU discovery ¤Îµ½Ò