gen_sctp(3)'> gen_sctp:open/1'> inet:ip_address()'> inet(3)'> %also; %here; ]>
2011 2014 Ericsson AB. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. diameter_sctp(3) Anders Svensson diameter_sctp.xml
diameter_sctp Diameter transport over SCTP.

This module implements diameter transport over SCTP using &gen_sctp;. It can be specified as the value of a transport_module option to &mod_add_transport; and implements the behaviour documented in &man_transport;.

start({Type, Ref}, Svc, [Opt]) -> {ok, Pid, [LAddr]} | {error, Reason} Start a transport process. Type = connect | accept Ref = &mod_transport_ref; Svc = #diameter_service{} Opt = OwnOpt | SctpOpt Pid = pid() LAddr = &ip_address; Reason = term() OwnOpt = {raddr, &ip_address;} | {rport, integer()} | {accept, Match} SctpOpt = term() Match = &ip_address; | string() | [Match]

The start function required by &man_transport;.

Options raddr and rport specify the remote address and port for a connecting transport and not valid for a listening transport: the former is required while latter defaults to 3868 if unspecified. Multiple raddr options can be specified, in which case the connecting transport in question attempts each in sequence until an association is established.

Option 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. Multiple accept options can be specified. A string-valued Match that does not parse as an address is interpreted as a regular expression.

Remaining options are any accepted by &gen_sctp_open1;, 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. (In particular, one of these must be specified.) Option port defaults to 3868 for a listening transport and 0 for a connecting transport.

An insufficiently large receive buffer may result in a peer having to resend incoming messages: set the &inet; option recbuf to increase the buffer size.

An insufficiently large send buffer may result in outgoing messages being discarded: set the &inet; option sndbuf to increase the buffer size.

The transport_data field of record diameter_packet is used to communicate the stream on which an inbound message has been received, or on which an outbound message should be sent. The value will be of the form {stream, Id} for an inbound message passed to a &app_handle_request; or &app_handle_answer; callback. For an outbound message, {outstream, Id} in the return value of &app_handle_request; or &app_prepare_retransmit; sets the outbound stream, the stream id being interpreted modulo the number of outbound streams. Any other value, or not setting a value, causes successive such sends to cycle though all outbound streams.

SEE ALSO

&man_main;, &man_transport;, &gen_sctp;, &inet;