c29bdff1ca8e9cf404beee1735ffb20f66a41552
[com/asn1c.git] / tests / tests-asn1c-compiler / 73-circular-OK.asn1.-Pfwide-types
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 EpytRef;
11
12 /*** <<< TYPE-DECLS [Type] >>> ***/
13
14 typedef struct Type {
15         struct data {
16                 A_SEQUENCE_OF(struct EpytRef) 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 extern asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1;
30 extern asn_TYPE_member_t asn_MBR_Type_1[1];
31
32 /*** <<< POST-INCLUDE [Type] >>> ***/
33
34 #include "EpytRef.h"
35
36 /*** <<< STAT-DEFS [Type] >>> ***/
37
38 static asn_TYPE_member_t asn_MBR_data_2[] = {
39         { ATF_POINTER, 0, 0,
40                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
41                 .tag_mode = 0,
42                 .type = &asn_DEF_EpytRef,
43                 .type_selector = 0,
44                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
45                 0, 0, /* No default value */
46                 .name = ""
47                 },
48 };
49 static const ber_tlv_tag_t asn_DEF_data_tags_2[] = {
50         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
51 };
52 static asn_SET_OF_specifics_t asn_SPC_data_specs_2 = {
53         sizeof(struct data),
54         offsetof(struct data, _asn_ctx),
55         0,      /* XER encoding is XMLDelimitedItemList */
56 };
57 static /* Use -fall-defs-global to expose */
58 asn_TYPE_descriptor_t asn_DEF_data_2 = {
59         "data",
60         "data",
61         &asn_OP_SEQUENCE_OF,
62         asn_DEF_data_tags_2,
63         sizeof(asn_DEF_data_tags_2)
64                 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
65         asn_DEF_data_tags_2,    /* Same as above */
66         sizeof(asn_DEF_data_tags_2)
67                 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
68         { 0, 0, SEQUENCE_OF_constraint },
69         asn_MBR_data_2,
70         1,      /* Single element */
71         &asn_SPC_data_specs_2   /* Additional specs */
72 };
73
74 asn_TYPE_member_t asn_MBR_Type_1[] = {
75         { ATF_NOFLAGS, 0, offsetof(struct Type, data),
76                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
77                 .tag_mode = 0,
78                 .type = &asn_DEF_data_2,
79                 .type_selector = 0,
80                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
81                 0, 0, /* No default value */
82                 .name = "data"
83                 },
84 };
85 static const ber_tlv_tag_t asn_DEF_Type_tags_1[] = {
86         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
87 };
88 static const asn_TYPE_tag2member_t asn_MAP_Type_tag2el_1[] = {
89     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data */
90 };
91 asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1 = {
92         sizeof(struct Type),
93         offsetof(struct Type, _asn_ctx),
94         .tag2el = asn_MAP_Type_tag2el_1,
95         .tag2el_count = 1,      /* Count of tags in the map */
96         0, 0, 0,        /* Optional elements (not needed) */
97         -1,     /* First extension addition */
98 };
99 asn_TYPE_descriptor_t asn_DEF_Type = {
100         "Type",
101         "Type",
102         &asn_OP_SEQUENCE,
103         asn_DEF_Type_tags_1,
104         sizeof(asn_DEF_Type_tags_1)
105                 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
106         asn_DEF_Type_tags_1,    /* Same as above */
107         sizeof(asn_DEF_Type_tags_1)
108                 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
109         { 0, 0, SEQUENCE_constraint },
110         asn_MBR_Type_1,
111         1,      /* Elements count */
112         &asn_SPC_Type_specs_1   /* Additional specs */
113 };
114
115
116 /*** <<< INCLUDES [EpytRef] >>> ***/
117
118 #include "Epyt.h"
119
120 /*** <<< TYPE-DECLS [EpytRef] >>> ***/
121
122 typedef Epyt_t   EpytRef_t;
123
124 /*** <<< FUNC-DECLS [EpytRef] >>> ***/
125
126 extern asn_TYPE_descriptor_t asn_DEF_EpytRef;
127 asn_struct_free_f EpytRef_free;
128 asn_struct_print_f EpytRef_print;
129 asn_constr_check_f EpytRef_constraint;
130 ber_type_decoder_f EpytRef_decode_ber;
131 der_type_encoder_f EpytRef_encode_der;
132 xer_type_decoder_f EpytRef_decode_xer;
133 xer_type_encoder_f EpytRef_encode_xer;
134
135 /*** <<< CODE [EpytRef] >>> ***/
136
137 /*
138  * This type is implemented using Epyt,
139  * so here we adjust the DEF accordingly.
140  */
141
142 /*** <<< STAT-DEFS [EpytRef] >>> ***/
143
144 static const ber_tlv_tag_t asn_DEF_EpytRef_tags_1[] = {
145         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
146 };
147 asn_TYPE_descriptor_t asn_DEF_EpytRef = {
148         "EpytRef",
149         "EpytRef",
150         &asn_OP_SEQUENCE,
151         asn_DEF_EpytRef_tags_1,
152         sizeof(asn_DEF_EpytRef_tags_1)
153                 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
154         asn_DEF_EpytRef_tags_1, /* Same as above */
155         sizeof(asn_DEF_EpytRef_tags_1)
156                 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
157         { 0, 0, SEQUENCE_constraint },
158         asn_MBR_Epyt_1,
159         3,      /* Elements count */
160         &asn_SPC_Epyt_specs_1   /* Additional specs */
161 };
162
163
164 /*** <<< INCLUDES [Epyt] >>> ***/
165
166 #include <asn_SET_OF.h>
167 #include <constr_SET_OF.h>
168 #include <constr_SEQUENCE.h>
169
170 /*** <<< FWD-DECLS [Epyt] >>> ***/
171
172 struct Type;
173 struct Ypet;
174
175 /*** <<< TYPE-DECLS [Epyt] >>> ***/
176
177 typedef struct Epyt {
178         struct stype {
179                 A_SET_OF(struct Type) list;
180                 
181                 /* Context for parsing across buffer boundaries */
182                 asn_struct_ctx_t _asn_ctx;
183         } stype;
184         struct Type     *type;  /* OPTIONAL */
185         struct Ypet     *ypet;  /* OPTIONAL */
186         
187         /* Context for parsing across buffer boundaries */
188         asn_struct_ctx_t _asn_ctx;
189 } Epyt_t;
190
191 /*** <<< FUNC-DECLS [Epyt] >>> ***/
192
193 extern asn_TYPE_descriptor_t asn_DEF_Epyt;
194 extern asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1;
195 extern asn_TYPE_member_t asn_MBR_Epyt_1[3];
196
197 /*** <<< POST-INCLUDE [Epyt] >>> ***/
198
199 #include "Type.h"
200 #include "Ypet.h"
201
202 /*** <<< STAT-DEFS [Epyt] >>> ***/
203
204 static asn_TYPE_member_t asn_MBR_stype_2[] = {
205         { ATF_POINTER, 0, 0,
206                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
207                 .tag_mode = 0,
208                 .type = &asn_DEF_Type,
209                 .type_selector = 0,
210                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
211                 0, 0, /* No default value */
212                 .name = ""
213                 },
214 };
215 static const ber_tlv_tag_t asn_DEF_stype_tags_2[] = {
216         (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
217 };
218 static asn_SET_OF_specifics_t asn_SPC_stype_specs_2 = {
219         sizeof(struct stype),
220         offsetof(struct stype, _asn_ctx),
221         0,      /* XER encoding is XMLDelimitedItemList */
222 };
223 static /* Use -fall-defs-global to expose */
224 asn_TYPE_descriptor_t asn_DEF_stype_2 = {
225         "stype",
226         "stype",
227         &asn_OP_SET_OF,
228         asn_DEF_stype_tags_2,
229         sizeof(asn_DEF_stype_tags_2)
230                 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
231         asn_DEF_stype_tags_2,   /* Same as above */
232         sizeof(asn_DEF_stype_tags_2)
233                 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
234         { 0, 0, SET_OF_constraint },
235         asn_MBR_stype_2,
236         1,      /* Single element */
237         &asn_SPC_stype_specs_2  /* Additional specs */
238 };
239
240 asn_TYPE_member_t asn_MBR_Epyt_1[] = {
241         { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype),
242                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
243                 .tag_mode = 0,
244                 .type = &asn_DEF_stype_2,
245                 .type_selector = 0,
246                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
247                 0, 0, /* No default value */
248                 .name = "stype"
249                 },
250         { ATF_POINTER, 2, offsetof(struct Epyt, type),
251                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
252                 .tag_mode = 0,
253                 .type = &asn_DEF_Type,
254                 .type_selector = 0,
255                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
256                 0, 0, /* No default value */
257                 .name = "type"
258                 },
259         { ATF_POINTER, 1, offsetof(struct Epyt, ypet),
260                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
261                 .tag_mode = 0,
262                 .type = &asn_DEF_Ypet,
263                 .type_selector = 0,
264                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
265                 0, 0, /* No default value */
266                 .name = "ypet"
267                 },
268 };
269 static const ber_tlv_tag_t asn_DEF_Epyt_tags_1[] = {
270         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
271 };
272 static const asn_TYPE_tag2member_t asn_MAP_Epyt_tag2el_1[] = {
273     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type */
274     { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype */
275     { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet */
276 };
277 asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1 = {
278         sizeof(struct Epyt),
279         offsetof(struct Epyt, _asn_ctx),
280         .tag2el = asn_MAP_Epyt_tag2el_1,
281         .tag2el_count = 3,      /* Count of tags in the map */
282         0, 0, 0,        /* Optional elements (not needed) */
283         -1,     /* First extension addition */
284 };
285 asn_TYPE_descriptor_t asn_DEF_Epyt = {
286         "Epyt",
287         "Epyt",
288         &asn_OP_SEQUENCE,
289         asn_DEF_Epyt_tags_1,
290         sizeof(asn_DEF_Epyt_tags_1)
291                 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
292         asn_DEF_Epyt_tags_1,    /* Same as above */
293         sizeof(asn_DEF_Epyt_tags_1)
294                 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
295         { 0, 0, SEQUENCE_constraint },
296         asn_MBR_Epyt_1,
297         3,      /* Elements count */
298         &asn_SPC_Epyt_specs_1   /* Additional specs */
299 };
300
301
302 /*** <<< INCLUDES [Ypet] >>> ***/
303
304 #include <INTEGER.h>
305 #include <IA5String.h>
306 #include "EnumType.h"
307 #include <asn_SET_OF.h>
308 #include <constr_SET_OF.h>
309 #include <constr_SET.h>
310
311 /*** <<< DEPS [Ypet] >>> ***/
312
313
314 /*
315  * Method of determining the components presence
316  */
317 typedef enum Ypet_PR {
318         Ypet_PR_epyt,   /* Member epyt is present */
319         Ypet_PR_plain,  /* Member plain is present */
320         Ypet_PR_senums, /* Member senums is present */
321         Ypet_PR_patest1,        /* Member patest1 is present */
322         Ypet_PR_patest2,        /* Member patest2 is present */
323 } Ypet_PR;
324
325 /*** <<< FWD-DECLS [Ypet] >>> ***/
326
327 struct Epyt;
328
329 /*** <<< TYPE-DECLS [Ypet] >>> ***/
330
331 typedef struct Ypet {
332         struct Epyt     *epyt;
333         INTEGER_t       *plain; /* DEFAULT 7 */
334         struct senums {
335                 A_SET_OF(EnumType_t) list;
336                 
337                 /* Context for parsing across buffer boundaries */
338                 asn_struct_ctx_t _asn_ctx;
339         } senums;
340         IA5String_t      patest1;
341         IA5String_t      patest2;
342         
343         /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
344         unsigned int _presence_map
345                 [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
346         
347         /* Context for parsing across buffer boundaries */
348         asn_struct_ctx_t _asn_ctx;
349 } Ypet_t;
350
351 /*** <<< FUNC-DECLS [Ypet] >>> ***/
352
353 extern asn_TYPE_descriptor_t asn_DEF_Ypet;
354 extern asn_SET_specifics_t asn_SPC_Ypet_specs_1;
355 extern asn_TYPE_member_t asn_MBR_Ypet_1[5];
356
357 /*** <<< POST-INCLUDE [Ypet] >>> ***/
358
359 #include "Epyt.h"
360
361 /*** <<< CTABLES [Ypet] >>> ***/
362
363 static int check_permitted_alphabet_6(const void *sptr) {
364         /* The underlying type is IA5String */
365         const IA5String_t *st = (const IA5String_t *)sptr;
366         const uint8_t *ch = st->buf;
367         const uint8_t *end = ch + st->size;
368         
369         for(; ch < end; ch++) {
370                 uint8_t cv = *ch;
371                 if(!(cv >= 65 && cv <= 90)) return -1;
372         }
373         return 0;
374 }
375
376 static int check_permitted_alphabet_7(const void *sptr) {
377         /* The underlying type is IA5String */
378         const IA5String_t *st = (const IA5String_t *)sptr;
379         const uint8_t *ch = st->buf;
380         const uint8_t *end = ch + st->size;
381         
382         for(; ch < end; ch++) {
383                 uint8_t cv = *ch;
384                 if(!(cv >= 97 && cv <= 122)) return -1;
385         }
386         return 0;
387 }
388
389
390 /*** <<< CODE [Ypet] >>> ***/
391
392 static int
393 memb_patest1_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
394                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
395         const IA5String_t *st = (const IA5String_t *)sptr;
396         
397         if(!sptr) {
398                 ASN__CTFAIL(app_key, td, sptr,
399                         "%s: value not given (%s:%d)",
400                         td->name, __FILE__, __LINE__);
401                 return -1;
402         }
403         
404         
405         if(!check_permitted_alphabet_6(st)) {
406                 /* Constraint check succeeded */
407                 return 0;
408         } else {
409                 ASN__CTFAIL(app_key, td, sptr,
410                         "%s: constraint failed (%s:%d)",
411                         td->name, __FILE__, __LINE__);
412                 return -1;
413         }
414 }
415
416 static int
417 memb_patest2_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
418                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
419         const IA5String_t *st = (const IA5String_t *)sptr;
420         
421         if(!sptr) {
422                 ASN__CTFAIL(app_key, td, sptr,
423                         "%s: value not given (%s:%d)",
424                         td->name, __FILE__, __LINE__);
425                 return -1;
426         }
427         
428         
429         if(!check_permitted_alphabet_7(st)) {
430                 /* Constraint check succeeded */
431                 return 0;
432         } else {
433                 ASN__CTFAIL(app_key, td, sptr,
434                         "%s: constraint failed (%s:%d)",
435                         td->name, __FILE__, __LINE__);
436                 return -1;
437         }
438 }
439
440
441 /*** <<< STAT-DEFS [Ypet] >>> ***/
442
443 static int asn_DFL_3_cmp_7(const void *sptr) {
444         const INTEGER_t *st = sptr;
445         
446         if(!st) {
447                 return -1; /* No value is not a default value */
448         }
449         
450         /* Test default value 7 */
451         long value;
452         if(asn_INTEGER2long(st, &value))
453                 return -1;
454         return (value != 7);
455 }
456 static int asn_DFL_3_set_7(void **sptr) {
457         INTEGER_t *st = *sptr;
458         
459         if(!st) {
460                 st = (*sptr = CALLOC(1, sizeof(*st)));
461                 if(!st) return -1;
462         }
463         
464         /* Install default value 7 */
465         return asn_long2INTEGER(st, 7);
466 }
467 static asn_TYPE_member_t asn_MBR_senums_4[] = {
468         { ATF_POINTER, 0, 0,
469                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
470                 .tag_mode = 0,
471                 .type = &asn_DEF_EnumType,
472                 .type_selector = 0,
473                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
474                 0, 0, /* No default value */
475                 .name = ""
476                 },
477 };
478 static const ber_tlv_tag_t asn_DEF_senums_tags_4[] = {
479         (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
480 };
481 static asn_SET_OF_specifics_t asn_SPC_senums_specs_4 = {
482         sizeof(struct senums),
483         offsetof(struct senums, _asn_ctx),
484         1,      /* XER encoding is XMLValueList */
485 };
486 static /* Use -fall-defs-global to expose */
487 asn_TYPE_descriptor_t asn_DEF_senums_4 = {
488         "senums",
489         "senums",
490         &asn_OP_SET_OF,
491         asn_DEF_senums_tags_4,
492         sizeof(asn_DEF_senums_tags_4)
493                 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
494         asn_DEF_senums_tags_4,  /* Same as above */
495         sizeof(asn_DEF_senums_tags_4)
496                 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
497         { 0, 0, SET_OF_constraint },
498         asn_MBR_senums_4,
499         1,      /* Single element */
500         &asn_SPC_senums_specs_4 /* Additional specs */
501 };
502
503 asn_TYPE_member_t asn_MBR_Ypet_1[] = {
504         { ATF_POINTER, 0, offsetof(struct Ypet, epyt),
505                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
506                 .tag_mode = 0,
507                 .type = &asn_DEF_Epyt,
508                 .type_selector = 0,
509                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
510                 0, 0, /* No default value */
511                 .name = "epyt"
512                 },
513         { ATF_POINTER, 1, offsetof(struct Ypet, plain),
514                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
515                 .tag_mode = 0,
516                 .type = &asn_DEF_INTEGER,
517                 .type_selector = 0,
518                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
519                 .default_value_cmp = &asn_DFL_3_cmp_7,  /* Compare DEFAULT 7 */
520                 .default_value_set = &asn_DFL_3_set_7,  /* Set DEFAULT 7 */
521                 .name = "plain"
522                 },
523         { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
524                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
525                 .tag_mode = 0,
526                 .type = &asn_DEF_senums_4,
527                 .type_selector = 0,
528                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
529                 0, 0, /* No default value */
530                 .name = "senums"
531                 },
532         { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),
533                 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
534                 .tag_mode = +1, /* EXPLICIT tag at current level */
535                 .type = &asn_DEF_IA5String,
536                 .type_selector = 0,
537                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints =  memb_patest1_constraint_1 },
538                 0, 0, /* No default value */
539                 .name = "patest1"
540                 },
541         { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),
542                 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
543                 .tag_mode = +1, /* EXPLICIT tag at current level */
544                 .type = &asn_DEF_IA5String,
545                 .type_selector = 0,
546                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints =  memb_patest2_constraint_1 },
547                 0, 0, /* No default value */
548                 .name = "patest2"
549                 },
550 };
551 static const ber_tlv_tag_t asn_DEF_Ypet_tags_1[] = {
552         (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
553 };
554 static const asn_TYPE_tag2member_t asn_MAP_Ypet_tag2el_1[] = {
555     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain */
556     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt */
557     { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums */
558     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 */
559     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 */
560 };
561 static const uint8_t asn_MAP_Ypet_mmap_1[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {
562         (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)
563 };
564 asn_SET_specifics_t asn_SPC_Ypet_specs_1 = {
565         sizeof(struct Ypet),
566         offsetof(struct Ypet, _asn_ctx),
567         offsetof(struct Ypet, _presence_map),
568         .tag2el = asn_MAP_Ypet_tag2el_1,
569         .tag2el_count = 5,      /* Count of tags in the map */
570         asn_MAP_Ypet_tag2el_1,  /* Same as above */
571         5,      /* Count of tags in the CXER map */
572         0,      /* Whether extensible */
573         (const unsigned int *)asn_MAP_Ypet_mmap_1       /* Mandatory elements map */
574 };
575 asn_TYPE_descriptor_t asn_DEF_Ypet = {
576         "Ypet",
577         "Ypet",
578         &asn_OP_SET,
579         asn_DEF_Ypet_tags_1,
580         sizeof(asn_DEF_Ypet_tags_1)
581                 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
582         asn_DEF_Ypet_tags_1,    /* Same as above */
583         sizeof(asn_DEF_Ypet_tags_1)
584                 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
585         { 0, 0, SET_constraint },
586         asn_MBR_Ypet_1,
587         5,      /* Elements count */
588         &asn_SPC_Ypet_specs_1   /* Additional specs */
589 };
590
591
592 /*** <<< INCLUDES [EnumType] >>> ***/
593
594 #include <ENUMERATED.h>
595
596 /*** <<< DEPS [EnumType] >>> ***/
597
598 typedef enum EnumType {
599         EnumType_one    = 0,
600         EnumType_two    = 1
601 } e_EnumType;
602
603 /*** <<< TYPE-DECLS [EnumType] >>> ***/
604
605 typedef ENUMERATED_t     EnumType_t;
606
607 /*** <<< FUNC-DECLS [EnumType] >>> ***/
608
609 extern asn_TYPE_descriptor_t asn_DEF_EnumType;
610 extern const asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1;
611 asn_struct_free_f EnumType_free;
612 asn_struct_print_f EnumType_print;
613 asn_constr_check_f EnumType_constraint;
614 ber_type_decoder_f EnumType_decode_ber;
615 der_type_encoder_f EnumType_encode_der;
616 xer_type_decoder_f EnumType_decode_xer;
617 xer_type_encoder_f EnumType_encode_xer;
618
619 /*** <<< CODE [EnumType] >>> ***/
620
621 /*
622  * This type is implemented using ENUMERATED,
623  * so here we adjust the DEF accordingly.
624  */
625
626 /*** <<< STAT-DEFS [EnumType] >>> ***/
627
628 static const asn_INTEGER_enum_map_t asn_MAP_EnumType_value2enum_1[] = {
629         { 0,    3,      "one" },
630         { 1,    3,      "two" }
631 };
632 static const unsigned int asn_MAP_EnumType_enum2value_1[] = {
633         0,      /* one(0) */
634         1       /* two(1) */
635 };
636 const asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1 = {
637         asn_MAP_EnumType_value2enum_1,  /* "tag" => N; sorted by tag */
638         asn_MAP_EnumType_enum2value_1,  /* N => "tag"; sorted by N */
639         2,      /* Number of elements in the maps */
640         0,      /* Enumeration is not extensible */
641         1,      /* Strict enumeration */
642         0,      /* Native long size */
643         0
644 };
645 static const ber_tlv_tag_t asn_DEF_EnumType_tags_1[] = {
646         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
647 };
648 asn_TYPE_descriptor_t asn_DEF_EnumType = {
649         "EnumType",
650         "EnumType",
651         &asn_OP_ENUMERATED,
652         asn_DEF_EnumType_tags_1,
653         sizeof(asn_DEF_EnumType_tags_1)
654                 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
655         asn_DEF_EnumType_tags_1,        /* Same as above */
656         sizeof(asn_DEF_EnumType_tags_1)
657                 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
658         { 0, 0, ENUMERATED_constraint },
659         0, 0,   /* Defined elsewhere */
660         &asn_SPC_EnumType_specs_1       /* Additional specs */
661 };
662