Asn1CEventHandler
[C++ Run-Time Classes]

Classes

struct  Asn1NamedCEventHandler

Typedefs

typedef void(* rtxStartElement )(const char *name, int idx)
typedef void(* rtxEndElement )(const char *name, int idx)
typedef void(* rtxBoolValue )(OSBOOL value)
typedef void(* rtxIntValue )(OSINT32 value)
typedef void(* rtxUIntValue )(OSUINT32 value)
typedef void(* rtxInt64Value )(OSINT64 value)
typedef void(* rtxUInt64Value )(OSUINT64 value)
typedef void(* rtxBitStrValue )(OSUINT32 numbits, const OSOCTET *data)
typedef void(* rtxOctStrValue )(OSUINT32 numocts, const OSOCTET *data)
typedef void(* rtxCharStrValue )(const char *value)
typedef void(* rtxCharStrValue16Bit )(OSUINT32 nchars, OSUNICHAR *data)
typedef void(* rtxCharStrValue32Bit )(OSUINT32 nchars, OS32BITCHAR *data)
typedef void(* rtxNullValue )(void)
typedef void(* rtxOidValue )(OSUINT32 numSubIds, OSUINT32 *pSubIds)
typedef void(* rtxRealValue )(double value)
typedef void(* rtxEnumValue )(OSUINT32 value, const OSUTF8CHAR *text)
typedef void(* rtxOpenTypeValue )(OSUINT32 numocts, const OSOCTET *data)
typedef int(* rtErrorHandler )(OSCTXT *pctxt, ASN1CCB *pCCB, int stat)
typedef struct
Asn1NamedCEventHandler 
Asn1NamedCEventHandler

Functions

void rtAddEventHandler (OSCTXT *pCtxt, Asn1NamedCEventHandler *pHandler)
void rtRemoveEventHandler (OSCTXT *pCtxt, Asn1NamedCEventHandler *pHandler)
void rtSetErrorHandler (OSCTXT *pctxt, rtErrorHandler pErrCB)
void rtRemoveErrorHandler (OSCTXT *pctxt)
int rtInvokeErrorHandler (OSCTXT *pctxt, ASN1CCB *pCCB, int stat)
void rtInvokeStartElement (OSCTXT *pCtxt, const char *name, int idx)
void rtInvokeEndElement (OSCTXT *pCtxt, const char *name, int idx)
void rtInvokeBoolValue (OSCTXT *pCtxt, OSBOOL value)
void rtInvokeIntValue (OSCTXT *pCtxt, OSINT32 value)
void rtInvokeUIntValue (OSCTXT *pCtxt, OSUINT32 value)
void rtInvokeInt64Value (OSCTXT *pCtxt, OSINT64 value)
void rtInvokeUInt64Value (OSCTXT *pCtxt, OSUINT64 value)
void rtInvokeBitStrValue (OSCTXT *pCtxt, OSUINT32 numbits, const OSOCTET *data)
void rtInvokeOctStrValue (OSCTXT *pCtxt, OSUINT32 numocts, const OSOCTET *data)
void rtInvokeCharStrValue (OSCTXT *pCtxt, const char *value)
void rtInvokeCharStr16BitValue (OSCTXT *pCtxt, OSUINT32 nchars, OSUNICHAR *data)
void rtInvokeCharStr32BitValue (OSCTXT *pCtxt, OSUINT32 nchars, OS32BITCHAR *data)
void rtInvokeNullValue (OSCTXT *pCtxt)
void rtInvokeOidValue (OSCTXT *pCtxt, OSUINT32 numSubIds, OSUINT32 *pSubIds)
void rtInvokeRealValue (OSCTXT *pCtxt, double value)
void rtInvokeEnumValue (OSCTXT *pCtxt, OSUINT32 value, const OSUTF8CHAR *text)
void rtInvokeOpenTypeValue (OSCTXT *pCtxt, OSUINT32 numocts, const OSOCTET *data)

Detailed Description

Asn1CEventHandler is a structure typed used for user-defined event handlers.


Typedef Documentation

