ASN1C V6.2 README

This file contains release notes on the latest release of the ASN1C compiler (version 6.2.x).

Contents

Introduction

Thank you for downloading this release of the ASN1C software. ASN1C is a powerful ASN.1 compiler capable of parsing and generating C, C++, C#, or Java source code for the most advanced ASN.1 syntax.

This package contains the ASN1C compiler executables and run-time libraries. Documentation is available online at http://www.obj-sys.com/docs/documents.shtml

Release Notes

This release of ASN1C adds the following new capabilities:
Improved Table Constraint Handling for 3GPP

A new command line switch (-3gpp) was added to be used in conjunction with the table constraints code generation switch (-tables). This causes a new type of table contraint handling code to be generated that is optimized towards the common pattern found in 3GPP specifications such as RANAP, NBAP, and RNSAP. This pattern is also present in the new S1AP and X2AP specifications used in LTE. The new code style is designed to be more intuitive and user friendly. Further information can be found in our white paper: ASN1C C/C++ Code Generation for 3GPP and LTE.

Support for the ASN.1 CONTAINING keyword

Support has been added for adding the type definition contained within a contents constraint specified using the CONTAINING keyword directly into the container type. The generated code will then automatically deal with converting the content to and from the BIT or OCTET STRING type that uses this constraint. Prior to this release, a user had to do a two-step procedure in order to encode or decode variables of these types.

New Configuration Variables for Reducing Code Size

