blob: b732a46593d7aef3d3022fd119074811f738d61d [file] [log] [blame]
Lev Walkinad0d6372017-08-08 02:02:42 -07001
2/*** <<< INCLUDES [Frame] >>> ***/
3
4#include <NativeInteger.h>
5#include <ANY.h>
6#include <asn_ioc.h>
7#include "PrimitiveMessage.h"
8#include "ComplexMessage.h"
Lev Walkin18660d22017-08-12 20:45:23 -07009#include <OPEN_TYPE.h>
10#include <constr_CHOICE.h>
Lev Walkinad0d6372017-08-08 02:02:42 -070011#include <constr_SEQUENCE.h>
12
Lev Walkin18660d22017-08-12 20:45:23 -070013/*** <<< DEPS [Frame] >>> ***/
14
15typedef enum value_PR {
16 value_PR_NOTHING, /* No components present */
17 value_PR_PrimitiveMessage,
18 value_PR_ComplexMessage
19} value_PR;
20
Lev Walkinad0d6372017-08-08 02:02:42 -070021/*** <<< TYPE-DECLS [Frame] >>> ***/
22
23typedef struct Frame {
24 long ident;
Lev Walkin18660d22017-08-12 20:45:23 -070025 struct value {
26 value_PR present;
Bi-Ruei, Chiue460c3b2017-10-19 20:49:17 +080027 union Frame__value_u {
Lev Walkin18660d22017-08-12 20:45:23 -070028 PrimitiveMessage_t PrimitiveMessage;
29 ComplexMessage_t ComplexMessage;
30 } choice;
31
32 /* Context for parsing across buffer boundaries */
33 asn_struct_ctx_t _asn_ctx;
34 } value;
Lev Walkinad0d6372017-08-08 02:02:42 -070035 /*
36 * This type is extensible,
37 * possible extensions are below.
38 */
39
40 /* Context for parsing across buffer boundaries */
41 asn_struct_ctx_t _asn_ctx;
42} Frame_t;
43
44/*** <<< FUNC-DECLS [Frame] >>> ***/
45
46extern asn_TYPE_descriptor_t asn_DEF_Frame;
47
Lev Walkin67a30122017-08-10 05:48:54 -070048/*** <<< IOC-TABLES [Frame] >>> ***/
49
Lev Walkind357f3d2017-08-10 17:40:37 -070050static const long asn_VAL_1_basicMessage = 1;
51static const long asn_VAL_2_2 = 2;
Lev Walkin67a30122017-08-10 05:48:54 -070052static const asn_ioc_cell_t asn_IOS_FrameTypes_1_rows[] = {
Lev Walkind357f3d2017-08-10 17:40:37 -070053 { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_1_basicMessage },
Lev Walkin67a30122017-08-10 05:48:54 -070054 { "&Type", aioc__type, &asn_DEF_PrimitiveMessage },
Lev Walkind357f3d2017-08-10 17:40:37 -070055 { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_2_2 },
Lev Walkin67a30122017-08-10 05:48:54 -070056 { "&Type", aioc__type, &asn_DEF_ComplexMessage }
57};
Lev Walkin18660d22017-08-12 20:45:23 -070058static const asn_ioc_set_t asn_IOS_FrameTypes_1[] = {
Lev Walkin67a30122017-08-10 05:48:54 -070059 2, 2, asn_IOS_FrameTypes_1_rows
60};
61
Lev Walkinad0d6372017-08-08 02:02:42 -070062/*** <<< CODE [Frame] >>> ***/
63
64static int
Lev Walkin20696a42017-10-17 21:27:33 -070065memb_ident_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkinad0d6372017-08-08 02:02:42 -070066 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
67
68 if(!sptr) {
69 ASN__CTFAIL(app_key, td, sptr,
70 "%s: value not given (%s:%d)",
71 td->name, __FILE__, __LINE__);
72 return -1;
73 }
74
75
76 if(1 /* No applicable constraints whatsoever */) {
77 /* Nothing is here. See below */
78 }
79
Lev Walkin0bfea562017-09-29 23:16:48 -070080 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
Lev Walkinad0d6372017-08-08 02:02:42 -070081}
82
Lev Walkin18660d22017-08-12 20:45:23 -070083static asn_type_selector_result_t
Bi-Ruei, Chiue460c3b2017-10-19 20:49:17 +080084select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
Lev Walkin18660d22017-08-12 20:45:23 -070085 asn_type_selector_result_t result = {0, 0};
86 const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
Lev Walkin67a30122017-08-10 05:48:54 -070087 size_t constraining_column = 0; /* &id */
88 size_t for_column = 1; /* &Type */
89 size_t row;
90 const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Frame, ident));
91
92 for(row=0; row < itable->rows_count; row++) {
Lev Walkin18660d22017-08-12 20:45:23 -070093 const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
94 const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
95
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +080096 if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
Lev Walkin18660d22017-08-12 20:45:23 -070097 result.type_descriptor = type_cell->type_descriptor;
98 result.presence_index = row + 1;
99 break;
Lev Walkin67a30122017-08-10 05:48:54 -0700100 }
101 }
102
Lev Walkin18660d22017-08-12 20:45:23 -0700103 return result;
Lev Walkin67a30122017-08-10 05:48:54 -0700104}
105
Lev Walkinad0d6372017-08-08 02:02:42 -0700106static int
Lev Walkin20696a42017-10-17 21:27:33 -0700107memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkinad0d6372017-08-08 02:02:42 -0700108 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
109
110 if(!sptr) {
111 ASN__CTFAIL(app_key, td, sptr,
112 "%s: value not given (%s:%d)",
113 td->name, __FILE__, __LINE__);
114 return -1;
115 }
116
117
118 if(1 /* No applicable constraints whatsoever */) {
119 /* Nothing is here. See below */
120 }
121
Lev Walkin0bfea562017-09-29 23:16:48 -0700122 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
Lev Walkinad0d6372017-08-08 02:02:42 -0700123}
124
125
126/*** <<< STAT-DEFS [Frame] >>> ***/
127
Lev Walkin18660d22017-08-12 20:45:23 -0700128static asn_TYPE_member_t asn_MBR_value_3[] = {
129 { ATF_NOFLAGS, 0, offsetof(struct value, choice.PrimitiveMessage),
130 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
131 .tag_mode = 0,
132 .type = &asn_DEF_PrimitiveMessage,
133 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700134 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700135 0, 0, /* No default value */
Lev Walkin18660d22017-08-12 20:45:23 -0700136 .name = "PrimitiveMessage"
137 },
138 { ATF_NOFLAGS, 0, offsetof(struct value, choice.ComplexMessage),
139 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
140 .tag_mode = 0,
141 .type = &asn_DEF_ComplexMessage,
142 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700143 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700144 0, 0, /* No default value */
Lev Walkin18660d22017-08-12 20:45:23 -0700145 .name = "ComplexMessage"
146 },
147};
148static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_3[] = {
149 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* PrimitiveMessage */
150 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* ComplexMessage */
151};
152static asn_CHOICE_specifics_t asn_SPC_value_specs_3 = {
153 sizeof(struct value),
154 offsetof(struct value, _asn_ctx),
155 offsetof(struct value, present),
156 sizeof(((struct value *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700157 .tag2el = asn_MAP_value_tag2el_3,
158 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkin20696a42017-10-17 21:27:33 -0700159 0, 0,
Lev Walkindf2edbb2017-10-21 13:40:07 -0700160 .first_extension = -1 /* Extensions start */
Lev Walkin18660d22017-08-12 20:45:23 -0700161};
162static /* Use -fall-defs-global to expose */
163asn_TYPE_descriptor_t asn_DEF_value_3 = {
164 "value",
165 "value",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800166 &asn_OP_OPEN_TYPE,
Lev Walkin18660d22017-08-12 20:45:23 -0700167 0, /* No effective tags (pointer) */
168 0, /* No effective tags (count) */
169 0, /* No tags (pointer) */
170 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700171 { 0, 0, OPEN_TYPE_constraint },
Lev Walkin18660d22017-08-12 20:45:23 -0700172 asn_MBR_value_3,
173 2, /* Elements count */
174 &asn_SPC_value_specs_3 /* Additional specs */
175};
176
Lev Walkinad0d6372017-08-08 02:02:42 -0700177static asn_TYPE_member_t asn_MBR_Frame_1[] = {
178 { ATF_NOFLAGS, 0, offsetof(struct Frame, ident),
179 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
180 .tag_mode = 0,
181 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700182 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700183 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_ident_constraint_1 },
Lev Walkin20696a42017-10-17 21:27:33 -0700184 0, 0, /* No default value */
Lev Walkinad0d6372017-08-08 02:02:42 -0700185 .name = "ident"
186 },
187 { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Frame, value),
188 .tag = -1 /* Ambiguous tag (ANY?) */,
189 .tag_mode = 0,
Lev Walkin18660d22017-08-12 20:45:23 -0700190 .type = &asn_DEF_value_3,
Bi-Ruei, Chiue460c3b2017-10-19 20:49:17 +0800191 .type_selector = select_Frame_value_type,
Lev Walkin0bfea562017-09-29 23:16:48 -0700192 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 },
Lev Walkin20696a42017-10-17 21:27:33 -0700193 0, 0, /* No default value */
Lev Walkinad0d6372017-08-08 02:02:42 -0700194 .name = "value"
195 },
196};
197static const ber_tlv_tag_t asn_DEF_Frame_tags_1[] = {
198 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
199};
200static const asn_TYPE_tag2member_t asn_MAP_Frame_tag2el_1[] = {
201 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* ident */
202};
203static asn_SEQUENCE_specifics_t asn_SPC_Frame_specs_1 = {
204 sizeof(struct Frame),
205 offsetof(struct Frame, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700206 .tag2el = asn_MAP_Frame_tag2el_1,
207 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkinad0d6372017-08-08 02:02:42 -0700208 0, 0, 0, /* Optional elements (not needed) */
Lev Walkindf2edbb2017-10-21 13:40:07 -0700209 2, /* First extension addition */
Lev Walkinad0d6372017-08-08 02:02:42 -0700210};
211asn_TYPE_descriptor_t asn_DEF_Frame = {
212 "Frame",
213 "Frame",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800214 &asn_OP_SEQUENCE,
Lev Walkinad0d6372017-08-08 02:02:42 -0700215 asn_DEF_Frame_tags_1,
216 sizeof(asn_DEF_Frame_tags_1)
217 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
218 asn_DEF_Frame_tags_1, /* Same as above */
219 sizeof(asn_DEF_Frame_tags_1)
220 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700221 { 0, 0, SEQUENCE_constraint },
Lev Walkinad0d6372017-08-08 02:02:42 -0700222 asn_MBR_Frame_1,
223 2, /* Elements count */
224 &asn_SPC_Frame_specs_1 /* Additional specs */
225};
226
227
228/*** <<< INCLUDES [PrimitiveMessage] >>> ***/
229
230#include <constr_SEQUENCE.h>
231
232/*** <<< TYPE-DECLS [PrimitiveMessage] >>> ***/
233
234typedef struct PrimitiveMessage {
235
236 /* Context for parsing across buffer boundaries */
237 asn_struct_ctx_t _asn_ctx;
238} PrimitiveMessage_t;
239
240/*** <<< FUNC-DECLS [PrimitiveMessage] >>> ***/
241
242extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage;
243extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1;
244
245/*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/
246
247static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = {
248 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
249};
250asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1 = {
251 sizeof(struct PrimitiveMessage),
252 offsetof(struct PrimitiveMessage, _asn_ctx),
253 0, /* No top level tags */
254 0, /* No tags in the map */
255 0, 0, 0, /* Optional elements (not needed) */
Lev Walkindf2edbb2017-10-21 13:40:07 -0700256 -1, /* First extension addition */
Lev Walkinad0d6372017-08-08 02:02:42 -0700257};
258asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = {
259 "PrimitiveMessage",
260 "PrimitiveMessage",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800261 &asn_OP_SEQUENCE,
Lev Walkinad0d6372017-08-08 02:02:42 -0700262 asn_DEF_PrimitiveMessage_tags_1,
263 sizeof(asn_DEF_PrimitiveMessage_tags_1)
264 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
265 asn_DEF_PrimitiveMessage_tags_1, /* Same as above */
266 sizeof(asn_DEF_PrimitiveMessage_tags_1)
267 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700268 { 0, 0, SEQUENCE_constraint },
Lev Walkinad0d6372017-08-08 02:02:42 -0700269 0, 0, /* No members */
270 &asn_SPC_PrimitiveMessage_specs_1 /* Additional specs */
271};
272
273
274/*** <<< INCLUDES [ComplexMessage] >>> ***/
275
276#include <constr_SEQUENCE.h>
277
278/*** <<< TYPE-DECLS [ComplexMessage] >>> ***/
279
280typedef struct ComplexMessage {
281
282 /* Context for parsing across buffer boundaries */
283 asn_struct_ctx_t _asn_ctx;
284} ComplexMessage_t;
285
286/*** <<< FUNC-DECLS [ComplexMessage] >>> ***/
287
288extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage;
289extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1;
290
291/*** <<< STAT-DEFS [ComplexMessage] >>> ***/
292
293static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = {
294 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
295};
296asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1 = {
297 sizeof(struct ComplexMessage),
298 offsetof(struct ComplexMessage, _asn_ctx),
299 0, /* No top level tags */
300 0, /* No tags in the map */
301 0, 0, 0, /* Optional elements (not needed) */
Lev Walkindf2edbb2017-10-21 13:40:07 -0700302 -1, /* First extension addition */
Lev Walkinad0d6372017-08-08 02:02:42 -0700303};
304asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
305 "ComplexMessage",
306 "ComplexMessage",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800307 &asn_OP_SEQUENCE,
Lev Walkinad0d6372017-08-08 02:02:42 -0700308 asn_DEF_ComplexMessage_tags_1,
309 sizeof(asn_DEF_ComplexMessage_tags_1)
310 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
311 asn_DEF_ComplexMessage_tags_1, /* Same as above */
312 sizeof(asn_DEF_ComplexMessage_tags_1)
313 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700314 { 0, 0, SEQUENCE_constraint },
Lev Walkinad0d6372017-08-08 02:02:42 -0700315 0, 0, /* No members */
316 &asn_SPC_ComplexMessage_specs_1 /* Additional specs */
317};
318