Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Flag] >>> ***/ |
| 3 | |
| 4 | #include <INTEGER.h> |
| 5 | #include <constr_SEQUENCE.h> |
| 6 | #include <ENUMERATED.h> |
| 7 | |
| 8 | /*** <<< DEPS [Flag] >>> ***/ |
| 9 | |
| 10 | typedef enum field { |
| 11 | field_red = 0, |
| 12 | field_green = 1, |
| 13 | field_blue = 5 |
| 14 | } e_field; |
| 15 | typedef enum field { |
| 16 | field_red = 3, |
| 17 | field_green = 4, |
| 18 | field_blue = 5 |
| 19 | } e_field; |
| 20 | |
| 21 | /*** <<< TYPE-DECLS [Flag] >>> ***/ |
| 22 | |
| 23 | typedef struct Flag_16P0 { |
| 24 | INTEGER_t *field /* DEFAULT 5 */; |
| 25 | |
| 26 | /* Context for parsing across buffer boundaries */ |
| 27 | asn_struct_ctx_t _asn_ctx; |
| 28 | } Flag_16P0_t; |
| 29 | typedef struct Flag_16P1 { |
| 30 | ENUMERATED_t *field /* DEFAULT 5 */; |
| 31 | |
| 32 | /* Context for parsing across buffer boundaries */ |
| 33 | asn_struct_ctx_t _asn_ctx; |
| 34 | } Flag_16P1_t; |
| 35 | |
| 36 | /*** <<< FUNC-DECLS [Flag] >>> ***/ |
| 37 | |
| 38 | extern asn_TYPE_descriptor_t asn_DEF_Flag_16P0; |
| 39 | /* extern asn_TYPE_descriptor_t asn_DEF_field_7; // (Use -fall-defs-global to expose) */ |
| 40 | extern asn_TYPE_descriptor_t asn_DEF_Flag_16P1; |
| 41 | |
| 42 | /*** <<< CODE [Flag] >>> ***/ |
| 43 | |
| 44 | static int |
| 45 | field_7_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 46 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 47 | /* Replace with underlying type checker */ |
| 48 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 49 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | /* |
| 53 | * This type is implemented using ENUMERATED, |
| 54 | * so here we adjust the DEF accordingly. |
| 55 | */ |
| 56 | static void |
| 57 | field_7_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 58 | td->free_struct = asn_DEF_ENUMERATED.free_struct; |
| 59 | td->print_struct = asn_DEF_ENUMERATED.print_struct; |
| 60 | td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; |
| 61 | td->der_encoder = asn_DEF_ENUMERATED.der_encoder; |
| 62 | td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; |
| 63 | td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; |
| 64 | td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 65 | td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 66 | if(!td->per_constraints) |
| 67 | td->per_constraints = asn_DEF_ENUMERATED.per_constraints; |
| 68 | td->elements = asn_DEF_ENUMERATED.elements; |
| 69 | td->elements_count = asn_DEF_ENUMERATED.elements_count; |
| 70 | /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ |
| 71 | } |
| 72 | |
| 73 | static void |
| 74 | field_7_free(asn_TYPE_descriptor_t *td, |
| 75 | void *struct_ptr, int contents_only) { |
| 76 | field_7_inherit_TYPE_descriptor(td); |
| 77 | td->free_struct(td, struct_ptr, contents_only); |
| 78 | } |
| 79 | |
| 80 | static int |
| 81 | field_7_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 82 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 83 | field_7_inherit_TYPE_descriptor(td); |
| 84 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 85 | } |
| 86 | |
| 87 | static asn_dec_rval_t |
| 88 | field_7_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 89 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 90 | field_7_inherit_TYPE_descriptor(td); |
| 91 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 92 | } |
| 93 | |
| 94 | static asn_enc_rval_t |
| 95 | field_7_encode_der(asn_TYPE_descriptor_t *td, |
| 96 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 97 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 98 | field_7_inherit_TYPE_descriptor(td); |
| 99 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 100 | } |
| 101 | |
| 102 | static asn_dec_rval_t |
| 103 | field_7_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 104 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 105 | field_7_inherit_TYPE_descriptor(td); |
| 106 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 107 | } |
| 108 | |
| 109 | static asn_enc_rval_t |
| 110 | field_7_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 111 | int ilevel, enum xer_encoder_flags_e flags, |
| 112 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 113 | field_7_inherit_TYPE_descriptor(td); |
| 114 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 115 | } |
| 116 | |
| 117 | |
| 118 | /*** <<< STAT-DEFS [Flag] >>> ***/ |
| 119 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 120 | static int asn_DFL_2_set_5(int set_value, void **sptr) { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 121 | INTEGER_t *st = *sptr; |
| 122 | |
| 123 | if(!st) { |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 124 | if(!set_value) return -1; /* Not a default value */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 125 | st = (*sptr = CALLOC(1, sizeof(*st))); |
| 126 | if(!st) return -1; |
| 127 | } |
| 128 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 129 | if(set_value) { |
| 130 | /* Install default value 5 */ |
| 131 | return asn_long2INTEGER(st, 5); |
| 132 | } else { |
| 133 | /* Test default value 5 */ |
| 134 | long value; |
| 135 | if(asn_INTEGER2long(st, &value)) |
| 136 | return -1; |
| 137 | return (value == 5); |
| 138 | } |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 139 | } |
| 140 | static asn_TYPE_member_t asn_MBR_Flag_16P0_1[] = { |
| 141 | { ATF_POINTER, 1, offsetof(struct Flag_16P0, field), |
| 142 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 143 | .tag_mode = 0, |
| 144 | .type = &asn_DEF_INTEGER, |
| 145 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 146 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 147 | .default_value = asn_DFL_2_set_5, /* DEFAULT 5 */ |
| 148 | .name = "field" |
| 149 | }, |
| 150 | }; |
| 151 | static ber_tlv_tag_t asn_DEF_Flag_16P0_tags_1[] = { |
| 152 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 153 | }; |
| 154 | static asn_TYPE_tag2member_t asn_MAP_Flag_16P0_tag2el_1[] = { |
| 155 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* field at 18 */ |
| 156 | }; |
| 157 | static asn_SEQUENCE_specifics_t asn_SPC_Flag_16P0_specs_1 = { |
| 158 | sizeof(struct Flag_16P0), |
| 159 | offsetof(struct Flag_16P0, _asn_ctx), |
| 160 | asn_MAP_Flag_16P0_tag2el_1, |
| 161 | 1, /* Count of tags in the map */ |
| 162 | 0, 0, 0, /* Optional elements (not needed) */ |
| 163 | -1, /* Start extensions */ |
| 164 | -1 /* Stop extensions */ |
| 165 | }; |
| 166 | asn_TYPE_descriptor_t asn_DEF_Flag_16P0 = { |
| 167 | "Flag", |
| 168 | "Flag", |
| 169 | SEQUENCE_free, |
| 170 | SEQUENCE_print, |
| 171 | SEQUENCE_constraint, |
| 172 | SEQUENCE_decode_ber, |
| 173 | SEQUENCE_encode_der, |
| 174 | SEQUENCE_decode_xer, |
| 175 | SEQUENCE_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 176 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 177 | 0, /* Use generic outmost tag fetcher */ |
| 178 | asn_DEF_Flag_16P0_tags_1, |
| 179 | sizeof(asn_DEF_Flag_16P0_tags_1) |
| 180 | /sizeof(asn_DEF_Flag_16P0_tags_1[0]), /* 1 */ |
| 181 | asn_DEF_Flag_16P0_tags_1, /* Same as above */ |
| 182 | sizeof(asn_DEF_Flag_16P0_tags_1) |
| 183 | /sizeof(asn_DEF_Flag_16P0_tags_1[0]), /* 1 */ |
| 184 | 0, /* No PER visible constraints */ |
| 185 | asn_MBR_Flag_16P0_1, |
| 186 | 1, /* Elements count */ |
| 187 | &asn_SPC_Flag_16P0_specs_1 /* Additional specs */ |
| 188 | }; |
| 189 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 190 | static int asn_DFL_7_set_5(int set_value, void **sptr) { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 191 | ENUMERATED_t *st = *sptr; |
| 192 | |
| 193 | if(!st) { |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 194 | if(!set_value) return -1; /* Not a default value */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 195 | st = (*sptr = CALLOC(1, sizeof(*st))); |
| 196 | if(!st) return -1; |
| 197 | } |
| 198 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 199 | if(set_value) { |
| 200 | /* Install default value 5 */ |
| 201 | return asn_long2INTEGER(st, 5); |
| 202 | } else { |
| 203 | /* Test default value 5 */ |
| 204 | long value; |
| 205 | if(asn_INTEGER2long(st, &value)) |
| 206 | return -1; |
| 207 | return (value == 5); |
| 208 | } |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 209 | } |
| 210 | static asn_INTEGER_enum_map_t asn_MAP_field_value2enum_7[] = { |
| 211 | { 3, 3, "red" }, |
| 212 | { 4, 5, "green" }, |
| 213 | { 5, 4, "blue" } |
| 214 | }; |
| 215 | static unsigned int asn_MAP_field_enum2value_7[] = { |
| 216 | 2, /* blue(5) */ |
| 217 | 1, /* green(4) */ |
| 218 | 0 /* red(3) */ |
| 219 | }; |
| 220 | static asn_INTEGER_specifics_t asn_SPC_field_specs_7 = { |
| 221 | asn_MAP_field_value2enum_7, /* "tag" => N; sorted by tag */ |
| 222 | asn_MAP_field_enum2value_7, /* N => "tag"; sorted by N */ |
| 223 | 3, /* Number of elements in the maps */ |
| 224 | 0, /* Enumeration is not extensible */ |
| 225 | 1 /* Strict enumeration */ |
| 226 | }; |
| 227 | static ber_tlv_tag_t asn_DEF_field_tags_7[] = { |
| 228 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 229 | }; |
| 230 | static /* Use -fall-defs-global to expose */ |
| 231 | asn_TYPE_descriptor_t asn_DEF_field_7 = { |
| 232 | "field", |
| 233 | "field", |
| 234 | field_7_free, |
| 235 | field_7_print, |
| 236 | field_7_constraint, |
| 237 | field_7_decode_ber, |
| 238 | field_7_encode_der, |
| 239 | field_7_decode_xer, |
| 240 | field_7_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 241 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 242 | 0, /* Use generic outmost tag fetcher */ |
| 243 | asn_DEF_field_tags_7, |
| 244 | sizeof(asn_DEF_field_tags_7) |
| 245 | /sizeof(asn_DEF_field_tags_7[0]), /* 1 */ |
| 246 | asn_DEF_field_tags_7, /* Same as above */ |
| 247 | sizeof(asn_DEF_field_tags_7) |
| 248 | /sizeof(asn_DEF_field_tags_7[0]), /* 1 */ |
| 249 | 0, /* No PER visible constraints */ |
| 250 | 0, 0, /* Defined elsewhere */ |
| 251 | &asn_SPC_field_specs_7 /* Additional specs */ |
| 252 | }; |
| 253 | |
| 254 | static asn_TYPE_member_t asn_MBR_Flag_16P1_6[] = { |
| 255 | { ATF_POINTER, 1, offsetof(struct Flag_16P1, field), |
| 256 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), |
| 257 | .tag_mode = 0, |
| 258 | .type = &asn_DEF_field_7, |
| 259 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 260 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 261 | .default_value = asn_DFL_7_set_5, /* DEFAULT 5 */ |
| 262 | .name = "field" |
| 263 | }, |
| 264 | }; |
| 265 | static ber_tlv_tag_t asn_DEF_Flag_16P1_tags_6[] = { |
| 266 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 267 | }; |
| 268 | static asn_TYPE_tag2member_t asn_MAP_Flag_16P1_tag2el_6[] = { |
| 269 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* field at 19 */ |
| 270 | }; |
| 271 | static asn_SEQUENCE_specifics_t asn_SPC_Flag_16P1_specs_6 = { |
| 272 | sizeof(struct Flag_16P1), |
| 273 | offsetof(struct Flag_16P1, _asn_ctx), |
| 274 | asn_MAP_Flag_16P1_tag2el_6, |
| 275 | 1, /* Count of tags in the map */ |
| 276 | 0, 0, 0, /* Optional elements (not needed) */ |
| 277 | -1, /* Start extensions */ |
| 278 | -1 /* Stop extensions */ |
| 279 | }; |
| 280 | asn_TYPE_descriptor_t asn_DEF_Flag_16P1 = { |
| 281 | "Flag", |
| 282 | "Flag", |
| 283 | SEQUENCE_free, |
| 284 | SEQUENCE_print, |
| 285 | SEQUENCE_constraint, |
| 286 | SEQUENCE_decode_ber, |
| 287 | SEQUENCE_encode_der, |
| 288 | SEQUENCE_decode_xer, |
| 289 | SEQUENCE_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 290 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 291 | 0, /* Use generic outmost tag fetcher */ |
| 292 | asn_DEF_Flag_16P1_tags_6, |
| 293 | sizeof(asn_DEF_Flag_16P1_tags_6) |
| 294 | /sizeof(asn_DEF_Flag_16P1_tags_6[0]), /* 1 */ |
| 295 | asn_DEF_Flag_16P1_tags_6, /* Same as above */ |
| 296 | sizeof(asn_DEF_Flag_16P1_tags_6) |
| 297 | /sizeof(asn_DEF_Flag_16P1_tags_6[0]), /* 1 */ |
| 298 | 0, /* No PER visible constraints */ |
| 299 | asn_MBR_Flag_16P1_6, |
| 300 | 1, /* Elements count */ |
| 301 | &asn_SPC_Flag_16P1_specs_6 /* Additional specs */ |
| 302 | }; |
| 303 | |
| 304 | |
| 305 | /*** <<< INCLUDES [IntegerColorFlag] >>> ***/ |
| 306 | |
| 307 | #include <Flag.h> |
| 308 | |
| 309 | /*** <<< TYPE-DECLS [IntegerColorFlag] >>> ***/ |
| 310 | |
| 311 | typedef Flag_16P0_t IntegerColorFlag_t; |
| 312 | |
| 313 | /*** <<< FUNC-DECLS [IntegerColorFlag] >>> ***/ |
| 314 | |
| 315 | extern asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag; |
| 316 | asn_struct_free_f IntegerColorFlag_free; |
| 317 | asn_struct_print_f IntegerColorFlag_print; |
| 318 | asn_constr_check_f IntegerColorFlag_constraint; |
| 319 | ber_type_decoder_f IntegerColorFlag_decode_ber; |
| 320 | der_type_encoder_f IntegerColorFlag_encode_der; |
| 321 | xer_type_decoder_f IntegerColorFlag_decode_xer; |
| 322 | xer_type_encoder_f IntegerColorFlag_encode_xer; |
| 323 | |
| 324 | /*** <<< CODE [IntegerColorFlag] >>> ***/ |
| 325 | |
| 326 | int |
| 327 | IntegerColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 328 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 329 | /* Replace with underlying type checker */ |
| 330 | td->check_constraints = asn_DEF_Flag_16P0.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 331 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 332 | } |
| 333 | |
| 334 | /* |
| 335 | * This type is implemented using Flag_16P0, |
| 336 | * so here we adjust the DEF accordingly. |
| 337 | */ |
| 338 | static void |
| 339 | IntegerColorFlag_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 340 | td->free_struct = asn_DEF_Flag_16P0.free_struct; |
| 341 | td->print_struct = asn_DEF_Flag_16P0.print_struct; |
| 342 | td->ber_decoder = asn_DEF_Flag_16P0.ber_decoder; |
| 343 | td->der_encoder = asn_DEF_Flag_16P0.der_encoder; |
| 344 | td->xer_decoder = asn_DEF_Flag_16P0.xer_decoder; |
| 345 | td->xer_encoder = asn_DEF_Flag_16P0.xer_encoder; |
| 346 | td->uper_decoder = asn_DEF_Flag_16P0.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 347 | td->uper_encoder = asn_DEF_Flag_16P0.uper_encoder; |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 348 | if(!td->per_constraints) |
| 349 | td->per_constraints = asn_DEF_Flag_16P0.per_constraints; |
| 350 | td->elements = asn_DEF_Flag_16P0.elements; |
| 351 | td->elements_count = asn_DEF_Flag_16P0.elements_count; |
| 352 | td->specifics = asn_DEF_Flag_16P0.specifics; |
| 353 | } |
| 354 | |
| 355 | void |
| 356 | IntegerColorFlag_free(asn_TYPE_descriptor_t *td, |
| 357 | void *struct_ptr, int contents_only) { |
| 358 | IntegerColorFlag_1_inherit_TYPE_descriptor(td); |
| 359 | td->free_struct(td, struct_ptr, contents_only); |
| 360 | } |
| 361 | |
| 362 | int |
| 363 | IntegerColorFlag_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 364 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 365 | IntegerColorFlag_1_inherit_TYPE_descriptor(td); |
| 366 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 367 | } |
| 368 | |
| 369 | asn_dec_rval_t |
| 370 | IntegerColorFlag_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 371 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 372 | IntegerColorFlag_1_inherit_TYPE_descriptor(td); |
| 373 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 374 | } |
| 375 | |
| 376 | asn_enc_rval_t |
| 377 | IntegerColorFlag_encode_der(asn_TYPE_descriptor_t *td, |
| 378 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 379 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 380 | IntegerColorFlag_1_inherit_TYPE_descriptor(td); |
| 381 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 382 | } |
| 383 | |
| 384 | asn_dec_rval_t |
| 385 | IntegerColorFlag_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 386 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 387 | IntegerColorFlag_1_inherit_TYPE_descriptor(td); |
| 388 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 389 | } |
| 390 | |
| 391 | asn_enc_rval_t |
| 392 | IntegerColorFlag_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 393 | int ilevel, enum xer_encoder_flags_e flags, |
| 394 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 395 | IntegerColorFlag_1_inherit_TYPE_descriptor(td); |
| 396 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 397 | } |
| 398 | |
| 399 | |
| 400 | /*** <<< STAT-DEFS [IntegerColorFlag] >>> ***/ |
| 401 | |
| 402 | static ber_tlv_tag_t asn_DEF_IntegerColorFlag_tags_1[] = { |
| 403 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 404 | }; |
| 405 | asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag = { |
| 406 | "IntegerColorFlag", |
| 407 | "IntegerColorFlag", |
| 408 | IntegerColorFlag_free, |
| 409 | IntegerColorFlag_print, |
| 410 | IntegerColorFlag_constraint, |
| 411 | IntegerColorFlag_decode_ber, |
| 412 | IntegerColorFlag_encode_der, |
| 413 | IntegerColorFlag_decode_xer, |
| 414 | IntegerColorFlag_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 415 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 416 | 0, /* Use generic outmost tag fetcher */ |
| 417 | asn_DEF_IntegerColorFlag_tags_1, |
| 418 | sizeof(asn_DEF_IntegerColorFlag_tags_1) |
| 419 | /sizeof(asn_DEF_IntegerColorFlag_tags_1[0]), /* 1 */ |
| 420 | asn_DEF_IntegerColorFlag_tags_1, /* Same as above */ |
| 421 | sizeof(asn_DEF_IntegerColorFlag_tags_1) |
| 422 | /sizeof(asn_DEF_IntegerColorFlag_tags_1[0]), /* 1 */ |
| 423 | 0, /* No PER visible constraints */ |
| 424 | 0, 0, /* Defined elsewhere */ |
| 425 | 0 /* No specifics */ |
| 426 | }; |
| 427 | |
| 428 | |
| 429 | /*** <<< INCLUDES [EnumeratedColorFlag] >>> ***/ |
| 430 | |
| 431 | #include <Flag.h> |
| 432 | |
| 433 | /*** <<< TYPE-DECLS [EnumeratedColorFlag] >>> ***/ |
| 434 | |
| 435 | typedef Flag_16P1_t EnumeratedColorFlag_t; |
| 436 | |
| 437 | /*** <<< FUNC-DECLS [EnumeratedColorFlag] >>> ***/ |
| 438 | |
| 439 | extern asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag; |
| 440 | asn_struct_free_f EnumeratedColorFlag_free; |
| 441 | asn_struct_print_f EnumeratedColorFlag_print; |
| 442 | asn_constr_check_f EnumeratedColorFlag_constraint; |
| 443 | ber_type_decoder_f EnumeratedColorFlag_decode_ber; |
| 444 | der_type_encoder_f EnumeratedColorFlag_encode_der; |
| 445 | xer_type_decoder_f EnumeratedColorFlag_decode_xer; |
| 446 | xer_type_encoder_f EnumeratedColorFlag_encode_xer; |
| 447 | |
| 448 | /*** <<< CODE [EnumeratedColorFlag] >>> ***/ |
| 449 | |
| 450 | int |
| 451 | EnumeratedColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 452 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 453 | /* Replace with underlying type checker */ |
| 454 | td->check_constraints = asn_DEF_Flag_16P1.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 455 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 456 | } |
| 457 | |
| 458 | /* |
| 459 | * This type is implemented using Flag_16P1, |
| 460 | * so here we adjust the DEF accordingly. |
| 461 | */ |
| 462 | static void |
| 463 | EnumeratedColorFlag_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 464 | td->free_struct = asn_DEF_Flag_16P1.free_struct; |
| 465 | td->print_struct = asn_DEF_Flag_16P1.print_struct; |
| 466 | td->ber_decoder = asn_DEF_Flag_16P1.ber_decoder; |
| 467 | td->der_encoder = asn_DEF_Flag_16P1.der_encoder; |
| 468 | td->xer_decoder = asn_DEF_Flag_16P1.xer_decoder; |
| 469 | td->xer_encoder = asn_DEF_Flag_16P1.xer_encoder; |
| 470 | td->uper_decoder = asn_DEF_Flag_16P1.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 471 | td->uper_encoder = asn_DEF_Flag_16P1.uper_encoder; |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 472 | if(!td->per_constraints) |
| 473 | td->per_constraints = asn_DEF_Flag_16P1.per_constraints; |
| 474 | td->elements = asn_DEF_Flag_16P1.elements; |
| 475 | td->elements_count = asn_DEF_Flag_16P1.elements_count; |
| 476 | td->specifics = asn_DEF_Flag_16P1.specifics; |
| 477 | } |
| 478 | |
| 479 | void |
| 480 | EnumeratedColorFlag_free(asn_TYPE_descriptor_t *td, |
| 481 | void *struct_ptr, int contents_only) { |
| 482 | EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); |
| 483 | td->free_struct(td, struct_ptr, contents_only); |
| 484 | } |
| 485 | |
| 486 | int |
| 487 | EnumeratedColorFlag_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 488 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 489 | EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); |
| 490 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 491 | } |
| 492 | |
| 493 | asn_dec_rval_t |
| 494 | EnumeratedColorFlag_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 495 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 496 | EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); |
| 497 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 498 | } |
| 499 | |
| 500 | asn_enc_rval_t |
| 501 | EnumeratedColorFlag_encode_der(asn_TYPE_descriptor_t *td, |
| 502 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 503 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 504 | EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); |
| 505 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 506 | } |
| 507 | |
| 508 | asn_dec_rval_t |
| 509 | EnumeratedColorFlag_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 510 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 511 | EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); |
| 512 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 513 | } |
| 514 | |
| 515 | asn_enc_rval_t |
| 516 | EnumeratedColorFlag_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 517 | int ilevel, enum xer_encoder_flags_e flags, |
| 518 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 519 | EnumeratedColorFlag_1_inherit_TYPE_descriptor(td); |
| 520 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 521 | } |
| 522 | |
| 523 | |
| 524 | /*** <<< STAT-DEFS [EnumeratedColorFlag] >>> ***/ |
| 525 | |
| 526 | static ber_tlv_tag_t asn_DEF_EnumeratedColorFlag_tags_1[] = { |
| 527 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 528 | }; |
| 529 | asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag = { |
| 530 | "EnumeratedColorFlag", |
| 531 | "EnumeratedColorFlag", |
| 532 | EnumeratedColorFlag_free, |
| 533 | EnumeratedColorFlag_print, |
| 534 | EnumeratedColorFlag_constraint, |
| 535 | EnumeratedColorFlag_decode_ber, |
| 536 | EnumeratedColorFlag_encode_der, |
| 537 | EnumeratedColorFlag_decode_xer, |
| 538 | EnumeratedColorFlag_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 539 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 540 | 0, /* Use generic outmost tag fetcher */ |
| 541 | asn_DEF_EnumeratedColorFlag_tags_1, |
| 542 | sizeof(asn_DEF_EnumeratedColorFlag_tags_1) |
| 543 | /sizeof(asn_DEF_EnumeratedColorFlag_tags_1[0]), /* 1 */ |
| 544 | asn_DEF_EnumeratedColorFlag_tags_1, /* Same as above */ |
| 545 | sizeof(asn_DEF_EnumeratedColorFlag_tags_1) |
| 546 | /sizeof(asn_DEF_EnumeratedColorFlag_tags_1[0]), /* 1 */ |
| 547 | 0, /* No PER visible constraints */ |
| 548 | 0, 0, /* Defined elsewhere */ |
| 549 | 0 /* No specifics */ |
| 550 | }; |
| 551 | |