ASN1C version 6.2 is now an official release!  What we plan to do in the weeks and months ahead in this blog is to provide a more complete description of some of the new features than what you will find in the documentation.  This includes example code, tips on use, examples from ASN.1 specifications where the feature is used, and, in the case of performance improvements, data showing tests we have run and the amount of improvement.

We start with the rather large change that was made to improve the way we deal with table constraints in 3GPP specifications.  This is now described in the documentation as well as a white paper on the subject.   The main goal of this change was to make table constraint generated code easier to work with.  In order to do this, we attempted to pull as much information forward from the embedded web of table constraints, information object sets, information objects, and class definitions as possible.  To illustrate the difference, this is what code generated from the NBAP specification looked like in ASN1C v6.1:

typedef struct EXTERN InitiatingMessage {
  ProcedureID procedureID;
  Criticality criticality;
  MessageDiscriminator messageDiscriminator;
  TransactionID transactionID;
  Asn1Object value;
} InitiatingMessage;

The line in bold was the code generated for the open type in the InitiatingMessage specification.  Asn1Object is a generic structure that contains a void pointer to hold an object of one of the allowed field types.  It was up to the user to go back to the specification to determine what the allowed types for the various combinations of procedureID and criticality were in order to populate the structure.

The new structure is as follows:

typedef struct EXTERN InitiatingMessage {
  ProcedureID procedureID;
  Criticality criticality;
  MessageDiscriminator messageDiscriminator;
  TransactionID transactionID;
  struct {
    /**
     * information object selector
     */
    NBAP_ELEMENTARY_PROCEDURES_TVALUE t;
    /**
     * NBAP_ELEMENTARY_PROCEDURES information objects
     */
    union {
      /**
       * messageDiscriminator: common
       * procedureID:
       * criticality: reject
       */
      RadioLinkSetupRequestFDD  *radioLinkSetupFDD;
      /**
       * messageDiscriminator: common
       * procedureID:
       * criticality: reject
      */
      RadioLinkSetupRequestTDD  *radioLinkSetupTDD;
    } u;
  } value;
} InitiatingMessage;

In this case, the items in bold show what is now generated in place of the Asn1Object line above.  All possibilities are pulled out and comments added to show what types go with what relational fields. Note that this is from a trimmed down version of the NBAP specification which is used in our sample programs - the full NBAP specification would have a much larger generated structure.

This change is currently targeted at 3GPP and LTE specifications that exhibit a certain table constraint pattern.  The change is currently only supported for the PER and XML encoding rules.  We plan to expand this coverage in the future to include BER/DER and other types of specifications that make use of table constraints such as those used in telecommunications (MAP) and IETF security (PKIX, CMS).


Published

Category

Announce