Problem in compiling C code generated by osmocom a

2019-07-17 03:35发布

问题:

I have installed the osmocom asn1c compiler, the aper-prefix branch, to obtain an implementation of the TCAP protocol. I have used the respective script to compile the ".asn" files. The C files are generated successfully, but when compiling the obtained C code, an error is raised, which is related to this line of code:

#include <EXTERNAL.h>

In fact, the file EXTERNAL.h is missing (seemingly, the EXTERNAL type is not supported by this compiler). Is anyone aware of this problem and a possible solution?

回答1:

You have several options:

  1. Use a newer version of asn1c from this PR (still not merged)

  2. Copy the EXTERNAL.h from the osmocom repository

  3. Rename EXTERNAL to EXTERNALt in all asn files and add the following in the asn files that has EXTERNALt.

    --
    -- From "ITU-T Recommendation X.208", "34 The external type"
    --
    EXTERNALt ::= [UNIVERSAL 8] IMPLICIT SEQUENCE
    {direct-reference OBJECT IDENTIFIER OPTIONAL,
        indirect-reference INTEGER OPTIONAL,
        data-value-descriptor ObjectDescriptor OPTIONAL,
        encoding CHOICE
        {single-ASN1-type [0] ANY,
            octet-aligned [1] IMPLICIT OCTET STRING,
            arbitrary [2] IMPLICIT BIT STRING}}
    

    Or add it in a separate asn file and import where needed.



标签: c asn.1 ss7 asn1