ASN1C C/C++ Common Runtime  ASN1C v7.4.x
Modules | Classes | Macros | Typedefs | Enumerations
C Runtime Common Functions

Modules

 Object Identifier Helper Functions
 
 Time Helper Functions
 
 Character String Conversion Functions
 
 Comparison Functions
 
 Comparison to Standard Output Functions
 
 Copy Functions
 
 Print values to text buffer functions.
 

Classes

struct  ASN1OctStr
 
struct  ASN1DynBitStr
 
struct  ASN1DynBitStr64
 
struct  ASN1BitStr32
 
struct  ASN1SeqOf
 
struct  ASN1SeqOfOctStr
 
struct  ASN1OpenType
 
struct  Asn1Object
 
struct  OSXSDAny
 
struct  Asn116BitCharString
 
struct  Asn132BitCharString
 
struct  Asn1CharArray
 
struct  Asn1CharSet
 
struct  Asn116BitCharSet
 
struct  Asn132BitCharSet
 
struct  ASN1BigInt
 
struct  ASN1CCB
 

Macros

#define XM_SEEK   0x01
 
#define XM_ADVANCE   0x02
 
#define XM_DYNAMIC   0x04
 
#define XM_SKIP   0x08
 
#define XM_OPTIONAL   0x10
 
#define ASN_K_MAXDEPTH   32
 
#define ASN_K_MAXENUM   100
 
#define ASN_K_MAXERRP   5
 
#define ASN_K_MAXERRSTK   8
 
#define ASN_K_ENCBUFSIZ   16*1024
 
#define ASN_K_MEMBUFSEG   1024
 
#define OSRTINDENTSPACES   3
 
#define ASN1_K_PLUS_INFINITY   0x40
 
#define ASN1_K_MINUS_INFINITY   0x41
 
#define ASN1_K_NOT_A_NUMBER   0x42
 
#define ASN1_K_MINUS_ZERO   0x43
 
#define REAL_BINARY   0x80
 
#define REAL_SIGN   0x40
 
#define REAL_EXPLEN_MASK   0x03
 
#define REAL_EXPLEN_1   0x00
 
#define REAL_EXPLEN_2   0x01
 
#define REAL_EXPLEN_3   0x02
 
#define REAL_EXPLEN_LONG   0x03
 
#define REAL_FACTOR_MASK   0x0c
 
#define REAL_BASE_MASK   0x30
 
#define REAL_BASE_2   0x00
 
#define REAL_BASE_8   0x10
 
#define REAL_BASE_16   0x20
 
#define REAL_ISO6093_MASK   0x3F
 
#define ASN1REALMAX   (OSREAL)DBL_MAX
 
#define ASN1REALMIN   (OSREAL)-DBL_MAX
 
#define ASN1DynOctStr   OSDynOctStr
 
#define ASN1DynOctStr64   OSDynOctStr64
 
#define OSSETBIT(bitStr, bitIndex)   rtxSetBit (bitStr.data, bitStr.numbits, bitIndex)
 
#define OSSETBITP(pBitStr, bitIndex)   rtxSetBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex)
 
#define OSCLEARBIT(bitStr, bitIndex)   rtxClearBit (bitStr.data, bitStr.numbits, bitIndex)
 
#define OSCLEARBITP(pBitStr, bitIndex)   rtxClearBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex)
 
#define OSTESTBIT(bitStr, bitIndex)   rtxTestBit (bitStr.data, bitStr.numbits, bitIndex)
 
#define OSTESTBITP(pBitStr, bitIndex)   rtxTestBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex)
 
#define ASN1_K_CCBMaskSize   32
 
#define ASN1_K_NumBitsPerMask   16
 
#define ASN1_K_MaxSetElements   (ASN1_K_CCBMaskSize*ASN1_K_NumBitsPerMask)
 
#define ASN1NUMOCTS(nbits)   ((nbits>0)?(((nbits-1)/8)+1):0)
 

Typedefs

typedef void * ASN1ANY
 
typedef Asn1Object ASN1Object
 
typedef struct OSXSDAny OSXSDAny
 
typedef OSUNICHAR ASN116BITCHAR
 
typedef const char * ASN1GeneralizedTime
 
typedef const char * ASN1GeneralString
 
typedef const char * ASN1GraphicString
 
typedef const char * ASN1IA5String
 
typedef const char * ASN1ISO646String
 
typedef const char * ASN1NumericString
 
typedef const char * ASN1ObjectDescriptor
 
typedef const char * ASN1PrintableString
 
typedef const char * ASN1TeletexString
 
typedef const char * ASN1T61String
 
typedef const char * ASN1UTCTime
 
typedef const char * ASN1VideotexString
 
typedef const char * ASN1VisibleString
 
typedef const OSUTF8CHAR * ASN1UTF8String
 
typedef Asn116BitCharString ASN1BMPString
 
typedef Asn132BitCharString ASN1UniversalString
 
typedef struct ASN1BigInt ASN1BigInt
 
typedef int(* ASN1DumpCbFunc) (const char *text_p, void *cbArg_p)
 

Enumerations

enum  ASN1StrType { ASN1HEX, ASN1BIN, ASN1CHR }
 
enum  ASN1ActionType { ASN1ENCODE, ASN1DECODE }
 
enum  OSXSDAnyAlt { OSXSDAny_binary, OSXSDAny_xmlText }
 

Detailed Description

