/*** <<< INCLUDES [Frame] >>> ***/ #include "ConstrainedInteger.h" #include #include #include "PrimitiveMessage.h" #include "ComplexMessage.h" #include #include #include /*** <<< DEPS [Frame] >>> ***/ typedef enum value_PR { value_PR_NOTHING, /* No components present */ value_PR_PrimitiveMessage, value_PR_ComplexMessage } value_PR; /*** <<< TYPE-DECLS [Frame] >>> ***/ typedef struct Frame { ConstrainedInteger_t ident; struct value { value_PR present; union Frame__value_u { PrimitiveMessage_t PrimitiveMessage; ComplexMessage_t ComplexMessage; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } value; /* * This type is extensible, * possible extensions are below. */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } Frame_t; /*** <<< FUNC-DECLS [Frame] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_Frame; /*** <<< IOC-TABLES [Frame] >>> ***/ static const long asn_VAL_1_primMessage = 1; static const long asn_VAL_2_cplxMessage = 2; static const asn_ioc_cell_t asn_IOS_FrameTypes_1_rows[] = { { "&id", aioc__value, &asn_DEF_ConstrainedInteger, &asn_VAL_1_primMessage }, { "&Type", aioc__type, &asn_DEF_PrimitiveMessage }, { "&id", aioc__value, &asn_DEF_ConstrainedInteger, &asn_VAL_2_cplxMessage }, { "&Type", aioc__type, &asn_DEF_ComplexMessage } }; static const asn_ioc_set_t asn_IOS_FrameTypes_1[] = { { 2, 2, asn_IOS_FrameTypes_1_rows } }; /*** <<< CODE [Frame] >>> ***/ static int memb_ident_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { ASN__CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 0 && value <= 32767)) { /* Constraint check succeeded */ return 0; } else { ASN__CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static asn_type_selector_result_t select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { asn_type_selector_result_t result = {0, 0}; const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1; size_t constraining_column = 0; /* &id */ size_t for_column = 1; /* &Type */ size_t row, presence_index = 0; const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Frame, ident)); for(row=0; row < itable->rows_count; row++) { const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column]; const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column]; if(type_cell->cell_kind == aioc__undefined) continue; presence_index++; if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) { result.type_descriptor = type_cell->type_descriptor; result.presence_index = presence_index; break; } } return result; } static int memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { if(!sptr) { ASN__CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(1 /* No applicable constraints whatsoever */) { /* Nothing is here. See below */ } return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); } /*** <<< STAT-DEFS [Frame] >>> ***/ static asn_TYPE_member_t asn_MBR_value_3[] = { { ATF_NOFLAGS, 0, offsetof(struct value, choice.PrimitiveMessage), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_PrimitiveMessage, .type_selector = 0, { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, 0, 0, /* No default value */ .name = "PrimitiveMessage" }, { ATF_NOFLAGS, 0, offsetof(struct value, choice.ComplexMessage), .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), .tag_mode = 0, .type = &asn_DEF_ComplexMessage, .type_selector = 0, { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, 0, 0, /* No default value */ .name = "ComplexMessage" }, }; static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_3[] = { { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* PrimitiveMessage */ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* ComplexMessage */ }; static asn_CHOICE_specifics_t asn_SPC_value_specs_3 = { sizeof(struct value), offsetof(struct value, _asn_ctx), offsetof(struct value, present), sizeof(((struct value *)0)->present), .tag2el = asn_MAP_value_tag2el_3, .tag2el_count = 2, /* Count of tags in the map */ 0, 0, .first_extension = -1 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_value_3 = { "value", "value", &asn_OP_OPEN_TYPE, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ { 0, 0, OPEN_TYPE_constraint }, asn_MBR_value_3, 2, /* Elements count */ &asn_SPC_value_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_Frame_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Frame, ident), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ .type = &asn_DEF_ConstrainedInteger, .type_selector = 0, { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_ident_constraint_1 }, 0, 0, /* No default value */ .name = "ident" }, { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Frame, value), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_value_3, .type_selector = select_Frame_value_type, { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 }, 0, 0, /* No default value */ .name = "value" }, }; static const ber_tlv_tag_t asn_DEF_Frame_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static const asn_TYPE_tag2member_t asn_MAP_Frame_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ident */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* value */ }; static asn_SEQUENCE_specifics_t asn_SPC_Frame_specs_1 = { sizeof(struct Frame), offsetof(struct Frame, _asn_ctx), .tag2el = asn_MAP_Frame_tag2el_1, .tag2el_count = 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 2, /* First extension addition */ }; asn_TYPE_descriptor_t asn_DEF_Frame = { "Frame", "Frame", &asn_OP_SEQUENCE, asn_DEF_Frame_tags_1, sizeof(asn_DEF_Frame_tags_1) /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */ asn_DEF_Frame_tags_1, /* Same as above */ sizeof(asn_DEF_Frame_tags_1) /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */ { 0, 0, SEQUENCE_constraint }, asn_MBR_Frame_1, 2, /* Elements count */ &asn_SPC_Frame_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [ConstrainedInteger] >>> ***/ #include /*** <<< TYPE-DECLS [ConstrainedInteger] >>> ***/ typedef long ConstrainedInteger_t; /*** <<< FUNC-DECLS [ConstrainedInteger] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ConstrainedInteger; asn_struct_free_f ConstrainedInteger_free; asn_struct_print_f ConstrainedInteger_print; asn_constr_check_f ConstrainedInteger_constraint; ber_type_decoder_f ConstrainedInteger_decode_ber; der_type_encoder_f ConstrainedInteger_encode_der; xer_type_decoder_f ConstrainedInteger_decode_xer; xer_type_encoder_f ConstrainedInteger_encode_xer; /*** <<< CODE [ConstrainedInteger] >>> ***/ int ConstrainedInteger_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { ASN__CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 0 && value <= 32767)) { /* Constraint check succeeded */ return 0; } else { ASN__CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ /*** <<< STAT-DEFS [ConstrainedInteger] >>> ***/ static const ber_tlv_tag_t asn_DEF_ConstrainedInteger_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_ConstrainedInteger = { "ConstrainedInteger", "ConstrainedInteger", &asn_OP_NativeInteger, asn_DEF_ConstrainedInteger_tags_1, sizeof(asn_DEF_ConstrainedInteger_tags_1) /sizeof(asn_DEF_ConstrainedInteger_tags_1[0]), /* 1 */ asn_DEF_ConstrainedInteger_tags_1, /* Same as above */ sizeof(asn_DEF_ConstrainedInteger_tags_1) /sizeof(asn_DEF_ConstrainedInteger_tags_1[0]), /* 1 */ { 0, 0, ConstrainedInteger_constraint }, 0, 0, /* No members */ 0 /* No specifics */ }; /*** <<< INCLUDES [PrimitiveMessage] >>> ***/ #include /*** <<< TYPE-DECLS [PrimitiveMessage] >>> ***/ typedef struct PrimitiveMessage { /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } PrimitiveMessage_t; /*** <<< FUNC-DECLS [PrimitiveMessage] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage; extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1; /*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/ static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1 = { sizeof(struct PrimitiveMessage), offsetof(struct PrimitiveMessage, _asn_ctx), 0, /* No top level tags */ 0, /* No tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* First extension addition */ }; asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = { "PrimitiveMessage", "PrimitiveMessage", &asn_OP_SEQUENCE, asn_DEF_PrimitiveMessage_tags_1, sizeof(asn_DEF_PrimitiveMessage_tags_1) /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */ asn_DEF_PrimitiveMessage_tags_1, /* Same as above */ sizeof(asn_DEF_PrimitiveMessage_tags_1) /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */ { 0, 0, SEQUENCE_constraint }, 0, 0, /* No members */ &asn_SPC_PrimitiveMessage_specs_1 /* Additional specs */ }; /*** <<< INCLUDES [ComplexMessage] >>> ***/ #include /*** <<< TYPE-DECLS [ComplexMessage] >>> ***/ typedef struct ComplexMessage { /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ComplexMessage_t; /*** <<< FUNC-DECLS [ComplexMessage] >>> ***/ extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage; extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1; /*** <<< STAT-DEFS [ComplexMessage] >>> ***/ static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1 = { sizeof(struct ComplexMessage), offsetof(struct ComplexMessage, _asn_ctx), 0, /* No top level tags */ 0, /* No tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* First extension addition */ }; asn_TYPE_descriptor_t asn_DEF_ComplexMessage = { "ComplexMessage", "ComplexMessage", &asn_OP_SEQUENCE, asn_DEF_ComplexMessage_tags_1, sizeof(asn_DEF_ComplexMessage_tags_1) /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */ asn_DEF_ComplexMessage_tags_1, /* Same as above */ sizeof(asn_DEF_ComplexMessage_tags_1) /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */ { 0, 0, SEQUENCE_constraint }, 0, 0, /* No members */ &asn_SPC_ComplexMessage_specs_1 /* Additional specs */ }; /*** <<< asn_constant.h >>> ***/ /* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) */ #ifndef _ASN_CONSTANT_H #define _ASN_CONSTANT_H #ifdef __cplusplus extern "C" { #endif #define primMessage (1) #define cplxMessage (2) #ifdef __cplusplus } #endif #endif /* _ASN_CONSTANT_H */