blob: 1d2ee812e6c7310997dc2b381fb76042ccf1135f [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 Walkin20696a42017-10-17 21:27:33 -070042 0, 0, /* No default value */
Lev Walkindb33c8d2017-08-22 01:41:58 -070043 .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 Walkin20696a42017-10-17 21:27:33 -070051 0, 0, /* No default value */
Lev Walkindb33c8d2017-08-22 01:41:58 -070052 .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 Walkin20696a42017-10-17 21:27:33 -070066 0, 0,
Lev Walkindf2edbb2017-10-21 13:40:07 -070067 .first_extension = -1 /* Extensions start */
Lev Walkindb33c8d2017-08-22 01:41:58 -070068};
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
Lev Walkin20696a42017-10-17 21:27:33 -0700124memb_x_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700125 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
Lev Walkin20696a42017-10-17 21:27:33 -0700150memb_y_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700151 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 Walkin20696a42017-10-17 21:27:33 -0700185 0, 0, /* No default value */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700186 .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 Walkin20696a42017-10-17 21:27:33 -0700194 0, 0, /* No default value */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700195 .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) */
Lev Walkindf2edbb2017-10-21 13:40:07 -0700212 -1, /* First extension addition */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700213};
214static /* Use -fall-defs-global to expose */
215asn_TYPE_descriptor_t asn_DEF_anonType_2 = {
216 "anonType",
217 "anonType",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800218 &asn_OP_SEQUENCE,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700219 asn_DEF_anonType_tags_2,
220 sizeof(asn_DEF_anonType_tags_2)
221 /sizeof(asn_DEF_anonType_tags_2[0]) - 1, /* 1 */
222 asn_DEF_anonType_tags_2, /* Same as above */
223 sizeof(asn_DEF_anonType_tags_2)
224 /sizeof(asn_DEF_anonType_tags_2[0]), /* 2 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700225 { 0, 0, SEQUENCE_constraint },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700226 asn_MBR_anonType_2,
227 2, /* Elements count */
228 &asn_SPC_anonType_specs_2 /* Additional specs */
229};
230
231asn_TYPE_member_t asn_MBR_Type1_1[] = {
232 { ATF_NOFLAGS, 0, offsetof(struct Type1, choice.anonType),
233 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
234 .tag_mode = 0,
235 .type = &asn_DEF_anonType_2,
236 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700237 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700238 0, 0, /* No default value */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700239 .name = "anonType"
240 },
241};
242static const asn_TYPE_tag2member_t asn_MAP_Type1_tag2el_1[] = {
243 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* anonType */
244};
245asn_CHOICE_specifics_t asn_SPC_Type1_specs_1 = {
246 sizeof(struct Type1),
247 offsetof(struct Type1, _asn_ctx),
248 offsetof(struct Type1, present),
249 sizeof(((struct Type1 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700250 .tag2el = asn_MAP_Type1_tag2el_1,
251 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkin20696a42017-10-17 21:27:33 -0700252 0, 0,
Lev Walkindf2edbb2017-10-21 13:40:07 -0700253 .first_extension = -1 /* Extensions start */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700254};
255asn_TYPE_descriptor_t asn_DEF_Type1 = {
256 "Type1",
257 "Type1",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800258 &asn_OP_CHOICE,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700259 0, /* No effective tags (pointer) */
260 0, /* No effective tags (count) */
261 0, /* No tags (pointer) */
262 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700263 { 0, 0, CHOICE_constraint },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700264 asn_MBR_Type1_1,
265 1, /* Elements count */
266 &asn_SPC_Type1_specs_1 /* Additional specs */
267};
268
269
270/*** <<< INCLUDES [Type2] >>> ***/
271
272#include <OCTET_STRING.h>
273#include <constr_SEQUENCE.h>
274#include <constr_CHOICE.h>
275
276/*** <<< DEPS [Type2] >>> ***/
277
278typedef enum Type2_PR {
279 Type2_PR_NOTHING, /* No components present */
280 Type2_PR_anonType
281} Type2_PR;
282
283/*** <<< TYPE-DECLS [Type2] >>> ***/
284
285typedef struct Type2 {
286 Type2_PR present;
287 union Type2_u {
Lev Walkin5efafc52017-09-05 03:43:00 -0700288 struct Type2__anonType {
Lev Walkindb33c8d2017-08-22 01:41:58 -0700289 OCTET_STRING_t x;
290 OCTET_STRING_t y;
291
292 /* Context for parsing across buffer boundaries */
293 asn_struct_ctx_t _asn_ctx;
294 } anonType;
295 } choice;
296
297 /* Context for parsing across buffer boundaries */
298 asn_struct_ctx_t _asn_ctx;
299} Type2_t;
300
301/*** <<< FUNC-DECLS [Type2] >>> ***/
302
303extern asn_TYPE_descriptor_t asn_DEF_Type2;
304extern asn_CHOICE_specifics_t asn_SPC_Type2_specs_1;
305extern asn_TYPE_member_t asn_MBR_Type2_1[1];
306
307/*** <<< CODE [Type2] >>> ***/
308
309static int
Lev Walkin20696a42017-10-17 21:27:33 -0700310memb_x_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700311 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
312 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
313 size_t size;
314
315 if(!sptr) {
316 ASN__CTFAIL(app_key, td, sptr,
317 "%s: value not given (%s:%d)",
318 td->name, __FILE__, __LINE__);
319 return -1;
320 }
321
322 size = st->size;
323
324 if((size == 48)) {
325 /* Constraint check succeeded */
326 return 0;
327 } else {
328 ASN__CTFAIL(app_key, td, sptr,
329 "%s: constraint failed (%s:%d)",
330 td->name, __FILE__, __LINE__);
331 return -1;
332 }
333}
334
335static int
Lev Walkin20696a42017-10-17 21:27:33 -0700336memb_y_constraint_2(const asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700337 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
338 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
339 size_t size;
340
341 if(!sptr) {
342 ASN__CTFAIL(app_key, td, sptr,
343 "%s: value not given (%s:%d)",
344 td->name, __FILE__, __LINE__);
345 return -1;
346 }
347
348 size = st->size;
349
350 if((size == 48)) {
351 /* Constraint check succeeded */
352 return 0;
353 } else {
354 ASN__CTFAIL(app_key, td, sptr,
355 "%s: constraint failed (%s:%d)",
356 td->name, __FILE__, __LINE__);
357 return -1;
358 }
359}
360
361
362/*** <<< STAT-DEFS [Type2] >>> ***/
363
364static asn_TYPE_member_t asn_MBR_anonType_2[] = {
Lev Walkin5efafc52017-09-05 03:43:00 -0700365 { ATF_NOFLAGS, 0, offsetof(struct Type2__anonType, x),
Lev Walkindb33c8d2017-08-22 01:41:58 -0700366 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
367 .tag_mode = -1, /* IMPLICIT tag at current level */
368 .type = &asn_DEF_OCTET_STRING,
369 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700370 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_x_constraint_2 },
Lev Walkin20696a42017-10-17 21:27:33 -0700371 0, 0, /* No default value */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700372 .name = "x"
373 },
Lev Walkin5efafc52017-09-05 03:43:00 -0700374 { ATF_NOFLAGS, 0, offsetof(struct Type2__anonType, y),
Lev Walkindb33c8d2017-08-22 01:41:58 -0700375 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
376 .tag_mode = -1, /* IMPLICIT tag at current level */
377 .type = &asn_DEF_OCTET_STRING,
378 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700379 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_y_constraint_2 },
Lev Walkin20696a42017-10-17 21:27:33 -0700380 0, 0, /* No default value */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700381 .name = "y"
382 },
383};
384static const ber_tlv_tag_t asn_DEF_anonType_tags_2[] = {
385 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
386 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
387};
388static const asn_TYPE_tag2member_t asn_MAP_anonType_tag2el_2[] = {
389 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* x */
390 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* y */
391};
392static asn_SEQUENCE_specifics_t asn_SPC_anonType_specs_2 = {
Lev Walkin5efafc52017-09-05 03:43:00 -0700393 sizeof(struct Type2__anonType),
394 offsetof(struct Type2__anonType, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700395 .tag2el = asn_MAP_anonType_tag2el_2,
396 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700397 0, 0, 0, /* Optional elements (not needed) */
Lev Walkindf2edbb2017-10-21 13:40:07 -0700398 -1, /* First extension addition */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700399};
400static /* Use -fall-defs-global to expose */
401asn_TYPE_descriptor_t asn_DEF_anonType_2 = {
402 "anonType",
403 "anonType",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800404 &asn_OP_SEQUENCE,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700405 asn_DEF_anonType_tags_2,
406 sizeof(asn_DEF_anonType_tags_2)
407 /sizeof(asn_DEF_anonType_tags_2[0]) - 1, /* 1 */
408 asn_DEF_anonType_tags_2, /* Same as above */
409 sizeof(asn_DEF_anonType_tags_2)
410 /sizeof(asn_DEF_anonType_tags_2[0]), /* 2 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700411 { 0, 0, SEQUENCE_constraint },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700412 asn_MBR_anonType_2,
413 2, /* Elements count */
414 &asn_SPC_anonType_specs_2 /* Additional specs */
415};
416
417asn_TYPE_member_t asn_MBR_Type2_1[] = {
418 { ATF_NOFLAGS, 0, offsetof(struct Type2, choice.anonType),
419 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
420 .tag_mode = 0,
421 .type = &asn_DEF_anonType_2,
422 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700423 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700424 0, 0, /* No default value */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700425 .name = "anonType"
426 },
427};
428static const asn_TYPE_tag2member_t asn_MAP_Type2_tag2el_1[] = {
429 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* anonType */
430};
431asn_CHOICE_specifics_t asn_SPC_Type2_specs_1 = {
432 sizeof(struct Type2),
433 offsetof(struct Type2, _asn_ctx),
434 offsetof(struct Type2, present),
435 sizeof(((struct Type2 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700436 .tag2el = asn_MAP_Type2_tag2el_1,
437 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkin20696a42017-10-17 21:27:33 -0700438 0, 0,
Lev Walkindf2edbb2017-10-21 13:40:07 -0700439 .first_extension = -1 /* Extensions start */
Lev Walkindb33c8d2017-08-22 01:41:58 -0700440};
441asn_TYPE_descriptor_t asn_DEF_Type2 = {
442 "Type2",
443 "Type2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800444 &asn_OP_CHOICE,
Lev Walkindb33c8d2017-08-22 01:41:58 -0700445 0, /* No effective tags (pointer) */
446 0, /* No effective tags (count) */
447 0, /* No tags (pointer) */
448 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700449 { 0, 0, CHOICE_constraint },
Lev Walkindb33c8d2017-08-22 01:41:58 -0700450 asn_MBR_Type2_1,
451 1, /* Elements count */
452 &asn_SPC_Type2_specs_1 /* Additional specs */
453};
454