<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css"> <title>Erlang -- diameter_sctp(3)</title> </head> <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container"> <script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript"> <!-- function getWinHeight() { var myHeight = 0; if( typeof( window.innerHeight ) == 'number' ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } return myHeight; } function setscrollpos() { var objf=document.getElementById('loadscrollpos'); document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2; } function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', setscrollpos); //--></script><div id="leftnav"><div class="innertube"> <img alt="Erlang logo" src="../../../../doc/erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="index.html">Reference Manual</a><br><a href="release_notes.html">Release Notes</a><br><a href="../pdf/diameter-1.3.pdf">PDF</a><br><a href="../../../../doc/index.html">Top</a></small><p><strong>Diameter</strong><br><strong>Reference Manual</strong><br><small>Version 1.3</small></p> <br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Table of Contents</strong></small></p> <ul class="flipMenu"> <li id="no" title="diameter " expanded="false">diameter<ul> <li><a href="diameter.html"> Top of manual page </a></li> <li title="add_transport-2"><a href="diameter.html#add_transport-2">add_transport/2</a></li> <li title="call-4"><a href="diameter.html#call-4">call/4</a></li> <li title="origin_state_id-0"><a href="diameter.html#origin_state_id-0">origin_state_id/0</a></li> <li title="remove_transport-2"><a href="diameter.html#remove_transport-2">remove_transport/2</a></li> <li title="service_info-2"><a href="diameter.html#service_info-2">service_info/2</a></li> <li title="services-0"><a href="diameter.html#services-0">services/0</a></li> <li title="session_id-1"><a href="diameter.html#session_id-1">session_id/1</a></li> <li title="start-0"><a href="diameter.html#start-0">start/0</a></li> <li title="start_service-2"><a href="diameter.html#start_service-2">start_service/2</a></li> <li title="stop-0"><a href="diameter.html#stop-0">stop/0</a></li> <li title="stop_service-1"><a href="diameter.html#stop_service-1">stop_service/1</a></li> <li title="subscribe-1"><a href="diameter.html#subscribe-1">subscribe/1</a></li> <li title="unsubscribe-1"><a href="diameter.html#unsubscribe-1">unsubscribe/1</a></li> </ul> </li> <li title="diameterc"><a href="diameterc.html">diameterc</a></li> <li id="no" title="diameter_app " expanded="false">diameter_app<ul> <li><a href="diameter_app.html"> Top of manual page </a></li> <li title="Mod:peer_up-3"><a href="diameter_app.html#Mod:peer_up-3">Mod:peer_up/3</a></li> <li title="Mod:peer_down-3"><a href="diameter_app.html#Mod:peer_down-3">Mod:peer_down/3</a></li> <li title="Mod:pick_peer-4"><a href="diameter_app.html#Mod:pick_peer-4">Mod:pick_peer/4</a></li> <li title="Mod:prepare_request-3"><a href="diameter_app.html#Mod:prepare_request-3">Mod:prepare_request/3</a></li> <li title="Mod:prepare_retransmit-3"><a href="diameter_app.html#Mod:prepare_retransmit-3">Mod:prepare_retransmit/3</a></li> <li title="Mod:handle_answer-4"><a href="diameter_app.html#Mod:handle_answer-4">Mod:handle_answer/4</a></li> <li title="Mod:handle_error-4"><a href="diameter_app.html#Mod:handle_error-4">Mod:handle_error/4</a></li> <li title="Mod:handle_request-3"><a href="diameter_app.html#Mod:handle_request-3">Mod:handle_request/3</a></li> </ul> </li> <li id="no" title="diameter_codec " expanded="false">diameter_codec<ul> <li><a href="diameter_codec.html"> Top of manual page </a></li> <li title="decode-2"><a href="diameter_codec.html#decode-2">decode/2</a></li> <li title="encode-2"><a href="diameter_codec.html#encode-2">encode/2</a></li> </ul> </li> <li title="diameter_dict"><a href="diameter_dict.html">diameter_dict</a></li> <li id="no" title="diameter_make " expanded="false">diameter_make<ul> <li><a href="diameter_make.html"> Top of manual page </a></li> <li title="codec-2"><a href="diameter_make.html#codec-2">codec/2</a></li> </ul> </li> <li id="no" title="diameter_transport " expanded="false">diameter_transport<ul> <li><a href="diameter_transport.html"> Top of manual page </a></li> <li title="Mod:start-3"><a href="diameter_transport.html#Mod:start-3">Mod:start/3</a></li> </ul> </li> <li id="no" title="diameter_tcp " expanded="false">diameter_tcp<ul> <li><a href="diameter_tcp.html"> Top of manual page </a></li> <li title="start-3"><a href="diameter_tcp.html#start-3">start/3</a></li> </ul> </li> <li id="loadscrollpos" title="diameter_sctp " expanded="true">diameter_sctp<ul> <li><a href="diameter_sctp.html"> Top of manual page </a></li> <li title="start-3"><a href="diameter_sctp.html#start-3">start/3</a></li> </ul> </li> </ul> </div></div> <div id="content"> <div class="innertube"> <!-- refpage --><center><h1>diameter_sctp</h1></center> <h3>MODULE</h3> <div class="REFBODY">diameter_sctp</div> <h3>MODULE SUMMARY</h3> <div class="REFBODY">Diameter transport over SCTP.</div> <h3>DESCRIPTION</h3> <div class="REFBODY"><p> <p> This module implements diameter transport over SCTP using <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','gen_sctp.html');">gen_sctp(3)</a></span>. It can be specified as the value of a transport_module option to <span class="bold_code"><a href="diameter.html#add_transport-2">diameter:add_transport/2</a></span> and implements the behaviour documented in <span class="bold_code"><a href="diameter_transport.html">diameter_transport(3)</a></span>.</p> <a name="start"></a> </p></div> <h3>EXPORTS</h3> <p><a name="start-3"><span class="bold_code">start({Type, Ref}, Svc, [Opt]) -> {ok, Pid, [LAddr]} | {error, Reason}</span></a><br></p> <div class="REFBODY"> <p>Types:</p> <div class="REFTYPES"> <span class="bold_code">Type = connect | accept</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Ref = <span class="bold_code"><a href="diameter.html#transport_ref">diameter:transport_ref()</a></span></span><br> </div> <div class="REFTYPES"> <span class="bold_code">Svc = #diameter_service{}</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Opt = {raddr, <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','inet.html#type-ip_address');">inet:ip_address()</a></span>} | {rport, integer()} | term()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">Pid = pid()</span><br> </div> <div class="REFTYPES"> <span class="bold_code">LAddr = <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','inet.html#type-ip_address');">inet:ip_address()</a></span></span><br> </div> <div class="REFTYPES"> <span class="bold_code">Reason = term()</span><br> </div> </div> <div class="REFBODY"><p> <p> The start function required by <span class="bold_code"><a href="diameter_transport.html">diameter_transport(3)</a></span>.</p> <p> The only diameter_sctp-specific argument is the options list. Options <span class="code">raddr</span> and <span class="code">rport</span> 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. More than one <span class="code">raddr</span> option can be specified, in which case the connecting transport in question attempts each in sequence until an association is established. Remaining options are any accepted by <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','gen_sctp.html#open-1');">gen_sctp:open/1</a></span>, with the exception of options <span class="code">mode</span>, <span class="code">binary</span>, <span class="code">list</span>, <span class="code">active</span> and <span class="code">sctp_events</span>. Note that options <span class="code">ip</span> and <span class="code">port</span> specify the local address and port respectively.</p> <p> Multiple <span class="code">ip</span> options can be specified for a multihomed peer. If none are specified then the values of <span class="code">Host-IP-Address</span> in the <span class="code">#diameter_service{}</span> record are used. (In particular, one of these must be specified.) Option <span class="code">port</span> defaults to 3868 for a listening transport and 0 for a connecting transport.</p> <div class="warning"> <div class="label">Warning</div> <div class="content"><p> <p> An insufficiently large receive buffer may result in a peer having to resend incoming messages: set the <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','inet.html');">inet(3)</a></span> option <span class="code">recbuf</span> to increase the buffer size.</p> <p> An insufficiently large send buffer may result in outgoing messages being discarded: set the <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','inet.html');">inet(3)</a></span> option <span class="code">sndbuf</span> to increase the buffer size.</p> </p></div> </div> <p> diameter_sctp uses the <span class="code">transport_data</span> field of the <span class="code">#diameter_packet{}</span> record 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 <span class="code">{stream, Id}</span> on an inbound message passed to a <span class="bold_code"><a href="diameter_app.html#Mod:handle_request-3">handle_request/3</a></span> or <span class="bold_code"><a href="diameter_app.html#Mod:handle_answer-4">handle_answer/4</a></span> callback. For an outbound message, either <span class="code">undefined</span> (explicitly or by receiving the outbound message as a <span class="code">binary()</span>) or a tuple should be set in the return value of <span class="bold_code"><a href="diameter_app.html#Mod:handle_request-3">handle_request/3</a></span> (typically by retaining the value passed into this function) or <span class="bold_code"><a href="diameter_app.html#Mod:prepare_request-3">prepare_request/3</a></span>. The value <span class="code">undefined</span> uses a "next outbound stream" id and increments this modulo the total number outbound streams. That is, successive values of <span class="code">undefined</span> cycle through all outbound streams.</p> </p></div> <h3><a name="id79199">SEE ALSO</a></h3> <div class="REFBODY"> <p> <span class="bold_code"><a href="diameter.html">diameter(3)</a></span>, <span class="bold_code"><a href="diameter_transport.html">diameter_transport(3)</a></span>, <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','gen_sctp.html');">gen_sctp(3)</a></span>, <span class="bold_code"><a href="javascript:erlhref('../../../../doc/../','kernel','inet.html');">inet(3)</a></span></p> </div> </div> <div class="footer"> <hr> <p>Copyright © 2011-2012 Ericsson AB. All Rights Reserved.</p> </div> </div> </div></body> </html>