ASN1C C/C++ Common Runtime  ASN1C v7.3.x
Classes | Typedefs | Functions
Asn1CEventHandler

Classes

struct  Asn1NamedCEventHandler
 

Typedefs

typedef void(* rtxStartElement) (const char *name, OSSIZE idx)
 
typedef void(* rtxEndElement) (const char *name, OSSIZE 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) (OSSIZE numbits, const OSOCTET *data)
 
typedef void(* rtxOctStrValue) (OSSIZE numocts, const OSOCTET *data)
 
typedef void(* rtxCharStrValue) (const char *value)
 
typedef void(* rtxCharStrValue16Bit) (OSSIZE nchars, OSUNICHAR *data)
 
typedef void(* rtxCharStrValue32Bit) (OSSIZE 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) (OSSIZE 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, OSSIZE idx)
 
void rtInvokeEndElement (OSCTXT *pCtxt, const char *name, OSSIZE 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, OSSIZE numbits, const OSOCTET *data)
 
void rtInvokeOctStrValue (OSCTXT *pCtxt, OSSIZE numocts, const OSOCTET *data)
 
void rtInvokeCharStrValue (OSCTXT *pCtxt, const char *value)
 
void rtInvokeCharStr16BitValue (OSCTXT *pCtxt, OSSIZE nchars, OSUNICHAR *data)
 
void rtInvokeCharStr32BitValue (OSCTXT *pCtxt, OSSIZE 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, OSSIZE numocts, const OSOCTET *data)
 

Detailed Description

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

Typedef Documentation

◆ Asn1NamedCEventHandler

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

◆ rtErrorHandler

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
pctxtPointer to an OSCTXT data structure.
pCCBPointer to an ASN1CCB data structure; this is the context control block that contains information pertinent to parsing data in an ASN.1 message.
statThe error status.
Returns
The new error status.

◆ rtxBitStrValue