This is a basic C based event handler structure, which can be used to define user-defined event handlers.

typedef int(* rtErrorHandler)(OSCTXT *pctxt, ASN1CCB *pCCB, int stat)

This is a function pointer for a callback function which is invoked from within a decode function when an error occurs. This allows users to intercept errors in decoding and recover from them.

Parameters:
pctxt Pointer to an OSCTXT data structure.
pCCB Pointer to an ASN1CCB data structure; this is the context control block that contains information pertinent to parsing data in an ASN.1 message.
stat The error status.
Returns:
The new error status.
typedef void(* rtxBitStrValue)(OSUINT32 numbits, const OSOCTET *data)

This is a function pointer for a callback function which is invoked from within a decode function when a value of the BIT STRING ASN.1 type is parsed.

Parameters:
numbits - Number of bits in the parsed value.
data - Pointer to a byte array that contains the bit string data.
Returns:
- none
typedef void(* rtxBoolValue)(OSBOOL value)

This is a function pointer for a callback function which is invoked from within a decode function when a value of the BOOLEAN ASN.1 type is parsed.

Parameters:
value Parsed value.
Returns:
- none
typedef void(* rtxCharStrValue)(const char *value)

This is a function pointer for a callback function which is invoked from within a decode function when a value of one of the 8-bit ASN.1 character string types is parsed.

Parameters:
value Null terminated character string value.
Returns:
- none
typedef void(* rtxCharStrValue16Bit)(OSUINT32 nchars, OSUNICHAR *data)

This is a function pointer for a callback function which is invoked from within a decode function when a value of one of the 16-bit ASN.1 character string types is parsed.

This is used for the ASN.1 BmpString type.

Parameters:
nchars Number of characters in the parsed value.
data Pointer to an array containing 16-bit values. These are represented using unsigned short integer values.
Returns:
- none
typedef void(* rtxCharStrValue32Bit)(OSUINT32 nchars, OS32BITCHAR *data)

This is a function pointer for a callback function which is invoked from within a decode function when a value of one of the 32-bit ASN.1 characer string types is parsed.

This is used for the ASN.1 UniversalString type.

Parameters:
nchars Number of characters in the parsed value.
data Pointer to an array containing 32-bit values. Each 32-bit integer value is a universal character.
Returns:
- none
typedef void(* rtxEndElement)(const char *name, int idx)

This is a function pointer for a callback function which is invoked from within a decode function when parsing is complete on an element of a SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE construct.

Parameters:
name For SEQUENCE, SET, or CHOICE, this is the name of the element as defined in the ASN.1 defination. For SEQUENCE OF or SET OF, this is set to the name "element".
idx For SEQUENCE, SET, or CHOICE, this is not used and is set to the value -1. For SEQUENCE OF or SET OF, this contains the zero-based index of the element in the conceptual array associated with the construct.
Returns:
- none
typedef void(* rtxEnumValue)(OSUINT32 value, const OSUTF8CHAR *text)

This is a function pointer for a callback function which is invoked from within a decode function when a value of the ENUMERATED ASN.1 type is parsed.

Parameters:
value - Parsed enumerated value
text - Textual value of the enumerated identifier
Returns:
- none
typedef void(* rtxInt64Value)(OSINT64 value)

This is a function pointer for a callback function which is invoked from within a decode function when a value of the 64-bit INTERGER ASN.1 type is parsed.

Parameters:
value Parsed value.
Returns:
- none
typedef void(* rtxIntValue)(OSINT32 value)

This is a function pointer for a callback function which is invoked from within a decode function when a value of the INTERGER ASN.1 type is parsed.

Parameters:
value Parsed value.
Returns:
- none
typedef void(* rtxNullValue)(void)

This is a function pointer for a callback function which is invoked from within a decode function when a value of the NULL ASN.1 type is parsed.

Parameters:
- none
Returns:
- none
typedef void(* rtxOctStrValue)(OSUINT32 numocts, const OSOCTET *data)

This is a function pointer for a callback function which is invoked from within a decode function when a value of one of the OCTET STRING ASN.1 type is parsed.

