blob: d05c23dda1819d5600b21eb62342bdd2bf82972c [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
65memb_ident_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
66 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
80 return td->check_constraints(td, sptr, ctfailcb, app_key);
81}
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
107memb_value_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
108 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
122 return td->check_constraints(td, sptr, ctfailcb, app_key);
123}
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,
134 .memb_constraints = 0, /* Defer constraints checking to the member type */
135 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
136 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
137 .default_value = 0,
138 .name = "PrimitiveMessage"
139 },
140 { ATF_NOFLAGS, 0, offsetof(struct value, choice.ComplexMessage),
141 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
142 .tag_mode = 0,
143 .type = &asn_DEF_ComplexMessage,
144 .type_selector = 0,
145 .memb_constraints = 0, /* Defer constraints checking to the member type */
146 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
147 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
148 .default_value = 0,
149 .name = "ComplexMessage"
150 },
151};
152static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_3[] = {
153 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* PrimitiveMessage */
154 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* ComplexMessage */
155};
156static asn_CHOICE_specifics_t asn_SPC_value_specs_3 = {
157 sizeof(struct value),
158 offsetof(struct value, _asn_ctx),
159 offsetof(struct value, present),
160 sizeof(((struct value *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700161 .tag2el = asn_MAP_value_tag2el_3,
162 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkin18660d22017-08-12 20:45:23 -0700163 .canonical_order = 0,
164 .ext_start = -1 /* Extensions start */
165};
166static /* Use -fall-defs-global to expose */
167asn_TYPE_descriptor_t asn_DEF_value_3 = {
168 "value",
169 "value",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800170 &asn_OP_OPEN_TYPE,
Lev Walkin18660d22017-08-12 20:45:23 -0700171 OPEN_TYPE_constraint,
Lev Walkin18660d22017-08-12 20:45:23 -0700172 0, /* No effective tags (pointer) */
173 0, /* No effective tags (count) */
174 0, /* No tags (pointer) */
175 0, /* No tags (count) */
176 0, /* No OER visible constraints */
177 0, /* No PER visible constraints */
178 asn_MBR_value_3,
179 2, /* Elements count */
180 &asn_SPC_value_specs_3 /* Additional specs */
181};
182
Lev Walkinad0d6372017-08-08 02:02:42 -0700183static asn_TYPE_member_t asn_MBR_Frame_1[] = {
184 { ATF_NOFLAGS, 0, offsetof(struct Frame, ident),
185 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
186 .tag_mode = 0,
187 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700188 .type_selector = 0,
Lev Walkinad0d6372017-08-08 02:02:42 -0700189 .memb_constraints = memb_ident_constraint_1,
190 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
191 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
192 .default_value = 0,
193 .name = "ident"
194 },
195 { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Frame, value),
196 .tag = -1 /* Ambiguous tag (ANY?) */,
197 .tag_mode = 0,
Lev Walkin18660d22017-08-12 20:45:23 -0700198 .type = &asn_DEF_value_3,
Lev Walkin67a30122017-08-10 05:48:54 -0700199 .type_selector = select_value_type,
Lev Walkinad0d6372017-08-08 02:02:42 -0700200 .memb_constraints = memb_value_constraint_1,
201 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
202 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
203 .default_value = 0,
204 .name = "value"
205 },
206};
207static const ber_tlv_tag_t asn_DEF_Frame_tags_1[] = {
208 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
209};
210static const asn_TYPE_tag2member_t asn_MAP_Frame_tag2el_1[] = {
211 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* ident */
212};
213static asn_SEQUENCE_specifics_t asn_SPC_Frame_specs_1 = {
214 sizeof(struct Frame),
215 offsetof(struct Frame, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700216 .tag2el = asn_MAP_Frame_tag2el_1,
217 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkinad0d6372017-08-08 02:02:42 -0700218 0, 0, 0, /* Optional elements (not needed) */
219 1, /* Start extensions */
220 3 /* Stop extensions */
221};
222asn_TYPE_descriptor_t asn_DEF_Frame = {
223 "Frame",
224 "Frame",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800225 &asn_OP_SEQUENCE,
Lev Walkinad0d6372017-08-08 02:02:42 -0700226 SEQUENCE_constraint,
Lev Walkinad0d6372017-08-08 02:02:42 -0700227 asn_DEF_Frame_tags_1,
228 sizeof(asn_DEF_Frame_tags_1)
229 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
230 asn_DEF_Frame_tags_1, /* Same as above */
231 sizeof(asn_DEF_Frame_tags_1)
232 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
233 0, /* No OER visible constraints */
234 0, /* No PER visible constraints */
235 asn_MBR_Frame_1,
236 2, /* Elements count */
237 &asn_SPC_Frame_specs_1 /* Additional specs */
238};
239
240
241/*** <<< INCLUDES [PrimitiveMessage] >>> ***/
242
243#include <constr_SEQUENCE.h>
244
245/*** <<< TYPE-DECLS [PrimitiveMessage] >>> ***/
246
247typedef struct PrimitiveMessage {
248
249 /* Context for parsing across buffer boundaries */
250 asn_struct_ctx_t _asn_ctx;
251} PrimitiveMessage_t;
252
253/*** <<< FUNC-DECLS [PrimitiveMessage] >>> ***/
254
255extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage;
256extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1;
257
258/*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/
259
260static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = {
261 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
262};
263asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1 = {
264 sizeof(struct PrimitiveMessage),
265 offsetof(struct PrimitiveMessage, _asn_ctx),
266 0, /* No top level tags */
267 0, /* No tags in the map */
268 0, 0, 0, /* Optional elements (not needed) */
269 -1, /* Start extensions */
270 -1 /* Stop extensions */
271};
272asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = {
273 "PrimitiveMessage",
274 "PrimitiveMessage",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800275 &asn_OP_SEQUENCE,
Lev Walkinad0d6372017-08-08 02:02:42 -0700276 SEQUENCE_constraint,
Lev Walkinad0d6372017-08-08 02:02:42 -0700277 asn_DEF_PrimitiveMessage_tags_1,
278 sizeof(asn_DEF_PrimitiveMessage_tags_1)
279 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
280 asn_DEF_PrimitiveMessage_tags_1, /* Same as above */
281 sizeof(asn_DEF_PrimitiveMessage_tags_1)
282 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
283 0, /* No OER visible constraints */
284 0, /* No PER visible constraints */
285 0, 0, /* No members */
286 &asn_SPC_PrimitiveMessage_specs_1 /* Additional specs */
287};
288
289
290/*** <<< INCLUDES [ComplexMessage] >>> ***/
291
292#include <constr_SEQUENCE.h>
293
294/*** <<< TYPE-DECLS [ComplexMessage] >>> ***/
295
296typedef struct ComplexMessage {
297
298 /* Context for parsing across buffer boundaries */
299 asn_struct_ctx_t _asn_ctx;
300} ComplexMessage_t;
301
302/*** <<< FUNC-DECLS [ComplexMessage] >>> ***/
303
304extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage;
305extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1;
306
307/*** <<< STAT-DEFS [ComplexMessage] >>> ***/
308
309static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = {
310 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
311};
312asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1 = {
313 sizeof(struct ComplexMessage),
314 offsetof(struct ComplexMessage, _asn_ctx),
315 0, /* No top level tags */
316 0, /* No tags in the map */
317 0, 0, 0, /* Optional elements (not needed) */
318 -1, /* Start extensions */
319 -1 /* Stop extensions */
320};
321asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
322 "ComplexMessage",
323 "ComplexMessage",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800324 &asn_OP_SEQUENCE,
Lev Walkinad0d6372017-08-08 02:02:42 -0700325 SEQUENCE_constraint,
Lev Walkinad0d6372017-08-08 02:02:42 -0700326 asn_DEF_ComplexMessage_tags_1,
327 sizeof(asn_DEF_ComplexMessage_tags_1)
328 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
329 asn_DEF_ComplexMessage_tags_1, /* Same as above */
330 sizeof(asn_DEF_ComplexMessage_tags_1)
331 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
332 0, /* No OER visible constraints */
333 0, /* No PER visible constraints */
334 0, 0, /* No members */
335 &asn_SPC_ComplexMessage_specs_1 /* Additional specs */
336};
337