Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

asn1type.h File Reference

Go to the source code of this file.

Compounds

struct  _ASN1ListElem
struct  _Asn1RTDList
struct  _Asn1RTDListNode
struct  _Asn1RTSList
struct  _Asn1RTSListNode
struct  _Asn1RTStack
struct  _Asn1SizeCnst
struct  Asn116BitCharSet
struct  Asn116BitCharString
struct  Asn132BitCharSet
struct  Asn132BitCharString
union  ASN1_DFLOAT
struct  ASN1BigInt
struct  ASN1BUFFER
struct  ASN1BUFSAVE
struct  ASN1CCB
struct  Asn1CharArray
struct  Asn1CharSet
struct  ASN1CTXT
struct  ASN1DynBitStr
struct  ASN1DynOctStr
struct  ASN1ErrInfo
struct  ASN1ErrLocn
struct  ASN1MemBuf
struct  Asn1Object
struct  ASN1OBJID
struct  ASN1OctStr
struct  ASN1OID64
struct  ASN1OpenType
struct  ASN1SeqOf
struct  ASN1SeqOfOctStr
struct  MemHeap
struct  MemLink

Defines

#define ASN1C_EXPANDED_TAGS
#define TV_UNIV   0
#define TV_APPL   1
#define TV_CTXT   2
#define TV_PRIV   3
#define TV_PRIM   0
#define TV_CONS   1
#define TM_UNIV   0x00000000
#define TM_APPL   0x40000000
#define TM_CTXT   0x80000000
#define TM_PRIV   0xC0000000
#define TM_PRIM   0x00000000
#define TM_CONS   0x20000000
#define TM_IDCODE   0x1FFFFFFF
#define ASN_K_BADTAG   0xFFFFFFFF
#define ASN_K_NOTAG   0xFFFFFFFF
#define TM_CLASS   0xC0
#define TM_FORM   0x20
#define TM_CLASS_FORM   0xE0
#define TM_B_IDCODE   0x1F
#define FALSE   0
#define TRUE   1
#define MINMSGLEN   8
#define ASN_OK   0
#define ASN_OK_FRAG   2
#define ASN_E_BUFOVFLW   -1
#define ASN_E_ENDOFBUF   -2
#define ASN_E_IDNOTFOU   -3
#define ASN_E_INVOBJID   -4
#define ASN_E_INVLEN   -5
#define ASN_E_INVENUM   -6
#define ASN_E_SETDUPL   -7
#define ASN_E_SETMISRQ   -8
#define ASN_E_NOTINSET   -9
#define ASN_E_SEQOVFLW   -10
#define ASN_E_INVOPT   -11
#define ASN_E_NOMEM   -12
#define ASN_E_INVHEXS   -14
#define ASN_E_INVBINS   -15
#define ASN_E_INVREAL   -16
#define ASN_E_STROVFLW   -17
#define ASN_E_BADVALUE   -18
#define ASN_E_UNDEFVAL   -19
#define ASN_E_UNDEFTYP   -20
#define ASN_E_BADTAG   -21
#define ASN_E_TOODEEP   -22
#define ASN_E_CONSVIO   -23
#define ASN_E_RANGERR   -24
#define ASN_E_ENDOFFILE   -25
#define ASN_E_INVUTF8   -26
#define ASN_E_CONCMODF   -27
#define ASN_E_ILLSTATE   -28
#define ASN_E_OUTOFBND   -29
#define ASN_E_INVPARAM   -30
#define ASN_E_INVFORMAT   -31
#define ASN_E_NOTINIT   -32
#define ASN_E_TOOBIG   -33
#define ASN_E_INVCHAR   -34
#define ASN_E_XMLSTATE   -35
#define ASN_E_XMLPARSE   -36
#define ASN_E_SEQORDER   -37
#define ASN_E_INVINDEX   -38
#define ASN_E_INVTCVAL   -39
#define ASN_E_FILNOTFOU   -40
#define ASN_E_FILEREAD   -41
#define ASN_E_FILEWRITE   -42
#define ASN_E_INVBASE64   -43
#define ASN_E_INVSOCKET   -44
#define ASN_E_XMLLIBNFOU   -45
#define ASN_E_XMLLIBINV   -46
#define ASN_E_NOTSUPP   -99
#define ASN_K_INDEFLEN   -9999
#define ASN_ID_EOC   0
#define ASN_ID_BOOL   1
#define ASN_ID_INT   2
#define ASN_ID_BITSTR   3
#define ASN_ID_OCTSTR   4
#define ASN_ID_NULL   5
#define ASN_ID_OBJID   6
#define ASN_ID_OBJDSC   7
#define ASN_ID_EXTERN   8
#define ASN_ID_REAL   9
#define ASN_ID_ENUM   10
#define ASN_ID_EPDV   11
#define ASN_ID_RELOID   13
#define ASN_ID_SEQ   16
#define ASN_ID_SET   17
#define ASN_SEQ_TAG   0x30
#define ASN_SET_TAG   0x31
#define ASN_ID_NumericString   18
#define ASN_ID_PrintableString   19
#define ASN_ID_TeletexString   20
#define ASN_ID_T61String   ASN_ID_TeletexString
#define ASN_ID_VideotexString   21
#define ASN_ID_IA5String   22
#define ASN_ID_UTCTime   23
#define ASN_ID_GeneralTime   24
#define ASN_ID_GraphicString   25
#define ASN_ID_VisibleString   26
#define ASN_ID_GeneralString   27
#define ASN_ID_UniversalString   28
#define ASN_ID_BMPString   30
#define XM_SEEK   0x01
#define XM_ADVANCE   0x02
#define XM_DYNAMIC   0x04
#define XM_SKIP   0x08
#define ASN_K_MAXDEPTH   32
#define ASN_K_MAXSUBIDS   128
#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 ASN1_K_PLUS_INFINITY   0x40
#define ASN1_K_MINUS_INFINITY   0x41
#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   (ASN1REAL)DBL_MAX
#define ASN1REALMIN   (ASN1REAL)-DBL_MAX
#define ASN1TAG_LSHIFT   24
#define ASN1UINT_MAX   4294967295U
#define ASN1INT_MAX   ((ASN1INT)2147483647L)
#define ASN1INT_MIN   ((ASN1INT)(-ASN1INT_MAX-1))
#define ASN1INT64   long
#define ASN1UINT64   unsigned long
#define ASN1INT64FMT   "%ld"
#define ASN1UINT64FMT   "%lu"
#define ASN1INT64FMTX   "%lx"
#define ASN1INT64MAX   LONG_MAX
#define ASN1UINT64MAX   ULONG_MAX
#define ASN1INT64MIN   LONG_MIN
#define ASN1I64CONST(val)   val##L
#define ASN1UI64CONST(val)   val##UL
#define ASN1Const
#define ASN1_K_CCBMaskSize   32
#define ASN1_K_NumBitsPerMask   16
#define ASN1_K_MaxSetElements   (ASN1_K_CCBMaskSize*ASN1_K_NumBitsPerMask)
#define RT_MH_DONTKEEPFREE   0x1
#define RTMEMSTD   0x0001
#define RTMEMRAW   0x0002
#define RTMEMMALLOC   0x0004
#define RTMEMSAVED   0x0008
#define RTMEMLINK   0x0010
#define XM_K_MEMBLKSIZ   (4*1024)
#define ASN1DYNCTXT   0x8000
#define ASN1INDEFLEN   0x4000
#define ASN1TRACE   0x2000
#define ASN1LASTEOC   0x1000
#define ASN1FASTCOPY   0x0800
#define ASN1CONSTAG   0x0400
#define ASN1CANXER   0x0200
#define ASN1SAVEBUF   0x0100
#define ASN1OPENTYPE   0x0080
#define ASN1MEMBUFPTR(pmb)   ((pmb)->buffer + (pmb)->startidx)
#define ASN1MEMBUFENDPTR(pmb)   ((pmb)->buffer + (pmb)->startidx + (pmb)->usedcnt)
#define ASN1MAX(a, b)   (((a)>(b))?(a):(b))
#define ASN1MIN(a, b)   (((a)<(b))?(a):(b))
#define ALLOC_ASN1ARRAY(pctxt, pseqof, type)
#define ALLOC_ASN1ARRAY1(pctxt, pseqof, type)
#define ALLOC_ASN1ARRAY2(pctxt, n, type)
#define ALLOC_ASN1ELEM(pctxt, type)   (type*) rtMemAllocZ (pctxt, sizeof(type))
#define ALLOC_ASN1ELEMDNODE(pctxt, type)
#define ALLOC_ASN1ELEMSNODE(pctxt, type)
#define ASN1ARRAYSIZE(x)   (sizeof(x)/sizeof(x[0]))
#define ASN1MALLOC(pctxt, nbytes)   rtMemAlloc(pctxt, nbytes)
#define ASN1REALLOC(pctxt, pmem, nbytes)   rtMemRealloc(pctxt, pmem, nbytes)
#define REALLOC_ASN1ARRAY(pctxt, pseqof, type)
#define ASN1MEMFREE(pctxt)   rtMemFree(pctxt)
#define ASN1MEMFREEPTR(pctxt, pmem)   rtMemFreePtr(pctxt, pmem)
#define ASN1MEMRESET(pctxt)   rtMemReset(pctxt)
#define ASN1BUFCUR(cp)   (cp)->buffer.data[(cp)->buffer.byteIndex]
#define ASN1BUFPTR(cp)   &(cp)->buffer.data[(cp)->buffer.byteIndex]
#define ASN1BUF_INDEFLEN(cp)   (((cp)->flags&ASN1INDEFLEN)!=0)
#define ASN1BUF_PTR(cp)   ASN1BUFPTR(cp)
#define ASN1NUMOCTS(nbits)   ((nbits>0)?(((nbits-1)/8)+1):0)
#define RTDIAG1(msg)
#define RTDIAG2(msg, a)
#define RTDIAG3(msg, a, b)
#define RTDIAG4(msg, a, b, c)
#define RTDIAG5(msg, a, b, c, d)
#define RTDIAG6(msg, a, b, c, d, e)
#define RTDIAG7(msg, a, b, c, d, e, f)
#define RTDIAG8(msg, a, b, c, d, e, f, g)
#define RTDIAG9(msg, a, b, c, d, e, f, g, h)
#define RTDIAG10(msg, a, b, c, d, e, f, g, h, i)
#define RTHEXDUMP(buffer, numocts)
#define HEXCHARTONIBBLE(ch, b)
#define NIBBLETOHEXCHAR(b, ch)
#define ASN1CDECL
#define EXTERN
#define EXTERNRT
#define ASN1CRTMALLOC0(nbytes)   malloc(nbytes)
#define ASN1CRTFREE0(ptr)   free(ptr)
#define ASN1CRTMALLOC   ASN1MALLOC
#define ASN1CRTFREE   ASN1MEMFREEPTR
#define OSSETBIT(bitStr, bitIndex)   rtSetBit (bitStr.data, bitStr.numbits, bitIndex)
#define OSSETBITP(pBitStr, bitIndex)   rtSetBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex)
#define OSCLEARBIT(bitStr, bitIndex)   rtClearBit (bitStr.data, bitStr.numbits, bitIndex)
#define OSCLEARBITP(pBitStr, bitIndex)   rtClearBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex)
#define OSTESTBIT(bitStr, bitIndex)   rtTestBit (bitStr.data, bitStr.numbits, bitIndex)
#define OSTESTBITP(pBitStr, bitIndex)   rtTestBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex)
#define rtSetStrToBigInt   rtBigIntSetStr
#define rtSetInt64ToBigInt   rtBigIntSetInt64
#define rtSetBytesToBigInt   rtBigIntSetBytes
#define rtGetBigIntLen   rtBigIntGetDataLen
#define rtGetBigInt   rtBigIntGetData
#define rtPrintBigInt   rtBigIntPrint
#define rtCompareBigInt   rtBigIntCompare
#define rtCompareBigIntStr   rtBigIntStrCompare

Typedefs

typedef char ASN1CHAR
typedef unsigned char ASN1OCTET
typedef ASN1OCTET ASN1BOOL
typedef int ASN1INT
typedef unsigned int ASN1UINT
typedef ASN1INT ASN1ENUM
typedef double ASN1REAL
typedef short ASN1SINT
typedef unsigned short ASN1USINT
typedef ASN1UINT ASN1TAG
typedef ASN1USINT ASN116BITCHAR
typedef ASN1UINT ASN132BITCHAR
typedef void * ASN1ANY
typedef char * ASN1ConstCharPtr
typedef ASN1OCTET * ASN1ConstOctetPtr
typedef void * ASN1ConstVoidPtr
typedef ASN116BITCHAR * ASN1Const16BitCharPtr
typedef _ASN1ListElem ASN1ListElem
typedef Asn1Object ASN1Object
typedef ASN1ConstCharPtr ASN1GeneralizedTime
typedef ASN1ConstCharPtr ASN1GeneralString
typedef ASN1ConstCharPtr ASN1GraphicString
typedef ASN1ConstCharPtr ASN1IA5String
typedef ASN1ConstCharPtr ASN1ISO646String
typedef ASN1ConstCharPtr ASN1NumericString
typedef ASN1ConstCharPtr ASN1ObjectDescriptor
typedef ASN1ConstCharPtr ASN1PrintableString
typedef ASN1ConstCharPtr ASN1TeletexString
typedef ASN1ConstCharPtr ASN1T61String
typedef ASN1ConstCharPtr ASN1UTCTime
typedef ASN1ConstCharPtr ASN1UTF8String
typedef ASN1ConstCharPtr ASN1VideotexString
typedef ASN1ConstCharPtr ASN1VisibleString
typedef Asn116BitCharString ASN1BMPString
typedef Asn132BitCharString ASN1UniversalString
typedef ASN1BigInt ASN1BigInt
typedef _Asn1RTSListNode Asn1RTSListNode
typedef _Asn1RTSList Asn1RTSList
typedef _Asn1RTDListNode Asn1RTDListNode
typedef _Asn1RTDList Asn1RTDList
typedef _Asn1RTStack Asn1RTStack
typedef _Asn1SizeCnst Asn1SizeCnst
typedef MemHeap ASN1MemHeap
typedef MemLink ASN1MemLink
typedef ASN1CTXT ASN1CTXT
typedef ASN1MemBuf ASN1MemBuf
typedef int(* ASN1DumpCbFunc )(ASN1ConstCharPtr text_p, void *cbArg_p)
typedef void *ASN1CDECL * ASN1MallocFunc (size_t size)
typedef void *ASN1CDECL * ASN1ReallocFunc (void *ptr, size_t size)

Enumerations

enum  ASN1TagType { ASN1IMPL, ASN1EXPL }
enum  ASN1StrType { ASN1HEX, ASN1BIN, ASN1CHR }
enum  ASN1ActionType { ASN1ENCODE, ASN1DECODE }

Functions

typedef void (ASN1CDECL *ASN1FreeFunc)(void *ptr)
EXTERNRT int rtBase64EncodeData (ASN1CTXT *pctxt, ASN1ConstOctetPtr pSrcData, int srcDataSize, ASN1OCTET **ppDstData)
EXTERNRT int rtBase64DecodeData (ASN1CTXT *pctxt, ASN1ConstOctetPtr pSrcData, int srcDataSize, ASN1OCTET **ppDstData)
EXTERNRT int rtCheckBuffer (ASN1CTXT *pctxt, ASN1UINT nbytes)
EXTERNRT void rtCopyContext (ASN1CTXT *pdest, ASN1CTXT *psrc)
EXTERNRT void rtCtxtSetFlag (ASN1CTXT *pctxt, ASN1USINT mask)
EXTERNRT void rtCtxtClearFlag (ASN1CTXT *pctxt, ASN1USINT mask)
EXTERNRT Asn1RTDListNode * rtDListAppend (ASN1CTXT *ctxt_p, Asn1RTDList *pList, void *pData)
EXTERNRT void rtDListInit (Asn1RTDList *pList)
EXTERNRT Asn1RTDListNode * rtDListInsert (ASN1CTXT *ctxt_p, Asn1RTDList *pList, int index, void *pData)
EXTERNRT Asn1RTDListNode * rtDListInsertBefore (ASN1CTXT *ctxt_p, Asn1RTDList *pList, Asn1RTDListNode *node, void *pData)
EXTERNRT Asn1RTDListNode * rtDListInsertAfter (ASN1CTXT *ctxt_p, Asn1RTDList *pList, Asn1RTDListNode *node, void *pData)
EXTERNRT Asn1RTDListNode * rtDListFindByIndex (Asn1RTDList *pList, int index)
EXTERNRT Asn1RTDListNode * rtDListFindByData (Asn1RTDList *pList, void *data)
EXTERNRT int rtDListFindIndexByData (Asn1RTDList *pList, void *data)
EXTERNRT void rtDListRemove (Asn1RTDList *pList, Asn1RTDListNode *node)
EXTERNRT void rtDListFreeNodes (ASN1CTXT *ctxt_p, Asn1RTDList *pList)
EXTERNRT void rtDListFreeAll (ASN1CTXT *ctxt_p, Asn1RTDList *pList)
EXTERNRT int rtDListToArray (ASN1CTXT *ctxt_p, Asn1RTDList *pList, void **ppArray, ASN1UINT *pElements, int elemSize)
EXTERNRT void rtDListAppendArray (ASN1CTXT *ctxt_p, Asn1RTDList *pList, ASN1ConstVoidPtr pArray, ASN1UINT numElements, int elemSize)
EXTERNRT void rtDListAppendArrayCopy (ASN1CTXT *ctxt_p, Asn1RTDList *pList, ASN1ConstVoidPtr pArray, ASN1UINT numElements, int elemSize)
EXTERNRT Asn1RTDListNode * rtDListAppendNode (ASN1CTXT *ctxt_p, Asn1RTDList *pList, void *pData)
EXTERNRT void rtdiag (ASN1ConstCharPtr fmtspec,...)
EXTERNRT void rtDiagHexDump (ASN1ConstOctetPtr data, ASN1UINT numocts)
EXTERNRT int rtErrAddIntParm (ASN1ErrInfo *pErrInfo, int errParm)
EXTERNRT int rtErrAddStrParm (ASN1ErrInfo *pErrInfo, ASN1ConstCharPtr errprm_p)
EXTERNRT int rtErrAddTagParm (ASN1ErrInfo *pErrInfo, ASN1TAG errParm)
EXTERNRT int rtErrAddUIntParm (ASN1ErrInfo *pErrInfo, unsigned int errParm)
EXTERNRT int rtErrCopyData (ASN1ErrInfo *pSrcErrInfo, ASN1ErrInfo *pDestErrInfo)
EXTERNRT void rtErrFreeParms (ASN1ErrInfo *pErrInfo)
EXTERNRT char * rtErrFmtMsg (ASN1ErrInfo *pErrInfo, char *bufp)
EXTERNRT char * rtErrGetText (ASN1CTXT *ctxt_p)
EXTERNRT void rtErrLogUsingCB (ASN1ErrInfo *pErrInfo, ASN1DumpCbFunc cb, void *cbArg)
EXTERNRT void rtErrPrint (ASN1ErrInfo *pErrInfo)
EXTERNRT int rtErrReset (ASN1ErrInfo *pErrInfo)
EXTERNRT int rtErrSetData (ASN1ErrInfo *pErrInfo, int status, ASN1ConstCharPtr module, int lno)
EXTERNRT void rtFreeContext (ASN1CTXT *ctxt_p)
EXTERNRT int rtGetIdentByteCount (ASN1UINT ident)
EXTERNRT int rtGetIdent64ByteCount (ASN1UINT64 ident)
EXTERNRT void rtHexDump (ASN1ConstOctetPtr data, ASN1UINT numocts)
EXTERNRT void rtHexDumpEx (ASN1ConstOctetPtr data, ASN1UINT numocts, int bytesPerUnit)
EXTERNRT void rtHexDumpToFile (FILE *fp, ASN1ConstOctetPtr data, ASN1UINT numocts)
EXTERNRT void rtHexDumpToFileEx (FILE *fp, ASN1ConstOctetPtr data, ASN1UINT numocts, int bytesPerUnit)
EXTERNRT int rtHexDumpToString (ASN1ConstOctetPtr data, ASN1UINT numocts, char *buffer, int bufferIndex, int bufferSize)
EXTERNRT int rtHexDumpToStringEx (ASN1ConstOctetPtr data, ASN1UINT numocts, char *buffer, int bufferIndex, int bufferSize, int bytesPerUnit)
EXTERNRT unsigned int rtIntByteCount (ASN1INT val)
EXTERNRT int rtOctetBitLen (ASN1OCTET w)
EXTERNRT ASN1MemLink * rtMemAddBlock (ASN1MemLink **ppMemLink, void *pMemBlk, int blockType)
EXTERNRT void * rtMemAlloc (ASN1CTXT *pctxt, int nbytes)
EXTERNRT void * rtMemAllocZ (ASN1CTXT *pctxt, int nbytes)
EXTERNRT void rtMemFreePtr (ASN1CTXT *pctxt, void *mem_p)
EXTERNRT void * rtMemRealloc (ASN1CTXT *pctxt, void *mem_p, int nbytes)
EXTERNRT void rtMemFree (ASN1CTXT *pctxt)
EXTERNRT void rtMemHeapFree (ASN1CTXT *pctxt)
EXTERNRT void rtMemReset (ASN1CTXT *pctxt)
EXTERNRT void rtMemMoveBlock (ASN1MemLink **ppSrcMemLink, ASN1ConstVoidPtr mem_p, ASN1MemLink **ppDstMemLink, ASN1BOOL detachFromSource)
EXTERNRT void * rtMemMarkSaved (ASN1CTXT *pctxt, ASN1ConstVoidPtr mem_p, ASN1BOOL saved)
EXTERNRT void rtMemSetDefBlkSize (ASN1UINT blkSize)
EXTERNRT ASN1UINT rtMemGetDefBlkSize ()
EXTERNRT void rtMemSetAllocFuncs (ASN1MallocFunc malloc_func, ASN1ReallocFunc realloc_func, ASN1FreeFunc free_func)
EXTERNRT void rtMemHeapSetFlags (ASN1CTXT *pctxt, ASN1UINT flags)
EXTERNRT void rtMemHeapClearFlags (ASN1CTXT *pctxt, ASN1UINT flags)
EXTERNRT void rtMemHeapSetDefBlkSize (ASN1CTXT *pctxt, ASN1UINT blkSize)
EXTERNRT ASN1UINT rtMemHeapGetDefBlkSize (ASN1CTXT *pctxt)
EXTERNRT void rtMemBufInit (ASN1CTXT *pCtxt, ASN1MemBuf *pMemBuf, ASN1UINT segsize)
EXTERNRT void rtMemBufInitBuffer (ASN1CTXT *pCtxt, ASN1MemBuf *pMemBuf, ASN1OCTET *buf, ASN1UINT bufsize, ASN1UINT segsize)
EXTERNRT void rtMemBufFree (ASN1MemBuf *pMemBuf)
EXTERNRT int rtMemBufAppend (ASN1MemBuf *pMemBuf, ASN1OCTET *pdata, ASN1UINT nbytes)
EXTERNRT void rtMemBufReset (ASN1MemBuf *pMemBuf)
EXTERNRT int rtMemBufTrimW (ASN1MemBuf *pMemBuf)
EXTERNRT int rtMemBufSet (ASN1MemBuf *pMemBuf, ASN1OCTET value, ASN1UINT nbytes)
EXTERNRT ASN1OCTET * rtMemBufGetData (ASN1MemBuf *pMemBuf, int *length)
EXTERNRT int rtMemBufGetDataLen (ASN1MemBuf *pMemBuf)
EXTERNRT int rtMemBufPreAllocate (ASN1MemBuf *pMemBuf, ASN1UINT nbytes)
EXTERNRT int rtInitContextBuffer (ASN1CTXT *ctxt_p, ASN1ConstOctetPtr bufaddr, ASN1UINT bufsiz)
EXTERNRT int rtInitContext (ASN1CTXT *ctxt_p)
EXTERNRT int rtInitContextExt (ASN1CTXT *ctxt_p)
EXTERNRT ASN1CTXT * rtNewContext ()
EXTERNRT int rtReadNextByte (ASN1CTXT *pCtxt)
EXTERNRT void rtSetCopyValues (ASN1CTXT *ctxt_p, ASN1BOOL value)
EXTERNRT void rtSetFastCopy (ASN1CTXT *ctxt_p, ASN1BOOL value)
EXTERNRT void rtSetDiag (int value)
EXTERNRT void rtSetOID (ASN1OBJID *ptarget, ASN1OBJID *psource)
EXTERNRT void rtAddOID (ASN1OBJID *ptarget, ASN1OBJID *psource)
EXTERNRT int rtSetBit (ASN1OCTET *pBits, int numbits, int bitIndex)
EXTERNRT int rtClearBit (ASN1OCTET *pBits, int numbits, int bitIndex)
EXTERNRT ASN1BOOL rtTestBit (ASN1ConstOctetPtr pBits, int numbits, int bitIndex)
EXTERNRT void rtSListInit (Asn1RTSList *pList)
EXTERNRT void rtSListInitEx (ASN1CTXT *pctxt, Asn1RTSList *pList)
EXTERNRT void rtSListFree (Asn1RTSList *pList)
EXTERNRT Asn1RTSList * rtSListCreate ()
EXTERNRT Asn1RTSList * rtSListCreateEx (ASN1CTXT *pctxt)
EXTERNRT Asn1RTSListNode * rtSListAppend (Asn1RTSList *pList, void *pData)
EXTERNRT ASN1BOOL rtSListFind (Asn1RTSList *pList, void *pData)
EXTERNRT void rtSListRemove (Asn1RTSList *pList, void *pData)
EXTERNRT Asn1RTStack * rtStackCreate ()
EXTERNRT Asn1RTStack * rtStackCreateEx (ASN1CTXT *pctxt)
EXTERNRT void rtStackInit (Asn1RTStack *pStack)
EXTERNRT void * rtStackPop (Asn1RTStack *pStack)
EXTERNRT int rtStackPush (Asn1RTStack *pStack, void *pData)
EXTERNRT int rtWriteBytes (ASN1CTXT *pctxt, ASN1ConstOctetPtr pdata, ASN1UINT nocts)
EXTERNRT ASN1REAL rtGetPlusInfinity ()
EXTERNRT ASN1REAL rtGetMinusInfinity ()
EXTERNRT ASN1ConstCharPtr rtBitStrToString (ASN1UINT numbits, ASN1ConstOctetPtr data, char *buffer, ASN1UINT bufsiz)
EXTERNRT ASN1ConstCharPtr rtBoolToString (ASN1BOOL value)
EXTERNRT ASN1ConstCharPtr rtIntToString (ASN1INT value, char *buffer, int bufsiz)
EXTERNRT ASN1ConstCharPtr rtInt64ToString (ASN1INT64 value, char *buffer, int bufsiz)
EXTERNRT ASN1ConstCharPtr rtUIntToString (ASN1UINT value, char *buffer, int bufsiz)
EXTERNRT ASN1ConstCharPtr rtUInt64ToString (ASN1UINT64 value, char *buffer, int bufsiz)
EXTERNRT ASN1ConstCharPtr rtOIDToString (ASN1UINT numids, ASN1UINT *data, char *buffer, ASN1UINT bufsiz)
EXTERNRT ASN1ConstCharPtr rtOID64ToString (ASN1UINT numids, ASN1UINT64 *data, char *buffer, ASN1UINT bufsiz)
EXTERNRT ASN1ConstCharPtr rtOctStrToString (ASN1UINT numocts, ASN1ConstOctetPtr data, char *buffer, ASN1UINT bufsiz)
EXTERNRT ASN1ConstCharPtr rtTagToString (ASN1TAG tag, char *buffer, ASN1UINT bufsiz)
EXTERNRT ASN1ConstCharPtr rtBCDToString (ASN1UINT numocts, ASN1ConstOctetPtr data, char *buffer, ASN1UINT bufsiz)
EXTERNRT int rtStringToBCD (ASN1ConstCharPtr str, ASN1OCTET *bcdStr, ASN1UINT bufsiz)
EXTERNRT ASN1ConstCharPtr rtBMPToCString (ASN1BMPString *pBMPString, char *cstring, ASN1UINT cstrsize)
EXTERNRT ASN1ConstCharPtr rtBMPToNewCString (ASN1BMPString *pBMPString)
EXTERNRT ASN1ConstCharPtr rtBMPToNewCStringEx (ASN1CTXT *pctxt, ASN1BMPString *pBMPString)
EXTERNRT ASN1BMPString * rtCToBMPString (ASN1CTXT *ctxt_p, ASN1ConstCharPtr cstring, ASN1BMPString *pBMPString, Asn116BitCharSet *pCharSet)
EXTERNRT ASN1BOOL rtIsIn16BitCharSet (ASN116BITCHAR ch, Asn116BitCharSet *pCharSet)
EXTERNRT ASN1ConstCharPtr rtUCSToCString (ASN1UniversalString *pUCSString, char *cstring, ASN1UINT cstrsize)
EXTERNRT ASN1ConstCharPtr rtUCSToNewCString (ASN1UniversalString *pUCSString)
EXTERNRT ASN1ConstCharPtr rtUCSToNewCStringEx (ASN1CTXT *pctxt, ASN1UniversalString *pUCSString)
EXTERNRT ASN1UniversalString * rtCToUCSString (ASN1CTXT *ctxt_p, ASN1ConstCharPtr cstring, ASN1UniversalString *pUCSString, Asn132BitCharSet *pCharSet)
EXTERNRT ASN1BOOL rtIsIn32BitCharSet (ASN132BITCHAR ch, Asn132BitCharSet *pCharSet)
EXTERNRT wchar_t * rtUCSToWCSString (ASN1UniversalString *pUCSString, wchar_t *wcstring, ASN1UINT wcstrsize)
EXTERNRT ASN1UniversalString * rtWCSToUCSString (ASN1CTXT *ctxt_p, wchar_t *wcstring, ASN1UniversalString *pUCSString, Asn132BitCharSet *pCharSet)
EXTERNRT int rtUTF8ToWCS (ASN1CTXT *pCtxt, ASN1UTF8String inbuf, wchar_t *outbuf, size_t outbufsiz)
EXTERNRT int rtWCSToUTF8 (ASN1CTXT *pCtxt, wchar_t *inbuf, size_t inlen, ASN1OCTET *outbuf, size_t outbufsiz)
EXTERNRT int rtValidateUTF8 (ASN1CTXT *pCtxt, ASN1UTF8String inbuf)
EXTERNRT int rtUTF8Len (ASN1UTF8String inbuf)
EXTERNRT int rtUTF8CharSize (ASN132BITCHAR wc)
EXTERNRT int rtUTF8EncodeChar (ASN132BITCHAR wc, ASN1OCTET *buf, int bufsiz)
EXTERNRT int rtUTF8DecodeChar (ASN1CTXT *pCtxt, ASN1UTF8String pinbuf, int *pInsize)
EXTERNRT void rtBigIntInit (ASN1BigInt *pInt)
EXTERNRT int rtBigIntSetStr (ASN1CTXT *pCtxt, ASN1BigInt *pInt, ASN1ConstCharPtr value, int radix)
EXTERNRT int rtBigIntSetInt64 (ASN1CTXT *pCtxt, ASN1BigInt *pInt, ASN1INT64 value)
EXTERNRT int rtBigIntSetBytes (ASN1CTXT *pCtxt, ASN1BigInt *pInt, ASN1OCTET *value, int vallen)
EXTERNRT int rtBigIntGetDataLen (ASN1BigInt *pInt)
EXTERNRT int rtBigIntGetData (ASN1CTXT *pCtxt, ASN1BigInt *pInt, ASN1OCTET *buffer, int bufSize)
EXTERNRT int rtBigIntDigitsNum (ASN1BigInt *pInt, int radix)
EXTERNRT int rtBigIntCopy (ASN1CTXT *pCtxt, const ASN1BigInt *pSrc, ASN1BigInt *pDst)
EXTERNRT int rtBigIntFastCopy (ASN1CTXT *pCtxt, ASN1BigInt *pSrc, ASN1BigInt *pDst)
EXTERNRT int rtBigIntToString (ASN1CTXT *pCtxt, ASN1BigInt *pInt, int radix, char *str, int strSize)
EXTERNRT int rtBigIntPrint (ASN1ConstCharPtr name, ASN1BigInt *bigint, int radix)
EXTERNRT int rtBigIntCompare (const ASN1BigInt *arg1, const ASN1BigInt *arg2)
EXTERNRT int rtBigIntStrCompare (ASN1CTXT *pCtxt, ASN1ConstCharPtr arg1, ASN1ConstCharPtr arg2)
EXTERNRT void rtBigIntFree (ASN1CTXT *pCtxt, ASN1BigInt *pInt)
EXTERNRT int rtFileReadBinary (ASN1CTXT *pctxt, ASN1ConstCharPtr filePath, ASN1OCTET **ppMsgBuf, int *pLength)

Variables

int g_debug


Detailed Description

Common ASN.1 runtime constants, data structure definitions, and run-time functions to support the BER/DER/PER/XER as defined in the ITU-T standards.

Define Documentation

#define ALLOC_ASN1ARRAY pctxt,
pseqof,
type   ) 
 

Value:

do {\
if (sizeof(type)*(pseqof)->n < (pseqof)->n) return ASN_E_NOMEM; \
if (((pseqof)->elem = (type*) rtMemAlloc \
(pctxt, sizeof(type)*(pseqof)->n)) == 0) return ASN_E_NOMEM; \
} while (0)

#define ALLOC_ASN1ARRAY1 pctxt,
pseqof,
type   ) 
 

Value:

do {\
if (sizeof(type)*(pseqof)->n < (pseqof)->n) (pseqof)->elem = 0; \
else (pseqof)->elem = (type*) rtMemAlloc \
(pctxt, sizeof(type)*(pseqof)->n); \
} while (0)

#define ALLOC_ASN1ARRAY2 pctxt,
n,
type   ) 
 

Value:

((type*) ((sizeof(type)*n < n) ? 0 : \
rtMemAlloc (pctxt, sizeof(type)*n)))

#define ALLOC_ASN1ELEMDNODE pctxt,
type   ) 
 

Value:

(type*) (((char*)rtMemAllocZ (pctxt, sizeof(type) + \
sizeof(Asn1RTDListNode))) + sizeof(Asn1RTDListNode))

#define ALLOC_ASN1ELEMSNODE pctxt,
type   ) 
 

Value:

(type*) (((char*)rtMemAllocZ (pctxt, sizeof(type) + \
sizeof(Asn1RTSListNode))) + sizeof(Asn1RTSListNode))

#define HEXCHARTONIBBLE ch,
 ) 
 

Value:

if (ch >= '0' && ch <= '9') b = (unsigned char)(ch - '0'); \
else if (ch >= 'a' && ch <= 'f') b = (unsigned char)((ch - 'a') + 10); \
else if (ch >= 'A' && ch <= 'F') b = (unsigned char)((ch - 'A') + 10); \
else b = 0xFF;

#define NIBBLETOHEXCHAR b,
ch   ) 
 

Value:

if (b >= 0 && b <= 9) ch = (char)(b + '0'); \
else if (b >= 0x0a && b <= 0x0f) ch = (char)((b - 10)+ 'a'); \
else ch = '?';

#define REALLOC_ASN1ARRAY pctxt,
pseqof,
type   ) 
 

Value:

do {\
if (sizeof(type)*(pseqof)->n < (pseqof)->n) return ASN_E_NOMEM; \
if (((pseqof)->elem = (type*) rtMemRealloc \
(pctxt, (pseqof)->elem, sizeof(type)*(pseqof)->n)) == 0) return ASN_E_NOMEM; \
} while (0)

#define rtSetStrToBigInt   rtBigIntSetStr
 

bigintf


Function Documentation

EXTERNRT int rtClearBit ASN1OCTET *  pBits,
int  numbits,
int  bitIndex
 

This function clears specified bit in the bit string.

Parameters:
pBits Pointer to octets of bit string.
numbits Number of bits in the bit string.
bitIndex Index of bit to be cleared. The bit with index 0 is a most significant bit in the octet with index 0.
Returns:
If successful, returns the previous state of bit. If bit was set the return value is positive, if bit was not set the return value is zero. Otherwise, return value is an error code:
  • ASN_E_OUTOFBND = bitIndex is out of bound (see errno)

EXTERNRT int rtFileReadBinary ASN1CTXT *  pctxt,
ASN1ConstCharPtr  filePath,
ASN1OCTET **  ppMsgBuf,
int *  pLength
 

This function reads the entire contents of a binary file into memory. A memory buffer is allocated for the file contents using the ASN1C run-time memory management functions.

Parameters:
pctxt Pointer to context block structure.
filePath Complete file path name of file to read.
ppMsgBuf Pointer to message buffer to receive allocated memory pointer.
pLength Pointer to integer to receive length of data read.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • ASN_E_FILNOTFOU = file not found
  • ASN_E_FILEREAD = file read error (see errno)

EXTERNRT void rtFreeContext ASN1CTXT *  ctxt_p  ) 
 

This function frees all dynamic memory associated with a context. This includes all memory inside the block (in particular, the list of memory blocks used by the rtMem functions) as well as the block itself if allocated with the rtNewContext function

Parameters:
ctxt_p A pointer to a context structure.

EXTERNRT void rtHexDump ASN1ConstOctetPtr  data,
ASN1UINT  numocts
 

The rtHexDump function outputs a hexadecimal dump of the current buffer contents to stdout. There is also a macro associated with rtHexDump. This macro is RTHEXDUMP and is defined in the asn1type.h header file. It allows a dump function to be complied in or out of the object code generated by the C/C++ complier by using a preprocessor variable (_TRACE).

Parameters:
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.

EXTERNRT void rtHexDumpEx ASN1ConstOctetPtr  data,
ASN1UINT  numocts,
int  bytesPerUnit
 

This function outputs a hexadecimal dump of the current buffer contents to stdout, but it may display the dump as an array or bytes, words, or double words.

Parameters:
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 (word), or 4 (double word).

EXTERNRT void rtHexDumpToFile FILE *  fp,
ASN1ConstOctetPtr  data,
ASN1UINT  numocts
 

This function outputs a hexadecimal dump of the current buffer contents to a file.

