Skip to main content



      Home
Home » Eclipse Projects » Eclipse Titan » Use of octetstring in LENGTHTO
Use of octetstring in LENGTHTO [message #1842035] Mon, 07 June 2021 20:31 Go to next message
Eclipse UserFriend
Hello,

I'm currently implementing a NAS encoder based on 3GPP TTCN files. However it specifies length fields as octetstrings, such as Type4Length_Type and Type6Length_Type (which are the typedefs of octetstrings).

For example in the following structure:
  type record ESM_MessageContainer {                            /* 24.301 cl. 9.9.3.15 */
    IEI8_Type                   iei                   optional,   /* present in case of TLV; omit in case of LV */
    Type6Length_Type            iel,
    octetstring                 esmPdu                            /* ESM PDU without NAS security header*/
  };


Here the field 'iel' specifies the length of 'esmPdu'.

But, Titan doesn't allow to use non-integer field in LENGTHTO variant with the following error:
error: The LENGTHTO field must be an integer or union type instead of 'octetstring'


Is there any chance to have a fix for this issue (to be able to use octetstring in LENGTHTO) ?

Thanks
Re: Use of octetstring in LENGTHTO [message #1842057 is a reply to message #1842035] Tue, 08 June 2021 05:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi Anton,

I created an issue for that in GitLab: https://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/554
Re: Use of octetstring in LENGTHTO [message #1842062 is a reply to message #1842057] Tue, 08 June 2021 06:18 Go to previous messageGo to next message
Eclipse UserFriend
Hi Adam,

Thank you
Re: Use of octetstring in LENGTHTO [message #1842129 is a reply to message #1842062] Wed, 09 June 2021 16:08 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

I found, that 3GPP TTCN also uses bitstrings for length.

So, it would be super if LENGHTO parameter accepts octetstring and bitstring.
Re: Use of octetstring in LENGTHTO [message #1842240 is a reply to message #1842129] Mon, 14 June 2021 04:15 Go to previous messageGo to next message
Eclipse UserFriend
Hey Anton,

I don't recall the orignal ETSI code but this is what I use for NAS encoding with Titan, works well.


type integer INT16b (0..65535) with { variant "FIELDLENGTH(16), BYTEORDER(last)" };

type record ESM_MessageContainer {                            /* 24.301 cl. 9.9.3.15 */
  IEI8_Type                   iei                   optional, /* present in case of TLV; omit in case of LV */
  INT16b                      iel,
  octetstring                 esmPdu                optional  /* ESM PDU without NAS security header;
                                                                 type is FFS */
} with {
  encode "RAW"
  variant (iel) "LENGTHTO(esmPdu)";
};


Cheers
Andre
Re: Use of octetstring in LENGTHTO [message #1842246 is a reply to message #1842240] Mon, 14 June 2021 07:12 Go to previous messageGo to next message
Eclipse UserFriend
Hello Andre,

On my side I use the similar technique to temporary resolve the issue, I just redeclare the required types, something like this:

type integer Type4Length_Type (0..255) with { variant "FIELDLENGTH(8)" }


However, I would like to avoid additional changes to ETSI code. Probably it shouldn't be a big deal to allow using octetstring/bitstring in LENGTHTO specification.

Regards,
Anton
Re: Use of octetstring in LENGTHTO [message #1851427 is a reply to message #1842246] Tue, 05 April 2022 09:53 Go to previous message
Eclipse UserFriend
Hi,

This request is now implemented and available in the compiler. See the details in https://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/554.
You can have a brief overview about what changed based on the diff of the documentation: https://gitlab.eclipse.org/eclipse/titan/titan.core/-/merge_requests/247/diffs?commit_id=da7b29f620be0d9c0c0581bba9c4a0bb39cfa72f
Of course any feedback are welcome!

[Updated on: Tue, 05 April 2022 09:53] by Moderator

Previous Topic:Choosing multiple encoders
Next Topic:using optional implicit omit
Goto Forum:
  


Current Time: Tue Jul 15 10:53:33 EDT 2025

Powered by FUDForum. Page generated in 0.52615 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top