OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / original / man7 / udp.7
index c2e7003..f4d5539 100644 (file)
@@ -1,17 +1,23 @@
 .\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>.
+.\"
+.\" %%%LICENSE_START(VERBATIM_ONE_PARA)
 .\" Permission is granted to distribute possibly modified copies
 .\" of this page provided the header is included verbatim,
 .\" and in case of nontrivial modification author and date
 .\" of the modification is added to the header.
+.\" %%%LICENSE_END
+.\"
 .\" $Id: udp.7,v 1.7 2000/01/22 01:55:05 freitag Exp $
 .\"
-.TH UDP  7 2010-06-13 "Linux" "Linux Programmer's Manual"
+.TH UDP  7 2013-07-31 "Linux" "Linux Programmer's Manual"
 .SH NAME
 udp \- User Datagram Protocol for IPv4
 .SH SYNOPSIS
 .B #include <sys/socket.h>
 .br
 .B #include <netinet/in.h>
+.br
+.B #include <netinet/udp.h>
 .sp
 .B udp_socket = socket(AF_INET, SOCK_DGRAM, 0);
 .SH DESCRIPTION
@@ -44,7 +50,7 @@ or
 In order to receive packets, the socket can be bound to a local
 address first by using
 .BR bind (2).
-Otherwise the socket layer will automatically assign
+Otherwise, the socket layer will automatically assign
 a free local port out of the range defined by
 .I /proc/sys/net/ipv4/ip_local_port_range
 and bind the socket to
@@ -60,7 +66,7 @@ is not supported.
 
 IP options may be sent or received using the socket options described in
 .BR ip (7).
-They are only processed by the kernel when the appropriate
+They are processed by the kernel only when the appropriate
 .I /proc
 parameter
 is enabled (but still passed to the user even when it is turned off).
@@ -70,7 +76,7 @@ See
 When the
 .B MSG_DONTROUTE
 flag is set on sending, the destination address must refer to a local
-interface address and the packet is only sent to that interface.
+interface address and the packet is sent only to that interface.
 
 By default, Linux UDP does path MTU (Maximum Transmission Unit) discovery.
 This means the kernel
@@ -89,12 +95,12 @@ When turned off, UDP will fragment outgoing UDP packets
 that exceed the interface MTU.
 However, disabling it is not recommended
 for performance and reliability reasons.
-.SS "Address Format"
+.SS Address format
 UDP uses the IPv4
 .I sockaddr_in
 address format described in
 .BR ip (7).
-.SS "Error Handling"
+.SS Error handling
 All fatal errors will be passed to the user as an error return even
 when the socket is not connected.
 This includes asynchronous errors
@@ -169,13 +175,17 @@ Each UDP socket is able to use the size for sending data,
 even if total pages of UDP sockets exceed
 .I udp_mem
 pressure.
-.SS "Socket Options"
+.SS Socket options
 To set or get a UDP socket option, call
 .BR getsockopt (2)
 to read or
 .BR setsockopt (2)
 to write the option with the option level argument set to
 .BR IPPROTO_UDP .
+Unless otherwise noted,
+.I optval
+is a pointer to an
+.IR int .
 .TP
 .BR UDP_CORK " (since Linux 2.5.44)"
 If this option is enabled, then all data output on this socket
@@ -223,7 +233,7 @@ to distinguish these cases.
 Returns the number of data bytes in the local send queue.
 Only supported with Linux 2.4 and above.
 .PP
-In addition all ioctls documented in
+In addition, all ioctls documented in
 .BR ip (7)
 and
 .BR socket (7)
@@ -243,7 +253,7 @@ This might be caused by a previous packet sent over the socket.
 is a new feature in Linux 2.2.
 .\" .SH CREDITS
 .\" This man page was written by Andi Kleen.
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR ip (7),
 .BR raw (7),
 .BR socket (7),
@@ -254,3 +264,12 @@ RFC\ 768 for the User Datagram Protocol.
 RFC\ 1122 for the host requirements.
 .br
 RFC\ 1191 for a description of path MTU discovery.
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.