1diameter_sctp(3) Erlang Module Definition diameter_sctp(3)
2
3
4
6 diameter_sctp - Diameter transport over SCTP.
7
9 This module implements diameter transport over SCTP using gen_sctp(3).
10 It can be specified as the value of a transport_module option to diame‐
11 ter:add_transport/2 and implements the behaviour documented in diame‐
12 ter_transport(3).
13
15 start({Type, Ref}, Svc, [Opt]) -> {ok, Pid, [LAddr]} | {error, Reason}
16
17 Types:
18
19 Type = connect | accept
20 Ref = diameter:transport_ref()
21 Svc = #diameter_service{}
22 Opt = OwnOpt | SctpOpt
23 Pid = pid()
24 LAddr = inet:ip_address()
25 Reason = term()
26 OwnOpt = {raddr, inet:ip_address()} | {rport, integer()} |
27 {accept, Match} | {unordered, boolean() | pos_integer()} |
28 {packet, boolean() | raw} | {message_cb, diameter:eval()} |
29 {sender, boolean()}
30 SctpOpt = term()
31 Match = inet:ip_address() | string() | [Match]
32
33 The start function required by diameter_transport(3).
34
35 Options raddr and rport specify the remote address and port for
36 a connecting transport and not valid for a listening transport:
37 the former is required while latter defaults to 3868 if unspeci‐
38 fied. Multiple raddr options can be specified, in which case the
39 connecting transport in question attempts each in sequence until
40 an association is established.
41
42 Option accept specifies remote addresses for a listening trans‐
43 port and is not valid for a connecting transport. If specified,
44 a remote address that does not match one of the specified ad‐
45 dresses causes the association to be aborted. Multiple accept
46 options can be specified. A string-valued Match that does not
47 parse as an address is interpreted as a regular expression.
48
49 Option unordered specifies whether or not to use unordered de‐
50 livery, integer N being equivalent to N =< OS, where OS is the
51 number of outbound streams negotiated on the association in
52 question. Regardless of configuration, sending is ordered on
53 stream 0 until reception of a second incoming message, to ensure
54 that a peer receives capabilities exchange messages before any
55 other. Defaults to false.
56
57 Option packet determines how/if an incoming message is packaged
58 into a diameter_packet record. If false then messages are re‐
59 ceived as binary(). If true then as a record with the binary()
60 message in the bin field and a {stream, Id} tuple in the trans‐
61 port_data field, where Id is the identifier of the inbound
62 stream the message was received on. If raw then as a record with
63 the received ancillary sctp_sndrcvinfo record in the trans‐
64 port_data field. Defaults to true.
65
66 Options message_cb and sender have semantics identical to those
67 documented in diameter_tcp(3), but with the message argument to
68 a recv callback being as directed by the packet option.
69
70 An {outstream, Id} tuple in the transport_data field of a outgo‐
71 ing diameter_packet record sets the outbound stream on which the
72 message is sent, modulo the negotiated number of outbound
73 streams. Any other value causes successive such sends to cycle
74 though all outbound streams.
75
76 Remaining options are any accepted by gen_sctp:open/1, with the
77 exception of options mode, binary, list, active and sctp_events.
78 Note that options ip and port specify the local address and port
79 respectively.
80
81 Multiple ip options can be specified for a multihomed peer. If
82 none are specified then the values of Host-IP-Address in the di‐
83 ameter_service record are used. Option port defaults to 3868 for
84 a listening transport and 0 for a connecting transport.
85
86 Warning:
87 An small receive buffer may result in a peer having to resend
88 incoming messages: set the inet(3) option recbuf to increase the
89 buffer size.
90
91 An small send buffer may result in outgoing messages being dis‐
92 carded: set the inet(3) option sndbuf to increase the buffer
93 size.
94
95
97 diameter(3), diameter_transport(3), gen_sctp(3), inet(3)
98
99
100
101Ericsson AB diameter 2.3 diameter_sctp(3)