General compactness in generated C/C++ PER code when the -compact switch is used has been improved on average between 10% and 20% in this release. In addition, new configuration variables (<notUsed/> and <perEncoding/> have been added to allow a user to further reduce the code footprint size by removing unused or boilerplate parts of encoded PER messages from generated encoders and decoders.

Improvements to C/C++ Memory Management

The C run-time code to support the standard nibble-alloc memory management algorithm has been overhauled to provide better performance. In large scale applications, the improvement can be dramatic with operations that used to take over an hour being able to be done in less than a minute. Also, a special compact version of the memory management has been provided for source code users that can be subsitiuted by simply compiling the run-time with the MEMCOMPACT switch enabled.

XML Namespace Support Added

Generated XML encoders and decoders will now automatically add namespace information to encoded XML documents based on ASN.1 module name. This will make the XML valid across modules when naming conflicts may occur.

Improved Syntax Checking

ASN.1 syntax checking was improved to check for more kinds of errors including a deep check for ambiguous tags in SEQUENCE or SET types.

Improved XSD Code Generation for 3GPP

XML schema produced for 3GPP specifications with table constraints has been improved to be more intuitive. It is now possible to generate XML encoders and decoders and an XSD specifcation for 3GPP based ASN.1 specifications such that the generated XML can be validated using the generated XSD file.

Addition of the ASN1C Eclipse Plug-in

A plug-in has been developed for the use of ASN.1 in the Eclipse IDE. The plug-in is based on the ASN.1 Editor plug-in available on SourceForge.net. The enhanced version adds the capability to set ASN1C compilation options and invoke the compiler directly from within Eclipse.

Capability to configure strings to use fixed-sized character arrays

The capability to used fixed-sized character arrays for character data has been added for C/C++. In the past, only a character pointer variable was generated.

Compatibility

In an ongoing effort to improve the product, changes have been made in how code is generated in some cases. The following are known areas where differences with the previous version exist:
  1. The C/C++ types generated for productions containing a contents constraint (CONTAINING keyword) has changed to include the contained type directly in the containing structure. Before, just a standard BIT or OCTET STRING type was included. This behavior can be disabled by using the -noContaining command-line switch
  2. The C/C++ types generated for table constraint support will be different if the -3gpp command-line switch is specified in addition to -tables. This should not be a backward compatibility issue because code can still be generated the old way by not using -3gpp (even for 3GPP specifications). This code should be considered to be deprecated however as future improvements will center upon the new model.
  3. XML documents generated with XML encoders will now, by default, contain namespace information in the form of namespace prefixes and xmlns attributes. This behavior can be disabled by using the -noxmlns command-line switch.

Documentation

Documentation for release is available online at the following web-link:

http://www.obj-sys.com/asn1c-manuals.shtml

Windows Installation

The steps to install ASN1C on a Windows system are as follows:

  1. Download the ASN1C package that is of interest to you. Packages are available online for C/C++, C#, and Java. The C/C++ package contains run-time libraries built with the Microsoft Visual C++ v6.0, Microsoft .NET 2003, 2005, and 2008 compilers, Borland v5.5 C++ compiler, and GNU Cygwin gcc 3.3.1 compiler.
  2. ASN1C for Windows is packaged in a self-extracting executable file format. To install, all that should be necessary is to double-click this file after downloading and then following the setup wizard instructions from that point.
  3. After installation is complete, the license file must be installed to allow the product to operate. This was sent in the osyslic.txt file that was attached to the E-mail message that was sent at the time the product was downloaded. If you did not receive a license file, please contact us.
  4. The osyslic.txt file must be copied to a location where the compiler can find it. This can be done in one of the following ways:
    a. The file can be copied to the same directory that the ASN1C compiler executable file is located in. This is in the bin subdirectory located under the top-level install directory. This is the preferred option as it keeps the license separate from other similar license files that may be present on a given computer system.
    b. The file can be copied into any of the directories specified within your PATH environment variable (copying to the c:\windows directory works on most systems), or
    c. The file can be copied to a different directory and an environment variable named OSLICDIR created to point at this directory location.

    The compiler should now be operational. The following command can be executed:

    <rootdir>\bin\asn1c

    to verify operation.

Contents of the Release

The following subdirectories contain the following files (note: <installdir> refers to the installation directory that was specified during the installation process):

Base Compiler Package

<installdir>\bin\asn1c.exe

The command-line compiler executable file. This is invoked on ASN.1 or XSD source files to generate C, C++, C#, or Java encode/decode classes and functions. It is recommended you modify your PATH environment variable to include <installdir>\bin to allow the compiler executable to be run from anywhere.

<installdir>\bin\asn1cGUI.exe

The compiler graphic user interface (GUI) wizard executable file. This GUI guides a user through the process of specifying ASN.1 or XSD source files and options. This is the program invoked from the start menu or desktop icon.

<installdir>\bin\berfdump.exe
<installdir>\bin\ber2def.exe
<installdir>\bin\ber2indef.exe

Utility programs for operating on BER-encoded files. The first program allows a file to be dumped in a human-readable format. The other two utilities convert files from the use of indefinite to definite length encoding and vice-versa.

<installdir>\bin\dumpasn1.exe

A public-domain ASN.1 BER/DER encoded data dump tool. Thanks to Peter Gutmann for making this available for public use. The full source code for this program can be found in the utils subdirectory of the installation.

<installdir>\bin\xsd2asn1.exe

XSD-to-ASN.1 translation program executable file. This program translates an XSD file to its ASN.1 equivalent as per the ITU-T X.694 standard.

<installdir>\doc

This directory contains documentation files. Note that the bulk of the documentation items are now available online (see the Documentation section above).

<installdir>\scripts

This directory contains Perl script files for doing source code editing and other transformations. The rtport.pl script is included in this release to port existing C/C++ applications that use ASN1C generated code from version 5.8 or lower to be compatible with the latest release of the product.

<installdir>\utils

This directory contains the source code and build makefile for some of the utility programs included in the bin subdirectory.

<installdir>\xsd\lib\asn1.xsd

This directory contains the common XML schema definitions (XSD) library. This contains type mappings for built-in ASN.1 types that do not have an equivalent types defined in XSD.

<installdir>\xsd\sample

This directory contains sample programs related to the conversion of ASN.1 to XML Schema. It also contains the XSD.asn ASN.1 specification which contains the XSD ASN.1 module that is sometimes referenced in ASN.1 files that are the result of an XSD-to-ASN.1 translation.

C/C++ run-time libraries and source files

<installdir>\c\lib\* (Visual C++ 6.0)
<installdir>\c_vs2003\lib\* (Visual C++ 7.1 / .NET 2003)
<installdir>\c_vs2005\lib\* (Visual C++ 8 / .NET 2005)
<installdir>\c_vs2008\lib\* (Visual C++ 9 / .NET 2008)
<installdir>\c_gnu\lib\*.a (GNU gcc 3.3.1)

The ASN1C C run-time library files. These contain BER/DER, PER, XER, and XML run-time functions. For each encoding rules type, there is a dynamic link library (.dll) and standard library file (.lib) for linking with the DLL. There is also a static library for direct linkage to the object modules (this is the library file with the '_a.lib' suffix). The static library included in the evaluation version is not thread-safe. The licensed version of the product also contains a thread-safe static library (compiled with -MT option) and a DLL-ready library (compiled with -MD option) for building your own value-added DLL's. Also note that the evaluation and development libraries are not fully optimized (they contain diagnostic tracing and are not compiled with compiler optimization turned on). The deployment libraries are fully optimized.

<installdir>\cpp\lib\*.lib (Visual C++ 6.0)
<installdir>\cpp_vs2003\lib\* (Visual C++ 7.1 / .NET 2003)
<installdir>\cpp_vs2005\lib\* (Visual C++ 8 / .NET 2005)
<installdir>\cpp_vs2008\lib\* (Visual C++ 9 / .NET 2008)
<installdir>\cpp_borland\lib\*.a (Borland C++ v5.5)
<installdir>\cpp_gnu\lib\*.a (GNU g++ 3.3.1)

The ASN1C C/C++ run-time library files. These are the same as the C run-time libraries above except they contain run-time C++ classes as well as C run-time functions.

<installdir>\c*\lib_opt\*
<installdir>\cpp*\lib_opt\*

The optimized version of the ASN1C run-time libraries. This version has all diagnostic messages, error stack trace and text, and non-essential status checks removed. (Note: these libraries are only available in the licensed deployment version of the product. If you wish to do performance testing, please contact us and we will make them available to you).

<installdir>\c*\lib_debug\*
<installdir>\cpp*\lib_debug\*

The debug DLL versions of the ASN1C run-time libraries. These are the same as the DLL C/C++ run-time libraries above except they are linked with debug versions of Standard C Run-time DLLs. (Note: these libraries are only available in the licensed development version of the product (SDK)).

<installdir>\c\sample_*
<installdir>\cpp\sample_*

The sample directories contain sample programs demonstrating the use of the compiler. There are a set of sample programs that correspond to each encoding rule set supported by ASN1C. Most sample programs are broken down into a writer and a reader. The writer encodes a sample data record and writes it to a disk file. The reader reads the encoded message from the file, decodes it, and then prints the results of the decode operation.

<installdir>\rtsrc\*
<installdir>\rtxsrc\*

Run-time source directories containing common type and class definitions used by all encoding rules. The installation run-time source directories contain the header files required to compile the compiler generated code. The C or C++ source files will also be located here if the run-time source code kit option was selected.

<installdir>\rtbersrc\*

BER/DER/CER specific run-time source directories. These contain common code for encoding/decoding BER, DER, or CER messages.

<installdir>\rtpersrc\*

PER specific run-time source directories. These contain common code for encoding/decoding PER messages.

<installdir>\rtxersrc\*
<installdir>\rtxmlsrc\*

XML specific run-time source directories. These contain common code for encoding/decoding XER or XML messages.

<installdir>\expatsrc\*

The XML parser run-time source directories contain the source files for the Expat C XML parser.

<installdir>\libxml2src\*

The LibXML2 parser run-time source directories contain the source files for the GNOME libxml2 C XML parser.

Java run-time libraries

<installdir>\java\asn1rt.jar

ASN.1 Java run-time libraries. These contain the low-level BER, PER, and/or XER encode/decode classes. The asn1rt.jar file contains classes compatible with the Java 5 JRE.

<installdir>\java\sample_ber
<installdir>\java\sample_der
<installdir>\java\sample_per
<installdir>\java\sample_xer
<installdir>\java\sample_xml

Sample programs illustrating the use of the Java version of ASN1C. As was the case for C/C++, most have a writer and a reader. Some contain support code used by other samples (for example, SimpleROSE contains the ROSE headers used by CSTA).

<installdir>/java/doc/*

The ASN.1 Java run-time libraries documentation files. These are html files generated with the javadoc documentation tool. To view the documentation, open the index.html file with a web browser and follow the hyperlinks.

<installdir>/java/xerces/*

The Apache Xerces Java XML parser implementation. This parser is used in the generated XER and XML decode classes.

C# run-time libraries

<installdir>\csharp\asn1rt.dll

The ASN.1 C# run-time library DLL. This contains the low-level BER, PER, and/or XER encode/decode classes. It supports .NET 2002 through 2005 versions.

<installdir>\csharp\sample_ber
<installdir>\csharp\sample_der
<installdir>\csharp\sample_per
<installdir>\csharp\sample_xer
<installdir>\csharp\sample_xml

Sample programs demonstrating the use of the C# version of ASN1C. As was the case for C/C++, most have a writer and a reader. Some contain support code used by other samples (for example, SimpleROSE contains the ROSE headers used by CSTA).

<installdir>/csharp/doc/*

The ASN.1 C# run-time libraries documentation files. Documentation is contained within the ASN1CLibrary.chm file. This is in Microsoft help format.

Getting Started with C or C++

The compiler can be run using either the GUI wizard or from the command line. To run the GUI wizard, launch the application and follow these steps. To run a simple test from the command line, do the following:
  1. Open an MS-DOS or other command shell window.

Getting Started with Java

The compiler can be run using either the GUI wizard or from the command line. To run the GUI wizard, launch the application and follow the steps. To run a simple test from the command line, do the following:
  1. Open an MS-DOS or other command shell window.
  2. Change directory (cd) to one of the employee sample directories (for example, java/sample_ber/Employee).
  3. Execute the build batch file:

    build

    This will cause the ASN1C compiler to be invoked to compile the employee.asn sample file. It will then invoke the Java compiler (javac) to compile all generated java files and the reader and writer programs (Note: JDK 1.4 was used to build all the run-time library classes). It will also automatically execute the writer and reader programs. These programs will produce a writer.log and reader.log file respectively.

    Note: a makefile is also available for use if you have a make utility program available. The makefile is compatible with the GNU make utility and with the Microsoft Visual C++ make utility (nmake).

  4. View the writer and reader log files. The writer.log file will contain a dump of the encoded message contents. The reader.log file will contain a printout of the decoded data.

Getting Started with C#

The compiler can be run using either the GUI wizard or from the command line. To run the GUI wizard, launch the application and follow the steps. To run a simple test from the command line, do the following:
  1. Make sure Microsoft .NET 2003, 2005, or 2008 is installed on your system.
  2. Open the Visual Studio .NET command prompt (This can be found using: Start->Programs->Microsoft Visual Studio .NET->Visual Studio .NET Tools)
  3. Execute the nmake command to run the complete sample program. The makefile will invoke the ASN1C compiler to generate C# code for the ASN.1 definition and then compile the generated C# code.
  4. Execute writer.exe to encode a binary message and write it to a file.
  5. Execute reader.exe to read the file containing encoded binary message and decode it.

Reporting Problems

Report problems you encounter by sending E-mail to support@obj-sys.com. The preferred format of example programs is the same as the sample programs. Please provide a writer and reader and indicate where in the code the problem occurs.

If you have any further questions or comments on what you would like to see in the product or what is difficult to use or understand, please communicate them to us. Your feedback is important to us. Please let us know how it works out for you - either good or bad.