TOP

What's New in the OSS ASN.1 Tools for C

Applies to: ASN.1/C 10.5

What's New in ASN.1/C 10.5

This section provides a summary of the new and enhanced features in the OSS ASN.1 Tools for C 10.5.

New Features

Conformance to Draft ITU-T Recommendation X.jsoner

The ASN.1/C compiler and the SOED, TOED, and LED runtime libraries support the JSON Encoding Rules. The existing -json command-line option instructs the compiler to enable support for X.jsoner at runtime.

The JSON codec supports the following encoding instructions:

  • JER:ARRAY
  • JER:BASE64
  • JER:NAME
  • JER:OBJECT
  • JER:TEXT
  • JER:UNWRAPPED
Smaller TOED footprint

By defining OSS_REDUCED_ERROR_MSGS when compiling the generated .c, error messages will contain just the 5 character message prefix, instead of the full message. Alternatively, if OSSDEBUG=0 is defined, the error message strings will be removed completely, leaving only the return code to determine which error occurred. On Linux x86, you can reduce the footprint of your application by approximately 20 kilobytes. This number may vary depending on the processor, operating system, and C compiler.

New samples

The following samples have been added for the LTE protocols:


What's New in ASN.1/C 10.4

This section provides a summary of the new and enhanced features in the OSS ASN.1 Tools for C 10.4.

New Features

64-bit precision in TIME type fractions

The ASN.1/C Compiler and Runtime now support 64-bit precision (19-20 decimal digits) in TIME type fractions.

New samples

The its_sae_j2735_2016 sample for the 2016-03 version of the J2735 protocol has been created. The sample does not include the J2735:2016 ASN.1 specification due to licensing reasons. Users should obtain it directly from the ITS SAE site.

A sample for the 3GPP XwAP (TS 36.463) protocol has been created.

Improvements

For ISO 8601 TIME type values with a property settings constraint that specifies "Basic=Date" and "Date=Y", "Date=YM", or "Date=YMD", with no Year settings:

  • The ASN.1/C Compiler now correctly generates an SOED control table and TOED functions.
  • The SOED/LEAN Octet Encoding Rules (OER) encoder/decoder now correctly encodes/decodes such values.

Previously, the OER encoder produced a verbose encoding instead of an optimized binary encoding.

The name of the OSS_ALLOW_ABSENT_OR_BAD_SECONDS_OR_ABSENT_Z runtime compatibility flag has been changed to OSS_ALLOW_ABSENT_OR_BAD_SECONDS; the original name was deemed somewhat misleading. For backward compatibility, the previous name is still available.

The ASN.1/C SOED/LEAN/TOED PER encoder-decoder implementation now conforms to the recent X.691 corrigendum (2015): an encoding contained in a BIT STRING should be at least one octet for PER ALIGNED and 1 bit for PER UNALIGNED.

OER encoding of untagged CHOICE values is now aligned with the X.696 standard. Previously, such CHOICE values were encoded BER-style: the outermost tag of the chosen alternative was encoded only once.

The ASN.1/C runtime implementations are now aligned to conform to ITU-T X.680 Clause 46.3c. This clause states that the minutes component of a GeneralizedTime type value can be omitted when the difference between local time and UTC is an integral number of hours. Previously, a false error could be issued when the minutes component was absent.


What's New in ASN.1/C 10.3

This section provides a summary of the new and enhanced features in the OSS ASN.1 Tools for C 10.3.

New Features

The following new features have been added:

Support for the JSON Encoding Rules

Support for the JSON Encoding Rules is available in all three runtime libraries of the OSS ASN.1/C Tools: Space-Optimized Encoder/Decoder (SOED), Time-Optimized Encoder/Decoder (TOED), and Lean Encoder/Decoder (LED). With JSON, you can preserve the power of text (JSON) encodings, yet take advantage of the conversion to or from binary (ASN.1) encodings for fast transmission or compact storage.

New command-line option

The -json command-line option enables generation of code for JSON.

New API functions

The ossBinary2JSON() and ossJSON2Binary() API functions have been added to convert data encoded in ASN.1 binary form (e.g., BER, PER, DER, OER, etc.) to JSON text encoding form (JSON) and vice versa.

The ossPrintJSON() API function is now supported. This function allows you to print the contents of a JSON encoding in a well-formatted manner.

