2011 Ericsson AB. All Rights Reserved. The contents of this file are subject to the Erlang Public License, Version 1.1, (the "License"); you may not use this file except in compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. diameter_tcp(3) Anders Svensson diameter_tcp.xml
diameter_tcp Diameter transport over TCP.

This module implements diameter transport over TCP using gen_tcp. 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(3). TLS security is supported, a connection being upgraded if TLS is negotiated during capabilities exchange.

start({Type, Ref}, Svc, [Opt]) -> {ok, Pid, [LAddr]} | {error, Reason} Start a transport process. Type = connect | accept Ref = reference() Svc = #diameter_service{} Opt = OwnOpt | TlsOpt | TcpOpt Pid = pid() LAddr = ip_address() Reason = term() OwnOpt = {raddr, ip_address()} | {rport, integer()} TlsOpt = {ssl_options, list()} TcpOpt = term()

The start function required by diameter_transport(3).

The only diameter_tcp-specific argument is the options list. Options raddr and rport specify the remote address and port for a connecting transport and are not valid for a listening transport. Option ssl_options specifies options to be passed to ssl:connect/2 of ssl:ssl_accept/2 in case capabilities exchange results in TLS being chosen for inband security. Remaining options are any accepted by gen_tcp:connect/3 for a connecting transport, or gen_tcp:listen/2 for a listening transport, with the exception of binary, packet and active. Also, option port can be specified for a listening transport to specify the local listening port, the default being the standardized 3868 if unspecified. Note that option ip specifies the local address.

The ssl_options option must be specified if and only if the transport in question has specified an Inband-Security-Id AVP with value TLS on the relevant call to start_service/2 or add_transport/2, so that the transport process will receive notification of whether or not to commence with a TLS handshake following capabilities exchange. Failing to specify ssl_options on a TLS-capable transport for which TLS is negotiated will cause TLS handshake to fail. Failing to specify TLS capability when ssl_options has been specified will cause the transport process to wait for a notification that will not be forthcoming, which will eventually cause the RFC 3539 watchdog to take down the connection.

If the service specifies more than one Host-IP-Address and option ip is unspecified then then the first of the service's addresses is used as the local address.

The returned local address list has length one.

SEE ALSO

diameter(3), diameter_transport(3)