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

Google


Objective Systems, Inc.

PER Runtime Library Functions.


Detailed Description

The ASN.1 Packed Encoding Rules (PER) runtime library contains the low-level constants, types, and functions that are assembled by the compiler to encode/decode more complex structures. The PER low-level C encode/decode functions are identified by their prefixes: pe_ for PER encode, pd_ for PERdecode, and pu_ for PER utility functions.


Modules

group  PER C Decode Functions.
group  PER C Encode Functions.
group  PER C Utility Functions

Classes

struct  PERField
struct  BinDumpBuffer

Defines

#define ASN_K_EXTENUM   999
#define PU_SETCHARSET(csetvar, canset, abits, ubits)
#define PU_INSLENFLD(ctxt_p)
#define PU_NEWFIELD(ctxt_p, suffix)
#define PU_PUSHNAME(ctxt_p, name)
#define PU_POPNAME(ctxt_p)
#define PU_SETBITOFFSET(ctxt_p)
#define PU_SETBITCOUNT(ctxt_p)
#define PU_PUSHELEMNAME(ctxt_p, idx)
#define EXTERNPER
#define PD_INCRBITIDX(ctxt_p)
#define PD_BIT(ctxt_p, pvalue)
#define PU_GETSIZECONSTRAINT(ctxt_p, extbit, pSize)
#define PU_GETCTXTBITOFFSET(ctxt_p)   (((ctxt_p)->buffer.byteIndex * 8) + (8 - (ctxt_p)->buffer.bitOffset))
#define PU_SETCTXTBITOFFSET(ctxt_p, _bitOffset)
#define PD_BYTE_ALIGN0(ctxt_p)
#define PD_BYTE_ALIGN   PD_BYTE_ALIGN0
#define PD_CHECKSEQOFLEN(pctxt, numElements, minElemBits)
#define pe_GeneralString(ctxt_p, value, permCharSet)   pe_VarWidthCharString(ctxt_p, value)
#define pe_GraphicString(ctxt_p, value, permCharSet)   pe_VarWidthCharString(ctxt_p, value)
#define pe_T61String(ctxt_p, value, permCharSet)   pe_VarWidthCharString(ctxt_p, value)
#define pe_TeletexString(ctxt_p, value, permCharSet)   pe_VarWidthCharString(ctxt_p, value)
#define pe_VideotexString(ctxt_p, value, permCharSet)   pe_VarWidthCharString(ctxt_p, value)
#define pe_ObjectDescriptor(ctxt_p, value, permCharSet)   pe_VarWidthCharString(ctxt_p, value)
#define pe_UTF8String(ctxt_p, value, permCharSet)   pe_VarWidthCharString(ctxt_p, value)
#define pe_IA5String(ctxt_p, value, permCharSet)   pe_ConstrainedStringEx (ctxt_p, value, permCharSet, 8, 7, 7)
#define pe_NumericString(ctxt_p, value, permCharSet)
#define pe_PrintableString(ctxt_p, value, permCharSet)   pe_ConstrainedStringEx (ctxt_p, value, permCharSet, 8, 7, 7)
#define pe_VisibleString(ctxt_p, value, permCharSet)
#define pe_ISO646String   pe_IA5String
#define pe_GeneralizedTime   pe_IA5String
#define pe_UTCTime   pe_GeneralizedTime
#define pd_GeneralString(ctxt_p, pvalue, permCharSet)   pd_VarWidthCharString (ctxt_p, pvalue)
#define pd_GraphicString(ctxt_p, pvalue, permCharSet)   pd_VarWidthCharString (ctxt_p, pvalue)
#define pd_VideotexString(ctxt_p, pvalue, permCharSet)   pd_VarWidthCharString (ctxt_p, pvalue)
#define pd_TeletexString(ctxt_p, pvalue, permCharSet)   pd_VarWidthCharString (ctxt_p, pvalue)
#define pd_T61String(ctxt_p, pvalue, permCharSet)   pd_VarWidthCharString (ctxt_p, pvalue)
#define pd_ObjectDescriptor(ctxt_p, pvalue, permCharSet)   pd_VarWidthCharString (ctxt_p, pvalue)
#define pd_UTF8String(ctxt_p, pvalue, permCharSet)   pd_VarWidthCharString (ctxt_p, pvalue)
#define pd_IA5String(ctxt_p, pvalue, permCharSet)   pd_ConstrainedStringEx (ctxt_p, pvalue, permCharSet, 8, 7, 7)
#define pd_NumericString(ctxt_p, pvalue, permCharSet)
#define pd_PrintableString(ctxt_p, pvalue, permCharSet)   pd_ConstrainedStringEx (ctxt_p, pvalue, permCharSet, 8, 7, 7)
#define pd_VisibleString(ctxt_p, pvalue, permCharSet)   pd_ConstrainedStringEx (ctxt_p, pvalue, permCharSet, 8, 7, 7)
#define pd_ISO646String   pd_IA5String
#define pd_GeneralizedTime   pd_IA5String
#define pd_UTCTime   pd_GeneralizedTime
#define pe_GetMsgLen   pu_getMsgLen

Typedefs

typedef PERField PERField


Define Documentation

#define PD_BIT ctxt_p,
pvalue   ) 
 

Value:

((PD_INCRBITIDX (ctxt_p) != ASN_OK) ? ASN_E_ENDOFBUF : ((pvalue) ? \ ((*(pvalue) = (ASN1OCTET)((((ctxt_p)->buffer.data[(ctxt_p)->buffer.byteIndex]) & \ (1 << (ctxt_p)->buffer.bitOffset)) != 0)), ASN_OK) : ASN_OK ))

#define PD_BYTE_ALIGN0 ctxt_p   ) 
 

Value:

((!(ctxt_p)->buffer.aligned) ? ASN_OK : \ (((ctxt_p)->buffer.bitOffset != 8) ? ( \ (ctxt_p)->buffer.byteIndex++, \ (ctxt_p)->buffer.bitOffset = 8, \ ASN_OK) : ASN_OK \ ))

#define PD_CHECKSEQOFLEN pctxt,
numElements,
minElemBits   ) 
 

Value:

((pctxt->buffer.size > 0) ? \ (((numElements * minElemBits) > (pctxt->buffer.size * 8)) ? \ ASN_E_INVLEN : ASN_OK) : ASN_OK)

#define PD_INCRBITIDX ctxt_p   ) 
 

Value:

((--(ctxt_p)->buffer.bitOffset < 0) ? \ ((++(ctxt_p)->buffer.byteIndex >= (ctxt_p)->buffer.size) ? ASN_E_ENDOFBUF : \ ((ctxt_p)->buffer.bitOffset = 7, ASN_OK)) : ASN_OK)

#define pd_NumericString ctxt_p,
pvalue,
permCharSet   ) 
 

Value:

pd_ConstrainedStringEx (ctxt_p, pvalue, \ (permCharSet == 0)?NUM_CANSET:permCharSet, 4, 4, 4)

#define pe_GeneralString ctxt_p,
value,
permCharSet   )     pe_VarWidthCharString(ctxt_p, value)
 

perutil

#define pe_NumericString ctxt_p,
value,
permCharSet   ) 
 

Value:

pe_ConstrainedStringEx (ctxt_p, value, \ (permCharSet == 0)?NUM_CANSET:permCharSet, 4, 4, 4)

#define PU_GETSIZECONSTRAINT ctxt_p,
extbit,
pSize   ) 
 

Value:

((((pSize) = ctxt_p->pSizeConstraint) != 0) ? \ ((((pSize) = ctxt_p->pSizeConstraint)->extended == extbit)?(pSize) : \ pu_getSizeConstraint (ctxt_p,extbit)) : NULL)

#define PU_SETCHARSET csetvar,
canset,
abits,
ubits   ) 
 

Value:

csetvar.charSet.nchars = 0; \ csetvar.canonicalSet = canset; \ csetvar.canonicalSetSize = sizeof(canset)-1; \ csetvar.canonicalSetBits = pu_bitcnt(csetvar.canonicalSetSize); \ csetvar.charSetUnalignedBits = ubits; \ csetvar.charSetAlignedBits = abits;

#define PU_SETCTXTBITOFFSET ctxt_p,
_bitOffset   ) 
 

Value:

do { \ (ctxt_p)->buffer.byteIndex = (_bitOffset / 8); \ (ctxt_p)->buffer.bitOffset = (ASN1USINT)(8 - (_bitOffset % 8)); \ } while(0)


Copyright © 1997-2004 Objective Systems,Inc.
All Rights Reserved.
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.

This file was last modified on 1 Oct 2004.
ASN1C PER Runtime, ASN1C v5.7x