blob: 076ae0f76329edfe044e38738769cfc458fb84ca [file] [log] [blame]
Lev Walkinffe79f42010-10-25 00:10:34 -07001
2/*** <<< INCLUDES [Enum1] >>> ***/
3
4#include <ENUMERATED.h>
5
6/*** <<< DEPS [Enum1] >>> ***/
7
8typedef enum Enum1 {
9 Enum1_red = 0,
10 Enum1_green = 1,
11 Enum1_blue = 4,
12 Enum1_alpha = 5
13 /*
14 * Enumeration is extensible
15 */
16} e_Enum1;
17
18/*** <<< TYPE-DECLS [Enum1] >>> ***/
19
20typedef ENUMERATED_t Enum1_t;
21
22/*** <<< FUNC-DECLS [Enum1] >>> ***/
23
24extern asn_TYPE_descriptor_t asn_DEF_Enum1;
25asn_struct_free_f Enum1_free;
26asn_struct_print_f Enum1_print;
27asn_constr_check_f Enum1_constraint;
28ber_type_decoder_f Enum1_decode_ber;
29der_type_encoder_f Enum1_encode_der;
30xer_type_decoder_f Enum1_decode_xer;
31xer_type_encoder_f Enum1_encode_xer;
32
33/*** <<< CODE [Enum1] >>> ***/
34
35int
36Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
37 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
38 /* Replace with underlying type checker */
39 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
40 return td->check_constraints(td, sptr, ctfailcb, app_key);
41}
42
43/*
44 * This type is implemented using ENUMERATED,
45 * so here we adjust the DEF accordingly.
46 */
47static void
48Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
49 td->free_struct = asn_DEF_ENUMERATED.free_struct;
50 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -080051 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -070052 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
53 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
54 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
55 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
56 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
57 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
58 if(!td->per_constraints)
59 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
60 td->elements = asn_DEF_ENUMERATED.elements;
61 td->elements_count = asn_DEF_ENUMERATED.elements_count;
62 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
63}
64
65void
66Enum1_free(asn_TYPE_descriptor_t *td,
67 void *struct_ptr, int contents_only) {
68 Enum1_1_inherit_TYPE_descriptor(td);
69 td->free_struct(td, struct_ptr, contents_only);
70}
71
72int
73Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
74 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
75 Enum1_1_inherit_TYPE_descriptor(td);
76 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
77}
78
79asn_dec_rval_t
80Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
81 void **structure, const void *bufptr, size_t size, int tag_mode) {
82 Enum1_1_inherit_TYPE_descriptor(td);
83 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
84}
85
86asn_enc_rval_t
87Enum1_encode_der(asn_TYPE_descriptor_t *td,
88 void *structure, int tag_mode, ber_tlv_tag_t tag,
89 asn_app_consume_bytes_f *cb, void *app_key) {
90 Enum1_1_inherit_TYPE_descriptor(td);
91 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
92}
93
94asn_dec_rval_t
95Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
96 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
97 Enum1_1_inherit_TYPE_descriptor(td);
98 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
99}
100
101asn_enc_rval_t
102Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
103 int ilevel, enum xer_encoder_flags_e flags,
104 asn_app_consume_bytes_f *cb, void *app_key) {
105 Enum1_1_inherit_TYPE_descriptor(td);
106 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
107}
108
109
110/*** <<< STAT-DEFS [Enum1] >>> ***/
111
Lev Walkina7591b52014-10-12 18:37:35 -0700112static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700113 { 0, 3, "red" },
114 { 1, 5, "green" },
115 { 4, 4, "blue" },
116 { 5, 5, "alpha" }
117 /* This list is extensible */
118};
Lev Walkina7591b52014-10-12 18:37:35 -0700119static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700120 3, /* alpha(5) */
121 2, /* blue(4) */
122 1, /* green(1) */
123 0 /* red(0) */
124 /* This list is extensible */
125};
johvike70c4072017-05-09 11:06:12 +0200126static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700127 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
128 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
129 4, /* Number of elements in the maps */
130 5, /* Extensions before this member */
131 1, /* Strict enumeration */
132 0, /* Native long size */
133 0
134};
Lev Walkina7591b52014-10-12 18:37:35 -0700135static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700136 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
137};
138asn_TYPE_descriptor_t asn_DEF_Enum1 = {
139 "Enum1",
140 "Enum1",
141 Enum1_free,
142 Enum1_print,
143 Enum1_constraint,
144 Enum1_decode_ber,
145 Enum1_encode_der,
146 Enum1_decode_xer,
147 Enum1_encode_xer,
148 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700149 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700150 0, /* Use generic outmost tag fetcher */
151 asn_DEF_Enum1_tags_1,
152 sizeof(asn_DEF_Enum1_tags_1)
153 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
154 asn_DEF_Enum1_tags_1, /* Same as above */
155 sizeof(asn_DEF_Enum1_tags_1)
156 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
157 0, /* No PER visible constraints */
158 0, 0, /* Defined elsewhere */
159 &asn_SPC_Enum1_specs_1 /* Additional specs */
160};
161
162
163/*** <<< INCLUDES [Enum2] >>> ***/
164
165#include <ENUMERATED.h>
166
167/*** <<< DEPS [Enum2] >>> ***/
168
169typedef enum Enum2 {
170 Enum2_red = 0,
171 Enum2_green = 1,
172 Enum2_blue = 45,
173 Enum2_orange = 23,
174 Enum2_alpha = 46,
175 /*
176 * Enumeration is extensible
177 */
178 Enum2_beta = 12,
179 Enum2_gamma = 103
180} e_Enum2;
181
182/*** <<< TYPE-DECLS [Enum2] >>> ***/
183
184typedef ENUMERATED_t Enum2_t;
185
186/*** <<< FUNC-DECLS [Enum2] >>> ***/
187
188extern asn_TYPE_descriptor_t asn_DEF_Enum2;
189asn_struct_free_f Enum2_free;
190asn_struct_print_f Enum2_print;
191asn_constr_check_f Enum2_constraint;
192ber_type_decoder_f Enum2_decode_ber;
193der_type_encoder_f Enum2_encode_der;
194xer_type_decoder_f Enum2_decode_xer;
195xer_type_encoder_f Enum2_encode_xer;
196
197/*** <<< CODE [Enum2] >>> ***/
198
199int
200Enum2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
201 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
202 /* Replace with underlying type checker */
203 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
204 return td->check_constraints(td, sptr, ctfailcb, app_key);
205}
206
207/*
208 * This type is implemented using ENUMERATED,
209 * so here we adjust the DEF accordingly.
210 */
211static void
212Enum2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
213 td->free_struct = asn_DEF_ENUMERATED.free_struct;
214 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800215 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700216 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
217 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
218 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
219 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
220 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
221 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
222 if(!td->per_constraints)
223 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
224 td->elements = asn_DEF_ENUMERATED.elements;
225 td->elements_count = asn_DEF_ENUMERATED.elements_count;
226 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
227}
228
229void
230Enum2_free(asn_TYPE_descriptor_t *td,
231 void *struct_ptr, int contents_only) {
232 Enum2_1_inherit_TYPE_descriptor(td);
233 td->free_struct(td, struct_ptr, contents_only);
234}
235
236int
237Enum2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
238 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
239 Enum2_1_inherit_TYPE_descriptor(td);
240 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
241}
242
243asn_dec_rval_t
244Enum2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
245 void **structure, const void *bufptr, size_t size, int tag_mode) {
246 Enum2_1_inherit_TYPE_descriptor(td);
247 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
248}
249
250asn_enc_rval_t
251Enum2_encode_der(asn_TYPE_descriptor_t *td,
252 void *structure, int tag_mode, ber_tlv_tag_t tag,
253 asn_app_consume_bytes_f *cb, void *app_key) {
254 Enum2_1_inherit_TYPE_descriptor(td);
255 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
256}
257
258asn_dec_rval_t
259Enum2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
260 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
261 Enum2_1_inherit_TYPE_descriptor(td);
262 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
263}
264
265asn_enc_rval_t
266Enum2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
267 int ilevel, enum xer_encoder_flags_e flags,
268 asn_app_consume_bytes_f *cb, void *app_key) {
269 Enum2_1_inherit_TYPE_descriptor(td);
270 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
271}
272
273
274/*** <<< STAT-DEFS [Enum2] >>> ***/
275
Lev Walkina7591b52014-10-12 18:37:35 -0700276static const asn_INTEGER_enum_map_t asn_MAP_Enum2_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700277 { 0, 3, "red" },
278 { 1, 5, "green" },
279 { 12, 4, "beta" },
280 { 23, 6, "orange" },
281 { 45, 4, "blue" },
282 { 46, 5, "alpha" },
283 { 103, 5, "gamma" }
284 /* This list is extensible */
285};
Lev Walkina7591b52014-10-12 18:37:35 -0700286static const unsigned int asn_MAP_Enum2_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700287 5, /* alpha(46) */
288 2, /* beta(12) */
289 4, /* blue(45) */
290 6, /* gamma(103) */
291 1, /* green(1) */
292 3, /* orange(23) */
293 0 /* red(0) */
294 /* This list is extensible */
295};
johvike70c4072017-05-09 11:06:12 +0200296static asn_INTEGER_specifics_t asn_SPC_Enum2_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700297 asn_MAP_Enum2_value2enum_1, /* "tag" => N; sorted by tag */
298 asn_MAP_Enum2_enum2value_1, /* N => "tag"; sorted by N */
299 7, /* Number of elements in the maps */
300 6, /* Extensions before this member */
301 1, /* Strict enumeration */
302 0, /* Native long size */
303 0
304};
Lev Walkina7591b52014-10-12 18:37:35 -0700305static const ber_tlv_tag_t asn_DEF_Enum2_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700306 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
307};
308asn_TYPE_descriptor_t asn_DEF_Enum2 = {
309 "Enum2",
310 "Enum2",
311 Enum2_free,
312 Enum2_print,
313 Enum2_constraint,
314 Enum2_decode_ber,
315 Enum2_encode_der,
316 Enum2_decode_xer,
317 Enum2_encode_xer,
318 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700319 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700320 0, /* Use generic outmost tag fetcher */
321 asn_DEF_Enum2_tags_1,
322 sizeof(asn_DEF_Enum2_tags_1)
323 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
324 asn_DEF_Enum2_tags_1, /* Same as above */
325 sizeof(asn_DEF_Enum2_tags_1)
326 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
327 0, /* No PER visible constraints */
328 0, 0, /* Defined elsewhere */
329 &asn_SPC_Enum2_specs_1 /* Additional specs */
330};
331
332
333/*** <<< INCLUDES [Enum3] >>> ***/
334
335#include <ENUMERATED.h>
336
337/*** <<< DEPS [Enum3] >>> ***/
338
339typedef enum Enum3 {
340 Enum3_a = 0,
341 Enum3_b = 3,
342 /*
343 * Enumeration is extensible
344 */
345 Enum3_c = 1
346} e_Enum3;
347
348/*** <<< TYPE-DECLS [Enum3] >>> ***/
349
350typedef ENUMERATED_t Enum3_t;
351
352/*** <<< FUNC-DECLS [Enum3] >>> ***/
353
354extern asn_TYPE_descriptor_t asn_DEF_Enum3;
355asn_struct_free_f Enum3_free;
356asn_struct_print_f Enum3_print;
357asn_constr_check_f Enum3_constraint;
358ber_type_decoder_f Enum3_decode_ber;
359der_type_encoder_f Enum3_encode_der;
360xer_type_decoder_f Enum3_decode_xer;
361xer_type_encoder_f Enum3_encode_xer;
362
363/*** <<< CODE [Enum3] >>> ***/
364
365int
366Enum3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
367 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
368 /* Replace with underlying type checker */
369 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
370 return td->check_constraints(td, sptr, ctfailcb, app_key);
371}
372
373/*
374 * This type is implemented using ENUMERATED,
375 * so here we adjust the DEF accordingly.
376 */
377static void
378Enum3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
379 td->free_struct = asn_DEF_ENUMERATED.free_struct;
380 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800381 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700382 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
383 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
384 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
385 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
386 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
387 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
388 if(!td->per_constraints)
389 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
390 td->elements = asn_DEF_ENUMERATED.elements;
391 td->elements_count = asn_DEF_ENUMERATED.elements_count;
392 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
393}
394
395void
396Enum3_free(asn_TYPE_descriptor_t *td,
397 void *struct_ptr, int contents_only) {
398 Enum3_1_inherit_TYPE_descriptor(td);
399 td->free_struct(td, struct_ptr, contents_only);
400}
401
402int
403Enum3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
404 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
405 Enum3_1_inherit_TYPE_descriptor(td);
406 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
407}
408
409asn_dec_rval_t
410Enum3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
411 void **structure, const void *bufptr, size_t size, int tag_mode) {
412 Enum3_1_inherit_TYPE_descriptor(td);
413 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
414}
415
416asn_enc_rval_t
417Enum3_encode_der(asn_TYPE_descriptor_t *td,
418 void *structure, int tag_mode, ber_tlv_tag_t tag,
419 asn_app_consume_bytes_f *cb, void *app_key) {
420 Enum3_1_inherit_TYPE_descriptor(td);
421 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
422}
423
424asn_dec_rval_t
425Enum3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
426 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
427 Enum3_1_inherit_TYPE_descriptor(td);
428 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
429}
430
431asn_enc_rval_t
432Enum3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
433 int ilevel, enum xer_encoder_flags_e flags,
434 asn_app_consume_bytes_f *cb, void *app_key) {
435 Enum3_1_inherit_TYPE_descriptor(td);
436 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
437}
438
439
440/*** <<< STAT-DEFS [Enum3] >>> ***/
441
Lev Walkina7591b52014-10-12 18:37:35 -0700442static const asn_INTEGER_enum_map_t asn_MAP_Enum3_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700443 { 0, 1, "a" },
444 { 1, 1, "c" },
445 { 3, 1, "b" }
446 /* This list is extensible */
447};
Lev Walkina7591b52014-10-12 18:37:35 -0700448static const unsigned int asn_MAP_Enum3_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700449 0, /* a(0) */
450 2, /* b(3) */
451 1 /* c(1) */
452 /* This list is extensible */
453};
johvike70c4072017-05-09 11:06:12 +0200454static asn_INTEGER_specifics_t asn_SPC_Enum3_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700455 asn_MAP_Enum3_value2enum_1, /* "tag" => N; sorted by tag */
456 asn_MAP_Enum3_enum2value_1, /* N => "tag"; sorted by N */
457 3, /* Number of elements in the maps */
458 3, /* Extensions before this member */
459 1, /* Strict enumeration */
460 0, /* Native long size */
461 0
462};
Lev Walkina7591b52014-10-12 18:37:35 -0700463static const ber_tlv_tag_t asn_DEF_Enum3_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700464 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
465};
466asn_TYPE_descriptor_t asn_DEF_Enum3 = {
467 "Enum3",
468 "Enum3",
469 Enum3_free,
470 Enum3_print,
471 Enum3_constraint,
472 Enum3_decode_ber,
473 Enum3_encode_der,
474 Enum3_decode_xer,
475 Enum3_encode_xer,
476 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700477 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700478 0, /* Use generic outmost tag fetcher */
479 asn_DEF_Enum3_tags_1,
480 sizeof(asn_DEF_Enum3_tags_1)
481 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
482 asn_DEF_Enum3_tags_1, /* Same as above */
483 sizeof(asn_DEF_Enum3_tags_1)
484 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
485 0, /* No PER visible constraints */
486 0, 0, /* Defined elsewhere */
487 &asn_SPC_Enum3_specs_1 /* Additional specs */
488};
489
490
491/*** <<< INCLUDES [Enum4] >>> ***/
492
493#include <ENUMERATED.h>
494
495/*** <<< DEPS [Enum4] >>> ***/
496
497typedef enum Enum4 {
498 Enum4_a = 0,
499 Enum4_b = 1,
500 /*
501 * Enumeration is extensible
502 */
503 Enum4_c = 3,
504 Enum4_d = 4
505} e_Enum4;
506
507/*** <<< TYPE-DECLS [Enum4] >>> ***/
508
509typedef ENUMERATED_t Enum4_t;
510
511/*** <<< FUNC-DECLS [Enum4] >>> ***/
512
513extern asn_TYPE_descriptor_t asn_DEF_Enum4;
514asn_struct_free_f Enum4_free;
515asn_struct_print_f Enum4_print;
516asn_constr_check_f Enum4_constraint;
517ber_type_decoder_f Enum4_decode_ber;
518der_type_encoder_f Enum4_encode_der;
519xer_type_decoder_f Enum4_decode_xer;
520xer_type_encoder_f Enum4_encode_xer;
521
522/*** <<< CODE [Enum4] >>> ***/
523
524int
525Enum4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
526 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
527 /* Replace with underlying type checker */
528 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
529 return td->check_constraints(td, sptr, ctfailcb, app_key);
530}
531
532/*
533 * This type is implemented using ENUMERATED,
534 * so here we adjust the DEF accordingly.
535 */
536static void
537Enum4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
538 td->free_struct = asn_DEF_ENUMERATED.free_struct;
539 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800540 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700541 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
542 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
543 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
544 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
545 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
546 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
547 if(!td->per_constraints)
548 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
549 td->elements = asn_DEF_ENUMERATED.elements;
550 td->elements_count = asn_DEF_ENUMERATED.elements_count;
551 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
552}
553
554void
555Enum4_free(asn_TYPE_descriptor_t *td,
556 void *struct_ptr, int contents_only) {
557 Enum4_1_inherit_TYPE_descriptor(td);
558 td->free_struct(td, struct_ptr, contents_only);
559}
560
561int
562Enum4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
563 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
564 Enum4_1_inherit_TYPE_descriptor(td);
565 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
566}
567
568asn_dec_rval_t
569Enum4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
570 void **structure, const void *bufptr, size_t size, int tag_mode) {
571 Enum4_1_inherit_TYPE_descriptor(td);
572 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
573}
574
575asn_enc_rval_t
576Enum4_encode_der(asn_TYPE_descriptor_t *td,
577 void *structure, int tag_mode, ber_tlv_tag_t tag,
578 asn_app_consume_bytes_f *cb, void *app_key) {
579 Enum4_1_inherit_TYPE_descriptor(td);
580 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
581}
582
583asn_dec_rval_t
584Enum4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
585 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
586 Enum4_1_inherit_TYPE_descriptor(td);
587 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
588}
589
590asn_enc_rval_t
591Enum4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
592 int ilevel, enum xer_encoder_flags_e flags,
593 asn_app_consume_bytes_f *cb, void *app_key) {
594 Enum4_1_inherit_TYPE_descriptor(td);
595 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
596}
597
598
599/*** <<< STAT-DEFS [Enum4] >>> ***/
600
Lev Walkina7591b52014-10-12 18:37:35 -0700601static const asn_INTEGER_enum_map_t asn_MAP_Enum4_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700602 { 0, 1, "a" },
603 { 1, 1, "b" },
604 { 3, 1, "c" },
605 { 4, 1, "d" }
606 /* This list is extensible */
607};
Lev Walkina7591b52014-10-12 18:37:35 -0700608static const unsigned int asn_MAP_Enum4_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700609 0, /* a(0) */
610 1, /* b(1) */
611 2, /* c(3) */
612 3 /* d(4) */
613 /* This list is extensible */
614};
johvike70c4072017-05-09 11:06:12 +0200615static asn_INTEGER_specifics_t asn_SPC_Enum4_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700616 asn_MAP_Enum4_value2enum_1, /* "tag" => N; sorted by tag */
617 asn_MAP_Enum4_enum2value_1, /* N => "tag"; sorted by N */
618 4, /* Number of elements in the maps */
619 3, /* Extensions before this member */
620 1, /* Strict enumeration */
621 0, /* Native long size */
622 0
623};
Lev Walkina7591b52014-10-12 18:37:35 -0700624static const ber_tlv_tag_t asn_DEF_Enum4_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700625 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
626};
627asn_TYPE_descriptor_t asn_DEF_Enum4 = {
628 "Enum4",
629 "Enum4",
630 Enum4_free,
631 Enum4_print,
632 Enum4_constraint,
633 Enum4_decode_ber,
634 Enum4_encode_der,
635 Enum4_decode_xer,
636 Enum4_encode_xer,
637 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700638 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700639 0, /* Use generic outmost tag fetcher */
640 asn_DEF_Enum4_tags_1,
641 sizeof(asn_DEF_Enum4_tags_1)
642 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
643 asn_DEF_Enum4_tags_1, /* Same as above */
644 sizeof(asn_DEF_Enum4_tags_1)
645 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
646 0, /* No PER visible constraints */
647 0, 0, /* Defined elsewhere */
648 &asn_SPC_Enum4_specs_1 /* Additional specs */
649};
650
651
652/*** <<< INCLUDES [Enum5] >>> ***/
653
654#include <ENUMERATED.h>
655
656/*** <<< DEPS [Enum5] >>> ***/
657
658typedef enum Enum5 {
659 Enum5_a = 0,
660 Enum5_z = 25,
661 /*
662 * Enumeration is extensible
663 */
664 Enum5_d = 26
665} e_Enum5;
666
667/*** <<< TYPE-DECLS [Enum5] >>> ***/
668
669typedef ENUMERATED_t Enum5_t;
670
671/*** <<< FUNC-DECLS [Enum5] >>> ***/
672
673extern asn_TYPE_descriptor_t asn_DEF_Enum5;
674asn_struct_free_f Enum5_free;
675asn_struct_print_f Enum5_print;
676asn_constr_check_f Enum5_constraint;
677ber_type_decoder_f Enum5_decode_ber;
678der_type_encoder_f Enum5_encode_der;
679xer_type_decoder_f Enum5_decode_xer;
680xer_type_encoder_f Enum5_encode_xer;
681
682/*** <<< CODE [Enum5] >>> ***/
683
684int
685Enum5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
686 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
687 /* Replace with underlying type checker */
688 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
689 return td->check_constraints(td, sptr, ctfailcb, app_key);
690}
691
692/*
693 * This type is implemented using ENUMERATED,
694 * so here we adjust the DEF accordingly.
695 */
696static void
697Enum5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
698 td->free_struct = asn_DEF_ENUMERATED.free_struct;
699 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800700 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700701 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
702 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
703 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
704 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
705 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
706 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
707 if(!td->per_constraints)
708 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
709 td->elements = asn_DEF_ENUMERATED.elements;
710 td->elements_count = asn_DEF_ENUMERATED.elements_count;
711 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
712}
713
714void
715Enum5_free(asn_TYPE_descriptor_t *td,
716 void *struct_ptr, int contents_only) {
717 Enum5_1_inherit_TYPE_descriptor(td);
718 td->free_struct(td, struct_ptr, contents_only);
719}
720
721int
722Enum5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
723 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
724 Enum5_1_inherit_TYPE_descriptor(td);
725 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
726}
727
728asn_dec_rval_t
729Enum5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
730 void **structure, const void *bufptr, size_t size, int tag_mode) {
731 Enum5_1_inherit_TYPE_descriptor(td);
732 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
733}
734
735asn_enc_rval_t
736Enum5_encode_der(asn_TYPE_descriptor_t *td,
737 void *structure, int tag_mode, ber_tlv_tag_t tag,
738 asn_app_consume_bytes_f *cb, void *app_key) {
739 Enum5_1_inherit_TYPE_descriptor(td);
740 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
741}
742
743asn_dec_rval_t
744Enum5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
745 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
746 Enum5_1_inherit_TYPE_descriptor(td);
747 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
748}
749
750asn_enc_rval_t
751Enum5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
752 int ilevel, enum xer_encoder_flags_e flags,
753 asn_app_consume_bytes_f *cb, void *app_key) {
754 Enum5_1_inherit_TYPE_descriptor(td);
755 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
756}
757
758
759/*** <<< STAT-DEFS [Enum5] >>> ***/
760
Lev Walkina7591b52014-10-12 18:37:35 -0700761static const asn_INTEGER_enum_map_t asn_MAP_Enum5_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700762 { 0, 1, "a" },
763 { 25, 1, "z" },
764 { 26, 1, "d" }
765 /* This list is extensible */
766};
Lev Walkina7591b52014-10-12 18:37:35 -0700767static const unsigned int asn_MAP_Enum5_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700768 0, /* a(0) */
769 2, /* d(26) */
770 1 /* z(25) */
771 /* This list is extensible */
772};
johvike70c4072017-05-09 11:06:12 +0200773static asn_INTEGER_specifics_t asn_SPC_Enum5_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700774 asn_MAP_Enum5_value2enum_1, /* "tag" => N; sorted by tag */
775 asn_MAP_Enum5_enum2value_1, /* N => "tag"; sorted by N */
776 3, /* Number of elements in the maps */
777 3, /* Extensions before this member */
778 1, /* Strict enumeration */
779 0, /* Native long size */
780 0
781};
Lev Walkina7591b52014-10-12 18:37:35 -0700782static const ber_tlv_tag_t asn_DEF_Enum5_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700783 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
784};
785asn_TYPE_descriptor_t asn_DEF_Enum5 = {
786 "Enum5",
787 "Enum5",
788 Enum5_free,
789 Enum5_print,
790 Enum5_constraint,
791 Enum5_decode_ber,
792 Enum5_encode_der,
793 Enum5_decode_xer,
794 Enum5_encode_xer,
795 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700796 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700797 0, /* Use generic outmost tag fetcher */
798 asn_DEF_Enum5_tags_1,
799 sizeof(asn_DEF_Enum5_tags_1)
800 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
801 asn_DEF_Enum5_tags_1, /* Same as above */
802 sizeof(asn_DEF_Enum5_tags_1)
803 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
804 0, /* No PER visible constraints */
805 0, 0, /* Defined elsewhere */
806 &asn_SPC_Enum5_specs_1 /* Additional specs */
807};
808