Production Level

These attributes can be applied at the production level by including them within a <production> section:

Name Values Description

<name> 
   </name>

production name This attribute identifies the production (type) to which this section applies. It is required.
<addarg name="name" type="type" func="encode|decode"/> Argument name, type, and function specified using attributes. This item adds an argument to the generated C encode and/or decode function. The name and C type of the argument are specified in the name and type attributes respectively. The func attribute is optional and only required if the argument should be added to either the encode or decode function only. By default, the argument is added to both the encode and decode function. This item is only supported for C 3GPP layer 3 code generation.
<aligned/> n/a This item is used to specify that byte alignment is to be done after encoding or decoding an instance of the targeted type. This item is only supported for C 3GPP layer 3 code generation.
<cDecFuncName> </cDecFuncName> <C source file name This item is used to substitute the C source code contained within the given file for what would have been generated for the C decode function for the given type. The current include path is searched for the given filename. This item is only supported for C 3GPP layer 3 code generation.
<cEncFuncName> </cEncFuncName> <C source file name This item is used to substitute the C source code contained within the given file for what would have been generated for the C encode function for the given type. The current include path is searched for the given filename. This item is only supported for C 3GPP layer 3 code generation.
<ctype> int8, uint8, int16, uint16, int32, uint32, int64, uint64, size, string, chararray

This is used to specify a C integer or character string type be used in place of the default definition generated by ASN1C.

In the case of integers, ASN1C will normally use the smallest integer type available based on the value or value range constraint on the INTEGER and if the INTEGER is unconstrained, the int32 (32-bit integer) type will be used. This item allows that behavior to be overridden. Note that if a signed integer type is specified for an INTEGER that is constrained to be non-negative, ASN1C will coerce the type into an unsigned integer type (e.g. int8 would be coerced into uint8). For very large integers, 'string' is used to specify a char* representation. "size" is for OSSIZE, which is a typedef for size_t.

For character string, ASN1C will use a character string pointer (char*) by default. The 'chararray' item can be used on strings with size constrains to specify a static character array variable be used.

<displayFormat lower, upper, ipv4, ipv6, imei, imsi, tbcd, timestamp, text, bits, hex This is used to specify an alternate stringified representation for binary data. All entries except bits and hex are applicable to OCTET STRING types. By default, OCTET STRING data is displayed in hexadecimal text format. The bits and hex entries are used with BIT STRING types. The lower and upper qualifiers also result in hexadecimal text format, but force lower or upper case characters to be used. The ipv4 and ipv6 qualifiers cause the data to be formatted as an IP address. The imei, imsi, and tbcd qualifiers treat the data as being encoded in TBCD format with slight differences in each format type. The timestamp qualifier causes the data to be formatted as a 3GPP timestamp. The text qualifier displays the binary data as ASCII text. The bits qualifier causes bit strings to be displayed in binary form (all 1's and 0's). The hex qualifier causes bit strings with named bits to be displayed in hex instead of with names and values.
<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).
<format> </format> base64, hex, xmllist This is used to set format options specific to XER encoding. The base64 or hex alternative is used to set the output format that binary data in OCTET STRING variables is displayed in in XML markup. The xmllist alternative is used with SEQUENCE OF or SET OF types to denote that items should be displayed in XML space-separated list format as opposed to a using a separate element for each list item.
<is3GExtList pre-eol="0|1" post-eol="0|1"/> n/a This item specifies that this production will be modelled as a 3G extended list. This can only be applied to SEQUENCE OF productions. It is used in 3G layer 3 messages when the extension of a repeating type is controlled by an extension bit that occurs either before or after the record. If the pre-eol attribute (short for "preceding end-of-list") is specified, it indicate a bit before the record signals whether another record follows. The value (0 or 1) indicates which bit value signal end-of-list. The post-eol attribute is the same except that it indicates the control bit follows after the record. This item is only supported for C 3GPP layer 3 code generation.
<is3GMessage/> n/a This item specifies that this production represents a 3G layer 3 message type as opposed to a 3G layer 3 information element (IE). This item is only supported for C 3GPP layer 3 code generation.
<isBigInteger/> n/a This item specifies that this production will be used to store an integer larger than the C or C++ int type on the given system (normally 32 bits). A C string type (char*) will be used to hold a textual representation of the value. This qualifier can be applied to either an integer or constructed type. If constructed, all integer elements within the constructed type are flagged as big integers.
<isOpenType/> n/a This item is used to indicate that any element of this type will be decoded as an open type (i.e. skipped). Refer to the section on deferred decoding for further information. Note that this variable can only be used with BER, CER, or DER encoding rules.
<isPDU/> n/a This item is used to indicate that this production represents a Protocol Data Unit (PDU). This is defined as a production that will be encoded or decoded from within the application code. This attribute only makes a difference in the generation of C++ classes. Control classes that are only used in the application code are only generated for types with this attribute set.
<isPLMNidentity/> n/a

This flag identifies the production as a PLMNidentity. Any production so identified will be treated as an OCTET STRING, regardless of how the production might be defined in the ASN.1.

<isTBCDString/> n/a This item is used to indicate that this production is to be encoded and decoded as a telephony binary coded string (TBCD). This is type is not part of the ASN.1 standards but is a widely used encoding format in telephony applications.
<length fixed-size="number"/> n/a This item is used to configure a length field in an OCTET STRING type for 3GPP layer 3 messages. By default, a length field is a single byte, but there are occasions where the field width may be different. This allows a fixed-size encoded field width to be specified. The most common values are 0 (no length field) or 2.
<noDecoder/> n/a Indicates that no decode function should be generated for this production. This item is only supported for C 3GPP layer 3 code generation.
<noEncoder/> n/a Indicates that no encode function should be generated for this production. This item is only supported for C 3GPP layer 3 code generation.
<setvar name="name" value="value"/> n/a This item is used within encode and decode functions to set a given variable within a generated structure to the given value. Normally it is used in conjunction with the 'addarg' configuration item to set a variable to value of an additional argument passed into a function. This item is only supported for C 3GPP layer 3 code generation.
<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 the generated C or C++ type for the given production.
<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.