blob: e9af4b3b6801a0e11cee59d5655b5cc0aa77f4ff [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;
27 union value_u {
28 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
Lev Walkin67a30122017-08-10 05:48:54 -070084select_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 Walkin18660d22017-08-12 20:45:23 -0700160 .ext_start = -1 /* Extensions start */
161};
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,
Lev Walkin67a30122017-08-10 05:48:54 -0700191 .type_selector = select_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) */
209 1, /* Start extensions */
210 3 /* Stop extensions */
211};
212asn_TYPE_descriptor_t asn_DEF_Frame = {
213 "Frame",
214 "Frame",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800215 &asn_OP_SEQUENCE,
Lev Walkinad0d6372017-08-08 02:02:42 -0700216 asn_DEF_Frame_tags_1,
217 sizeof(asn_DEF_Frame_tags_1)
218 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
219 asn_DEF_Frame_tags_1, /* Same as above */
220 sizeof(asn_DEF_Frame_tags_1)
221 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700222 { 0, 0, SEQUENCE_constraint },
Lev Walkinad0d6372017-08-08 02:02:42 -0700223 asn_MBR_Frame_1,
224 2, /* Elements count */
225 &asn_SPC_Frame_specs_1 /* Additional specs */
226};
227
228
229/*** <<< INCLUDES [PrimitiveMessage] >>> ***/
230
231#include <constr_SEQUENCE.h>
232
233/*** <<< TYPE-DECLS [PrimitiveMessage] >>> ***/
234
235typedef struct PrimitiveMessage {
236
237 /* Context for parsing across buffer boundaries */
238 asn_struct_ctx_t _asn_ctx;
239} PrimitiveMessage_t;
240
241/*** <<< FUNC-DECLS [PrimitiveMessage] >>> ***/
242
243extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage;
244extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1;
245
246/*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/
247
248static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = {
249 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
250};
251asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1 = {
252 sizeof(struct PrimitiveMessage),
253 offsetof(struct PrimitiveMessage, _asn_ctx),
254 0, /* No top level tags */
255 0, /* No tags in the map */
256 0, 0, 0, /* Optional elements (not needed) */
257 -1, /* Start extensions */
258 -1 /* Stop extensions */
259};
260asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = {
261 "PrimitiveMessage",
262 "PrimitiveMessage",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800263 &asn_OP_SEQUENCE,
Lev Walkinad0d6372017-08-08 02:02:42 -0700264 asn_DEF_PrimitiveMessage_tags_1,
265 sizeof(asn_DEF_PrimitiveMessage_tags_1)
266 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
267 asn_DEF_PrimitiveMessage_tags_1, /* Same as above */
268 sizeof(asn_DEF_PrimitiveMessage_tags_1)
269 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700270 { 0, 0, SEQUENCE_constraint },
Lev Walkinad0d6372017-08-08 02:02:42 -0700271 0, 0, /* No members */
272 &asn_SPC_PrimitiveMessage_specs_1 /* Additional specs */
273};
274
275
276/*** <<< INCLUDES [ComplexMessage] >>> ***/
277
278#include <constr_SEQUENCE.h>
279
280/*** <<< TYPE-DECLS [ComplexMessage] >>> ***/
281
282typedef struct ComplexMessage {
283
284 /* Context for parsing across buffer boundaries */
285 asn_struct_ctx_t _asn_ctx;
286} ComplexMessage_t;
287
288/*** <<< FUNC-DECLS [ComplexMessage] >>> ***/
289
290extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage;
291extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1;
292
293/*** <<< STAT-DEFS [ComplexMessage] >>> ***/
294
295static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = {
296 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
297};
298asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1 = {
299 sizeof(struct ComplexMessage),
300 offsetof(struct ComplexMessage, _asn_ctx),
301 0, /* No top level tags */
302 0, /* No tags in the map */
303 0, 0, 0, /* Optional elements (not needed) */
304 -1, /* Start extensions */
305 -1 /* Stop extensions */
306};
307asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
308 "ComplexMessage",
309 "ComplexMessage",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800310 &asn_OP_SEQUENCE,
Lev Walkinad0d6372017-08-08 02:02:42 -0700311 asn_DEF_ComplexMessage_tags_1,
312 sizeof(asn_DEF_ComplexMessage_tags_1)
313 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
314 asn_DEF_ComplexMessage_tags_1, /* Same as above */
315 sizeof(asn_DEF_ComplexMessage_tags_1)
316 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700317 { 0, 0, SEQUENCE_constraint },
Lev Walkinad0d6372017-08-08 02:02:42 -0700318 0, 0, /* No members */
319 &asn_SPC_ComplexMessage_specs_1 /* Additional specs */
320};
321