From 14867ef618386d5008adf19b8d7a76e56f869145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 12 Apr 2012 15:36:59 +0200 Subject: kernel: Initial doc of forgotten inet options * UDP: ulticast_if, multicast_loop and multicast_ttl, add_membership and drop_membership * Inet: bit8, buffer, deliver, high_watermark, linger and low_watermark --- lib/kernel/doc/src/gen_sctp.xml | 26 +------------ lib/kernel/doc/src/gen_tcp.xml | 37 ++++++++++-------- lib/kernel/doc/src/gen_udp.xml | 38 ++++++++++++++++++ lib/kernel/doc/src/inet.xml | 86 ++++++++++++++++++++++++++++++++++++++++- 4 files changed, 145 insertions(+), 42 deletions(-) (limited to 'lib/kernel/doc') diff --git a/lib/kernel/doc/src/gen_sctp.xml b/lib/kernel/doc/src/gen_sctp.xml index 579b7f1f74..291aee62b1 100644 --- a/lib/kernel/doc/src/gen_sctp.xml +++ b/lib/kernel/doc/src/gen_sctp.xml @@ -530,19 +530,8 @@ SCTP data interleaved with other inter-process messages.

- - {buffer, integer()} - -

Determines the size of the user-level software buffer used by - the SCTP driver. Not to be confused with sndbuf - and recbuf options which correspond to - the kernel socket buffers. It is recommended - to have val(buffer) >= max(val(sndbuf),val(recbuf)). - In fact, the val(buffer) is automatically set to - the above maximum when sndbuf or recbuf values are set.

-
- {tos, integer()} + {tos, integer()}

Sets the Type-Of-Service field on the IP datagrams being sent, to the given value, which effectively determines a prioritization @@ -567,19 +556,8 @@ {IP,Port} of the socket can be re-used immediately: no waiting in the CLOSE_WAIT state is performed (may be required for high-throughput servers).