Parameters:
numocts Number of octets in the parsed value.
data Pointer to byte array containing the octet string data.
Returns:
- none
typedef void(* rtxOidValue)(OSUINT32 numSubIds, OSUINT32 *pSubIds)

This is a function pointer for a callback function which is invoked from within a decode function whn a value the OBJECT IDENTIFIER ASN.1 type is parsed.

Parameters:
numSubIds Number of subidentifiers in the object identifier.
pSubIds Pointer to array containing the subidentifier values.
Returns:
-none
typedef void(* rtxOpenTypeValue)(OSUINT32 numocts, const OSOCTET *data)

This is a function pointer for a callback function which is invoked from within a decode function when an ASN.1 open type is parsed.

Parameters:
numocts Number of octets in the parsed value.
data Pointer to byet array contain in tencoded ASN.1 value.
Returns:
- none
typedef void(* rtxRealValue)(double value)

This is a function pointer for a callback function which is invoked from within a decode function when a value the REAL ASN.1 type is parsed.

Parameters:
value Parsed value.
Returns:
- none
typedef void(* rtxStartElement)(const char *name, int idx)

This is a function pointer for a callback function which is invoked from within a decode function when an element of a SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE construct is parsed.

Parameters:
name For SEQUENCE, SET, or CHOICE, this is the name of the element as defined in the ASN.1 defination. For SEQUENCE OF or SET OF, this is set to the name "element".
idx For SEQUENCE, SET, or CHOICE, this is not used and is set to the value -1. For SEQUENCE OF or SET OF, this contains the zero-based index of the element in the conceptual array associated with the construct.
Returns:
- none
typedef void(* rtxUInt64Value)(OSUINT64 value)

This is a function pointer for a callback function which is invoked from within a decode function when a value of the 64-bit INTEGER ASN.1 type is parsed.

Parameters:
value Parsed value.
Returns:
- none
typedef void(* rtxUIntValue)(OSUINT32 value)

This is a function pointer for a callback function which is invoked from within a decode function when a value of the INTEGER ASN.1 type is parsed. In this case, constraints on the integer value forced the use of unsigned integer C type to represent the value.

Parameters:
value Parsed value.
Returns:
- none

Function Documentation

void rtAddEventHandler ( OSCTXT pCtxt,
Asn1NamedCEventHandler pHandler 
)

This function is called to add a new event handler to the context event handler list.

Parameters:
pCtxt Context to which event handler has to be added.
pHandler Pointer to the event handler structure.
Returns:
none
void rtInvokeBitStrValue ( OSCTXT pCtxt,
OSUINT32  numbits,
const OSOCTET *  data 
)

This function is called by generated code to invoke the event handler's bit string value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
numbits The number of bits contained in the decoded bit string.
data A pointer to the decoded octets containing the data.
void rtInvokeBoolValue ( OSCTXT pCtxt,
OSBOOL  value 
)

This function is called by generated code to invoke the event handler's boolean value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
value The decoded boolean value passed to the event handler.
void rtInvokeCharStr16BitValue ( OSCTXT pCtxt,
OSUINT32  nchars,
OSUNICHAR *  data 
)

This function is called by generated code to invoke the event handler's 16-bit character string value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
nchars The number of characters in the string.
value The decoded 16-bit character string.
void rtInvokeCharStr32BitValue ( OSCTXT pCtxt,
OSUINT32  nchars,
OS32BITCHAR *  data 
)

This function is called by generated code to invoke the event handler's 32-bit character string value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
nchars The number of characters in the string.
value The decoded 32-bit character string.
void rtInvokeCharStrValue ( OSCTXT pCtxt,
const char *  value 
)

This function is called by generated code to invoke the event handler's character string value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
value The decoded character string.
void rtInvokeEndElement ( OSCTXT pCtxt,
const char *  name,
int  idx 
)

This function is called by generated code to invoke the event handler's end element function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
name The name of the element on which the function is called.
idx The index of the element (for use in SEQUENCE OF items).
void rtInvokeEnumValue ( OSCTXT pCtxt,
OSUINT32  value,
const OSUTF8CHAR *  text 
)