The C run-time common library contains common C functions used by the low-level encode/decode functions. These functions are identified by their rt and rtx prefixes.

The categories of functions provided are as follows:

Macro Definition Documentation

◆ ASN1_K_CCBMaskSize

#define ASN1_K_CCBMaskSize   32

The maximum size for the context control block mask.

◆ ASN1_K_MaxSetElements

#define ASN1_K_MaxSetElements   (ASN1_K_CCBMaskSize*ASN1_K_NumBitsPerMask)

The maximum number of set elements that can be handled by the CCB.

◆ ASN1_K_MINUS_INFINITY

#define ASN1_K_MINUS_INFINITY   0x41

The ASN.1 Real value Minus Infinity.

◆ ASN1_K_MINUS_ZERO

#define ASN1_K_MINUS_ZERO   0x43

The ASN.1 Real value Minus Zero.

◆ ASN1_K_NOT_A_NUMBER

#define ASN1_K_NOT_A_NUMBER   0x42

The ASN.1 Real value Not-A-Number.

◆ ASN1_K_NumBitsPerMask

#define ASN1_K_NumBitsPerMask   16

The number of bits that can be set per mask.

◆ ASN1_K_PLUS_INFINITY

#define ASN1_K_PLUS_INFINITY   0x40

The ASN.1 Real value Plus Infinity.

◆ ASN1DynOctStr

#define ASN1DynOctStr   OSDynOctStr

We define ASN1DynOctStr to be the common generic OSDynOctStr type.

Referenced by ASN1TDynOctStr::operator=().

◆ ASN_K_ENCBUFSIZ

#define ASN_K_ENCBUFSIZ   16*1024

dynamic encode buffer extent size

◆ ASN_K_MAXDEPTH

#define ASN_K_MAXDEPTH   32

maximum nesting depth for messages

◆ ASN_K_MAXENUM

#define ASN_K_MAXENUM   100

maximum enum values in an enum type

◆ ASN_K_MAXERRP

#define ASN_K_MAXERRP   5

maximum error parameters

◆ ASN_K_MAXERRSTK

#define ASN_K_MAXERRSTK   8

maximum levels on error ctxt stack

◆ ASN_K_MEMBUFSEG

#define ASN_K_MEMBUFSEG   1024

memory buffer extent size

◆ OSCLEARBIT

#define OSCLEARBIT (   bitStr,
  bitIndex 
)    rtxClearBit (bitStr.data, bitStr.numbits, bitIndex)

This macro clears the given bit in the given static bit string.

Parameters
bitStrThe bit string to manipulate.
bitIndexThe index to clear.

◆ OSCLEARBITP

#define OSCLEARBITP (   pBitStr,
  bitIndex 
)    rtxClearBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex)

This macro clears the given bit in the given dynamic bit string.

Parameters
pBitStrThe pointer-to-bit string to manipulate.
bitIndexThe index to clear.

◆ OSRTINDENTSPACES

#define OSRTINDENTSPACES   3

number of spaces for indent

◆ OSSETBIT

#define OSSETBIT (   bitStr,
  bitIndex 
)    rtxSetBit (bitStr.data, bitStr.numbits, bitIndex)

This macro sets the given bit in the given static bit string.

Parameters
bitStrThe bit string to manipulate.
bitIndexThe index to set.

◆ OSSETBITP

#define OSSETBITP (   pBitStr,
  bitIndex 
)    rtxSetBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex)

This macro sets the given bit in the given dynamic bit string.

Parameters
pBitStrA pointer-to-bit string to manipulate.
bitIndexThe index to set.

◆ OSTESTBIT

#define OSTESTBIT (   bitStr,
  bitIndex 
)    rtxTestBit (bitStr.data, bitStr.numbits, bitIndex)

This macro tests the given bit in the given static bit string.

Parameters
bitStrThe bit string to manipulate.
bitIndexThe index to test.
Returns
TRUE if the bit is on; FALSE if the bit is off.

◆ OSTESTBITP

#define OSTESTBITP (   pBitStr,
  bitIndex 
)    rtxTestBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex)

This macro tests the given bit in the given dynamic bit string.

Parameters
pBitStrThe pointer-to-bit string to manipulate.
bitIndexThe index to set.

◆ XM_ADVANCE

#define XM_ADVANCE   0x02

advance pointer to contents on match

◆ XM_DYNAMIC

#define XM_DYNAMIC   0x04

alloc dyn mem for decoded variable

◆ XM_OPTIONAL

#define XM_OPTIONAL   0x10

tag test is for optional element

◆ XM_SEEK

#define XM_SEEK   0x01

seek match until found or end-of-buf

◆ XM_SKIP

#define XM_SKIP   0x08

skip to next field after parsing tag

Typedef Documentation

◆ ASN1BigInt

typedef struct ASN1BigInt ASN1BigInt

A structure used to define an ASN.1 big integer. This structure is rarely, if ever, used by client code, and will instead be used by generated code to facilitate encoding and decoding integer values that cannot fit in normal C/C++ integer types.

◆ ASN1DumpCbFunc

typedef int(* ASN1DumpCbFunc) (const char *text_p, void *cbArg_p)

ASN.1 dump utility callback function definition

Enumeration Type Documentation

◆ ASN1ActionType

An enumerated list of ASN.1 actions: encode or decode.

◆ ASN1StrType

An enumerated list of the various string types: hexadecimal, binary, and character strings.