blob: 641bca893c8595874f5b1aa573c82b8c1d237dbe [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
96 if(constraining_cell->type_descriptor->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
97 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",
170 OPEN_TYPE_free,
171 OPEN_TYPE_print,
172 OPEN_TYPE_compare,
173 OPEN_TYPE_constraint,
174 OPEN_TYPE_decode_ber,
175 OPEN_TYPE_encode_der,
176 OPEN_TYPE_decode_xer,
177 OPEN_TYPE_encode_xer,
178 0, 0, /* No OER support, use "-gen-OER" to enable */
179 0, 0, /* No PER support, use "-gen-PER" to enable */
180 0, /* Use generic outmost tag fetcher */
181 0, /* No effective tags (pointer) */
182 0, /* No effective tags (count) */
183 0, /* No tags (pointer) */
184 0, /* No tags (count) */
185 0, /* No OER visible constraints */
186 0, /* No PER visible constraints */
187 asn_MBR_value_3,
188 2, /* Elements count */
189 &asn_SPC_value_specs_3 /* Additional specs */
190};
191
Lev Walkinad0d6372017-08-08 02:02:42 -0700192static asn_TYPE_member_t asn_MBR_Frame_1[] = {
193 { ATF_NOFLAGS, 0, offsetof(struct Frame, ident),
194 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
195 .tag_mode = 0,
196 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700197 .type_selector = 0,
Lev Walkinad0d6372017-08-08 02:02:42 -0700198 .memb_constraints = memb_ident_constraint_1,
199 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
200 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
201 .default_value = 0,
202 .name = "ident"
203 },
204 { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Frame, value),
205 .tag = -1 /* Ambiguous tag (ANY?) */,
206 .tag_mode = 0,
Lev Walkin18660d22017-08-12 20:45:23 -0700207 .type = &asn_DEF_value_3,
Lev Walkin67a30122017-08-10 05:48:54 -0700208 .type_selector = select_value_type,
Lev Walkinad0d6372017-08-08 02:02:42 -0700209 .memb_constraints = memb_value_constraint_1,
210 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
211 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
212 .default_value = 0,
213 .name = "value"
214 },
215};
216static const ber_tlv_tag_t asn_DEF_Frame_tags_1[] = {
217 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
218};
219static const asn_TYPE_tag2member_t asn_MAP_Frame_tag2el_1[] = {
220 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* ident */
221};
222static asn_SEQUENCE_specifics_t asn_SPC_Frame_specs_1 = {
223 sizeof(struct Frame),
224 offsetof(struct Frame, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700225 .tag2el = asn_MAP_Frame_tag2el_1,
226 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkinad0d6372017-08-08 02:02:42 -0700227 0, 0, 0, /* Optional elements (not needed) */
228 1, /* Start extensions */
229 3 /* Stop extensions */
230};
231asn_TYPE_descriptor_t asn_DEF_Frame = {
232 "Frame",
233 "Frame",
234 SEQUENCE_free,
235 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700236 SEQUENCE_compare,
Lev Walkinad0d6372017-08-08 02:02:42 -0700237 SEQUENCE_constraint,
238 SEQUENCE_decode_ber,
239 SEQUENCE_encode_der,
240 SEQUENCE_decode_xer,
241 SEQUENCE_encode_xer,
242 0, 0, /* No OER support, use "-gen-OER" to enable */
243 0, 0, /* No PER support, use "-gen-PER" to enable */
244 0, /* Use generic outmost tag fetcher */
245 asn_DEF_Frame_tags_1,
246 sizeof(asn_DEF_Frame_tags_1)
247 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
248 asn_DEF_Frame_tags_1, /* Same as above */
249 sizeof(asn_DEF_Frame_tags_1)
250 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
251 0, /* No OER visible constraints */
252 0, /* No PER visible constraints */
253 asn_MBR_Frame_1,
254 2, /* Elements count */
255 &asn_SPC_Frame_specs_1 /* Additional specs */
256};
257
258
259/*** <<< INCLUDES [PrimitiveMessage] >>> ***/
260
261#include <constr_SEQUENCE.h>
262
263/*** <<< TYPE-DECLS [PrimitiveMessage] >>> ***/
264
265typedef struct PrimitiveMessage {
266
267 /* Context for parsing across buffer boundaries */
268 asn_struct_ctx_t _asn_ctx;
269} PrimitiveMessage_t;
270
271/*** <<< FUNC-DECLS [PrimitiveMessage] >>> ***/
272
273extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage;
274extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1;
275
276/*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/
277
278static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = {
279 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
280};
281asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1 = {
282 sizeof(struct PrimitiveMessage),
283 offsetof(struct PrimitiveMessage, _asn_ctx),
284 0, /* No top level tags */
285 0, /* No tags in the map */
286 0, 0, 0, /* Optional elements (not needed) */
287 -1, /* Start extensions */
288 -1 /* Stop extensions */
289};
290asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = {
291 "PrimitiveMessage",
292 "PrimitiveMessage",
293 SEQUENCE_free,
294 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700295 SEQUENCE_compare,
Lev Walkinad0d6372017-08-08 02:02:42 -0700296 SEQUENCE_constraint,
297 SEQUENCE_decode_ber,
298 SEQUENCE_encode_der,
299 SEQUENCE_decode_xer,
300 SEQUENCE_encode_xer,
301 0, 0, /* No OER support, use "-gen-OER" to enable */
302 0, 0, /* No PER support, use "-gen-PER" to enable */
303 0, /* Use generic outmost tag fetcher */
304 asn_DEF_PrimitiveMessage_tags_1,
305 sizeof(asn_DEF_PrimitiveMessage_tags_1)
306 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
307 asn_DEF_PrimitiveMessage_tags_1, /* Same as above */
308 sizeof(asn_DEF_PrimitiveMessage_tags_1)
309 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
310 0, /* No OER visible constraints */
311 0, /* No PER visible constraints */
312 0, 0, /* No members */
313 &asn_SPC_PrimitiveMessage_specs_1 /* Additional specs */
314};
315
316
317/*** <<< INCLUDES [ComplexMessage] >>> ***/
318
319#include <constr_SEQUENCE.h>
320
321/*** <<< TYPE-DECLS [ComplexMessage] >>> ***/
322
323typedef struct ComplexMessage {
324
325 /* Context for parsing across buffer boundaries */
326 asn_struct_ctx_t _asn_ctx;
327} ComplexMessage_t;
328
329/*** <<< FUNC-DECLS [ComplexMessage] >>> ***/
330
331extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage;
332extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1;
333
334/*** <<< STAT-DEFS [ComplexMessage] >>> ***/
335
336static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = {
337 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
338};
339asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1 = {
340 sizeof(struct ComplexMessage),
341 offsetof(struct ComplexMessage, _asn_ctx),
342 0, /* No top level tags */
343 0, /* No tags in the map */
344 0, 0, 0, /* Optional elements (not needed) */
345 -1, /* Start extensions */
346 -1 /* Stop extensions */
347};
348asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
349 "ComplexMessage",
350 "ComplexMessage",
351 SEQUENCE_free,
352 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700353 SEQUENCE_compare,
Lev Walkinad0d6372017-08-08 02:02:42 -0700354 SEQUENCE_constraint,
355 SEQUENCE_decode_ber,
356 SEQUENCE_encode_der,
357 SEQUENCE_decode_xer,
358 SEQUENCE_encode_xer,
359 0, 0, /* No OER support, use "-gen-OER" to enable */
360 0, 0, /* No PER support, use "-gen-PER" to enable */
361 0, /* Use generic outmost tag fetcher */
362 asn_DEF_ComplexMessage_tags_1,
363 sizeof(asn_DEF_ComplexMessage_tags_1)
364 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
365 asn_DEF_ComplexMessage_tags_1, /* Same as above */
366 sizeof(asn_DEF_ComplexMessage_tags_1)
367 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
368 0, /* No OER visible constraints */
369 0, /* No PER visible constraints */
370 0, 0, /* No members */
371 &asn_SPC_ComplexMessage_specs_1 /* Additional specs */
372};
373