css7asn.1

Problem in compiling C code generated by osmocom asn1c


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?


Solution

  • 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.