Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 1 | |
| 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 Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 9 | #include <OPEN_TYPE.h> |
| 10 | #include <constr_CHOICE.h> |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 11 | #include <constr_SEQUENCE.h> |
| 12 | |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 13 | /*** <<< DEPS [Frame] >>> ***/ |
| 14 | |
| 15 | typedef enum value_PR { |
| 16 | value_PR_NOTHING, /* No components present */ |
| 17 | value_PR_PrimitiveMessage, |
| 18 | value_PR_ComplexMessage |
| 19 | } value_PR; |
| 20 | |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 21 | /*** <<< TYPE-DECLS [Frame] >>> ***/ |
| 22 | |
| 23 | typedef struct Frame { |
| 24 | long ident; |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 25 | 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 Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 35 | /* |
| 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 | |
| 46 | extern asn_TYPE_descriptor_t asn_DEF_Frame; |
| 47 | |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 48 | /*** <<< IOC-TABLES [Frame] >>> ***/ |
| 49 | |
Lev Walkin | d357f3d | 2017-08-10 17:40:37 -0700 | [diff] [blame] | 50 | static const long asn_VAL_1_basicMessage = 1; |
| 51 | static const long asn_VAL_2_2 = 2; |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 52 | static const asn_ioc_cell_t asn_IOS_FrameTypes_1_rows[] = { |
Lev Walkin | d357f3d | 2017-08-10 17:40:37 -0700 | [diff] [blame] | 53 | { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_1_basicMessage }, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 54 | { "&Type", aioc__type, &asn_DEF_PrimitiveMessage }, |
Lev Walkin | d357f3d | 2017-08-10 17:40:37 -0700 | [diff] [blame] | 55 | { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_2_2 }, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 56 | { "&Type", aioc__type, &asn_DEF_ComplexMessage } |
| 57 | }; |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 58 | static const asn_ioc_set_t asn_IOS_FrameTypes_1[] = { |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 59 | 2, 2, asn_IOS_FrameTypes_1_rows |
| 60 | }; |
| 61 | |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 62 | /*** <<< CODE [Frame] >>> ***/ |
| 63 | |
| 64 | static int |
| 65 | memb_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 Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 83 | static asn_type_selector_result_t |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 84 | select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 85 | asn_type_selector_result_t result = {0, 0}; |
| 86 | const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1; |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 87 | 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 Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 93 | 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, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 96 | if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) { |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 97 | result.type_descriptor = type_cell->type_descriptor; |
| 98 | result.presence_index = row + 1; |
| 99 | break; |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 100 | } |
| 101 | } |
| 102 | |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 103 | return result; |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 104 | } |
| 105 | |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 106 | static int |
| 107 | memb_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 Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 128 | static 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 | }; |
| 152 | static 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 | }; |
| 156 | static 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 Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 161 | .tag2el = asn_MAP_value_tag2el_3, |
| 162 | .tag2el_count = 2, /* Count of tags in the map */ |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 163 | .canonical_order = 0, |
| 164 | .ext_start = -1 /* Extensions start */ |
| 165 | }; |
| 166 | static /* Use -fall-defs-global to expose */ |
| 167 | asn_TYPE_descriptor_t asn_DEF_value_3 = { |
| 168 | "value", |
| 169 | "value", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 170 | &asn_OP_OPEN_TYPE, |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 171 | OPEN_TYPE_constraint, |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 172 | 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 Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 183 | static 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 Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 188 | .type_selector = 0, |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 189 | .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 Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 198 | .type = &asn_DEF_value_3, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 199 | .type_selector = select_value_type, |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 200 | .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 | }; |
| 207 | static const ber_tlv_tag_t asn_DEF_Frame_tags_1[] = { |
| 208 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 209 | }; |
| 210 | static const asn_TYPE_tag2member_t asn_MAP_Frame_tag2el_1[] = { |
| 211 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* ident */ |
| 212 | }; |
| 213 | static asn_SEQUENCE_specifics_t asn_SPC_Frame_specs_1 = { |
| 214 | sizeof(struct Frame), |
| 215 | offsetof(struct Frame, _asn_ctx), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 216 | .tag2el = asn_MAP_Frame_tag2el_1, |
| 217 | .tag2el_count = 1, /* Count of tags in the map */ |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 218 | 0, 0, 0, /* Optional elements (not needed) */ |
| 219 | 1, /* Start extensions */ |
| 220 | 3 /* Stop extensions */ |
| 221 | }; |
| 222 | asn_TYPE_descriptor_t asn_DEF_Frame = { |
| 223 | "Frame", |
| 224 | "Frame", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 225 | &asn_OP_SEQUENCE, |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 226 | SEQUENCE_constraint, |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 227 | 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 | |
| 247 | typedef 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 | |
| 255 | extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage; |
| 256 | extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1; |
| 257 | |
| 258 | /*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/ |
| 259 | |
| 260 | static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = { |
| 261 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 262 | }; |
| 263 | asn_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 | }; |
| 272 | asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = { |
| 273 | "PrimitiveMessage", |
| 274 | "PrimitiveMessage", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 275 | &asn_OP_SEQUENCE, |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 276 | SEQUENCE_constraint, |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 277 | 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 | |
| 296 | typedef 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 | |
| 304 | extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage; |
| 305 | extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1; |
| 306 | |
| 307 | /*** <<< STAT-DEFS [ComplexMessage] >>> ***/ |
| 308 | |
| 309 | static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = { |
| 310 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 311 | }; |
| 312 | asn_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 | }; |
| 321 | asn_TYPE_descriptor_t asn_DEF_ComplexMessage = { |
| 322 | "ComplexMessage", |
| 323 | "ComplexMessage", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 324 | &asn_OP_SEQUENCE, |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 325 | SEQUENCE_constraint, |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 326 | 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 | |