Debian Codegraph @

tests/44-choice-in-sequence-OK.asn1.-P

raw
1
2 /*** <<< INCLUDES [T] >>> ***/
3
4 #include <NULL.h>
5 #include <constr_CHOICE.h>
6 #include <constr_SEQUENCE.h>
7
8 /*** <<< DEPS [T] >>> ***/
9
10 typedef enum b_PR {
11 b_PR_NOTHING, /* No components present */
12 b_PR_c,
13 b_PR_d,
14 b_PR_e,
15 b_PR_h
16 } b_PR;
17 typedef enum e_PR {
18 e_PR_NOTHING, /* No components present */
19 e_PR_f,
20 e_PR_g
21 } e_PR;
22 typedef enum h_PR {
23 h_PR_NOTHING, /* No components present */
24 h_PR_i,
25 h_PR_j
26 } h_PR;
27
28 /*** <<< TYPE-DECLS [T] >>> ***/
29
30 typedef struct T {
31 NULL_t a;
32 struct b {
33 b_PR present;
34 union T__b_u {
35 NULL_t c;
36 NULL_t d;
37 struct e {
38 e_PR present;
39 union T__b__e_u {
40 NULL_t f;
41 NULL_t g;
42 } choice;
43
44 /* Context for parsing across buffer boundaries */
45 asn_struct_ctx_t _asn_ctx;
46 } e;
47 struct h {
48 h_PR present;
49 union T__b__h_u {
50 NULL_t i;
51 NULL_t j;
52 } choice;
53
54 /* Context for parsing across buffer boundaries */
55 asn_struct_ctx_t _asn_ctx;
56 } h;
57 } choice;
58
59 /* Context for parsing across buffer boundaries */
60 asn_struct_ctx_t _asn_ctx;
61 } b;
62
63 /* Context for parsing across buffer boundaries */
64 asn_struct_ctx_t _asn_ctx;
65 } T_t;
66
67 /*** <<< FUNC-DECLS [T] >>> ***/
68
69 extern asn_TYPE_descriptor_t asn_DEF_T;
70
71 /*** <<< STAT-DEFS [T] >>> ***/
72
73 static asn_TYPE_member_t asn_MBR_e_6[] = {
74 { ATF_NOFLAGS, 0, offsetof(struct e, choice.f),
75 .tag = (ASN_TAG_CLASS_PRIVATE | (7 << 2)),
76 .tag_mode = -1, /* IMPLICIT tag at current level */
77 .type = &asn_DEF_NULL,
78 .memb_constraints = 0, /* Defer constraints checking to the member type */
79 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
80 .default_value = 0,
81 .name = "f"
82 },
83 { ATF_NOFLAGS, 0, offsetof(struct e, choice.g),
84 .tag = (ASN_TAG_CLASS_PRIVATE | (8 << 2)),
85 .tag_mode = -1, /* IMPLICIT tag at current level */
86 .type = &asn_DEF_NULL,
87 .memb_constraints = 0, /* Defer constraints checking to the member type */
88 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
89 .default_value = 0,
90 .name = "g"
91 },
92 };
93 static const asn_TYPE_tag2member_t asn_MAP_e_tag2el_6[] = {
94 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 0, 0, 0 }, /* f */
95 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 } /* g */
96 };
97 static asn_CHOICE_specifics_t asn_SPC_e_specs_6 = {
98 sizeof(struct e),
99 offsetof(struct e, _asn_ctx),
100 offsetof(struct e, present),
101 sizeof(((struct e *)0)->present),
102 asn_MAP_e_tag2el_6,
103 2, /* Count of tags in the map */
104 .canonical_order = 0,
105 .ext_start = -1 /* Extensions start */
106 };
107 static /* Use -fall-defs-global to expose */
108 asn_TYPE_descriptor_t asn_DEF_e_6 = {
109 "e",
110 "e",
111 CHOICE_free,
112 CHOICE_print,
113 CHOICE_constraint,
114 CHOICE_decode_ber,
115 CHOICE_encode_der,
116 CHOICE_decode_xer,
117 CHOICE_encode_xer,
118 0, 0, /* No PER support, use "-gen-PER" to enable */
119 CHOICE_outmost_tag,
120 0, /* No effective tags (pointer) */
121 0, /* No effective tags (count) */
122 0, /* No tags (pointer) */
123 0, /* No tags (count) */
124 0, /* No PER visible constraints */
125 asn_MBR_e_6,
126 2, /* Elements count */
127 &asn_SPC_e_specs_6 /* Additional specs */
128 };
129
130 static asn_TYPE_member_t asn_MBR_h_9[] = {
131 { ATF_NOFLAGS, 0, offsetof(struct h, choice.i),
132 .tag = (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
133 .tag_mode = -1, /* IMPLICIT tag at current level */
134 .type = &asn_DEF_NULL,
135 .memb_constraints = 0, /* Defer constraints checking to the member type */
136 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
137 .default_value = 0,
138 .name = "i"
139 },
140 { ATF_NOFLAGS, 0, offsetof(struct h, choice.j),
141 .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
142 .tag_mode = -1, /* IMPLICIT tag at current level */
143 .type = &asn_DEF_NULL,
144 .memb_constraints = 0, /* Defer constraints checking to the member type */
145 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
146 .default_value = 0,
147 .name = "j"
148 },
149 };
150 static const asn_TYPE_tag2member_t asn_MAP_h_tag2el_9[] = {
151 { (ASN_TAG_CLASS_PRIVATE | (1 << 2)), 0, 0, 0 }, /* i */
152 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 1, 0, 0 } /* j */
153 };
154 static asn_CHOICE_specifics_t asn_SPC_h_specs_9 = {
155 sizeof(struct h),
156 offsetof(struct h, _asn_ctx),
157 offsetof(struct h, present),
158 sizeof(((struct h *)0)->present),
159 asn_MAP_h_tag2el_9,
160 2, /* Count of tags in the map */
161 .canonical_order = 0,
162 .ext_start = -1 /* Extensions start */
163 };
164 static /* Use -fall-defs-global to expose */
165 asn_TYPE_descriptor_t asn_DEF_h_9 = {
166 "h",
167 "h",
168 CHOICE_free,
169 CHOICE_print,
170 CHOICE_constraint,
171 CHOICE_decode_ber,
172 CHOICE_encode_der,
173 CHOICE_decode_xer,
174 CHOICE_encode_xer,
175 0, 0, /* No PER support, use "-gen-PER" to enable */
176 CHOICE_outmost_tag,
177 0, /* No effective tags (pointer) */
178 0, /* No effective tags (count) */
179 0, /* No tags (pointer) */
180 0, /* No tags (count) */
181 0, /* No PER visible constraints */
182 asn_MBR_h_9,
183 2, /* Elements count */
184 &asn_SPC_h_specs_9 /* Additional specs */
185 };
186
187 static asn_TYPE_member_t asn_MBR_b_3[] = {
188 { ATF_NOFLAGS, 0, offsetof(struct b, choice.c),
189 .tag = (ASN_TAG_CLASS_PRIVATE | (5 << 2)),
190 .tag_mode = -1, /* IMPLICIT tag at current level */
191 .type = &asn_DEF_NULL,
192 .memb_constraints = 0, /* Defer constraints checking to the member type */
193 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
194 .default_value = 0,
195 .name = "c"
196 },
197 { ATF_NOFLAGS, 0, offsetof(struct b, choice.d),
198 .tag = (ASN_TAG_CLASS_PRIVATE | (6 << 2)),
199 .tag_mode = -1, /* IMPLICIT tag at current level */
200 .type = &asn_DEF_NULL,
201 .memb_constraints = 0, /* Defer constraints checking to the member type */
202 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
203 .default_value = 0,
204 .name = "d"
205 },
206 { ATF_NOFLAGS, 0, offsetof(struct b, choice.e),
207 .tag = -1 /* Ambiguous tag (CHOICE?) */,
208 .tag_mode = 0,
209 .type = &asn_DEF_e_6,
210 .memb_constraints = 0, /* Defer constraints checking to the member type */
211 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
212 .default_value = 0,
213 .name = "e"
214 },
215 { ATF_NOFLAGS, 0, offsetof(struct b, choice.h),
216 .tag = (ASN_TAG_CLASS_PRIVATE | (9 << 2)),
217 .tag_mode = +1, /* EXPLICIT tag at current level */
218 .type = &asn_DEF_h_9,
219 .memb_constraints = 0, /* Defer constraints checking to the member type */
220 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
221 .default_value = 0,
222 .name = "h"
223 },
224 };
225 static const asn_TYPE_tag2member_t asn_MAP_b_tag2el_3[] = {
226 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 0, 0, 0 }, /* c */
227 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d */
228 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 2, 0, 0 }, /* f */
229 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 2, 0, 0 }, /* g */
230 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 3, 0, 0 } /* h */
231 };
232 static asn_CHOICE_specifics_t asn_SPC_b_specs_3 = {
233 sizeof(struct b),
234 offsetof(struct b, _asn_ctx),
235 offsetof(struct b, present),
236 sizeof(((struct b *)0)->present),
237 asn_MAP_b_tag2el_3,
238 5, /* Count of tags in the map */
239 .canonical_order = 0,
240 .ext_start = -1 /* Extensions start */
241 };
242 static /* Use -fall-defs-global to expose */
243 asn_TYPE_descriptor_t asn_DEF_b_3 = {
244 "b",
245 "b",
246 CHOICE_free,
247 CHOICE_print,
248 CHOICE_constraint,
249 CHOICE_decode_ber,
250 CHOICE_encode_der,
251 CHOICE_decode_xer,
252 CHOICE_encode_xer,
253 0, 0, /* No PER support, use "-gen-PER" to enable */
254 CHOICE_outmost_tag,
255 0, /* No effective tags (pointer) */
256 0, /* No effective tags (count) */
257 0, /* No tags (pointer) */
258 0, /* No tags (count) */
259 0, /* No PER visible constraints */
260 asn_MBR_b_3,
261 4, /* Elements count */
262 &asn_SPC_b_specs_3 /* Additional specs */
263 };
264
265 static asn_TYPE_member_t asn_MBR_T_1[] = {
266 { ATF_NOFLAGS, 0, offsetof(struct T, a),
267 .tag = (ASN_TAG_CLASS_PRIVATE | (2 << 2)),
268 .tag_mode = -1, /* IMPLICIT tag at current level */
269 .type = &asn_DEF_NULL,
270 .memb_constraints = 0, /* Defer constraints checking to the member type */
271 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
272 .default_value = 0,
273 .name = "a"
274 },
275 { ATF_NOFLAGS, 0, offsetof(struct T, b),
276 .tag = -1 /* Ambiguous tag (CHOICE?) */,
277 .tag_mode = 0,
278 .type = &asn_DEF_b_3,
279 .memb_constraints = 0, /* Defer constraints checking to the member type */
280 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
281 .default_value = 0,
282 .name = "b"
283 },
284 };
285 static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
286 (ASN_TAG_CLASS_PRIVATE | (1 << 2)),
287 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
288 };
289 static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
290 { (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a */
291 { (ASN_TAG_CLASS_PRIVATE | (5 << 2)), 1, 0, 0 }, /* c */
292 { (ASN_TAG_CLASS_PRIVATE | (6 << 2)), 1, 0, 0 }, /* d */
293 { (ASN_TAG_CLASS_PRIVATE | (7 << 2)), 1, 0, 0 }, /* f */
294 { (ASN_TAG_CLASS_PRIVATE | (8 << 2)), 1, 0, 0 }, /* g */
295 { (ASN_TAG_CLASS_PRIVATE | (9 << 2)), 1, 0, 0 } /* h */
296 };
297 static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
298 sizeof(struct T),
299 offsetof(struct T, _asn_ctx),
300 asn_MAP_T_tag2el_1,
301 6, /* Count of tags in the map */
302 0, 0, 0, /* Optional elements (not needed) */
303 -1, /* Start extensions */
304 -1 /* Stop extensions */
305 };
306 asn_TYPE_descriptor_t asn_DEF_T = {
307 "T",
308 "T",
309 SEQUENCE_free,
310 SEQUENCE_print,
311 SEQUENCE_constraint,
312 SEQUENCE_decode_ber,
313 SEQUENCE_encode_der,
314 SEQUENCE_decode_xer,
315 SEQUENCE_encode_xer,
316 0, 0, /* No PER support, use "-gen-PER" to enable */
317 0, /* Use generic outmost tag fetcher */
318 asn_DEF_T_tags_1,
319 sizeof(asn_DEF_T_tags_1)
320 /sizeof(asn_DEF_T_tags_1[0]) - 1, /* 1 */
321 asn_DEF_T_tags_1, /* Same as above */
322 sizeof(asn_DEF_T_tags_1)
323 /sizeof(asn_DEF_T_tags_1[0]), /* 2 */
324 0, /* No PER visible constraints */
325 asn_MBR_T_1,
326 2, /* Elements count */
327 &asn_SPC_T_specs_1 /* Additional specs */
328 };
329