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