2 /*** <<< INCLUDES [Frame] >>> ***/
4 #include "ConstrainedInteger.h"
7 #include "PrimitiveMessage.h"
8 #include "ComplexMessage.h"
10 #include <constr_CHOICE.h>
11 #include <constr_SEQUENCE.h>
13 /*** <<< DEPS [Frame] >>> ***/
15 typedef enum value_PR {
16 value_PR_NOTHING, /* No components present */
17 value_PR_PrimitiveMessage,
18 value_PR_ComplexMessage
21 /*** <<< TYPE-DECLS [Frame] >>> ***/
23 typedef struct Frame {
24 ConstrainedInteger_t ident;
27 union Frame__value_u {
28 PrimitiveMessage_t PrimitiveMessage;
29 ComplexMessage_t ComplexMessage;
32 /* Context for parsing across buffer boundaries */
33 asn_struct_ctx_t _asn_ctx;
36 * This type is extensible,
37 * possible extensions are below.
40 /* Context for parsing across buffer boundaries */
41 asn_struct_ctx_t _asn_ctx;
44 /*** <<< FUNC-DECLS [Frame] >>> ***/
46 extern asn_TYPE_descriptor_t asn_DEF_Frame;
48 /*** <<< IOC-TABLES [Frame] >>> ***/
50 static const long asn_VAL_1_primMessage = 1;
51 static const long asn_VAL_2_cplxMessage = 2;
52 static const asn_ioc_cell_t asn_IOS_FrameTypes_1_rows[] = {
53 { "&id", aioc__value, &asn_DEF_ConstrainedInteger, &asn_VAL_1_primMessage },
54 { "&Type", aioc__type, &asn_DEF_PrimitiveMessage },
55 { "&id", aioc__value, &asn_DEF_ConstrainedInteger, &asn_VAL_2_cplxMessage },
56 { "&Type", aioc__type, &asn_DEF_ComplexMessage }
58 static const asn_ioc_set_t asn_IOS_FrameTypes_1[] = {
59 { 2, 2, asn_IOS_FrameTypes_1_rows }
62 /*** <<< CODE [Frame] >>> ***/
65 memb_ident_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
66 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
70 ASN__CTFAIL(app_key, td, sptr,
71 "%s: value not given (%s:%d)",
72 td->name, __FILE__, __LINE__);
76 value = *(const long *)sptr;
78 if((value >= 0 && value <= 32767)) {
79 /* Constraint check succeeded */
82 ASN__CTFAIL(app_key, td, sptr,
83 "%s: constraint failed (%s:%d)",
84 td->name, __FILE__, __LINE__);
89 static asn_type_selector_result_t
90 select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
91 asn_type_selector_result_t result = {0, 0};
92 const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
93 size_t constraining_column = 0; /* &id */
94 size_t for_column = 1; /* &Type */
95 size_t row, presence_index = 0;
96 const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Frame, ident));
98 for(row=0; row < itable->rows_count; row++) {
99 const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
100 const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
102 if(type_cell->cell_kind == aioc__undefined)
106 if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
107 result.type_descriptor = type_cell->type_descriptor;
108 result.presence_index = presence_index;
117 memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
118 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
121 ASN__CTFAIL(app_key, td, sptr,
122 "%s: value not given (%s:%d)",
123 td->name, __FILE__, __LINE__);
128 if(1 /* No applicable constraints whatsoever */) {
129 /* Nothing is here. See below */
132 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
136 /*** <<< STAT-DEFS [Frame] >>> ***/
138 static asn_TYPE_member_t asn_MBR_value_3[] = {
139 { ATF_NOFLAGS, 0, offsetof(struct value, choice.PrimitiveMessage),
140 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
142 .type = &asn_DEF_PrimitiveMessage,
144 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
145 0, 0, /* No default value */
146 .name = "PrimitiveMessage"
148 { ATF_NOFLAGS, 0, offsetof(struct value, choice.ComplexMessage),
149 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
151 .type = &asn_DEF_ComplexMessage,
153 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
154 0, 0, /* No default value */
155 .name = "ComplexMessage"
158 static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_3[] = {
159 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* PrimitiveMessage */
160 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* ComplexMessage */
162 static asn_CHOICE_specifics_t asn_SPC_value_specs_3 = {
163 sizeof(struct value),
164 offsetof(struct value, _asn_ctx),
165 offsetof(struct value, present),
166 sizeof(((struct value *)0)->present),
167 .tag2el = asn_MAP_value_tag2el_3,
168 .tag2el_count = 2, /* Count of tags in the map */
170 .first_extension = -1 /* Extensions start */
172 static /* Use -fall-defs-global to expose */
173 asn_TYPE_descriptor_t asn_DEF_value_3 = {
177 0, /* No effective tags (pointer) */
178 0, /* No effective tags (count) */
179 0, /* No tags (pointer) */
180 0, /* No tags (count) */
181 { 0, 0, OPEN_TYPE_constraint },
183 2, /* Elements count */
184 &asn_SPC_value_specs_3 /* Additional specs */
187 static asn_TYPE_member_t asn_MBR_Frame_1[] = {
188 { ATF_NOFLAGS, 0, offsetof(struct Frame, ident),
189 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
190 .tag_mode = -1, /* IMPLICIT tag at current level */
191 .type = &asn_DEF_ConstrainedInteger,
193 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_ident_constraint_1 },
194 0, 0, /* No default value */
197 { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Frame, value),
198 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
199 .tag_mode = +1, /* EXPLICIT tag at current level */
200 .type = &asn_DEF_value_3,
201 .type_selector = select_Frame_value_type,
202 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 },
203 0, 0, /* No default value */
207 static const ber_tlv_tag_t asn_DEF_Frame_tags_1[] = {
208 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
210 static const asn_TYPE_tag2member_t asn_MAP_Frame_tag2el_1[] = {
211 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ident */
212 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* value */
214 static asn_SEQUENCE_specifics_t asn_SPC_Frame_specs_1 = {
215 sizeof(struct Frame),
216 offsetof(struct Frame, _asn_ctx),
217 .tag2el = asn_MAP_Frame_tag2el_1,
218 .tag2el_count = 2, /* Count of tags in the map */
219 0, 0, 0, /* Optional elements (not needed) */
220 2, /* First extension addition */
222 asn_TYPE_descriptor_t asn_DEF_Frame = {
226 asn_DEF_Frame_tags_1,
227 sizeof(asn_DEF_Frame_tags_1)
228 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
229 asn_DEF_Frame_tags_1, /* Same as above */
230 sizeof(asn_DEF_Frame_tags_1)
231 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
232 { 0, 0, SEQUENCE_constraint },
234 2, /* Elements count */
235 &asn_SPC_Frame_specs_1 /* Additional specs */
239 /*** <<< INCLUDES [ConstrainedInteger] >>> ***/
241 #include <NativeInteger.h>
243 /*** <<< TYPE-DECLS [ConstrainedInteger] >>> ***/
245 typedef long ConstrainedInteger_t;
247 /*** <<< FUNC-DECLS [ConstrainedInteger] >>> ***/
249 extern asn_TYPE_descriptor_t asn_DEF_ConstrainedInteger;
250 asn_struct_free_f ConstrainedInteger_free;
251 asn_struct_print_f ConstrainedInteger_print;
252 asn_constr_check_f ConstrainedInteger_constraint;
253 ber_type_decoder_f ConstrainedInteger_decode_ber;
254 der_type_encoder_f ConstrainedInteger_encode_der;
255 xer_type_decoder_f ConstrainedInteger_decode_xer;
256 xer_type_encoder_f ConstrainedInteger_encode_xer;
258 /*** <<< CODE [ConstrainedInteger] >>> ***/
261 ConstrainedInteger_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
262 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
266 ASN__CTFAIL(app_key, td, sptr,
267 "%s: value not given (%s:%d)",
268 td->name, __FILE__, __LINE__);
272 value = *(const long *)sptr;
274 if((value >= 0 && value <= 32767)) {
275 /* Constraint check succeeded */
278 ASN__CTFAIL(app_key, td, sptr,
279 "%s: constraint failed (%s:%d)",
280 td->name, __FILE__, __LINE__);
286 * This type is implemented using NativeInteger,
287 * so here we adjust the DEF accordingly.
290 /*** <<< STAT-DEFS [ConstrainedInteger] >>> ***/
292 static const ber_tlv_tag_t asn_DEF_ConstrainedInteger_tags_1[] = {
293 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
295 asn_TYPE_descriptor_t asn_DEF_ConstrainedInteger = {
296 "ConstrainedInteger",
297 "ConstrainedInteger",
298 &asn_OP_NativeInteger,
299 asn_DEF_ConstrainedInteger_tags_1,
300 sizeof(asn_DEF_ConstrainedInteger_tags_1)
301 /sizeof(asn_DEF_ConstrainedInteger_tags_1[0]), /* 1 */
302 asn_DEF_ConstrainedInteger_tags_1, /* Same as above */
303 sizeof(asn_DEF_ConstrainedInteger_tags_1)
304 /sizeof(asn_DEF_ConstrainedInteger_tags_1[0]), /* 1 */
305 { 0, 0, ConstrainedInteger_constraint },
306 0, 0, /* No members */
311 /*** <<< INCLUDES [PrimitiveMessage] >>> ***/
313 #include <constr_SEQUENCE.h>
315 /*** <<< TYPE-DECLS [PrimitiveMessage] >>> ***/
317 typedef struct PrimitiveMessage {
319 /* Context for parsing across buffer boundaries */
320 asn_struct_ctx_t _asn_ctx;
321 } PrimitiveMessage_t;
323 /*** <<< FUNC-DECLS [PrimitiveMessage] >>> ***/
325 extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage;
326 extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1;
328 /*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/
330 static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = {
331 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
333 asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1 = {
334 sizeof(struct PrimitiveMessage),
335 offsetof(struct PrimitiveMessage, _asn_ctx),
336 0, /* No top level tags */
337 0, /* No tags in the map */
338 0, 0, 0, /* Optional elements (not needed) */
339 -1, /* First extension addition */
341 asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = {
345 asn_DEF_PrimitiveMessage_tags_1,
346 sizeof(asn_DEF_PrimitiveMessage_tags_1)
347 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
348 asn_DEF_PrimitiveMessage_tags_1, /* Same as above */
349 sizeof(asn_DEF_PrimitiveMessage_tags_1)
350 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
351 { 0, 0, SEQUENCE_constraint },
352 0, 0, /* No members */
353 &asn_SPC_PrimitiveMessage_specs_1 /* Additional specs */
357 /*** <<< INCLUDES [ComplexMessage] >>> ***/
359 #include <constr_SEQUENCE.h>
361 /*** <<< TYPE-DECLS [ComplexMessage] >>> ***/
363 typedef struct ComplexMessage {
365 /* Context for parsing across buffer boundaries */
366 asn_struct_ctx_t _asn_ctx;
369 /*** <<< FUNC-DECLS [ComplexMessage] >>> ***/
371 extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage;
372 extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1;
374 /*** <<< STAT-DEFS [ComplexMessage] >>> ***/
376 static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = {
377 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
379 asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1 = {
380 sizeof(struct ComplexMessage),
381 offsetof(struct ComplexMessage, _asn_ctx),
382 0, /* No top level tags */
383 0, /* No tags in the map */
384 0, 0, 0, /* Optional elements (not needed) */
385 -1, /* First extension addition */
387 asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
391 asn_DEF_ComplexMessage_tags_1,
392 sizeof(asn_DEF_ComplexMessage_tags_1)
393 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
394 asn_DEF_ComplexMessage_tags_1, /* Same as above */
395 sizeof(asn_DEF_ComplexMessage_tags_1)
396 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
397 { 0, 0, SEQUENCE_constraint },
398 0, 0, /* No members */
399 &asn_SPC_ComplexMessage_specs_1 /* Additional specs */
403 /*** <<< asn_constant.h >>> ***/
406 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
409 #ifndef _ASN_CONSTANT_H
410 #define _ASN_CONSTANT_H
416 #define primMessage (1)
417 #define cplxMessage (2)
424 #endif /* _ASN_CONSTANT_H */