<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div>The *actual implementation* in diameter_codec.erl [1] gets it right, though.</div><div><br></div><div>BR,</div><div>Ulf W</div><div><br></div><div>[1] <a href="https://github.com/erlang/otp/blob/maint/lib/diameter/src/base/diameter_codec.erl#L104">https://github.com/erlang/otp/blob/maint/lib/diameter/src/base/diameter_codec.erl#L104</a></div><div><a href="https://github.com/erlang/otp/blob/maint/lib/diameter/src/base/diameter_codec.erl#L296">https://github.com/erlang/otp/blob/maint/lib/diameter/src/base/diameter_codec.erl#L296</a></div><br><div><div>On 06 Apr 2014, at 16:51, austin aigbe <<a href="mailto:eshikafe@gmail.com">eshikafe@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hello,<div><br></div><div>According to RFC6733, the diameter header Command Code field is three octets (i.e 24 bits) but the Erlang diameter header implementation has it defined as a 1 octet field (i.e 8 bits). Why?</div>
<div><br></div><div><br></div><div><br></div><div><b>RFC 6733</b>:</div><div><br></div><div><div>3. Diameter Header</div><div><br></div><div> A summary of the Diameter header format is shown below. The fields</div><div>
are transmitted in network byte order.</div><div><br></div><div> 0 1 2 3</div><div> 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1</div>
<div> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</div><div> | Version | Message Length |</div><div> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</div>
<div> | Command Flags | Command Code |</div><div> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</div><div> | Application-ID |</div>
<div> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</div><div> | Hop-by-Hop Identifier |</div><div> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</div>
<div> | End-to-End Identifier |</div><div> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</div><div> | AVPs ...</div><div> +-+-+-+-+-+-+-+-+-+-+-+-+-</div>
</div><div><br></div><div><b>C:\Program Files\erl6.0\lib\diameter-1.6\include\diameter.hrl:</b><br></div><div><div>-record(diameter_header,</div><div> {version, %% 8-bit unsigned</div><div> length, %% 24-bit unsigned</div>
<div> <b> cmd_code, %% 8-bit unsigned</b></div><div> application_id, %% 24-bit unsigned</div><div> hop_by_hop_id, %% 32-bit unsigned</div><div> end_to_end_id, %% 32-bit unsigned</div>
<div> is_request, %% boolean() R flag</div><div> is_proxiable, %% boolean() P flag</div><div> is_error, %% boolean() E flag</div><div> is_retransmitted}). %% boolean() T flag</div>
</div><div><br></div><div>BR,</div><div>Austin</div></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div><div>Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.</div><div><a href="http://feuerlabs.com">http://feuerlabs.com</a></div></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>