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