Update.
[libtasn1.git] / lib / int.h
blob0851689a879a82c98a013f074bd38a51ccc6ac7a
1 /*
2 * Copyright (C) 2004, 2006 Free Software Foundation, Inc.
3 * Copyright (C) 2002 Fabio Fiorina
5 * This file is part of LIBTASN1.
7 * The LIBTASN1 library is free software; you can redistribute it
8 * and/or modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA
23 #ifndef INT_H
24 #define INT_H
26 #include <libtasn1.h>
28 #include <defines.h>
31 #define LIBTASN1_DEBUG
32 #define LIBTASN1_DEBUG_PARSER
33 #define LIBTASN1_DEBUG_INTEGER
36 #include <mem.h>
38 #define MAX_LOG_SIZE 1024 /* maximum number of characters of a log message */
40 /* Define used for visiting trees. */
41 #define UP 1
42 #define RIGHT 2
43 #define DOWN 3
45 /****************************************/
46 /* Returns the first 8 bits. */
47 /* Used with the field type of node_asn */
48 /****************************************/
49 #define type_field(x) (x&0xFF)
51 /* List of constants for field type of typedef node_asn */
52 #define TYPE_CONSTANT 1
53 #define TYPE_IDENTIFIER 2
54 #define TYPE_INTEGER 3
55 #define TYPE_BOOLEAN 4
56 #define TYPE_SEQUENCE 5
57 #define TYPE_BIT_STRING 6
58 #define TYPE_OCTET_STRING 7
59 #define TYPE_TAG 8
60 #define TYPE_DEFAULT 9
61 #define TYPE_SIZE 10
62 #define TYPE_SEQUENCE_OF 11
63 #define TYPE_OBJECT_ID 12
64 #define TYPE_ANY 13
65 #define TYPE_SET 14
66 #define TYPE_SET_OF 15
67 #define TYPE_DEFINITIONS 16
68 #define TYPE_TIME 17
69 #define TYPE_CHOICE 18
70 #define TYPE_IMPORTS 19
71 #define TYPE_NULL 20
72 #define TYPE_ENUMERATED 21
73 #define TYPE_GENERALSTRING 27
76 /***********************************************************************/
77 /* List of constants to better specify the type of typedef node_asn. */
78 /***********************************************************************/
79 /* Used with TYPE_TAG */
80 #define CONST_UNIVERSAL (1<<8)
81 #define CONST_PRIVATE (1<<9)
82 #define CONST_APPLICATION (1<<10)
83 #define CONST_EXPLICIT (1<<11)
84 #define CONST_IMPLICIT (1<<12)
86 #define CONST_TAG (1<<13) /* Used in ASN.1 assignement */
87 #define CONST_OPTION (1<<14)
88 #define CONST_DEFAULT (1<<15)
89 #define CONST_TRUE (1<<16)
90 #define CONST_FALSE (1<<17)
92 #define CONST_LIST (1<<18) /* Used with TYPE_INTEGER and TYPE_BIT_STRING */
93 #define CONST_MIN_MAX (1<<19)
95 #define CONST_1_PARAM (1<<20)
97 #define CONST_SIZE (1<<21)
99 #define CONST_DEFINED_BY (1<<22)
101 #define CONST_GENERALIZED (1<<23)
102 #define CONST_UTC (1<<24)
104 /* #define CONST_IMPORTS (1<<25) */
106 #define CONST_NOT_USED (1<<26)
107 #define CONST_SET (1<<27)
108 #define CONST_ASSIGN (1<<28)
110 #define CONST_DOWN (1<<29)
111 #define CONST_RIGHT (1<<30)
113 #endif /* INT_H */