ASN1PERMessageBuffer Class Reference
[PER Message Buffer Classes]
#include <asn1PerCppTypes.h>
Public Member Functions | |
void | binDump (const char *varname) |
void | hexDump () |
size_t | getMsgLen () |
OSBOOL | isAligned () |
void | setTrace (OSBOOL value) |
EXTPERMETHOD int | setBuffer (const OSOCTET *pMsgBuf, size_t msgBufLen) |
void | BinDump (const char *varname) |
void | HexDump () |
int | GetMsgLen () |
void | SetTrace (OSBOOL value) |
Protected Member Functions | |
EXTPERMETHOD | ASN1PERMessageBuffer (Type bufferType, OSBOOL aligned) |
EXTPERMETHOD | ASN1PERMessageBuffer (OSRTStream &stream, OSBOOL aligned) |
EXTPERMETHOD | ASN1PERMessageBuffer (Type bufferType, OSOCTET *pMsgBuf, size_t msgBufLen, OSBOOL aligned) |
EXTPERMETHOD | ASN1PERMessageBuffer (Type bufferType, OSOCTET *pMsgBuf, size_t msgBufLen, OSBOOL aligned, OSRTContext *pContext) |
Detailed Description
The ASN1PERMessageBuffer class is derived from the ASN1MessageBuffer base class. It is the base class for the ASN1PEREncodeBuffer and ASN1PERDecodeBuffer derived classes. It contains variables and methods specific to encoding or decoding ASN.1 messages using the Packed Encoding Rules (PER). It is used to manage the buffer into which an ASN.1 message is to be encoded or decoded.
Constructor & Destructor Documentation
EXTPERMETHOD ASN1PERMessageBuffer::ASN1PERMessageBuffer | ( | Type | bufferType, | |
OSBOOL | aligned | |||
) | [protected] |
This constructor does not set a PER input source. It is used by the derived encode buffer classes. Use the getStatus() method to determine if an error has occured during initialization.
- Parameters:
-
bufferType Type of message buffer that is being created (for example, PEREncode or PERDecode). aligned Flag indicating if aligned (TRUE) or unaligned (FALSE) encoding should be done.
EXTPERMETHOD ASN1PERMessageBuffer::ASN1PERMessageBuffer | ( | OSRTStream & | stream, | |
OSBOOL | aligned | |||
) | [protected] |
This constructor associates a stream with a PER encode or decode buffer. It is used by the derived encode buffer classes to create a stream-based PER encoder or decoder.
- Parameters:
-
stream Stream class reference. aligned Flag indicating if aligned (TRUE) or unaligned (FALSE) encoding should be done.
EXTPERMETHOD ASN1PERMessageBuffer::ASN1PERMessageBuffer | ( | Type | bufferType, | |
OSOCTET * | pMsgBuf, | |||
size_t | msgBufLen, | |||
OSBOOL | aligned | |||
) | [protected] |
This constructor allows a memory buffer holding a binary PER message to be specified. Use the getStatus() method to determine if an error has occured during initialization.
- Parameters:
-
bufferType Type of message buffer that is being created (for example, PEREncode or PERDecode). pMsgBuf A pointer to a fixed size message buffer to recieve the encoded message. msgBufLen Size of the fixed-size message buffer. aligned Flag indicating if aligned (TRUE) or unaligned (FALSE) encoding should be done.
EXTPERMETHOD ASN1PERMessageBuffer::ASN1PERMessageBuffer | ( | Type | bufferType, | |
OSOCTET * | pMsgBuf, | |||
size_t | msgBufLen, | |||
OSBOOL | aligned, | |||
OSRTContext * | pContext | |||
) | [protected] |
This constructor allows a memory buffer holding a binary PER message to be specified. It also allows a pre-existing context to be associated with this buffer. Use the getStatus() method to determine if an error has occured during initialization.
- Parameters:
-
bufferType Type of message buffer that is being created (for example, PEREncode or PERDecode). pMsgBuf A pointer to a fixed size message buffer to recieve the encoded message. msgBufLen Size of the fixed-size message buffer. aligned Flag indicating if aligned (TRUE) or unaligned (FALSE) encoding should be done. pContext A pointer to an OSRTContext structure.
Member Function Documentation
void ASN1PERMessageBuffer::binDump | ( | const char * | varname | ) | [inline] |
This method outputs a binary dump of the current buffer contents to stdout.
- Parameters:
-
varname char pointer to current buffer
References pu_bindump().
size_t ASN1PERMessageBuffer::getMsgLen | ( | ) | [inline] |
This method returns the length of a previously encoded PER message.
- Parameters:
-
- none
References pu_getMsgLen().
void ASN1PERMessageBuffer::hexDump | ( | ) | [inline] |
This method outputs a hexadecimal dump of the current buffer contents to stdout.
- Parameters:
-
- none
References pu_hexdump().
OSBOOL ASN1PERMessageBuffer::isAligned | ( | ) | [inline] |
This method indicates if PER aligned encoding is in effect.
- Parameters:
-
- none
- Returns:
- Boolean result: true if aligned; false if unaligned.
EXTPERMETHOD int ASN1PERMessageBuffer::setBuffer | ( | const OSOCTET * | pMsgBuf, | |
size_t | msgBufLen | |||
) |
This method sets a buffer to receive the encoded message.
- Parameters:
-
pMsgBuf A pointer to a memory buffer to use to encode a message. The buffer should be declared as an array of unsigned characters (OSOCTETs). This parameter can be set to NULL to specify dynamic encoding (i.e., the encode functions will dynamically allocate a buffer for the message). msgBufLen The length of the memory buffer in bytes. If pMsgBuf is NULL, this parameter specifies the initial size of the dynamic buffer; if 0 - the default size will be used.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
void ASN1PERMessageBuffer::setTrace | ( | OSBOOL | value | ) | [inline] |
This method turns PER diagnostic tracing on or off.
This enables the collection of the bit statistics inside the PER library functions that can be displayed using the binDump method.
- Parameters:
-
value Boolean value indicating whether tracing should be on (true) or off (false).
The documentation for this class was generated from the following file: