Home > Support > Documentation

asn1per.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1997-2006 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00024 
00025 /*
00026 // CHANGE LOG
00027 // Date         Init    Description
00028 // 04/30/02     AB      Added Universal string routines
00029 // 05/08/02     AB      Added p?_oid64 prototypes
00030 // 05/10/02     AB      Added RELATIVE-OID
00031 // 10/15/02     ED      Changes to PER permitted alphabet constraint
00032 //                      handling.
00033 // 10/27/02     AB      Int64/UInt64 encode/decode funcs added
00034 // 11/06/02     AB      PD_BYTE_ALIGN0 added
00035 // 10/31/03     CZ      Expand mainpage text.
00036 //
00038 */
00074 #ifndef _OSRTPER_H_
00075 #define _OSRTPER_H_
00076 
00077 #include "rtsrc/asn1type.h"
00078 #include "rtsrc/asn1CharSet.h"
00079 
00092 /* The following constant is stored in an enumerated value if the       */
00093 /* parsed value is not within the defined set of extended enum values   */
00094 /* (note: this is only done in the case of PER because the actual value */
00095 /* is not known - in BER, the actual value is stored)..                 */
00096 
00097 #define ASN_K_EXTENUM   999
00098 
00099 /* 
00100 *Structure to track encoded PER fields 
00101 */
00102 
00103 typedef struct PERField {
00104    const char* name;
00105    size_t       bitOffset;
00106    size_t       numbits;
00107 } PERField;
00108 
00109 /* 
00110 *Structure to track encoded PER fields 
00111 */
00112 typedef struct {
00113    unsigned char lb, lbm;
00114    char fmtBitBuffer[40], fmtHexBuffer[10], fmtAscBuffer[10];
00115    int  fmtBitCharIdx, fmtHexCharIdx, fmtAscCharIdx;
00116 } BinDumpBuffer;
00117 
00118 /* Macro to create a character set */
00119 
00120 #define PU_SETCHARSET(csetvar, canset, abits, ubits) \
00121 csetvar.charSet.nchars = 0; \
00122 csetvar.canonicalSet = canset; \
00123 csetvar.canonicalSetSize = sizeof(canset)-1; \
00124 csetvar.canonicalSetBits = pu_bitcnt(csetvar.canonicalSetSize); \
00125 csetvar.charSetUnalignedBits = ubits; \
00126 csetvar.charSetAlignedBits = abits;
00127 
00128 
00129 /* Macros */
00130 
00131 #ifdef _TRACE
00132 #define PU_INSLENFLD(pctxt)       pu_insLenField(pctxt)
00133 #define PU_NEWFIELD(pctxt,suffix) pu_newField(pctxt,suffix)
00134 #define PU_PUSHNAME(pctxt,name)   pu_pushName(pctxt,name)
00135 #define PU_POPNAME(pctxt)         pu_popName(pctxt)
00136 #define PU_SETBITOFFSET(pctxt)    pu_setFldBitOffset(pctxt)
00137 #define PU_SETBITCOUNT(pctxt)     pu_setFldBitCount(pctxt)
00138 #define PU_PUSHELEMNAME(pctxt,idx) pu_pushElemName(pctxt,idx)
00139 #else
00140 #define PU_INSLENFLD(pctxt)
00141 #define PU_NEWFIELD(pctxt,suffix)
00142 #define PU_PUSHNAME(pctxt,name)
00143 #define PU_POPNAME(pctxt)
00144 #define PU_SETBITOFFSET(pctxt)
00145 #define PU_SETBITCOUNT(pctxt)
00146 #define PU_PUSHELEMNAME(pctxt,idx)
00147 #endif
00148 
00149 #ifdef __cplusplus
00150 extern "C" {
00151 #endif
00152 
00153 #ifdef BUILDASN1PERDLL
00154 #define EXTERNPER __declspec(dllexport)
00155 #elif defined (USEASN1PERDLL)
00156 #define EXTERNPER __declspec(dllimport)
00157 #else
00158 #define EXTERNPER
00159 #endif /* BUILDASN1PERDLL */
00160 
00161 /* Function prototypes */
00162 
00163 #define PD_INCRBITIDX(pctxt) \
00164 ((--(pctxt)->buffer.bitOffset < 0) ? \
00165 ((++(pctxt)->buffer.byteIndex >= (pctxt)->buffer.size) ? RTERR_ENDOFBUF : \
00166 ((pctxt)->buffer.bitOffset = 7, 0)) : 0)
00167 
00168 /* This macro is an optimized version of pd_bit function */
00169 
00170 #define PD_BIT(pctxt,pvalue) \
00171 ((PD_INCRBITIDX (pctxt) != 0) ? RTERR_ENDOFBUF : ((pvalue) ? \
00172 ((*(pvalue) = (OSOCTET)((((pctxt)->buffer.data[(pctxt)->buffer.byteIndex]) & \
00173 (OSINTCONST(1) << (pctxt)->buffer.bitOffset)) != 0)), 0) : 0 ))
00174 
00175 /* This macro is an optimized version of pu_getSizeConstraint function */
00176 
00177 #define PU_GETSIZECONSTRAINT(pctxt,extbit,pSize) \
00178 ((((pSize) = ACINFO(pctxt)->pSizeConstraint) != 0) ? \
00179 ((((pSize) = ACINFO(pctxt)->pSizeConstraint)->extended == extbit)?(pSize) : \
00180 pu_getSizeConstraint (pctxt,extbit)) : NULL)
00181 
00182 /* This macro calculates the relative bit offset to the current buffer position. */
00183 
00184 #define PU_GETCTXTBITOFFSET(pctxt) \
00185 (((pctxt)->buffer.byteIndex * 8) + (8 - (pctxt)->buffer.bitOffset))
00186 
00187 /* This macro sets the bit offset to the given value within the context */
00188 
00189 #define PU_SETCTXTBITOFFSET(pctxt,_bitOffset) \
00190 do { \
00191 (pctxt)->buffer.byteIndex = (_bitOffset / 8); \
00192 (pctxt)->buffer.bitOffset = (OSUINT16)(8 - (_bitOffset % 8)); \
00193 } while(0)
00194 
00195 /* These macros are an optimized version of pd_byte_align function */
00196 
00197 #define PD_BYTE_ALIGN0(pctxt) \
00198 ((!(pctxt)->buffer.aligned) ? 0 : \
00199 (((pctxt)->buffer.bitOffset != 8) ? ( \
00200 (pctxt)->buffer.byteIndex++,       \
00201 (pctxt)->buffer.bitOffset = 8,     \
00202 0) : 0                    \
00203 ))
00204 
00205 #ifdef _TRACE
00206 #define PD_BYTE_ALIGN(pctxt) \
00207 ((!(pctxt)->buffer.aligned) ? 0 : \
00208 (((pctxt)->buffer.bitOffset != 8) ? ( \
00209 (pctxt)->buffer.byteIndex++,       \
00210 (pctxt)->buffer.bitOffset = 8,     \
00211 pu_setFldBitOffset(pctxt),         \
00212 0) : 0                    \
00213 ))
00214 #else
00215 #define PD_BYTE_ALIGN PD_BYTE_ALIGN0
00216 #endif
00217 
00218 #define PD_CHECKSEQOFLEN(pctxt,numElements,minElemBits) \
00219 ((pctxt->buffer.size > 0) ?  \
00220 (((numElements * minElemBits) > (pctxt->buffer.size * 8)) ? \
00221 ASN_E_INVLEN : 0) : 0)
00222 
00254 EXTERNPER int pd_bit (OSCTXT* pctxt, OSBOOL* pvalue);
00255 
00271 EXTERNPER int pd_bits 
00272 (OSCTXT* pctxt, OSUINT32* pvalue, OSUINT32 nbits);
00273 
00294 EXTERNPER int pd_BigInteger 
00295 (OSCTXT *pctxt, const char** ppvalue);
00296 
00317 EXTERNPER int pd_BitString 
00318 (OSCTXT* pctxt, OSUINT32* numbits_p, OSOCTET* buffer,
00319  OSUINT32 bufsiz);
00320 
00345 EXTERNPER int pd_BMPString 
00346 (OSCTXT* pctxt, ASN1BMPString* pvalue, Asn116BitCharSet* permCharSet);
00347 
00371 EXTERNPER int pd_UniversalString 
00372 (OSCTXT* pctxt, ASN1UniversalString* pvalue, Asn132BitCharSet* permCharSet);
00373 
00385 EXTERNPER int pd_byte_align (OSCTXT* pctxt);
00386 
00397 EXTERNPER int pd_ChoiceOpenTypeExt 
00398 (OSCTXT* pctxt, const OSOCTET** object_p2, OSUINT32* pnumocts);
00399 
00412 EXTERNPER int pd_ConsInteger 
00413 (OSCTXT* pctxt, OSINT32* pvalue, OSINT32 lower, OSINT32 upper);
00414 
00428 EXTERNPER int pd_ConsInt8 
00429 (OSCTXT* pctxt, OSINT8* pvalue, OSINT32 lower, OSINT32 upper);
00430 
00444 EXTERNPER int pd_ConsInt16 (OSCTXT* pctxt, 
00445                             OSINT16* pvalue, OSINT32 lower, OSINT32 upper);
00446 
00460 EXTERNPER int pd_ConsInt64 (OSCTXT* pctxt, 
00461                             OSINT64* pvalue, OSINT64 lower, OSINT64 upper);
00462 
00476 EXTERNPER int pd_ConsUnsigned 
00477 (OSCTXT* pctxt, OSUINT32* pvalue, OSUINT32 lower, OSUINT32 upper);
00478 
00492 EXTERNPER int pd_ConsUInt8 (OSCTXT* pctxt, 
00493                             OSUINT8* pvalue, OSUINT32 lower, OSUINT32 upper);
00494 
00508 EXTERNPER int pd_ConsUInt16 
00509 (OSCTXT* pctxt, OSUINT16* pvalue, OSUINT32 lower, OSUINT32 upper);
00510 
00524 EXTERNPER int pd_ConsUInt64 (OSCTXT* pctxt, OSUINT64* pvalue, 
00525                              OSUINT64 lower, OSUINT64 upper);
00526 
00544 EXTERNPER int pd_ConsWholeNumber 
00545 (OSCTXT* pctxt, OSUINT32* padjusted_value, OSUINT32 range_value);
00546 
00564 EXTERNPER int pd_ConsWholeNumber64 
00565 (OSCTXT* pctxt, OSUINT64* padjusted_value, OSUINT64 range_value);
00566 
00583 EXTERNPER int pd_ConstrainedString 
00584 (OSCTXT* pctxt, const char** string, Asn1CharSet* pCharSet);
00585 
00605 EXTERNPER int pd_ConstrainedStringEx 
00606 (OSCTXT* pctxt, const char** string, const char* charSet,
00607  OSUINT32 abits, OSUINT32 ubits, OSUINT32 canSetBits);
00608 
00631 EXTERNPER int pd_16BitConstrainedString 
00632 (OSCTXT* pctxt, Asn116BitCharString* pString, Asn116BitCharSet* pCharSet);
00633 
00656 EXTERNPER int pd_32BitConstrainedString 
00657 (OSCTXT* pctxt, Asn132BitCharString* pString, Asn132BitCharSet* pCharSet);
00658 
00681 EXTERNPER int pd_DynBitString 
00682 (OSCTXT* pctxt, ASN1DynBitStr* pBitStr);
00683 
00700 EXTERNPER int pd_DynOctetString 
00701 (OSCTXT* pctxt, ASN1DynOctStr* pOctStr);
00702 
00713 EXTERNPER int pd_GetComponentLength 
00714 (OSCTXT* pctxt, OSUINT32 itemBits);
00715 
00729 EXTERNPER int pd_Length (OSCTXT* pctxt, OSUINT32* pvalue);
00730 
00738 EXTERNPER int pd_moveBitCursor (OSCTXT* pctxt, int bitOffset);
00739 
00752 EXTERNPER int pd_ObjectIdentifier (OSCTXT* pctxt, ASN1OBJID* pvalue);
00753 
00767 EXTERNPER int pd_oid64 (OSCTXT* pctxt, ASN1OID64* pvalue);
00768 
00781 EXTERNPER int pd_RelativeOID (OSCTXT* pctxt, ASN1OBJID* pvalue);
00782 
00801 EXTERNPER int pd_OctetString 
00802 (OSCTXT* pctxt, OSUINT32* pnumocts, OSOCTET* buffer,
00803  OSUINT32 bufsiz);
00804 
00822 EXTERNPER int pd_OpenType 
00823 (OSCTXT* pctxt, const OSOCTET** object_p2, OSUINT32* pnumocts);
00824 
00846 EXTERNPER int pd_OpenTypeExt 
00847 (OSCTXT* pctxt, const OSOCTET** object_p2, OSUINT32* pnumocts);
00848 
00862 EXTERNPER int pd_Real 
00863 (OSCTXT* pctxt, OSREAL* pvalue);
00864 
00880 EXTERNPER int pd_SmallNonNegWholeNumber 
00881 (OSCTXT* pctxt, OSUINT32* pvalue);
00882 
00894 EXTERNPER int pd_SemiConsInteger 
00895    (OSCTXT* pctxt, OSINT32* pvalue, OSINT32 lower);
00896 
00909 EXTERNPER int pd_SemiConsUnsigned 
00910    (OSCTXT* pctxt, OSUINT32* pvalue, OSUINT32 lower);
00911 
00924 EXTERNPER int pd_SemiConsInt64 
00925    (OSCTXT* pctxt, OSINT64* pvalue, OSINT64 lower);
00926 
00939 EXTERNPER int pd_SemiConsUInt64 
00940    (OSCTXT* pctxt, OSUINT64* pvalue, OSUINT64 lower);
00941 
00942 
00952 EXTERNPER int pd_UnconsInteger (OSCTXT *pctxt, OSINT32* pvalue);
00953 
00964 #define pd_UnconsUnsigned(pctxt,pvalue) \
00965 pd_SemiConsUnsigned(pctxt, pvalue, 0U)
00966 
00977 EXTERNPER int pd_UnconsInt64 (OSCTXT *pctxt, OSINT64* pvalue);
00978 
00989 #define pd_UnconsUInt64(pctxt,pvalue) \
00990 pd_SemiConsUInt64(pctxt, pvalue, 0)
00991 
01003 EXTERNPER int pd_VarWidthCharString (OSCTXT* pctxt, const char** pvalue);
01004 
01018 EXTERNPER int pd_Real10 (OSCTXT *pctxt, const char** ppvalue); 
01019 
01022 /* Encode functions */
01066 EXTERNPER int pe_16BitConstrainedString 
01067 (OSCTXT* pctxt, Asn116BitCharString value, Asn116BitCharSet* pCharSet);
01068 
01091 EXTERNPER int pe_32BitConstrainedString 
01092 (OSCTXT* pctxt, Asn132BitCharString value, Asn132BitCharSet* pCharSet);
01093 
01104 EXTERNPER int pe_2sCompBinInt 
01105 (OSCTXT* pctxt, OSINT32 value);
01106 
01117 EXTERNPER int pe_2sCompBinInt64 (OSCTXT* pctxt, OSINT64 value);
01118 
01125 EXTERNPER int pe_aligned_octets 
01126 (OSCTXT* pctxt, OSOCTET* pvalue, OSUINT32 nocts);
01127 
01147 EXTERNPER int pe_BigInteger 
01148 (OSCTXT* pctxt, const char* pvalue);
01149 
01159 EXTERNPER int pe_bit 
01160 (OSCTXT* pctxt, OSBOOL value);
01161 
01172 EXTERNPER int pe_bits 
01173 (OSCTXT* pctxt, OSUINT32 value, OSUINT32 nbits);
01174 
01187 EXTERNPER int pe_bits64 (OSCTXT* pctxt, OSUINT64 value, OSUINT32 nbits);
01188 
01202 EXTERNPER int pe_BitString 
01203 (OSCTXT* pctxt, OSUINT32 numocts, const OSOCTET* data);
01204 
01228 EXTERNPER int pe_BMPString 
01229 (OSCTXT* pctxt, ASN1BMPString value, Asn116BitCharSet* permCharSet);
01230 
01254 EXTERNPER int pe_UniversalString 
01255 (OSCTXT* pctxt, ASN1UniversalString value, Asn132BitCharSet* permCharSet);
01256 
01268 EXTERNPER int pe_byte_align (OSCTXT* pctxt);
01269 
01285 EXTERNPER int pe_CheckBuffer (OSCTXT* pctxt, size_t nbytes);
01286 
01298 EXTERNPER int pe_ChoiceTypeExt 
01299 (OSCTXT* pctxt, OSUINT32 numocts, const OSOCTET* data);
01300 
01313 EXTERNPER int pe_ConsInteger 
01314 (OSCTXT* pctxt, OSINT32 value, OSINT32 lower, OSINT32 upper);
01315 
01328 EXTERNPER int pe_ConsInt64 (OSCTXT* pctxt, 
01329                             OSINT64 value, OSINT64 lower, OSINT64 upper);
01330 
01342 EXTERNPER int pe_ConstrainedString 
01343 (OSCTXT* pctxt, const char* string, Asn1CharSet* pCharSet);
01344 
01362 EXTERNPER int pe_ConstrainedStringEx 
01363 (OSCTXT* pctxt, const char* string, const char* charSet,
01364  OSUINT32 abits, OSUINT32 ubits, OSUINT32 canSetBits);
01365 
01381 EXTERNPER int pe_ConsUnsigned 
01382 (OSCTXT* pctxt, OSUINT32 value, OSUINT32 lower, OSUINT32 upper);
01383 
01403 EXTERNPER int pe_ConsUInt64 (OSCTXT* pctxt, OSUINT64 value, 
01404                              OSUINT64 lower, OSUINT64 upper);
01405 
01421 EXTERNPER int pe_ConsWholeNumber 
01422 (OSCTXT* pctxt, OSUINT32 adjusted_value, OSUINT32 range_value);
01423 
01439 EXTERNPER int pe_ConsWholeNumber64 
01440 (OSCTXT* pctxt, OSUINT64 adjusted_value, OSUINT64 range_value);
01441 
01455 EXTERNPER int pe_ExpandBuffer (OSCTXT* pctxt, size_t nbytes);
01456 
01460 EXTERNPER OSUINT32 pe_GetIntLen (OSUINT32 value);
01461 
01467 EXTERNPER size_t pe_GetMsgBitCnt (OSCTXT* pctxt);
01468 
01487 EXTERNPER OSOCTET* pe_GetMsgPtr (OSCTXT* pctxt, OSINT32* pLength);
01488 
01499 EXTERNPER OSOCTET* pe_GetMsgPtrU (OSCTXT* pctxt, OSUINT32* pLength);
01500 
01512 EXTERNPER int pe_Length (OSCTXT* pctxt, OSUINT32 value);
01513 
01524 EXTERNPER int pe_NonNegBinInt (OSCTXT* pctxt, OSUINT32 value);
01525 
01536 EXTERNPER int pe_NonNegBinInt64 (OSCTXT* pctxt, OSUINT64 value);
01537 
01550 EXTERNPER int pe_ObjectIdentifier (OSCTXT* pctxt, ASN1OBJID* pvalue);
01551 
01565 EXTERNPER int pe_oid64 (OSCTXT* pctxt, ASN1OID64* pvalue);
01566 
01579 EXTERNPER int pe_RelativeOID (OSCTXT* pctxt, ASN1OBJID* pvalue);
01580 
01594 EXTERNPER int pe_octets 
01595 (OSCTXT* pctxt, const OSOCTET* pvalue, OSUINT32 nbits);
01596 
01609 EXTERNPER int pe_OctetString 
01610 (OSCTXT* pctxt, OSUINT32 numocts, const OSOCTET* data);
01611 
01627 EXTERNPER int pe_OpenType 
01628 (OSCTXT* pctxt, OSUINT32 numocts, const OSOCTET* data);
01629 
01648 EXTERNPER int pe_OpenTypeExt 
01649 (OSCTXT* pctxt, OSRTDList* pElemList);
01650 
01660 EXTERNPER int pe_OpenTypeExtBits 
01661 (OSCTXT* pctxt, OSRTDList* pElemList);
01662 
01680 EXTERNPER int pe_Real (OSCTXT* pctxt, OSREAL value);
01681 
01696 EXTERNPER int pe_SmallNonNegWholeNumber (OSCTXT* pctxt, OSUINT32 value);
01697 
01709 EXTERNPER int pe_SemiConsInteger 
01710    (OSCTXT* pctxt, OSINT32 value, OSINT32 lower);
01711 
01723 EXTERNPER int pe_SemiConsInt64 
01724    (OSCTXT* pctxt, OSINT64 value, OSINT64 lower);
01725 
01737 EXTERNPER int pe_SemiConsUnsigned 
01738    (OSCTXT* pctxt, OSUINT32 value, OSUINT32 lower);
01739 
01752 EXTERNPER int pe_SemiConsUInt64 
01753    (OSCTXT* pctxt, OSUINT64 value, OSUINT64 lower);
01754 
01764 EXTERNPER int pe_UnconsLength (OSCTXT* pctxt, OSUINT32 value);
01765 
01775 EXTERNPER int pe_UnconsInteger (OSCTXT* pctxt, OSINT32 value);
01776 
01786 EXTERNPER int pe_UnconsInt64 (OSCTXT* pctxt, OSINT64 value);
01787 
01797 EXTERNPER int pe_UnconsUnsigned (OSCTXT* pctxt, OSUINT32 value);
01798 
01809 EXTERNPER int pe_UnconsUInt64 (OSCTXT* pctxt, OSUINT64 value);
01810 
01823 EXTERNPER int pe_VarWidthCharString (OSCTXT* pctxt, const char* value); 
01824 
01838 EXTERNPER int pe_Real10 (OSCTXT* pctxt, const char* pvalue);
01839 
01842 /* Utility functions */
01843 
01844 
01865 EXTERNPER int pu_addSizeConstraint (OSCTXT* pctxt, Asn1SizeCnst* pSize);
01866 
01867 EXTERNPER OSBOOL pu_alignCharStr 
01868 (OSCTXT* pctxt, OSUINT32 len, OSUINT32 nbits, Asn1SizeCnst* pSize);
01869 
01876 EXTERNPER int pu_checkSizeConstraint(OSCTXT* pctxt, int size);
01877 
01881 EXTERNPER OSUINT32 pu_bitcnt (OSUINT32 value);
01882 
01883 EXTERNPER Asn1SizeCnst* pu_checkSize 
01884 (Asn1SizeCnst* pSizeList, OSUINT32 value, OSBOOL* pExtendable);
01885 
01899 EXTERNPER void pu_freeContext (OSCTXT* pctxt);
01900 
01901 
01908 EXTERNPER int  pu_getBitOffset (OSCTXT* pctxt);
01909 
01910 
01911 EXTERNPER size_t pu_getMaskAndIndex (size_t bitOffset, unsigned char* pMask);
01912 
01924 EXTERNPER size_t pu_getMsgLen (OSCTXT* pctxt);
01925 
01934 EXTERNPER void pu_hexdump (OSCTXT* pctxt);
01935 
01936 EXTERNPER int pu_setBuffer 
01937 (OSCTXT* pctxt, OSOCTET* bufaddr, size_t bufsiz, OSBOOL aligned);
01938 
01939 EXTERNPER int pe_setp (OSCTXT* pctxt,
01940              OSOCTET* bufaddr, size_t bufsiz, OSBOOL aligned);
01941 
01942 
01943 
01944 #define pd_setp(pctxt, bufaddr, bufsiz, aligned) \
01945    pu_setBuffer(pctxt, bufaddr, bufsiz, aligned)
01946 #define pe_resetp(pctxt)   rtxResetContext(pctxt)
01947 #define pd_resetp(pctxt)   rtxResetContext(pctxt)
01948 
01949 
01950 
01978 EXTERNPER int pu_initContext 
01979 (OSCTXT* pctxt, OSOCTET* bufaddr, OSUINT32 bufsiz, OSBOOL aligned);
01980 
01997 EXTERNPER int pu_initContextBuffer (OSCTXT* pTarget, OSCTXT* pSource);
01998 
01999 EXTERNPER const char* pu_getFullName 
02000 (OSCTXT* pctxt, const char* suffix);
02001 
02002 EXTERNPER Asn1SizeCnst* pu_getSizeConstraint 
02003 (OSCTXT* pctxt, OSBOOL extbit);
02004 
02005 EXTERNPER void pu_init16BitCharSet 
02006 (Asn116BitCharSet* pCharSet, OSUNICHAR first, OSUNICHAR last, 
02007  OSUINT32 abits, OSUINT32 ubits);
02008 
02015 EXTERNPER void pu_insLenField (OSCTXT* pctxt);
02016 
02020 EXTERNPER OSBOOL pu_isExtendableSize (Asn1SizeCnst* pSizeList);
02021 
02025 EXTERNPER OSBOOL pu_isFixedSize (Asn1SizeCnst* pSizeList);
02026 
02051 EXTERNPER OSCTXT* pu_newContext 
02052 (OSOCTET* bufaddr, OSUINT32 bufsiz, OSBOOL aligned);
02053 
02054 EXTERNPER PERField* pu_newField 
02055 (OSCTXT* pctxt, const char* nameSuffix);
02056 
02060 EXTERNPER void pu_popName (OSCTXT* pctxt);
02061 
02068 EXTERNPER void pu_pushElemName (OSCTXT* pctxt, int index);
02069 
02074 EXTERNPER void pu_pushName (OSCTXT* pctxt, const char* name);
02075 
02076 
02077 EXTERNPER void pu_setBitOffset (OSCTXT* pctxt, int bitOffset);
02078 
02090 EXTERNPER void pu_setCharSet (Asn1CharSet* pCharSet, const char* permSet);
02091 
02106 EXTERNPER void pu_set16BitCharSet 
02107 (OSCTXT* pctxt, Asn116BitCharSet* pCharSet, Asn116BitCharSet* pAlphabet);
02108 
02109 
02118 EXTERNPER void pu_set16BitCharSetFromRange 
02119 (Asn116BitCharSet* pCharSet, OSUINT16 firstChar, OSUINT16 lastChar);
02120 
02124 EXTERNPER void pu_setFldBitCount (OSCTXT* pctxt);
02125 
02126 
02130 EXTERNPER void pu_setFldBitOffset (OSCTXT* pctxt);
02131 
02136 EXTERNPER OSBOOL pu_setTrace (OSCTXT* pCtxt, OSBOOL value);
02137 
02152 EXTERNPER void pu_bindump (OSCTXT* pctxt, const char* varname);
02153 EXTERNPER void pu_dumpField 
02154 (OSCTXT* pctxt, PERField* pField, const char* varname, 
02155  size_t nextBitOffset, BinDumpBuffer* pbuf);
02156 
02157 EXTERNPER void pu_init32BitCharSet 
02158 (Asn132BitCharSet* pCharSet, OS32BITCHAR first, OS32BITCHAR last, 
02159  OSUINT32 abits, OSUINT32 ubits);
02160 
02175 EXTERNPER void pu_set32BitCharSet 
02176 (OSCTXT* pctxt, Asn132BitCharSet* pCharSet, Asn132BitCharSet* pAlphabet);
02177 
02186 EXTERNPER void pu_set32BitCharSetFromRange 
02187 (Asn132BitCharSet* pCharSet, OSUINT32 firstChar, OSUINT32 lastChar);
02188 
02198 EXTERNPER int pu_GetLibVersion ();
02199 
02207 EXTERNPER const char* pu_GetLibInfo ();
02208 
02213 #ifdef __cplusplus
02214 }
02215 #endif
02216 
02217 /* Macros */
02218 
02219 #define pe_GeneralString(pctxt,value,permCharSet) \
02220 pe_VarWidthCharString(pctxt, value)
02221 
02222 #define pe_GraphicString(pctxt,value,permCharSet) \
02223 pe_VarWidthCharString(pctxt, value)
02224 
02225 #define pe_T61String(pctxt,value,permCharSet) \
02226 pe_VarWidthCharString(pctxt, value)
02227 
02228 #define pe_TeletexString(pctxt,value,permCharSet) \
02229 pe_VarWidthCharString(pctxt, value)
02230 
02231 #define pe_VideotexString(pctxt,value,permCharSet) \
02232 pe_VarWidthCharString(pctxt, value)
02233 
02234 #define pe_ObjectDescriptor(pctxt,value,permCharSet) \
02235 pe_VarWidthCharString(pctxt, value)
02236 
02237 #define pe_UTF8String(pctxt,value,permCharSet) \
02238 pe_VarWidthCharString(pctxt, value)
02239 
02240         
02241 #define pe_IA5String(pctxt,value,permCharSet) \
02242 pe_ConstrainedStringEx (pctxt, value, permCharSet, 8, 7, 7)
02243 
02244 #define pe_NumericString(pctxt,value,permCharSet) \
02245 pe_ConstrainedStringEx (pctxt, value, \
02246 (permCharSet == 0)?NUM_CANSET:permCharSet, 4, 4, 4)
02247 
02248 #define pe_PrintableString(pctxt,value,permCharSet) \
02249 pe_ConstrainedStringEx (pctxt, value, permCharSet, 8, 7, 7)
02250 
02251 #define pe_VisibleString(pctxt,value,permCharSet) \
02252 
02253 #define pe_ISO646String      pe_IA5String
02254 #define pe_GeneralizedTime   pe_IA5String
02255 #define pe_UTCTime           pe_GeneralizedTime
02256 
02257 
02258 #define pd_GeneralString(pctxt,pvalue,permCharSet) \
02259 pd_VarWidthCharString (pctxt, pvalue)
02260 
02261 #define pd_GraphicString(pctxt,pvalue,permCharSet) \
02262 pd_VarWidthCharString (pctxt, pvalue)
02263 
02264 #define pd_VideotexString(pctxt,pvalue,permCharSet) \
02265 pd_VarWidthCharString (pctxt, pvalue)
02266 
02267 #define pd_TeletexString(pctxt,pvalue,permCharSet) \
02268 pd_VarWidthCharString (pctxt, pvalue)
02269 
02270 #define pd_T61String(pctxt,pvalue,permCharSet) \
02271 pd_VarWidthCharString (pctxt, pvalue)
02272 
02273 #define pd_ObjectDescriptor(pctxt,pvalue,permCharSet) \
02274 pd_VarWidthCharString (pctxt, pvalue)
02275 
02276 #define pd_UTF8String(pctxt,pvalue,permCharSet) \
02277 pd_VarWidthCharString (pctxt, pvalue)
02278 
02279 
02280 #define pd_IA5String(pctxt,pvalue,permCharSet) \
02281 pd_ConstrainedStringEx (pctxt, pvalue, permCharSet, 8, 7, 7)
02282 
02283 #define pd_NumericString(pctxt,pvalue,permCharSet) \
02284 pd_ConstrainedStringEx (pctxt, pvalue, \
02285 (permCharSet == 0)?NUM_CANSET:permCharSet, 4, 4, 4)
02286 
02287 #define pd_PrintableString(pctxt,pvalue,permCharSet) \
02288 pd_ConstrainedStringEx (pctxt, pvalue, permCharSet, 8, 7, 7)
02289 
02290 #define pd_VisibleString(pctxt,pvalue,permCharSet) \
02291 pd_ConstrainedStringEx (pctxt, pvalue, permCharSet, 8, 7, 7)
02292 
02293 
02294 #define pd_ISO646String      pd_IA5String
02295 #define pd_GeneralizedTime   pd_IA5String
02296 #define pd_UTCTime           pd_GeneralizedTime
02297 
02298 #define pe_GetMsgLen         pu_getMsgLen
02299 
02302 #endif