|
|
 |
 |
|
Detailed Description
PER runtime library decode functions handle the decoding of the primitive ASN.1 data types and length variables. Calls to these functions are assembled in the C source code generated by the ASN1C complier to decode complex ASN.1 structures. These functions are also directly callable from within a user's application program if the need to decode a primitive item exists.
The procedure to decode a primitive data item is as follows:
- Call the pu_newContext or pu_initContext function to specify the address of the buffer containing the encoded ASN.1 data to be decoded and whether the data is aligned, or unaligned.
- Call the specific decode function to decode the value.
|
Defines |
| #define | pd_UnconsInteger(ctxt_p, pvalue) pd_SemiConsInteger(ctxt_p, pvalue, ASN1INT_MIN) |
| #define | pd_UnconsUnsigned(ctxt_p, pvalue) pd_SemiConsUnsigned(ctxt_p, pvalue, 0U) |
| #define | pd_UnconsInt64(ctxt_p, pvalue) pd_SemiConsInt64(ctxt_p, pvalue, ASN1INT64MIN) |
| #define | pd_UnconsUInt64(ctxt_p, pvalue) pd_SemiConsUInt64(ctxt_p, pvalue, 0) |
Functions |
| int | pd_bit (ASN1CTXT *ctxt_p, ASN1BOOL *pvalue) |
| int | pd_bits (ASN1CTXT *ctxt_p, ASN1UINT *pvalue, ASN1UINT nbits) |
| int | pd_BigInteger (ASN1CTXT *ctxt_p, ASN1ConstCharPtr *ppvalue) |
| int | pd_BitString (ASN1CTXT *ctxt_p, ASN1UINT *numbits_p, ASN1OCTET *buffer, ASN1UINT bufsiz) |
| int | pd_BMPString (ASN1CTXT *ctxt_p, ASN1BMPString *pvalue, Asn116BitCharSet *permCharSet) |
| int | pd_UniversalString (ASN1CTXT *ctxt_p, ASN1UniversalString *pvalue, Asn132BitCharSet *permCharSet) |
| int | pd_byte_align (ASN1CTXT *ctxt_p) |
| int | pd_ChoiceOpenTypeExt (ASN1CTXT *ctxt_p, ASN1ConstOctetPtr *object_p2, ASN1UINT *numocts_p) |
| int | pd_ConsInteger (ASN1CTXT *ctxt_p, ASN1INT *pvalue, ASN1INT lower, ASN1INT upper) |
| int | pd_ConsInt8 (ASN1CTXT *ctxt_p, ASN1INT8 *pvalue, ASN1INT lower, ASN1INT upper) |
| int | pd_ConsInt16 (ASN1CTXT *ctxt_p, ASN1SINT *pvalue, ASN1INT lower, ASN1INT upper) |
| int | pd_ConsInt64 (ASN1CTXT *ctxt_p, ASN1INT64 *pvalue, ASN1INT64 lower, ASN1INT64 upper) |
| int | pd_ConsUnsigned (ASN1CTXT *ctxt_p, ASN1UINT *pvalue, ASN1UINT lower, ASN1UINT upper) |
| int | pd_ConsUInt8 (ASN1CTXT *ctxt_p, ASN1UINT8 *pvalue, ASN1UINT lower, ASN1UINT upper) |
| int | pd_ConsUInt16 (ASN1CTXT *ctxt_p, ASN1USINT *pvalue, ASN1UINT lower, ASN1UINT upper) |
| int | pd_ConsUInt64 (ASN1CTXT *ctxt_p, ASN1UINT64 *pvalue, ASN1UINT64 lower, ASN1UINT64 upper) |
| int | pd_ConsWholeNumber (ASN1CTXT *ctxt_p, ASN1UINT *padjusted_value, ASN1UINT range_value) |
| int | pd_ConsWholeNumber64 (ASN1CTXT *ctxt_p, ASN1UINT64 *padjusted_value, ASN1UINT64 range_value) |
| int | pd_ConstrainedString (ASN1CTXT *ctxt_p, ASN1ConstCharPtr *string, Asn1CharSet *pCharSet) |
| int | pd_ConstrainedStringEx (ASN1CTXT *ctxt_p, ASN1ConstCharPtr *string, ASN1ConstCharPtr charSet, ASN1UINT abits, ASN1UINT ubits, ASN1UINT canSetBits) |
| int | pd_16BitConstrainedString (ASN1CTXT *ctxt_p, Asn116BitCharString *pString, Asn116BitCharSet *pCharSet) |
| int | pd_32BitConstrainedString (ASN1CTXT *ctxt_p, Asn132BitCharString *pString, Asn132BitCharSet *pCharSet) |
| int | pd_DynBitString (ASN1CTXT *ctxt_p, ASN1DynBitStr *pBitStr) |
| int | pd_DynOctetString (ASN1CTXT *ctxt_p, ASN1DynOctStr *pOctStr) |
| int | pd_GetComponentLength (ASN1CTXT *ctxt_p, ASN1UINT itemBits) |
| int | pd_Length (ASN1CTXT *ctxt_p, ASN1UINT *pvalue) |
| int | pd_moveBitCursor (ASN1CTXT *ctxt_p, int bitOffset) |
| int | pd_ObjectIdentifier (ASN1CTXT *ctxt_p, ASN1OBJID *pvalue) |
| int | pd_oid64 (ASN1CTXT *ctxt_p, ASN1OID64 *pvalue) |
| int | pd_RelativeOID (ASN1CTXT *ctxt_p, ASN1OBJID *pvalue) |
| int | pd_OctetString (ASN1CTXT *ctxt_p, ASN1UINT *numocts_p, ASN1OCTET *buffer, ASN1UINT bufsiz) |
| int | pd_OpenType (ASN1CTXT *ctxt_p, ASN1ConstOctetPtr *object_p2, ASN1UINT *numocts_p) |
| int | pd_OpenTypeExt (ASN1CTXT *ctxt_p, ASN1ConstOctetPtr *object_p2, ASN1UINT *numocts_p) |
| int | pd_Real (ASN1CTXT *ctxt_p, ASN1REAL *pvalue) |
| int | pd_SmallNonNegWholeNumber (ASN1CTXT *ctxt_p, ASN1UINT *pvalue) |
| int | pd_SemiConsInteger (ASN1CTXT *ctxt_p, ASN1INT *pvalue, ASN1INT lower) |
| int | pd_SemiConsUnsigned (ASN1CTXT *ctxt_p, ASN1UINT *pvalue, ASN1UINT lower) |
| int | pd_SemiConsInt64 (ASN1CTXT *ctxt_p, ASN1INT64 *pvalue, ASN1INT64 lower) |
| int | pd_SemiConsUInt64 (ASN1CTXT *ctxt_p, ASN1UINT64 *pvalue, ASN1UINT64 lower) |
| int | pd_VarWidthCharString (ASN1CTXT *pctxt, ASN1ConstCharPtr *pvalue) |
Define Documentation
| #define pd_UnconsInt64 |
( |
ctxt_p, |
|
|
pvalue |
|
) |
pd_SemiConsInt64(ctxt_p, pvalue, ASN1INT64MIN) |
|
|
|
This function will decode an unconstrained 64-bit integer.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to 64-bit integer variable to receive decoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| #define pd_UnconsInteger |
( |
ctxt_p, |
|
|
pvalue |
|
) |
pd_SemiConsInteger(ctxt_p, pvalue, ASN1INT_MIN) |
|
|
|
This function will decode an unconstrained integer.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to integer variable to receive decoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| #define pd_UnconsUInt64 |
( |
ctxt_p, |
|
|
pvalue |
|
) |
pd_SemiConsUInt64(ctxt_p, pvalue, 0) |
|
|
|
This function will decode an unconstrained unsigned 64-bit integer.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to unsigned 64-bit integer variable to receive decoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| #define pd_UnconsUnsigned |
( |
ctxt_p, |
|
|
pvalue |
|
) |
pd_SemiConsUnsigned(ctxt_p, pvalue, 0U) |
|
|
|
This function will decode an unconstrained unsigned integer.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to unsigned integer variable to receive decoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
Function Documentation
| int pd_16BitConstrainedString |
( |
ASN1CTXT * |
ctxt_p, |
|
|
Asn116BitCharString * |
pString, |
|
|
Asn116BitCharSet * |
pCharSet |
|
) |
|
|
|
|
This function will encode a constrained ASN.1 character string. This function is normally not called directly but rather is called from Useful Type Character String encode functions that deal with 16-bit strings. The only function that does not release is the pe_BMPString function.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| pString | Character string to be encoded. The structure includes a count field containing the number of characters to encode and an array of unsigned short integers to hold the 16-bit characters to be encoded. |
| pCharSet | Pointer to the constraining character set. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_32BitConstrainedString |
( |
ASN1CTXT * |
ctxt_p, |
|
|
Asn132BitCharString * |
pString, |
|
|
Asn132BitCharSet * |
pCharSet |
|
) |
|
|
|
|
This function will encode a constrained ASN.1 character string. This function is normally not called directly but rather is called from Useful Type Character String encode functions that deal with 32-bit strings. The only function that does not release is the pe_UniversalString function.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| pString | Character string to be encoded. The structure includes a count field containing the number of characters to encode and an array of unsigned short integers to hold the 32-bit characters to be encoded. |
| pCharSet | Pointer to the constraining character set. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_BigInteger |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1ConstCharPtr * |
ppvalue |
|
) |
|
|
|
|
This function decodes a variable of the ASN.1 INTEGER type. In this case, the integer is assumed to be of a larger size than can fit in a C or C++ long type (normally 32 or 64 bits). For example, parameters used to calculate security values are typically larger than these sizes. These variables are stored in character string constant variables. They are represented as hexadecimal strings starting with "0x" prefix. If it is necessary to convert a hexadecimal string to another radix, then use the rtBigIntSetStr / rtBigIntToString functions.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| ppvalue | Pointer to a character pointer variable to receive the decoded unsigned value. Dynamic memory is allocated for the variable using the rtMemAlloc function. The decoded variable is represented as a decimal string starting with no prefix. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_bit |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1BOOL * |
pvalue |
|
) |
|
|
|
|
This function will decode a single bit a place the result in an ASN.1 BOOLEAN type variable.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| pvalue | A pointer to the BOOLEAN value to receive the decoded result. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_bits |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT * |
pvalue, |
|
|
ASN1UINT |
nbits |
|
) |
|
|
|
|
This function will decode a series of multiple bits and place the results in an unsigned integer variable.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| pvalue | A pointer to an unsigned integer variable to receive the decoded result. |
| nbits | The number of bits to decode. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_BitString |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT * |
numbits_p, |
|
|
ASN1OCTET * |
buffer, |
|
|
ASN1UINT |
bufsiz |
|
) |
|
|
|
|
This function will decode a value of the ASN.1 bit string type whose maximum size is is known in advance. The ASN1C complier generates a call to this function to decode bit string productions or elements that contain a size constraint.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| numbits_p | Pointer to an unsigned integer variable to receive decoded number of bits. |
| buffer | Pointer to a fixed-size or pre-allocated array of bufsiz octets to receive a decoded bit string. |
| bufsiz | Length (in octets) of the buffer to receive the decoded bit string. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_BMPString |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1BMPString * |
pvalue, |
|
|
Asn116BitCharSet * |
permCharSet |
|
) |
|
|
|
|
This function will decode a variable of the ASN.1 BMP character string. This differs from the decode routines for the character strings previously described in that the BMP string type is based on 16-bit characters. A 16-bit character string is modeled using an array of unsigned short integers.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| pvalue | Pointer to character string structure to receive the decoded result The structure includes a count field containing the number of characters and an array of unsigned short integers to hold the 16-bit character values. |
| permCharSet | A pointer to the constraining character set. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_byte_align |
( |
ASN1CTXT * |
ctxt_p |
) |
|
|
|
|
This function will position the decode bit cursor on the next byte boundary.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ChoiceOpenTypeExt |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1ConstOctetPtr * |
object_p2, |
|
|
ASN1UINT * |
numocts_p |
|
) |
|
|
|
|
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| object_p2 | A pointer to an open type variable to receive the decoded data. |
| numocts_p | A pointer to an unsigned buffer of bufsiz octets to receive decoded data. |
|
| int pd_ConsInt16 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1SINT * |
pvalue, |
|
|
ASN1INT |
lower, |
|
|
ASN1INT |
upper |
|
) |
|
|
|
|
This function will decode a 16-bit integer constrained either by a value or value range constraint.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to 16-bit integer variable to receive decoded value. |
| lower | Lower range value. |
| upper | Upper range value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConsInt64 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1INT64 * |
pvalue, |
|
|
ASN1INT64 |
lower, |
|
|
ASN1INT64 |
upper |
|
) |
|
|
|
|
This function will decode a 64-bit integer constrained either by a value or value range constraint.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to 64-bit integer variable to receive decoded value. |
| lower | Lower range value, represented as 64-bit integer. |
| upper | Upper range value, represented as 64-bit integer. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConsInt8 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1INT8 * |
pvalue, |
|
|
ASN1INT |
lower, |
|
|
ASN1INT |
upper |
|
) |
|
|
|
|
This function will decode an 8-bit integer constrained either by a value or value range constraint.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to 8-bit integer variable to receive decoded value. |
| lower | Lower range value. |
| upper | Upper range value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConsInteger |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1INT * |
pvalue, |
|
|
ASN1INT |
lower, |
|
|
ASN1INT |
upper |
|
) |
|
|
|
|
This function will decode an integer constrained either by a value or value range constraint.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to integer variable to receive decoded value. |
| lower | Lower range value. |
| upper | Upper range value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConstrainedString |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1ConstCharPtr * |
string, |
|
|
Asn1CharSet * |
pCharSet |
|
) |
|
|
|
|
This function decodes a constrained string value. This is a deprecated version of the function provided for backward compatibility.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| string | Pointer to const char* to receive decoded string. Memory will be allocated for this variable using internal memory management functions. |
| pCharSet | Pointer to a character set descriptor structure. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConstrainedStringEx |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1ConstCharPtr * |
string, |
|
|
ASN1ConstCharPtr |
charSet, |
|
|
ASN1UINT |
abits, |
|
|
ASN1UINT |
ubits, |
|
|
ASN1UINT |
canSetBits |
|
) |
|
|
|
|
This function decodes a constrained string value. This version of the function allows all of the required permitted alphabet constraint parameters to be passed in as arguments.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| string | Pointer to const char* to receive decoded string. Memory will be allocated for this variable using internal memory management functions. |
| charSet | String containing permitted alphabet character set. Can be null if no character set was specified. |
| abits | Number of bits in a character set character (aligned). |
| ubits | Number of bits in a character set character (unaligned). |
| canSetBits | Number of bits in a character from the canonical set representing this string. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConsUInt16 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1USINT * |
pvalue, |
|
|
ASN1UINT |
lower, |
|
|
ASN1UINT |
upper |
|
) |
|
|
|
|
This function will decode a 16-bit unsigned integer constrained either by a value or value range constraint.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to 16-bit unsigned integer variable to receive decoded value. |
| lower | Lower range value. |
| upper | Upper range value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConsUInt64 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT64 * |
pvalue, |
|
|
ASN1UINT64 |
lower, |
|
|
ASN1UINT64 |
upper |
|
) |
|
|
|
|
This function will decode a 64-bit unsigned integer constrained either by a value or value range constraint.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to 64-bit unsigned integer variable to receive decoded value. |
| lower | Lower range value. |
| upper | Upper range value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConsUInt8 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT8 * |
pvalue, |
|
|
ASN1UINT |
lower, |
|
|
ASN1UINT |
upper |
|
) |
|
|
|
|
This function will decode an 8-bit unsigned integer constrained either by a value or value range constraint.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to 8-bit unsigned integer variable to receive decoded value. |
| lower | Lower range value. |
| upper | Upper range value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConsUnsigned |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT * |
pvalue, |
|
|
ASN1UINT |
lower, |
|
|
ASN1UINT |
upper |
|
) |
|
|
|
|
This function will decode an unsigned integer constrained either by a value or value range constraint.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to unsigned integer variable to receive decoded value. |
| lower | Lower range value. |
| upper | Upper range value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConsWholeNumber |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT * |
padjusted_value, |
|
|
ASN1UINT |
range_value |
|
) |
|
|
|
|
This function decodes a constrained whole number as specified in Section 10.5 of the X.691 standard.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| padjusted_value | Pointer to unsigned adjusted integer value to receive decoded result. To get the final value, this value is added to the lower boundary of the range. |
| range_value | Unsigned integer value specifying the total size of the range. This is obtained by subtracting the lower range value from the upper range value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_ConsWholeNumber64 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT64 * |
padjusted_value, |
|
|
ASN1UINT64 |
range_value |
|
) |
|
|
|
|
This function decodes a constrained whole number as specified in Section 10.5 of the X.691 standard, represented as 64-bit integer.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| padjusted_value | Pointer to 64-bit unsigned adjusted integer value to receive decoded result. To get the final value, this value is added to the lower boundary of the range. |
| range_value | Unsigned 64-bit integer value specifying the total size of the range. This is obtained by subtracting the lower range value from the upper range value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_DynBitString |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1DynBitStr * |
pBitStr |
|
) |
|
|
|
|
This function will decode a variable of thr ASN.1 BIT STRING type. This function allocates dynamic memory t store the decoded result. The ASN1C complier generates a call to this function to decode an unconstrained bit string production or element.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| pBitStr | Pointer to a dynamic bit string structure to receive the decoded result. This structure contains a field to hold the number of decoded bits and a pointer to an octet string to hold the decoded data. Memory is allocated by the decoder using the rtMemAlloc function. This memory is tracked within the context and released when the pu_freeContext function is invoked. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_DynOctetString |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1DynOctStr * |
pOctStr |
|
) |
|
|
|
|
This function will decode a value of the ASN.1 octet string type whose maximum size is known in advance. The ASN1C complier generates a call to this function to decode octet string productions or elements that contain a size constraint.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| pOctStr | A pointer to a dynamic octet string to receive the decoded result. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_GetComponentLength |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT |
itemBits |
|
) |
|
|
|
|
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| itemBits | The size of the specific entity. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_Length |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT * |
pvalue |
|
) |
|
|
|
|
This function will decode a length determinant value.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| pvalue | A pointer to an unsigned integer variable to receive the decoded length value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_moveBitCursor |
( |
ASN1CTXT * |
ctxt_p, |
|
|
int |
bitOffset |
|
) |
|
|
|
|
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| bitOffset | The bit offset inside the message buffer. |
|
| int pd_ObjectIdentifier |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1OBJID * |
pvalue |
|
) |
|
|
|
|
This function decodes a value of the ASN.1 object identifier type.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to value to receive decoded result. The ASN1OBJID structure contains an integer to hold the number of subidentifiers and an array to hold the subidentifier values. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_OctetString |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT * |
numocts_p, |
|
|
ASN1OCTET * |
buffer, |
|
|
ASN1UINT |
bufsiz |
|
) |
|
|
|
|
This function will decode a value of the ASN.1 octet string type whose maximun size is known in advance. The ASN1C compiler generates a call to this function to decode octet string productions or elements that contain a size constraint.
- Parameters:
-
| ctxt_p | Pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| numocts_p | A pointer to an unsigned buffer of bufsiz octets to receive decoded data. |
| buffer | A pointer to a pre-allocated buffer of size octets to receive the decoded data. |
| bufsiz | The size of the buffer to receive the decoded result. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_oid64 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1OID64 * |
pvalue |
|
) |
|
|
|
|
This function decodes a value of the ASN.1 object identifier type using 64-bit subidentifiers.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to value to receive decoded result. The ASN1OID64 structure contains an integer to hold the number of subidentifiers and an array of 64-bit unsigned integers to hold the subidentifier values. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_OpenType |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1ConstOctetPtr * |
object_p2, |
|
|
ASN1UINT * |
numocts_p |
|
) |
|
|
|
|
This function will decode an ASN.1 open type. This used to be the ASN.1 ANY type, but now is used in a variety of applications requiring an encoding that can be interpreted by a decoder without prior knowledge of the type of the variable.
- Parameters:
-
| ctxt_p | Pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| numocts_p | A pointer to an unsigned buffer of bufsiz octets to receive decoded data. |
| object_p2 | A pointer to an open type variable to receive the decoded data. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_OpenTypeExt |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1ConstOctetPtr * |
object_p2, |
|
|
ASN1UINT * |
numocts_p |
|
) |
|
|
|
|
This function will decode an ASN.1 open type extension. These are extra fields in a version-2 message that may be present after the ... extension marker. An open type structure (extElem1) is added to a message structure that contains an extension marker but no extension elements. The pd_OpenTypeExt function will populate this structure with the complete extension information (optional bit or choice index, length and data). A subsequent call to pe_OpenTypeExt will cause the saved extension fields to be included in a newly encoded message of the given type.
- Parameters:
-
| ctxt_p | Pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| object_p2 | A pointer to an open type variable to receive the decoded data. |
| numocts_p | A pointer to an unsigned buffer of bufsiz octets to receive decoded data. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_Real |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1REAL * |
pvalue |
|
) |
|
|
|
|
This function will encode a value of the ASN.1 real type. This function provides support for the plus-infinity special real values. Use the rtGetPlusInfinity or the rtGetMinusInfinity functions to get these special values.
- Parameters:
-
| ctxt_p | Pointer to a context structure. This provides a storage area for the function to store all workings variables that must be maintained between function calls. |
| pvalue | Value to be encoded. Special real values and plus and minus infinity are encoded by using the rtGetPlusInfinity and rtGetMinusInfinity functions to set the real value to be encoded. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_RelativeOID |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1OBJID * |
pvalue |
|
) |
|
|
|
|
This function decodes a value of the ASN.1 RELATIVE-OID type.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to value to receive decoded result. The ASN1OBJID structure contains an integer to hold the number of subidentifiers and an array to hold the subidentifier values. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_SemiConsInt64 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1INT64 * |
pvalue, |
|
|
ASN1INT64 |
lower |
|
) |
|
|
|
|
This function will decode a semi-constrained 64-bit integer.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to 64-bit integer variable to receive decoded value. |
| lower | Lower range value, represented as signed 64-bit integer. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_SemiConsInteger |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1INT * |
pvalue, |
|
|
ASN1INT |
lower |
|
) |
|
|
|
|
This function will decode a semi-constrained integer.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to integer variable to receive decoded value. |
| lower | Lower range value, represented as signed integer. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_SemiConsUInt64 |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT64 * |
pvalue, |
|
|
ASN1UINT64 |
lower |
|
) |
|
|
|
|
This function will decode a semi-constrained unsigned 64-bit integer.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to unsigned 64-bit integer variable to receive decoded value. |
| lower | Lower range value, represented as unsigned 64-bit integer. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_SemiConsUnsigned |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT * |
pvalue, |
|
|
ASN1UINT |
lower |
|
) |
|
|
|
|
This function will decode a semi-constrained unsigned integer.
- Parameters:
-
| ctxt_p | Pointer to context block structure. |
| pvalue | Pointer to unsigned integer variable to receive decoded value. |
| lower | Lower range value, represented as unsigned integer. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_SmallNonNegWholeNumber |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UINT * |
pvalue |
|
) |
|
|
|
|
This function will decode a small non-negative whole number as specified in Section 10.6 of the X.691 standard. This is a number that is expected to be small, but whose size is potentially unlimited due to the presence of an extension maker.
- Parameters:
-
| ctxt_p | Pointer to a context structure. This provides a storage area for the function to store all workings variables that must be maintained between function calls. |
| pvalue | Pointer to an unsigned integer value t receive decoded results. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_UniversalString |
( |
ASN1CTXT * |
ctxt_p, |
|
|
ASN1UniversalString * |
pvalue, |
|
|
Asn132BitCharSet * |
permCharSet |
|
) |
|
|
|
|
This function will decode a variable of the ASN.1 32-bit character string. This differs from the decode routines for the character strings previously described because the universal string type is based on 32-bit characters. A 32-bit character string is modeled using an array of unsigned integers.
- Parameters:
-
| ctxt_p | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
| pvalue | Pointer to character string structure to receive the decoded result The structure includes a count field containing the number of characters and an array of unsigned short integers to hold the 32-bit character values. |
| permCharSet | A pointer to the constraining character set. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int pd_VarWidthCharString |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1ConstCharPtr * |
pvalue |
|
) |
|
|
|
|
- Parameters:
-
| pctxt | Pointer to context block structure. |
| pvalue | Pointer to unsigned 64-bit integer variable to receive decoded value. |
|
|
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.
|
This file was last modified on
8 Sep 2005. ASN1C PER Runtime, ASN1C v5.8x |
|