Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
Merge branch 'dev' into major
Browse files Browse the repository at this point in the history
* dev:
  Improve types and specifications of the inet modules
  • Loading branch information
uabboli committed Aug 26, 2011
2 parents d2408a6 + 9a52e23 commit efc604e
Show file tree
Hide file tree
Showing 9 changed files with 403 additions and 369 deletions.
144 changes: 69 additions & 75 deletions lib/kernel/doc/src/gen_sctp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
<item><seealso marker="#options">SCTP SOCKET OPTIONS</seealso></item>
<item><seealso marker="#examples">SCTP EXAMPLES</seealso></item>
<item><seealso marker="#seealso">SEE ALSO</seealso></item>
<item><seealso marker="#authors">AUTHORS</seealso></item>
</list>
<marker id="types"></marker>
</section>
Expand All @@ -80,36 +79,18 @@
</desc>
</datatype>
<datatype>
<name name="hostname"/>
</datatype>
<datatype>
<name name="ip_address"/>
<desc>
<p>Represents an address of an SCTP socket.
It is a tuple as explained in
<seealso marker="inet">inet(3)</seealso>.</p>
</desc>
</datatype>
<datatype>
<name name="port_number"/>
</datatype>
<datatype>
<name name="posix"/>
<desc>
<p>See <seealso marker="inet#error_codes">
inet(3); POSIX Error Codes</seealso>.</p>
</desc>
</datatype>
<datatype>
<name name="sctp_option"/>
<name name="option"/>
<desc>
<p>One of the
<seealso marker="#options">SCTP Socket Options.</seealso></p>
<marker id="type-sctp_socket"></marker>
</desc>
</datatype>
<datatype>
<name name="sctp_socket"/>
<name name="option_name"/>
<desc><marker id="type-sctp_socket"></marker></desc>
</datatype>
<datatype>
<name><marker id="type-sctp_socket">sctp_socket()</marker></name>
<desc>
<p>Socket identifier returned from <c>open/*</c>.</p>
<marker id="exports"></marker>
Expand Down Expand Up @@ -175,8 +156,8 @@
#sctp_assoc_change{
state = atom(),
error = atom(),
outbound_streams = int(),
inbound_streams = int(),
outbound_streams = integer(),
inbound_streams = integer(),
assoc_id = assoc_id()
} </pre>
<p>The number of outbound and inbound streams can be set by
Expand Down Expand Up @@ -300,6 +281,19 @@
The default <c><anno>IP</anno></c> and <c><anno>Port</anno></c> are <c>any</c>
and <c>0</c>, meaning bind to all local addresses on any
one free port.</p>

<p>Other options are:</p>
<taglist>
<tag><c>inet6</c></tag>
<item>
<p>Set up the socket for IPv6.</p>
</item>
<tag><c>inet</c></tag>
<item>
<p>Set up the socket for IPv4. This is the default.</p>
</item>
</taglist>

<p>A default set of socket <seealso marker="#options">options</seealso>
is used. In particular, the socket is opened in
<seealso marker="#option-binary">binary</seealso> and
Expand Down Expand Up @@ -350,7 +344,7 @@
#sctp_paddr_change{
addr = {ip_address(),port()},
state = atom(),
error = int(),
error = integer(),
assoc_id = assoc_id()
} </pre>
<p>Indicates change of the status of the peer's IP address given by
Expand Down Expand Up @@ -387,7 +381,7 @@
<pre>
#sctp_send_failed{
flags = true | false,
error = int(),
error = integer(),
info = #sctp_sndrcvinfo{},
assoc_id = assoc_id()
data = binary()
Expand All @@ -407,7 +401,7 @@
<item>
<pre>
#sctp_adaptation_event{
adaptation_ind = int(),
adaptation_ind = integer(),
assoc_id = assoc_id()
} </pre>
<p>Delivered when a peer sends an Adaptation Layer Indication
Expand Down Expand Up @@ -505,7 +499,7 @@
</list>
<marker id="option-buffer"></marker>
</item>
<tag><c>{buffer, int()}</c></tag>
<tag><c>{buffer, integer()}</c></tag>
<item>
<p>Determines the size of the user-level software buffer used by
the SCTP driver. Not to be confused with <c>sndbuf</c>
Expand All @@ -515,15 +509,15 @@
In fact, the <c>val(buffer)</c> is automatically set to
the above maximum when <c>sndbuf</c> or <c>recbuf</c> values are set.</p>
</item>
<tag><c>{tos, int()}</c></tag>
<tag><c>{tos, integer()}</c></tag>
<item>
<p>Sets the Type-Of-Service field on the IP datagrams being sent,
to the given value, which effectively determines a prioritization
policy for the outbound packets. The acceptable values
are system-dependent. TODO: we do not provide
symbolic names for these values yet.</p>
</item>
<tag><c>{priority, int()}</c></tag>
<tag><c>{priority, integer()}</c></tag>
<item>
<p>A protocol-independent equivalent of <c>tos</c> above. Setting
priority implies setting tos as well.</p>
Expand All @@ -542,7 +536,7 @@
required for high-throughput servers).</p>
<marker id="option-linger"></marker>
</item>
<tag><c>{linger, {true|false, int()}</c></tag>
<tag><c>{linger, {true|false, integer()}</c></tag>
<item>
<p>Determines the timeout in seconds for flushing unsent data in the
<c>gen_sctp:close/1</c> socket call. If the 1st component of the value
Expand All @@ -552,14 +546,14 @@
the flushing time-out in seconds.</p>
<marker id="option-sndbuf"></marker>
</item>
<tag><c>{sndbuf, int()}</c></tag>
<tag><c>{sndbuf, integer()}</c></tag>
<item>
<p>The size, in bytes, of the *kernel* send buffer for this socket.
Sending errors would occur for datagrams larger than
<c>val(sndbuf)</c>. Setting this option also adjusts
the size of the driver buffer (see <c>buffer</c> above).</p>
</item>
<tag><c>{recbuf, int()}</c></tag>
<tag><c>{recbuf, integer()}</c></tag>
<item>
<p>The size, in bytes, of the *kernel* recv buffer for this socket.
Sending errors would occur for datagrams larger than
Expand All @@ -571,9 +565,9 @@
<pre>
#sctp_rtoinfo{
assoc_id = assoc_id(),
initial = int(),
max = int(),
min = int()
initial = integer(),
max = integer(),
min = integer()
} </pre>
<p>Determines re-transmission time-out parameters, in milliseconds,
for the association(s) given by <c>assoc_id</c>.
Expand All @@ -586,11 +580,11 @@
<pre>
#sctp_assocparams{
assoc_id = assoc_id(),
asocmaxrxt = int(),
number_peer_destinations = int(),
peer_rwnd = int(),
local_rwnd = int(),
cookie_life = int()
asocmaxrxt = integer(),
number_peer_destinations = integer(),
peer_rwnd = integer(),
local_rwnd = integer(),
cookie_life = integer()
} </pre>
<p>Determines association parameters for the association(s) given by
<c>assoc_id</c>. <c>assoc_id = 0</c> (default) indicates
Expand All @@ -601,10 +595,10 @@
<item>
<pre>
#sctp_initmsg{
num_ostreams = int(),
max_instreams = int(),
max_attempts = int(),
max_init_timeo = int()
num_ostreams = integer(),
max_instreams = integer(),
max_attempts = integer(),
max_init_timeo = integer()
} </pre>
<p>Determines the default parameters which this socket attempts
to negotiate with its peer while establishing an association with it.
Expand All @@ -630,10 +624,11 @@
</list>
<p></p>
</item>
<tag><c>{sctp_autoclose, int()|infinity}</c></tag>
<tag><c>{sctp_autoclose, integer() >= 0}</c></tag>
<item>
<p>Determines the time (in seconds) after which an idle association is
automatically closed.</p>
automatically closed. <c>0</c> means that the association is
never automatically closed.</p>
</item>
<tag><c>{sctp_nodelay, true|false}</c></tag>
<item>
Expand All @@ -655,7 +650,7 @@
<p>Turns on|off automatic mapping of IPv4 addresses into IPv6 ones
(if the socket address family is AF_INET6).</p>
</item>
<tag><c>{sctp_maxseg, int()}</c></tag>
<tag><c>{sctp_maxseg, integer()}</c></tag>
<item>
<p>Determines the maximum chunk size if message fragmentation is used.
If <c>0</c>, the chunk size is limited by the Path MTU only.</p>
Expand Down Expand Up @@ -693,7 +688,7 @@
<marker id="record-sctp_setadaptation"></marker>
<pre>
#sctp_setadaptation{
adaptation_ind = int()
adaptation_ind = integer()
} </pre>
<p>When set, requests that the local endpoint uses the value given by
<c>adaptation_ind</c> as the Adaptation Indication parameter for
Expand All @@ -707,10 +702,10 @@
#sctp_paddrparams{
assoc_id = assoc_id(),
address = {IP, Port},
hbinterval = int(),
pathmaxrxt = int(),
pathmtu = int(),
sackdelay = int(),
hbinterval = integer(),
pathmaxrxt = integer(),
pathmtu = integer(),
sackdelay = integer(),
flags = list()
}
IP = ip_address()
Expand Down Expand Up @@ -771,14 +766,14 @@
<marker id="record-sctp_sndrcvinfo"></marker>
<pre>
#sctp_sndrcvinfo{
stream = int(),
ssn = int(),
stream = integer(),
ssn = integer(),
flags = list(),
ppid = int(),
context = int(),
timetolive = int(),
tsn = int(),
cumtsn = int(),
ppid = integer(),
context = integer(),
timetolive = integer(),
tsn = integer(),
cumtsn = integer(),
assoc_id = assoc_id()
} </pre>
<p><c>#sctp_sndrcvinfo{}</c> is used both in this socket option, and as
Expand Down Expand Up @@ -853,7 +848,7 @@
<pre>
#sctp_assoc_value{
assoc_id = assoc_id(),
assoc_value = int()
assoc_value = integer()
} </pre>
<p>Rarely used. Determines the ACK time
(given by <c>assoc_value</c> in milliseconds) for
Expand All @@ -866,12 +861,12 @@
#sctp_status{
assoc_id = assoc_id(),
state = atom(),
rwnd = int(),
unackdata = int(),
penddata = int(),
instrms = int(),
outstrms = int(),
fragmentation_point = int(),
rwnd = integer(),
unackdata = integer(),
penddata = integer(),
instrms = integer(),
outstrms = integer(),
fragmentation_point = integer(),
primary = #sctp_paddrinfo{}
} </pre>
<p>This option is read-only. It determines the status of
Expand Down Expand Up @@ -946,10 +941,10 @@
assoc_id = assoc_id(),
address = {IP, Port},
state = inactive | active,
cwnd = int(),
srtt = int(),
rto = int(),
mtu = int()
cwnd = integer(),
srtt = integer(),
rto = integer(),
mtu = integer()
}
IP = ip_address()
Port = port_number() </pre>
Expand Down Expand Up @@ -1119,7 +1114,6 @@ client_loop(S, Peer1, Port1, AssocId1, Peer2, Port2, AssocId2) -&gt;
<seealso marker="gen_udp">gen_udp(3)</seealso>,
<url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC2960</url> (Stream Control Transmission Protocol),
<url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions for SCTP.</url></p>
<marker id="authors"></marker>
</section>
</erlref>

23 changes: 9 additions & 14 deletions lib/kernel/doc/src/gen_tcp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,16 @@ do_recv(Sock, Bs) ->

<datatypes>
<datatype>
<name name="hostname"/>
<name name="option"/>
</datatype>
<datatype>
<name name="ip_address"/>
<desc>
<p>Represents an address of a TCP socket.
It is a tuple as explained in
<seealso marker="inet">inet(3)</seealso>.</p>
</desc>
<name name="option_name"/>
</datatype>
<datatype>
<name name="port_number"/>
<name name="connect_option"/>
</datatype>
<datatype>
<name name="posix"/>
<desc>
<p>See <seealso marker="inet#error_codes">
inet(3); POSIX Error Codes</seealso>.</p>
</desc>
<name name="listen_option"/>
</datatype>
<datatype>
<name><marker id="type-socket">socket()</marker></name>
Expand Down Expand Up @@ -122,7 +113,7 @@ do_recv(Sock, Bs) ->
<item>
<p>Specify which local port number to use.</p>
</item>
<tag><c>{fd, int()}</c></tag>
<tag><c>{fd, integer() >= 0}</c></tag>
<item>
<p>If a socket has somehow been connected without using
<c>gen_tcp</c>, use this option to pass the file
Expand Down Expand Up @@ -196,6 +187,10 @@ do_recv(Sock, Bs) ->
<p>If the host has several network interfaces, this option
specifies which one to listen on.</p>
</item>
<tag><c>{port, Port}</c></tag>
<item>
<p>Specify which local port number to use.</p>
</item>
<tag><c>{fd, Fd}</c></tag>
<item>
<p>If a socket has somehow been connected without using
Expand Down
Loading

0 comments on commit efc604e

Please sign in to comment.