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

Google


Objective Systems, Inc.

asn1berStream.h

Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 1997-2004 by 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 // CHANGE LOG 00026 // Date Init Description 00027 // 11/02/03 AB Initial issue 00028 // 00030 */ 00037 #ifndef _ASN1BERSTREAM_H_ 00038 #define _ASN1BERSTREAM_H_ 00039 00040 #include "asn1ber.h" 00041 #include "rtStream.h" 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00074 EXTERNBER int berStrmInitContext (ASN1CTXT* pctxt); 00075 00086 EXTERNBER int berStrmFreeContext (ASN1CTXT* pctxt); 00087 00125 EXTERNBER int berEncStrmBigInt (ASN1CTXT* pctxt, 00126 ASN1ConstCharPtr pvalue, 00127 ASN1TagType tagging); 00128 00150 EXTERNBER int berEncStrmBitStr (ASN1CTXT* pctxt, 00151 ASN1ConstOctetPtr object_p, 00152 ASN1UINT numbits, 00153 ASN1TagType tagging); 00154 00177 EXTERNBER int berEncStrmBMPStr (ASN1CTXT* pctxt, 00178 const Asn116BitCharString* object_p, 00179 ASN1TagType tagging); 00180 00200 EXTERNBER int berEncStrmBool (ASN1CTXT* pctxt, ASN1BOOL value, 00201 ASN1TagType tagging); 00202 00227 EXTERNBER int berEncStrmCharStr (ASN1CTXT* pctxt, ASN1ConstCharPtr object_p, 00228 ASN1TagType tagging, ASN1TAG tag); 00229 00244 EXTERNBER int berEncStrmEOC (ASN1CTXT *pctxt); 00245 00267 EXTERNBER int berEncStrmEnum (ASN1CTXT* pctxt, ASN1ENUM value, 00268 ASN1TagType tagging); 00269 00289 EXTERNBER int berEncStrmInt (ASN1CTXT* pctxt, ASN1INT value, 00290 ASN1TagType tagging); 00291 00312 EXTERNBER int berEncStrmInt8 (ASN1CTXT* pctxt, ASN1INT8 value, 00313 ASN1TagType tagging); 00314 00335 EXTERNBER int berEncStrmInt16 (ASN1CTXT* pctxt, ASN1SINT value, 00336 ASN1TagType tagging); 00337 00359 EXTERNBER int berEncStrmInt64 (ASN1CTXT* pctxt, ASN1INT64 value, 00360 ASN1TagType tagging); 00361 00376 EXTERNBER int berEncStrmLength (ASN1CTXT *pctxt, int length); 00377 00394 EXTERNBER int berEncStrmNull (ASN1CTXT* pctxt, ASN1TagType tagging); 00395 00416 EXTERNBER int berEncStrmObjId (ASN1CTXT* pctxt, const ASN1OBJID *object_p, 00417 ASN1TagType tagging); 00418 00440 EXTERNBER int berEncStrmObjId64 (ASN1CTXT* pctxt, const ASN1OID64 *object_p, 00441 ASN1TagType tagging); 00442 00463 EXTERNBER int berEncStrmOctStr (ASN1CTXT* pctxt, 00464 ASN1ConstOctetPtr object_p, 00465 ASN1UINT numocts, 00466 ASN1TagType tagging); 00467 00486 EXTERNBER int berEncStrmOpenTypeExt (ASN1CTXT* pctxt, Asn1RTDList* pElemList); 00487 00512 EXTERNBER int berEncStrmReal (ASN1CTXT* pctxt, ASN1REAL value, 00513 ASN1TagType tagging); 00514 00535 EXTERNBER int berEncStrmRelativeOID (ASN1CTXT* pctxt, 00536 const ASN1OBJID *object_p, 00537 ASN1TagType tagging); 00538 00556 EXTERNBER int berEncStrmTag (ASN1CTXT *pctxt, ASN1TAG tag); 00557 00582 EXTERNBER int berEncStrmTagAndLen (ASN1CTXT *pctxt, ASN1TAG tag, int length); 00583 00601 EXTERNBER int berEncStrmTagAndIndefLen (ASN1CTXT *pctxt, ASN1TAG tag); 00602 00623 EXTERNBER int berEncStrmUInt (ASN1CTXT* pctxt, ASN1UINT value, 00624 ASN1TagType tagging); 00625 00646 EXTERNBER int berEncStrmUInt8 (ASN1CTXT* pctxt, ASN1UINT8 value, 00647 ASN1TagType tagging); 00648 00669 EXTERNBER int berEncStrmUInt16 (ASN1CTXT* pctxt, ASN1USINT value, 00670 ASN1TagType tagging); 00671 00694 EXTERNBER int berEncStrmUInt64 (ASN1CTXT* pctxt, ASN1UINT64 value, 00695 ASN1TagType tagging); 00696 00719 EXTERNBER int berEncStrmUnivStr (ASN1CTXT* pctxt, 00720 const Asn132BitCharString* object_p, 00721 ASN1TagType tagging); 00722 00737 EXTERNBER int berEncStrmWriteOctet (ASN1CTXT* pctxt, ASN1OCTET octet); 00738 00754 EXTERNBER int berEncStrmWriteOctets (ASN1CTXT* pctxt, 00755 ASN1ConstOctetPtr poctets, 00756 size_t numocts); 00757 00758 00782 EXTERNBER int cerEncStrmBMPStr (ASN1CTXT* pctxt, 00783 const Asn116BitCharString* object_p, 00784 ASN1TagType tagging); 00785 00808 EXTERNBER int cerEncStrmBitStr (ASN1CTXT* pctxt, 00809 ASN1ConstOctetPtr object_p, 00810 ASN1UINT numbits, 00811 ASN1TagType tagging); 00812 00838 EXTERNBER int cerEncStrmCharStr (ASN1CTXT* pctxt, ASN1ConstCharPtr object_p, 00839 ASN1TagType tagging, ASN1TAG tag); 00840 00862 EXTERNBER int cerEncStrmOctStr (ASN1CTXT* pctxt, 00863 ASN1ConstOctetPtr object_p, 00864 ASN1UINT numocts, 00865 ASN1TagType tagging); 00866 00890 EXTERNBER int cerEncStrmUnivStr (ASN1CTXT* pctxt, 00891 const Asn132BitCharString* object_p, 00892 ASN1TagType tagging); 00893 00931 EXTERNBER int berDecStrmBMPStr (ASN1CTXT* pctxt, Asn116BitCharString* object_p, 00932 ASN1TagType tagging, int length); 00933 00967 EXTERNBER int berDecStrmBigInt (ASN1CTXT *pctxt, ASN1ConstCharPtr* object_p, 00968 ASN1TagType tagging, int length); 00969 01004 EXTERNBER int berDecStrmBitStr (ASN1CTXT *pctxt, ASN1OCTET* pvalue, 01005 ASN1UINT* pnbits, 01006 ASN1TagType tagging, 01007 int length); 01008 01032 EXTERNBER int berDecStrmBool (ASN1CTXT *pctxt, ASN1BOOL *object_p, 01033 ASN1TagType tagging, int length); 01034 01067 EXTERNBER int berDecStrmCharStr (ASN1CTXT *pctxt, ASN1ConstCharPtr* ppvalue, 01068 ASN1TagType tagging, ASN1TAG tag, int length); 01069 01097 EXTERNBER int berDecStrmDynBitStr (ASN1CTXT *pctxt, ASN1ConstOctetPtr* ppvalue, 01098 ASN1UINT* pnbits, 01099 ASN1TagType tagging, int length); 01100 01128 EXTERNBER int berDecStrmDynOctStr (ASN1CTXT *pctxt, ASN1ConstOctetPtr* ppvalue, 01129 ASN1UINT* pnocts, 01130 ASN1TagType tagging, int length); 01131 01155 EXTERNBER int berDecStrmEnum (ASN1CTXT *pctxt, ASN1ENUM *object_p, 01156 ASN1TagType tagging, int length); 01157 01181 EXTERNBER int berDecStrmInt (ASN1CTXT *pctxt, ASN1INT *object_p, 01182 ASN1TagType tagging, int length); 01183 01207 EXTERNBER int berDecStrmInt8 (ASN1CTXT *pctxt, ASN1INT8 *object_p, 01208 ASN1TagType tagging, int length); 01209 01233 EXTERNBER int berDecStrmInt16 (ASN1CTXT *pctxt, ASN1SINT *object_p, 01234 ASN1TagType tagging, int length); 01235 01259 EXTERNBER int berDecStrmInt64 (ASN1CTXT *pctxt, ASN1INT64 *object_p, 01260 ASN1TagType tagging, int length); 01261 01277 EXTERNBER int berDecStrmLength (ASN1CTXT *pctxt, int *len_p); 01278 01296 EXTERNBER int berDecStrmMatchEOC (ASN1CTXT* pctxt); 01297 01322 EXTERNBER int berDecStrmMatchTag (ASN1CTXT* pctxt, ASN1TAG tag, int *len_p, 01323 ASN1BOOL advance); 01324 01338 EXTERNBER int berDecStrmNextElement (ASN1CTXT *pctxt); 01339 01356 EXTERNBER int berDecStrmNull (ASN1CTXT *pctxt, ASN1TagType tagging); 01357 01383 EXTERNBER int berDecStrmObjId (ASN1CTXT *pctxt, ASN1OBJID *object_p, 01384 ASN1TagType tagging, 01385 int length); 01386 01413 EXTERNBER int berDecStrmObjId64 (ASN1CTXT *pctxt, ASN1OID64 *object_p, 01414 ASN1TagType tagging, 01415 int length); 01416 01450 EXTERNBER int berDecStrmOctStr (ASN1CTXT *pctxt, ASN1OCTET* pvalue, 01451 ASN1UINT* pnocts, 01452 ASN1TagType tagging, 01453 int length); 01454 01479 EXTERNBER int berDecStrmOpenType (ASN1CTXT *pctxt, 01480 ASN1ConstOctetPtr* object_p2, 01481 ASN1UINT* numocts_p); 01482 01500 EXTERNBER int berDecStrmOpenTypeAppend (ASN1CTXT *pctxt, 01501 Asn1RTDList *pElemList); 01502 01529 EXTERNBER int berDecStrmOpenTypeExt (ASN1CTXT *pctxt, ASN1CCB* ccb_p, 01530 ASN1TAG tag, 01531 Asn1RTDList *pElemList); 01532 01552 EXTERNBER int berDecStrmPeekTagAndLen 01553 (ASN1CTXT* pctxt, ASN1TAG* ptag, int* plen); 01554 01577 EXTERNBER int berDecStrmReal (ASN1CTXT *pctxt, ASN1REAL *object_p, 01578 ASN1TagType tagging, int length); 01579 01605 EXTERNBER int berDecStrmRelativeOID (ASN1CTXT *pctxt, ASN1OBJID *object_p, 01606 ASN1TagType tagging, 01607 int length); 01608 01623 EXTERNBER int berDecStrmTag (ASN1CTXT* pctxt, ASN1TAG *tag_p); 01624 01643 EXTERNBER int berDecStrmTagAndLen (ASN1CTXT *pctxt, ASN1TAG *tag_p, 01644 int *len_p); 01645 01664 EXTERNBER ASN1BOOL berDecStrmTestEOC (ASN1CTXT* pctxt, ASN1CCB* ccb_p); 01665 01690 EXTERNBER int berDecStrmUInt (ASN1CTXT *pctxt, ASN1UINT *object_p, 01691 ASN1TagType tagging, int length); 01692 01717 EXTERNBER int berDecStrmUInt8 (ASN1CTXT *pctxt, ASN1UINT8 *object_p, 01718 ASN1TagType tagging, int length); 01719 01744 EXTERNBER int berDecStrmUInt16 (ASN1CTXT *pctxt, ASN1USINT *object_p, 01745 ASN1TagType tagging, int length); 01746 01771 EXTERNBER int berDecStrmUInt64 (ASN1CTXT *pctxt, ASN1UINT64 *object_p, 01772 ASN1TagType tagging, int length); 01773 01800 EXTERNBER int berDecStrmUnivStr (ASN1CTXT* pctxt, 01801 Asn132BitCharString* object_p, 01802 ASN1TagType tagging, int length); 01805 EXTERNBER int cerEncCanonicalSort (ASN1CTXT* pctxt, 01806 ASN1CTXT* pMemCtxt, 01807 Asn1RTSList* pList); 01808 EXTERNBER void cerGetBufLocDescr (ASN1CTXT *pctxt, Asn1BufLocDescr* pDescr); 01809 EXTERNBER void cerAddBufLocDescr (ASN1CTXT *pctxt, Asn1RTSList* pElemList, 01810 Asn1BufLocDescr* pDescr); 01811 01812 #ifdef __cplusplus 01813 } 01814 #endif 01815 01816 /* This macro will test for EOB */ 01817 01818 #define BS_CHKEOB(ctxt_p) \ 01819 (((ctxt_p)->buffer.byteIndex + 2 > (ctxt_p)->buffer.size) ? TRUE : \ 01820 (((ctxt_p)->buffer.data[(ctxt_p)->buffer.byteIndex] == 0 && \ 01821 (ctxt_p)->buffer.data[(ctxt_p)->buffer.byteIndex + 1] == 0 ) ? \ 01822 TRUE : FALSE)) 01823 01824 /* This macro will test for length overrun */ 01825 01826 #define BS_CHKEND(ctxt_p,ccb_p) \ 01827 ((ccb_p)->stat = ASN_OK, \ 01828 (((ccb_p)->len == ASN_K_INDEFLEN) ? berDecStrmTestEOC (ctxt_p,ccb_p) : \ 01829 (((int)(OSRTSTREAM_BYTEINDEX(ctxt_p) - (ccb_p)->bytes) >= (ccb_p)->len)))) 01830 01831 01832 #endif /* _ASN1BERSTREAM_H_ */

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 BER Runtime, ASN1C v5.7x