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