typedef void(* rtxBitStrValue) (OSSIZE 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

◆ rtxBoolValue

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
valueParsed value.
Returns
- none

◆ rtxCharStrValue

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
valueNull terminated character string value.
Returns
- none

◆ rtxCharStrValue16Bit

typedef void(* rtxCharStrValue16Bit) (OSSIZE 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
ncharsNumber of characters in the parsed value.
dataPointer to an array containing 16-bit values. These are represented using unsigned short integer values.
Returns
- none

◆ rtxCharStrValue32Bit

typedef void(* rtxCharStrValue32Bit) (OSSIZE 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
ncharsNumber of characters in the parsed value.
dataPointer to an array containing 32-bit values. Each 32-bit integer value is a universal character.
Returns
- none

◆ rtxEndElement

typedef void(* rtxEndElement) (const char *name, OSSIZE 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
nameFor 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".
idxFor 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

◆ rtxEnumValue

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

◆ rtxInt64Value

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
valueParsed value.
Returns
- none

◆ rtxIntValue

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
valueParsed value.
Returns
- none

◆ rtxNullValue

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

◆ rtxOctStrValue

typedef void(* rtxOctStrValue) (OSSIZE 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
numoctsNumber of octets in the parsed value.
dataPointer to byte array containing the octet string data.
Returns
- none

◆ rtxOidValue

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
numSubIdsNumber of subidentifiers in the object identifier.
pSubIdsPointer to array containing the subidentifier values.
Returns
-none

◆ rtxOpenTypeValue

typedef void(* rtxOpenTypeValue) (OSSIZE 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
numoctsNumber of octets in the parsed value.
dataPointer to byet array contain in tencoded ASN.1 value.
Returns
- none

◆ rtxRealValue

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
valueParsed value.
Returns
- none

◆ rtxStartElement

typedef void(* rtxStartElement) (const char *name, OSSIZE 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
nameFor 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".
idxFor 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

◆ rtxUInt64Value

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
valueParsed value.
Returns
- none

◆ rtxUIntValue

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
valueParsed value.
Returns
- none

Function Documentation

◆ rtAddEventHandler()

void rtAddEventHandler ( OSCTXT pCtxt,
Asn1NamedCEventHandler pHandler 
)

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

Parameters
pCtxtContext to which event handler has to be added.
pHandlerPointer to the event handler structure.
Returns
none

◆ rtInvokeBitStrValue()

void rtInvokeBitStrValue ( OSCTXT pCtxt,
OSSIZE  numbits,
const OSOCTET *  data 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
numbitsThe number of bits contained in the decoded bit string.
dataA pointer to the decoded octets containing the data.

◆ rtInvokeBoolValue()

void rtInvokeBoolValue ( OSCTXT pCtxt,
OSBOOL  value 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
valueThe decoded boolean value passed to the event handler.

◆ rtInvokeCharStr16BitValue()

void rtInvokeCharStr16BitValue ( OSCTXT pCtxt,
OSSIZE  nchars,
OSUNICHAR *  data 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
ncharsThe number of characters in the string.
valueThe decoded 16-bit character string.

◆ rtInvokeCharStr32BitValue()

void rtInvokeCharStr32BitValue ( OSCTXT pCtxt,
OSSIZE  nchars,
OS32BITCHAR *  data 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
ncharsThe number of characters in the string.
valueThe decoded 32-bit character string.

◆ rtInvokeCharStrValue()

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
pctxtA pointer to an OSCTXT data structure.
valueThe decoded character string.

◆ rtInvokeEndElement()

void rtInvokeEndElement ( OSCTXT pCtxt,
const char *  name,
OSSIZE  idx 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
nameThe name of the element on which the function is called.
idxThe index of the element (for use in SEQUENCE OF items).

◆ rtInvokeEnumValue()

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
pctxtA pointer to an OSCTXT data structure.
valueThe integer value corresponding to the enumerated value.
textThe character string text that represents the enumerated value.

◆ rtInvokeErrorHandler()

int rtInvokeErrorHandler ( OSCTXT pctxt,
ASN1CCB pCCB,
int  stat 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
pCCBA pointer to an ASN1CCB data structure.
statThe error status encountered.
Returns
None.
See also
rtSetErrorHandler
rtErrorHandler

◆ rtInvokeInt64Value()

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
pctxtA pointer to an OSCTXT data structure.
valueThe decoded signed 64-bit integer value passed to the event handler.

◆ rtInvokeIntValue()

void rtInvokeIntValue ( OSCTXT pCtxt,
OSINT32  value 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
valueThe decoded signed integer value passed to the event handler.

◆ rtInvokeNullValue()

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
pctxtA pointer to an OSCTXT data structure.

◆ rtInvokeOctStrValue()

void rtInvokeOctStrValue ( OSCTXT pCtxt,
OSSIZE  numocts,
const OSOCTET *  data 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
numoctsThe number of octets contained in the decoded octet string.
dataA pointer to the decoded octets containing the data.

◆ rtInvokeOidValue()

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
pctxtA pointer to an OSCTXT data structure.
numSubIdsThe number of sub ids in the OID value.
pSubIdsThe sub ids that comprise the OID value.

◆ rtInvokeOpenTypeValue()

void rtInvokeOpenTypeValue ( OSCTXT pCtxt,
OSSIZE  numocts,
const OSOCTET *  data 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
numoctsThe number of octets the decoded open type contains.
dataThe content of the decoded open type.

◆ rtInvokeRealValue()

void rtInvokeRealValue ( OSCTXT pCtxt,
double  value 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
valueThe decoded real value.

◆ rtInvokeStartElement()

void rtInvokeStartElement ( OSCTXT pCtxt,
const char *  name,
OSSIZE  idx 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
nameThe name of the element on which the function is called.
idxThe index of the element (for use in SEQUENCE OF items).

◆ rtInvokeUInt64Value()

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
pctxtA pointer to an OSCTXT data structure.
valueThe decoded unsigned 64-bit integer value passed to the event handler.

◆ rtInvokeUIntValue()

void rtInvokeUIntValue ( OSCTXT pCtxt,
OSUINT32  value 
)

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

Parameters
pctxtA pointer to an OSCTXT data structure.
valueThe decoded unsigned integer value passed to the event handler.

◆ rtRemoveErrorHandler()

void rtRemoveErrorHandler ( OSCTXT pctxt)

This function removes the error handler from the given context.

Parameters
pctxtA pointer to an OSCTXT data structure.
Returns
None.

◆ rtRemoveEventHandler()

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
pCtxtContext from which event handler has to be removed.
pHandlerPointer to event handler structure.
Returns
none

◆ rtSetErrorHandler()

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
pctxtA pointer to an OSCTXT structure used for decoding.
pErrCBA pointer to the rtErrorHandler callback function.
Returns
None.