Parameters:
fp A pointer to FILE structure. The file should be opened for writing.
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed

EXTERNRT void rtHexDumpToFileEx FILE *  fp,
ASN1ConstOctetPtr  data,
ASN1UINT  numocts,
int  bytesPerUnit
 

This function outputs a hexadecimal dump of the current buffer to a file, but it may output the dump as an array of bytes, words, or double words.

Parameters:
fp A pointer to FILE structure. The file should be opened for writing.
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 (word), or 4 (double word).

EXTERNRT int rtHexDumpToString ASN1ConstOctetPtr  data,
ASN1UINT  numocts,
char *  buffer,
int  bufferIndex,
int  bufferSize
 

This function formats a hexadecimal dump of the current buffer contents to a string.

Parameters:
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
buffer The destination string buffer.
bufferIndex The starting position in the destination buffer. The formatting of the dump will begin at this position.
bufferSize The total size of the destination buffer.

EXTERNRT int rtHexDumpToStringEx ASN1ConstOctetPtr  data,
ASN1UINT  numocts,
char *  buffer,
int  bufferIndex,
int  bufferSize,
int  bytesPerUnit
 

This fucntion formats a hexadecimal dumpof the current buffer contents to a string, but it may output the dump as an array of bytes, words, or double words.

Parameters:
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
buffer The destination string buffer.
bufferIndex The starting position in the destination buffer. The formatting of the dump will begin at this position.
bufferSize The total size of the destination buffer.
bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 (word), or 4 (double word).

EXTERNRT int rtSetBit ASN1OCTET *  pBits,
int  numbits,
int  bitIndex
 

This function sets specified bit in the bit string.

Parameters:
pBits Pointer to octets of bit string.
numbits Number of bits in the bit string.
bitIndex Index of bit to be set. The bit with index 0 is a most significant bit in the octet with index 0.
Returns:
If successful, returns the previous state of bit. If bit was set the return value is positive, if bit was not set the return value is zero. Otherwise, return value is an error code:
  • ASN_E_OUTOFBND = bitIndex is out of bound (see errno)

EXTERNRT ASN1BOOL rtTestBit ASN1ConstOctetPtr  pBits,
int  numbits,
int  bitIndex
 

This function tests specified bit in the bit string.

Parameters:
pBits Pointer to octets of bit string.
numbits Number of bits in the bit string.
bitIndex Index of bit to be tested. The bit with index 0 is a most significant bit in the octet with index 0.
Returns:
True if bit set or false if not set or array index is beyond range of number of bits in the string.

EXTERNRT int rtWriteBytes ASN1CTXT *  pctxt,
ASN1ConstOctetPtr  pdata,
ASN1UINT  nocts
 

llsutil


This file was last modified on 11 Jun 2003.
ASN1C Run-time Common Function, Version 5.5