]> git.saurik.com Git - apple/security.git/blob - SecuritySNACCRuntime/c-lib/boot/asn-useful.h
Security-28.tar.gz
[apple/security.git] / SecuritySNACCRuntime / c-lib / boot / asn-useful.h
1 /*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 /*
20 * asn-useful.h
21 *
22 * "ASN-USEFUL" ASN.1 module C type definitions and prototypes
23 *
24 * This .h file was generated by snacc on Mon Mar 3 11:08:41 1997
25 *
26 * UBC snacc written compiler by Mike Sample
27 *
28 * NOTE: This is a machine generated file--editing not recommended
29 */
30
31
32 #ifndef _asn_useful_h_
33 #define _asn_useful_h_
34
35
36
37
38 typedef AsnOcts ObjectDescriptor; /* [UNIVERSAL 7] IMPLICIT OCTET STRING */
39
40 #define BEncObjectDescriptorContent BEncAsnOctsContent
41
42 #define BDecObjectDescriptorContent BDecAsnOctsContent
43
44 #define PrintObjectDescriptor PrintAsnOcts
45
46 #define FreeObjectDescriptor FreeAsnOcts
47
48
49
50
51 typedef AsnOcts NumericString; /* [UNIVERSAL 18] IMPLICIT OCTET STRING */
52
53 AsnLen BEncNumericString PROTO ((BUF_TYPE b, NumericString *v));
54
55 void BDecNumericString PROTO ((BUF_TYPE b, NumericString *result, AsnLen *bytesDecoded, ENV_TYPE env));
56 #define BEncNumericStringContent BEncAsnOctsContent
57
58 #define BDecNumericStringContent BDecAsnOctsContent
59
60 #define PrintNumericString PrintAsnOcts
61
62 #define FreeNumericString FreeAsnOcts
63
64
65
66
67 typedef AsnOcts PrintableString; /* [UNIVERSAL 19] IMPLICIT OCTET STRING */
68
69 AsnLen BEncPrintableString PROTO ((BUF_TYPE b, PrintableString *v));
70
71 void BDecPrintableString PROTO ((BUF_TYPE b, PrintableString *result, AsnLen *bytesDecoded, ENV_TYPE env));
72 #define BEncPrintableStringContent BEncAsnOctsContent
73
74 #define BDecPrintableStringContent BDecAsnOctsContent
75
76 #define PrintPrintableString PrintAsnOcts
77
78 #define FreePrintableString FreeAsnOcts
79
80
81
82
83 typedef AsnOcts TeletexString; /* [UNIVERSAL 20] IMPLICIT OCTET STRING */
84
85 AsnLen BEncTeletexString PROTO ((BUF_TYPE b, TeletexString *v));
86
87 void BDecTeletexString PROTO ((BUF_TYPE b, TeletexString *result, AsnLen *bytesDecoded, ENV_TYPE env));
88 #define BEncTeletexStringContent BEncAsnOctsContent
89
90 #define BDecTeletexStringContent BDecAsnOctsContent
91
92 #define PrintTeletexString PrintAsnOcts
93
94 #define FreeTeletexString FreeAsnOcts
95
96
97
98
99 typedef AsnOcts T61String; /* [UNIVERSAL 20] IMPLICIT OCTET STRING */
100
101 AsnLen BEncT61String PROTO ((BUF_TYPE b, T61String *v));
102
103 void BDecT61String PROTO ((BUF_TYPE b, T61String *result, AsnLen *bytesDecoded, ENV_TYPE env));
104 #define BEncT61StringContent BEncAsnOctsContent
105
106 #define BDecT61StringContent BDecAsnOctsContent
107
108 #define PrintT61String PrintAsnOcts
109
110 #define FreeT61String FreeAsnOcts
111
112
113
114
115 typedef AsnOcts VideotexString; /* [UNIVERSAL 21] IMPLICIT OCTET STRING */
116
117 AsnLen BEncVideotexString PROTO ((BUF_TYPE b, VideotexString *v));
118
119 void BDecVideotexString PROTO ((BUF_TYPE b, VideotexString *result, AsnLen *bytesDecoded, ENV_TYPE env));
120 #define BEncVideotexStringContent BEncAsnOctsContent
121
122 #define BDecVideotexStringContent BDecAsnOctsContent
123
124 #define PrintVideotexString PrintAsnOcts
125
126 #define FreeVideotexString FreeAsnOcts
127
128
129
130
131 typedef AsnOcts IA5String; /* [UNIVERSAL 22] IMPLICIT OCTET STRING */
132
133 AsnLen BEncIA5String PROTO ((BUF_TYPE b, IA5String *v));
134
135 void BDecIA5String PROTO ((BUF_TYPE b, IA5String *result, AsnLen *bytesDecoded, ENV_TYPE env));
136 #define BEncIA5StringContent BEncAsnOctsContent
137
138 #define BDecIA5StringContent BDecAsnOctsContent
139
140 #define PrintIA5String PrintAsnOcts
141
142 #define FreeIA5String FreeAsnOcts
143
144
145
146
147 typedef AsnOcts GraphicString; /* [UNIVERSAL 25] IMPLICIT OCTET STRING */
148
149 AsnLen BEncGraphicString PROTO ((BUF_TYPE b, GraphicString *v));
150
151 void BDecGraphicString PROTO ((BUF_TYPE b, GraphicString *result, AsnLen *bytesDecoded, ENV_TYPE env));
152 #define BEncGraphicStringContent BEncAsnOctsContent
153
154 #define BDecGraphicStringContent BDecAsnOctsContent
155
156 #define PrintGraphicString PrintAsnOcts
157
158 #define FreeGraphicString FreeAsnOcts
159
160
161
162
163 typedef AsnOcts VisibleString; /* [UNIVERSAL 26] IMPLICIT OCTET STRING */
164
165 AsnLen BEncVisibleString PROTO ((BUF_TYPE b, VisibleString *v));
166
167 void BDecVisibleString PROTO ((BUF_TYPE b, VisibleString *result, AsnLen *bytesDecoded, ENV_TYPE env));
168 #define BEncVisibleStringContent BEncAsnOctsContent
169
170 #define BDecVisibleStringContent BDecAsnOctsContent
171
172 #define PrintVisibleString PrintAsnOcts
173
174 #define FreeVisibleString FreeAsnOcts
175
176
177
178
179 typedef AsnOcts ISO646String; /* [UNIVERSAL 26] IMPLICIT OCTET STRING */
180
181 AsnLen BEncISO646String PROTO ((BUF_TYPE b, ISO646String *v));
182
183 void BDecISO646String PROTO ((BUF_TYPE b, ISO646String *result, AsnLen *bytesDecoded, ENV_TYPE env));
184 #define BEncISO646StringContent BEncAsnOctsContent
185
186 #define BDecISO646StringContent BDecAsnOctsContent
187
188 #define PrintISO646String PrintAsnOcts
189
190 #define FreeISO646String FreeAsnOcts
191
192
193
194
195 typedef AsnOcts GeneralString; /* [UNIVERSAL 27] IMPLICIT OCTET STRING */
196
197 AsnLen BEncGeneralString PROTO ((BUF_TYPE b, GeneralString *v));
198
199 void BDecGeneralString PROTO ((BUF_TYPE b, GeneralString *result, AsnLen *bytesDecoded, ENV_TYPE env));
200 #define BEncGeneralStringContent BEncAsnOctsContent
201
202 #define BDecGeneralStringContent BDecAsnOctsContent
203
204 #define PrintGeneralString PrintAsnOcts
205
206 #define FreeGeneralString FreeAsnOcts
207
208
209
210
211 typedef AsnOcts UTCTime; /* [UNIVERSAL 23] IMPLICIT OCTET STRING */
212
213 AsnLen BEncUTCTime PROTO ((BUF_TYPE b, UTCTime *v));
214
215 void BDecUTCTime PROTO ((BUF_TYPE b, UTCTime *result, AsnLen *bytesDecoded, ENV_TYPE env));
216 #define BEncUTCTimeContent BEncAsnOctsContent
217
218 #define BDecUTCTimeContent BDecAsnOctsContent
219
220 #define PrintUTCTime PrintAsnOcts
221
222 #define FreeUTCTime FreeAsnOcts
223
224
225
226
227 typedef AsnOcts GeneralizedTime; /* [UNIVERSAL 24] IMPLICIT OCTET STRING */
228
229 AsnLen BEncGeneralizedTime PROTO ((BUF_TYPE b, GeneralizedTime *v));
230
231 void BDecGeneralizedTime PROTO ((BUF_TYPE b, GeneralizedTime *result, AsnLen *bytesDecoded, ENV_TYPE env));
232 #define BEncGeneralizedTimeContent BEncAsnOctsContent
233
234 #define BDecGeneralizedTimeContent BDecAsnOctsContent
235
236 #define PrintGeneralizedTime PrintAsnOcts
237
238 #define FreeGeneralizedTime FreeAsnOcts
239
240
241
242
243 typedef struct EXTERNALChoice /* CHOICE */
244 {
245 enum EXTERNALChoiceChoiceId
246 {
247 EXTERNALCHOICE_SINGLE_ASN1_TYPE,
248 EXTERNALCHOICE_OCTET_ALIGNED,
249 EXTERNALCHOICE_ARBITRARY
250 } choiceId;
251 union EXTERNALChoiceChoiceUnion
252 {
253 AsnOcts* single_ASN1_type; /* [0] OCTET STRING */
254 AsnOcts* octet_aligned; /* [1] IMPLICIT OCTET STRING */
255 AsnBits* arbitrary; /* [2] IMPLICIT BIT STRING */
256 } a;
257 } EXTERNALChoice;
258
259 AsnLen BEncEXTERNALChoiceContent PROTO ((BUF_TYPE b, EXTERNALChoice *v));
260
261 void BDecEXTERNALChoiceContent PROTO ((BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, EXTERNALChoice *v, AsnLen *bytesDecoded, ENV_TYPE env));
262
263
264 void PrintEXTERNALChoice PROTO ((FILE* f, EXTERNALChoice *v, unsigned short int indent));
265 void FreeEXTERNALChoice PROTO ((EXTERNALChoice *v));
266
267
268
269
270
271 typedef struct EXTERNAL /* [UNIVERSAL 8] IMPLICIT SEQUENCE */
272 {
273 AsnOid direct_reference; /* OBJECT IDENTIFIER OPTIONAL */
274 AsnInt* indirect_reference; /* INTEGER OPTIONAL */
275 ObjectDescriptor data_value_descriptor; /* ObjectDescriptor OPTIONAL */
276 struct EXTERNALChoice* encoding; /* EXTERNALChoice */
277 } EXTERNAL;
278
279 AsnLen BEncEXTERNAL PROTO ((BUF_TYPE b, EXTERNAL *v));
280
281 void BDecEXTERNAL PROTO ((BUF_TYPE b, EXTERNAL *result, AsnLen *bytesDecoded, ENV_TYPE env));
282 AsnLen BEncEXTERNALContent PROTO ((BUF_TYPE b, EXTERNAL *v));
283
284 void BDecEXTERNALContent PROTO ((BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, EXTERNAL *v, AsnLen *bytesDecoded, ENV_TYPE env));
285
286
287 void PrintEXTERNAL PROTO ((FILE* f, EXTERNAL *v, unsigned short int indent));
288 void FreeEXTERNAL PROTO ((EXTERNAL *v));
289
290
291
292
293
294
295 #endif /* conditional include of asn-useful.h */