blob: 3bf204673af362cc504e88a0badbfb2abf216fac [file] [log] [blame]
vlm0b567bf2005-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
vlm5feb7522005-03-04 23:50:56 +000010struct Epyt;
vlm0b567bf2005-03-04 22:18:20 +000011
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
vlm1f7df782005-03-04 23:48:19 +000032#include <EpytRef.h>
vlm0b567bf2005-03-04 22:18:20 +000033
34/*** <<< STAT-DEFS [Type] >>> ***/
35
36static asn_TYPE_member_t asn_MBR_data_2[] = {
vlm2cebdf32005-08-16 16:57:17 +000037 { ATF_POINTER, 0, 0,
vlm0b567bf2005-03-04 22:18:20 +000038 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
39 .tag_mode = 0,
vlm1f7df782005-03-04 23:48:19 +000040 .type = (void *)&asn_DEF_EpytRef,
vlm0b567bf2005-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
vlm1f7df782005-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
vlm67d57fe2005-03-06 09:29:03 +0000156EpytRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
vlm1f7df782005-03-04 23:48:19 +0000157 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) {
vlm67d57fe2005-03-06 09:29:03 +0000171 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000172 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) {
vlm67d57fe2005-03-06 09:29:03 +0000178 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000179 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,
vlmc04faea2005-03-17 21:57:19 +0000184 void **structure, const void *bufptr, size_t size, int tag_mode) {
vlm67d57fe2005-03-06 09:29:03 +0000185 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000186 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) {
vlm67d57fe2005-03-06 09:29:03 +0000193 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000194 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,
vlmc04faea2005-03-17 21:57:19 +0000199 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
vlm67d57fe2005-03-06 09:29:03 +0000200 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000201 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) {
vlm67d57fe2005-03-06 09:29:03 +0000208 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000209 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
210}
211
212
213/*** <<< STAT-DEFS [EpytRef] >>> ***/
214
vlm67d57fe2005-03-06 09:29:03 +0000215static ber_tlv_tag_t asn_DEF_EpytRef_1_tags[] = {
vlm1f7df782005-03-04 23:48:19 +0000216 (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 */
vlm67d57fe2005-03-06 09:29:03 +0000229 asn_DEF_EpytRef_1_tags,
230 sizeof(asn_DEF_EpytRef_1_tags)
231 /sizeof(asn_DEF_EpytRef_1_tags[0]), /* 1 */
232 asn_DEF_EpytRef_1_tags, /* Same as above */
233 sizeof(asn_DEF_EpytRef_1_tags)
234 /sizeof(asn_DEF_EpytRef_1_tags[0]), /* 1 */
vlm1f7df782005-03-04 23:48:19 +0000235 0, 0, /* Defined elsewhere */
236 0 /* No specifics */
237};
238
239
vlm0b567bf2005-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
vlm5feb7522005-03-04 23:50:56 +0000248struct Type;
249struct Ypet;
vlm0b567bf2005-03-04 22:18:20 +0000250
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[] = {
vlm2cebdf32005-08-16 16:57:17 +0000279 { ATF_POINTER, 0, 0,
vlm0b567bf2005-03-04 22:18:20 +0000280 .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
vlm0b567bf2005-03-04 22:18:20 +0000382#include <INTEGER.h>
vlm67d57fe2005-03-06 09:29:03 +0000383#include <IA5String.h>
vlm6c5d5e52005-03-04 22:38:22 +0000384#include <EnumType.h>
385#include <asn_SET_OF.h>
386#include <constr_SET_OF.h>
vlm0b567bf2005-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 */
vlm6c5d5e52005-03-04 22:38:22 +0000398 Ypet_PR_senums, /* Member senums is present */
vlm67d57fe2005-03-06 09:29:03 +0000399 Ypet_PR_patest1, /* Member patest1 is present */
400 Ypet_PR_patest2, /* Member patest2 is present */
vlm0b567bf2005-03-04 22:18:20 +0000401} Ypet_PR;
402
vlm6c4a8502005-08-18 13:38:19 +0000403/*** <<< FWD-DECLS [Ypet] >>> ***/
404
405struct Epyt;
406
vlm0b567bf2005-03-04 22:18:20 +0000407/*** <<< TYPE-DECLS [Ypet] >>> ***/
408
409typedef struct Ypet {
vlm6c4a8502005-08-18 13:38:19 +0000410 struct Epyt *epyt;
vlm0b567bf2005-03-04 22:18:20 +0000411 INTEGER_t *plain /* DEFAULT 7 */;
vlm6c5d5e52005-03-04 22:38:22 +0000412 struct senums {
413 A_SET_OF(EnumType_t) list;
414
415 /* Context for parsing across buffer boundaries */
416 asn_struct_ctx_t _asn_ctx;
417 } senums;
vlm67d57fe2005-03-06 09:29:03 +0000418 IA5String_t patest1;
419 IA5String_t patest2;
vlm0b567bf2005-03-04 22:18:20 +0000420
421 /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
422 unsigned int _presence_map
vlm67d57fe2005-03-06 09:29:03 +0000423 [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
vlm0b567bf2005-03-04 22:18:20 +0000424
425 /* Context for parsing across buffer boundaries */
426 asn_struct_ctx_t _asn_ctx;
427} Ypet_t;
428
429/*** <<< FUNC-DECLS [Ypet] >>> ***/
430
431extern asn_TYPE_descriptor_t asn_DEF_Ypet;
432
vlm6c4a8502005-08-18 13:38:19 +0000433/*** <<< POST-INCLUDE [Ypet] >>> ***/
434
435#include <Epyt.h>
436
vlm67d57fe2005-03-06 09:29:03 +0000437/*** <<< CTABLES [Ypet] >>> ***/
438
439static int check_permitted_alphabet_6(const void *sptr) {
440 /* The underlying type is IA5String */
441 const IA5String_t *st = (const IA5String_t *)sptr;
442 const uint8_t *ch = st->buf;
443 const uint8_t *end = ch + st->size;
444
445 for(; ch < end; ch++) {
446 uint8_t cv = *ch;
447 if(!(cv >= 65 && cv <= 90)) return -1;
448 }
449 return 0;
450}
451
452static int check_permitted_alphabet_7(const void *sptr) {
453 /* The underlying type is IA5String */
454 const IA5String_t *st = (const IA5String_t *)sptr;
455 const uint8_t *ch = st->buf;
456 const uint8_t *end = ch + st->size;
457
458 for(; ch < end; ch++) {
459 uint8_t cv = *ch;
460 if(!(cv >= 97 && cv <= 122)) return -1;
461 }
462 return 0;
463}
464
465
466/*** <<< CODE [Ypet] >>> ***/
467
468static int
469memb_patest1_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
470 asn_app_consume_bytes_f *app_errlog, void *app_key) {
471 const IA5String_t *st = (const IA5String_t *)sptr;
472
473 if(!sptr) {
474 _ASN_ERRLOG(app_errlog, app_key,
475 "%s: value not given (%s:%d)",
476 td->name, __FILE__, __LINE__);
477 return -1;
478 }
479
480
481 if(!check_permitted_alphabet_6(st)) {
482 /* Constraint check succeeded */
483 return 0;
484 } else {
485 _ASN_ERRLOG(app_errlog, app_key,
486 "%s: constraint failed (%s:%d)",
487 td->name, __FILE__, __LINE__);
488 return -1;
489 }
490}
491
492static int
493memb_patest2_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
494 asn_app_consume_bytes_f *app_errlog, void *app_key) {
495 const IA5String_t *st = (const IA5String_t *)sptr;
496
497 if(!sptr) {
498 _ASN_ERRLOG(app_errlog, app_key,
499 "%s: value not given (%s:%d)",
500 td->name, __FILE__, __LINE__);
501 return -1;
502 }
503
504
505 if(!check_permitted_alphabet_7(st)) {
506 /* Constraint check succeeded */
507 return 0;
508 } else {
509 _ASN_ERRLOG(app_errlog, app_key,
510 "%s: constraint failed (%s:%d)",
511 td->name, __FILE__, __LINE__);
512 return -1;
513 }
514}
515
516
vlm0b567bf2005-03-04 22:18:20 +0000517/*** <<< STAT-DEFS [Ypet] >>> ***/
518
vlm67d57fe2005-03-06 09:29:03 +0000519static asn_TYPE_member_t asn_MBR_senums_4[] = {
vlm2cebdf32005-08-16 16:57:17 +0000520 { ATF_POINTER, 0, 0,
vlm6c5d5e52005-03-04 22:38:22 +0000521 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
522 .tag_mode = 0,
523 .type = (void *)&asn_DEF_EnumType,
524 .memb_constraints = 0, /* Defer constraints checking to the member type */
525 .name = ""
526 },
527};
vlm67d57fe2005-03-06 09:29:03 +0000528static ber_tlv_tag_t asn_DEF_senums_4_tags[] = {
vlm6c5d5e52005-03-04 22:38:22 +0000529 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
530};
vlm67d57fe2005-03-06 09:29:03 +0000531static asn_SET_OF_specifics_t asn_SPC_senums_4_specs = {
vlm6c5d5e52005-03-04 22:38:22 +0000532 sizeof(struct senums),
533 offsetof(struct senums, _asn_ctx),
534 1, /* XER encoding is XMLValueList */
535};
536static /* Use -fall-defs-global to expose */
vlm67d57fe2005-03-06 09:29:03 +0000537asn_TYPE_descriptor_t asn_DEF_senums_4 = {
vlm6c5d5e52005-03-04 22:38:22 +0000538 "senums",
539 "senums",
540 SET_OF_free,
541 SET_OF_print,
542 SET_OF_constraint,
543 SET_OF_decode_ber,
544 SET_OF_encode_der,
545 SET_OF_decode_xer,
546 SET_OF_encode_xer,
547 0, /* Use generic outmost tag fetcher */
vlm67d57fe2005-03-06 09:29:03 +0000548 asn_DEF_senums_4_tags,
549 sizeof(asn_DEF_senums_4_tags)
550 /sizeof(asn_DEF_senums_4_tags[0]), /* 1 */
551 asn_DEF_senums_4_tags, /* Same as above */
552 sizeof(asn_DEF_senums_4_tags)
553 /sizeof(asn_DEF_senums_4_tags[0]), /* 1 */
554 asn_MBR_senums_4,
vlm6c5d5e52005-03-04 22:38:22 +0000555 1, /* Single element */
vlm67d57fe2005-03-06 09:29:03 +0000556 &asn_SPC_senums_4_specs /* Additional specs */
vlm6c5d5e52005-03-04 22:38:22 +0000557};
558
vlm0b567bf2005-03-04 22:18:20 +0000559static asn_TYPE_member_t asn_MBR_Ypet_1[] = {
vlm6c4a8502005-08-18 13:38:19 +0000560 { ATF_POINTER, 0, offsetof(struct Ypet, epyt),
vlm0b567bf2005-03-04 22:18:20 +0000561 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
562 .tag_mode = 0,
563 .type = (void *)&asn_DEF_Epyt,
564 .memb_constraints = 0, /* Defer constraints checking to the member type */
565 .name = "epyt"
566 },
567 { ATF_POINTER, 1, offsetof(struct Ypet, plain),
568 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
569 .tag_mode = 0,
570 .type = (void *)&asn_DEF_INTEGER,
571 .memb_constraints = 0, /* Defer constraints checking to the member type */
572 .name = "plain"
573 },
vlm6c5d5e52005-03-04 22:38:22 +0000574 { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
575 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
576 .tag_mode = 0,
vlm67d57fe2005-03-06 09:29:03 +0000577 .type = (void *)&asn_DEF_senums_4,
vlm6c5d5e52005-03-04 22:38:22 +0000578 .memb_constraints = 0, /* Defer constraints checking to the member type */
579 .name = "senums"
580 },
vlm67d57fe2005-03-06 09:29:03 +0000581 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),
582 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
583 .tag_mode = +1, /* EXPLICIT tag at current level */
584 .type = (void *)&asn_DEF_IA5String,
585 .memb_constraints = memb_patest1_1_constraint,
586 .name = "patest1"
587 },
588 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),
589 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
590 .tag_mode = +1, /* EXPLICIT tag at current level */
591 .type = (void *)&asn_DEF_IA5String,
592 .memb_constraints = memb_patest2_1_constraint,
593 .name = "patest2"
594 },
vlm0b567bf2005-03-04 22:18:20 +0000595};
596static ber_tlv_tag_t asn_DEF_Ypet_1_tags[] = {
597 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
598};
599static asn_TYPE_tag2member_t asn_MAP_Ypet_1_tag2el[] = {
600 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain at 28 */
vlm6c5d5e52005-03-04 22:38:22 +0000601 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt at 27 */
vlm67d57fe2005-03-06 09:29:03 +0000602 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums at 29 */
603 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 at 30 */
604 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 at 31 */
vlm0b567bf2005-03-04 22:18:20 +0000605};
vlm67d57fe2005-03-06 09:29:03 +0000606static uint8_t asn_MAP_Ypet_1_mmap[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {
607 (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)
vlm0b567bf2005-03-04 22:18:20 +0000608};
609static asn_SET_specifics_t asn_SPC_Ypet_1_specs = {
610 sizeof(struct Ypet),
611 offsetof(struct Ypet, _asn_ctx),
612 offsetof(struct Ypet, _presence_map),
613 asn_MAP_Ypet_1_tag2el,
vlm67d57fe2005-03-06 09:29:03 +0000614 5, /* Count of tags in the map */
vlm0b567bf2005-03-04 22:18:20 +0000615 asn_MAP_Ypet_1_tag2el, /* Same as above */
vlm67d57fe2005-03-06 09:29:03 +0000616 5, /* Count of tags in the CXER map */
vlm0b567bf2005-03-04 22:18:20 +0000617 0, /* Whether extensible */
618 (unsigned int *)asn_MAP_Ypet_1_mmap /* Mandatory elements map */
619};
620asn_TYPE_descriptor_t asn_DEF_Ypet = {
621 "Ypet",
622 "Ypet",
623 SET_free,
624 SET_print,
625 SET_constraint,
626 SET_decode_ber,
627 SET_encode_der,
628 SET_decode_xer,
629 SET_encode_xer,
630 0, /* Use generic outmost tag fetcher */
631 asn_DEF_Ypet_1_tags,
632 sizeof(asn_DEF_Ypet_1_tags)
633 /sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */
634 asn_DEF_Ypet_1_tags, /* Same as above */
635 sizeof(asn_DEF_Ypet_1_tags)
636 /sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */
637 asn_MBR_Ypet_1,
vlm67d57fe2005-03-06 09:29:03 +0000638 5, /* Elements count */
vlm0b567bf2005-03-04 22:18:20 +0000639 &asn_SPC_Ypet_1_specs /* Additional specs */
640};
641
vlm6c5d5e52005-03-04 22:38:22 +0000642
643/*** <<< INCLUDES [EnumType] >>> ***/
644
645#include <ENUMERATED.h>
646
647/*** <<< DEPS [EnumType] >>> ***/
648
649typedef enum EnumType {
650 EnumType_one = 0,
651 EnumType_two = 1
652} EnumType_e;
653
654/*** <<< TYPE-DECLS [EnumType] >>> ***/
655
656typedef ENUMERATED_t EnumType_t;
657
658/*** <<< FUNC-DECLS [EnumType] >>> ***/
659
660extern asn_TYPE_descriptor_t asn_DEF_EnumType;
661asn_struct_free_f EnumType_free;
662asn_struct_print_f EnumType_print;
663asn_constr_check_f EnumType_constraint;
664ber_type_decoder_f EnumType_decode_ber;
665der_type_encoder_f EnumType_encode_der;
666xer_type_decoder_f EnumType_decode_xer;
667xer_type_encoder_f EnumType_encode_xer;
668
669/*** <<< CODE [EnumType] >>> ***/
670
671int
672EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
673 asn_app_consume_bytes_f *app_errlog, void *app_key) {
674 /* Replace with underlying type checker */
675 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
676 return td->check_constraints(td, sptr, app_errlog, app_key);
677}
678
679/*
680 * This type is implemented using ENUMERATED,
681 * so here we adjust the DEF accordingly.
682 */
683static void
684EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
685 td->free_struct = asn_DEF_ENUMERATED.free_struct;
686 td->print_struct = asn_DEF_ENUMERATED.print_struct;
687 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
688 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
689 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
690 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
691 td->elements = asn_DEF_ENUMERATED.elements;
692 td->elements_count = asn_DEF_ENUMERATED.elements_count;
vlm541def92005-03-29 19:05:37 +0000693 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
vlm6c5d5e52005-03-04 22:38:22 +0000694}
695
696void
697EnumType_free(asn_TYPE_descriptor_t *td,
698 void *struct_ptr, int contents_only) {
699 EnumType_1_inherit_TYPE_descriptor(td);
700 td->free_struct(td, struct_ptr, contents_only);
701}
702
703int
704EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
705 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
706 EnumType_1_inherit_TYPE_descriptor(td);
707 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
708}
709
710asn_dec_rval_t
711EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000712 void **structure, const void *bufptr, size_t size, int tag_mode) {
vlm6c5d5e52005-03-04 22:38:22 +0000713 EnumType_1_inherit_TYPE_descriptor(td);
714 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
715}
716
717asn_enc_rval_t
718EnumType_encode_der(asn_TYPE_descriptor_t *td,
719 void *structure, int tag_mode, ber_tlv_tag_t tag,
720 asn_app_consume_bytes_f *cb, void *app_key) {
721 EnumType_1_inherit_TYPE_descriptor(td);
722 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
723}
724
725asn_dec_rval_t
726EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000727 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
vlm6c5d5e52005-03-04 22:38:22 +0000728 EnumType_1_inherit_TYPE_descriptor(td);
729 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
730}
731
732asn_enc_rval_t
733EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
734 int ilevel, enum xer_encoder_flags_e flags,
735 asn_app_consume_bytes_f *cb, void *app_key) {
736 EnumType_1_inherit_TYPE_descriptor(td);
737 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
738}
739
740
741/*** <<< STAT-DEFS [EnumType] >>> ***/
742
743static asn_INTEGER_enum_map_t asn_MAP_EnumType_1_value2enum[] = {
744 { 0, 3, "one" },
745 { 1, 3, "two" }
746};
747static unsigned int asn_MAP_EnumType_1_enum2value[] = {
748 0, /* one(0) */
749 1 /* two(1) */
750};
751static asn_INTEGER_specifics_t asn_SPC_EnumType_1_specs = {
752 asn_MAP_EnumType_1_value2enum, /* "tag" => N; sorted by tag */
753 asn_MAP_EnumType_1_enum2value, /* N => "tag"; sorted by N */
754 2, /* Number of elements in the maps */
755 0, /* Enumeration is not extensible */
756 1 /* Strict enumeration */
757};
758static ber_tlv_tag_t asn_DEF_EnumType_1_tags[] = {
759 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
760};
761asn_TYPE_descriptor_t asn_DEF_EnumType = {
762 "EnumType",
763 "EnumType",
764 EnumType_free,
765 EnumType_print,
766 EnumType_constraint,
767 EnumType_decode_ber,
768 EnumType_encode_der,
769 EnumType_decode_xer,
770 EnumType_encode_xer,
771 0, /* Use generic outmost tag fetcher */
772 asn_DEF_EnumType_1_tags,
773 sizeof(asn_DEF_EnumType_1_tags)
774 /sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */
775 asn_DEF_EnumType_1_tags, /* Same as above */
776 sizeof(asn_DEF_EnumType_1_tags)
777 /sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */
778 0, 0, /* Defined elsewhere */
779 &asn_SPC_EnumType_1_specs /* Additional specs */
780};
781