asn1c: Failed to parse S1AP and RANAP asn.1
I’d like to report another problem when processing S1AP, RANAP and NBAP asn1 files with newest repository acdca4184712a92b9318f3d0fbf9d70e581361aa.
They are OK to be parsed and C code generated in 94f0b645d401f75b5b1aa8e5440dc2df0f916517
FATAL: Information Object Set S1AP-ELEMENTARY-PROCEDURES contains no objects at line 247
FATAL: Cannot compile "InitiatingMessage" (20:1) at line 224
FATAL: Cannot compile "InitiatingMessage" (20:1) at line 224
Makefile:1140: recipe for target 'regenerate-from-asn1-source' failed
FATAL: Information Object Set RANAP-ELEMENTARY-PROCEDURES contains no objects at line 233
FATAL: Cannot compile "InitiatingMessage" (20:1) at line 204
FATAL: Cannot compile "InitiatingMessage" (20:1) at line 204
Makefile:1312: recipe for target 'regenerate-from-asn1-source' failed
make: *** [regenerate-from-asn1-source] Error 70
If you need these asn.1 files, please let me know.
Thanks for your great effort !
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 63 (32 by maintainers)
Commits related to this issue
- Fix decoding sample-S1AP-InitialContextSetup.aper problem Based on Velichkov's suggestion on comment : https://github.com/vlm/asn1c/issues/185#issuecomment-341944947 — committed to brchiu/asn1c by brchiu 7 years ago
- Fix decoding sample-S1AP-InitialContextSetup.aper problem Based on Velichkov's suggestion on comment : https://github.com/vlm/asn1c/issues/185#issuecomment-341944947 — committed to brchiu/asn1c by brchiu 7 years ago
- Fix decoding sample-S1AP-InitialContextSetup.aper problem Based on Velichkov's suggestion on comment : https://github.com/vlm/asn1c/issues/185#issuecomment-341944947 — committed to brchiu/asn1c by brchiu 7 years ago
- Fix decoding sample-S1AP-InitialContextSetup.aper problem Based on Velichkov's suggestion on comment : https://github.com/vlm/asn1c/issues/185#issuecomment-341944947 — committed to brchiu/asn1c by brchiu 7 years ago
- aper: SEQUENCE(SIZE(1..256)) OF is not decoded correctly because the alignement was forgotten See also https://github.com/vlm/asn1c/issues/185#issuecomment-368745830 — committed to velichkov/asn1c by velichkov 7 years ago
- aper: Fix range calculation when decoding constrained SEQUENCE OF/SET OF According to Rec. ITU-T X.691 (08/2015) 11.5.3 Let "range" be defined as the integer value ("ub" – "lb" + 1), and let the val... — committed to velichkov/asn1c by velichkov 7 years ago
- aper: Fix range calculation when decoding constrained SEQUENCE OF/SET OF According to Rec. ITU-T X.691 (08/2015) 11.5.3 Let "range" be defined as the integer value ("ub" – "lb" + 1), and let the val... — committed to velichkov/asn1c by velichkov 7 years ago
- aper: Fix range calculation when decoding constrained SEQUENCE OF/SET OF According to Rec. ITU-T X.691 (08/2015) 11.5.3 Let "range" be defined as the integer value ("ub" – "lb" + 1), and let the val... — committed to velichkov/asn1c by velichkov 7 years ago
- S1AP: Add sample S1AP pdus from NextEPC project Files are from #185 and were renamed to match the Makefile's glob pattern bin/1.bin -> nextepc/sample-S1AP-PDU-1.aper Thanks to @acetcom — committed to velichkov/asn1c by velichkov 6 years ago
- aper: Fix INTEGER encode on 32bit platforms On i686 the long is 4 bytes and the right shift with more then 32 bits is probably an undefined behaviour See https://github.com/vlm/asn1c/issues/185#issu... — committed to velichkov/asn1c by velichkov 6 years ago
- aper: Fix decode of big unsigned integers on 32bit platforms On i686 the long is 4 bytes and when converted to uint64_t some big unsigned values get converted to very big negative values See https:/... — committed to velichkov/asn1c by velichkov 6 years ago
- aper: Fix INTEGER encode on 32bit platforms On i686 the long is 4 bytes and the right shift with more then 32 bits is probably an undefined behaviour See https://github.com/vlm/asn1c/issues/185#issu... — committed to mouse07410/asn1c by velichkov 6 years ago
- aper: Fix decode of big unsigned integers on 32bit platforms On i686 the long is 4 bytes and when converted to uint64_t some big unsigned values get converted to very big negative values See https:/... — committed to mouse07410/asn1c by velichkov 6 years ago
Hi @acetcom,
I just pushed 3 commits in my fork - two APER fixes (fec0acc058491b60eb00cd223de246b168b69f92, f5dc5cc6358a153cd0e0da503563c595d2a2edd4) and one XER (8d06d92df6dca1b9a6dcb0aedef0f91e053823d0)
The problems were also reproducible with
make check
as I’ve already added the PDUs you provided in my fork.@mouse07410 and @velichkov
Sorry for late response!
Today(26/March), I’ve tested asn1c library with NextEPC test framework.
In 32bit machine, both are correctly worked for NextEPC. No Problem!
Thanks a lot!
Hi @brchiu,
I’m OK to incorporate this into your PR, an easy way to do it is to cherry-pick from my repository
@mouse07410,
Ok. If @brchiu decides to not cherry-pick this change I will open a new PR once #226 gets merged.
I will. In the future feel free to check-pick changes directly from my repo as described above.
Dear @brchiu , With regard to the problem in compiling “Information Object Set”, the problem seems solved and S1AP, RANAP, X2AP, M3AP, LPPa, PCAP, XwAP are successfully compiled, as you mentioned, after commit 3bbbd04 by @vlm . However, when compiling the GSM_MAP protocol, that issue still rises.
Do you have any clue that how this can be resolved? Maybe with similar approach which addressed the problem for S1AP.
Thanks
hi, @acetcom, just for your information. Online tool provided by http://asn1-playground.oss.com/ also failed to decode this
srsenb.aper
.Hi @acetcom,
Most probably the srsENB encoding is not correct because wireshark does not decode it as well.
Yes the problem is related with this parameter. To get some more info run s1ap-dump with
-dd
optionHi @mouse07410,
I think these checks are sufficient.
Hi, @velichkov
Great! NextEPC 32bit version is also successfully ported with this.
For your reference, I’ve only changed the following code based on your s1ap branch.
The attached pcap was created by new S1AP API. s1ap-32bit.tar.gz
And also, you can find the example code in NextEPC repository.
The new NextEPC will be released after testing real eNodeB. 1~2 week might be needed.
Thank you very much!!!
Best Regards, Sukchan
Hi @acetcom,
The previous fix was definitely not correct, my second attempt is 3f5ef6d (you need to revert or drop the previous patch and apply this on top of a1537b84624a1626d6c806e6791765d837d190ef).
And if possible could you send me all messages from the
testepc.pcapng
extracted as a bin files.Hi @acetcom, @brchiu,
To resolve the problem with
s1reset_three_part_of_s1_interface.bin
apply 25da4e3d90e827f70c31b3a4833fe31ef56401ceWhen decoding a SEQUENCE OF with less then 256 the alignment bits were not read and because of this the decoded length was wrong
Hi @brchiu,
You have made a great progress!
An alternative solution according to the documentation could be
I just tried with both options and the cyclic inclusion is removed at least for S1AP but the compilation fails with
Part of problems during parsing S1AP’s ASN.1 was fixed in fix_s1ap branch of my fork.
But there still be unsolved ones. It looks like current
asn1c
can not handle following ASN.1. A minimum excerpt is in this gist.By the way, though S1AP and RANAP can be parsed and generate corresponding C code for S1AP and RANAP with commit 94f0b64, due to APER not support in this repository, S1AP and RANAP message can not be encoded or decoded yet.
We still need to merge APER implementation, for example #125 or #115, in the future.