[erlang-questions] Diameter header cmd_code field bit size
Anders Svensson
anders.otp@REDACTED
Mon Apr 7 10:16:02 CEST 2014
It's a comment typo. Even application_id is wrong: should be 32-bit,
not 24. I'll fix this for the coming 17.0 release. Thanks for the
report.
/Anders, Erlang/OTP
On Sun, Apr 6, 2014 at 4:51 PM, austin aigbe <eshikafe@REDACTED> wrote:
> Hello,
>
> 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?
>
>
>
> RFC 6733:
>
> 3. Diameter Header
>
> A summary of the Diameter header format is shown below. The fields
> are transmitted in network byte order.
>
> 0 1 2 3
> 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
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> | Version | Message Length |
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> | Command Flags | Command Code |
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> | Application-ID |
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> | Hop-by-Hop Identifier |
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> | End-to-End Identifier |
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> | AVPs ...
> +-+-+-+-+-+-+-+-+-+-+-+-+-
>
> C:\Program Files\erl6.0\lib\diameter-1.6\include\diameter.hrl:
> -record(diameter_header,
> {version, %% 8-bit unsigned
> length, %% 24-bit unsigned
> cmd_code, %% 8-bit unsigned
> application_id, %% 24-bit unsigned
> hop_by_hop_id, %% 32-bit unsigned
> end_to_end_id, %% 32-bit unsigned
> is_request, %% boolean() R flag
> is_proxiable, %% boolean() P flag
> is_error, %% boolean() E flag
> is_retransmitted}). %% boolean() T flag
>
> BR,
> Austin
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
More information about the erlang-questions
mailing list