options, updates
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 17 May 1986 06:53:18 +0000 (22:53 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 17 May 1986 06:53:18 +0000 (22:53 -0800)
SCCS-vsn: share/man/man4/tcp.4 6.2
SCCS-vsn: share/man/man4/udp.4 6.2
SCCS-vsn: share/man/man4/ip.4 6.2

usr/src/share/man/man4/ip.4
usr/src/share/man/man4/tcp.4
usr/src/share/man/man4/udp.4

index 6cecebc..12453ae 100644 (file)
@@ -2,7 +2,7 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)ip.4        6.1 (Berkeley) %G%
+.\"    @(#)ip.4        6.2 (Berkeley) %G%
 .\"
 .TH IP 4P ""
 .UC 5
 .\"
 .TH IP 4P ""
 .UC 5
@@ -13,12 +13,33 @@ ip \- Internet Protocol
 .br
 .B #include <netinet/in.h>
 .PP
 .br
 .B #include <netinet/in.h>
 .PP
-.B s = socket(AF_INET, SOCK_RAW, 0);
+.B s = socket(AF_INET, SOCK_RAW, proto);
 .SH DESCRIPTION
 IP is the transport layer protocol used
 .SH DESCRIPTION
 IP is the transport layer protocol used
-by the Internet protocol family.  It may be accessed
+by the Internet protocol family.
+Options may be set at the IP level
+when using higher-level protocols that are based on IP
+(such as TCP and UDP).
+It may also be accessed
 through a \*(lqraw socket\*(rq when developing new protocols, or
 through a \*(lqraw socket\*(rq when developing new protocols, or
-special purpose applications.  IP sockets are connectionless,
+special purpose applications.
+.PP
+A single generic option is supported at the IP level, IP_OPTIONS,
+that may be used to provide IP options to be transmitted in the IP
+header of each outgoing packet.
+Options are set with
+.IR setsockopt (2)
+and examined with
+.IR getsockopt (2).
+The format of IP options to be sent is that specified by the IP protocol
+specification, with one exception:
+the list of addresses for Source Route options must include the first-hop
+gateway at the beginning of the list of gateways.
+The first-hop gateway address will be extracted from the option list
+and the size adjusted accordingly before use.
+IP options may be used with any socket type in the Internet family.
+.PP
+Raw IP sockets are connectionless,
 and are normally used with the
 .I sendto 
 and
 and are normally used with the
 .I sendto 
 and
@@ -36,11 +57,20 @@ or
 .IR send (2)
 system calls may be used).
 .PP
 .IR send (2)
 system calls may be used).
 .PP
+If
+.I proto
+is 0, the default protocol IPPROTO_RAW is used for outgoing
+packets, and only incoming packets destined for that protocol
+are received.
+If
+.I proto
+is non-zero, that protocol number will be used on outgoing packets
+and to filter incoming packets.
+.PP
 Outgoing packets automatically have an IP header prepended to
 them (based on the destination address and the protocol
 number the socket is created with).
 Outgoing packets automatically have an IP header prepended to
 them (based on the destination address and the protocol
 number the socket is created with).
-Likewise, incoming packets have their IP header stripped
-before being sent to the user.
+Incoming packets are received with IP header and options intact.
 .SH DIAGNOSTICS
 A socket operation may fail with one of the following errors returned:
 .TP 15
 .SH DIAGNOSTICS
 A socket operation may fail with one of the following errors returned:
 .TP 15
@@ -62,9 +92,16 @@ an internal data structure;
 when an attempt is made to create a 
 socket with a network address for which no network interface
 exists.
 when an attempt is made to create a 
 socket with a network address for which no network interface
 exists.
-.SH SEE ALSO
-send(2), recv(2), intro(4N), inet(4F)
-.SH BUGS
-One should be able to send and receive ip options.
 .PP
 .PP
-The protocol should be settable after socket creation.
+The following errors specific to IP
+may occur when setting or getting IP options:
+.TP 15
+[EINVAL]
+An unknown socket option name was given.
+.TP 15
+[EINVAL]
+The IP option field was improperly formed;
+an option field was shorter than the minimum value
+or longer than the option buffer provided.
+.SH SEE ALSO
+getsockopt(2), send(2), recv(2), intro(4N), icmp(4P), inet(4F)
index a598f46..58e4582 100644 (file)
@@ -2,7 +2,7 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)tcp.4       6.1 (Berkeley) %G%
+.\"    @(#)tcp.4       6.2 (Berkeley) %G%
 .\"
 .TH TCP 4P ""
 .UC 5
 .\"
 .TH TCP 4P ""
 .UC 5
@@ -52,6 +52,31 @@ fixed by the peer entity's location.   The address assigned the
 socket is the address associated with the network interface
 through which packets are being transmitted and received.  Normally
 this address corresponds to the peer entity's network.
 socket is the address associated with the network interface
 through which packets are being transmitted and received.  Normally
 this address corresponds to the peer entity's network.
+.PP
+TCP supports one socket option which is set with
+.IR setsockopt (2)
+and tested with
+.IR getsockopt (2).
+Under most circumstances, TCP sends data when it is presented;
+when outstanding data has not yet been acknowledged, it gathers
+small amounts of output to be sent in a single packet once
+an acknowledgement is received.
+For a small number of clients, such as window systems
+that send a stream of mouse events which receive no replies,
+this packetization may cause significant delays.
+Therefore, TCP provides a boolean option, TCP_NODELAY (from
+.IR <netinet/tcp.h> ,
+to defeat this algorithm.
+The option level for the
+.I setsockopt
+call is the protocol number for TCP,
+available from
+.IR getprotobyname (3N).
+.PP
+Options at the IP transport level may be used with TCP; see
+.IR ip (4P).
+Incoming connection requests that are source-routed are noted,
+and the reverse source route is used in responding.
 .SH DIAGNOSTICS
 A socket operation may fail with one of the following errors returned:
 .TP 20
 .SH DIAGNOSTICS
 A socket operation may fail with one of the following errors returned:
 .TP 20
@@ -86,9 +111,4 @@ when an attempt is made to create a
 socket with a network address for which no network interface
 exists.
 .SH SEE ALSO
 socket with a network address for which no network interface
 exists.
 .SH SEE ALSO
-intro(4N), inet(4F)
-.SH BUGS
-It should be possible to send and receive TCP options.
-The system always tries to negotiates the maximum TCP segment
-size to be 1024 bytes.  This can result in poor performance
-if an intervening network performs excessive fragmentation.
+getsockopt(2), socket(2), intro(4N), inet(4F), ip(4P)
index c0aef96..1091d36 100644 (file)
@@ -2,7 +2,7 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"    @(#)udp.4       6.1 (Berkeley) %G%
+.\"    @(#)udp.4       6.2 (Berkeley) %G%
 .\"
 .TH UDP 4P ""
 .UC 5
 .\"
 .TH UDP 4P ""
 .UC 5
@@ -43,6 +43,9 @@ may not be \*(lqconnected\*(rq to a TCP port).  In addition broadcast
 packets may be sent (assuming the underlying network supports
 this) by using a reserved \*(lqbroadcast address\*(rq; this address
 is network interface dependent.
 packets may be sent (assuming the underlying network supports
 this) by using a reserved \*(lqbroadcast address\*(rq; this address
 is network interface dependent.
+.PP
+Options at the IP transport level may be used with UDP; see
+.IR ip (4P).
 .SH DIAGNOSTICS
 A socket operation may fail with one of the following errors returned:
 .TP 15
 .SH DIAGNOSTICS
 A socket operation may fail with one of the following errors returned:
 .TP 15
@@ -70,7 +73,4 @@ when an attempt is made to create a
 socket with a network address for which no network interface
 exists.
 .SH SEE ALSO
 socket with a network address for which no network interface
 exists.
 .SH SEE ALSO
-send(2),
-recv(2),
-intro(4N),
-inet(4F)
+getsockopt(2), recv(2), send(2), socket(2), intro(4N), inet(4F), ip(4P)