- -
- {linger, {true|false, integer()} - -

Determines the timeout in seconds for flushing unsent data in the - gen_sctp:close/1 socket call. If the 1st component of the value - tuple is false, the 2nd one is ignored, which means that - gen_sctp:close/1 returns immediately not waiting - for data to be flushed. Otherwise, the 2nd component is - the flushing time-out in seconds.

-
- {sndbuf, integer()} + {sndbuf, integer()}

The size, in bytes, of the *kernel* send buffer for this socket. Sending errors would occur for datagrams larger than diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index cf97607af1..32a0f9b0d7 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -96,37 +96,42 @@ do_recv(Sock, Bs) -> can be either a hostname, or an IP address.

The available options are:

- list - -

Received Packet is delivered as a list.

-
- binary - -

Received Packet is delivered as a binary.

-
- {ip, ip_address()} + {ip, ip_address()}

If the host has several network interfaces, this option specifies which one to use.

- {port, Port} - -

Specify which local port number to use.

-
+ {fd, integer() >= 0}

If a socket has somehow been connected without using gen_tcp, use this option to pass the file descriptor for it.

- inet6 + + {ifaddr, ip_address()} +

TODO: Document

+
+ + inet +

Set up the socket for IPv4.

+
+ + inet6 +

Set up the socket for IPv6.

- inet + + {port, Port} -

Set up the socket for IPv4.

+

Specify which local port number to use.

+ + {tcp_module, module()} +

TODO: Document

+
+ Opt

See diff --git a/lib/kernel/doc/src/gen_udp.xml b/lib/kernel/doc/src/gen_udp.xml index daa9b7d887..0b2cd3d765 100644 --- a/lib/kernel/doc/src/gen_udp.xml +++ b/lib/kernel/doc/src/gen_udp.xml @@ -86,6 +86,44 @@

Set up the socket for IPv4.

+ + {multicast_if, Address} + +

Set the local device for a multicast socket.

+
+ + {multicast_loop, true | false} + +

+ When true sent multicast packets will be looped back to the local + sockets. +

+
+ + {multicast_ttl, Integer} + +

+ The multicast_ttl option changes the time-to-live (TTL) for + outgoing multicast datagrams in order to control the scope of the + multicasts. +

+

+ Datagrams with a TTL of 1 are not forwarded beyond the local + network. +
Default: 1 +

+
+ + {add_membership, {MultiAddress, InterfaceAddress}} + +

Join a multicast group.

+
+ + {drop_membership, {MultiAddress, InterfaceAddress}} + +

Leave multicast group.

+
+ Opt

See diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml index bf6c4cfb1a..05946f1f18 100644 --- a/lib/kernel/doc/src/inet.xml +++ b/lib/kernel/doc/src/inet.xml @@ -445,10 +445,27 @@ fe80::204:acff:fe17:bf38 flow control; the other side will not be able send faster than the receiver can read.

+ + {bit8, clear | set | on | off} +

TODO: Document

+
+ {broadcast, Boolean}(UDP sockets)

Enable/disable permission to send broadcasts.

+ + {buffer, Size} + +

Determines the size of the user-level software buffer used by + the driver. Not to be confused with sndbuf + and recbuf options which correspond to + the kernel socket buffers. It is recommended + to have val(buffer) >= max(val(sndbuf),val(recbuf)). + In fact, the val(buffer) is automatically set to + the above maximum when sndbuf or recbuf values are set.

+
+ {delay_send, Boolean}

Normally, when an Erlang process sends to a socket, @@ -463,10 +480,19 @@ fe80::204:acff:fe17:bf38 real property of the socket. Needless to say it is an implementation specific option. Default is false.

+ + {deliver, port | term} +

When {active, true} delivers data on the forms + port : {S, {data, [H1,..Hsz | Data]}} or + term : {tcp, S, [H1..Hsz | Data]}. +

+
+ {dontroute, Boolean}

Enable/disable routing bypass for outgoing messages.

+ {exit_on_close, Boolean}

By default this option is set to true.

@@ -476,6 +502,7 @@ fe80::204:acff:fe17:bf38 gen_tcp:shutdown/2 to shutdown the write side.

+ {header, Size}

This option is only meaningful if the binary @@ -487,6 +514,15 @@ fe80::204:acff:fe17:bf38 example Size == 2, the data received will match [Byte1,Byte2|Binary].

+ + {high_watermark, Size} +

+ Sender is forced busy if sent and equeued data + readched the highwater mark. +
Default: 8192 kB. +

+
+ {keepalive, Boolean}(TCP/IP sockets)

Enables/disables periodic transmission on a connected @@ -495,6 +531,41 @@ fe80::204:acff:fe17:bf38 considered broken and an error message will be sent to the controlling process. Default disabled.

+ + {linger, {true|false, Seconds}} + +

Determines the timeout in seconds for flushing unsent data in the + close/1 socket call. If the 1st component of the value + tuple is false, the 2nd one is ignored, which means that + close/1 returns immediately not waiting + for data to be flushed. Otherwise, the 2nd component is + the flushing time-out in seconds.

+
+ + {low_watermark, Size} +

+ If the port has reached its high_watermark it will + force busy onto senders. When the port data queue reaches the + low_watermark callers are no longer forced busy. +
Default: 4096 kB. +

+
+ + {mode, Mode :: binary | list} + +

Received Packet is delivered as defined by Mode.

+
+ + list + +

Received Packet is delivered as a list.

+
+ + binary + +

Received Packet is delivered as a binary.

+
+ {nodelay, Boolean}(TCP/IP sockets)

If Boolean == true, the TCP_NODELAY option @@ -578,6 +649,16 @@ fe80::204:acff:fe17:bf38 indicated length are accepted and not considered invalid due to internal buffer limitations.

+ + {priority, Priority} +

Set the protocol-defined priority for all packets to be sent + on this socket.

+
+ + {raw, Protocol, OptionNum, ValueBin} +

See below.

+
+ {read_packets, Integer}(UDP sockets)

Sets the max number of UDP packets to read without @@ -589,7 +670,7 @@ fe80::204:acff:fe17:bf38 high the system can become unresponsive due to UDP packet flooding.

- {recbuf, Integer} + {recbuf, Size}

Gives the size of the receive buffer to use for the socket.

@@ -620,7 +701,7 @@ fe80::204:acff:fe17:bf38 Default is false due to backward compatibility.

- {sndbuf, Integer} + {sndbuf, Size}

Gives the size of the send buffer to use for the socket.

@@ -639,6 +720,7 @@ fe80::204:acff:fe17:bf38 not implemented. Use with caution.

+

In addition to the options mentioned above, raw option specifications can be used. The raw options are specified as a tuple of arity four, beginning with the tag -- cgit v1.2.3 From 5f8c0d0a439d1ff993c8485403b74aa2a9294248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 13 Apr 2012 14:28:13 +0200 Subject: kernel: Document bit8 option in inet:setopts/2 * This is a highly specialized option which is probably not used and will be removed in R16 --- lib/kernel/doc/src/inet.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/kernel/doc') diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml index 05946f1f18..522a27dcfa 100644 --- a/lib/kernel/doc/src/inet.xml +++ b/lib/kernel/doc/src/inet.xml @@ -447,7 +447,13 @@ fe80::204:acff:fe17:bf38 {bit8, clear | set | on | off} -

TODO: Document

+ +

+ Scans every byte in received data-packets and checks if the 8 bit + is set in any of them. Information is retrieved with + inet:getopts/2. + Deprecated! Will be removed in Erlang/OTP R16. +

{broadcast, Boolean}(UDP sockets) -- cgit v1.2.3 From d64479bcc536c64b15e0c9fa28ecb73bc7e385a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 13 Apr 2012 15:17:47 +0200 Subject: kernel: Document tcp-, udp- and sctp_module option --- lib/kernel/doc/src/gen_sctp.xml | 9 +++++++++ lib/kernel/doc/src/gen_tcp.xml | 18 +++++++++++++++++- lib/kernel/doc/src/gen_udp.xml | 7 +++++++ 3 files changed, 33 insertions(+), 1 deletion(-) (limited to 'lib/kernel/doc') diff --git a/lib/kernel/doc/src/gen_sctp.xml b/lib/kernel/doc/src/gen_sctp.xml index 291aee62b1..cf1cfb6ec9 100644 --- a/lib/kernel/doc/src/gen_sctp.xml +++ b/lib/kernel/doc/src/gen_sctp.xml @@ -571,6 +571,15 @@ val(sndbuf). Setting this option also adjusts the size of the driver buffer (see buffer above).

+ + {sctp_module, module()} +

+ Override which callback module used. Defaults to + inet_sctp for IPv4 and inet6_sctp for IPv6. +

+
+ + {sctp_rtoinfo, #sctp_rtoinfo{}}
  #sctp_rtoinfo{
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml
index 32a0f9b0d7..e4f1cf7612 100644
--- a/lib/kernel/doc/src/gen_tcp.xml
+++ b/lib/kernel/doc/src/gen_tcp.xml
@@ -129,7 +129,10 @@ do_recv(Sock, Bs) ->
           
 
 		  {tcp_module, module()}
-           

TODO: Document

+

+ Override which callback module used. Defaults to + inet_tcp for IPv4 and inet6_tcp for IPv6. +

Opt @@ -202,6 +205,11 @@ do_recv(Sock, Bs) -> gen_tcp, use this option to pass the file descriptor for it.

+ + {ifaddr, ip_address()} +

TODO: Document

+
+ inet6

Set up the socket for IPv6.

@@ -210,6 +218,14 @@ do_recv(Sock, Bs) ->

Set up the socket for IPv4.

+ + {tcp_module, module()} +

+ Override which callback module used. Defaults to + inet_tcp for IPv4 and inet6_tcp for IPv6. +

+
+ Opt

See diff --git a/lib/kernel/doc/src/gen_udp.xml b/lib/kernel/doc/src/gen_udp.xml index 0b2cd3d765..7cf8a6da4c 100644 --- a/lib/kernel/doc/src/gen_udp.xml +++ b/lib/kernel/doc/src/gen_udp.xml @@ -87,6 +87,13 @@

Set up the socket for IPv4.

+ {udp_module, module()} +

+ Override which callback module used. Defaults to + inet_udp for IPv4 and inet6_udp for IPv6. +

+
+ {multicast_if, Address}

Set the local device for a multicast socket.

-- cgit v1.2.3 From 57c50be011a5005639d2be38f1c9f538d9f00f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 13 Apr 2012 17:38:14 +0200 Subject: kernel: Document ifaddr option * same as ip option --- lib/kernel/doc/src/gen_tcp.xml | 14 +++++++++----- lib/kernel/doc/src/gen_udp.xml | 8 ++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'lib/kernel/doc') diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index e4f1cf7612..869e305690 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -102,6 +102,12 @@ do_recv(Sock, Bs) -> specifies which one to use.

+ {ifaddr, ip_address()} + +

Same as {ip, ip_address()}. If the host has several network interfaces, this option + specifies which one to use.

+
+ {fd, integer() >= 0}

If a socket has somehow been connected without using @@ -109,10 +115,6 @@ do_recv(Sock, Bs) -> descriptor for it.

- {ifaddr, ip_address()} -

TODO: Document

-
- inet

Set up the socket for IPv4.

@@ -207,7 +209,9 @@ do_recv(Sock, Bs) ->
{ifaddr, ip_address()} -

TODO: Document

+ +

Same as {ip, ip_address()}. If the host has several network interfaces, this option + specifies which one to use.

inet6 diff --git a/lib/kernel/doc/src/gen_udp.xml b/lib/kernel/doc/src/gen_udp.xml index 7cf8a6da4c..77e6182884 100644 --- a/lib/kernel/doc/src/gen_udp.xml +++ b/lib/kernel/doc/src/gen_udp.xml @@ -72,6 +72,14 @@

If the host has several network interfaces, this option specifies which one to use.

+ + {ifaddr, ip_address()} + +

Same as {ip, ip_address()}. If the host has several network interfaces, this option + specifies which one to use.

+
+ + {fd, integer() >= 0}

If a socket has somehow been opened without using -- cgit v1.2.3