]> git.saurik.com Git - apple/security.git/blob - SecuritySNACCRuntime/c-lib/inc/asn-useful.h
Security-30.1.tar.gz
[apple/security.git] / SecuritySNACCRuntime / c-lib / inc / 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 Thu Jun 8 12:35:27 2000
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 UTF8String; /* [UNIVERSAL 12] IMPLICIT OCTET STRING */
52
53 AsnLen BEncUTF8String PROTO ((BUF_TYPE b, UTF8String *v));
54
55 void BDecUTF8String PROTO ((BUF_TYPE b, UTF8String *result, AsnLen *bytesDecoded, ENV_TYPE env));
56 #define BEncUTF8StringContent BEncAsnOctsContent
57
58 #define BDecUTF8StringContent BDecAsnOctsContent
59
60 #define PrintUTF8String PrintAsnOcts
61
62 #define FreeUTF8String FreeAsnOcts
63
64
65
66
67 typedef AsnOcts NumericString; /* [UNIVERSAL 18] IMPLICIT OCTET STRING */
68
69 AsnLen BEncNumericString PROTO ((BUF_TYPE b, NumericString *v));
70
71 void BDecNumericString PROTO ((BUF_TYPE b, NumericString *result, AsnLen *bytesDecoded, ENV_TYPE env));
72 #define BEncNumericStringContent BEncAsnOctsContent
73
74 #define BDecNumericStringContent BDecAsnOctsContent
75
76 #define PrintNumericString PrintAsnOcts
77
78 #define FreeNumericString FreeAsnOcts
79
80
81
82
83 typedef AsnOcts PrintableString; /* [UNIVERSAL 19] IMPLICIT OCTET STRING */
84
85 AsnLen BEncPrintableString PROTO ((BUF_TYPE b, PrintableString *v));
86
87 void BDecPrintableString PROTO ((BUF_TYPE b, PrintableString *result, AsnLen *bytesDecoded, ENV_TYPE env));
88 #define BEncPrintableStringContent BEncAsnOctsContent
89
90 #define BDecPrintableStringContent BDecAsnOctsContent
91
92 #define PrintPrintableString PrintAsnOcts
93
94 #define FreePrintableString FreeAsnOcts
95
96
97
98
99 typedef AsnOcts TeletexString; /* [UNIVERSAL 20] IMPLICIT OCTET STRING */
100
101 AsnLen BEncTeletexString PROTO ((BUF_TYPE b, TeletexString *v));
102
103 void BDecTeletexString PROTO ((BUF_TYPE b, TeletexString *result, AsnLen *bytesDecoded, ENV_TYPE env));
104 #define BEncTeletexStringContent BEncAsnOctsContent
105
106 #define BDecTeletexStringContent BDecAsnOctsContent
107
108 #define PrintTeletexString PrintAsnOcts
109
110 #define FreeTeletexString FreeAsnOcts
111
112
113
114
115 typedef AsnOcts T61String; /* [UNIVERSAL 20] IMPLICIT OCTET STRING */
116
117 AsnLen BEncT61String PROTO ((BUF_TYPE b, T61String *v));
118
119 void BDecT61String PROTO ((BUF_TYPE b, T61String *result, AsnLen *bytesDecoded, ENV_TYPE env));
120 #define BEncT61StringContent BEncAsnOctsContent
121
122 #define BDecT61StringContent BDecAsnOctsContent
123
124 #define PrintT61String PrintAsnOcts
125
126 #define FreeT61String FreeAsnOcts
127
128
129
130
131 typedef AsnOcts VideotexString; /* [UNIVERSAL 21] IMPLICIT OCTET STRING */
132
133 AsnLen BEncVideotexString PROTO ((BUF_TYPE b, VideotexString *v));
134
135 void BDecVideotexString PROTO ((BUF_TYPE b, VideotexString *result, AsnLen *bytesDecoded, ENV_TYPE env));
136 #define BEncVideotexStringContent BEncAsnOctsContent
137
138 #define BDecVideotexStringContent BDecAsnOctsContent
139
140 #define PrintVideotexString PrintAsnOcts
141
142 #define FreeVideotexString FreeAsnOcts
143
144
145
146
147 typedef AsnOcts IA5String; /* [UNIVERSAL 22] IMPLICIT OCTET STRING */
148
149 AsnLen BEncIA5String PROTO ((BUF_TYPE b, IA5String *v));
150
151 void BDecIA5String PROTO ((BUF_TYPE b, IA5String *result, AsnLen *bytesDecoded, ENV_TYPE env));
152 #define BEncIA5StringContent BEncAsnOctsContent
153
154 #define BDecIA5StringContent BDecAsnOctsContent
155
156 #define PrintIA5String PrintAsnOcts
157
158 #define FreeIA5String FreeAsnOcts
159
160
161
162
163 typedef AsnOcts GraphicString; /* [UNIVERSAL 25] IMPLICIT OCTET STRING */
164
165 AsnLen BEncGraphicString PROTO ((BUF_TYPE b, GraphicString *v));
166
167 void BDecGraphicString PROTO ((BUF_TYPE b, GraphicString *result, AsnLen *bytesDecoded, ENV_TYPE env));
168 #define BEncGraphicStringContent BEncAsnOctsContent
169
170 #define BDecGraphicStringContent BDecAsnOctsContent
171
172 #define PrintGraphicString PrintAsnOcts
173
174 #define FreeGraphicString FreeAsnOcts
175
176
177
178
179 typedef AsnOcts VisibleString; /* [UNIVERSAL 26] IMPLICIT OCTET STRING */
180
181 AsnLen BEncVisibleString PROTO ((BUF_TYPE b, VisibleString *v));
182
183 void BDecVisibleString PROTO ((BUF_TYPE b, VisibleString *result, AsnLen *bytesDecoded, ENV_TYPE env));
184 #define BEncVisibleStringContent BEncAsnOctsContent
185
186 #define BDecVisibleStringContent BDecAsnOctsContent
187
188 #define PrintVisibleString PrintAsnOcts
189
190 #define FreeVisibleString FreeAsnOcts
191
192
193
194
195 typedef AsnOcts ISO646String; /* [UNIVERSAL 26] IMPLICIT OCTET STRING */
196
197 AsnLen BEncISO646String PROTO ((BUF_TYPE b, ISO646String *v));
198
199 void BDecISO646String PROTO ((BUF_TYPE b, ISO646String *result, AsnLen *bytesDecoded, ENV_TYPE env));
200 #define BEncISO646StringContent BEncAsnOctsContent
201
202 #define BDecISO646StringContent BDecAsnOctsContent
203
204 #define PrintISO646String PrintAsnOcts
205
206 #define FreeISO646String FreeAsnOcts
207
208
209
210
211 typedef AsnOcts GeneralString; /* [UNIVERSAL 27] IMPLICIT OCTET STRING */
212
213 AsnLen BEncGeneralString PROTO ((BUF_TYPE b, GeneralString *v));
214
215 void BDecGeneralString PROTO ((BUF_TYPE b, GeneralString *result, AsnLen *bytesDecoded, ENV_TYPE env));
216 #define BEncGeneralStringContent BEncAsnOctsContent
217
218 #define BDecGeneralStringContent BDecAsnOctsContent
219
220 #define PrintGeneralString PrintAsnOcts
221
222 #define FreeGeneralString FreeAsnOcts
223
224
225
226
227 typedef AsnOcts UTCTime; /* [UNIVERSAL 23] IMPLICIT OCTET STRING */
228
229 AsnLen BEncUTCTime PROTO ((BUF_TYPE b, UTCTime *v));
230
231 void BDecUTCTime PROTO ((BUF_TYPE b, UTCTime *result, AsnLen *bytesDecoded, ENV_TYPE env));
232 #define BEncUTCTimeContent BEncAsnOctsContent
233
234 #define BDecUTCTimeContent BDecAsnOctsContent
235
236 #define PrintUTCTime PrintAsnOcts
237
238 #define FreeUTCTime FreeAsnOcts
239
240
241
242
243 typedef AsnOcts GeneralizedTime; /* [UNIVERSAL 24] IMPLICIT OCTET STRING */
244
245 AsnLen BEncGeneralizedTime PROTO ((BUF_TYPE b, GeneralizedTime *v));
246
247 void BDecGeneralizedTime PROTO ((BUF_TYPE b, GeneralizedTime *result, AsnLen *bytesDecoded, ENV_TYPE env));
248 #define BEncGeneralizedTimeContent BEncAsnOctsContent
249
250 #define BDecGeneralizedTimeContent BDecAsnOctsContent
251
252 #define PrintGeneralizedTime PrintAsnOcts
253
254 #define FreeGeneralizedTime FreeAsnOcts
255
256
257
258
259 typedef AsnOcts UniversalString; /* [UNIVERSAL 28] IMPLICIT OCTET STRING */
260
261 AsnLen BEncUniversalString PROTO ((BUF_TYPE b, UniversalString *v));
262
263 void BDecUniversalString PROTO ((BUF_TYPE b, UniversalString *result, AsnLen *bytesDecoded, ENV_TYPE env));
264 #define BEncUniversalStringContent BEncAsnOctsContent
265
266 #define BDecUniversalStringContent BDecAsnOctsContent
267
268 #define PrintUniversalString PrintAsnOcts
269
270 #define FreeUniversalString FreeAsnOcts
271
272
273
274
275 typedef AsnOcts BMPString; /* [UNIVERSAL 30] IMPLICIT OCTET STRING */
276
277 AsnLen BEncBMPString PROTO ((BUF_TYPE b, BMPString *v));
278
279 void BDecBMPString PROTO ((BUF_TYPE b, BMPString *result, AsnLen *bytesDecoded, ENV_TYPE env));
280 #define BEncBMPStringContent BEncAsnOctsContent
281
282 #define BDecBMPStringContent BDecAsnOctsContent
283
284 #define PrintBMPString PrintAsnOcts
285
286 #define FreeBMPString FreeAsnOcts
287
288
289
290
291 typedef struct EXTERNALChoice /* CHOICE */
292 {
293 enum EXTERNALChoiceChoiceId
294 {
295 EXTERNALCHOICE_SINGLE_ASN1_TYPE,
296 EXTERNALCHOICE_OCTET_ALIGNED,
297 EXTERNALCHOICE_ARBITRARY
298 } choiceId;
299 union EXTERNALChoiceChoiceUnion
300 {
301 AsnOcts* single_ASN1_type; /* [0] OCTET STRING */
302 AsnOcts* octet_aligned; /* [1] IMPLICIT OCTET STRING */
303 AsnBits* arbitrary; /* [2] IMPLICIT BIT STRING */
304 } a;
305 } EXTERNALChoice;
306
307 AsnLen BEncEXTERNALChoiceContent PROTO ((BUF_TYPE b, EXTERNALChoice *v));
308
309 void BDecEXTERNALChoiceContent PROTO ((BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, EXTERNALChoice *v, AsnLen *bytesDecoded, ENV_TYPE env));
310
311
312 void PrintEXTERNALChoice PROTO ((FILE* f, EXTERNALChoice *v, unsigned short int indent));
313 void FreeEXTERNALChoice PROTO ((EXTERNALChoice *v));
314
315
316
317
318
319 typedef struct EXTERNAL /* [UNIVERSAL 8] IMPLICIT SEQUENCE */
320 {
321 AsnOid direct_reference; /* OBJECT IDENTIFIER OPTIONAL */
322 AsnInt* indirect_reference; /* INTEGER OPTIONAL */
323 ObjectDescriptor data_value_descriptor; /* ObjectDescriptor OPTIONAL */
324 struct EXTERNALChoice* encoding; /* EXTERNALChoice */
325 } EXTERNAL;
326
327 AsnLen BEncEXTERNAL PROTO ((BUF_TYPE b, EXTERNAL *v));
328
329 void BDecEXTERNAL PROTO ((BUF_TYPE b, EXTERNAL *result, AsnLen *bytesDecoded, ENV_TYPE env));
330 AsnLen BEncEXTERNALContent PROTO ((BUF_TYPE b, EXTERNAL *v));
331
332 void BDecEXTERNALContent PROTO ((BUF_TYPE b, AsnTag tagId0, AsnLen elmtLen0, EXTERNAL *v, AsnLen *bytesDecoded, ENV_TYPE env));
333
334
335 void PrintEXTERNAL PROTO ((FILE* f, EXTERNAL *v, unsigned short int indent));
336 void FreeEXTERNAL PROTO ((EXTERNAL *v));
337
338
339
340
341
342
343 #endif /* conditional include of asn-useful.h */