An <element>
section can appear under
a <production>
section, an
<element>
section, or a
<partial-decode-group>
section.
These attributes can be applied at the element level by including them within an
<element>
section:
Name | Values | Description |
---|---|---|
<name> |
element name | This attribute identifies the element within a SEQUENCE, SET, or CHOICE construct to which this section applies. It is required. |
<addarg name="name" func="encode|decode"/> | Argument name, function specified using attributes. | This item adds an argument to the generated C encode and/or decode function that is invoked to encode or decode the element. The name attribute specified the value to be passed. 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 this element. This item is only supported for C 3GPP layer 3 code generation. |
<asn1typename/></asn1typename> | ASN.1 type name | This allows you to specify the ASN.1 name to use for an anonymous type. The anonymous type will be treated as if it were a named type having the given name. |
<cDecSrcName> </cDecSrcName> | <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 decoding the element. The code in this case is not a complete function but rather a snippet to be inserted within a larger function. The current include path is searched for the given filename. This item is only supported for C 3GPP layer 3 code generation. |
<cEncSrcName> </cEncSrcName> | <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 encoding the element. The code in this case is not a complete function but rather a snippet to be inserted within a larger function. 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 specific C type be used in place of the default definition generated by ASN1C. For integer types, the options are the same as at the production level. For character string types, 'chararray' is used to specify a static character array instead of a character pointer type (char*). This can only be done if the string type contains a size constraint. |
<end3GExtElem name="element name"/> | <Element name> attribute | This item is used to delimit a group of optional elements that start with an 'ext' boolean element. A common pattern in the specification of 3GPP IE's is to include an extension bit to signal the presence or absence of group of elements (these normally comprise a single octet). This is essentially an alternative way to specify an optional element group in ASN.1. This item is only supported for C 3GPP layer 3 code generation. |
<iei format="t|tv|tlv" length="length"/> | IEI hex value | This item is used to indicate an element is part of the non-imperative part 3GPP layer 3 message. These are optional elements with single byte tags. The tag is the IEI hex value specified at the value of the item. The format attribute specifies if the item is a tag (t), tag/value (tv), or tag/length/value (tlv). The length attribute is only required if format if tv to specify the length of the value. This item is only supported for C 3GPP layer 3 code generation. |
<inline/> | n/a | This item is used to indicate that code generated for a nested item within a constructed type should be expanded inline rather than pulled out to create a separate new type. |
<is3GExtList pre-eol="0|1" post-eol="0|1"/> | n/a | This item specifies that this element will be modelled as a 3G extended list. This can only be applied to elements of type SEQUENCE OF. 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. |
<is3GLength bitFieldSize="nbits" units="bits|bytes"/> | n/a | This item is used to mark an element as a 3GPP length field element. Normally this an element with the name 'length' of type INTEGER that is the first element in a SEQUENCE. This indicates special processing should be done on the element. On encode, any value populated in this field will be ignored and the actual length of the encoded data will be calculated and populated in this field after encoding is complete. On decode, this element is used to determine when end of message occurs. The 'bitFieldLength' attribute is used to specify the field size if it not an even octet (8 bits). The 'units' attribute specifies the units stored in the length field (bits or bytes). This item is only supported for C 3GPP layer 3 code generation. |
<is3GVarLenList lengthElem="name"/> | n/a | This item specifies that this element will be modelled as a 3G variable length list. This can only be applied to elements of type SEQUENCE OF. It is used in 3G layer 3 messages when a length element is used to determine the number of items in the list. The 'lengthElem' attribute specifies the element within the structure that contains this count. This item is only supported for C 3GPP layer 3 code generation. |
<isBigInteger/> | n/a | This item specifies that this element 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 flag variable specifies that this element 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. |
<length fixed-size="number" expr="@-notation-expr" unusedBits="@-notation-expr"/> | n/a |
This item is used to configure a length field for an OCTET STRING, SEQUENCE OF, TBCD or GSM string type, for 3GPP layer 3 messages. This item is only supported for C 3GPP layer 3 code generation. The fixed-size attribute is used to specify the size of a length field that immediately precedes the related type. By default, length fields are assumed to be a single byte, but other sizes are possible. The value 0 indicates there is no length field (the value ends when the enclosing IE ends). Another common value is 2, for a two-byte length field. The expr attribute identifies another field that provides the length. This uses the @-notation used for table constraints and can be a simple expression using + or - operators. The unusedBits attribute identifies a field that provides the number of unused bits for a GSM string. It uses the same format as the expr attribute. |
<notUsed/> | n/a | This flag variable specifies that this element will not be used at all in the generated code. It can only be applied to optional elements within a SEQUENCE or SET, or to elements within a CHOICE. Its purpose is for production of more compact code by allowing users to configure out items that are of no interest to them. |
<notUsedSkip/> | n/a | This is the same as <notUsed/> except that it tells the compiler to generate skip functions when necessary. Skip functions are used for skipping over values of a type during decoding, rather than reporting an error if that type should happen to be encountered in the encoding. |
<notUsedDecode/> | n/a | Similar to the notUsed flag, except that rather than indicating the element is not used at all, it indicates the element is not used for decoding (i.e. it is still used for encoding). This can be useful for reducing the amount of generated code, when used in conjuction with a production level <include/> (which see). It signals that the element's type does not require a decode function for the sake of this element. |
<notUsedDecodeSkip/> | n/a | This is the same as <notUsedDecode/> except that it tells the compiler to generate skip functions when necessary. Skip functions are used for skipping over values of a type during decoding, rather than reporting an error if that type should happen to be encountered in the encoding. |
<notUsedEncode/> | n/a | The encoding complement to <notUsedDecode/> |
<partial-decode name="name"> | n/a | This item is used to indicate the ASN.1 element is targeted for partial decoding. This is currently only supported for C/C++ PER. Refer to the section "Generated C/C++ Files and Partial Decoding" for more information. |
<perEncoding> </perEncoding> | hex data | This variable allows a user to substitute a known binary PER encoding for the given element. This encoding will be inserted into the encoded data stream on encoding and skipped over on decoding. Its purpose is the production of more compact and faster code for PER by bypassing run-time calculations needed to encode or decode variable data. |
<selector element="name" value="value"/> | n/a | This item is used to configure an element within a CHOICE in a 3GPP layer 3 message. It specifies the value of another element within the container type which selects this element. The 'element' field specifies the name of the element within the container type and 'value' specifies the value. 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 this element. |
<testValue> </testValue> | An ASN.1 value or keyword Rand or None. | This item is used to set a pre-determined value for test code generation. Its main use is to set relational table constraint key values to force generation of code for specific instance. The Rand keyword can be used with CHOICE elements to force generation of random code for a given alternative. |