7f53a5195edd3b9976f30d63568b8887e5b54e99
[com/asn1c.git] / tests / tests-asn1c-compiler / 72-same-names-OK.asn1.-Pfwide-types
1
2 /*** <<< INCLUDES [Type] >>> ***/
3
4 #include <asn_SET_OF.h>
5 #include "Type1.h"
6 #include "Type2.h"
7 #include <constr_SEQUENCE.h>
8 #include <constr_SET_OF.h>
9
10 /*** <<< FWD-DEFS [Type] >>> ***/
11
12 typedef struct Member {
13         Type1_t  t1;
14         Type2_t  t2;
15         
16         /* Context for parsing across buffer boundaries */
17         asn_struct_ctx_t _asn_ctx;
18 } Member;
19
20 /*** <<< TYPE-DECLS [Type] >>> ***/
21
22 typedef struct Type {
23         A_SET_OF(Member) list;
24         
25         /* Context for parsing across buffer boundaries */
26         asn_struct_ctx_t _asn_ctx;
27 } Type_t;
28
29 /*** <<< FUNC-DECLS [Type] >>> ***/
30
31 extern asn_TYPE_descriptor_t asn_DEF_Type;
32
33 /*** <<< STAT-DEFS [Type] >>> ***/
34
35 static asn_TYPE_member_t asn_MBR_Member_2[] = {
36         { ATF_NOFLAGS, 0, offsetof(struct Member, t1),
37                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
38                 .tag_mode = 0,
39                 .type = &asn_DEF_Type1,
40                 .type_selector = 0,
41                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
42                 0, 0, /* No default value */
43                 .name = "t1"
44                 },
45         { ATF_NOFLAGS, 0, offsetof(struct Member, t2),
46                 .tag = -1 /* Ambiguous tag (CHOICE?) */,
47                 .tag_mode = 0,
48                 .type = &asn_DEF_Type2,
49                 .type_selector = 0,
50                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
51                 0, 0, /* No default value */
52                 .name = "t2"
53                 },
54 };
55 static const ber_tlv_tag_t asn_DEF_Member_tags_2[] = {
56         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
57 };
58 static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_2[] = {
59     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* t1 */
60     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 }, /* one-name */
61     { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* two-name */
62 };
63 static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_2 = {
64         sizeof(struct Member),
65         offsetof(struct Member, _asn_ctx),
66         .tag2el = asn_MAP_Member_tag2el_2,
67         .tag2el_count = 3,      /* Count of tags in the map */
68         0, 0, 0,        /* Optional elements (not needed) */
69         -1,     /* First extension addition */
70 };
71 static /* Use -fall-defs-global to expose */
72 asn_TYPE_descriptor_t asn_DEF_Member_2 = {
73         "SEQUENCE",
74         "SEQUENCE",
75         &asn_OP_SEQUENCE,
76         asn_DEF_Member_tags_2,
77         sizeof(asn_DEF_Member_tags_2)
78                 /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
79         asn_DEF_Member_tags_2,  /* Same as above */
80         sizeof(asn_DEF_Member_tags_2)
81                 /sizeof(asn_DEF_Member_tags_2[0]), /* 1 */
82         { 0, 0, SEQUENCE_constraint },
83         asn_MBR_Member_2,
84         2,      /* Elements count */
85         &asn_SPC_Member_specs_2 /* Additional specs */
86 };
87
88 static asn_TYPE_member_t asn_MBR_Type_1[] = {
89         { ATF_POINTER, 0, 0,
90                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
91                 .tag_mode = 0,
92                 .type = &asn_DEF_Member_2,
93                 .type_selector = 0,
94                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
95                 0, 0, /* No default value */
96                 .name = ""
97                 },
98 };
99 static const ber_tlv_tag_t asn_DEF_Type_tags_1[] = {
100         (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
101 };
102 static asn_SET_OF_specifics_t asn_SPC_Type_specs_1 = {
103         sizeof(struct Type),
104         offsetof(struct Type, _asn_ctx),
105         0,      /* XER encoding is XMLDelimitedItemList */
106 };
107 asn_TYPE_descriptor_t asn_DEF_Type = {
108         "Type",
109         "Type",
110         &asn_OP_SET_OF,
111         asn_DEF_Type_tags_1,
112         sizeof(asn_DEF_Type_tags_1)
113                 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
114         asn_DEF_Type_tags_1,    /* Same as above */
115         sizeof(asn_DEF_Type_tags_1)
116                 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
117         { 0, 0, SET_OF_constraint },
118         asn_MBR_Type_1,
119         1,      /* Single element */
120         &asn_SPC_Type_specs_1   /* Additional specs */
121 };
122
123
124 /*** <<< INCLUDES [Type1] >>> ***/
125
126 #include <INTEGER.h>
127 #include <constr_SEQUENCE.h>
128 #include <constr_CHOICE.h>
129
130 /*** <<< DEPS [Type1] >>> ***/
131
132 typedef enum one_name_PR {
133         one_name_PR_NOTHING,    /* No components present */
134         one_name_PR_another_name
135 } one_name_PR;
136
137 /*** <<< TYPE-DECLS [Type1] >>> ***/
138
139 typedef struct Type1 {
140         struct one_name {
141                 one_name_PR present;
142                 union Type1__one_name_u {
143                         struct another_name {
144                                 INTEGER_t        a;
145                                 INTEGER_t        b;
146                                 
147                                 /* Context for parsing across buffer boundaries */
148                                 asn_struct_ctx_t _asn_ctx;
149                         } another_name;
150                 } choice;
151                 
152                 /* Context for parsing across buffer boundaries */
153                 asn_struct_ctx_t _asn_ctx;
154         } one_name;
155         
156         /* Context for parsing across buffer boundaries */
157         asn_struct_ctx_t _asn_ctx;
158 } Type1_t;
159
160 /*** <<< FUNC-DECLS [Type1] >>> ***/
161
162 extern asn_TYPE_descriptor_t asn_DEF_Type1;
163 extern asn_SEQUENCE_specifics_t asn_SPC_Type1_specs_1;
164 extern asn_TYPE_member_t asn_MBR_Type1_1[1];
165
166 /*** <<< STAT-DEFS [Type1] >>> ***/
167
168 static asn_TYPE_member_t asn_MBR_another_name_3[] = {
169         { ATF_NOFLAGS, 0, offsetof(struct another_name, a),
170                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
171                 .tag_mode = 0,
172                 .type = &asn_DEF_INTEGER,
173                 .type_selector = 0,
174                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
175                 0, 0, /* No default value */
176                 .name = "a"
177                 },
178         { ATF_NOFLAGS, 0, offsetof(struct another_name, b),
179                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
180                 .tag_mode = 0,
181                 .type = &asn_DEF_INTEGER,
182                 .type_selector = 0,
183                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
184                 0, 0, /* No default value */
185                 .name = "b"
186                 },
187 };
188 static const ber_tlv_tag_t asn_DEF_another_name_tags_3[] = {
189         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
190 };
191 static const asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_3[] = {
192     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* a */
193     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* b */
194 };
195 static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_3 = {
196         sizeof(struct another_name),
197         offsetof(struct another_name, _asn_ctx),
198         .tag2el = asn_MAP_another_name_tag2el_3,
199         .tag2el_count = 2,      /* Count of tags in the map */
200         0, 0, 0,        /* Optional elements (not needed) */
201         -1,     /* First extension addition */
202 };
203 static /* Use -fall-defs-global to expose */
204 asn_TYPE_descriptor_t asn_DEF_another_name_3 = {
205         "another-name",
206         "another-name",
207         &asn_OP_SEQUENCE,
208         asn_DEF_another_name_tags_3,
209         sizeof(asn_DEF_another_name_tags_3)
210                 /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */
211         asn_DEF_another_name_tags_3,    /* Same as above */
212         sizeof(asn_DEF_another_name_tags_3)
213                 /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */
214         { 0, 0, SEQUENCE_constraint },
215         asn_MBR_another_name_3,
216         2,      /* Elements count */
217         &asn_SPC_another_name_specs_3   /* Additional specs */
218 };
219
220 static asn_TYPE_member_t asn_MBR_one_name_2[] = {
221         { ATF_NOFLAGS, 0, offsetof(struct one_name, choice.another_name),
222                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
223                 .tag_mode = 0,
224                 .type = &asn_DEF_another_name_3,
225                 .type_selector = 0,
226                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
227                 0, 0, /* No default value */
228                 .name = "another-name"
229                 },
230 };
231 static const asn_TYPE_tag2member_t asn_MAP_one_name_tag2el_2[] = {
232     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */
233 };
234 static asn_CHOICE_specifics_t asn_SPC_one_name_specs_2 = {
235         sizeof(struct one_name),
236         offsetof(struct one_name, _asn_ctx),
237         offsetof(struct one_name, present),
238         sizeof(((struct one_name *)0)->present),
239         .tag2el = asn_MAP_one_name_tag2el_2,
240         .tag2el_count = 1,      /* Count of tags in the map */
241         0, 0,
242         .first_extension = -1   /* Extensions start */
243 };
244 static /* Use -fall-defs-global to expose */
245 asn_TYPE_descriptor_t asn_DEF_one_name_2 = {
246         "one-name",
247         "one-name",
248         &asn_OP_CHOICE,
249         0,      /* No effective tags (pointer) */
250         0,      /* No effective tags (count) */
251         0,      /* No tags (pointer) */
252         0,      /* No tags (count) */
253         { 0, 0, CHOICE_constraint },
254         asn_MBR_one_name_2,
255         1,      /* Elements count */
256         &asn_SPC_one_name_specs_2       /* Additional specs */
257 };
258
259 asn_TYPE_member_t asn_MBR_Type1_1[] = {
260         { ATF_NOFLAGS, 0, offsetof(struct Type1, one_name),
261                 .tag = -1 /* Ambiguous tag (CHOICE?) */,
262                 .tag_mode = 0,
263                 .type = &asn_DEF_one_name_2,
264                 .type_selector = 0,
265                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
266                 0, 0, /* No default value */
267                 .name = "one-name"
268                 },
269 };
270 static const ber_tlv_tag_t asn_DEF_Type1_tags_1[] = {
271         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
272 };
273 static const asn_TYPE_tag2member_t asn_MAP_Type1_tag2el_1[] = {
274     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */
275 };
276 asn_SEQUENCE_specifics_t asn_SPC_Type1_specs_1 = {
277         sizeof(struct Type1),
278         offsetof(struct Type1, _asn_ctx),
279         .tag2el = asn_MAP_Type1_tag2el_1,
280         .tag2el_count = 1,      /* Count of tags in the map */
281         0, 0, 0,        /* Optional elements (not needed) */
282         -1,     /* First extension addition */
283 };
284 asn_TYPE_descriptor_t asn_DEF_Type1 = {
285         "Type1",
286         "Type1",
287         &asn_OP_SEQUENCE,
288         asn_DEF_Type1_tags_1,
289         sizeof(asn_DEF_Type1_tags_1)
290                 /sizeof(asn_DEF_Type1_tags_1[0]), /* 1 */
291         asn_DEF_Type1_tags_1,   /* Same as above */
292         sizeof(asn_DEF_Type1_tags_1)
293                 /sizeof(asn_DEF_Type1_tags_1[0]), /* 1 */
294         { 0, 0, SEQUENCE_constraint },
295         asn_MBR_Type1_1,
296         1,      /* Elements count */
297         &asn_SPC_Type1_specs_1  /* Additional specs */
298 };
299
300
301 /*** <<< INCLUDES [Type2] >>> ***/
302
303 #include <BIT_STRING.h>
304 #include <INTEGER.h>
305 #include <constr_SEQUENCE.h>
306 #include <constr_SET.h>
307 #include <constr_CHOICE.h>
308
309 /*** <<< DEPS [Type2] >>> ***/
310
311 typedef enum Type2_PR {
312         Type2_PR_NOTHING,       /* No components present */
313         Type2_PR_one_name,
314         Type2_PR_two_name
315 } Type2_PR;
316 typedef enum a {
317         a_one   = 0
318 } e_a;
319
320 /*
321  * Method of determining the components presence
322  */
323 typedef enum two_name_PR {
324         two_name_PR_another_name,       /* Member another_name is present */
325 } two_name_PR;
326 typedef enum a {
327         a_one   = 0
328 } e_a;
329
330 /*** <<< TYPE-DECLS [Type2] >>> ***/
331
332 typedef struct Type2 {
333         Type2_PR present;
334         union Type2_u {
335                 struct one_name {
336                         struct another_name {
337                                 BIT_STRING_t     a;
338                                 INTEGER_t        b;
339                                 
340                                 /* Context for parsing across buffer boundaries */
341                                 asn_struct_ctx_t _asn_ctx;
342                         } another_name;
343                         
344                         /* Context for parsing across buffer boundaries */
345                         asn_struct_ctx_t _asn_ctx;
346                 } one_name;
347                 struct two_name {
348                         struct another_name {
349                                 BIT_STRING_t     a;
350                                 INTEGER_t        b;
351                                 
352                                 /* Context for parsing across buffer boundaries */
353                                 asn_struct_ctx_t _asn_ctx;
354                         } another_name;
355                         
356                         /* Presence bitmask: ASN_SET_ISPRESENT(ptwo_name, two_name_PR_x) */
357                         unsigned int _presence_map
358                                 [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
359                         
360                         /* Context for parsing across buffer boundaries */
361                         asn_struct_ctx_t _asn_ctx;
362                 } two_name;
363         } choice;
364         
365         /* Context for parsing across buffer boundaries */
366         asn_struct_ctx_t _asn_ctx;
367 } Type2_t;
368
369 /*** <<< FUNC-DECLS [Type2] >>> ***/
370
371 extern asn_TYPE_descriptor_t asn_DEF_Type2;
372 extern asn_CHOICE_specifics_t asn_SPC_Type2_specs_1;
373 extern asn_TYPE_member_t asn_MBR_Type2_1[2];
374
375 /*** <<< CODE [Type2] >>> ***/
376
377 static int
378 memb_a_constraint_3(const asn_TYPE_descriptor_t *td, const void *sptr,
379                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
380         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
381         size_t size;
382         
383         if(!sptr) {
384                 ASN__CTFAIL(app_key, td, sptr,
385                         "%s: value not given (%s:%d)",
386                         td->name, __FILE__, __LINE__);
387                 return -1;
388         }
389         
390         if(st->size > 0) {
391                 /* Size in bits */
392                 size = 8 * st->size - (st->bits_unused & 0x07);
393         } else {
394                 size = 0;
395         }
396         
397         if((size == 2)) {
398                 /* Constraint check succeeded */
399                 return 0;
400         } else {
401                 ASN__CTFAIL(app_key, td, sptr,
402                         "%s: constraint failed (%s:%d)",
403                         td->name, __FILE__, __LINE__);
404                 return -1;
405         }
406 }
407
408 static int
409 memb_a_constraint_8(const asn_TYPE_descriptor_t *td, const void *sptr,
410                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
411         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
412         size_t size;
413         
414         if(!sptr) {
415                 ASN__CTFAIL(app_key, td, sptr,
416                         "%s: value not given (%s:%d)",
417                         td->name, __FILE__, __LINE__);
418                 return -1;
419         }
420         
421         if(st->size > 0) {
422                 /* Size in bits */
423                 size = 8 * st->size - (st->bits_unused & 0x07);
424         } else {
425                 size = 0;
426         }
427         
428         if((size == 2)) {
429                 /* Constraint check succeeded */
430                 return 0;
431         } else {
432                 ASN__CTFAIL(app_key, td, sptr,
433                         "%s: constraint failed (%s:%d)",
434                         td->name, __FILE__, __LINE__);
435                 return -1;
436         }
437 }
438
439
440 /*** <<< STAT-DEFS [Type2] >>> ***/
441
442 static asn_TYPE_member_t asn_MBR_another_name_3[] = {
443         { ATF_NOFLAGS, 0, offsetof(struct another_name, a),
444                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
445                 .tag_mode = 0,
446                 .type = &asn_DEF_BIT_STRING,
447                 .type_selector = 0,
448                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints =  memb_a_constraint_3 },
449                 0, 0, /* No default value */
450                 .name = "a"
451                 },
452         { ATF_NOFLAGS, 0, offsetof(struct another_name, b),
453                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
454                 .tag_mode = 0,
455                 .type = &asn_DEF_INTEGER,
456                 .type_selector = 0,
457                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
458                 0, 0, /* No default value */
459                 .name = "b"
460                 },
461 };
462 static const ber_tlv_tag_t asn_DEF_another_name_tags_3[] = {
463         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
464 };
465 static const asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_3[] = {
466     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* b */
467     { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* a */
468 };
469 static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_3 = {
470         sizeof(struct another_name),
471         offsetof(struct another_name, _asn_ctx),
472         .tag2el = asn_MAP_another_name_tag2el_3,
473         .tag2el_count = 2,      /* Count of tags in the map */
474         0, 0, 0,        /* Optional elements (not needed) */
475         -1,     /* First extension addition */
476 };
477 static /* Use -fall-defs-global to expose */
478 asn_TYPE_descriptor_t asn_DEF_another_name_3 = {
479         "another-name",
480         "another-name",
481         &asn_OP_SEQUENCE,
482         asn_DEF_another_name_tags_3,
483         sizeof(asn_DEF_another_name_tags_3)
484                 /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */
485         asn_DEF_another_name_tags_3,    /* Same as above */
486         sizeof(asn_DEF_another_name_tags_3)
487                 /sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */
488         { 0, 0, SEQUENCE_constraint },
489         asn_MBR_another_name_3,
490         2,      /* Elements count */
491         &asn_SPC_another_name_specs_3   /* Additional specs */
492 };
493
494 static asn_TYPE_member_t asn_MBR_one_name_2[] = {
495         { ATF_NOFLAGS, 0, offsetof(struct one_name, another_name),
496                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
497                 .tag_mode = 0,
498                 .type = &asn_DEF_another_name_3,
499                 .type_selector = 0,
500                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
501                 0, 0, /* No default value */
502                 .name = "another-name"
503                 },
504 };
505 static const ber_tlv_tag_t asn_DEF_one_name_tags_2[] = {
506         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
507 };
508 static const asn_TYPE_tag2member_t asn_MAP_one_name_tag2el_2[] = {
509     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */
510 };
511 static asn_SEQUENCE_specifics_t asn_SPC_one_name_specs_2 = {
512         sizeof(struct one_name),
513         offsetof(struct one_name, _asn_ctx),
514         .tag2el = asn_MAP_one_name_tag2el_2,
515         .tag2el_count = 1,      /* Count of tags in the map */
516         0, 0, 0,        /* Optional elements (not needed) */
517         -1,     /* First extension addition */
518 };
519 static /* Use -fall-defs-global to expose */
520 asn_TYPE_descriptor_t asn_DEF_one_name_2 = {
521         "one-name",
522         "one-name",
523         &asn_OP_SEQUENCE,
524         asn_DEF_one_name_tags_2,
525         sizeof(asn_DEF_one_name_tags_2)
526                 /sizeof(asn_DEF_one_name_tags_2[0]), /* 1 */
527         asn_DEF_one_name_tags_2,        /* Same as above */
528         sizeof(asn_DEF_one_name_tags_2)
529                 /sizeof(asn_DEF_one_name_tags_2[0]), /* 1 */
530         { 0, 0, SEQUENCE_constraint },
531         asn_MBR_one_name_2,
532         1,      /* Elements count */
533         &asn_SPC_one_name_specs_2       /* Additional specs */
534 };
535
536 static asn_TYPE_member_t asn_MBR_another_name_8[] = {
537         { ATF_NOFLAGS, 0, offsetof(struct another_name, a),
538                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
539                 .tag_mode = 0,
540                 .type = &asn_DEF_BIT_STRING,
541                 .type_selector = 0,
542                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints =  memb_a_constraint_8 },
543                 0, 0, /* No default value */
544                 .name = "a"
545                 },
546         { ATF_NOFLAGS, 0, offsetof(struct another_name, b),
547                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
548                 .tag_mode = 0,
549                 .type = &asn_DEF_INTEGER,
550                 .type_selector = 0,
551                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
552                 0, 0, /* No default value */
553                 .name = "b"
554                 },
555 };
556 static const ber_tlv_tag_t asn_DEF_another_name_tags_8[] = {
557         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
558 };
559 static const asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_8[] = {
560     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* b */
561     { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* a */
562 };
563 static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_8 = {
564         sizeof(struct another_name),
565         offsetof(struct another_name, _asn_ctx),
566         .tag2el = asn_MAP_another_name_tag2el_8,
567         .tag2el_count = 2,      /* Count of tags in the map */
568         0, 0, 0,        /* Optional elements (not needed) */
569         -1,     /* First extension addition */
570 };
571 static /* Use -fall-defs-global to expose */
572 asn_TYPE_descriptor_t asn_DEF_another_name_8 = {
573         "another-name",
574         "another-name",
575         &asn_OP_SEQUENCE,
576         asn_DEF_another_name_tags_8,
577         sizeof(asn_DEF_another_name_tags_8)
578                 /sizeof(asn_DEF_another_name_tags_8[0]), /* 1 */
579         asn_DEF_another_name_tags_8,    /* Same as above */
580         sizeof(asn_DEF_another_name_tags_8)
581                 /sizeof(asn_DEF_another_name_tags_8[0]), /* 1 */
582         { 0, 0, SEQUENCE_constraint },
583         asn_MBR_another_name_8,
584         2,      /* Elements count */
585         &asn_SPC_another_name_specs_8   /* Additional specs */
586 };
587
588 static asn_TYPE_member_t asn_MBR_two_name_7[] = {
589         { ATF_NOFLAGS, 0, offsetof(struct two_name, another_name),
590                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
591                 .tag_mode = 0,
592                 .type = &asn_DEF_another_name_8,
593                 .type_selector = 0,
594                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
595                 0, 0, /* No default value */
596                 .name = "another-name"
597                 },
598 };
599 static const ber_tlv_tag_t asn_DEF_two_name_tags_7[] = {
600         (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
601 };
602 static const asn_TYPE_tag2member_t asn_MAP_two_name_tag2el_7[] = {
603     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */
604 };
605 static const uint8_t asn_MAP_two_name_mmap_7[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
606         (1 << 7)
607 };
608 static 
609 asn_SET_specifics_t asn_SPC_two_name_specs_7 = {
610         sizeof(struct two_name),
611         offsetof(struct two_name, _asn_ctx),
612         offsetof(struct two_name, _presence_map),
613         .tag2el = asn_MAP_two_name_tag2el_7,
614         .tag2el_count = 1,      /* Count of tags in the map */
615         asn_MAP_two_name_tag2el_7,      /* Same as above */
616         1,      /* Count of tags in the CXER map */
617         0,      /* Whether extensible */
618         (const unsigned int *)asn_MAP_two_name_mmap_7   /* Mandatory elements map */
619 };
620 static /* Use -fall-defs-global to expose */
621 asn_TYPE_descriptor_t asn_DEF_two_name_7 = {
622         "two-name",
623         "two-name",
624         &asn_OP_SET,
625         asn_DEF_two_name_tags_7,
626         sizeof(asn_DEF_two_name_tags_7)
627                 /sizeof(asn_DEF_two_name_tags_7[0]), /* 1 */
628         asn_DEF_two_name_tags_7,        /* Same as above */
629         sizeof(asn_DEF_two_name_tags_7)
630                 /sizeof(asn_DEF_two_name_tags_7[0]), /* 1 */
631         { 0, 0, SET_constraint },
632         asn_MBR_two_name_7,
633         1,      /* Elements count */
634         &asn_SPC_two_name_specs_7       /* Additional specs */
635 };
636
637 asn_TYPE_member_t asn_MBR_Type2_1[] = {
638         { ATF_NOFLAGS, 0, offsetof(struct Type2, choice.one_name),
639                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
640                 .tag_mode = 0,
641                 .type = &asn_DEF_one_name_2,
642                 .type_selector = 0,
643                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
644                 0, 0, /* No default value */
645                 .name = "one-name"
646                 },
647         { ATF_NOFLAGS, 0, offsetof(struct Type2, choice.two_name),
648                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
649                 .tag_mode = 0,
650                 .type = &asn_DEF_two_name_7,
651                 .type_selector = 0,
652                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
653                 0, 0, /* No default value */
654                 .name = "two-name"
655                 },
656 };
657 static const asn_TYPE_tag2member_t asn_MAP_Type2_tag2el_1[] = {
658     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* one-name */
659     { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* two-name */
660 };
661 asn_CHOICE_specifics_t asn_SPC_Type2_specs_1 = {
662         sizeof(struct Type2),
663         offsetof(struct Type2, _asn_ctx),
664         offsetof(struct Type2, present),
665         sizeof(((struct Type2 *)0)->present),
666         .tag2el = asn_MAP_Type2_tag2el_1,
667         .tag2el_count = 2,      /* Count of tags in the map */
668         0, 0,
669         .first_extension = -1   /* Extensions start */
670 };
671 asn_TYPE_descriptor_t asn_DEF_Type2 = {
672         "Type2",
673         "Type2",
674         &asn_OP_CHOICE,
675         0,      /* No effective tags (pointer) */
676         0,      /* No effective tags (count) */
677         0,      /* No tags (pointer) */
678         0,      /* No tags (count) */
679         { 0, 0, CHOICE_constraint },
680         asn_MBR_Type2_1,
681         2,      /* Elements count */
682         &asn_SPC_Type2_specs_1  /* Additional specs */
683 };
684