blob: 6be0ee1ae07ee05c9770182fbcfee599e6f9f08b [file] [log] [blame]
Lev Walkindb33c8d2017-08-22 01:41:58 -07001
2/*** <<< INCLUDES [CommonType] >>> ***/
3
4#include "Type1.h"
5#include "Type2.h"
6#include <constr_CHOICE.h>
7
8/*** <<< DEPS [CommonType] >>> ***/
9
10typedef enum CommonType_PR {
11 CommonType_PR_NOTHING, /* No components present */
12 CommonType_PR_t1,
13 CommonType_PR_t2
14} CommonType_PR;
15
16/*** <<< TYPE-DECLS [CommonType] >>> ***/
17
18typedef struct CommonType {
19 CommonType_PR present;
20 union CommonType_u {
21 Type1_t t1;
22 Type2_t t2;
23 } choice;
24
25 /* Context for parsing across buffer boundaries */
26 asn_struct_ctx_t _asn_ctx;
27} CommonType_t;
28
29/*** <<< FUNC-DECLS [CommonType] >>> ***/
30
31extern asn_TYPE_descriptor_t asn_DEF_CommonType;
32
33/*** <<< STAT-DEFS [CommonType] >>> ***/
34
35static asn_TYPE_member_t asn_MBR_CommonType_1[] = {
36 { ATF_NOFLAGS, 0, offsetof(struct CommonType, choice.t1),
37 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
38 .tag_mode = +1, /* EXPLICIT tag at current level */
39 .type = &asn_DEF_Type1,
40 .type_selector = 0,
41 .memb_constraints = 0, /* Defer constraints checking to the member type */
42 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
43 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
44 .default_value = 0,
45 .name = "t1"
46 },
47 { ATF_NOFLAGS, 0, offsetof(struct CommonType, choice.t2),
48 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
49 .tag_mode = +1, /* EXPLICIT tag at current level */
50 .type = &asn_DEF_Type2,
51 .type_selector = 0,
52 .memb_constraints = 0, /* Defer constraints checking to the member type */
53 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
54 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
55 .default_value = 0,
56 .name = "t2"
57 },
58};
59static const asn_TYPE_tag2member_t asn_MAP_CommonType_tag2el_1[] = {
60 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* t1 */
61 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* t2 */
62};
63static asn_CHOICE_specifics_t asn_SPC_CommonType_specs_1 = {
64 sizeof(struct CommonType),
65 offsetof(struct CommonType, _asn_ctx),
66 offsetof(struct CommonType, present),
67 sizeof(((struct CommonType *)0)->present),
68 asn_MAP_CommonType_tag2el_1,
69 2, /* Count of tags in the map */
70 .canonical_order = 0,
71 .ext_start = -1 /* Extensions start */
72};
73asn_TYPE_descriptor_t asn_DEF_CommonType = {
74 "CommonType",
75 "CommonType",
76 CHOICE_free,
77 CHOICE_print,
78 CHOICE_compare,
79 CHOICE_constraint,
80 CHOICE_decode_ber,
81 CHOICE_encode_der,
82 CHOICE_decode_xer,
83 CHOICE_encode_xer,
84 0, 0, /* No OER support, use "-gen-OER" to enable */
85 0, 0, /* No PER support, use "-gen-PER" to enable */
86 CHOICE_outmost_tag,
87 0, /* No effective tags (pointer) */
88 0, /* No effective tags (count) */
89 0, /* No tags (pointer) */
90 0, /* No tags (count) */
91 0, /* No OER visible constraints */
92 0, /* No PER visible constraints */
93 asn_MBR_CommonType_1,
94 2, /* Elements count */
95 &asn_SPC_CommonType_specs_1 /* Additional specs */
96};
97
98
99/*** <<< INCLUDES [Type1] >>> ***/
100
101#include <OCTET_STRING.h>
102#include <constr_SEQUENCE.h>
103#include <constr_CHOICE.h>
104
105/*** <<< DEPS [Type1] >>> ***/
106
107typedef enum Type1_PR {
108 Type1_PR_NOTHING, /* No components present */
109 Type1_PR_anonType
110} Type1_PR;
111
112/*** <<< TYPE-DECLS [Type1] >>> ***/
113
114typedef struct Type1 {
115 Type1_PR present;
116 union Type1_u {
117 struct anonType {
118 OCTET_STRING_t x;
119 OCTET_STRING_t y;
120
121 /* Context for parsing across buffer boundaries */
122 asn_struct_ctx_t _asn_ctx;
123 } anonType;
124 } choice;
125
126 /* Context for parsing across buffer boundaries */
127 asn_struct_ctx_t _asn_ctx;
128} Type1_t;
129
130/*** <<< FUNC-DECLS [Type1] >>> ***/
131
132extern asn_TYPE_descriptor_t asn_DEF_Type1;
133extern asn_CHOICE_specifics_t asn_SPC_Type1_specs_1;
134extern asn_TYPE_member_t asn_MBR_Type1_1[1];
135
136/*** <<< CODE [Type1] >>> ***/
137
138static int
139memb_x_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
140 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
141 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
142 size_t size;
143
144 if(!sptr) {
145 ASN__CTFAIL(app_key, td, sptr,
146 "%s: value not given (%s:%d)",
147 td->name, __FILE__, __LINE__);
148 return -1;
149 }
150
151 size = st->size;
152
153 if((size == 32)) {
154 /* Constraint check succeeded */
155 return 0;
156 } else {
157 ASN__CTFAIL(app_key, td, sptr,
158 "%s: constraint failed (%s:%d)",
159 td->name, __FILE__, __LINE__);
160 return -1;
161 }
162}
163
164static int
165memb_y_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
166 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
167 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
168 size_t size;
169
170 if(!sptr) {
171 ASN__CTFAIL(app_key, td, sptr,
172 "%s: value not given (%s:%d)",
173 td->name, __FILE__, __LINE__);
174 return -1;
175 }
176
177 size = st->size;
178
179 if((size == 32)) {
180 /* Constraint check succeeded */
181 return 0;
182 } else {
183 ASN__CTFAIL(app_key, td, sptr,
184 "%s: constraint failed (%s:%d)",
185 td->name, __FILE__, __LINE__);
186 return -1;
187 }
188}
189
190
191/*** <<< STAT-DEFS [Type1] >>> ***/
192
193static asn_TYPE_member_t asn_MBR_anonType_2[] = {
194 { ATF_NOFLAGS, 0, offsetof(struct anonType, x),
195 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
196 .tag_mode = -1, /* IMPLICIT tag at current level */
197 .type = &asn_DEF_OCTET_STRING,
198 .type_selector = 0,
199 .memb_constraints = memb_x_constraint_2,
200 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
201 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
202 .default_value = 0,
203 .name = "x"
204 },
205 { ATF_NOFLAGS, 0, offsetof(struct anonType, y),
206 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
207 .tag_mode = -1, /* IMPLICIT tag at current level */
208 .type = &asn_DEF_OCTET_STRING,
209 .type_selector = 0,
210 .memb_constraints = memb_y_constraint_2,
211 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
212 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
213 .default_value = 0,
214 .name = "y"
215 },
216};
217static const ber_tlv_tag_t asn_DEF_anonType_tags_2[] = {
218 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
219 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
220};
221static const asn_TYPE_tag2member_t asn_MAP_anonType_tag2el_2[] = {
222 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* x */
223 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* y */
224};
225static asn_SEQUENCE_specifics_t asn_SPC_anonType_specs_2 = {
226 sizeof(struct anonType),
227 offsetof(struct anonType, _asn_ctx),
228 asn_MAP_anonType_tag2el_2,
229 2, /* Count of tags in the map */
230 0, 0, 0, /* Optional elements (not needed) */
231 -1, /* Start extensions */
232 -1 /* Stop extensions */
233};
234static /* Use -fall-defs-global to expose */
235asn_TYPE_descriptor_t asn_DEF_anonType_2 = {
236 "anonType",
237 "anonType",
238 SEQUENCE_free,
239 SEQUENCE_print,
240 SEQUENCE_compare,
241 SEQUENCE_constraint,
242 SEQUENCE_decode_ber,
243 SEQUENCE_encode_der,
244 SEQUENCE_decode_xer,
245 SEQUENCE_encode_xer,
246 0, 0, /* No OER support, use "-gen-OER" to enable */
247 0, 0, /* No PER support, use "-gen-PER" to enable */
248 0, /* Use generic outmost tag fetcher */
249 asn_DEF_anonType_tags_2,
250 sizeof(asn_DEF_anonType_tags_2)
251 /sizeof(asn_DEF_anonType_tags_2[0]) - 1, /* 1 */
252 asn_DEF_anonType_tags_2, /* Same as above */
253 sizeof(asn_DEF_anonType_tags_2)
254 /sizeof(asn_DEF_anonType_tags_2[0]), /* 2 */
255 0, /* No OER visible constraints */
256 0, /* No PER visible constraints */
257 asn_MBR_anonType_2,
258 2, /* Elements count */
259 &asn_SPC_anonType_specs_2 /* Additional specs */
260};
261
262asn_TYPE_member_t asn_MBR_Type1_1[] = {
263 { ATF_NOFLAGS, 0, offsetof(struct Type1, choice.anonType),
264 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
265 .tag_mode = 0,
266 .type = &asn_DEF_anonType_2,
267 .type_selector = 0,
268 .memb_constraints = 0, /* Defer constraints checking to the member type */
269 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
270 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
271 .default_value = 0,
272 .name = "anonType"
273 },
274};
275static const asn_TYPE_tag2member_t asn_MAP_Type1_tag2el_1[] = {
276 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* anonType */
277};
278asn_CHOICE_specifics_t asn_SPC_Type1_specs_1 = {
279 sizeof(struct Type1),
280 offsetof(struct Type1, _asn_ctx),
281 offsetof(struct Type1, present),
282 sizeof(((struct Type1 *)0)->present),
283 asn_MAP_Type1_tag2el_1,
284 1, /* Count of tags in the map */
285 .canonical_order = 0,
286 .ext_start = -1 /* Extensions start */
287};
288asn_TYPE_descriptor_t asn_DEF_Type1 = {
289 "Type1",
290 "Type1",
291 CHOICE_free,
292 CHOICE_print,
293 CHOICE_compare,
294 CHOICE_constraint,
295 CHOICE_decode_ber,
296 CHOICE_encode_der,
297 CHOICE_decode_xer,
298 CHOICE_encode_xer,
299 0, 0, /* No OER support, use "-gen-OER" to enable */
300 0, 0, /* No PER support, use "-gen-PER" to enable */
301 CHOICE_outmost_tag,
302 0, /* No effective tags (pointer) */
303 0, /* No effective tags (count) */
304 0, /* No tags (pointer) */
305 0, /* No tags (count) */
306 0, /* No OER visible constraints */
307 0, /* No PER visible constraints */
308 asn_MBR_Type1_1,
309 1, /* Elements count */
310 &asn_SPC_Type1_specs_1 /* Additional specs */
311};
312
313
314/*** <<< INCLUDES [Type2] >>> ***/
315
316#include <OCTET_STRING.h>
317#include <constr_SEQUENCE.h>
318#include <constr_CHOICE.h>
319
320/*** <<< DEPS [Type2] >>> ***/
321
322typedef enum Type2_PR {
323 Type2_PR_NOTHING, /* No components present */
324 Type2_PR_anonType
325} Type2_PR;
326
327/*** <<< TYPE-DECLS [Type2] >>> ***/
328
329typedef struct Type2 {
330 Type2_PR present;
331 union Type2_u {
332 struct anonType {
333 OCTET_STRING_t x;
334 OCTET_STRING_t y;
335
336 /* Context for parsing across buffer boundaries */
337 asn_struct_ctx_t _asn_ctx;
338 } anonType;
339 } choice;
340
341 /* Context for parsing across buffer boundaries */
342 asn_struct_ctx_t _asn_ctx;
343} Type2_t;
344
345/*** <<< FUNC-DECLS [Type2] >>> ***/
346
347extern asn_TYPE_descriptor_t asn_DEF_Type2;
348extern asn_CHOICE_specifics_t asn_SPC_Type2_specs_1;
349extern asn_TYPE_member_t asn_MBR_Type2_1[1];
350
351/*** <<< CODE [Type2] >>> ***/
352
353static int
354memb_x_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
355 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
356 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
357 size_t size;
358
359 if(!sptr) {
360 ASN__CTFAIL(app_key, td, sptr,
361 "%s: value not given (%s:%d)",
362 td->name, __FILE__, __LINE__);
363 return -1;
364 }
365
366 size = st->size;
367
368 if((size == 48)) {
369 /* Constraint check succeeded */
370 return 0;
371 } else {
372 ASN__CTFAIL(app_key, td, sptr,
373 "%s: constraint failed (%s:%d)",
374 td->name, __FILE__, __LINE__);
375 return -1;
376 }
377}
378
379static int
380memb_y_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
381 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
382 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
383 size_t size;
384
385 if(!sptr) {
386 ASN__CTFAIL(app_key, td, sptr,
387 "%s: value not given (%s:%d)",
388 td->name, __FILE__, __LINE__);
389 return -1;
390 }
391
392 size = st->size;
393
394 if((size == 48)) {
395 /* Constraint check succeeded */
396 return 0;
397 } else {
398 ASN__CTFAIL(app_key, td, sptr,
399 "%s: constraint failed (%s:%d)",
400 td->name, __FILE__, __LINE__);
401 return -1;
402 }
403}
404
405
406/*** <<< STAT-DEFS [Type2] >>> ***/
407
408static asn_TYPE_member_t asn_MBR_anonType_2[] = {
409 { ATF_NOFLAGS, 0, offsetof(struct anonType, x),
410 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
411 .tag_mode = -1, /* IMPLICIT tag at current level */
412 .type = &asn_DEF_OCTET_STRING,
413 .type_selector = 0,
414 .memb_constraints = memb_x_constraint_2,
415 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
416 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
417 .default_value = 0,
418 .name = "x"
419 },
420 { ATF_NOFLAGS, 0, offsetof(struct anonType, y),
421 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
422 .tag_mode = -1, /* IMPLICIT tag at current level */
423 .type = &asn_DEF_OCTET_STRING,
424 .type_selector = 0,
425 .memb_constraints = memb_y_constraint_2,
426 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
427 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
428 .default_value = 0,
429 .name = "y"
430 },
431};
432static const ber_tlv_tag_t asn_DEF_anonType_tags_2[] = {
433 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
434 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
435};
436static const asn_TYPE_tag2member_t asn_MAP_anonType_tag2el_2[] = {
437 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* x */
438 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* y */
439};
440static asn_SEQUENCE_specifics_t asn_SPC_anonType_specs_2 = {
441 sizeof(struct anonType),
442 offsetof(struct anonType, _asn_ctx),
443 asn_MAP_anonType_tag2el_2,
444 2, /* Count of tags in the map */
445 0, 0, 0, /* Optional elements (not needed) */
446 -1, /* Start extensions */
447 -1 /* Stop extensions */
448};
449static /* Use -fall-defs-global to expose */
450asn_TYPE_descriptor_t asn_DEF_anonType_2 = {
451 "anonType",
452 "anonType",
453 SEQUENCE_free,
454 SEQUENCE_print,
455 SEQUENCE_compare,
456 SEQUENCE_constraint,
457 SEQUENCE_decode_ber,
458 SEQUENCE_encode_der,
459 SEQUENCE_decode_xer,
460 SEQUENCE_encode_xer,
461 0, 0, /* No OER support, use "-gen-OER" to enable */
462 0, 0, /* No PER support, use "-gen-PER" to enable */
463 0, /* Use generic outmost tag fetcher */
464 asn_DEF_anonType_tags_2,
465 sizeof(asn_DEF_anonType_tags_2)
466 /sizeof(asn_DEF_anonType_tags_2[0]) - 1, /* 1 */
467 asn_DEF_anonType_tags_2, /* Same as above */
468 sizeof(asn_DEF_anonType_tags_2)
469 /sizeof(asn_DEF_anonType_tags_2[0]), /* 2 */
470 0, /* No OER visible constraints */
471 0, /* No PER visible constraints */
472 asn_MBR_anonType_2,
473 2, /* Elements count */
474 &asn_SPC_anonType_specs_2 /* Additional specs */
475};
476
477asn_TYPE_member_t asn_MBR_Type2_1[] = {
478 { ATF_NOFLAGS, 0, offsetof(struct Type2, choice.anonType),
479 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
480 .tag_mode = 0,
481 .type = &asn_DEF_anonType_2,
482 .type_selector = 0,
483 .memb_constraints = 0, /* Defer constraints checking to the member type */
484 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
485 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
486 .default_value = 0,
487 .name = "anonType"
488 },
489};
490static const asn_TYPE_tag2member_t asn_MAP_Type2_tag2el_1[] = {
491 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* anonType */
492};
493asn_CHOICE_specifics_t asn_SPC_Type2_specs_1 = {
494 sizeof(struct Type2),
495 offsetof(struct Type2, _asn_ctx),
496 offsetof(struct Type2, present),
497 sizeof(((struct Type2 *)0)->present),
498 asn_MAP_Type2_tag2el_1,
499 1, /* Count of tags in the map */
500 .canonical_order = 0,
501 .ext_start = -1 /* Extensions start */
502};
503asn_TYPE_descriptor_t asn_DEF_Type2 = {
504 "Type2",
505 "Type2",
506 CHOICE_free,
507 CHOICE_print,
508 CHOICE_compare,
509 CHOICE_constraint,
510 CHOICE_decode_ber,
511 CHOICE_encode_der,
512 CHOICE_decode_xer,
513 CHOICE_encode_xer,
514 0, 0, /* No OER support, use "-gen-OER" to enable */
515 0, 0, /* No PER support, use "-gen-PER" to enable */
516 CHOICE_outmost_tag,
517 0, /* No effective tags (pointer) */
518 0, /* No effective tags (count) */
519 0, /* No tags (pointer) */
520 0, /* No tags (count) */
521 0, /* No OER visible constraints */
522 0, /* No PER visible constraints */
523 asn_MBR_Type2_1,
524 1, /* Elements count */
525 &asn_SPC_Type2_specs_1 /* Additional specs */
526};
527