Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -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 | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 29 | 0, 0, /* No default value */ |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 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), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 42 | .tag2el = asn_MAP_Message_tag2el_1, |
| 43 | .tag2el_count = 1, /* Count of tags in the map */ |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 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", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 51 | &asn_OP_SEQUENCE, |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -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 | d8e07c5 | 2017-08-23 07:38:30 -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 |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 125 | memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 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 | d8e07c5 | 2017-08-23 07:38:30 -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 | |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 156 | if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) { |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 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 |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 167 | memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 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 | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | |
| 186 | /*** <<< STAT-DEFS [SpecializedContent] >>> ***/ |
| 187 | |
| 188 | static asn_TYPE_member_t asn_MBR_value_3[] = { |
| 189 | { ATF_NOFLAGS, 0, offsetof(struct value, choice.INTEGER), |
| 190 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 191 | .tag_mode = 0, |
| 192 | .type = &asn_DEF_NativeInteger, |
| 193 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 194 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 195 | 0, 0, /* No default value */ |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 196 | .name = "INTEGER" |
| 197 | }, |
| 198 | { ATF_NOFLAGS, 0, offsetof(struct value, choice.BOOLEAN), |
| 199 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 200 | .tag_mode = 0, |
| 201 | .type = &asn_DEF_BOOLEAN, |
| 202 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 203 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 204 | 0, 0, /* No default value */ |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 205 | .name = "BOOLEAN" |
| 206 | }, |
| 207 | }; |
| 208 | static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_3[] = { |
| 209 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* BOOLEAN */ |
| 210 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* INTEGER */ |
| 211 | }; |
| 212 | static asn_CHOICE_specifics_t asn_SPC_value_specs_3 = { |
| 213 | sizeof(struct value), |
| 214 | offsetof(struct value, _asn_ctx), |
| 215 | offsetof(struct value, present), |
| 216 | sizeof(((struct value *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 217 | .tag2el = asn_MAP_value_tag2el_3, |
| 218 | .tag2el_count = 2, /* Count of tags in the map */ |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 219 | 0, 0, |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 220 | .ext_start = -1 /* Extensions start */ |
| 221 | }; |
| 222 | static /* Use -fall-defs-global to expose */ |
| 223 | asn_TYPE_descriptor_t asn_DEF_value_3 = { |
| 224 | "value", |
| 225 | "value", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 226 | &asn_OP_OPEN_TYPE, |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 227 | 0, /* No effective tags (pointer) */ |
| 228 | 0, /* No effective tags (count) */ |
| 229 | 0, /* No tags (pointer) */ |
| 230 | 0, /* No tags (count) */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 231 | { 0, 0, OPEN_TYPE_constraint }, |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 232 | asn_MBR_value_3, |
| 233 | 2, /* Elements count */ |
| 234 | &asn_SPC_value_specs_3 /* Additional specs */ |
| 235 | }; |
| 236 | |
| 237 | asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = { |
| 238 | { ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_30P0, id), |
| 239 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 240 | .tag_mode = 0, |
| 241 | .type = &asn_DEF_NativeInteger, |
| 242 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 243 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_id_constraint_1 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 244 | 0, 0, /* No default value */ |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 245 | .name = "id" |
| 246 | }, |
| 247 | { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_30P0, value), |
| 248 | .tag = -1 /* Ambiguous tag (ANY?) */, |
| 249 | .tag_mode = 0, |
| 250 | .type = &asn_DEF_value_3, |
| 251 | .type_selector = select_value_type, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 252 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 253 | 0, 0, /* No default value */ |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 254 | .name = "value" |
| 255 | }, |
| 256 | }; |
| 257 | static const ber_tlv_tag_t asn_DEF_SpecializedContent_30P0_tags_1[] = { |
| 258 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 259 | }; |
| 260 | static const asn_TYPE_tag2member_t asn_MAP_SpecializedContent_30P0_tag2el_1[] = { |
| 261 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */ |
| 262 | }; |
| 263 | asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_30P0_specs_1 = { |
| 264 | sizeof(struct SpecializedContent_30P0), |
| 265 | offsetof(struct SpecializedContent_30P0, _asn_ctx), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 266 | .tag2el = asn_MAP_SpecializedContent_30P0_tag2el_1, |
| 267 | .tag2el_count = 1, /* Count of tags in the map */ |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 268 | 0, 0, 0, /* Optional elements (not needed) */ |
| 269 | -1, /* Start extensions */ |
| 270 | -1 /* Stop extensions */ |
| 271 | }; |
| 272 | asn_TYPE_descriptor_t asn_DEF_SpecializedContent_30P0 = { |
| 273 | "SpecializedContent", |
| 274 | "SpecializedContent", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 275 | &asn_OP_SEQUENCE, |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 276 | asn_DEF_SpecializedContent_30P0_tags_1, |
| 277 | sizeof(asn_DEF_SpecializedContent_30P0_tags_1) |
| 278 | /sizeof(asn_DEF_SpecializedContent_30P0_tags_1[0]), /* 1 */ |
| 279 | asn_DEF_SpecializedContent_30P0_tags_1, /* Same as above */ |
| 280 | sizeof(asn_DEF_SpecializedContent_30P0_tags_1) |
| 281 | /sizeof(asn_DEF_SpecializedContent_30P0_tags_1[0]), /* 1 */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 282 | { 0, 0, SEQUENCE_constraint }, |
Lev Walkin | d8e07c5 | 2017-08-23 07:38:30 -0700 | [diff] [blame] | 283 | asn_MBR_SpecializedContent_30P0_1, |
| 284 | 2, /* Elements count */ |
| 285 | &asn_SPC_SpecializedContent_30P0_specs_1 /* Additional specs */ |
| 286 | }; |
| 287 | |