diameter_sctp(3erl)
okay bestie, welcome to diameter_sctp(3erl) β an Erlang Module Definition page, and it's giving Diameter transport over SCTP π
β¨. This is the group-chat breakdown, but every technical deet is staying exactly where it belongs.
β¨ NAME β¨
diameter_sctp β Diameter transport over SCTP. no cap, that's the name.
π DESCRIPTION π
This module implements Diameter transport over SCTP using gen_sctp(3erl). It can be specified as the value of a transport_module option to diameter:add_transport/2 and implements the behaviour documented in diameter_transport(3erl). So yes: it's the SCTP transport plug-in energy, and it's fully aware of the assignment π.
π EXPORTS π
start({Type, Ref}, Svc, [Opt]) -> {ok, Pid, [LAddr]} | {error, Reason}
Types:
Type = connect | accept
Ref = diameter:transport_ref()
Svc = #diameter_service{}
Opt = OwnOpt | SctpOpt
Pid = pid()
LAddr = inet:ip_address()
Reason = term()
OwnOpt = {raddr, inet:ip_address()} | {rport, integer()} |
{accept, Match} | {unordered, boolean() | pos_integer()} |
{packet, boolean() | raw} | {message_cb, diameter:eval()} |
{sender, boolean()}
SctpOpt = term()
Match = inet:ip_address() | string() | [Match]
This is the start function required by diameter_transport(3erl). Iconic, required, doing its lil job π«Ά.
raddrβ remote address for a connecting transport. It is not valid for a listening transport. Required.rportβ remote port for a connecting transport. It is not valid for a listening transport. Defaults to3868if unspecified. Multipleraddroptions can be specified; the connecting transport in question attempts each in sequence until an association is established. It's giving "try the whole roster" energy π₯.acceptβ specifies remote addresses for a listening transport and is not valid for a connecting transport. If specified, a remote address that does not match one of the specified addresses causes the association to be aborted. Multipleacceptoptions can be specified. A string-valuedMatchthat does not parse as an address is interpreted as a regular expression.unorderedβ specifies whether or not to use unordered delivery, integerNbeing equivalent toN =< OS, whereOSis the number of outbound streams negotiated on the association in question. Regardless of configuration, sending is ordered on stream0until reception of a second incoming message, to ensure that a peer receives capabilities exchange messages before any other. Defaults tofalse.packetβ determines how/if an incoming message is packaged into adiameter_packetrecord. Iffalse, then messages are received asbinary(). Iftrue, then as a record with thebinary()message in thebinfield and a{stream, Id}tuple in thetransport_datafield, whereIdis the identifier of the inbound stream the message was received on. Ifraw, then as a record with the received ancillarysctp_sndrcvinforecord in thetransport_datafield. Defaults totrue.message_cbandsenderβ have semantics identical to those documented indiameter_tcp(3erl), but with the message argument to arecvcallback being as directed by thepacketoption.{outstream, Id}intransport_dataβ an{outstream, Id}tuple in thetransport_datafield of an outgoingdiameter_packetrecord sets the outbound stream on which the message is sent, modulo the negotiated number of outbound streams. Any other value causes successive such sends to cycle through all outbound streams.- Remaining options β any accepted by
gen_sctp:open/1, with the exception of optionsmode,binary,list,activeandsctp_events. Note that optionsipandportspecify the local address and port respectively. ipβ multipleipoptions can be specified for a multihomed peer. If none are specified, then the values ofHost-IP-Addressin thediameter_servicerecord are used.portβ defaults to3868for a listening transport and0for a connecting transport.
β οΈ Warning β οΈ
A small receive buffer may result in a peer having to resend incoming messages: set theinet(3erl)optionrecbufto increase the buffer size.
A small send buffer may result in outgoing messages being discarded: set theinet(3erl)optionsndbufto increase the buffer size.
π¦ SEE ALSO π¦
π cute sign-off: Ericsson AB, diameter 2.2.7, and the diameter_sctp(3erl) manual page β that's the footer tea, periodt π
π¦ where this page comes from
- debian bookworm: erlang-manpages 1:25.2.3+dfsg-1+deb12u1 Β· Apache-2.0
- debian bookworm: erlang-manpages 1:25.2.3+dfsg-1+deb12u4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms