X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilcasn1%2Fsilcasn1_i.h;h=8dd98752474063889e6111e2b4ecdc8fa8392967;hp=394ba3bac254317f7219c327dd66a0bdc270b2c2;hb=e7b6c157b80152bf9fb9266e6bdd93f9fb0db776;hpb=12cb6e09b64a9ecd8ee90f0243fc4af41a64238c diff --git a/lib/silcasn1/silcasn1_i.h b/lib/silcasn1/silcasn1_i.h index 394ba3ba..8dd98752 100644 --- a/lib/silcasn1/silcasn1_i.h +++ b/lib/silcasn1/silcasn1_i.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 2003 - 2005 Pekka Riikonen + Copyright (C) 2003 - 2007 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,21 +26,25 @@ /* ASN.1 context */ struct SilcAsn1Object { - va_list ap; /* List of ASN.1 types given as argument */ + SilcStack orig_stack; /* Stack given to silc_asn1_alloc */ SilcStack stack1; /* Stack for encoder */ SilcStack stack2; /* Internal stack for encoding/decoding */ + va_list ap; /* List of ASN.1 types given as argument */ unsigned int accumul : 1; /* Accumulate memory from stack for result */ + unsigned int switched : 1; /* Set when stack2 is set to stack1 */ }; /* The maximum depth for recursion in encoder and decoder. */ #define SILC_ASN1_RECURSION_DEPTH 512 /* Implementation specific special tags. Range is 0x7000 - 0x7fff. */ -#define SILC_ASN1_TAG_ANY 0x7000 /* SILC_ASN1_ANY given */ -#define SILC_ASN1_TAG_FUNC 0x7001 /* Callback encoder/decoder */ -#define SILC_ASN1_TAG_OPTS 0x7002 /* SILC_ASN1_OPTS given */ -#define SILC_ASN1_TAG_CHOICE 0x7003 /* SILC_ASN1_CHOICE given */ -#define SILC_ASN1_TAG_SEQUENCE_OF 0x7004 /* SILC_ASN1_SEQUENCE_OF given */ +#define SILC_ASN1_TAG_ANY 0x7000 /* SILC_ASN1_ANY given */ +#define SILC_ASN1_TAG_FUNC 0x7001 /* Callback encoder/decoder */ +#define SILC_ASN1_TAG_OPTS 0x7002 /* SILC_ASN1_OPTS given */ +#define SILC_ASN1_TAG_CHOICE 0x7003 /* SILC_ASN1_CHOICE given */ +#define SILC_ASN1_TAG_SEQUENCE_OF 0x7004 /* SILC_ASN1_SEQUENCE_OF given */ +#define SILC_ASN1_TAG_ANY_PRIMITIVE 0x7005 /* Pre-encoded primitive data */ +#define SILC_ASN1_TAG_SHORT_INTEGER 0x7006 /* Short integer */ /* Helper macros for adding the arguments to encoder and decoder. */ @@ -98,12 +102,14 @@ struct SilcAsn1Object { ret_type = (ret_type & 0xffff) & ~0x8000; \ } -#ifdef SILC_DIST_INPLACE /* Internal functions */ +#if defined(SILC_DEBUG) /* Returns string representation of a tag */ const char *silc_asn1_tag_name(SilcAsn1Tag tag); +#endif /* SILC_DEBUG */ +#ifdef SILC_DIST_INPLACE /* Dumps the ASN.1 data block into standard output (stdout). */ SilcBool silc_asn1_dump(SilcAsn1 asn1, SilcBuffer src); #endif /* SILC_DIST_INPLACE */