These attributes can be applied at the module level by including them within a
<module>
section:
Name | Values | Description |
---|---|---|
<name> </name> |
module name | This attribute identifies the module to which this section applies. Either this or the <oid> element/attribute is required. |
<oid> | module OID (object identifier) | This attribute provides for an alternate form of module identification for the case when module name is not unique. For example, a given ASN.1 module may have multiple versions. A unique version of the module can be identified using the OID value. |
<codename> </codename> | C/C++, Java, or C# name | This item specifies an alternate name for the module to be used in generated code. By default, the module name is used in the form it appears in the ASN.1 specification with hyphens converted to underscores. |
<include types="names" values="names"/> | ASN.1 type or value names are specified as an attribute list | By default, the compiler generates code for all types and values within a specification. This item allows you to explicitly list the ASN.1 types and/or values for which code should be generated. This allows you to reduce the size of the generated code base by selecting only a subset of the types/values in a specification for compilation. If a type or value is included that refers to other types or values (for example, the element types in a SEQUENCE, SET, or CHOICE), all of the referenced types or values will be automatically included as well. However, if an element is marked <notUsed/> or <notUsedSkip/>, the referenced type is not automatically included; if an element is marked <notUsedDecode/> or <notUsedDecodeSkip>, the referenced type is included for encoding only; if an element is marked <notUsedEncode/>, the referenced type is included for decoding only. |
<include encoders="names"/> | ASN.1 type names specified as an attribute list. | This item allows a list of ASN.1 types to be included in the generated code for which only encode functions will be generated. Automatic inclusion of referenced types takes place as for <include type="names"/>, except that the inclusion is for encoding only. |
<include decoders="names"/> | ASN.1 type names specified as an attribute list. | This item allows a list of ASN.1 types to be included in the generated code for which only decode functions will be generated. Automatic inclusion of referenced types takes place as for <include type="names"/>, except that the inclusion is for decoding only. |
<include memfree="names"/> | ASN.1 type names specified as an attribute list. | This item allows a list of ASN.1 types to be included in the generated code for which only memory free functions will be generated. |
<include importsFrom= "name"/> | ASN.1 module name(s) specified as an attribute list. | This form of the include directive tells the compiler to only include types and/or values in the generated code that are imported by the given module(s). |
<exclude types="names" values="names"/> | ASN.1 type or values names are specified as an attribute list | This item allows a list of ASN.1 types and/or values to be excluded in the generated code. By default, the compiler generates code for all types and values within a specification. This is generally not as useful as in include directive because most types in a specification are referenced by other types. If an attempt is made to exclude a type or value referenced by another item, the directive will be ignored. |
<storage> </storage> |
One of the following keywords: dynamic, static, list, array, dynamicArray, std::list, std::vector, std::deque. | The definition is the same as for the global case except that the specified storage type will only be applied to generated C and C++ types from the given module. |
<sourceFile> </sourceFile> | source file name | Indicates the given module is contained within the given ASN.1 source file. This is used on IMPORTs to instruct the compiler where to look for imported definitions. |
<prefix> </prefix> | prefix text | This is used to specify a general prefix that will be applied to all generated C and C++ names (note: for C++ types, the prefix is applied after the standard ‘ASN1T_’ prefix). This can be used to prevent name clashes if multiple modules are involved in a compilation and they all contain common names. |
<typePrefix> </typePrefix> | prefix text | This is used to specify a prefix that will be applied to all generated C and C++ typedef names (note: for C++, the prefix is applied after the standard ‘ASN1T_’ prefix). This can be used to prevent name clashes if multiple modules are involved in a compilation and they all contain common names. |
<enumPrefix> </enumPrefix> | prefix text | This is used to specify a prefix that will be applied to all generated enumerated identifiers within a module. This can be used to prevent name clashes if multiple modules are involved in a compilation. (note: this attribute is normally not needed for C++ enumerated identifiers because they are already wrapped in a structure to allows the type name to be used as an additional identifier). |
<valuePrefix> </valuePrefix> | prefix text | This is used to specify a prefix that will be applied to all generated value constants within a module. This can be used to prevent name clashes if multiple modules are involved that use a common name for two or more different value declarations. |
<classPrefix> </classPrefix> | prefix text | This is used to specify a prefix that will be applied to all generated items in a module derived from an ASN.1 CLASS definition. |
<objectPrefix> </objectPrefix> | prefix text | This is used to specify a prefix that will be applied to all generated items in a module derived from an ASN.1 Information Object definition. |
<objectsetPrefix> </objectsetPrefix> | prefix text | This is used to specify a prefix that will be applied to all generated items in a module derived from an ASN.1 Information Object Set definition. |
<noPDU/> | n/a | Indicates that this module contains no PDU definitions. This is normally true in modules that are imported to get common type definitions (for example, InformationFramework). This will prevent the C++ version of the compiler from generating any control class definitions for the types in the module. |
<intCType> | int8, uint8, int16, uint16, int32, uint32, int64, uint64, string | This is used to specify a specific C integer type be used for all unconstrained integer types. By default, ASN1C will use the int32 (32-bit integer) type for all unconstrained integers. |
<arcCType> | int32, int64 | The is used to specify a specific C integer type be used for the arc types in Object Identifier definitions. By default, int32 (32-bit integer arc values) are generated. |
<namespace> </namespace> | namespace URI | This is used to specify the target namespace for the given module when generating XSD and/or XML code. By default, the compiler will not include a targetNamespace directive in the generated XSD code (i.e. all items will not be assigned to any namespace). This option only has meaning when used with the - xml / -xsd command line options. |
<hFile> </hFile> | C/C++ header filename | This is used to specify the name of a C/C++ header file to be used to store generated definitions for the module. By default, the header file name is set to the ASN.1 name of the module with '.h' appended to the end. |
<alias asn1name="name" codename="name"/> | ASN.1 to computer language name mapping | This item allows a name in the ASN.1 specification being compiled to be mapped to an alternate name in the generated computer language files. The primary use is to allow shorter names to be used in places where a combination of names may be very long. In this release, the only names that can be used in the alias statement are information object set names. |