blob: 5c26d8dc749a564ad4c22bdb589ffc4c38f6ef92 [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 Walkinba68c912017-07-06 07:52:39 -070067 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
68 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +040069 if(!td->oer_constraints)
70 td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +000071 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
78static void
79field_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
85static int
86field_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
92static asn_dec_rval_t
93field_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
99static asn_enc_rval_t
100field_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
107static asn_dec_rval_t
108field_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
114static asn_enc_rval_t
115field_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 Walkin9f5bb3a2006-08-18 01:46:46 +0000125static int asn_DFL_2_set_5(int set_value, void **sptr) {
Lev Walkin171487e2006-03-21 07:25:18 +0000126 INTEGER_t *st = *sptr;
127
128 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000129 if(!set_value) return -1; /* Not a default value */
Lev Walkin171487e2006-03-21 07:25:18 +0000130 st = (*sptr = CALLOC(1, sizeof(*st)));
131 if(!st) return -1;
132 }
133
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000134 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 Walkin171487e2006-03-21 07:25:18 +0000144}
145static 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 Walkinb33425f2017-07-14 14:59:52 +0400151 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin171487e2006-03-21 07:25:18 +0000152 .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 Walkina7591b52014-10-12 18:37:35 -0700157static const ber_tlv_tag_t asn_DEF_Flag_16P0_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000158 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
159};
Lev Walkina7591b52014-10-12 18:37:35 -0700160static const asn_TYPE_tag2member_t asn_MAP_Flag_16P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700161 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* field */
Lev Walkin171487e2006-03-21 07:25:18 +0000162};
163static 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};
172asn_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 Walkinba68c912017-07-06 07:52:39 -0700182 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400183 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000184 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 Walkinb33425f2017-07-14 14:59:52 +0400191 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000192 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 Walkin9f5bb3a2006-08-18 01:46:46 +0000198static int asn_DFL_7_set_5(int set_value, void **sptr) {
Lev Walkin171487e2006-03-21 07:25:18 +0000199 ENUMERATED_t *st = *sptr;
200
201 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000202 if(!set_value) return -1; /* Not a default value */
Lev Walkin171487e2006-03-21 07:25:18 +0000203 st = (*sptr = CALLOC(1, sizeof(*st)));
204 if(!st) return -1;
205 }
206
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000207 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 Walkin171487e2006-03-21 07:25:18 +0000217}
Lev Walkina7591b52014-10-12 18:37:35 -0700218static const asn_INTEGER_enum_map_t asn_MAP_field_value2enum_7[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000219 { 3, 3, "red" },
220 { 4, 5, "green" },
221 { 5, 4, "blue" }
222};
Lev Walkina7591b52014-10-12 18:37:35 -0700223static const unsigned int asn_MAP_field_enum2value_7[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000224 2, /* blue(5) */
225 1, /* green(4) */
226 0 /* red(3) */
227};
johvike70c4072017-05-09 11:06:12 +0200228static asn_INTEGER_specifics_t asn_SPC_field_specs_7 = {
Lev Walkin171487e2006-03-21 07:25:18 +0000229 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 Walkin8bb57a22007-12-03 13:41:36 +0000233 1, /* Strict enumeration */
234 0, /* Native long size */
235 0
Lev Walkin171487e2006-03-21 07:25:18 +0000236};
Lev Walkina7591b52014-10-12 18:37:35 -0700237static const ber_tlv_tag_t asn_DEF_field_tags_7[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000238 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
239};
240static /* Use -fall-defs-global to expose */
241asn_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 Walkinba68c912017-07-06 07:52:39 -0700251 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400252 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000253 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 Walkinb33425f2017-07-14 14:59:52 +0400260 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000261 0, /* No PER visible constraints */
262 0, 0, /* Defined elsewhere */
263 &asn_SPC_field_specs_7 /* Additional specs */
264};
265
266static 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 Walkinb33425f2017-07-14 14:59:52 +0400272 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin171487e2006-03-21 07:25:18 +0000273 .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 Walkina7591b52014-10-12 18:37:35 -0700278static const ber_tlv_tag_t asn_DEF_Flag_16P1_tags_6[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000279 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
280};
Lev Walkina7591b52014-10-12 18:37:35 -0700281static const asn_TYPE_tag2member_t asn_MAP_Flag_16P1_tag2el_6[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700282 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* field */
Lev Walkin171487e2006-03-21 07:25:18 +0000283};
284static 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};
293asn_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 Walkinba68c912017-07-06 07:52:39 -0700303 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400304 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000305 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 Walkinb33425f2017-07-14 14:59:52 +0400312 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000313 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 Walkin22b5ed42006-09-13 02:51:20 +0000322#include "Flag.h"
Lev Walkin171487e2006-03-21 07:25:18 +0000323
324/*** <<< TYPE-DECLS [IntegerColorFlag] >>> ***/
325
326typedef Flag_16P0_t IntegerColorFlag_t;
327
328/*** <<< FUNC-DECLS [IntegerColorFlag] >>> ***/
329
330extern asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag;
331asn_struct_free_f IntegerColorFlag_free;
332asn_struct_print_f IntegerColorFlag_print;
333asn_constr_check_f IntegerColorFlag_constraint;
334ber_type_decoder_f IntegerColorFlag_decode_ber;
335der_type_encoder_f IntegerColorFlag_encode_der;
336xer_type_decoder_f IntegerColorFlag_decode_xer;
337xer_type_encoder_f IntegerColorFlag_encode_xer;
338
339/*** <<< CODE [IntegerColorFlag] >>> ***/
340
341int
342IntegerColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000343 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000344 /* Replace with underlying type checker */
345 td->check_constraints = asn_DEF_Flag_16P0.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000346 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin171487e2006-03-21 07:25:18 +0000347}
348
349/*
350 * This type is implemented using Flag_16P0,
351 * so here we adjust the DEF accordingly.
352 */
353static void
354IntegerColorFlag_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 Walkin6169b8d2013-12-07 11:02:44 -0800357 td->check_constraints = asn_DEF_Flag_16P0.check_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000358 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 Walkin9f5bb3a2006-08-18 01:46:46 +0000363 td->uper_encoder = asn_DEF_Flag_16P0.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700364 td->oer_decoder = asn_DEF_Flag_16P0.oer_decoder;
365 td->oer_encoder = asn_DEF_Flag_16P0.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400366 if(!td->oer_constraints)
367 td->oer_constraints = asn_DEF_Flag_16P0.oer_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000368 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
375void
376IntegerColorFlag_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
382int
383IntegerColorFlag_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
389asn_dec_rval_t
390IntegerColorFlag_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
396asn_enc_rval_t
397IntegerColorFlag_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
404asn_dec_rval_t
405IntegerColorFlag_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
411asn_enc_rval_t
412IntegerColorFlag_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 Walkina7591b52014-10-12 18:37:35 -0700422static const ber_tlv_tag_t asn_DEF_IntegerColorFlag_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000423 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
424};
425asn_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 Walkinba68c912017-07-06 07:52:39 -0700435 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400436 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000437 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 Walkinb33425f2017-07-14 14:59:52 +0400444 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000445 0, /* No PER visible constraints */
446 0, 0, /* Defined elsewhere */
447 0 /* No specifics */
448};
449
450
451/*** <<< INCLUDES [EnumeratedColorFlag] >>> ***/
452
Lev Walkin22b5ed42006-09-13 02:51:20 +0000453#include "Flag.h"
Lev Walkin171487e2006-03-21 07:25:18 +0000454
455/*** <<< TYPE-DECLS [EnumeratedColorFlag] >>> ***/
456
457typedef Flag_16P1_t EnumeratedColorFlag_t;
458
459/*** <<< FUNC-DECLS [EnumeratedColorFlag] >>> ***/
460
461extern asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag;
462asn_struct_free_f EnumeratedColorFlag_free;
463asn_struct_print_f EnumeratedColorFlag_print;
464asn_constr_check_f EnumeratedColorFlag_constraint;
465ber_type_decoder_f EnumeratedColorFlag_decode_ber;
466der_type_encoder_f EnumeratedColorFlag_encode_der;
467xer_type_decoder_f EnumeratedColorFlag_decode_xer;
468xer_type_encoder_f EnumeratedColorFlag_encode_xer;
469
470/*** <<< CODE [EnumeratedColorFlag] >>> ***/
471
472int
473EnumeratedColorFlag_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000474 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000475 /* Replace with underlying type checker */
476 td->check_constraints = asn_DEF_Flag_16P1.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000477 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin171487e2006-03-21 07:25:18 +0000478}
479
480/*
481 * This type is implemented using Flag_16P1,
482 * so here we adjust the DEF accordingly.
483 */
484static void
485EnumeratedColorFlag_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 Walkin6169b8d2013-12-07 11:02:44 -0800488 td->check_constraints = asn_DEF_Flag_16P1.check_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000489 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 Walkin9f5bb3a2006-08-18 01:46:46 +0000494 td->uper_encoder = asn_DEF_Flag_16P1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700495 td->oer_decoder = asn_DEF_Flag_16P1.oer_decoder;
496 td->oer_encoder = asn_DEF_Flag_16P1.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400497 if(!td->oer_constraints)
498 td->oer_constraints = asn_DEF_Flag_16P1.oer_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000499 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
506void
507EnumeratedColorFlag_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
513int
514EnumeratedColorFlag_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
520asn_dec_rval_t
521EnumeratedColorFlag_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
527asn_enc_rval_t
528EnumeratedColorFlag_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
535asn_dec_rval_t
536EnumeratedColorFlag_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
542asn_enc_rval_t
543EnumeratedColorFlag_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 Walkina7591b52014-10-12 18:37:35 -0700553static const ber_tlv_tag_t asn_DEF_EnumeratedColorFlag_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000554 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
555};
556asn_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 Walkinba68c912017-07-06 07:52:39 -0700566 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400567 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000568 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 Walkinb33425f2017-07-14 14:59:52 +0400575 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000576 0, /* No PER visible constraints */
577 0, 0, /* Defined elsewhere */
578 0 /* No specifics */
579};
580