Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Message] >>> ***/ |
| 3 | |
| 4 | #include "SpecializedContent.h" |
| 5 | #include <constr_SEQUENCE.h> |
| 6 | |
| 7 | /*** <<< TYPE-DECLS [Message] >>> ***/ |
| 8 | |
| 9 | typedef struct Message { |
| 10 | SpecializedContent_30P0_t content; |
| 11 | |
| 12 | /* Context for parsing across buffer boundaries */ |
| 13 | asn_struct_ctx_t _asn_ctx; |
| 14 | } Message_t; |
| 15 | |
| 16 | /*** <<< FUNC-DECLS [Message] >>> ***/ |
| 17 | |
| 18 | extern asn_TYPE_descriptor_t asn_DEF_Message; |
| 19 | |
| 20 | /*** <<< STAT-DEFS [Message] >>> ***/ |
| 21 | |
| 22 | static asn_TYPE_member_t asn_MBR_Message_1[] = { |
| 23 | { ATF_NOFLAGS, 0, offsetof(struct Message, content), |
| 24 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 25 | .tag_mode = 0, |
| 26 | .type = &asn_DEF_SpecializedContent_30P0, |
| 27 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 28 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 29 | .default_value = 0, |
| 30 | .name = "content" |
| 31 | }, |
| 32 | }; |
| 33 | static const ber_tlv_tag_t asn_DEF_Message_tags_1[] = { |
| 34 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 35 | }; |
| 36 | static const asn_TYPE_tag2member_t asn_MAP_Message_tag2el_1[] = { |
| 37 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* content */ |
| 38 | }; |
| 39 | static asn_SEQUENCE_specifics_t asn_SPC_Message_specs_1 = { |
| 40 | sizeof(struct Message), |
| 41 | offsetof(struct Message, _asn_ctx), |
| 42 | .tag2el = asn_MAP_Message_tag2el_1, |
| 43 | .tag2el_count = 1, /* Count of tags in the map */ |
| 44 | 0, 0, 0, /* Optional elements (not needed) */ |
| 45 | -1, /* Start extensions */ |
| 46 | -1 /* Stop extensions */ |
| 47 | }; |
| 48 | asn_TYPE_descriptor_t asn_DEF_Message = { |
| 49 | "Message", |
| 50 | "Message", |
| 51 | &asn_OP_SEQUENCE, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 52 | asn_DEF_Message_tags_1, |
| 53 | sizeof(asn_DEF_Message_tags_1) |
| 54 | /sizeof(asn_DEF_Message_tags_1[0]), /* 1 */ |
| 55 | asn_DEF_Message_tags_1, /* Same as above */ |
| 56 | sizeof(asn_DEF_Message_tags_1) |
| 57 | /sizeof(asn_DEF_Message_tags_1[0]), /* 1 */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 58 | { 0, 0, SEQUENCE_constraint }, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 59 | asn_MBR_Message_1, |
| 60 | 1, /* Elements count */ |
| 61 | &asn_SPC_Message_specs_1 /* Additional specs */ |
| 62 | }; |
| 63 | |
| 64 | |
| 65 | /*** <<< INCLUDES [SpecializedContent] >>> ***/ |
| 66 | |
| 67 | #include <NativeInteger.h> |
| 68 | #include <ANY.h> |
| 69 | #include <asn_ioc.h> |
| 70 | #include <OPEN_TYPE.h> |
| 71 | #include <BOOLEAN.h> |
| 72 | #include <constr_CHOICE.h> |
| 73 | #include <constr_SEQUENCE.h> |
| 74 | |
| 75 | /*** <<< DEPS [SpecializedContent] >>> ***/ |
| 76 | |
| 77 | typedef enum value_PR { |
| 78 | value_PR_NOTHING, /* No components present */ |
| 79 | value_PR_INTEGER, |
| 80 | value_PR_BOOLEAN |
| 81 | } value_PR; |
| 82 | |
| 83 | /*** <<< TYPE-DECLS [SpecializedContent] >>> ***/ |
| 84 | |
| 85 | typedef struct SpecializedContent_30P0 { |
| 86 | long id; |
| 87 | struct value { |
| 88 | value_PR present; |
| 89 | union value_u { |
| 90 | long INTEGER; |
| 91 | BOOLEAN_t BOOLEAN; |
| 92 | } choice; |
| 93 | |
| 94 | /* Context for parsing across buffer boundaries */ |
| 95 | asn_struct_ctx_t _asn_ctx; |
| 96 | } value; |
| 97 | |
| 98 | /* Context for parsing across buffer boundaries */ |
| 99 | asn_struct_ctx_t _asn_ctx; |
| 100 | } SpecializedContent_30P0_t; |
| 101 | |
| 102 | /*** <<< FUNC-DECLS [SpecializedContent] >>> ***/ |
| 103 | |
| 104 | extern asn_TYPE_descriptor_t asn_DEF_SpecializedContent_30P0; |
| 105 | extern asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_30P0_specs_1; |
| 106 | extern asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[2]; |
| 107 | |
| 108 | /*** <<< IOC-TABLES [SpecializedContent] >>> ***/ |
| 109 | |
| 110 | static const long asn_VAL_1_1 = 1; |
| 111 | static const long asn_VAL_2_2 = 2; |
| 112 | static const asn_ioc_cell_t asn_IOS_RegionalExtension_1_rows[] = { |
| 113 | { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_1_1 }, |
| 114 | { "&Type", , |
| 115 | { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_2_2 }, |
| 116 | { "&Type", |
| 117 | }; |
| 118 | static const asn_ioc_set_t asn_IOS_RegionalExtension_1[] = { |
| 119 | 2, 2, asn_IOS_RegionalExtension_1_rows |
| 120 | }; |
| 121 | |
| 122 | /*** <<< CODE [SpecializedContent] >>> ***/ |
| 123 | |
| 124 | static int |
| 125 | memb_id_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 126 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 127 | |
| 128 | if(!sptr) { |
| 129 | ASN__CTFAIL(app_key, td, sptr, |
| 130 | "%s: value not given (%s:%d)", |
| 131 | td->name, __FILE__, __LINE__); |
| 132 | return -1; |
| 133 | } |
| 134 | |
| 135 | |
| 136 | if(1 /* No applicable constraints whatsoever */) { |
| 137 | /* Nothing is here. See below */ |
| 138 | } |
| 139 | |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 140 | return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | static asn_type_selector_result_t |
| 144 | select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { |
| 145 | asn_type_selector_result_t result = {0, 0}; |
| 146 | const asn_ioc_set_t *itable = asn_IOS_RegionalExtension_1; |
| 147 | size_t constraining_column = 0; /* &id */ |
| 148 | size_t for_column = 1; /* &Type */ |
| 149 | size_t row; |
| 150 | const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SpecializedContent_30P0, id)); |
| 151 | |
| 152 | for(row=0; row < itable->rows_count; row++) { |
| 153 | const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column]; |
| 154 | const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column]; |
| 155 | |
| 156 | if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) { |
| 157 | result.type_descriptor = type_cell->type_descriptor; |
| 158 | result.presence_index = row + 1; |
| 159 | break; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | return result; |
| 164 | } |
| 165 | |
| 166 | static int |
| 167 | memb_value_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 168 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 169 | |
| 170 | if(!sptr) { |
| 171 | ASN__CTFAIL(app_key, td, sptr, |
| 172 | "%s: value not given (%s:%d)", |
| 173 | td->name, __FILE__, __LINE__); |
| 174 | return -1; |
| 175 | } |
| 176 | |
| 177 | |
| 178 | if(1 /* No applicable constraints whatsoever */) { |
| 179 | /* Nothing is here. See below */ |
| 180 | } |
| 181 | |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 182 | return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | |
| 186 | /*** <<< CTDEFS [SpecializedContent] >>> ***/ |
| 187 | |
Lev Walkin | 0479e04 | 2017-09-26 18:39:58 -0700 | [diff] [blame] | 188 | static asn_per_constraints_t asn_PER_memb_id_constr_2 CC_NOTUSED = { |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 189 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 190 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 191 | 0, 0 /* No PER value map */ |
| 192 | }; |
Lev Walkin | 0479e04 | 2017-09-26 18:39:58 -0700 | [diff] [blame] | 193 | static asn_per_constraints_t asn_PER_memb_value_constr_3 CC_NOTUSED = { |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 194 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 195 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 196 | 0, 0 /* No PER value map */ |
| 197 | }; |
| 198 | |
| 199 | /*** <<< STAT-DEFS [SpecializedContent] >>> ***/ |
| 200 | |
| 201 | static asn_TYPE_member_t asn_MBR_value_3[] = { |
| 202 | { ATF_NOFLAGS, 0, offsetof(struct value, choice.INTEGER), |
| 203 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 204 | .tag_mode = 0, |
| 205 | .type = &asn_DEF_NativeInteger, |
| 206 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 207 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 208 | .default_value = 0, |
| 209 | .name = "INTEGER" |
| 210 | }, |
| 211 | { ATF_NOFLAGS, 0, offsetof(struct value, choice.BOOLEAN), |
| 212 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 213 | .tag_mode = 0, |
| 214 | .type = &asn_DEF_BOOLEAN, |
| 215 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 216 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 217 | .default_value = 0, |
| 218 | .name = "BOOLEAN" |
| 219 | }, |
| 220 | }; |
| 221 | static const unsigned asn_MAP_value_cmap_3[] = { 1, 0 }; |
| 222 | static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_3[] = { |
| 223 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* BOOLEAN */ |
| 224 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* INTEGER */ |
| 225 | }; |
| 226 | static asn_CHOICE_specifics_t asn_SPC_value_specs_3 = { |
| 227 | sizeof(struct value), |
| 228 | offsetof(struct value, _asn_ctx), |
| 229 | offsetof(struct value, present), |
| 230 | sizeof(((struct value *)0)->present), |
| 231 | .tag2el = asn_MAP_value_tag2el_3, |
| 232 | .tag2el_count = 2, /* Count of tags in the map */ |
| 233 | .canonical_order = asn_MAP_value_cmap_3, /* Canonically sorted */ |
| 234 | .ext_start = -1 /* Extensions start */ |
| 235 | }; |
| 236 | static /* Use -fall-defs-global to expose */ |
| 237 | asn_TYPE_descriptor_t asn_DEF_value_3 = { |
| 238 | "value", |
| 239 | "value", |
| 240 | &asn_OP_OPEN_TYPE, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 241 | 0, /* No effective tags (pointer) */ |
| 242 | 0, /* No effective tags (count) */ |
| 243 | 0, /* No tags (pointer) */ |
| 244 | 0, /* No tags (count) */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 245 | { 0, 0, OPEN_TYPE_constraint }, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 246 | asn_MBR_value_3, |
| 247 | 2, /* Elements count */ |
| 248 | &asn_SPC_value_specs_3 /* Additional specs */ |
| 249 | }; |
| 250 | |
| 251 | asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = { |
| 252 | { ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_30P0, id), |
| 253 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 254 | .tag_mode = 0, |
| 255 | .type = &asn_DEF_NativeInteger, |
| 256 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 257 | { .oer_constraints = 0, .per_constraints = &asn_PER_memb_id_constr_2, .general_constraints = memb_id_constraint_1 }, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 258 | .default_value = 0, |
| 259 | .name = "id" |
| 260 | }, |
| 261 | { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_30P0, value), |
| 262 | .tag = -1 /* Ambiguous tag (ANY?) */, |
| 263 | .tag_mode = 0, |
| 264 | .type = &asn_DEF_value_3, |
| 265 | .type_selector = select_value_type, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 266 | { .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_3, .general_constraints = memb_value_constraint_1 }, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 267 | .default_value = 0, |
| 268 | .name = "value" |
| 269 | }, |
| 270 | }; |
| 271 | static const ber_tlv_tag_t asn_DEF_SpecializedContent_30P0_tags_1[] = { |
| 272 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 273 | }; |
| 274 | static const asn_TYPE_tag2member_t asn_MAP_SpecializedContent_30P0_tag2el_1[] = { |
| 275 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */ |
| 276 | }; |
| 277 | asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_30P0_specs_1 = { |
| 278 | sizeof(struct SpecializedContent_30P0), |
| 279 | offsetof(struct SpecializedContent_30P0, _asn_ctx), |
| 280 | .tag2el = asn_MAP_SpecializedContent_30P0_tag2el_1, |
| 281 | .tag2el_count = 1, /* Count of tags in the map */ |
| 282 | 0, 0, 0, /* Optional elements (not needed) */ |
| 283 | -1, /* Start extensions */ |
| 284 | -1 /* Stop extensions */ |
| 285 | }; |
| 286 | asn_TYPE_descriptor_t asn_DEF_SpecializedContent_30P0 = { |
| 287 | "SpecializedContent", |
| 288 | "SpecializedContent", |
| 289 | &asn_OP_SEQUENCE, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 290 | asn_DEF_SpecializedContent_30P0_tags_1, |
| 291 | sizeof(asn_DEF_SpecializedContent_30P0_tags_1) |
| 292 | /sizeof(asn_DEF_SpecializedContent_30P0_tags_1[0]), /* 1 */ |
| 293 | asn_DEF_SpecializedContent_30P0_tags_1, /* Same as above */ |
| 294 | sizeof(asn_DEF_SpecializedContent_30P0_tags_1) |
| 295 | /sizeof(asn_DEF_SpecializedContent_30P0_tags_1[0]), /* 1 */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame^] | 296 | { 0, 0, SEQUENCE_constraint }, |
Lev Walkin | 20dc624 | 2017-08-27 23:44:39 -0700 | [diff] [blame] | 297 | asn_MBR_SpecializedContent_30P0_1, |
| 298 | 2, /* Elements count */ |
| 299 | &asn_SPC_SpecializedContent_30P0_specs_1 /* Additional specs */ |
| 300 | }; |
| 301 | |