Also, the following API functions have been added:

New IAAPI functions

The ossDetectCDRHeaders() IAAPI function accepts the input buffer with BER-based encoded messages and returns information stored in CDR headers when a supported format is detected.

The following IAAPI functions for converting to and from CSV have been added:

  • ossClearCsvSettings()
  • ossGetCsvSetting()
  • ossSetCsvSetting()
  • ossSetDefaultCsvSettings()
  • ossConvertCsvToPduValue()
  • ossConvertCsvToTypeValue()
  • ossConvertPduValueToCsv()
  • ossConvertTypeValueToCsv()
  • ossGetNumberOfExtraCsvs()
New IAAPI flag

The TLV_NOCDRHEADERS IAAPI flag suppresses automatic detection of CDR headers.

Improvements

IAAPI improvements

IAAPI functions that print BER-encoded messages in TLV format now automatically detect and skip CDR headers.

The following CDR formats are supported:

  • CDR files consisting of a CDR file header and CDR records with a CDR record header before each BER-based message.
  • CDR files consisting of CDR record headers that hold the record identifier in the first two octets and the record length in the next two octets.
Samples improvements

The samples for Releases 10, 11, and 12 have been updated to the latest versions of the standards. New samples for 3GPP LTE Release 13 have been added.


What's New in ASN.1/C 10.2

This section provides a summary of the new and enhanced features in the OSS ASN.1 Tools for C 10.2.

New Features

The following new features have been added:

Partial Decoding

The partial decoding feature enables you to:

  • Decode preselected fields from incoming messages at a high speed.
  • Directly access the decoded field in the callback function without traversing from the top of the PDU.
  • Get the offset and length of the field encoding in a binary BER/DER/OER/C-OER message. It allows you to replace the value of the field directly in the binary message, if the encoding of the new value is of the same length as of the previous one.

The partial decoding feature requires TOED runtime version 10.2 or later and it is available upon request. For information about purchasing the license, contact Sales ‹info@oss.com›.

For more information, see the Partial Decoding section.

New command-line options

The -enablePartialDecode and -partialDecodeOnly options instruct the compiler to generate code that enables the ossPartialDecode() TOED runtime API function. The options are available if the -toed option is specified or implied by default.

New compiler directives

The OSS.DataCallback and OSS.InfoCallback compiler directives have been added.

New API functions

The ossPartialDecode() and ossTestPD() API functions have been added.

The following API utility functions that support BCD and TBCD encodings have been added to the ASN.1/C runtime libraries. The functions print octet-aligned data as BCD or TBCD strings and convert octet strings to or from BCD or TBCD strings.

  • ossPrintOctetAsBCDString()
  • ossPrintOctetAsTBCDString()
  • ossConvertOctetToBCDString()
  • ossConvertOctetToTBCDString()
  • ossConvertBCDStringToOctet()
  • ossConvertTBCDStringToOctet()
New Samples

You can find the partial_decode and s1ap_pd_r12 samples that illustrate the partial decoding feature usage in the samples/advanced.

The provided set of samples has been updated:

  • The new standards/tap3_bin2xml sample demonstrates conversion from binary (BER) encoding to XML (XER) encoding. It uses the ASN.1 specification from the standards/tap3 sample.
  • The new standards/cam_denm sample shows you how to handle CAM and DENM messages specified by the ETSI EN 302 637-2, ETSI EN 302 637-3, and ETSI TS 102 894-2 standards.
  • The LTE samples for 3GPP Release 12 (RRC, S1AP, X2AP, M2AP M3AP, SbcAP) have been added.

Improvements

The ossCreateUnencodedValueOfPDU() and ossCreateUnencodedValueOfType() IAAPI functions now create unencoded values for PDU types that have a CONTAINING clause inside ASN.1 types with ContentsConstraint.


What's New in ASN.1/C 10.1

This section provides a summary of the new and enhanced features in the OSS ASN.1 Tools for C 10.1.

New Features

Enhanced OER Support

The ASN.1/C compiler and the TOED, SOED, and LED runtimes have all been augmented to support OER as defined in "Rec. ITU-T X.696 | ISO/IEC 8825-7", rather than only the subset of ASN.1 types as defined in the "NTCIP 1102:2004 Octet Encoding Rules (OER) Base Protocol" document.

