Search code examples
cparsingasn.1ss7

Error in generating C code from GSM-TCAP asn1 files


I am trying to generate C code for the GSM-TCAP asn1 files obtained from libosmo-asn1-TCAP. I have installed the osmocom libasnc1 compiler (tried both master and aper-prefix branches) and run this code:

asn1c -fcompound-names -gen-PER 
       DialoguePDUs.asn 
       tcap.asn 
       TCAPMessages.asn 
       TC-Notation-Extensions.asn 
       UnidialoguePDUs.asn

However, the compiler reports the following syntax error:

ASN.1 grammar parse error near line 86 (token "returnResult"): syntax error, 
unexpected TOK_identifier Cannot parse "TCAPMessages.asn"

Does anyone know the root of this problem, and how to resolve it?


Solution

  • You don't need to compile all asn files in asn sub-directory. There is a rebuild script that you could use.

    asn1c $ASN/DialoguePDUs.asn $ASN/tcap.asn $ASN/UnidialoguePDUs.asn 
    

    The other files contain syntax that is not supported by asn1c and some of them were rewritten to not use such syntax and some are not needed at all.