diameter_sctp(3)
π NAME π
diameter_sctp β bestie, this is the Diameter transport over SCTP. That's it. That's the whole name, slay.
β¨ DESCRIPTION β¨
Okay so listen. This module implements diameter transport over SCTP using gen_sctp. You can hand it over as the value of a transport_module option to diameter:add_transport/2, and it does the whole behaviour thing documented over in diameter_transport. No cap, it just works like that. π
πΈ SEE ALSO πΈ
diameterdiameter_transportgen_sctpinet
π¦ DATA TYPES π¦
Lowkey the most important part, so pay attention bestie:
connect_option() ::
{raddr, inet:ip_address()} |
{rport, inet:port_number()} |
option() |
term().
listen_option() :: {accept, match()} | option() | term().
match() :: inet:ip_address() | string() | [match()].
option() ::
{sender, boolean()} |
sender |
{packet, boolean() | raw} |
{message_cb, false | diameter:eval()}.
π FUNCTIONS π
π« start/3 π«
start({accept, Ref}, #diameter_service{}, [listen_option()]) ->
{ok, pid(), [inet:ip_address()]}
when Ref :: diameter:transport_ref();
({connect, Ref}, #diameter_service{}, [connect_option()]) ->
{ok, pid(), [inet:ip_address()]}
when Ref :: diameter:transport_ref().
This is the start function that diameter_transport requires, so like, it's not optional, it's the vibe check.
The options raddr and rport specify the remote address and port for a connecting transport β and ngl they are not valid for a listening transport. raddr is required, while rport defaults to 3868 if you don't say anything. You can also drop multiple raddr options, and in that case the connecting transport in question attempts each one in sequence until an association is established. iconic behavior honestly.
Option accept specifies remote addresses for a listening transport and is not valid for a connecting transport. If you specify it, a remote address that does not match one of the specified addresses causes the association to be aborted. π Multiple accept options can be specified too, go off. A string-valued Match that does not parse as an address is interpreted as a regular expression.
Option unordered specifies whether or not to use unordered delivery, where integer N is equivalent to N =< OS, and OS is the number of outbound streams negotiated on the association in question. Regardless of configuration, sending is ordered on stream 0 until reception of a second incoming message, to ensure that a peer receives capabilities exchange messages before any other. Defaults to false.
Option packet determines how/if an incoming message is packaged into a diameter_packet record. Here's the breakdown bestie:
- If
falsethen messages are received asbinary(). - If
truethen 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. - If
rawthen as a record with the received ancillarysctp_sndrcvinforecord in thetransport_datafield.
Defaults to true. π
Options message_cb and sender have semantics identical to those documented in diameter_tcp(3), but with the message argument to a recv callback being as directed by the packet option. yes, identical, i said what i said.
An {outstream, Id} tuple in the transport_data field of a outgoing diameter_packet record 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 are any accepted by gen_sctp:open/1, with the exception of options mode, binary, list, active and sctp_events. Note that options ip and port specify the local address and port respectively. π
Multiple ip options can be specified for a multihomed peer. If none are specified then the values of Host-IP-Address in the diameter_service record are used. Option port defaults to 3868 for a listening transport and 0 for a connecting transport.
β οΈ WARNING β οΈ A small receive buffer may result in a peer having to resend incoming messages: set theinetoptionrecbufto increase the buffer size. A small send buffer may result in outgoing messages being discarded: set theinetoptionsndbufto increase the buffer size. not me begging you to size your buffers correctly bestie. π
okay that's the whole page, you ate that π«Ά this little love letter to SCTP came from Ericsson AB, it's diameter 2.7.2, and it's page diameter_sctp(3) of the manual. mwah π
π¦ where this page comes from
- nixos 26.05: erlang 29.1.2
- nixpkgs unstable: erlang 29.1.2
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms