TOP

ASN.1/C Compiler Advanced Topics

Applies to: ASN.1/C v11.3-11.3.1

This section covers complex features of the OSS ASN.1 Tools. See the following topics:

Helper Wrappers

Helper wrappers enable you to speed up the development process without worrying about the internal details of the ASN.1 compiler-generated structures. They provide macros and functions that control compiler-generated structures and make errors less likely to occur.

To use helper wrappers, compile your ASN.1 schema with the -helperAPI option. The following related options are automatically enabled: -helperListAPI, -helperMacros, and -helperNames.

General Guidance

This section discusses the differences between the code generated with helper wrappers and the one generated without helper wrappers.

When using helper wrappers, C structures derived from built-in ASN.1 types are generated into separate types, and not inline.

Example

ASN.1 C C (with -helperAPI)
Module DEFINITIONS ::= BEGIN
   S ::= SEQUENCE {
       b CHOICE {
       c BOOLEAN,
       d INTEGER
       }
    }
 END
typedef struct S {
    struct {
        unsigned short  choice;
#           define      c_chosen 1
#           define      d_chosen 2
        union {
            ossBoolean      c;  /* to choose, set choice to c_chosen */
            int             d;  /* to choose, set choice to d_chosen */
        } u;
    } b;
} S;
typedef struct S {
    struct S_b      *b;
} S;

typedef struct S_b {
    unsigned short  choice;
#       define      c_chosen 1
#       define      d_chosen 2
    union {
        ossBoolean      c;  /* to choose, set choice to c_chosen */
        int             d;  /* to choose, set choice to d_chosen */
    } u;
} S_b;

Built-in simple types represented by structures have more intuitive names: "_BitStr" or "_BmpStr".

Example

ASN.1 C C (with -helperAPI)
Module DEFINITIONS ::= BEGIN
   S ::= SEQUENCE {
      a BMPString,
   }
END
typedef struct S {
    struct {
        unsigned int    length;
        unsigned short  *value;
    } a;
} S;
typedef struct _BmpStr {
    unsigned int    length;
    unsigned short  *value;
} _BmpStr;

typedef struct S {
    struct _BmpStr  *a;
} S;

Structures that are not derived from built-in simple types are created based on the position of the built-in types within a complex user-defined type.

All references to structures within C structures are generated as pointers. Simple types such as INTEGER (without a HUGE directive), REAL (with the DOUBLE directive), BOOLEAN, NULL, and ENUMERATED don't have pointers. To convert the corresponding fields to pointers, use the POINTER directive.

Example

ASN.1 C C (with -helperAPI)
Module DEFINITIONS ::= BEGIN
   S ::= SEQUENCE {
      a SEQUENCE {
      b INTEGER
      }
   }
END
typedef struct S {
    struct {
        int             b;
    } a;
} S;
 typedef struct S {
    struct S_a      *a;
} S;
Module DEFINITIONS ::= BEGIN
   S ::= SEQUENCE {
      a SEQUENCE {
      b INTEGER --<POINTER>--
      }
   }
END
typedef struct S {
    struct {
        int             *b;
    } a;
} S;
typedef struct S {
    struct S_a      *a;
} S;

typedef struct S_a {
    int             *b;
} S_a;

When using helper wrappers, a new DLINKED-PLUS representation is used for SET OF and SEQUENCE OF types with structured and pointer elements.

Example

ASN.1 C C (with -helperAPI)
Module DEFINITIONS ::= BEGIN
   S ::= SEQUENCE {
      a SEQUENCE OF SET {
      b INTEGER
      },
      c SEQUENCE OF INTEGER
   }
END
typedef struct S {
    struct _seqof1 {
        struct _seqof1  *next;
        struct {
            int             b;
        } value;
    } *a;
    struct _seqof2 {
        struct _seqof2  *next;
        int             value;
    } *c;
} S;
typedef struct S {
    struct S_a      *a;
    struct S_c      *c;
} S;

typedef struct S_a_set {
    int             b;
} S_a_set;

typedef struct S_a {
    struct S_a_node *head;
    struct S_a_node *tail;
    unsigned int    count;
} S_a;

typedef struct S_a_node {
    struct S_a_node *next;
    struct S_a_node *prev;
    struct S_a_set  *value;
} S_a_node;

typedef struct S_c {
    unsigned int    count;
    int             *value;
} S_c;

ASN.1 Macros

The OSS macro processor is included as part of the OSS ASN.1 compiler and provides a series of useful functions:

  • Expands all macro notation.
  • Performs full syntax checking of ASN.1 source files.
  • Produces source listings (with all imported items expanded) and diagnostic messages.

When invoking the OSS macro expander/syntax checker, no preprocessing of the ASN.1 source is required.

Expansion of ASN.1 Macro Notation

The ASN.1 type that the macro instance returns (the type of the value that the macro assigns to the local value reference, VALUE) is used to determine how the macro is expanded. If a single assignment is made to VALUE in an instance of the macro, the type associated with that value is returned.

When the type returned by the macro instance is indeterminate (zero or more than one assignment to VALUE in the macro instance), a CHOICE type is generated. If no assignment is made to VALUE in the macro instance, the resulting CHOICE contains each possible type that the macro can return. If more than one assignment is made to VALUE in the macro instance, the resulting CHOICE contains the type associated with each VALUE to which an assignment was made.

When the type returned by the macro instance is completely indeterminate, an ANY type is generated. This occurs when the value assigned to VALUE is an argument that is present only in the macro's VALUE NOTATION, but the macro is used strictly as a type with no value specified.

Macro instances that have indeterminate return types are non-standard and we recommend that you do not use them. The compiler tolerates these types of macros only to support older versions; however, a warning message is issued when it encounters them.

Restrictions

The following restrictions apply to user-defined ASN.1 macros:

  • When defining a macro by another macro, make sure the latter is defined.
    In the following example, OPERATION must be defined before it can be used in defining ABSTRACT-OPERATION:
    ABSTRACT-OPERATION MACRO ::= OPERATION
  • The "[" character is not supported for macros as an astring.
  • When you specify arguments in a macro instance, make sure the macro is defined.
    In the following example, A is defined correctly since no argument is passed to ERROR. Also, C is defined correctly because ERROR is defined before being referenced by C. Note that B is defined incorrectly, because arguments are passed to it, but ERROR is referenced by B before being defined:
    A ::= ERROR
     
    B ::= ERROR PARAMETER BOOLEAN
     
    ERROR MACRO ::= BEGIN
        TYPE NOTATION	::= Parameter
        VALUE NOTATION	::= value(VALUE CHOICE{
           localValue  INTEGER,
           globalValue OBJECT IDENTIFIER})
           Parameter    ::= "PARAMETER" NamedType | empty
           NamedType    ::= identifier type       | type
    END
    
    C ::= ERROR PARAMETER BOOLEAN
    
  • Macro arguments and values that do not have an effect on the return type are checked by the compiler for correct usage, but have no effect on the compiler output. The compiler treats such parameters and values as formal comments whose meaning is understood only by the user. Therefore it validates their usage but does not attempt to interpret their meaning.
    For example, using the ERROR definition specified above, you can create an instance of ERROR as follows:
     C ::= ERROR PARAMETER BOOLEAN
    Note that, in the macro definition, the type of the value returned by ERROR is CHOICE {localValue INTEGER, globalValue OBJECT IDENTIFIER}; this type is independent of the parameters passed to ERROR. The compiler syntax-checks the parameters to ensure that if the PARAMETER occurs immediately after ERROR, it is followed by a valid ASN.1 type. These parameters are then ignored and have no further effect. In some instances, this behavior is contrary to the type/value compatibility rules in ASN.1.

Examples of Macros

The following examples are drawn from the ITU-T Recommendations X.208 and X.410:

Example 1

Macro whose return type is independent of the instance of the type notation and value notation:

 ERROR MACRO ::= BEGIN
    TYPE NOTATION	::= "PARAMETER" NamedType | empty
    VALUE NOTATION	::= value(VALUE INTEGER)
    NamedType        ::= identifier type       | type
 END
 

Used as follows:

 ErrorRecord ::= SEQUENCE {
    rectype   ERROR PARAMETER VisibleString,
    sector                    INTEGER
   }
 

Regardless of the parameter passed to the macro, the following definition is always implied because the type returned by the macro is always INTEGER:

  ErrorRecord ::= SEQUENCE {
     rectype   	   INTEGER,
     sector    	   INTEGER
  }
 

Example 2

Macro whose return type is independent of the instance of the type notation and the value notation:

 OPERATION MACRO ::= BEGIN
    TYPE NOTATION   ::= "ARGUMENT" NamedType
	                Result Errors      | empty
    VALUE NOTATION 	   ::= value(VALUE INTEGER)
    Result             ::= empty           | "RESULT" NamedType
    Errors             ::= empty           | "ERRORS" "{"ErrorNames"}"
    NamedType          ::= identifier type | type
    ErrorNames         ::= empty           | IdentifierList
    IdentifierList  ::= identifier         | IdentifierList  "," identifier
 END

Used as follows:

 cancel OPERATION
 ARGUMENT	jobname IA5String
 RESULT	    jobCancelled NULL
 ERRORS	{jobNotFound, unauthorizedCancel}
		  ::= 1
  
  Message ::= SEQUENCE {
	invokeID	INTEGER,
		        OPERATION,
	argument	ANY
	}
 

Regardless of the parameters passed to the macro, since the type that the macro returns is always INTEGER, the following code is always generated:

 lookup INTEGER ::= 1
   
 Message ::= SEQUENCE {
    invokeID   INTEGER,
               INTEGER,
    argument   ANY
   }

Example 3

Macro whose return type is independent of the instance of the value notation, but depends on the instance of the type notation:

PAIR MACRO ::= BEGIN

   TYPE NOTATION ::= 
      "TYPEX" "=" type(LocalType1)
      "TYPEY" "=" type(LocalType2)
   VALUE NOTATION ::=
      "("
      "X" "=" value(LocalValue1 LocalType1)
      ","
      "Y" "=" value(LocalValue2 LocalType2)
      <VALUE SEQUENCE {LocalType1, LocalType2} ::= 
         {LocalValue1, LocalValue2}>
      ")"
END

Used as follows:

AgeAndMarried ::= PAIR
   TYPEX = INTEGER
   TYPEY = BOOLEAN
      
serena AgeAndMarried ::= (X = 2, Y = FALSE)

The following code is generated. Note that the generated types are based on the macro parameters:

AgeAndMarried ::= SEQUENCE {
   INTEGER,
   BOOLEAN
   }

serena AgeAndMarried ::= {2, FALSE}

Example 4

Macro whose return type depends on the instance of the type and the value notation (contains multiple assignments to VALUE):

BIND MACRO ::= BEGIN

   TYPE NOTATION	::= Argument  Result  Error
   VALUE NOTATION	::= Argument-value | Result-value | Error-value

   Argument        ::= empty | "ARGUMENT"   Name type(Argument-type)
   Result          ::= empty | "RESULT"     Name type(Result-type)
   Error           ::= empty | "BIND-ERROR" Name type(Error-type)
   Name            ::= empty | identifier
   
   Argument-value	::= empty | "ARGUMENT"
            value(Arg-value Argument-type)
   <VALUE [16] EXPLICIT Argument-type ::= Arg-value>

   Result-value::= empty | "RESULT"
            value(Res-value Result-type)
   <VALUE [17] EXPLICIT Result-type   ::= Res-value>

   Error-value::= empty | "ERROR"
            value(Err-value Error-type)
   <VALUE [18] EXPLICIT Error-type    ::= Err-value>
END
 

Used as follows:

BindA ::= BIND
BindB ::= BIND RESULT INTEGER
b BIND ARGUMENT INTEGER ::= ARGUMENT 2

A warning message is issued for BindA and BindB, and the following code is generated:

BindA ::= CHOICE {
[16] ANY,
[17] ANY,
[18] ANY
}

BindB ::= [17] INTEGER

b [16] INTEGER ::= 2

Backward Compatibility

The following table contains the -compat flags listed alphabetically and provides a short description. For more information, see ASN.1/C Compiler -compat Flags.

Name Description
addBadDirForInstancesOfParamRef
Generates incorrect directives in the .gen file. It is used with the -gen or -keep option for shared instances of parameterized types for which a separate typedef is created.
allowBadDEFAULTValues
Allows the compiler to silently truncate a size-constrained DEFAULT value and to issue a warning message instead of an error. The DER/CER/COER encoder will not encode the value if it is equal to the truncated version of the DEFAULT value.
allowLinkedDirectiveForStringTypes
Provides compatibility with previous versions and instructs the compiler to accept LINKED directives applied to string types for compatibility with very early ASN.1/C releases.
allowUnnamed
Instructs the compiler to generate unnamed nested C structures.
autoDetectPDUnumber
Instructs the OSS TOED/SOED BER decoder to ignore a PDU number passed to determine it from an encoding, even when the number is not zero.
bad1994ExternalWithContentsConstr
Instructs the compiler to generate an incorrect 1994 EXTERNAL representation for EXTERNAL types with ContentsConstraint within MultipleTypeConstraint.
badDefineNamesForComponentsOfFields
Instructs the compiler to accept incorrect #define names generated for OPTIONAL (or DEFAULT) fields of COMPONENTS OF when FIELDNAME (DefineName, NickName) is applied to the corresponding field of the original type.
badConflictingEnumeratedNames
Instructs the compiler to generate duplicate names for enumeration values and definitions when a combination of names and directives is used in the ASN.1 syntax.
badExternalPrefix
Adds an "_" prefix to structures of EXTERNAL types.
badLengthDirectives
Instructs the compiler to allow SHORT, INT, and LONG directives to affect the length and count fields of compiler-generated structures.
badNameConflicts
Instructs the compiler to disambiguate names when this is not required.
badPointerTypesWithNestedContConstr
Instructs the compiler to generate an additional pointer for ASN.1 types with ContentsConstraint within InnerSubtypes and with compiler-generated helper names.
badRefNames
Instructs the compiler to generate a type reference of the base type for tagged types marked an OSS.POINTER directive.
badSetOfOidWithPointer
Instructs the compiler to ignore the effect of other global directives when a global OSS.POINTER directive is applied to SET OF, SEQUENCE OF, and OBJECT IDENTIFIER types.
badSharingForTypesWithInlineTypeDir
Instructs the compiler to ignore OSS.UseThis directives for similar types that include fields marked with OSS.InlineType directives.
badTypedefsForUserNames
Instructs the compiler to generate more typedefs in the header file for TYPENAME directives.
badTYPENAMEdirectives
Instructs the ASN.1 compiler to process invalid OSS.TYPENAME directives applied to referenced fields of structured types.
badUnboundedBitStringsWithNamedBits
Instructs the compiler to not limit an unbounded BIT STRING with a NamedBits representation based on named bits values.
badUnderscorePrefix
Adds an "_" prefix to internal names.
badValuePrefix
Instructs the compiler to not add a prefix to ambiguous value references.
BMPleanUTF8String
Instructs the compiler to use standards older than version 7.0 for UTF8String representations when -lean is specified.
charUTF8String
Instructs the compiler to represent UTF8String with one-byte character strings.
decoderUpdatesInputAddress
Allows ossDecode() to modify the input buffer, address, and length.
extensionWithMask
Enables bitmasks for pointered extensible elements.
extraLinkedSETOFPointer
Instructs the compiler to generate a double pointer (**) for circular SET OF definitions.
extraNameShortening
Instructs the compiler to shorten names.
extSizeNotUnbounded
Instructs the compiler to use fixed-length arrays for certain extensible types.
generateInlineDeeplyNestedTypes
Instructs the compiler to generate a C-type definition for deeply nested ASN.1 types.
ignore1994ExternalConstr
Instructs the compiler to not provide information at runtime about constraints applied to 1994 EXTERNAL types converted to the 1990 EXTERNAL representation.
ignoreInlineTypeDirForSharedTypes
Instructs the compiler to ignore the effect of an InlineType directive applied to types nested within shared types.
ignoreNicknamesInConflict
Instructs the compiler to generate disambiguated names for #define constants or for elements of an ENUMERATED type even when the ASN1.Nickname directive is applied.
ignorePointerDirForLean
Instructs the compiler to ignore the effect of the POINTER directive for Lean, thus providing compatibility with Lean encoder/decoder runtime libraries of previous versions.
ignorePrefixForSpecialStructures
When -helperNames is specified, disables prefixing for C structures generated for ASN.1 types, such as CHARACTER STRING, EMBEDDED PDV, and EXTERNAL.
implicitTypeInArray
Generates an implicit type definition for CHOICE, SET OF, and SEQUENCE OF types when these are elements of SET OF or SEQUENCE OF types in an ARRAY representation.
intEnums
Initializes C enum variables with INTEGERs and restricts the scope of enum typedefs.
multipleUserFunctions
Allows multiple constraint functions for a single type.
nestUnions
Instructs the compiler to ignore nested structures within CHOICE types.
noASN.1comments
Disables ASN.1 comment transfer to the header file.
noBTypeValues
Instructs the compiler to ignore SEQUENCE or SET types in value notation.
noConstrainedByFunctionsFromInnerSubtype
Instructs the compiler to not generate user-defined functions for fields with a CONSTRAINED BY constraint within an inner subtype constraint when the -userConstraints option is specified.
noConstDeclarations
Instructs the compiler to not generate const declarations for simple type values.
noDecoupledNames
Instructs the compiler to use pre-v5.0.0 rules of name-mangling when generating .c and .h files.
noDefaultValues
Instructs the compiler to treat DEFAULT items as OPTIONAL.
noMacroArgumentPDUs
Instructs the compiler to not treat macro arguments as PDUs.
noObjectSetsFromDummyObjects
Instructs the compiler to generate additional _OSET declarations for instances of parameterized information object sets used in table constraints.
noOssterm
Disables generation of ossterm() when the -test option is used.
noParamTypesharing
Disables type sharing for parameterized types.
noPduForContainedExternal
Disables generation of a PDU constant in the header file for EXTERNAL types used in ContentsConstraint.
noPDUsForImports
Instructs the compiler to not treat imported types as PDUs.
noSharedTypes
Disables type sharing optimization used by compiler.
noUInt
Instructs the compiler to not use unsigned int for constrained INTEGERs.
noULength
Restricts the use of unsigned int for the length and count fields in the header file.
noUnionRepresentationForOpenTypes
Instructs the ASN.1 compiler to generate a common representation for each open type as a predefined OpenType structure.
noUserConstraintPDUs
Instructs the compiler to treat parameters to CONSTRAINED BY as non-PDUs.
noValues
Disables C initializations for value notation.
oldBooleanType
Instructs the compiler to equate BOOLEAN and ossBoolean types.
oldEncodableNames
Generates additional typedefs for referenced or parameter types with the DeferDecoding or ENCODABLE directive.
oldExternObjHdl
Instructs the compiler to append "ObjHandle" to EXTERNAL types.
oldInternalDefineNames
Allows mangling of #define names in internal structures.
oldInternalNamesWithinUseThisSharedTypes
Generates artificial type names within parameterized types based on the name of the type that contains instances of parameterized types, when sharing of the instances occurs and UseThis directives are present.
oldLocationOfTypesFromInnerWithContentConstraints
When you apply a contents constraint to a BIT STRING or OCTET STRING type, the generated type representation differs from the original one. When you apply a contents constraint within an inner subtype, the compiler preserves the original type representation and generates an additional type with a new representation for the contents constraint. The flag instructs the compiler to generate structures for additional types in the location used in previous versions instead of generating the structures within the same headers as the ones in which the structures for the original types are generated when you specify the -splitHeaders option with the -c++ or -dualHeaders option.
oldNamesManglingWithPrefix
Reproduces rare bugs by mangling certain typenames when the -c++ and -prefix options are used.
oldObjectNames
Disables prefixing of information object names.
oldParamTypesharing
Excludes types used as actual parameters in parameterized types from type sharing optimization.
oldSharingFieldsWithDirect
Prevents type sharing of nested structures that have an OSS.DefineName or OSS.FIELDNAME directive applied to one of their fields.
oldTypesFromInnerSubtypeWithContentConstraints
Instructs the compiler to use the same name specified with a TYPENAME directive for the generated representations of both the base type and the type created after using contents constraints within an inner subtype constraint.
padded
Allows PADDED directives on variable length strings.
paddedForNamedBits
Instructs the compiler to represent BIT STRING types with named bit lists using the PADDED representation instead of the UNBOUNDED representation.
pointeredParamTypesWithContConstrAndUseThis
Generates typedefs with an additional pointer for parameterized types with a ContentsConstraint and UseThis directives.
terseComments
Instructs the compiler to print brief comments in the header file.
typedefsForGenNames
Instructs the compiler to generate additional typedefs in the header file for internal compiler-generated names.
unbndBit
Allows SizeConstraints to take precedence over NamedBitLists.
unnamedStructForConstrBy
Instructs the compiler to generate unnamed structures for types with CONSTRAINED BY nested within SET, SEQUENCE, SET OF, and SEQUENCE OF types with an OSS.LINKED, OSS.DLINKED, or OSS ARRAY directive applied.
useUShortForBitStringsWithNamedBits
Instructs the compiler to not generate representations for BIT STRINGs with NamedBits that have values that exceed SHRT_MAX and are less than USHRT_MAX.
v2.0
Provides compatibility with version 2.0.
v3.0
Provides compatibility with version 3.0.
v3.5
Provides compatibility with version 3.5.
v3.6
Provides compatibility with version 3.6.
v4.0
Provides compatibility with version 4.0.
v4.1.0
Provides compatibility with version 4.1.0.
v4.1typesharing
Instructs the compiler to use version 4.1 for type sharing.
v4.1.1 / v4.1.2 / v4.1.3 / v4.1.4 / v4.1.5 
v4.1.6 / v4.1.7 / v4.1.8
Provides compatibility with the corresponding version numbers.
v4.1.6encodable
Instructs the compiler to generate unnecessary typedefs for ENCODABLE types.
v4.1.6extraLinkedSETOFPtr
Adds a double pointer (**) to circular SET OF definitions.
v4.1.9
Provides compatibility with version 4.1.9.
v4.2.0
Provides compatibility with version 4.2.0.
v4.2.5typesharing
Instructs the compiler to use version 4.2.5 for type sharing.
v4.2.6
Provides compatibility with version 4.2.6.
v4.2badSetOfWithGlobalDir
Instructs the compiler to use an incorrect handling of mutually exclusive global directives applied to SET OF and SEQUENCE OF types.
v4.2badUnderscorePrefix
Adds an "_" prefix to internal names.
v4.2defaults
Instructs the compiler to use version 4.2 for the default representation schema.
v4.2namesForOpenTypes
Instructs the ASN.1 compiler to generate names using the old format that includes the original ASN.1 built-in type name for which an open type is generated.
v4.2nicknames
Allows Nickname and TYPENAME directives applied to parameterized types to affect the actual parameters.
v4.2objHandleCstrPointer
Instructs the compiler to generate pointered structures for character strings with an OBJHANDLE | NOCOPY directive.
v4.2octetStringDefault
Instructs the compiler to represent OCTET STRINGS (larger than 256 bytes) as VARYING.
v5.0.0
Provides compatibility with version 5.0.0.
5.0.0badNamesForNamedItems
Allows the Nickname directive to have a general effect on parameterized types for nested NamedNumberLists.
5.0.0namesPrefixes
Adds unnecessary prefixes derived from module names to #define constants.
5.0.0nicknames
Allows Nickname and TYPENAME directives to have no effect on certain parameterized types.
5.0.1
Provides compatibility with version 5.0.1.
5.0.4
Provides compatibility with version 5.0.4.
v5.0.6
Provides compatibility with version 5.0.6
5.1extraPointer
Allows the OSS.POINTER directive to be applied to circularly referenced linked SET OF or SEQUENCE OF types.
5.1parameterizedTypes
Allows general representations for restricted character types and INTEGER types with parameterized size or range constraints.
5.1typesharing
Instructs the compiler to use version 5.1 for the type sharing algorithm.
5.1unnamedStructForConstrBy
Generates inline types for unnamed structures defined within CONSTRAINED BY clauses when -C++ and -userConstraints options are specified.
v5.1.0
Provides compatibility with version 5.1.0.
v5.1.3
Provides compatibility with version 5.1.3.
v5.1.4
Provides compatibility with version 5.1.4.
v5.2nestedUsethisTypes
Instructs the compiler to ignore the OSS.UseThis directive when applied to a type referencing another type.
v5.2noExtraParamRef
Instructs the compiler to not generate separate typedef for an ASN.1 type referenced by a parameterized type.
v5.2paramNicknames
Reproduces rare bugs with an OSS.TYPENAME and ASN1.Nickname directives applied to certain parameterized types.
v5.2paramRangeConstraints
Allows long int representations for instances of INTEGER types with dummy parameterized range constraints.
v5.2sharing
Instructs the compiler to use version 5.2 for the type sharing algorithm.
v5.2typesharing
Reproduces bugs in type sharing with a rare type of parameterization.
v5.2.0
Provides compatibility with version 5.2.0.
v5.2.1
Provides compatibility with version 5.2.1.
v5.3.0
Provides compatibility with version 5.3.0.
v5.3.1
Provides compatibility with version 5.3.1.
v5.4integer
Provides compatibility with version 5.4integer.
v5.4.0
Provides compatibility with version 5.4.0.
v5.4.2
Provides compatibility with version 5.4.2
v5.4.4
Provides compatibility with version 5.4.4.
v6.0.0
Provides compatibility with version 6.0.0.
v6.0stringswithMAXsize
Provides compatibility with versions older than version 6.1.4 when generating C-representations for character strings with SIZE constraints defined with the MAX keyword.
v6.1.3varyingbitstring
Provides compatibility with versions prior to 6.1.4 as regards the C-representation of unconstrained BIT STRING types with named bits and the POINTER and VARYING directives applied.
v6.1.3
Provides compatibility with version 6.1.3.
v6.1.4DefineNameSharing
Disables name mangling changes while providing compatibility with version 6.1.4.
v6.1.4extrapointer
Provides compatibility with versions 6.1.2, 6.1.4 and 7.0BetaA as regards applying an extra POINTER directive in certain rare cases to fields of a SEQUENCE, SET or CHOICE type.
v6.1.4ReferencesToLeanTypes
Instructs the compiler to use built-in LED typedefs instead of typedefs generated for references to named simple types with the -lean option.
v6.1.4
Provides compatibility with version 6.1.4.
v7.0DefineNames
Restores the names generated in some #defines.
v7.0pdusForBuiltinTypesInObjectSet
Provides compatibility with versions older than version 7.0.2.
v8.0.0
Provides compatibility with version 8.0.0.
v8.1.0
Provides compatibility with version 8.1.0.
v8.1.2SharingTypesWithEXERInstruction
Instructs the compiler to not use type sharing to share identical types with assigned E-XER encoding instructions and provides compatibility with version 8.1.2.
v8.1.2
Provides compatibility with version 8.1.2.
v8.1.2ParamRefSharingWithDirectives
Instructs the compiler to generate a different typedef for parameterized types with shared instances when FIELDNAME, DefineName, TYPENAME, and ExtractType directives are present.
v8.2.0
Provides compatibility with version 8.2.0.
v8.2.0DefineNamesSharingWhenUsingXmlNames
Instructs the compiler to not use XML names of types to resolve name conflicts related to type components when the -useXmlNames option is specified.
v8.3.1
Provides compatibility with version 8.3.1.
v8.4.0
Provides compatibility with version 8.4.0.
v8.4DirForInstancesOfParamRef
Instructs the compiler to not use .gen files generated with the -keepNames option to restore old names for shared instances of parameterized types.
v8.4ExtraTypedefForParamRefWithUseThis
Generates additional unused typedefs for one of the shared instances of parameterized types.
v8.4InvalidSizeForUnionConstraint
Instructs the compiler to not handle a union of size and single value subtype constraints. The type C representation is truncated using the upper bound of a size constraint.
v8.4PrimitiveTypeSharing
Generates additional unnecessary typedefs for similar types that appear within other similar types linked by a OSS.UseThis directive.
v8.4TypesSharingWithAutomaticTagging
Generates duplicate structures in the header file for similar ASN.1 types that are defined in a module with automatic tagging instead of sharing such structures.
v8.5.0
Provides compatibility with version 8.5.0.
v8.5FalseExtendedConstraintEncoding
Restores incorrect compiler and runtime behavior for versions older than version 8.6 so that the PER encoder/decoder can handle certain extensible constraints.
v8.5DlinkedSeqOfSetOfWithExtSizeConstraint
Instructs the compiler to not generate DLINKED/DLINKED-PLUS representations for SET or SEQUENCE OF types with extensible size constraints and a DLINKED or DLINKED-PLUS directive applied.
v8.5TableConstraintForExtensibleObjectSets
Restores compiler and runtime behavior for versions older than version 8.6 to handle table or component relation constraint violations for extensible object sets.
v8.6namesForSetOfAndSeqOfWithNamedElements
Restores compiler behavior for versions older than version 9.0 to generate names for a C structure representing a SET OF or SEQUENCE OF type element when the latter type has no ASN.1 name.
v8.6UTF8StringRepresentation
Restores compiler behavior for versions older than version 9.0 to generate different UTF8String C representations depending on the presence of wide characters in type values in the input syntax, when -lean is specified.
v8.7.0
Provides compatibility with version 8.7.0.
v8.7BitStringsWithMAXUpperBound
Restores compiler behavior for versions older than version 9.0 to generate different C representations for BIT STRING types that have a SIZE constraint with a MAX upper bound and a PADDED or VARYING directive applied.
v8.7reservedWords
Restores compiler behavior for versions older than version 9.0 to generate SID and small names without mangling.
v9.0.0extractionForDeeplyNestedTypes
Restores compiler behavior for versions older than version 9.0 to generate code that does not limit the nesting level of structures and unions.
v9.0reservedWords
Restores compiler behavior for versions older than version 10.0 to generate floor and send names without mangling.
v10.0valueTruncation
Truncates a SEQUENCE or SET OF type value with an extensible size constraint.
v10.0reservedWords
Generates interface names without mangling.
v10.1.0
Provides compatibility with version 10.1.0 of the ASN.1 compiler.
v10.5.0 
Provides compatibility with version 10.5.0 of the ASN.1 compiler. The -compat v10.5.0 flag is the equivalent of the -compat v10.5NamesConflictingWithNicknames option.
v10.5NamesConflictingWithNicknames 
Restores pre-10.6 compiler version behavior. The ASN.1 compiler could skip disambiguation of global names generated for #define constants or for ENUMERATED type elements within very large ASN.1 syntaxes when those names were in conflict with user-defined names specified using an ASN1.Nickname directive.
v10.6.0
Provides compatibility with version 10.6.0 of the ASN.1 compiler. The -compat v10.6.0 flag is the equivalent of the -compat v10.6PdusForReferencedTypesOfRemovedFields, -compat v10.6PointeredTypesFromInnerWithContentConstraints, -compat v10.6DefineNamesForTypesFromInnerWithContentConstraints, -compat noConstrainedByFunctionsFromInnerSubtype, and -compat oldTypesFromInnerSubtypeWithContentConstraints options.
v10.6DefineNamesForTypesFromInnerWithContentConstraints
Instructs the compiler to mangle global define names with the same values that are generated for similar fields within artificial types created after using contents constraints within an inner subtype constraint.
v10.6PdusForReferencedTypesOfRemovedFields
Starting with version 10.7, the compiler no longer treats a named ASN.1 type as a PDU type when the type is referenced only by the fields removed with an ASN1.Remove compiler directive. The v10.6PdusForReferencedTypesOfRemovedFields compat flag restores the previous compiler behavior.
v10.6PointeredTypesFromInnerWithContentConstraints
Instructs the compiler to generate additional pointers for duplicate types created after applying contents constraints within inner subtype constraints in case of circular definitions when using helper mode.
v10.7.0
Provides compatibility with version 10.7.0 of the ASN.1 compiler. The -compat v10.7.0 flag is the equivalent of the -compat v10.7OrderOfSharedTypedefsForOpenTypes flag.
v10.7ContentsConstraintsWithRecursiveTypeInsideConstrainedBy
Instructs the compiler to not generate PDU typedefs for types derived from contents constraints that are included inside recursively defined types when the recursion occurs within a nested user-defined constraint applied using an inner subtype constraint.
v10.7DataCallback
Disables the behavior of DataCallback functions introduced in version 11.0.
v10.7JsonEncodeRestrictedCharStringUsingNonHexForm
Instructs the JSON encoder/decoder to process TeletexString, T61String, VideotexString, GraphicString, and GeneralString (also ObjectDescriptor) types as JSON strings.
v10.7OrderOfSharedTypedefsForOpenTypes
Restores the order of typedefs generated by ASN.1 compiler versions prior to v11.0.
v11.0.0
Provides compatibility with version 11.0.0 of the ASN.1 compiler.
v11.0ImportedWithSuccessorForwardedReferences
Instructs the ASN.1 compiler to not report errors or warnings for some unresolved forwarded references imported using WITH SUCCESSORS.
ignoreUseThisDirectivesForFieldsInsideParamTypess
Instructs the ASN.1 compiler to ignore OSS.UseThis directives applied to open type fields inside parametrized types that can be shared and used in the new "union" representation of open types in the generated header file.
v11.1.0
Provides compatibility with version 11.1.0 of the ASN.1 compiler.
v11.1ArtificialPDUsForRecursivesTypes
Instructs the ASN.1 compiler to create new artificial PDUs for complex recursive types defined through a CONSTRAINED BY syntax inside parameterized types.
v11.1ContentsConstraintInsideOpenTypeValue
Instructs the ASN.1 compiler to create a new artificial PDU for type with a contents constraint inside an open type value even when a matching type exists in the information object set specified in the component relation constraint.
v11.1DefineNamesForTypesFromInnerWithContentConstraints
Provides compatibility with compiler versions 10.6 through 11.1 and instructs the compiler to generate the same define names that are generated for fields inside structurally different artificial types created after applying a contents contrain inside an inner subtype.
v11.1FieldNamesAndGlobalPrefix
Instructs the compiler to generate truncated field names that match one of the reserved names when the OSS.DefineName directive is applied to the parent's field marked with OPTIONAL and the -prefix option is specified.
v11.1ForwardedNonParamReferencesImportedWithSuccessors
Instructs the ASN.1 compiler to skip some forwarded non-parameterized references that are defined later, are imported using WITH SUCCESSORS, and included inside actual parameters with inner subtype constraints in instances of parameterized types. This behavior might cause warnings in relaxed mode or errors in non-relaxed mode.
v11.2.0
Provides compatibility with version 11.2.0 of the ASN.1 compiler. This flag is equivalent to the following -compat options: v11.2TypesFromConstrainedBy, v11.2PdusForTypesFromDEFAULTInsideInfoObjClass.
v11.2PdusForTypesFromDEFAULTInsideInfoObjClass
Instructs the ASN.1 compiler to disambiguate conflicting PDU names with an extra module name for types used in a DEFAULT syntax applied to VariableTypeFields inside information object classes.
v11.2TypesFromConstrainedBy
Instructs the ASN.1 compiler to generate names that were generated by previous versions of the ASN.1 compiler for types defined in a CONSTRAINED BY syntax.


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

Copyright © 2024 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 for C 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 for C are available to you.