This function is called by generated code to invoke the event handler's enumerated value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
value The integer value corresponding to the enumerated value.
text The character string text that represents the enumerated value.
int rtInvokeErrorHandler ( OSCTXT pctxt,
ASN1CCB pCCB,
int  stat 
)

This function invokes the error handler callback defined inside the context.

Parameters:
pctxt A pointer to an OSCTXT data structure.
pCCB A pointer to an ASN1CCB data structure.
stat The error status encountered.
Returns:
None.
See also:
rtSetErrorHandler
rtErrorHandler
void rtInvokeInt64Value ( OSCTXT pCtxt,
OSINT64  value 
)

This function is called by generated code to invoke the event handler's signed 64-bit integer value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
value The decoded signed 64-bit integer value passed to the event handler.
void rtInvokeIntValue ( OSCTXT pCtxt,
OSINT32  value 
)

This function is called by generated code to invoke the event handler's signed integer value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
value The decoded signed integer value passed to the event handler.
void rtInvokeNullValue ( OSCTXT pCtxt  ) 

This function is called by generated code to invoke the event handler's null value function. No value is required for NULL types.

Parameters:
pctxt A pointer to an OSCTXT data structure.
void rtInvokeOctStrValue ( OSCTXT pCtxt,
OSUINT32  numocts,
const OSOCTET *  data 
)

This function is called by generated code to invoke the event handler's octet string value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
numocts The number of octets contained in the decoded octet string.
data A pointer to the decoded octets containing the data.
void rtInvokeOidValue ( OSCTXT pCtxt,
OSUINT32  numSubIds,
OSUINT32 *  pSubIds 
)

This function is called by generated code to invoke the event handler's object identifier value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
numSubIds The number of sub ids in the OID value.
pSubIds The sub ids that comprise the OID value.
void rtInvokeOpenTypeValue ( OSCTXT pCtxt,
OSUINT32  numocts,
const OSOCTET *  data 
)

This function is called by generated code to invoke the event handler's open type value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
numocts The number of octets the decoded open type contains.
data The content of the decoded open type.
void rtInvokeRealValue ( OSCTXT pCtxt,
double  value 
)

This function is called by generated code to invoke the event handler's real value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
value The decoded real value.
void rtInvokeStartElement ( OSCTXT pCtxt,
const char *  name,
int  idx 
)

This function is called by generated code to invoke the event handler's StartElement function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
name The name of the element on which the function is called.
idx The index of the element (for use in SEQUENCE OF items).
void rtInvokeUInt64Value ( OSCTXT pCtxt,
OSUINT64  value 
)

This function is called by generated code to invoke the event handler's unsigned 64-bit integer value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
value The decoded unsigned 64-bit integer value passed to the event handler.
void rtInvokeUIntValue ( OSCTXT pCtxt,
OSUINT32  value 
)

This function is called by generated code to invoke the event handler's unsigned integer value function.

Parameters:
pctxt A pointer to an OSCTXT data structure.
value The decoded unsigned integer value passed to the event handler.
void rtRemoveErrorHandler ( OSCTXT pctxt  ) 

This function removes the error handler from the given context.

Parameters:
pctxt A pointer to an OSCTXT data structure.
Returns:
None.
void rtRemoveEventHandler ( OSCTXT pCtxt,
Asn1NamedCEventHandler pHandler 
)

This function is called to remove an event handler from the context event handler list. Note that it does not delete the event handler object.

Parameters:
pCtxt Context from which event handler has to be removed.
pHandler Pointer to event handler structure.
Returns:
none
void rtSetErrorHandler ( OSCTXT pctxt,
rtErrorHandler  pErrCB 
)

This function is called to set the error handler in an OSCTXT data structure. The error handler is called within generated code if an error occurs during message parsing. Only one error handler may be used at a time.

Parameters:
pctxt A pointer to an OSCTXT structure used for decoding.
pErrCB A pointer to the rtErrorHandler callback function.
Returns:
None.