The OSS compilers do not generate code for all the asn files for protocols like s1ap and x2ap. Do we need to add the "-root" option?

The default behavior of the OSS ASN.1 Compiler is to treat the final module within the final input file as the root module. It is the root module which is, so to speak, the top of the food chain. The root is the one which contains the types you directly work with; the other modules are there solely to resolve the references.

So although finding and moving the actual root module to the bottom would solve your problem, you probably don't already know which is the root. The easiest way around this is to ask the ASN.1 Compiler to treat all modules as roots; you do this by using the -root option. You'll probably get a lot more stuff generated into the .c/.cpp/.h or .java files, but you'll be sure that it's all there.

If you prefer to work at isolating the root, you can try moving the modules around or else use the OSS.ROOT directive like this

--<OSS.ROOT RootModuleName>--

where RootModuleName is replaced by the name of the actual root module.

The OSS.ROOT directive instructs the ASN.1 Compiler to forget about using the last module as the root and instead treat the modules specified by the directive as roots. There can be any number. You may place this directive within an ASN.1 file or, perhaps in a more tidy manner, insert it into a separate file, for instance, directives.asn, and include that file on the command line. So, instead of

asn1 a.asn b.asn c.asn

you would have

asn1 directives.asn a.asn b.asn c.asn

For details on -root and OSS.ROOT, please review the OSS ASN.1 Compilers Reference Manual.

The samples included with some of the Knowledge Center answers are meant for your general understanding of the OSS products. Different versions of the products might produce slightly different outputs. Consult the products documentation and samples for the most up-to-date products information and code examples.

Contact Support
contact Our office hours
24 hours/day, 7 days/week

  • Phone: 1-888-OSS-2761 (USA and Canada)
  • Phone: 1-732-302-9669 (International)
  • Fax: 1-732-302-0023
  • Email:
Free Trial

Test drive the OSS Nokalva ASN.1, 4G and XML Tools now! Your trial includes complete software, documentation, sample programs, free 24x7 technical support and more.

Learn ASN.1
Learn ASN.1

Our expert personnel can help you learn ASN.1!

We offer 4-day ASN.1 courses at our headquarters or your premises.