Version 4.2 enhancements

New Value Generation

The TCE-C++ ASN.1 Compiler generates now definitions for the most common values.
A definition is generated for each ASN.1 ValueAssignment where the type of the value is BOOLEAN, INTEGER, ENUMERATED, OBJECT IDENTIFIER, RELATIVE-OID, BIT STRING or OCTET STRING.

These definitions are generated as #define in the file asntype.h. The generated name is usually the ASN.1 name suffixed by __V to avoid identifier conflicts.
For example, the following ASN.1 definition
maxNrOfErrors INTEGER ::= 256
produces the generation of the following statement in the file asntype.h :
#define maxNrOfErrors__V 256
It is now possible to apply a $Id formal comment to a ValueAssignment.
For example, the following ASN.1 definition
maxNrOfErrors INTEGER ::= --$ Id myName -- 256
produces the generation of the following statement in the file asntype.h :
#define myName__V 256

Enhanced runtime error management

The TCE-C++ ASN.1 runtime now offers much more information about the errors that can be encountered. This information is available through new methods of the asnContext class.

When an error is detected during a decoding or during a constraint check, it is now possible to get the precise location of the error in the value.

When an error is detected during a decoding, it is now possible to obtain the offset of the error in the encoded value.

When an error is detected during an encoding or a decoding, it is now possible to know the state of the input or output stream.

Improvement of the BER toolkit

The BER toolkit has been enriched by several new methods that allow applications to manage bad BER encoding.

For instance, the BER toolkit can be used to extract error data from TAP3 messages in order to build RAP messages (see the Rejects & Returns process for billing standards on

The new methods added in the class asnBerToolKit allow to:

  • Get an arbitrary TLV from a BER encoding, his length and his offset,
  • Encode and decode BER tags.

The existing methods have been enhanced to support the description of the occurrence of a tag.

A new method has also been added to the asnContext class to allow the user to obtain the location of an error detected by the user application.

New automatic type decoding

The TCE-C++ ASN.1 runtime offers two new methods to create a value from a BER or an XER encoding without specifying the type to decode.

These methods are useful to reduce the amount of code to be written to transform BER message into XER messages and conversely.

These methods require only the specification of the abstract syntax and the uniqueness of the BER or XER tags.

New constraint check mechanism

This release introduces a new constraint check mechanism in addition to the existing one. The new mechanism (table driven) uses less memory but is more CPU time consuming.It is selected with the -chkcst option at ASN.1 compilation time. No additional file is generated because the data of the file are used to perform the constraint check.

PER run-time fixes

The PER encoding of a value depends on the evaluation of the ASN.1 constraint of its type, as specified by [X.680] and [X.691].

Some rules of [X.691], that are subject to interpretation in the 1997 release of the ASN.1 standard, have been clarified in the 2002 release (see ISO/IEC 8825-2: 2002 - ITU-T Rec. X.691 07/02).

These clarified rules standardize the PER encoding of some tricky combination of constraints and have generally no impact on common ASN.1 syntaxes.

This release implements the clarified rules of the 2002 release of the ASN.1 standard.

Project file improvement

The file references contained in an ASNSDK project (file with suffix .pra) are no longer stored as absolute file names in system-dependent format but as file names relative to the project file and in a system-independent format.

This allows using the same project file from various systems and with different file system mount points.

An existing ASNSDK project is converted to new format the first time that it is saved with the V4.2 TCE-C++ ASN.1 compiler GUI.

New file split option

The compiler produces large C++ files for large ASN.1 syntaxes. This can make difficult the C++ compilation of these files.

The compiler now supports a new -split option that allows users to split the generated C++ source files in several parts.

Runtime memory allocation optimization

The PER, BER and XER encoders now use a more efficient memory allocation scheme.

It reduces the number of memory allocation requests and the overall use of memory, except when only little memory is allocated.

The encoding time can be reduced up to 30% for PER, BER and XER.

This optimization reduces the number of calls to asnalloc (the customizable memory allocator) by grouping together several small memory requests and by releasing them as a whole.

A new customizable constant asnCAD10_TMPALLOCSIZE has been introduced for fine-tuning. The customizable constant asnCMA00PERENCBUFSIZE has been removed.

Compiler code generation optimization

The code generation has been improved on two points:

  • The code generated for the ENUMERATED type has been reduced.
  • The data structures generated in file are now more compact.

The amount of code and data can be reduced up to 30% depending on the development environment, the target platform, the compilation options and the runtime customization.

XER schema compatibility with third party tools

The XML schema generated for XER values with the -xsd compiler option has been slightly modified to improve its compatibility with third party tools:

  • All XML elements have now an XML type,
  • Only the PDU ASN.1 types of the syntax are generated as root XML elements.

These modifications have no impact on the use of the schema to verify XER values.