[erlang-questions] SCTP PPID change
Ahmed Ali
ahmed.nawras@REDACTED
Wed Oct 14 13:12:36 CEST 2009
Hi Raimo,
Thanks a lot for your help. The issue was due to assoc_id in
#sctp_sndrcvinfo{} not being integer.
Best regards,
Ahmed
On Wed, Oct 14, 2009 at 2:33 PM, Raimo Niskanen
<raimo+erlang-questions@REDACTED> wrote:
> On Wed, Oct 14, 2009 at 03:09:33AM +0400, Ahmed Ali wrote:
>> Hi,
>>
>> I'm experminting with SCTP support in Erlang. I'm using Solaris 10
>> with Erlang R13B02. SCTP support is enabled during compiling Erlang.
>>
>> I'm having problem with changing ppid to 3 (M3UA). The first thing I
>> did is to add sctp_default_send_param in gen_sctp:connect/4. However,
>> I got the error below. I've tried to used gen_sctp:send/3 instead of
>> send/4 as below but I get exactly the same error. I also tried to
>> troubleshoot the issue and found out the error is generated from
>> module prim_inet.erl in erts code. My guess is that type_value/3
>> function checks that the values of the supplied #sctp_sndrcvinfo{} are
>> valid but appearntly, something is not correct in #sctp_sndrcvinfo{}
>> record I'm sending.
>>
>> Without setting PPID, everything works and I could see traffic is sent
>> and received correctly. Any help is appreciated.
>>
>> gen_sctp:send(S, #sctp_sndrcvinfo{stream=Stream,
>> assoc_id=Assoc,
>> ppid=3}, Data)
> I guess this is what you ment:
>
> gen_sctp:send(S,
> #sctp_sndrcvinfo{stream=Stream,
> assoc_id=Assoc#sctp_assoc_change.assoc_id,
> ppid=3}, Data)
>
> The shortcut of using #sctp_assoc_change{} as assoc_id
> in gen_sctp:send/4 is not appropriate for gen_sctp:send/3.
> Argument 2 has to be a #sctp_sndrcvinfo{} and
> #sctp_sndrcvinfo.assoc_id has to be an integer.
> Read inet_sctp.hrl.
>
>>
>> {error,
>> {type,
>> {record,set,
>> {sctp_sndrcvinfo,
>> [uint16,0],
>> [],
>> [{bitenumlist,
>> [{unordered,1},{addr_over,2},{abort,4},{eof,8}],
>> uint16},
>> []],
>> [uint32,0],
>> [uint32,0],
>> [uint32,0],
>> [],[],
> ***> [sctp_assoc_id,0]},
>> {sctp_sndrcvinfo,0,undefined,undefined,3,undefined,undefined,
>> undefined,undefined,
> ***> {sctp_assoc_change,comm_up,0,5,17,1}},
>> 10
>> }
>> }
>> }
>
> *** Type mismatch
>
>>
>> Best regards,
>>
>> Ahmed
>>
>> ________________________________________________________________
>> erlang-questions mailing list. See http://www.erlang.org/faq.html
>> erlang-questions (at) erlang.org
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
>
More information about the erlang-questions
mailing list