The Canonical Octet Encoding Rules (C-OER) as defined in "Rec. ITU-T X.696 | ISO/IEC 8825-7" are now supported by the ASN.1/C compiler and the TOED, SOED, and LED runtimes.

Support for non-breaking spaces in the input ASN.1 syntax as UTF-8 format Unicode characters. Other Unicode characters that are treated as spaces are supported in UTF-8 format as well.

New command-line options

The new -useQualifiedNames compiler option instructs the ASN.1 compiler to add a prefix, depending on the type name, to:

  • enumerators generated for an ENUMERATED ASN.1 type
  • constants generated for named numbers of an INTEGER type
  • constants generated for named bits of a BIT STRING type

Improvements

The ASN.1/C compiler now generates huge values of base 2 REAL types without losing precision.

Choice alternatives containing an untagged choice are now canonically ordered correctly by the compiler.

The ASN.1/C compiler is changed so as to now accept GeneralizedTime values where the minutes and seconds components are omitted and a time difference component is present.

The compiler now accepts comments within compiler command files. The "--" characters specify the beginning of a comment and can be placed anywhere on the line. The comment continues until either a subsequent "--" is reached or the line ends.


What's New in ASN.1/C 10.0

This section provides a summary of the new and enhanced features in the OSS ASN.1 Tools for C 10.0.

New Features

Octet Encoding Rules (OER) Support

Support for the Octet Encoding Rules (OER), as specified by the NTCIP 1102:2004 Octet Encoding Rules (OER) Base Protocol document, has been implemented in the ASN.1/C compiler, the SOED, TOED, and IAAPI runtime libraries, ASN.1 Studio, and CAGL.

OER messages can generally be encoded/decoded significantly faster compared to BER and PER messages, while being only slightly less compact than PER messages. Support for OER in ASN.1/C LED will be provided in the next release.

New utility API functions

Two new utility API functions are provided:

  • ossPrintPDUToBuffer() serializes the content of the compiler-generated structures (before encoding or after decoding) into standard ASN.1 value notation format and then writes it into the output buffer; this function is similar to ossPrintPDU(), which writes to the standard output.
  • ossDeterminePDUBufferLength() is used to determine the length of the output buffer (in bytes) required by ossPrintPDUToBuffer().
New samples

The set of samples provided includes new samples illustrating the use of protocols based on the SAE J2735 Intelligent Transportation standard, as well as the RRC, S1AP, and X2AP LTE protocols based on 3GPP Release 10.

Improvements

You can now decode open types with table (component relation) constraints, without setting the AUTOMATIC_ENCDEC runtime flag.

The compiler will now generate TOED decoding functions so that even when the AUTOMATIC_ENCDEC runtime flag is not set, the decoder resolves component relation constraints and sets the pduNum field of the OpenType structure accordingly. The field is set to zero when neither the -autoencdec nor the -constr compiler options are specified, or when the NOCONSTRAIN runtime flag is set.

The SOED decoders will now fill in an OpenType pduNum field unless the NOCONSTRAIN runtime flag is set. Previously, the decoders did not fill in the pduNum field for new (union based) OpenTypes when the AUTOMATIC_ENCDEC flag was not set.

The compiler will now implicitly turn on the -debug option while generating TOED functions even when the -lean option is specified. Previously, the -lean option suppressed the implicit -debug option. As a result, the TOED printing functions were not generated unless -debug was specified explicitly.

Some OSS API functions (ossDecode(), ossEncode(), ossSkipPadBytes(), ossBinary2XML(), ossXML2Binary(), etc.) will now return new error codes and messages when file/socket memory manager errors occur. Previously, most such errors produced the common FATAL_ERROR (18) error code and an error message such as "x0087S: Undefined memory-management error #N.". To check for a specific error you had to parse the message and extract the #N value.


This documentation applies to the OSS® ASN.1 Tools for C release 10.5 and later.

Copyright © 2017 OSS Nokalva, Inc. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means electronic, mechanical, photocopying, recording or otherwise, without the prior permission of OSS Nokalva, Inc.
Every distributed copy of the OSS ASN.1 Tools is associated with a specific license and related unique license number. That license determines, among other things, what functions of the OSS ASN.1 Tools are available to you.