blob: 542535706ee5d78234e2f151e33d2600ea1fb248 [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,
Lev Walkin0bfea562017-09-29 23:16:48 -070041 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkindb33c8d2017-08-22 01:41:58 -070042 .default_value = 0,
43 .name = "t1"
44 },
45 { ATF_NOFLAGS, 0, offsetof(struct CommonType, choice.t2),
46 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
47 .tag_mode = +1, /* EXPLICIT tag at current level */
48 .type = &asn_DEF_Type2,
49 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070050 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkindb33c8d2017-08-22 01:41:58 -070051 .default_value = 0,
52 .name = "t2"
53 },
54};
55static const asn_TYPE_tag2member_t asn_MAP_CommonType_tag2el_1[] = {
56 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* t1 */
57 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* t2 */
58};
59static asn_CHOICE_specifics_t asn_SPC_CommonType_specs_1 = {
60 sizeof(struct CommonType),
61 offsetof(struct CommonType, _asn_ctx),
62 offsetof(struct CommonType, present),
63 sizeof(((struct CommonType *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -070064 .tag2el = asn_MAP_CommonType_tag2el_1,
65 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkindb33c8d2017-08-22 01:41:58 -070066 .canonical_order = 0,
67 .ext_start = -1 /* Extensions start */
68};
69asn_TYPE_descriptor_t asn_DEF_CommonType = {
70 "CommonType",
71 "CommonType",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +080072 &asn_OP_CHOICE,
Lev Walkindb33c8d2017-08-22 01:41:58 -070073 0, /* No effective tags (pointer) */
74 0, /* No effective tags (count) */
75 0, /* No tags (pointer) */
76 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -070077 { 0, 0, CHOICE_constraint },
Lev Walkindb33c8d2017-08-22 01:41:58 -070078 asn_MBR_CommonType_1,
79 2, /* Elements count */
80 &asn_SPC_CommonType_specs_1 /* Additional specs */
81};
82
83
84/*** <<< INCLUDES [Type1] >>> ***/
85
86#include <OCTET_STRING.h>
87#include <constr_SEQUENCE.h>
88#include <constr_CHOICE.h>
89
90/*** <<< DEPS [Type1] >>> ***/
91
92typedef enum Type1_PR {
93 Type1_PR_NOTHING, /* No components present */
94 Type1_PR_anonType
95} Type1_PR;
96
97/*** <<< TYPE-DECLS [Type1] >>> ***/
98
99typedef struct Type1 {
100 Type1_PR present;
101 union Type1_u {
Lev Walkin5efafc52017-09-05 03:43:00 -0700102 struct Type1__anonType {
Lev Walkindb33c8d2017-08-22 01:41:58 -0700103 OCTET_STRING_t x;
104 OCTET_STRING_t y;
105
106 /* Context for parsing across buffer boundaries */
107 asn_struct_ctx_t _asn_ctx;
108 } anonType;
109 } choice;
110
111 /* Context for parsing across buffer boundaries */
112 asn_struct_ctx_t _asn_ctx;
113} Type1_t;
114
115/*** <<< FUNC-DECLS [Type1] >>> ***/
116
117extern asn_TYPE_descriptor_t asn_DEF_Type1;
118extern asn_CHOICE_specifics_t asn_SPC_Type1_specs_1;
119extern asn_TYPE_member_t asn_MBR_Type1_1[1];
120
121/*** <<< CODE [Type1] >>> ***/
122
123static int
124memb_x_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
125 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
126 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
127 size_t size;
128
129 if(!sptr) {
130 ASN__CTFAIL(app_key, td, sptr,
131 "%s: value not given (%s:%d)",
132 td->name, __FILE__, __LINE__);
133 return -1;
134 }
135
136 size = st->size;
137
138 if((size == 32)) {
139 /* Constraint check succeeded */
140 return 0;
141 } else {
142 ASN__CTFAIL(app_key, td, sptr,
143 "%s: constraint failed (%s:%d)",
144 td->name, __FILE__, __LINE__);
145 return -1;
146 }
147}
148
149static int
150memb_y_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
151 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
152 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
153 size_t size;
154
155 if(!sptr) {
156 ASN__CTFAIL(app_key, td, sptr,
157 "%s: value not given (%s:%d)",
158 td->name, __FILE__, __LINE__);
159 return -1;
160 }
161
162 size = st->size;
163
164 if((size == 32)) {
165 /* Constraint check succeeded */
166 return 0;
167 } else {
168 ASN__CTFAIL(app_key, td, sptr,
169 "%s: constraint failed (%s:%d)",
170 td->name, __FILE__, __LINE__);
171 return -1;
172 }
173}
174
175
176/*** <<< STAT-DEFS [Type1] >>> ***/
177
178static asn_TYPE_member_t asn_MBR_anonType_2[] = {
Lev Walkin5efafc52017-09-05 03:43:00 -0700179 { ATF_NOFLAGS, 0, offsetof(struct Type1__anonType, x),
Lev Walkindb33c8d2017-08-22 01:41:58 -0700180 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
181 .tag_mode = -1, /* IMPLICIT tag at current level */
182 .type = &asn_DEF_OCTET_STRING,
183 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700184 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_x_constraint_2 },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700185 .default_value = 0,
186 .name = "x"
187 },
Lev Walkin5efafc52017-09-05 03:43:00 -0700188 { ATF_NOFLAGS, 0, offsetof(struct Type1__anonType, y),
Lev Walkindb33c8d2017-08-22 01:41:58 -0700189 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
190 .tag_mode = -1, /* IMPLICIT tag at current level */
191 .type = &asn_DEF_OCTET_STRING,
192 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700193 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_y_constraint_2 },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700194 .default_value = 0,
195 .name = "y"
196 },
197};
198static const ber_tlv_tag_t asn_DEF_anonType_tags_2[] = {
199 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
200 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
201};
202static const asn_TYPE_tag2member_t asn_MAP_anonType_tag2el_2[] = {
203 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* x */
204 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* y */
205};
206static asn_SEQUENCE_specifics_t asn_SPC_anonType_specs_2 = {
Lev Walkin5efafc52017-09-05 03:43:00 -0700207 sizeof(struct Type1__anonType),
208 offsetof(struct Type1__anonType, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700209 .tag2el = asn_MAP_anonType_tag2el_2,
210 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700211 0, 0, 0, /* Optional elements (not needed) */
212 -1, /* Start extensions */
213 -1 /* Stop extensions */
214};
215static /* Use -fall-defs-global to expose */
216asn_TYPE_descriptor_t asn_DEF_anonType_2 = {
217 "anonType",
218 "anonType",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800219 &asn_OP_SEQUENCE,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700220 asn_DEF_anonType_tags_2,
221 sizeof(asn_DEF_anonType_tags_2)
222 /sizeof(asn_DEF_anonType_tags_2[0]) - 1, /* 1 */
223 asn_DEF_anonType_tags_2, /* Same as above */
224 sizeof(asn_DEF_anonType_tags_2)
225 /sizeof(asn_DEF_anonType_tags_2[0]), /* 2 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700226 { 0, 0, SEQUENCE_constraint },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700227 asn_MBR_anonType_2,
228 2, /* Elements count */
229 &asn_SPC_anonType_specs_2 /* Additional specs */
230};
231
232asn_TYPE_member_t asn_MBR_Type1_1[] = {
233 { ATF_NOFLAGS, 0, offsetof(struct Type1, choice.anonType),
234 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
235 .tag_mode = 0,
236 .type = &asn_DEF_anonType_2,
237 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700238 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700239 .default_value = 0,
240 .name = "anonType"
241 },
242};
243static const asn_TYPE_tag2member_t asn_MAP_Type1_tag2el_1[] = {
244 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* anonType */
245};
246asn_CHOICE_specifics_t asn_SPC_Type1_specs_1 = {
247 sizeof(struct Type1),
248 offsetof(struct Type1, _asn_ctx),
249 offsetof(struct Type1, present),
250 sizeof(((struct Type1 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700251 .tag2el = asn_MAP_Type1_tag2el_1,
252 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700253 .canonical_order = 0,
254 .ext_start = -1 /* Extensions start */
255};
256asn_TYPE_descriptor_t asn_DEF_Type1 = {
257 "Type1",
258 "Type1",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800259 &asn_OP_CHOICE,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700260 0, /* No effective tags (pointer) */
261 0, /* No effective tags (count) */
262 0, /* No tags (pointer) */
263 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700264 { 0, 0, CHOICE_constraint },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700265 asn_MBR_Type1_1,
266 1, /* Elements count */
267 &asn_SPC_Type1_specs_1 /* Additional specs */
268};
269
270
271/*** <<< INCLUDES [Type2] >>> ***/
272
273#include <OCTET_STRING.h>
274#include <constr_SEQUENCE.h>
275#include <constr_CHOICE.h>
276
277/*** <<< DEPS [Type2] >>> ***/
278
279typedef enum Type2_PR {
280 Type2_PR_NOTHING, /* No components present */
281 Type2_PR_anonType
282} Type2_PR;
283
284/*** <<< TYPE-DECLS [Type2] >>> ***/
285
286typedef struct Type2 {
287 Type2_PR present;
288 union Type2_u {
Lev Walkin5efafc52017-09-05 03:43:00 -0700289 struct Type2__anonType {
Lev Walkindb33c8d2017-08-22 01:41:58 -0700290 OCTET_STRING_t x;
291 OCTET_STRING_t y;
292
293 /* Context for parsing across buffer boundaries */
294 asn_struct_ctx_t _asn_ctx;
295 } anonType;
296 } choice;
297
298 /* Context for parsing across buffer boundaries */
299 asn_struct_ctx_t _asn_ctx;
300} Type2_t;
301
302/*** <<< FUNC-DECLS [Type2] >>> ***/
303
304extern asn_TYPE_descriptor_t asn_DEF_Type2;
305extern asn_CHOICE_specifics_t asn_SPC_Type2_specs_1;
306extern asn_TYPE_member_t asn_MBR_Type2_1[1];
307
308/*** <<< CODE [Type2] >>> ***/
309
310static int
311memb_x_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
312 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
313 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
314 size_t size;
315
316 if(!sptr) {
317 ASN__CTFAIL(app_key, td, sptr,
318 "%s: value not given (%s:%d)",
319 td->name, __FILE__, __LINE__);
320 return -1;
321 }
322
323 size = st->size;
324
325 if((size == 48)) {
326 /* Constraint check succeeded */
327 return 0;
328 } else {
329 ASN__CTFAIL(app_key, td, sptr,
330 "%s: constraint failed (%s:%d)",
331 td->name, __FILE__, __LINE__);
332 return -1;
333 }
334}
335
336static int
337memb_y_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
338 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
339 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
340 size_t size;
341
342 if(!sptr) {
343 ASN__CTFAIL(app_key, td, sptr,
344 "%s: value not given (%s:%d)",
345 td->name, __FILE__, __LINE__);
346 return -1;
347 }
348
349 size = st->size;
350
351 if((size == 48)) {
352 /* Constraint check succeeded */
353 return 0;
354 } else {
355 ASN__CTFAIL(app_key, td, sptr,
356 "%s: constraint failed (%s:%d)",
357 td->name, __FILE__, __LINE__);
358 return -1;
359 }
360}
361
362
363/*** <<< STAT-DEFS [Type2] >>> ***/
364
365static asn_TYPE_member_t asn_MBR_anonType_2[] = {
Lev Walkin5efafc52017-09-05 03:43:00 -0700366 { ATF_NOFLAGS, 0, offsetof(struct Type2__anonType, x),
Lev Walkindb33c8d2017-08-22 01:41:58 -0700367 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
368 .tag_mode = -1, /* IMPLICIT tag at current level */
369 .type = &asn_DEF_OCTET_STRING,
370 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700371 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_x_constraint_2 },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700372 .default_value = 0,
373 .name = "x"
374 },
Lev Walkin5efafc52017-09-05 03:43:00 -0700375 { ATF_NOFLAGS, 0, offsetof(struct Type2__anonType, y),
Lev Walkindb33c8d2017-08-22 01:41:58 -0700376 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
377 .tag_mode = -1, /* IMPLICIT tag at current level */
378 .type = &asn_DEF_OCTET_STRING,
379 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700380 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_y_constraint_2 },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700381 .default_value = 0,
382 .name = "y"
383 },
384};
385static const ber_tlv_tag_t asn_DEF_anonType_tags_2[] = {
386 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
387 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
388};
389static const asn_TYPE_tag2member_t asn_MAP_anonType_tag2el_2[] = {
390 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* x */
391 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* y */
392};
393static asn_SEQUENCE_specifics_t asn_SPC_anonType_specs_2 = {
Lev Walkin5efafc52017-09-05 03:43:00 -0700394 sizeof(struct Type2__anonType),
395 offsetof(struct Type2__anonType, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700396 .tag2el = asn_MAP_anonType_tag2el_2,
397 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700398 0, 0, 0, /* Optional elements (not needed) */
399 -1, /* Start extensions */
400 -1 /* Stop extensions */
401};
402static /* Use -fall-defs-global to expose */
403asn_TYPE_descriptor_t asn_DEF_anonType_2 = {
404 "anonType",
405 "anonType",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800406 &asn_OP_SEQUENCE,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700407 asn_DEF_anonType_tags_2,
408 sizeof(asn_DEF_anonType_tags_2)
409 /sizeof(asn_DEF_anonType_tags_2[0]) - 1, /* 1 */
410 asn_DEF_anonType_tags_2, /* Same as above */
411 sizeof(asn_DEF_anonType_tags_2)
412 /sizeof(asn_DEF_anonType_tags_2[0]), /* 2 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700413 { 0, 0, SEQUENCE_constraint },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700414 asn_MBR_anonType_2,
415 2, /* Elements count */
416 &asn_SPC_anonType_specs_2 /* Additional specs */
417};
418
419asn_TYPE_member_t asn_MBR_Type2_1[] = {
420 { ATF_NOFLAGS, 0, offsetof(struct Type2, choice.anonType),
421 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
422 .tag_mode = 0,
423 .type = &asn_DEF_anonType_2,
424 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700425 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700426 .default_value = 0,
427 .name = "anonType"
428 },
429};
430static const asn_TYPE_tag2member_t asn_MAP_Type2_tag2el_1[] = {
431 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* anonType */
432};
433asn_CHOICE_specifics_t asn_SPC_Type2_specs_1 = {
434 sizeof(struct Type2),
435 offsetof(struct Type2, _asn_ctx),
436 offsetof(struct Type2, present),
437 sizeof(((struct Type2 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700438 .tag2el = asn_MAP_Type2_tag2el_1,
439 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700440 .canonical_order = 0,
441 .ext_start = -1 /* Extensions start */
442};
443asn_TYPE_descriptor_t asn_DEF_Type2 = {
444 "Type2",
445 "Type2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800446 &asn_OP_CHOICE,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700447 0, /* No effective tags (pointer) */
448 0, /* No effective tags (count) */
449 0, /* No tags (pointer) */
450 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700451 { 0, 0, CHOICE_constraint },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700452 asn_MBR_Type2_1,
453 1, /* Elements count */
454 &asn_SPC_Type2_specs_1 /* Additional specs */
455};
456