Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Enum1] >>> ***/ |
| 3 | |
| 4 | #include <ENUMERATED.h> |
| 5 | |
| 6 | /*** <<< DEPS [Enum1] >>> ***/ |
| 7 | |
| 8 | typedef enum Enum1 { |
| 9 | Enum1_red = 0, |
| 10 | Enum1_green = 1, |
| 11 | Enum1_blue = 4, |
| 12 | Enum1_alpha = 5 |
| 13 | /* |
| 14 | * Enumeration is extensible |
| 15 | */ |
| 16 | } e_Enum1; |
| 17 | |
| 18 | /*** <<< TYPE-DECLS [Enum1] >>> ***/ |
| 19 | |
| 20 | typedef ENUMERATED_t Enum1_t; |
| 21 | |
| 22 | /*** <<< FUNC-DECLS [Enum1] >>> ***/ |
| 23 | |
| 24 | extern asn_TYPE_descriptor_t asn_DEF_Enum1; |
| 25 | asn_struct_free_f Enum1_free; |
| 26 | asn_struct_print_f Enum1_print; |
| 27 | asn_constr_check_f Enum1_constraint; |
| 28 | ber_type_decoder_f Enum1_decode_ber; |
| 29 | der_type_encoder_f Enum1_encode_der; |
| 30 | xer_type_decoder_f Enum1_decode_xer; |
| 31 | xer_type_encoder_f Enum1_encode_xer; |
| 32 | |
| 33 | /*** <<< CODE [Enum1] >>> ***/ |
| 34 | |
| 35 | int |
| 36 | Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 37 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 38 | /* Replace with underlying type checker */ |
| 39 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
| 40 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
| 41 | } |
| 42 | |
| 43 | /* |
| 44 | * This type is implemented using ENUMERATED, |
| 45 | * so here we adjust the DEF accordingly. |
| 46 | */ |
| 47 | static void |
| 48 | Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 49 | td->free_struct = asn_DEF_ENUMERATED.free_struct; |
| 50 | td->print_struct = asn_DEF_ENUMERATED.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 51 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 52 | td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; |
| 53 | td->der_encoder = asn_DEF_ENUMERATED.der_encoder; |
| 54 | td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; |
| 55 | td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; |
| 56 | td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; |
| 57 | td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 58 | td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder; |
| 59 | td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 60 | if(!td->oer_constraints) |
| 61 | td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 62 | if(!td->per_constraints) |
| 63 | td->per_constraints = asn_DEF_ENUMERATED.per_constraints; |
| 64 | td->elements = asn_DEF_ENUMERATED.elements; |
| 65 | td->elements_count = asn_DEF_ENUMERATED.elements_count; |
| 66 | /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ |
| 67 | } |
| 68 | |
| 69 | void |
| 70 | Enum1_free(asn_TYPE_descriptor_t *td, |
| 71 | void *struct_ptr, int contents_only) { |
| 72 | Enum1_1_inherit_TYPE_descriptor(td); |
| 73 | td->free_struct(td, struct_ptr, contents_only); |
| 74 | } |
| 75 | |
| 76 | int |
| 77 | Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 78 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 79 | Enum1_1_inherit_TYPE_descriptor(td); |
| 80 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 81 | } |
| 82 | |
| 83 | asn_dec_rval_t |
| 84 | Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 85 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 86 | Enum1_1_inherit_TYPE_descriptor(td); |
| 87 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 88 | } |
| 89 | |
| 90 | asn_enc_rval_t |
| 91 | Enum1_encode_der(asn_TYPE_descriptor_t *td, |
| 92 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 93 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 94 | Enum1_1_inherit_TYPE_descriptor(td); |
| 95 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 96 | } |
| 97 | |
| 98 | asn_dec_rval_t |
| 99 | Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 100 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 101 | Enum1_1_inherit_TYPE_descriptor(td); |
| 102 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 103 | } |
| 104 | |
| 105 | asn_enc_rval_t |
| 106 | Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 107 | int ilevel, enum xer_encoder_flags_e flags, |
| 108 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 109 | Enum1_1_inherit_TYPE_descriptor(td); |
| 110 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 111 | } |
| 112 | |
| 113 | |
| 114 | /*** <<< STAT-DEFS [Enum1] >>> ***/ |
| 115 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 116 | static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 117 | { 0, 3, "red" }, |
| 118 | { 1, 5, "green" }, |
| 119 | { 4, 4, "blue" }, |
| 120 | { 5, 5, "alpha" } |
| 121 | /* This list is extensible */ |
| 122 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 123 | static const unsigned int asn_MAP_Enum1_enum2value_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 124 | 3, /* alpha(5) */ |
| 125 | 2, /* blue(4) */ |
| 126 | 1, /* green(1) */ |
| 127 | 0 /* red(0) */ |
| 128 | /* This list is extensible */ |
| 129 | }; |
johvik | e70c407 | 2017-05-09 11:06:12 +0200 | [diff] [blame] | 130 | static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 131 | asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */ |
| 132 | asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */ |
| 133 | 4, /* Number of elements in the maps */ |
| 134 | 5, /* Extensions before this member */ |
| 135 | 1, /* Strict enumeration */ |
| 136 | 0, /* Native long size */ |
| 137 | 0 |
| 138 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 139 | static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 140 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 141 | }; |
| 142 | asn_TYPE_descriptor_t asn_DEF_Enum1 = { |
| 143 | "Enum1", |
| 144 | "Enum1", |
| 145 | Enum1_free, |
| 146 | Enum1_print, |
| 147 | Enum1_constraint, |
| 148 | Enum1_decode_ber, |
| 149 | Enum1_encode_der, |
| 150 | Enum1_decode_xer, |
| 151 | Enum1_encode_xer, |
Lev Walkin | a46ab9c | 2017-07-06 07:57:15 -0700 | [diff] [blame] | 152 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 153 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 154 | 0, /* Use generic outmost tag fetcher */ |
| 155 | asn_DEF_Enum1_tags_1, |
| 156 | sizeof(asn_DEF_Enum1_tags_1) |
| 157 | /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ |
| 158 | asn_DEF_Enum1_tags_1, /* Same as above */ |
| 159 | sizeof(asn_DEF_Enum1_tags_1) |
| 160 | /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 161 | 0, /* No OER visible constraints */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 162 | 0, /* No PER visible constraints */ |
| 163 | 0, 0, /* Defined elsewhere */ |
| 164 | &asn_SPC_Enum1_specs_1 /* Additional specs */ |
| 165 | }; |
| 166 | |
| 167 | |
| 168 | /*** <<< INCLUDES [Enum2] >>> ***/ |
| 169 | |
| 170 | #include <ENUMERATED.h> |
| 171 | |
| 172 | /*** <<< DEPS [Enum2] >>> ***/ |
| 173 | |
| 174 | typedef enum Enum2 { |
| 175 | Enum2_red = 0, |
| 176 | Enum2_green = 1, |
| 177 | Enum2_blue = 45, |
| 178 | Enum2_orange = 23, |
| 179 | Enum2_alpha = 46, |
| 180 | /* |
| 181 | * Enumeration is extensible |
| 182 | */ |
| 183 | Enum2_beta = 12, |
| 184 | Enum2_gamma = 103 |
| 185 | } e_Enum2; |
| 186 | |
| 187 | /*** <<< TYPE-DECLS [Enum2] >>> ***/ |
| 188 | |
| 189 | typedef ENUMERATED_t Enum2_t; |
| 190 | |
| 191 | /*** <<< FUNC-DECLS [Enum2] >>> ***/ |
| 192 | |
| 193 | extern asn_TYPE_descriptor_t asn_DEF_Enum2; |
| 194 | asn_struct_free_f Enum2_free; |
| 195 | asn_struct_print_f Enum2_print; |
| 196 | asn_constr_check_f Enum2_constraint; |
| 197 | ber_type_decoder_f Enum2_decode_ber; |
| 198 | der_type_encoder_f Enum2_encode_der; |
| 199 | xer_type_decoder_f Enum2_decode_xer; |
| 200 | xer_type_encoder_f Enum2_encode_xer; |
| 201 | |
| 202 | /*** <<< CODE [Enum2] >>> ***/ |
| 203 | |
| 204 | int |
| 205 | Enum2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 206 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 207 | /* Replace with underlying type checker */ |
| 208 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
| 209 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
| 210 | } |
| 211 | |
| 212 | /* |
| 213 | * This type is implemented using ENUMERATED, |
| 214 | * so here we adjust the DEF accordingly. |
| 215 | */ |
| 216 | static void |
| 217 | Enum2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 218 | td->free_struct = asn_DEF_ENUMERATED.free_struct; |
| 219 | td->print_struct = asn_DEF_ENUMERATED.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 220 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 221 | td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; |
| 222 | td->der_encoder = asn_DEF_ENUMERATED.der_encoder; |
| 223 | td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; |
| 224 | td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; |
| 225 | td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; |
| 226 | td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 227 | td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder; |
| 228 | td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 229 | if(!td->oer_constraints) |
| 230 | td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 231 | if(!td->per_constraints) |
| 232 | td->per_constraints = asn_DEF_ENUMERATED.per_constraints; |
| 233 | td->elements = asn_DEF_ENUMERATED.elements; |
| 234 | td->elements_count = asn_DEF_ENUMERATED.elements_count; |
| 235 | /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ |
| 236 | } |
| 237 | |
| 238 | void |
| 239 | Enum2_free(asn_TYPE_descriptor_t *td, |
| 240 | void *struct_ptr, int contents_only) { |
| 241 | Enum2_1_inherit_TYPE_descriptor(td); |
| 242 | td->free_struct(td, struct_ptr, contents_only); |
| 243 | } |
| 244 | |
| 245 | int |
| 246 | Enum2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 247 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 248 | Enum2_1_inherit_TYPE_descriptor(td); |
| 249 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 250 | } |
| 251 | |
| 252 | asn_dec_rval_t |
| 253 | Enum2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 254 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 255 | Enum2_1_inherit_TYPE_descriptor(td); |
| 256 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 257 | } |
| 258 | |
| 259 | asn_enc_rval_t |
| 260 | Enum2_encode_der(asn_TYPE_descriptor_t *td, |
| 261 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 262 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 263 | Enum2_1_inherit_TYPE_descriptor(td); |
| 264 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 265 | } |
| 266 | |
| 267 | asn_dec_rval_t |
| 268 | Enum2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 269 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 270 | Enum2_1_inherit_TYPE_descriptor(td); |
| 271 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 272 | } |
| 273 | |
| 274 | asn_enc_rval_t |
| 275 | Enum2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 276 | int ilevel, enum xer_encoder_flags_e flags, |
| 277 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 278 | Enum2_1_inherit_TYPE_descriptor(td); |
| 279 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 280 | } |
| 281 | |
| 282 | |
| 283 | /*** <<< STAT-DEFS [Enum2] >>> ***/ |
| 284 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 285 | static const asn_INTEGER_enum_map_t asn_MAP_Enum2_value2enum_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 286 | { 0, 3, "red" }, |
| 287 | { 1, 5, "green" }, |
| 288 | { 12, 4, "beta" }, |
| 289 | { 23, 6, "orange" }, |
| 290 | { 45, 4, "blue" }, |
| 291 | { 46, 5, "alpha" }, |
| 292 | { 103, 5, "gamma" } |
| 293 | /* This list is extensible */ |
| 294 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 295 | static const unsigned int asn_MAP_Enum2_enum2value_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 296 | 5, /* alpha(46) */ |
| 297 | 2, /* beta(12) */ |
| 298 | 4, /* blue(45) */ |
| 299 | 6, /* gamma(103) */ |
| 300 | 1, /* green(1) */ |
| 301 | 3, /* orange(23) */ |
| 302 | 0 /* red(0) */ |
| 303 | /* This list is extensible */ |
| 304 | }; |
johvik | e70c407 | 2017-05-09 11:06:12 +0200 | [diff] [blame] | 305 | static asn_INTEGER_specifics_t asn_SPC_Enum2_specs_1 = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 306 | asn_MAP_Enum2_value2enum_1, /* "tag" => N; sorted by tag */ |
| 307 | asn_MAP_Enum2_enum2value_1, /* N => "tag"; sorted by N */ |
| 308 | 7, /* Number of elements in the maps */ |
| 309 | 6, /* Extensions before this member */ |
| 310 | 1, /* Strict enumeration */ |
| 311 | 0, /* Native long size */ |
| 312 | 0 |
| 313 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 314 | static const ber_tlv_tag_t asn_DEF_Enum2_tags_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 315 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 316 | }; |
| 317 | asn_TYPE_descriptor_t asn_DEF_Enum2 = { |
| 318 | "Enum2", |
| 319 | "Enum2", |
| 320 | Enum2_free, |
| 321 | Enum2_print, |
| 322 | Enum2_constraint, |
| 323 | Enum2_decode_ber, |
| 324 | Enum2_encode_der, |
| 325 | Enum2_decode_xer, |
| 326 | Enum2_encode_xer, |
Lev Walkin | a46ab9c | 2017-07-06 07:57:15 -0700 | [diff] [blame] | 327 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 328 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 329 | 0, /* Use generic outmost tag fetcher */ |
| 330 | asn_DEF_Enum2_tags_1, |
| 331 | sizeof(asn_DEF_Enum2_tags_1) |
| 332 | /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */ |
| 333 | asn_DEF_Enum2_tags_1, /* Same as above */ |
| 334 | sizeof(asn_DEF_Enum2_tags_1) |
| 335 | /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 336 | 0, /* No OER visible constraints */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 337 | 0, /* No PER visible constraints */ |
| 338 | 0, 0, /* Defined elsewhere */ |
| 339 | &asn_SPC_Enum2_specs_1 /* Additional specs */ |
| 340 | }; |
| 341 | |
| 342 | |
| 343 | /*** <<< INCLUDES [Enum3] >>> ***/ |
| 344 | |
| 345 | #include <ENUMERATED.h> |
| 346 | |
| 347 | /*** <<< DEPS [Enum3] >>> ***/ |
| 348 | |
| 349 | typedef enum Enum3 { |
| 350 | Enum3_a = 0, |
| 351 | Enum3_b = 3, |
| 352 | /* |
| 353 | * Enumeration is extensible |
| 354 | */ |
| 355 | Enum3_c = 1 |
| 356 | } e_Enum3; |
| 357 | |
| 358 | /*** <<< TYPE-DECLS [Enum3] >>> ***/ |
| 359 | |
| 360 | typedef ENUMERATED_t Enum3_t; |
| 361 | |
| 362 | /*** <<< FUNC-DECLS [Enum3] >>> ***/ |
| 363 | |
| 364 | extern asn_TYPE_descriptor_t asn_DEF_Enum3; |
| 365 | asn_struct_free_f Enum3_free; |
| 366 | asn_struct_print_f Enum3_print; |
| 367 | asn_constr_check_f Enum3_constraint; |
| 368 | ber_type_decoder_f Enum3_decode_ber; |
| 369 | der_type_encoder_f Enum3_encode_der; |
| 370 | xer_type_decoder_f Enum3_decode_xer; |
| 371 | xer_type_encoder_f Enum3_encode_xer; |
| 372 | |
| 373 | /*** <<< CODE [Enum3] >>> ***/ |
| 374 | |
| 375 | int |
| 376 | Enum3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 377 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 378 | /* Replace with underlying type checker */ |
| 379 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
| 380 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
| 381 | } |
| 382 | |
| 383 | /* |
| 384 | * This type is implemented using ENUMERATED, |
| 385 | * so here we adjust the DEF accordingly. |
| 386 | */ |
| 387 | static void |
| 388 | Enum3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 389 | td->free_struct = asn_DEF_ENUMERATED.free_struct; |
| 390 | td->print_struct = asn_DEF_ENUMERATED.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 391 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 392 | td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; |
| 393 | td->der_encoder = asn_DEF_ENUMERATED.der_encoder; |
| 394 | td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; |
| 395 | td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; |
| 396 | td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; |
| 397 | td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 398 | td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder; |
| 399 | td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 400 | if(!td->oer_constraints) |
| 401 | td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 402 | if(!td->per_constraints) |
| 403 | td->per_constraints = asn_DEF_ENUMERATED.per_constraints; |
| 404 | td->elements = asn_DEF_ENUMERATED.elements; |
| 405 | td->elements_count = asn_DEF_ENUMERATED.elements_count; |
| 406 | /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ |
| 407 | } |
| 408 | |
| 409 | void |
| 410 | Enum3_free(asn_TYPE_descriptor_t *td, |
| 411 | void *struct_ptr, int contents_only) { |
| 412 | Enum3_1_inherit_TYPE_descriptor(td); |
| 413 | td->free_struct(td, struct_ptr, contents_only); |
| 414 | } |
| 415 | |
| 416 | int |
| 417 | Enum3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 418 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 419 | Enum3_1_inherit_TYPE_descriptor(td); |
| 420 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 421 | } |
| 422 | |
| 423 | asn_dec_rval_t |
| 424 | Enum3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 425 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 426 | Enum3_1_inherit_TYPE_descriptor(td); |
| 427 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 428 | } |
| 429 | |
| 430 | asn_enc_rval_t |
| 431 | Enum3_encode_der(asn_TYPE_descriptor_t *td, |
| 432 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 433 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 434 | Enum3_1_inherit_TYPE_descriptor(td); |
| 435 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 436 | } |
| 437 | |
| 438 | asn_dec_rval_t |
| 439 | Enum3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 440 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 441 | Enum3_1_inherit_TYPE_descriptor(td); |
| 442 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 443 | } |
| 444 | |
| 445 | asn_enc_rval_t |
| 446 | Enum3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 447 | int ilevel, enum xer_encoder_flags_e flags, |
| 448 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 449 | Enum3_1_inherit_TYPE_descriptor(td); |
| 450 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 451 | } |
| 452 | |
| 453 | |
| 454 | /*** <<< STAT-DEFS [Enum3] >>> ***/ |
| 455 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 456 | static const asn_INTEGER_enum_map_t asn_MAP_Enum3_value2enum_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 457 | { 0, 1, "a" }, |
| 458 | { 1, 1, "c" }, |
| 459 | { 3, 1, "b" } |
| 460 | /* This list is extensible */ |
| 461 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 462 | static const unsigned int asn_MAP_Enum3_enum2value_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 463 | 0, /* a(0) */ |
| 464 | 2, /* b(3) */ |
| 465 | 1 /* c(1) */ |
| 466 | /* This list is extensible */ |
| 467 | }; |
johvik | e70c407 | 2017-05-09 11:06:12 +0200 | [diff] [blame] | 468 | static asn_INTEGER_specifics_t asn_SPC_Enum3_specs_1 = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 469 | asn_MAP_Enum3_value2enum_1, /* "tag" => N; sorted by tag */ |
| 470 | asn_MAP_Enum3_enum2value_1, /* N => "tag"; sorted by N */ |
| 471 | 3, /* Number of elements in the maps */ |
| 472 | 3, /* Extensions before this member */ |
| 473 | 1, /* Strict enumeration */ |
| 474 | 0, /* Native long size */ |
| 475 | 0 |
| 476 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 477 | static const ber_tlv_tag_t asn_DEF_Enum3_tags_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 478 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 479 | }; |
| 480 | asn_TYPE_descriptor_t asn_DEF_Enum3 = { |
| 481 | "Enum3", |
| 482 | "Enum3", |
| 483 | Enum3_free, |
| 484 | Enum3_print, |
| 485 | Enum3_constraint, |
| 486 | Enum3_decode_ber, |
| 487 | Enum3_encode_der, |
| 488 | Enum3_decode_xer, |
| 489 | Enum3_encode_xer, |
Lev Walkin | a46ab9c | 2017-07-06 07:57:15 -0700 | [diff] [blame] | 490 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 491 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 492 | 0, /* Use generic outmost tag fetcher */ |
| 493 | asn_DEF_Enum3_tags_1, |
| 494 | sizeof(asn_DEF_Enum3_tags_1) |
| 495 | /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */ |
| 496 | asn_DEF_Enum3_tags_1, /* Same as above */ |
| 497 | sizeof(asn_DEF_Enum3_tags_1) |
| 498 | /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 499 | 0, /* No OER visible constraints */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 500 | 0, /* No PER visible constraints */ |
| 501 | 0, 0, /* Defined elsewhere */ |
| 502 | &asn_SPC_Enum3_specs_1 /* Additional specs */ |
| 503 | }; |
| 504 | |
| 505 | |
| 506 | /*** <<< INCLUDES [Enum4] >>> ***/ |
| 507 | |
| 508 | #include <ENUMERATED.h> |
| 509 | |
| 510 | /*** <<< DEPS [Enum4] >>> ***/ |
| 511 | |
| 512 | typedef enum Enum4 { |
| 513 | Enum4_a = 0, |
| 514 | Enum4_b = 1, |
| 515 | /* |
| 516 | * Enumeration is extensible |
| 517 | */ |
| 518 | Enum4_c = 3, |
| 519 | Enum4_d = 4 |
| 520 | } e_Enum4; |
| 521 | |
| 522 | /*** <<< TYPE-DECLS [Enum4] >>> ***/ |
| 523 | |
| 524 | typedef ENUMERATED_t Enum4_t; |
| 525 | |
| 526 | /*** <<< FUNC-DECLS [Enum4] >>> ***/ |
| 527 | |
| 528 | extern asn_TYPE_descriptor_t asn_DEF_Enum4; |
| 529 | asn_struct_free_f Enum4_free; |
| 530 | asn_struct_print_f Enum4_print; |
| 531 | asn_constr_check_f Enum4_constraint; |
| 532 | ber_type_decoder_f Enum4_decode_ber; |
| 533 | der_type_encoder_f Enum4_encode_der; |
| 534 | xer_type_decoder_f Enum4_decode_xer; |
| 535 | xer_type_encoder_f Enum4_encode_xer; |
| 536 | |
| 537 | /*** <<< CODE [Enum4] >>> ***/ |
| 538 | |
| 539 | int |
| 540 | Enum4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 541 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 542 | /* Replace with underlying type checker */ |
| 543 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
| 544 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
| 545 | } |
| 546 | |
| 547 | /* |
| 548 | * This type is implemented using ENUMERATED, |
| 549 | * so here we adjust the DEF accordingly. |
| 550 | */ |
| 551 | static void |
| 552 | Enum4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 553 | td->free_struct = asn_DEF_ENUMERATED.free_struct; |
| 554 | td->print_struct = asn_DEF_ENUMERATED.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 555 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 556 | td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; |
| 557 | td->der_encoder = asn_DEF_ENUMERATED.der_encoder; |
| 558 | td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; |
| 559 | td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; |
| 560 | td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; |
| 561 | td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 562 | td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder; |
| 563 | td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 564 | if(!td->oer_constraints) |
| 565 | td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 566 | if(!td->per_constraints) |
| 567 | td->per_constraints = asn_DEF_ENUMERATED.per_constraints; |
| 568 | td->elements = asn_DEF_ENUMERATED.elements; |
| 569 | td->elements_count = asn_DEF_ENUMERATED.elements_count; |
| 570 | /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ |
| 571 | } |
| 572 | |
| 573 | void |
| 574 | Enum4_free(asn_TYPE_descriptor_t *td, |
| 575 | void *struct_ptr, int contents_only) { |
| 576 | Enum4_1_inherit_TYPE_descriptor(td); |
| 577 | td->free_struct(td, struct_ptr, contents_only); |
| 578 | } |
| 579 | |
| 580 | int |
| 581 | Enum4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 582 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 583 | Enum4_1_inherit_TYPE_descriptor(td); |
| 584 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 585 | } |
| 586 | |
| 587 | asn_dec_rval_t |
| 588 | Enum4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 589 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 590 | Enum4_1_inherit_TYPE_descriptor(td); |
| 591 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 592 | } |
| 593 | |
| 594 | asn_enc_rval_t |
| 595 | Enum4_encode_der(asn_TYPE_descriptor_t *td, |
| 596 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 597 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 598 | Enum4_1_inherit_TYPE_descriptor(td); |
| 599 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 600 | } |
| 601 | |
| 602 | asn_dec_rval_t |
| 603 | Enum4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 604 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 605 | Enum4_1_inherit_TYPE_descriptor(td); |
| 606 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 607 | } |
| 608 | |
| 609 | asn_enc_rval_t |
| 610 | Enum4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 611 | int ilevel, enum xer_encoder_flags_e flags, |
| 612 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 613 | Enum4_1_inherit_TYPE_descriptor(td); |
| 614 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 615 | } |
| 616 | |
| 617 | |
| 618 | /*** <<< STAT-DEFS [Enum4] >>> ***/ |
| 619 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 620 | static const asn_INTEGER_enum_map_t asn_MAP_Enum4_value2enum_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 621 | { 0, 1, "a" }, |
| 622 | { 1, 1, "b" }, |
| 623 | { 3, 1, "c" }, |
| 624 | { 4, 1, "d" } |
| 625 | /* This list is extensible */ |
| 626 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 627 | static const unsigned int asn_MAP_Enum4_enum2value_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 628 | 0, /* a(0) */ |
| 629 | 1, /* b(1) */ |
| 630 | 2, /* c(3) */ |
| 631 | 3 /* d(4) */ |
| 632 | /* This list is extensible */ |
| 633 | }; |
johvik | e70c407 | 2017-05-09 11:06:12 +0200 | [diff] [blame] | 634 | static asn_INTEGER_specifics_t asn_SPC_Enum4_specs_1 = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 635 | asn_MAP_Enum4_value2enum_1, /* "tag" => N; sorted by tag */ |
| 636 | asn_MAP_Enum4_enum2value_1, /* N => "tag"; sorted by N */ |
| 637 | 4, /* Number of elements in the maps */ |
| 638 | 3, /* Extensions before this member */ |
| 639 | 1, /* Strict enumeration */ |
| 640 | 0, /* Native long size */ |
| 641 | 0 |
| 642 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 643 | static const ber_tlv_tag_t asn_DEF_Enum4_tags_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 644 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 645 | }; |
| 646 | asn_TYPE_descriptor_t asn_DEF_Enum4 = { |
| 647 | "Enum4", |
| 648 | "Enum4", |
| 649 | Enum4_free, |
| 650 | Enum4_print, |
| 651 | Enum4_constraint, |
| 652 | Enum4_decode_ber, |
| 653 | Enum4_encode_der, |
| 654 | Enum4_decode_xer, |
| 655 | Enum4_encode_xer, |
Lev Walkin | a46ab9c | 2017-07-06 07:57:15 -0700 | [diff] [blame] | 656 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 657 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 658 | 0, /* Use generic outmost tag fetcher */ |
| 659 | asn_DEF_Enum4_tags_1, |
| 660 | sizeof(asn_DEF_Enum4_tags_1) |
| 661 | /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */ |
| 662 | asn_DEF_Enum4_tags_1, /* Same as above */ |
| 663 | sizeof(asn_DEF_Enum4_tags_1) |
| 664 | /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 665 | 0, /* No OER visible constraints */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 666 | 0, /* No PER visible constraints */ |
| 667 | 0, 0, /* Defined elsewhere */ |
| 668 | &asn_SPC_Enum4_specs_1 /* Additional specs */ |
| 669 | }; |
| 670 | |
| 671 | |
| 672 | /*** <<< INCLUDES [Enum5] >>> ***/ |
| 673 | |
| 674 | #include <ENUMERATED.h> |
| 675 | |
| 676 | /*** <<< DEPS [Enum5] >>> ***/ |
| 677 | |
| 678 | typedef enum Enum5 { |
| 679 | Enum5_a = 0, |
| 680 | Enum5_z = 25, |
| 681 | /* |
| 682 | * Enumeration is extensible |
| 683 | */ |
| 684 | Enum5_d = 26 |
| 685 | } e_Enum5; |
| 686 | |
| 687 | /*** <<< TYPE-DECLS [Enum5] >>> ***/ |
| 688 | |
| 689 | typedef ENUMERATED_t Enum5_t; |
| 690 | |
| 691 | /*** <<< FUNC-DECLS [Enum5] >>> ***/ |
| 692 | |
| 693 | extern asn_TYPE_descriptor_t asn_DEF_Enum5; |
| 694 | asn_struct_free_f Enum5_free; |
| 695 | asn_struct_print_f Enum5_print; |
| 696 | asn_constr_check_f Enum5_constraint; |
| 697 | ber_type_decoder_f Enum5_decode_ber; |
| 698 | der_type_encoder_f Enum5_encode_der; |
| 699 | xer_type_decoder_f Enum5_decode_xer; |
| 700 | xer_type_encoder_f Enum5_encode_xer; |
| 701 | |
| 702 | /*** <<< CODE [Enum5] >>> ***/ |
| 703 | |
| 704 | int |
| 705 | Enum5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 706 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 707 | /* Replace with underlying type checker */ |
| 708 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
| 709 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
| 710 | } |
| 711 | |
| 712 | /* |
| 713 | * This type is implemented using ENUMERATED, |
| 714 | * so here we adjust the DEF accordingly. |
| 715 | */ |
| 716 | static void |
| 717 | Enum5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 718 | td->free_struct = asn_DEF_ENUMERATED.free_struct; |
| 719 | td->print_struct = asn_DEF_ENUMERATED.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 720 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 721 | td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; |
| 722 | td->der_encoder = asn_DEF_ENUMERATED.der_encoder; |
| 723 | td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; |
| 724 | td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; |
| 725 | td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; |
| 726 | td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 727 | td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder; |
| 728 | td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 729 | if(!td->oer_constraints) |
| 730 | td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints; |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 731 | if(!td->per_constraints) |
| 732 | td->per_constraints = asn_DEF_ENUMERATED.per_constraints; |
| 733 | td->elements = asn_DEF_ENUMERATED.elements; |
| 734 | td->elements_count = asn_DEF_ENUMERATED.elements_count; |
| 735 | /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ |
| 736 | } |
| 737 | |
| 738 | void |
| 739 | Enum5_free(asn_TYPE_descriptor_t *td, |
| 740 | void *struct_ptr, int contents_only) { |
| 741 | Enum5_1_inherit_TYPE_descriptor(td); |
| 742 | td->free_struct(td, struct_ptr, contents_only); |
| 743 | } |
| 744 | |
| 745 | int |
| 746 | Enum5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 747 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 748 | Enum5_1_inherit_TYPE_descriptor(td); |
| 749 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 750 | } |
| 751 | |
| 752 | asn_dec_rval_t |
| 753 | Enum5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 754 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 755 | Enum5_1_inherit_TYPE_descriptor(td); |
| 756 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 757 | } |
| 758 | |
| 759 | asn_enc_rval_t |
| 760 | Enum5_encode_der(asn_TYPE_descriptor_t *td, |
| 761 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 762 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 763 | Enum5_1_inherit_TYPE_descriptor(td); |
| 764 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 765 | } |
| 766 | |
| 767 | asn_dec_rval_t |
| 768 | Enum5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 769 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 770 | Enum5_1_inherit_TYPE_descriptor(td); |
| 771 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 772 | } |
| 773 | |
| 774 | asn_enc_rval_t |
| 775 | Enum5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 776 | int ilevel, enum xer_encoder_flags_e flags, |
| 777 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 778 | Enum5_1_inherit_TYPE_descriptor(td); |
| 779 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 780 | } |
| 781 | |
| 782 | |
| 783 | /*** <<< STAT-DEFS [Enum5] >>> ***/ |
| 784 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 785 | static const asn_INTEGER_enum_map_t asn_MAP_Enum5_value2enum_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 786 | { 0, 1, "a" }, |
| 787 | { 25, 1, "z" }, |
| 788 | { 26, 1, "d" } |
| 789 | /* This list is extensible */ |
| 790 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 791 | static const unsigned int asn_MAP_Enum5_enum2value_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 792 | 0, /* a(0) */ |
| 793 | 2, /* d(26) */ |
| 794 | 1 /* z(25) */ |
| 795 | /* This list is extensible */ |
| 796 | }; |
johvik | e70c407 | 2017-05-09 11:06:12 +0200 | [diff] [blame] | 797 | static asn_INTEGER_specifics_t asn_SPC_Enum5_specs_1 = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 798 | asn_MAP_Enum5_value2enum_1, /* "tag" => N; sorted by tag */ |
| 799 | asn_MAP_Enum5_enum2value_1, /* N => "tag"; sorted by N */ |
| 800 | 3, /* Number of elements in the maps */ |
| 801 | 3, /* Extensions before this member */ |
| 802 | 1, /* Strict enumeration */ |
| 803 | 0, /* Native long size */ |
| 804 | 0 |
| 805 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 806 | static const ber_tlv_tag_t asn_DEF_Enum5_tags_1[] = { |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 807 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 808 | }; |
| 809 | asn_TYPE_descriptor_t asn_DEF_Enum5 = { |
| 810 | "Enum5", |
| 811 | "Enum5", |
| 812 | Enum5_free, |
| 813 | Enum5_print, |
| 814 | Enum5_constraint, |
| 815 | Enum5_decode_ber, |
| 816 | Enum5_encode_der, |
| 817 | Enum5_decode_xer, |
| 818 | Enum5_encode_xer, |
Lev Walkin | a46ab9c | 2017-07-06 07:57:15 -0700 | [diff] [blame] | 819 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 820 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 821 | 0, /* Use generic outmost tag fetcher */ |
| 822 | asn_DEF_Enum5_tags_1, |
| 823 | sizeof(asn_DEF_Enum5_tags_1) |
| 824 | /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */ |
| 825 | asn_DEF_Enum5_tags_1, /* Same as above */ |
| 826 | sizeof(asn_DEF_Enum5_tags_1) |
| 827 | /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 828 | 0, /* No OER visible constraints */ |
Lev Walkin | ffe79f4 | 2010-10-25 00:10:34 -0700 | [diff] [blame] | 829 | 0, /* No PER visible constraints */ |
| 830 | 0, 0, /* Defined elsewhere */ |
| 831 | &asn_SPC_Enum5_specs_1 /* Additional specs */ |
| 832 | }; |
| 833 | |