blob: 837f6f7106866686ddecccc4e6a8070a91ffd24e [file] [log] [blame]
Lev Walkinc8285712005-03-04 22:18:20 +00001
2/*** <<< INCLUDES [Type] >>> ***/
3
4#include <asn_SEQUENCE_OF.h>
5#include <constr_SEQUENCE_OF.h>
6#include <constr_SEQUENCE.h>
7
8/*** <<< FWD-DECLS [Type] >>> ***/
9
10struct Epyt; /* Forward declaration */
11
12/*** <<< TYPE-DECLS [Type] >>> ***/
13
14typedef struct Type {
15 struct data {
16 A_SEQUENCE_OF(struct Epyt) list;
17
18 /* Context for parsing across buffer boundaries */
19 asn_struct_ctx_t _asn_ctx;
20 } data;
21
22 /* Context for parsing across buffer boundaries */
23 asn_struct_ctx_t _asn_ctx;
24} Type_t;
25
26/*** <<< FUNC-DECLS [Type] >>> ***/
27
28extern asn_TYPE_descriptor_t asn_DEF_Type;
29
30/*** <<< POST-INCLUDE [Type] >>> ***/
31
Lev Walkincaf0d5a2005-03-04 23:48:19 +000032#include <EpytRef.h>
Lev Walkinc8285712005-03-04 22:18:20 +000033
34/*** <<< STAT-DEFS [Type] >>> ***/
35
36static asn_TYPE_member_t asn_MBR_data_2[] = {
37 { ATF_NOFLAGS, 0, 0,
38 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
39 .tag_mode = 0,
Lev Walkincaf0d5a2005-03-04 23:48:19 +000040 .type = (void *)&asn_DEF_EpytRef,
Lev Walkinc8285712005-03-04 22:18:20 +000041 .memb_constraints = 0, /* Defer constraints checking to the member type */
42 .name = ""
43 },
44};
45static ber_tlv_tag_t asn_DEF_data_2_tags[] = {
46 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
47};
48static asn_SET_OF_specifics_t asn_SPC_data_2_specs = {
49 sizeof(struct data),
50 offsetof(struct data, _asn_ctx),
51 0, /* XER encoding is XMLDelimitedItemList */
52};
53static /* Use -fall-defs-global to expose */
54asn_TYPE_descriptor_t asn_DEF_data_2 = {
55 "data",
56 "data",
57 SEQUENCE_OF_free,
58 SEQUENCE_OF_print,
59 SEQUENCE_OF_constraint,
60 SEQUENCE_OF_decode_ber,
61 SEQUENCE_OF_encode_der,
62 SEQUENCE_OF_decode_xer,
63 SEQUENCE_OF_encode_xer,
64 0, /* Use generic outmost tag fetcher */
65 asn_DEF_data_2_tags,
66 sizeof(asn_DEF_data_2_tags)
67 /sizeof(asn_DEF_data_2_tags[0]), /* 1 */
68 asn_DEF_data_2_tags, /* Same as above */
69 sizeof(asn_DEF_data_2_tags)
70 /sizeof(asn_DEF_data_2_tags[0]), /* 1 */
71 asn_MBR_data_2,
72 1, /* Single element */
73 &asn_SPC_data_2_specs /* Additional specs */
74};
75
76static asn_TYPE_member_t asn_MBR_Type_1[] = {
77 { ATF_NOFLAGS, 0, offsetof(struct Type, data),
78 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
79 .tag_mode = 0,
80 .type = (void *)&asn_DEF_data_2,
81 .memb_constraints = 0, /* Defer constraints checking to the member type */
82 .name = "data"
83 },
84};
85static ber_tlv_tag_t asn_DEF_Type_1_tags[] = {
86 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
87};
88static asn_TYPE_tag2member_t asn_MAP_Type_1_tag2el[] = {
89 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data at 16 */
90};
91static asn_SEQUENCE_specifics_t asn_SPC_Type_1_specs = {
92 sizeof(struct Type),
93 offsetof(struct Type, _asn_ctx),
94 asn_MAP_Type_1_tag2el,
95 1, /* Count of tags in the map */
96 -1, /* Start extensions */
97 -1 /* Stop extensions */
98};
99asn_TYPE_descriptor_t asn_DEF_Type = {
100 "Type",
101 "Type",
102 SEQUENCE_free,
103 SEQUENCE_print,
104 SEQUENCE_constraint,
105 SEQUENCE_decode_ber,
106 SEQUENCE_encode_der,
107 SEQUENCE_decode_xer,
108 SEQUENCE_encode_xer,
109 0, /* Use generic outmost tag fetcher */
110 asn_DEF_Type_1_tags,
111 sizeof(asn_DEF_Type_1_tags)
112 /sizeof(asn_DEF_Type_1_tags[0]), /* 1 */
113 asn_DEF_Type_1_tags, /* Same as above */
114 sizeof(asn_DEF_Type_1_tags)
115 /sizeof(asn_DEF_Type_1_tags[0]), /* 1 */
116 asn_MBR_Type_1,
117 1, /* Elements count */
118 &asn_SPC_Type_1_specs /* Additional specs */
119};
120
121
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000122/*** <<< INCLUDES [EpytRef] >>> ***/
123
124#include <Epyt.h>
125
126/*** <<< TYPE-DECLS [EpytRef] >>> ***/
127
128typedef Epyt_t EpytRef_t;
129
130/*** <<< FUNC-DECLS [EpytRef] >>> ***/
131
132extern asn_TYPE_descriptor_t asn_DEF_EpytRef;
133asn_struct_free_f EpytRef_free;
134asn_struct_print_f EpytRef_print;
135asn_constr_check_f EpytRef_constraint;
136ber_type_decoder_f EpytRef_decode_ber;
137der_type_encoder_f EpytRef_encode_der;
138xer_type_decoder_f EpytRef_decode_xer;
139xer_type_encoder_f EpytRef_encode_xer;
140
141/*** <<< CODE [EpytRef] >>> ***/
142
143int
144EpytRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
145 asn_app_consume_bytes_f *app_errlog, void *app_key) {
146 /* Replace with underlying type checker */
147 td->check_constraints = asn_DEF_Epyt.check_constraints;
148 return td->check_constraints(td, sptr, app_errlog, app_key);
149}
150
151/*
152 * This type is implemented using Epyt,
153 * so here we adjust the DEF accordingly.
154 */
155static void
156EpytRef_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
157 td->free_struct = asn_DEF_Epyt.free_struct;
158 td->print_struct = asn_DEF_Epyt.print_struct;
159 td->ber_decoder = asn_DEF_Epyt.ber_decoder;
160 td->der_encoder = asn_DEF_Epyt.der_encoder;
161 td->xer_decoder = asn_DEF_Epyt.xer_decoder;
162 td->xer_encoder = asn_DEF_Epyt.xer_encoder;
163 td->elements = asn_DEF_Epyt.elements;
164 td->elements_count = asn_DEF_Epyt.elements_count;
165 td->specifics = asn_DEF_Epyt.specifics;
166}
167
168void
169EpytRef_free(asn_TYPE_descriptor_t *td,
170 void *struct_ptr, int contents_only) {
171 EpytRef_0_inherit_TYPE_descriptor(td);
172 td->free_struct(td, struct_ptr, contents_only);
173}
174
175int
176EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
177 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
178 EpytRef_0_inherit_TYPE_descriptor(td);
179 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
180}
181
182asn_dec_rval_t
183EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
184 void **structure, void *bufptr, size_t size, int tag_mode) {
185 EpytRef_0_inherit_TYPE_descriptor(td);
186 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
187}
188
189asn_enc_rval_t
190EpytRef_encode_der(asn_TYPE_descriptor_t *td,
191 void *structure, int tag_mode, ber_tlv_tag_t tag,
192 asn_app_consume_bytes_f *cb, void *app_key) {
193 EpytRef_0_inherit_TYPE_descriptor(td);
194 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
195}
196
197asn_dec_rval_t
198EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
199 void **structure, const char *opt_mname, void *bufptr, size_t size) {
200 EpytRef_0_inherit_TYPE_descriptor(td);
201 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
202}
203
204asn_enc_rval_t
205EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
206 int ilevel, enum xer_encoder_flags_e flags,
207 asn_app_consume_bytes_f *cb, void *app_key) {
208 EpytRef_0_inherit_TYPE_descriptor(td);
209 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
210}
211
212
213/*** <<< STAT-DEFS [EpytRef] >>> ***/
214
215static ber_tlv_tag_t asn_DEF_EpytRef_0_tags[] = {
216 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
217};
218asn_TYPE_descriptor_t asn_DEF_EpytRef = {
219 "EpytRef",
220 "EpytRef",
221 EpytRef_free,
222 EpytRef_print,
223 EpytRef_constraint,
224 EpytRef_decode_ber,
225 EpytRef_encode_der,
226 EpytRef_decode_xer,
227 EpytRef_encode_xer,
228 0, /* Use generic outmost tag fetcher */
229 asn_DEF_EpytRef_0_tags,
230 sizeof(asn_DEF_EpytRef_0_tags)
231 /sizeof(asn_DEF_EpytRef_0_tags[0]), /* 1 */
232 asn_DEF_EpytRef_0_tags, /* Same as above */
233 sizeof(asn_DEF_EpytRef_0_tags)
234 /sizeof(asn_DEF_EpytRef_0_tags[0]), /* 1 */
235 0, 0, /* Defined elsewhere */
236 0 /* No specifics */
237};
238
239
Lev Walkinc8285712005-03-04 22:18:20 +0000240/*** <<< INCLUDES [Epyt] >>> ***/
241
242#include <asn_SET_OF.h>
243#include <constr_SET_OF.h>
244#include <constr_SEQUENCE.h>
245
246/*** <<< FWD-DECLS [Epyt] >>> ***/
247
248struct Type; /* Forward declaration */
249struct Ypet; /* Forward declaration */
250
251/*** <<< TYPE-DECLS [Epyt] >>> ***/
252
253typedef struct Epyt {
254 struct stype {
255 A_SET_OF(struct Type) list;
256
257 /* Context for parsing across buffer boundaries */
258 asn_struct_ctx_t _asn_ctx;
259 } stype;
260 struct Type *type /* OPTIONAL */;
261 struct Ypet *ypet /* OPTIONAL */;
262
263 /* Context for parsing across buffer boundaries */
264 asn_struct_ctx_t _asn_ctx;
265} Epyt_t;
266
267/*** <<< FUNC-DECLS [Epyt] >>> ***/
268
269extern asn_TYPE_descriptor_t asn_DEF_Epyt;
270
271/*** <<< POST-INCLUDE [Epyt] >>> ***/
272
273#include <Type.h>
274#include <Ypet.h>
275
276/*** <<< STAT-DEFS [Epyt] >>> ***/
277
278static asn_TYPE_member_t asn_MBR_stype_2[] = {
279 { ATF_NOFLAGS, 0, 0,
280 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
281 .tag_mode = 0,
282 .type = (void *)&asn_DEF_Type,
283 .memb_constraints = 0, /* Defer constraints checking to the member type */
284 .name = ""
285 },
286};
287static ber_tlv_tag_t asn_DEF_stype_2_tags[] = {
288 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
289};
290static asn_SET_OF_specifics_t asn_SPC_stype_2_specs = {
291 sizeof(struct stype),
292 offsetof(struct stype, _asn_ctx),
293 0, /* XER encoding is XMLDelimitedItemList */
294};
295static /* Use -fall-defs-global to expose */
296asn_TYPE_descriptor_t asn_DEF_stype_2 = {
297 "stype",
298 "stype",
299 SET_OF_free,
300 SET_OF_print,
301 SET_OF_constraint,
302 SET_OF_decode_ber,
303 SET_OF_encode_der,
304 SET_OF_decode_xer,
305 SET_OF_encode_xer,
306 0, /* Use generic outmost tag fetcher */
307 asn_DEF_stype_2_tags,
308 sizeof(asn_DEF_stype_2_tags)
309 /sizeof(asn_DEF_stype_2_tags[0]), /* 1 */
310 asn_DEF_stype_2_tags, /* Same as above */
311 sizeof(asn_DEF_stype_2_tags)
312 /sizeof(asn_DEF_stype_2_tags[0]), /* 1 */
313 asn_MBR_stype_2,
314 1, /* Single element */
315 &asn_SPC_stype_2_specs /* Additional specs */
316};
317
318static asn_TYPE_member_t asn_MBR_Epyt_1[] = {
319 { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype),
320 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
321 .tag_mode = 0,
322 .type = (void *)&asn_DEF_stype_2,
323 .memb_constraints = 0, /* Defer constraints checking to the member type */
324 .name = "stype"
325 },
326 { ATF_POINTER, 2, offsetof(struct Epyt, type),
327 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
328 .tag_mode = 0,
329 .type = (void *)&asn_DEF_Type,
330 .memb_constraints = 0, /* Defer constraints checking to the member type */
331 .name = "type"
332 },
333 { ATF_POINTER, 1, offsetof(struct Epyt, ypet),
334 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
335 .tag_mode = 0,
336 .type = (void *)&asn_DEF_Ypet,
337 .memb_constraints = 0, /* Defer constraints checking to the member type */
338 .name = "ypet"
339 },
340};
341static ber_tlv_tag_t asn_DEF_Epyt_1_tags[] = {
342 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
343};
344static asn_TYPE_tag2member_t asn_MAP_Epyt_1_tag2el[] = {
345 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type at 22 */
346 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype at 21 */
347 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet at 23 */
348};
349static asn_SEQUENCE_specifics_t asn_SPC_Epyt_1_specs = {
350 sizeof(struct Epyt),
351 offsetof(struct Epyt, _asn_ctx),
352 asn_MAP_Epyt_1_tag2el,
353 3, /* Count of tags in the map */
354 -1, /* Start extensions */
355 -1 /* Stop extensions */
356};
357asn_TYPE_descriptor_t asn_DEF_Epyt = {
358 "Epyt",
359 "Epyt",
360 SEQUENCE_free,
361 SEQUENCE_print,
362 SEQUENCE_constraint,
363 SEQUENCE_decode_ber,
364 SEQUENCE_encode_der,
365 SEQUENCE_decode_xer,
366 SEQUENCE_encode_xer,
367 0, /* Use generic outmost tag fetcher */
368 asn_DEF_Epyt_1_tags,
369 sizeof(asn_DEF_Epyt_1_tags)
370 /sizeof(asn_DEF_Epyt_1_tags[0]), /* 1 */
371 asn_DEF_Epyt_1_tags, /* Same as above */
372 sizeof(asn_DEF_Epyt_1_tags)
373 /sizeof(asn_DEF_Epyt_1_tags[0]), /* 1 */
374 asn_MBR_Epyt_1,
375 3, /* Elements count */
376 &asn_SPC_Epyt_1_specs /* Additional specs */
377};
378
379
380/*** <<< INCLUDES [Ypet] >>> ***/
381
382#include <Epyt.h>
383#include <INTEGER.h>
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000384#include <EnumType.h>
385#include <asn_SET_OF.h>
386#include <constr_SET_OF.h>
Lev Walkinc8285712005-03-04 22:18:20 +0000387#include <constr_SET.h>
388
389/*** <<< DEPS [Ypet] >>> ***/
390
391
392/*
393 * Method of determining the components presence
394 */
395typedef enum Ypet_PR {
396 Ypet_PR_epyt, /* Member epyt is present */
397 Ypet_PR_plain, /* Member plain is present */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000398 Ypet_PR_senums, /* Member senums is present */
Lev Walkinc8285712005-03-04 22:18:20 +0000399} Ypet_PR;
400
401/*** <<< TYPE-DECLS [Ypet] >>> ***/
402
403typedef struct Ypet {
404 Epyt_t epyt;
405 INTEGER_t *plain /* DEFAULT 7 */;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000406 struct senums {
407 A_SET_OF(EnumType_t) list;
408
409 /* Context for parsing across buffer boundaries */
410 asn_struct_ctx_t _asn_ctx;
411 } senums;
Lev Walkinc8285712005-03-04 22:18:20 +0000412
413 /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
414 unsigned int _presence_map
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000415 [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
Lev Walkinc8285712005-03-04 22:18:20 +0000416
417 /* Context for parsing across buffer boundaries */
418 asn_struct_ctx_t _asn_ctx;
419} Ypet_t;
420
421/*** <<< FUNC-DECLS [Ypet] >>> ***/
422
423extern asn_TYPE_descriptor_t asn_DEF_Ypet;
424
425/*** <<< STAT-DEFS [Ypet] >>> ***/
426
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000427static asn_TYPE_member_t asn_MBR_senums_2[] = {
428 { ATF_NOFLAGS, 0, 0,
429 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
430 .tag_mode = 0,
431 .type = (void *)&asn_DEF_EnumType,
432 .memb_constraints = 0, /* Defer constraints checking to the member type */
433 .name = ""
434 },
435};
436static ber_tlv_tag_t asn_DEF_senums_2_tags[] = {
437 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
438};
439static asn_SET_OF_specifics_t asn_SPC_senums_2_specs = {
440 sizeof(struct senums),
441 offsetof(struct senums, _asn_ctx),
442 1, /* XER encoding is XMLValueList */
443};
444static /* Use -fall-defs-global to expose */
445asn_TYPE_descriptor_t asn_DEF_senums_2 = {
446 "senums",
447 "senums",
448 SET_OF_free,
449 SET_OF_print,
450 SET_OF_constraint,
451 SET_OF_decode_ber,
452 SET_OF_encode_der,
453 SET_OF_decode_xer,
454 SET_OF_encode_xer,
455 0, /* Use generic outmost tag fetcher */
456 asn_DEF_senums_2_tags,
457 sizeof(asn_DEF_senums_2_tags)
458 /sizeof(asn_DEF_senums_2_tags[0]), /* 1 */
459 asn_DEF_senums_2_tags, /* Same as above */
460 sizeof(asn_DEF_senums_2_tags)
461 /sizeof(asn_DEF_senums_2_tags[0]), /* 1 */
462 asn_MBR_senums_2,
463 1, /* Single element */
464 &asn_SPC_senums_2_specs /* Additional specs */
465};
466
Lev Walkinc8285712005-03-04 22:18:20 +0000467static asn_TYPE_member_t asn_MBR_Ypet_1[] = {
468 { ATF_NOFLAGS, 0, offsetof(struct Ypet, epyt),
469 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
470 .tag_mode = 0,
471 .type = (void *)&asn_DEF_Epyt,
472 .memb_constraints = 0, /* Defer constraints checking to the member type */
473 .name = "epyt"
474 },
475 { ATF_POINTER, 1, offsetof(struct Ypet, plain),
476 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
477 .tag_mode = 0,
478 .type = (void *)&asn_DEF_INTEGER,
479 .memb_constraints = 0, /* Defer constraints checking to the member type */
480 .name = "plain"
481 },
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000482 { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
483 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
484 .tag_mode = 0,
485 .type = (void *)&asn_DEF_senums_2,
486 .memb_constraints = 0, /* Defer constraints checking to the member type */
487 .name = "senums"
488 },
Lev Walkinc8285712005-03-04 22:18:20 +0000489};
490static ber_tlv_tag_t asn_DEF_Ypet_1_tags[] = {
491 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
492};
493static asn_TYPE_tag2member_t asn_MAP_Ypet_1_tag2el[] = {
494 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain at 28 */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000495 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt at 27 */
496 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 } /* senums at 30 */
Lev Walkinc8285712005-03-04 22:18:20 +0000497};
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000498static uint8_t asn_MAP_Ypet_1_mmap[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = {
499 (1 << 7) | (0 << 6) | (1 << 5)
Lev Walkinc8285712005-03-04 22:18:20 +0000500};
501static asn_SET_specifics_t asn_SPC_Ypet_1_specs = {
502 sizeof(struct Ypet),
503 offsetof(struct Ypet, _asn_ctx),
504 offsetof(struct Ypet, _presence_map),
505 asn_MAP_Ypet_1_tag2el,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000506 3, /* Count of tags in the map */
Lev Walkinc8285712005-03-04 22:18:20 +0000507 asn_MAP_Ypet_1_tag2el, /* Same as above */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000508 3, /* Count of tags in the CXER map */
Lev Walkinc8285712005-03-04 22:18:20 +0000509 0, /* Whether extensible */
510 (unsigned int *)asn_MAP_Ypet_1_mmap /* Mandatory elements map */
511};
512asn_TYPE_descriptor_t asn_DEF_Ypet = {
513 "Ypet",
514 "Ypet",
515 SET_free,
516 SET_print,
517 SET_constraint,
518 SET_decode_ber,
519 SET_encode_der,
520 SET_decode_xer,
521 SET_encode_xer,
522 0, /* Use generic outmost tag fetcher */
523 asn_DEF_Ypet_1_tags,
524 sizeof(asn_DEF_Ypet_1_tags)
525 /sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */
526 asn_DEF_Ypet_1_tags, /* Same as above */
527 sizeof(asn_DEF_Ypet_1_tags)
528 /sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */
529 asn_MBR_Ypet_1,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000530 3, /* Elements count */
Lev Walkinc8285712005-03-04 22:18:20 +0000531 &asn_SPC_Ypet_1_specs /* Additional specs */
532};
533
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000534
535/*** <<< INCLUDES [EnumType] >>> ***/
536
537#include <ENUMERATED.h>
538
539/*** <<< DEPS [EnumType] >>> ***/
540
541typedef enum EnumType {
542 EnumType_one = 0,
543 EnumType_two = 1
544} EnumType_e;
545
546/*** <<< TYPE-DECLS [EnumType] >>> ***/
547
548typedef ENUMERATED_t EnumType_t;
549
550/*** <<< FUNC-DECLS [EnumType] >>> ***/
551
552extern asn_TYPE_descriptor_t asn_DEF_EnumType;
553asn_struct_free_f EnumType_free;
554asn_struct_print_f EnumType_print;
555asn_constr_check_f EnumType_constraint;
556ber_type_decoder_f EnumType_decode_ber;
557der_type_encoder_f EnumType_encode_der;
558xer_type_decoder_f EnumType_decode_xer;
559xer_type_encoder_f EnumType_encode_xer;
560
561/*** <<< CODE [EnumType] >>> ***/
562
563int
564EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
565 asn_app_consume_bytes_f *app_errlog, void *app_key) {
566 /* Replace with underlying type checker */
567 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
568 return td->check_constraints(td, sptr, app_errlog, app_key);
569}
570
571/*
572 * This type is implemented using ENUMERATED,
573 * so here we adjust the DEF accordingly.
574 */
575static void
576EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
577 td->free_struct = asn_DEF_ENUMERATED.free_struct;
578 td->print_struct = asn_DEF_ENUMERATED.print_struct;
579 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
580 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
581 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
582 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
583 td->elements = asn_DEF_ENUMERATED.elements;
584 td->elements_count = asn_DEF_ENUMERATED.elements_count;
585 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
586}
587
588void
589EnumType_free(asn_TYPE_descriptor_t *td,
590 void *struct_ptr, int contents_only) {
591 EnumType_1_inherit_TYPE_descriptor(td);
592 td->free_struct(td, struct_ptr, contents_only);
593}
594
595int
596EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
597 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
598 EnumType_1_inherit_TYPE_descriptor(td);
599 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
600}
601
602asn_dec_rval_t
603EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
604 void **structure, void *bufptr, size_t size, int tag_mode) {
605 EnumType_1_inherit_TYPE_descriptor(td);
606 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
607}
608
609asn_enc_rval_t
610EnumType_encode_der(asn_TYPE_descriptor_t *td,
611 void *structure, int tag_mode, ber_tlv_tag_t tag,
612 asn_app_consume_bytes_f *cb, void *app_key) {
613 EnumType_1_inherit_TYPE_descriptor(td);
614 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
615}
616
617asn_dec_rval_t
618EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
619 void **structure, const char *opt_mname, void *bufptr, size_t size) {
620 EnumType_1_inherit_TYPE_descriptor(td);
621 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
622}
623
624asn_enc_rval_t
625EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
626 int ilevel, enum xer_encoder_flags_e flags,
627 asn_app_consume_bytes_f *cb, void *app_key) {
628 EnumType_1_inherit_TYPE_descriptor(td);
629 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
630}
631
632
633/*** <<< STAT-DEFS [EnumType] >>> ***/
634
635static asn_INTEGER_enum_map_t asn_MAP_EnumType_1_value2enum[] = {
636 { 0, 3, "one" },
637 { 1, 3, "two" }
638};
639static unsigned int asn_MAP_EnumType_1_enum2value[] = {
640 0, /* one(0) */
641 1 /* two(1) */
642};
643static asn_INTEGER_specifics_t asn_SPC_EnumType_1_specs = {
644 asn_MAP_EnumType_1_value2enum, /* "tag" => N; sorted by tag */
645 asn_MAP_EnumType_1_enum2value, /* N => "tag"; sorted by N */
646 2, /* Number of elements in the maps */
647 0, /* Enumeration is not extensible */
648 1 /* Strict enumeration */
649};
650static ber_tlv_tag_t asn_DEF_EnumType_1_tags[] = {
651 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
652};
653asn_TYPE_descriptor_t asn_DEF_EnumType = {
654 "EnumType",
655 "EnumType",
656 EnumType_free,
657 EnumType_print,
658 EnumType_constraint,
659 EnumType_decode_ber,
660 EnumType_encode_der,
661 EnumType_decode_xer,
662 EnumType_encode_xer,
663 0, /* Use generic outmost tag fetcher */
664 asn_DEF_EnumType_1_tags,
665 sizeof(asn_DEF_EnumType_1_tags)
666 /sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */
667 asn_DEF_EnumType_1_tags, /* Same as above */
668 sizeof(asn_DEF_EnumType_1_tags)
669 /sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */
670 0, 0, /* Defined elsewhere */
671 &asn_SPC_EnumType_1_specs /* Additional specs */
672};
673