blob: 5ced128cca8c9ab214750ddcb88860abcb2b9038 [file] [log] [blame]
Lev Walkin171487e2006-03-21 07:25:18 +00001
2/*** <<< INCLUDES [Flag] >>> ***/
3
4#include <INTEGER.h>
5#include <constr_SEQUENCE.h>
6#include <ENUMERATED.h>
7
8/*** <<< DEPS [Flag] >>> ***/
9
10typedef enum field {
11 field_red = 0,
12 field_green = 1,
13 field_blue = 5
14} e_field;
15typedef enum field {
16 field_red = 3,
17 field_green = 4,
18 field_blue = 5
19} e_field;
20
21/*** <<< TYPE-DECLS [Flag] >>> ***/
22
23typedef 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;
29typedef 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
38extern asn_TYPE_descriptor_t asn_DEF_Flag_16P0;
39/* extern asn_TYPE_descriptor_t asn_DEF_field_7; // (Use -fall-defs-global to expose) */
40extern asn_TYPE_descriptor_t asn_DEF_Flag_16P1;
41
42/*** <<< CODE [Flag] >>> ***/
43
44static int
45field_7_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000046 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +000047 /* Replace with underlying type checker */
48 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +000049 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin171487e2006-03-21 07:25:18 +000050}
51
52/*
53 * This type is implemented using ENUMERATED,
54 * so here we adjust the DEF accordingly.
55 */
56static void
57field_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 Walkin6169b8d2013-12-07 11:02:44 -080060 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +000061 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 Walkin9f5bb3a2006-08-18 01:46:46 +000066 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkin171487e2006-03-21 07:25:18 +000067 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
74static void
75field_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
81static int
82field_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
88static asn_dec_rval_t
89field_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
95static asn_enc_rval_t
96field_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
103static asn_dec_rval_t
104field_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
110static asn_enc_rval_t
111field_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
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000121static int asn_DFL_2_set_5(int set_value, void **sptr) {
Lev Walkin171487e2006-03-21 07:25:18 +0000122 INTEGER_t *st = *sptr;
123
124 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000125 if(!set_value) return -1; /* Not a default value */
Lev Walkin171487e2006-03-21 07:25:18 +0000126 st = (*sptr = CALLOC(1, sizeof(*st)));
127 if(!st) return -1;
128 }
129
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000130 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 }
Lev Walkin171487e2006-03-21 07:25:18 +0000140}
141static 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};
152static ber_tlv_tag_t asn_DEF_Flag_16P0_tags_1[] = {
153 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
154};
155static asn_TYPE_tag2member_t asn_MAP_Flag_16P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700156 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* field */
Lev Walkin171487e2006-03-21 07:25:18 +0000157};
158static 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};
167asn_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,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000177 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000178 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
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000191static int asn_DFL_7_set_5(int set_value, void **sptr) {
Lev Walkin171487e2006-03-21 07:25:18 +0000192 ENUMERATED_t *st = *sptr;
193
194 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000195 if(!set_value) return -1; /* Not a default value */
Lev Walkin171487e2006-03-21 07:25:18 +0000196 st = (*sptr = CALLOC(1, sizeof(*st)));
197 if(!st) return -1;
198 }
199
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000200 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 }
Lev Walkin171487e2006-03-21 07:25:18 +0000210}
211static asn_INTEGER_enum_map_t asn_MAP_field_value2enum_7[] = {
212 { 3, 3, "red" },
213 { 4, 5, "green" },
214 { 5, 4, "blue" }
215};
216static unsigned int asn_MAP_field_enum2value_7[] = {
217 2, /* blue(5) */
218 1, /* green(4) */
219 0 /* red(3) */
220};
221static 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 */
Lev Walkin8bb57a22007-12-03 13:41:36 +0000226 1, /* Strict enumeration */
227 0, /* Native long size */
228 0
Lev Walkin171487e2006-03-21 07:25:18 +0000229};
230static ber_tlv_tag_t asn_DEF_field_tags_7[] = {
231 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
232};
233static /* Use -fall-defs-global to expose */
234asn_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,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000244 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000245 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
257static 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};
268static ber_tlv_tag_t asn_DEF_Flag_16P1_tags_6[] = {
269 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
270};
271static asn_TYPE_tag2member_t asn_MAP_Flag_16P1_tag2el_6[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700272 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* field */
Lev Walkin171487e2006-03-21 07:25:18 +0000273};
274static 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};
283asn_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,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000293 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000294 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
Lev Walkin22b5ed42006-09-13 02:51:20 +0000310#include "Flag.h"
Lev Walkin171487e2006-03-21 07:25:18 +0000311
312/*** <<< TYPE-DECLS [IntegerColorFlag] >>> ***/
313
314typedef Flag_16P0_t IntegerColorFlag_t;
315
316/*** <<< FUNC-DECLS [IntegerColorFlag] >>> ***/
317
318extern asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag;
319asn_struct_free_f IntegerColorFlag_free;
320asn_struct_print_f IntegerColorFlag_print;
321asn_constr_check_f IntegerColorFlag_constraint;
322ber_type_decoder_f IntegerColorFlag_decode_ber;
323der_type_encoder_f IntegerColorFlag_encode_der;
324xer_type_decoder_f IntegerColorFlag_decode_xer;
325xer_type_encoder_f IntegerColorFlag_encode_xer;
326
327/*** <<< CODE [IntegerColorFlag] >>> ***/
328
329int
330IntegerColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000331 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000332 /* Replace with underlying type checker */
333 td->check_constraints = asn_DEF_Flag_16P0.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000334 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin171487e2006-03-21 07:25:18 +0000335}
336
337/*
338 * This type is implemented using Flag_16P0,
339 * so here we adjust the DEF accordingly.
340 */
341static void
342IntegerColorFlag_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;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800345 td->check_constraints = asn_DEF_Flag_16P0.check_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000346 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;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000351 td->uper_encoder = asn_DEF_Flag_16P0.uper_encoder;
Lev Walkin171487e2006-03-21 07:25:18 +0000352 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
359void
360IntegerColorFlag_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
366int
367IntegerColorFlag_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
373asn_dec_rval_t
374IntegerColorFlag_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
380asn_enc_rval_t
381IntegerColorFlag_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
388asn_dec_rval_t
389IntegerColorFlag_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
395asn_enc_rval_t
396IntegerColorFlag_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
406static ber_tlv_tag_t asn_DEF_IntegerColorFlag_tags_1[] = {
407 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
408};
409asn_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,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000419 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000420 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
Lev Walkin22b5ed42006-09-13 02:51:20 +0000435#include "Flag.h"
Lev Walkin171487e2006-03-21 07:25:18 +0000436
437/*** <<< TYPE-DECLS [EnumeratedColorFlag] >>> ***/
438
439typedef Flag_16P1_t EnumeratedColorFlag_t;
440
441/*** <<< FUNC-DECLS [EnumeratedColorFlag] >>> ***/
442
443extern asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag;
444asn_struct_free_f EnumeratedColorFlag_free;
445asn_struct_print_f EnumeratedColorFlag_print;
446asn_constr_check_f EnumeratedColorFlag_constraint;
447ber_type_decoder_f EnumeratedColorFlag_decode_ber;
448der_type_encoder_f EnumeratedColorFlag_encode_der;
449xer_type_decoder_f EnumeratedColorFlag_decode_xer;
450xer_type_encoder_f EnumeratedColorFlag_encode_xer;
451
452/*** <<< CODE [EnumeratedColorFlag] >>> ***/
453
454int
455EnumeratedColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000456 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000457 /* Replace with underlying type checker */
458 td->check_constraints = asn_DEF_Flag_16P1.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000459 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin171487e2006-03-21 07:25:18 +0000460}
461
462/*
463 * This type is implemented using Flag_16P1,
464 * so here we adjust the DEF accordingly.
465 */
466static void
467EnumeratedColorFlag_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;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800470 td->check_constraints = asn_DEF_Flag_16P1.check_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000471 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;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000476 td->uper_encoder = asn_DEF_Flag_16P1.uper_encoder;
Lev Walkin171487e2006-03-21 07:25:18 +0000477 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
484void
485EnumeratedColorFlag_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
491int
492EnumeratedColorFlag_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
498asn_dec_rval_t
499EnumeratedColorFlag_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
505asn_enc_rval_t
506EnumeratedColorFlag_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
513asn_dec_rval_t
514EnumeratedColorFlag_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
520asn_enc_rval_t
521EnumeratedColorFlag_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
531static ber_tlv_tag_t asn_DEF_EnumeratedColorFlag_tags_1[] = {
532 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
533};
534asn_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,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000544 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000545 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