Debian Codegraph @

tests/73-circular-OK.asn1.-Pfwide-types

raw
1
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
10 struct Epyt;
11
12 /*** <<< TYPE-DECLS [Type] >>> ***/
13
14 typedef 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
28 extern asn_TYPE_descriptor_t asn_DEF_Type;
29
30 /*** <<< POST-INCLUDE [Type] >>> ***/
31
32 #include "EpytRef.h"
33
34 /*** <<< STAT-DEFS [Type] >>> ***/
35
36 static asn_TYPE_member_t asn_MBR_data_2[] = {
37 { ATF_POINTER, 0, 0,
38 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
39 .tag_mode = 0,
40 .type = &asn_DEF_EpytRef,
41 .memb_constraints = 0, /* Defer constraints checking to the member type */
42 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
43 .default_value = 0,
44 .name = ""
45 },
46 };
47 static const ber_tlv_tag_t asn_DEF_data_tags_2[] = {
48 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
49 };
50 static asn_SET_OF_specifics_t asn_SPC_data_specs_2 = {
51 sizeof(struct data),
52 offsetof(struct data, _asn_ctx),
53 0, /* XER encoding is XMLDelimitedItemList */
54 };
55 static /* Use -fall-defs-global to expose */
56 asn_TYPE_descriptor_t asn_DEF_data_2 = {
57 "data",
58 "data",
59 SEQUENCE_OF_free,
60 SEQUENCE_OF_print,
61 SEQUENCE_OF_constraint,
62 SEQUENCE_OF_decode_ber,
63 SEQUENCE_OF_encode_der,
64 SEQUENCE_OF_decode_xer,
65 SEQUENCE_OF_encode_xer,
66 0, 0, /* No PER support, use "-gen-PER" to enable */
67 0, /* Use generic outmost tag fetcher */
68 asn_DEF_data_tags_2,
69 sizeof(asn_DEF_data_tags_2)
70 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
71 asn_DEF_data_tags_2, /* Same as above */
72 sizeof(asn_DEF_data_tags_2)
73 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
74 0, /* No PER visible constraints */
75 asn_MBR_data_2,
76 1, /* Single element */
77 &asn_SPC_data_specs_2 /* Additional specs */
78 };
79
80 static asn_TYPE_member_t asn_MBR_Type_1[] = {
81 { ATF_NOFLAGS, 0, offsetof(struct Type, data),
82 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
83 .tag_mode = 0,
84 .type = &asn_DEF_data_2,
85 .memb_constraints = 0, /* Defer constraints checking to the member type */
86 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
87 .default_value = 0,
88 .name = "data"
89 },
90 };
91 static const ber_tlv_tag_t asn_DEF_Type_tags_1[] = {
92 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
93 };
94 static const asn_TYPE_tag2member_t asn_MAP_Type_tag2el_1[] = {
95 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data */
96 };
97 static asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1 = {
98 sizeof(struct Type),
99 offsetof(struct Type, _asn_ctx),
100 asn_MAP_Type_tag2el_1,
101 1, /* Count of tags in the map */
102 0, 0, 0, /* Optional elements (not needed) */
103 -1, /* Start extensions */
104 -1 /* Stop extensions */
105 };
106 asn_TYPE_descriptor_t asn_DEF_Type = {
107 "Type",
108 "Type",
109 SEQUENCE_free,
110 SEQUENCE_print,
111 SEQUENCE_constraint,
112 SEQUENCE_decode_ber,
113 SEQUENCE_encode_der,
114 SEQUENCE_decode_xer,
115 SEQUENCE_encode_xer,
116 0, 0, /* No PER support, use "-gen-PER" to enable */
117 0, /* Use generic outmost tag fetcher */
118 asn_DEF_Type_tags_1,
119 sizeof(asn_DEF_Type_tags_1)
120 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
121 asn_DEF_Type_tags_1, /* Same as above */
122 sizeof(asn_DEF_Type_tags_1)
123 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
124 0, /* No PER visible constraints */
125 asn_MBR_Type_1,
126 1, /* Elements count */
127 &asn_SPC_Type_specs_1 /* Additional specs */
128 };
129
130
131 /*** <<< INCLUDES [EpytRef] >>> ***/
132
133 #include "Epyt.h"
134
135 /*** <<< TYPE-DECLS [EpytRef] >>> ***/
136
137 typedef Epyt_t EpytRef_t;
138
139 /*** <<< FUNC-DECLS [EpytRef] >>> ***/
140
141 extern asn_TYPE_descriptor_t asn_DEF_EpytRef;
142 asn_struct_free_f EpytRef_free;
143 asn_struct_print_f EpytRef_print;
144 asn_constr_check_f EpytRef_constraint;
145 ber_type_decoder_f EpytRef_decode_ber;
146 der_type_encoder_f EpytRef_encode_der;
147 xer_type_decoder_f EpytRef_decode_xer;
148 xer_type_encoder_f EpytRef_encode_xer;
149
150 /*** <<< CODE [EpytRef] >>> ***/
151
152 int
153 EpytRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
154 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
155 /* Replace with underlying type checker */
156 td->check_constraints = asn_DEF_Epyt.check_constraints;
157 return td->check_constraints(td, sptr, ctfailcb, app_key);
158 }
159
160 /*
161 * This type is implemented using Epyt,
162 * so here we adjust the DEF accordingly.
163 */
164 static void
165 EpytRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
166 td->free_struct = asn_DEF_Epyt.free_struct;
167 td->print_struct = asn_DEF_Epyt.print_struct;
168 td->check_constraints = asn_DEF_Epyt.check_constraints;
169 td->ber_decoder = asn_DEF_Epyt.ber_decoder;
170 td->der_encoder = asn_DEF_Epyt.der_encoder;
171 td->xer_decoder = asn_DEF_Epyt.xer_decoder;
172 td->xer_encoder = asn_DEF_Epyt.xer_encoder;
173 td->uper_decoder = asn_DEF_Epyt.uper_decoder;
174 td->uper_encoder = asn_DEF_Epyt.uper_encoder;
175 if(!td->per_constraints)
176 td->per_constraints = asn_DEF_Epyt.per_constraints;
177 td->elements = asn_DEF_Epyt.elements;
178 td->elements_count = asn_DEF_Epyt.elements_count;
179 td->specifics = asn_DEF_Epyt.specifics;
180 }
181
182 void
183 EpytRef_free(asn_TYPE_descriptor_t *td,
184 void *struct_ptr, int contents_only) {
185 EpytRef_1_inherit_TYPE_descriptor(td);
186 td->free_struct(td, struct_ptr, contents_only);
187 }
188
189 int
190 EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
191 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
192 EpytRef_1_inherit_TYPE_descriptor(td);
193 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
194 }
195
196 asn_dec_rval_t
197 EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
198 void **structure, const void *bufptr, size_t size, int tag_mode) {
199 EpytRef_1_inherit_TYPE_descriptor(td);
200 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
201 }
202
203 asn_enc_rval_t
204 EpytRef_encode_der(asn_TYPE_descriptor_t *td,
205 void *structure, int tag_mode, ber_tlv_tag_t tag,
206 asn_app_consume_bytes_f *cb, void *app_key) {
207 EpytRef_1_inherit_TYPE_descriptor(td);
208 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
209 }
210
211 asn_dec_rval_t
212 EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
213 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
214 EpytRef_1_inherit_TYPE_descriptor(td);
215 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
216 }
217
218 asn_enc_rval_t
219 EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
220 int ilevel, enum xer_encoder_flags_e flags,
221 asn_app_consume_bytes_f *cb, void *app_key) {
222 EpytRef_1_inherit_TYPE_descriptor(td);
223 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
224 }
225
226
227 /*** <<< STAT-DEFS [EpytRef] >>> ***/
228
229 static const ber_tlv_tag_t asn_DEF_EpytRef_tags_1[] = {
230 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
231 };
232 asn_TYPE_descriptor_t asn_DEF_EpytRef = {
233 "EpytRef",
234 "EpytRef",
235 EpytRef_free,
236 EpytRef_print,
237 EpytRef_constraint,
238 EpytRef_decode_ber,
239 EpytRef_encode_der,
240 EpytRef_decode_xer,
241 EpytRef_encode_xer,
242 0, 0, /* No PER support, use "-gen-PER" to enable */
243 0, /* Use generic outmost tag fetcher */
244 asn_DEF_EpytRef_tags_1,
245 sizeof(asn_DEF_EpytRef_tags_1)
246 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
247 asn_DEF_EpytRef_tags_1, /* Same as above */
248 sizeof(asn_DEF_EpytRef_tags_1)
249 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
250 0, /* No PER visible constraints */
251 0, 0, /* Defined elsewhere */
252 0 /* No specifics */
253 };
254
255
256 /*** <<< INCLUDES [Epyt] >>> ***/
257
258 #include <asn_SET_OF.h>
259 #include <constr_SET_OF.h>
260 #include <constr_SEQUENCE.h>
261
262 /*** <<< FWD-DECLS [Epyt] >>> ***/
263
264 struct Type;
265 struct Ypet;
266
267 /*** <<< TYPE-DECLS [Epyt] >>> ***/
268
269 typedef struct Epyt {
270 struct stype {
271 A_SET_OF(struct Type) list;
272
273 /* Context for parsing across buffer boundaries */
274 asn_struct_ctx_t _asn_ctx;
275 } stype;
276 struct Type *type /* OPTIONAL */;
277 struct Ypet *ypet /* OPTIONAL */;
278
279 /* Context for parsing across buffer boundaries */
280 asn_struct_ctx_t _asn_ctx;
281 } Epyt_t;
282
283 /*** <<< FUNC-DECLS [Epyt] >>> ***/
284
285 extern asn_TYPE_descriptor_t asn_DEF_Epyt;
286
287 /*** <<< POST-INCLUDE [Epyt] >>> ***/
288
289 #include "Type.h"
290 #include "Ypet.h"
291
292 /*** <<< STAT-DEFS [Epyt] >>> ***/
293
294 static asn_TYPE_member_t asn_MBR_stype_2[] = {
295 { ATF_POINTER, 0, 0,
296 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
297 .tag_mode = 0,
298 .type = &asn_DEF_Type,
299 .memb_constraints = 0, /* Defer constraints checking to the member type */
300 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
301 .default_value = 0,
302 .name = ""
303 },
304 };
305 static const ber_tlv_tag_t asn_DEF_stype_tags_2[] = {
306 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
307 };
308 static asn_SET_OF_specifics_t asn_SPC_stype_specs_2 = {
309 sizeof(struct stype),
310 offsetof(struct stype, _asn_ctx),
311 0, /* XER encoding is XMLDelimitedItemList */
312 };
313 static /* Use -fall-defs-global to expose */
314 asn_TYPE_descriptor_t asn_DEF_stype_2 = {
315 "stype",
316 "stype",
317 SET_OF_free,
318 SET_OF_print,
319 SET_OF_constraint,
320 SET_OF_decode_ber,
321 SET_OF_encode_der,
322 SET_OF_decode_xer,
323 SET_OF_encode_xer,
324 0, 0, /* No PER support, use "-gen-PER" to enable */
325 0, /* Use generic outmost tag fetcher */
326 asn_DEF_stype_tags_2,
327 sizeof(asn_DEF_stype_tags_2)
328 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
329 asn_DEF_stype_tags_2, /* Same as above */
330 sizeof(asn_DEF_stype_tags_2)
331 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
332 0, /* No PER visible constraints */
333 asn_MBR_stype_2,
334 1, /* Single element */
335 &asn_SPC_stype_specs_2 /* Additional specs */
336 };
337
338 static asn_TYPE_member_t asn_MBR_Epyt_1[] = {
339 { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype),
340 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
341 .tag_mode = 0,
342 .type = &asn_DEF_stype_2,
343 .memb_constraints = 0, /* Defer constraints checking to the member type */
344 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
345 .default_value = 0,
346 .name = "stype"
347 },
348 { ATF_POINTER, 2, offsetof(struct Epyt, type),
349 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
350 .tag_mode = 0,
351 .type = &asn_DEF_Type,
352 .memb_constraints = 0, /* Defer constraints checking to the member type */
353 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
354 .default_value = 0,
355 .name = "type"
356 },
357 { ATF_POINTER, 1, offsetof(struct Epyt, ypet),
358 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
359 .tag_mode = 0,
360 .type = &asn_DEF_Ypet,
361 .memb_constraints = 0, /* Defer constraints checking to the member type */
362 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
363 .default_value = 0,
364 .name = "ypet"
365 },
366 };
367 static const ber_tlv_tag_t asn_DEF_Epyt_tags_1[] = {
368 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
369 };
370 static const asn_TYPE_tag2member_t asn_MAP_Epyt_tag2el_1[] = {
371 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type */
372 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype */
373 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet */
374 };
375 static asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1 = {
376 sizeof(struct Epyt),
377 offsetof(struct Epyt, _asn_ctx),
378 asn_MAP_Epyt_tag2el_1,
379 3, /* Count of tags in the map */
380 0, 0, 0, /* Optional elements (not needed) */
381 -1, /* Start extensions */
382 -1 /* Stop extensions */
383 };
384 asn_TYPE_descriptor_t asn_DEF_Epyt = {
385 "Epyt",
386 "Epyt",
387 SEQUENCE_free,
388 SEQUENCE_print,
389 SEQUENCE_constraint,
390 SEQUENCE_decode_ber,
391 SEQUENCE_encode_der,
392 SEQUENCE_decode_xer,
393 SEQUENCE_encode_xer,
394 0, 0, /* No PER support, use "-gen-PER" to enable */
395 0, /* Use generic outmost tag fetcher */
396 asn_DEF_Epyt_tags_1,
397 sizeof(asn_DEF_Epyt_tags_1)
398 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
399 asn_DEF_Epyt_tags_1, /* Same as above */
400 sizeof(asn_DEF_Epyt_tags_1)
401 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
402 0, /* No PER visible constraints */
403 asn_MBR_Epyt_1,
404 3, /* Elements count */
405 &asn_SPC_Epyt_specs_1 /* Additional specs */
406 };
407
408
409 /*** <<< INCLUDES [Ypet] >>> ***/
410
411 #include <INTEGER.h>
412 #include <IA5String.h>
413 #include "EnumType.h"
414 #include <asn_SET_OF.h>
415 #include <constr_SET_OF.h>
416 #include <constr_SET.h>
417
418 /*** <<< DEPS [Ypet] >>> ***/
419
420
421 /*
422 * Method of determining the components presence
423 */
424 typedef enum Ypet_PR {
425 Ypet_PR_epyt, /* Member epyt is present */
426 Ypet_PR_plain, /* Member plain is present */
427 Ypet_PR_senums, /* Member senums is present */
428 Ypet_PR_patest1, /* Member patest1 is present */
429 Ypet_PR_patest2, /* Member patest2 is present */
430 } Ypet_PR;
431
432 /*** <<< FWD-DECLS [Ypet] >>> ***/
433
434 struct Epyt;
435
436 /*** <<< TYPE-DECLS [Ypet] >>> ***/
437
438 typedef struct Ypet {
439 struct Epyt *epyt;
440 INTEGER_t *plain /* DEFAULT 7 */;
441 struct senums {
442 A_SET_OF(EnumType_t) list;
443
444 /* Context for parsing across buffer boundaries */
445 asn_struct_ctx_t _asn_ctx;
446 } senums;
447 IA5String_t patest1;
448 IA5String_t patest2;
449
450 /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
451 unsigned int _presence_map
452 [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
453
454 /* Context for parsing across buffer boundaries */
455 asn_struct_ctx_t _asn_ctx;
456 } Ypet_t;
457
458 /*** <<< FUNC-DECLS [Ypet] >>> ***/
459
460 extern asn_TYPE_descriptor_t asn_DEF_Ypet;
461
462 /*** <<< POST-INCLUDE [Ypet] >>> ***/
463
464 #include "Epyt.h"
465
466 /*** <<< CTABLES [Ypet] >>> ***/
467
468 static int check_permitted_alphabet_6(const void *sptr) {
469 /* The underlying type is IA5String */
470 const IA5String_t *st = (const IA5String_t *)sptr;
471 const uint8_t *ch = st->buf;
472 const uint8_t *end = ch + st->size;
473
474 for(; ch < end; ch++) {
475 uint8_t cv = *ch;
476 if(!(cv >= 65 && cv <= 90)) return -1;
477 }
478 return 0;
479 }
480
481 static int check_permitted_alphabet_7(const void *sptr) {
482 /* The underlying type is IA5String */
483 const IA5String_t *st = (const IA5String_t *)sptr;
484 const uint8_t *ch = st->buf;
485 const uint8_t *end = ch + st->size;
486
487 for(; ch < end; ch++) {
488 uint8_t cv = *ch;
489 if(!(cv >= 97 && cv <= 122)) return -1;
490 }
491 return 0;
492 }
493
494
495 /*** <<< CODE [Ypet] >>> ***/
496
497 static int
498 memb_patest1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
499 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
500 const IA5String_t *st = (const IA5String_t *)sptr;
501
502 if(!sptr) {
503 ASN__CTFAIL(app_key, td, sptr,
504 "%s: value not given (%s:%d)",
505 td->name, __FILE__, __LINE__);
506 return -1;
507 }
508
509
510 if(!check_permitted_alphabet_6(st)) {
511 /* Constraint check succeeded */
512 return 0;
513 } else {
514 ASN__CTFAIL(app_key, td, sptr,
515 "%s: constraint failed (%s:%d)",
516 td->name, __FILE__, __LINE__);
517 return -1;
518 }
519 }
520
521 static int
522 memb_patest2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
523 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
524 const IA5String_t *st = (const IA5String_t *)sptr;
525
526 if(!sptr) {
527 ASN__CTFAIL(app_key, td, sptr,
528 "%s: value not given (%s:%d)",
529 td->name, __FILE__, __LINE__);
530 return -1;
531 }
532
533
534 if(!check_permitted_alphabet_7(st)) {
535 /* Constraint check succeeded */
536 return 0;
537 } else {
538 ASN__CTFAIL(app_key, td, sptr,
539 "%s: constraint failed (%s:%d)",
540 td->name, __FILE__, __LINE__);
541 return -1;
542 }
543 }
544
545
546 /*** <<< STAT-DEFS [Ypet] >>> ***/
547
548 static int asn_DFL_3_set_7(int set_value, void **sptr) {
549 INTEGER_t *st = *sptr;
550
551 if(!st) {
552 if(!set_value) return -1; /* Not a default value */
553 st = (*sptr = CALLOC(1, sizeof(*st)));
554 if(!st) return -1;
555 }
556
557 if(set_value) {
558 /* Install default value 7 */
559 return asn_long2INTEGER(st, 7);
560 } else {
561 /* Test default value 7 */
562 long value;
563 if(asn_INTEGER2long(st, &value))
564 return -1;
565 return (value == 7);
566 }
567 }
568 static asn_TYPE_member_t asn_MBR_senums_4[] = {
569 { ATF_POINTER, 0, 0,
570 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
571 .tag_mode = 0,
572 .type = &asn_DEF_EnumType,
573 .memb_constraints = 0, /* Defer constraints checking to the member type */
574 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
575 .default_value = 0,
576 .name = ""
577 },
578 };
579 static const ber_tlv_tag_t asn_DEF_senums_tags_4[] = {
580 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
581 };
582 static asn_SET_OF_specifics_t asn_SPC_senums_specs_4 = {
583 sizeof(struct senums),
584 offsetof(struct senums, _asn_ctx),
585 1, /* XER encoding is XMLValueList */
586 };
587 static /* Use -fall-defs-global to expose */
588 asn_TYPE_descriptor_t asn_DEF_senums_4 = {
589 "senums",
590 "senums",
591 SET_OF_free,
592 SET_OF_print,
593 SET_OF_constraint,
594 SET_OF_decode_ber,
595 SET_OF_encode_der,
596 SET_OF_decode_xer,
597 SET_OF_encode_xer,
598 0, 0, /* No PER support, use "-gen-PER" to enable */
599 0, /* Use generic outmost tag fetcher */
600 asn_DEF_senums_tags_4,
601 sizeof(asn_DEF_senums_tags_4)
602 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
603 asn_DEF_senums_tags_4, /* Same as above */
604 sizeof(asn_DEF_senums_tags_4)
605 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
606 0, /* No PER visible constraints */
607 asn_MBR_senums_4,
608 1, /* Single element */
609 &asn_SPC_senums_specs_4 /* Additional specs */
610 };
611
612 static asn_TYPE_member_t asn_MBR_Ypet_1[] = {
613 { ATF_POINTER, 0, offsetof(struct Ypet, epyt),
614 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
615 .tag_mode = 0,
616 .type = &asn_DEF_Epyt,
617 .memb_constraints = 0, /* Defer constraints checking to the member type */
618 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
619 .default_value = 0,
620 .name = "epyt"
621 },
622 { ATF_POINTER, 1, offsetof(struct Ypet, plain),
623 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
624 .tag_mode = 0,
625 .type = &asn_DEF_INTEGER,
626 .memb_constraints = 0, /* Defer constraints checking to the member type */
627 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
628 .default_value = asn_DFL_3_set_7, /* DEFAULT 7 */
629 .name = "plain"
630 },
631 { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
632 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
633 .tag_mode = 0,
634 .type = &asn_DEF_senums_4,
635 .memb_constraints = 0, /* Defer constraints checking to the member type */
636 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
637 .default_value = 0,
638 .name = "senums"
639 },
640 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),
641 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
642 .tag_mode = +1, /* EXPLICIT tag at current level */
643 .type = &asn_DEF_IA5String,
644 .memb_constraints = memb_patest1_constraint_1,
645 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
646 .default_value = 0,
647 .name = "patest1"
648 },
649 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),
650 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
651 .tag_mode = +1, /* EXPLICIT tag at current level */
652 .type = &asn_DEF_IA5String,
653 .memb_constraints = memb_patest2_constraint_1,
654 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
655 .default_value = 0,
656 .name = "patest2"
657 },
658 };
659 static const ber_tlv_tag_t asn_DEF_Ypet_tags_1[] = {
660 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
661 };
662 static const asn_TYPE_tag2member_t asn_MAP_Ypet_tag2el_1[] = {
663 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain */
664 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt */
665 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums */
666 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 */
667 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 */
668 };
669 static const uint8_t asn_MAP_Ypet_mmap_1[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {
670 (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)
671 };
672 static asn_SET_specifics_t asn_SPC_Ypet_specs_1 = {
673 sizeof(struct Ypet),
674 offsetof(struct Ypet, _asn_ctx),
675 offsetof(struct Ypet, _presence_map),
676 asn_MAP_Ypet_tag2el_1,
677 5, /* Count of tags in the map */
678 asn_MAP_Ypet_tag2el_1, /* Same as above */
679 5, /* Count of tags in the CXER map */
680 0, /* Whether extensible */
681 (unsigned int *)asn_MAP_Ypet_mmap_1 /* Mandatory elements map */
682 };
683 asn_TYPE_descriptor_t asn_DEF_Ypet = {
684 "Ypet",
685 "Ypet",
686 SET_free,
687 SET_print,
688 SET_constraint,
689 SET_decode_ber,
690 SET_encode_der,
691 SET_decode_xer,
692 SET_encode_xer,
693 0, 0, /* No PER support, use "-gen-PER" to enable */
694 0, /* Use generic outmost tag fetcher */
695 asn_DEF_Ypet_tags_1,
696 sizeof(asn_DEF_Ypet_tags_1)
697 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
698 asn_DEF_Ypet_tags_1, /* Same as above */
699 sizeof(asn_DEF_Ypet_tags_1)
700 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
701 0, /* No PER visible constraints */
702 asn_MBR_Ypet_1,
703 5, /* Elements count */
704 &asn_SPC_Ypet_specs_1 /* Additional specs */
705 };
706
707
708 /*** <<< INCLUDES [EnumType] >>> ***/
709
710 #include <ENUMERATED.h>
711
712 /*** <<< DEPS [EnumType] >>> ***/
713
714 typedef enum EnumType {
715 EnumType_one = 0,
716 EnumType_two = 1
717 } e_EnumType;
718
719 /*** <<< TYPE-DECLS [EnumType] >>> ***/
720
721 typedef ENUMERATED_t EnumType_t;
722
723 /*** <<< FUNC-DECLS [EnumType] >>> ***/
724
725 extern asn_TYPE_descriptor_t asn_DEF_EnumType;
726 asn_struct_free_f EnumType_free;
727 asn_struct_print_f EnumType_print;
728 asn_constr_check_f EnumType_constraint;
729 ber_type_decoder_f EnumType_decode_ber;
730 der_type_encoder_f EnumType_encode_der;
731 xer_type_decoder_f EnumType_decode_xer;
732 xer_type_encoder_f EnumType_encode_xer;
733
734 /*** <<< CODE [EnumType] >>> ***/
735
736 int
737 EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
738 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
739 /* Replace with underlying type checker */
740 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
741 return td->check_constraints(td, sptr, ctfailcb, app_key);
742 }
743
744 /*
745 * This type is implemented using ENUMERATED,
746 * so here we adjust the DEF accordingly.
747 */
748 static void
749 EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
750 td->free_struct = asn_DEF_ENUMERATED.free_struct;
751 td->print_struct = asn_DEF_ENUMERATED.print_struct;
752 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
753 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
754 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
755 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
756 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
757 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
758 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
759 if(!td->per_constraints)
760 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
761 td->elements = asn_DEF_ENUMERATED.elements;
762 td->elements_count = asn_DEF_ENUMERATED.elements_count;
763 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
764 }
765
766 void
767 EnumType_free(asn_TYPE_descriptor_t *td,
768 void *struct_ptr, int contents_only) {
769 EnumType_1_inherit_TYPE_descriptor(td);
770 td->free_struct(td, struct_ptr, contents_only);
771 }
772
773 int
774 EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
775 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
776 EnumType_1_inherit_TYPE_descriptor(td);
777 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
778 }
779
780 asn_dec_rval_t
781 EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
782 void **structure, const void *bufptr, size_t size, int tag_mode) {
783 EnumType_1_inherit_TYPE_descriptor(td);
784 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
785 }
786
787 asn_enc_rval_t
788 EnumType_encode_der(asn_TYPE_descriptor_t *td,
789 void *structure, int tag_mode, ber_tlv_tag_t tag,
790 asn_app_consume_bytes_f *cb, void *app_key) {
791 EnumType_1_inherit_TYPE_descriptor(td);
792 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
793 }
794
795 asn_dec_rval_t
796 EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
797 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
798 EnumType_1_inherit_TYPE_descriptor(td);
799 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
800 }
801
802 asn_enc_rval_t
803 EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
804 int ilevel, enum xer_encoder_flags_e flags,
805 asn_app_consume_bytes_f *cb, void *app_key) {
806 EnumType_1_inherit_TYPE_descriptor(td);
807 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
808 }
809
810
811 /*** <<< STAT-DEFS [EnumType] >>> ***/
812
813 static const asn_INTEGER_enum_map_t asn_MAP_EnumType_value2enum_1[] = {
814 { 0, 3, "one" },
815 { 1, 3, "two" }
816 };
817 static const unsigned int asn_MAP_EnumType_enum2value_1[] = {
818 0, /* one(0) */
819 1 /* two(1) */
820 };
821 static const asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1 = {
822 asn_MAP_EnumType_value2enum_1, /* "tag" => N; sorted by tag */
823 asn_MAP_EnumType_enum2value_1, /* N => "tag"; sorted by N */
824 2, /* Number of elements in the maps */
825 0, /* Enumeration is not extensible */
826 1, /* Strict enumeration */
827 0, /* Native long size */
828 0
829 };
830 static const ber_tlv_tag_t asn_DEF_EnumType_tags_1[] = {
831 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
832 };
833 asn_TYPE_descriptor_t asn_DEF_EnumType = {
834 "EnumType",
835 "EnumType",
836 EnumType_free,
837 EnumType_print,
838 EnumType_constraint,
839 EnumType_decode_ber,
840 EnumType_encode_der,
841 EnumType_decode_xer,
842 EnumType_encode_xer,
843 0, 0, /* No PER support, use "-gen-PER" to enable */
844 0, /* Use generic outmost tag fetcher */
845 asn_DEF_EnumType_tags_1,
846 sizeof(asn_DEF_EnumType_tags_1)
847 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
848 asn_DEF_EnumType_tags_1, /* Same as above */
849 sizeof(asn_DEF_EnumType_tags_1)
850 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
851 0, /* No PER visible constraints */
852 0, 0, /* Defined elsewhere */
853 &asn_SPC_EnumType_specs_1 /* Additional specs */
854 };
855