INTEGER Value

The INTEGER type causes a #define statement to be generated in the header file of the form ASN1V_<valueName> where <valueName> would be replaced with the name in the ASN.1 source file. The reason for doing this is the common use of INTEGER values for size and value range constraints in the ASN.1 specifications. By generating #define statements, the symbolic names can be included in the source code making it easier to adjust the boundary values.

This mapping is defined as follows:

ASN.1 production:

   <name> INTEGER ::= <value>

Generated code:

   #define ASN1V_<name> <value>;

For example, the following declaration:

   ivalue INTEGER ::= 5

will cause the following statement to be added to the generated header file:

   #define ASN1V_ivalue 5

The reason the ASN1V_ prefix is added is to prevent collisions with INTEGER value declarations and other declarations such as enumeration items with the same name.