Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Use of octetstring in LENGTHTO
Use of octetstring in LENGTHTO [message #1842035] Tue, 08 June 2021 00:31 Go to next message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 15
Registered: June 2021
Junior Member
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 09:21 Go to previous messageGo to next message
Adam Knapp is currently offline Adam KnappFriend
Messages: 54
Registered: November 2020
Member
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 10:18 Go to previous messageGo to next message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 15
Registered: June 2021
Junior Member
Hi Adam,

Thank you
Re: Use of octetstring in LENGTHTO [message #1842129 is a reply to message #1842062] Wed, 09 June 2021 20:08 Go to previous messageGo to next message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 15
Registered: June 2021
Junior Member
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 08:15 Go to previous messageGo to next message
Andre Puschmann is currently offline Andre PuschmannFriend
Messages: 57
Registered: March 2018
Member
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 11:12 Go to previous messageGo to next message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 15
Registered: June 2021
Junior Member
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 13:53 Go to previous message
Adam Knapp is currently offline Adam KnappFriend
Messages: 54
Registered: November 2020
Member
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 13:53]

Report message to a moderator

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


Current Time: Wed Oct 09 13:23:33 GMT 2024

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

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

Back to the top