blob: 7150662b9bf38b6e6fa40fe8ff6f1ac59d7f7453 [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;
Lev Walkinba68c912017-07-06 07:52:39 -070058 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
59 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinffe79f42010-10-25 00:10:34 -070060 if(!td->per_constraints)
61 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
62 td->elements = asn_DEF_ENUMERATED.elements;
63 td->elements_count = asn_DEF_ENUMERATED.elements_count;
64 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
65}
66
67void
68Enum1_free(asn_TYPE_descriptor_t *td,
69 void *struct_ptr, int contents_only) {
70 Enum1_1_inherit_TYPE_descriptor(td);
71 td->free_struct(td, struct_ptr, contents_only);
72}
73
74int
75Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
76 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
77 Enum1_1_inherit_TYPE_descriptor(td);
78 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
79}
80
81asn_dec_rval_t
82Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
83 void **structure, const void *bufptr, size_t size, int tag_mode) {
84 Enum1_1_inherit_TYPE_descriptor(td);
85 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
86}
87
88asn_enc_rval_t
89Enum1_encode_der(asn_TYPE_descriptor_t *td,
90 void *structure, int tag_mode, ber_tlv_tag_t tag,
91 asn_app_consume_bytes_f *cb, void *app_key) {
92 Enum1_1_inherit_TYPE_descriptor(td);
93 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
94}
95
96asn_dec_rval_t
97Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
98 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
99 Enum1_1_inherit_TYPE_descriptor(td);
100 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
101}
102
103asn_enc_rval_t
104Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
105 int ilevel, enum xer_encoder_flags_e flags,
106 asn_app_consume_bytes_f *cb, void *app_key) {
107 Enum1_1_inherit_TYPE_descriptor(td);
108 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
109}
110
111
112/*** <<< STAT-DEFS [Enum1] >>> ***/
113
Lev Walkina7591b52014-10-12 18:37:35 -0700114static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700115 { 0, 3, "red" },
116 { 1, 5, "green" },
117 { 4, 4, "blue" },
118 { 5, 5, "alpha" }
119 /* This list is extensible */
120};
Lev Walkina7591b52014-10-12 18:37:35 -0700121static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700122 3, /* alpha(5) */
123 2, /* blue(4) */
124 1, /* green(1) */
125 0 /* red(0) */
126 /* This list is extensible */
127};
johvike70c4072017-05-09 11:06:12 +0200128static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700129 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
130 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
131 4, /* Number of elements in the maps */
132 5, /* Extensions before this member */
133 1, /* Strict enumeration */
134 0, /* Native long size */
135 0
136};
Lev Walkina7591b52014-10-12 18:37:35 -0700137static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700138 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
139};
140asn_TYPE_descriptor_t asn_DEF_Enum1 = {
141 "Enum1",
142 "Enum1",
143 Enum1_free,
144 Enum1_print,
145 Enum1_constraint,
146 Enum1_decode_ber,
147 Enum1_encode_der,
148 Enum1_decode_xer,
149 Enum1_encode_xer,
150 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700151 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700152 0, /* Use generic outmost tag fetcher */
153 asn_DEF_Enum1_tags_1,
154 sizeof(asn_DEF_Enum1_tags_1)
155 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
156 asn_DEF_Enum1_tags_1, /* Same as above */
157 sizeof(asn_DEF_Enum1_tags_1)
158 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
159 0, /* No PER visible constraints */
160 0, 0, /* Defined elsewhere */
161 &asn_SPC_Enum1_specs_1 /* Additional specs */
162};
163
164
165/*** <<< INCLUDES [Enum2] >>> ***/
166
167#include <ENUMERATED.h>
168
169/*** <<< DEPS [Enum2] >>> ***/
170
171typedef enum Enum2 {
172 Enum2_red = 0,
173 Enum2_green = 1,
174 Enum2_blue = 45,
175 Enum2_orange = 23,
176 Enum2_alpha = 46,
177 /*
178 * Enumeration is extensible
179 */
180 Enum2_beta = 12,
181 Enum2_gamma = 103
182} e_Enum2;
183
184/*** <<< TYPE-DECLS [Enum2] >>> ***/
185
186typedef ENUMERATED_t Enum2_t;
187
188/*** <<< FUNC-DECLS [Enum2] >>> ***/
189
190extern asn_TYPE_descriptor_t asn_DEF_Enum2;
191asn_struct_free_f Enum2_free;
192asn_struct_print_f Enum2_print;
193asn_constr_check_f Enum2_constraint;
194ber_type_decoder_f Enum2_decode_ber;
195der_type_encoder_f Enum2_encode_der;
196xer_type_decoder_f Enum2_decode_xer;
197xer_type_encoder_f Enum2_encode_xer;
198
199/*** <<< CODE [Enum2] >>> ***/
200
201int
202Enum2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
203 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
204 /* Replace with underlying type checker */
205 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
206 return td->check_constraints(td, sptr, ctfailcb, app_key);
207}
208
209/*
210 * This type is implemented using ENUMERATED,
211 * so here we adjust the DEF accordingly.
212 */
213static void
214Enum2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
215 td->free_struct = asn_DEF_ENUMERATED.free_struct;
216 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800217 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700218 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
219 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
220 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
221 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
222 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
223 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700224 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
225 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinffe79f42010-10-25 00:10:34 -0700226 if(!td->per_constraints)
227 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
228 td->elements = asn_DEF_ENUMERATED.elements;
229 td->elements_count = asn_DEF_ENUMERATED.elements_count;
230 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
231}
232
233void
234Enum2_free(asn_TYPE_descriptor_t *td,
235 void *struct_ptr, int contents_only) {
236 Enum2_1_inherit_TYPE_descriptor(td);
237 td->free_struct(td, struct_ptr, contents_only);
238}
239
240int
241Enum2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
242 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
243 Enum2_1_inherit_TYPE_descriptor(td);
244 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
245}
246
247asn_dec_rval_t
248Enum2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
249 void **structure, const void *bufptr, size_t size, int tag_mode) {
250 Enum2_1_inherit_TYPE_descriptor(td);
251 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
252}
253
254asn_enc_rval_t
255Enum2_encode_der(asn_TYPE_descriptor_t *td,
256 void *structure, int tag_mode, ber_tlv_tag_t tag,
257 asn_app_consume_bytes_f *cb, void *app_key) {
258 Enum2_1_inherit_TYPE_descriptor(td);
259 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
260}
261
262asn_dec_rval_t
263Enum2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
264 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
265 Enum2_1_inherit_TYPE_descriptor(td);
266 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
267}
268
269asn_enc_rval_t
270Enum2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
271 int ilevel, enum xer_encoder_flags_e flags,
272 asn_app_consume_bytes_f *cb, void *app_key) {
273 Enum2_1_inherit_TYPE_descriptor(td);
274 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
275}
276
277
278/*** <<< STAT-DEFS [Enum2] >>> ***/
279
Lev Walkina7591b52014-10-12 18:37:35 -0700280static const asn_INTEGER_enum_map_t asn_MAP_Enum2_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700281 { 0, 3, "red" },
282 { 1, 5, "green" },
283 { 12, 4, "beta" },
284 { 23, 6, "orange" },
285 { 45, 4, "blue" },
286 { 46, 5, "alpha" },
287 { 103, 5, "gamma" }
288 /* This list is extensible */
289};
Lev Walkina7591b52014-10-12 18:37:35 -0700290static const unsigned int asn_MAP_Enum2_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700291 5, /* alpha(46) */
292 2, /* beta(12) */
293 4, /* blue(45) */
294 6, /* gamma(103) */
295 1, /* green(1) */
296 3, /* orange(23) */
297 0 /* red(0) */
298 /* This list is extensible */
299};
johvike70c4072017-05-09 11:06:12 +0200300static asn_INTEGER_specifics_t asn_SPC_Enum2_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700301 asn_MAP_Enum2_value2enum_1, /* "tag" => N; sorted by tag */
302 asn_MAP_Enum2_enum2value_1, /* N => "tag"; sorted by N */
303 7, /* Number of elements in the maps */
304 6, /* Extensions before this member */
305 1, /* Strict enumeration */
306 0, /* Native long size */
307 0
308};
Lev Walkina7591b52014-10-12 18:37:35 -0700309static const ber_tlv_tag_t asn_DEF_Enum2_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700310 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
311};
312asn_TYPE_descriptor_t asn_DEF_Enum2 = {
313 "Enum2",
314 "Enum2",
315 Enum2_free,
316 Enum2_print,
317 Enum2_constraint,
318 Enum2_decode_ber,
319 Enum2_encode_der,
320 Enum2_decode_xer,
321 Enum2_encode_xer,
322 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700323 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700324 0, /* Use generic outmost tag fetcher */
325 asn_DEF_Enum2_tags_1,
326 sizeof(asn_DEF_Enum2_tags_1)
327 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
328 asn_DEF_Enum2_tags_1, /* Same as above */
329 sizeof(asn_DEF_Enum2_tags_1)
330 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
331 0, /* No PER visible constraints */
332 0, 0, /* Defined elsewhere */
333 &asn_SPC_Enum2_specs_1 /* Additional specs */
334};
335
336
337/*** <<< INCLUDES [Enum3] >>> ***/
338
339#include <ENUMERATED.h>
340
341/*** <<< DEPS [Enum3] >>> ***/
342
343typedef enum Enum3 {
344 Enum3_a = 0,
345 Enum3_b = 3,
346 /*
347 * Enumeration is extensible
348 */
349 Enum3_c = 1
350} e_Enum3;
351
352/*** <<< TYPE-DECLS [Enum3] >>> ***/
353
354typedef ENUMERATED_t Enum3_t;
355
356/*** <<< FUNC-DECLS [Enum3] >>> ***/
357
358extern asn_TYPE_descriptor_t asn_DEF_Enum3;
359asn_struct_free_f Enum3_free;
360asn_struct_print_f Enum3_print;
361asn_constr_check_f Enum3_constraint;
362ber_type_decoder_f Enum3_decode_ber;
363der_type_encoder_f Enum3_encode_der;
364xer_type_decoder_f Enum3_decode_xer;
365xer_type_encoder_f Enum3_encode_xer;
366
367/*** <<< CODE [Enum3] >>> ***/
368
369int
370Enum3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
371 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
372 /* Replace with underlying type checker */
373 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
374 return td->check_constraints(td, sptr, ctfailcb, app_key);
375}
376
377/*
378 * This type is implemented using ENUMERATED,
379 * so here we adjust the DEF accordingly.
380 */
381static void
382Enum3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
383 td->free_struct = asn_DEF_ENUMERATED.free_struct;
384 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800385 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700386 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
387 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
388 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
389 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
390 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
391 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700392 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
393 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinffe79f42010-10-25 00:10:34 -0700394 if(!td->per_constraints)
395 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
396 td->elements = asn_DEF_ENUMERATED.elements;
397 td->elements_count = asn_DEF_ENUMERATED.elements_count;
398 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
399}
400
401void
402Enum3_free(asn_TYPE_descriptor_t *td,
403 void *struct_ptr, int contents_only) {
404 Enum3_1_inherit_TYPE_descriptor(td);
405 td->free_struct(td, struct_ptr, contents_only);
406}
407
408int
409Enum3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
410 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
411 Enum3_1_inherit_TYPE_descriptor(td);
412 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
413}
414
415asn_dec_rval_t
416Enum3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
417 void **structure, const void *bufptr, size_t size, int tag_mode) {
418 Enum3_1_inherit_TYPE_descriptor(td);
419 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
420}
421
422asn_enc_rval_t
423Enum3_encode_der(asn_TYPE_descriptor_t *td,
424 void *structure, int tag_mode, ber_tlv_tag_t tag,
425 asn_app_consume_bytes_f *cb, void *app_key) {
426 Enum3_1_inherit_TYPE_descriptor(td);
427 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
428}
429
430asn_dec_rval_t
431Enum3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
432 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
433 Enum3_1_inherit_TYPE_descriptor(td);
434 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
435}
436
437asn_enc_rval_t
438Enum3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
439 int ilevel, enum xer_encoder_flags_e flags,
440 asn_app_consume_bytes_f *cb, void *app_key) {
441 Enum3_1_inherit_TYPE_descriptor(td);
442 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
443}
444
445
446/*** <<< STAT-DEFS [Enum3] >>> ***/
447
Lev Walkina7591b52014-10-12 18:37:35 -0700448static const asn_INTEGER_enum_map_t asn_MAP_Enum3_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700449 { 0, 1, "a" },
450 { 1, 1, "c" },
451 { 3, 1, "b" }
452 /* This list is extensible */
453};
Lev Walkina7591b52014-10-12 18:37:35 -0700454static const unsigned int asn_MAP_Enum3_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700455 0, /* a(0) */
456 2, /* b(3) */
457 1 /* c(1) */
458 /* This list is extensible */
459};
johvike70c4072017-05-09 11:06:12 +0200460static asn_INTEGER_specifics_t asn_SPC_Enum3_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700461 asn_MAP_Enum3_value2enum_1, /* "tag" => N; sorted by tag */
462 asn_MAP_Enum3_enum2value_1, /* N => "tag"; sorted by N */
463 3, /* Number of elements in the maps */
464 3, /* Extensions before this member */
465 1, /* Strict enumeration */
466 0, /* Native long size */
467 0
468};
Lev Walkina7591b52014-10-12 18:37:35 -0700469static const ber_tlv_tag_t asn_DEF_Enum3_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700470 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
471};
472asn_TYPE_descriptor_t asn_DEF_Enum3 = {
473 "Enum3",
474 "Enum3",
475 Enum3_free,
476 Enum3_print,
477 Enum3_constraint,
478 Enum3_decode_ber,
479 Enum3_encode_der,
480 Enum3_decode_xer,
481 Enum3_encode_xer,
482 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700483 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700484 0, /* Use generic outmost tag fetcher */
485 asn_DEF_Enum3_tags_1,
486 sizeof(asn_DEF_Enum3_tags_1)
487 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
488 asn_DEF_Enum3_tags_1, /* Same as above */
489 sizeof(asn_DEF_Enum3_tags_1)
490 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
491 0, /* No PER visible constraints */
492 0, 0, /* Defined elsewhere */
493 &asn_SPC_Enum3_specs_1 /* Additional specs */
494};
495
496
497/*** <<< INCLUDES [Enum4] >>> ***/
498
499#include <ENUMERATED.h>
500
501/*** <<< DEPS [Enum4] >>> ***/
502
503typedef enum Enum4 {
504 Enum4_a = 0,
505 Enum4_b = 1,
506 /*
507 * Enumeration is extensible
508 */
509 Enum4_c = 3,
510 Enum4_d = 4
511} e_Enum4;
512
513/*** <<< TYPE-DECLS [Enum4] >>> ***/
514
515typedef ENUMERATED_t Enum4_t;
516
517/*** <<< FUNC-DECLS [Enum4] >>> ***/
518
519extern asn_TYPE_descriptor_t asn_DEF_Enum4;
520asn_struct_free_f Enum4_free;
521asn_struct_print_f Enum4_print;
522asn_constr_check_f Enum4_constraint;
523ber_type_decoder_f Enum4_decode_ber;
524der_type_encoder_f Enum4_encode_der;
525xer_type_decoder_f Enum4_decode_xer;
526xer_type_encoder_f Enum4_encode_xer;
527
528/*** <<< CODE [Enum4] >>> ***/
529
530int
531Enum4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
532 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
533 /* Replace with underlying type checker */
534 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
535 return td->check_constraints(td, sptr, ctfailcb, app_key);
536}
537
538/*
539 * This type is implemented using ENUMERATED,
540 * so here we adjust the DEF accordingly.
541 */
542static void
543Enum4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
544 td->free_struct = asn_DEF_ENUMERATED.free_struct;
545 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800546 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700547 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
548 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
549 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
550 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
551 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
552 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700553 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
554 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinffe79f42010-10-25 00:10:34 -0700555 if(!td->per_constraints)
556 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
557 td->elements = asn_DEF_ENUMERATED.elements;
558 td->elements_count = asn_DEF_ENUMERATED.elements_count;
559 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
560}
561
562void
563Enum4_free(asn_TYPE_descriptor_t *td,
564 void *struct_ptr, int contents_only) {
565 Enum4_1_inherit_TYPE_descriptor(td);
566 td->free_struct(td, struct_ptr, contents_only);
567}
568
569int
570Enum4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
571 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
572 Enum4_1_inherit_TYPE_descriptor(td);
573 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
574}
575
576asn_dec_rval_t
577Enum4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
578 void **structure, const void *bufptr, size_t size, int tag_mode) {
579 Enum4_1_inherit_TYPE_descriptor(td);
580 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
581}
582
583asn_enc_rval_t
584Enum4_encode_der(asn_TYPE_descriptor_t *td,
585 void *structure, int tag_mode, ber_tlv_tag_t tag,
586 asn_app_consume_bytes_f *cb, void *app_key) {
587 Enum4_1_inherit_TYPE_descriptor(td);
588 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
589}
590
591asn_dec_rval_t
592Enum4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
593 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
594 Enum4_1_inherit_TYPE_descriptor(td);
595 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
596}
597
598asn_enc_rval_t
599Enum4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
600 int ilevel, enum xer_encoder_flags_e flags,
601 asn_app_consume_bytes_f *cb, void *app_key) {
602 Enum4_1_inherit_TYPE_descriptor(td);
603 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
604}
605
606
607/*** <<< STAT-DEFS [Enum4] >>> ***/
608
Lev Walkina7591b52014-10-12 18:37:35 -0700609static const asn_INTEGER_enum_map_t asn_MAP_Enum4_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700610 { 0, 1, "a" },
611 { 1, 1, "b" },
612 { 3, 1, "c" },
613 { 4, 1, "d" }
614 /* This list is extensible */
615};
Lev Walkina7591b52014-10-12 18:37:35 -0700616static const unsigned int asn_MAP_Enum4_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700617 0, /* a(0) */
618 1, /* b(1) */
619 2, /* c(3) */
620 3 /* d(4) */
621 /* This list is extensible */
622};
johvike70c4072017-05-09 11:06:12 +0200623static asn_INTEGER_specifics_t asn_SPC_Enum4_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700624 asn_MAP_Enum4_value2enum_1, /* "tag" => N; sorted by tag */
625 asn_MAP_Enum4_enum2value_1, /* N => "tag"; sorted by N */
626 4, /* Number of elements in the maps */
627 3, /* Extensions before this member */
628 1, /* Strict enumeration */
629 0, /* Native long size */
630 0
631};
Lev Walkina7591b52014-10-12 18:37:35 -0700632static const ber_tlv_tag_t asn_DEF_Enum4_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700633 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
634};
635asn_TYPE_descriptor_t asn_DEF_Enum4 = {
636 "Enum4",
637 "Enum4",
638 Enum4_free,
639 Enum4_print,
640 Enum4_constraint,
641 Enum4_decode_ber,
642 Enum4_encode_der,
643 Enum4_decode_xer,
644 Enum4_encode_xer,
645 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700646 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700647 0, /* Use generic outmost tag fetcher */
648 asn_DEF_Enum4_tags_1,
649 sizeof(asn_DEF_Enum4_tags_1)
650 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
651 asn_DEF_Enum4_tags_1, /* Same as above */
652 sizeof(asn_DEF_Enum4_tags_1)
653 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
654 0, /* No PER visible constraints */
655 0, 0, /* Defined elsewhere */
656 &asn_SPC_Enum4_specs_1 /* Additional specs */
657};
658
659
660/*** <<< INCLUDES [Enum5] >>> ***/
661
662#include <ENUMERATED.h>
663
664/*** <<< DEPS [Enum5] >>> ***/
665
666typedef enum Enum5 {
667 Enum5_a = 0,
668 Enum5_z = 25,
669 /*
670 * Enumeration is extensible
671 */
672 Enum5_d = 26
673} e_Enum5;
674
675/*** <<< TYPE-DECLS [Enum5] >>> ***/
676
677typedef ENUMERATED_t Enum5_t;
678
679/*** <<< FUNC-DECLS [Enum5] >>> ***/
680
681extern asn_TYPE_descriptor_t asn_DEF_Enum5;
682asn_struct_free_f Enum5_free;
683asn_struct_print_f Enum5_print;
684asn_constr_check_f Enum5_constraint;
685ber_type_decoder_f Enum5_decode_ber;
686der_type_encoder_f Enum5_encode_der;
687xer_type_decoder_f Enum5_decode_xer;
688xer_type_encoder_f Enum5_encode_xer;
689
690/*** <<< CODE [Enum5] >>> ***/
691
692int
693Enum5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
694 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
695 /* Replace with underlying type checker */
696 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
697 return td->check_constraints(td, sptr, ctfailcb, app_key);
698}
699
700/*
701 * This type is implemented using ENUMERATED,
702 * so here we adjust the DEF accordingly.
703 */
704static void
705Enum5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
706 td->free_struct = asn_DEF_ENUMERATED.free_struct;
707 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800708 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700709 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
710 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
711 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
712 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
713 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
714 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700715 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
716 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinffe79f42010-10-25 00:10:34 -0700717 if(!td->per_constraints)
718 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
719 td->elements = asn_DEF_ENUMERATED.elements;
720 td->elements_count = asn_DEF_ENUMERATED.elements_count;
721 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
722}
723
724void
725Enum5_free(asn_TYPE_descriptor_t *td,
726 void *struct_ptr, int contents_only) {
727 Enum5_1_inherit_TYPE_descriptor(td);
728 td->free_struct(td, struct_ptr, contents_only);
729}
730
731int
732Enum5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
733 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
734 Enum5_1_inherit_TYPE_descriptor(td);
735 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
736}
737
738asn_dec_rval_t
739Enum5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
740 void **structure, const void *bufptr, size_t size, int tag_mode) {
741 Enum5_1_inherit_TYPE_descriptor(td);
742 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
743}
744
745asn_enc_rval_t
746Enum5_encode_der(asn_TYPE_descriptor_t *td,
747 void *structure, int tag_mode, ber_tlv_tag_t tag,
748 asn_app_consume_bytes_f *cb, void *app_key) {
749 Enum5_1_inherit_TYPE_descriptor(td);
750 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
751}
752
753asn_dec_rval_t
754Enum5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
755 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
756 Enum5_1_inherit_TYPE_descriptor(td);
757 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
758}
759
760asn_enc_rval_t
761Enum5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
762 int ilevel, enum xer_encoder_flags_e flags,
763 asn_app_consume_bytes_f *cb, void *app_key) {
764 Enum5_1_inherit_TYPE_descriptor(td);
765 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
766}
767
768
769/*** <<< STAT-DEFS [Enum5] >>> ***/
770
Lev Walkina7591b52014-10-12 18:37:35 -0700771static const asn_INTEGER_enum_map_t asn_MAP_Enum5_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700772 { 0, 1, "a" },
773 { 25, 1, "z" },
774 { 26, 1, "d" }
775 /* This list is extensible */
776};
Lev Walkina7591b52014-10-12 18:37:35 -0700777static const unsigned int asn_MAP_Enum5_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700778 0, /* a(0) */
779 2, /* d(26) */
780 1 /* z(25) */
781 /* This list is extensible */
782};
johvike70c4072017-05-09 11:06:12 +0200783static asn_INTEGER_specifics_t asn_SPC_Enum5_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700784 asn_MAP_Enum5_value2enum_1, /* "tag" => N; sorted by tag */
785 asn_MAP_Enum5_enum2value_1, /* N => "tag"; sorted by N */
786 3, /* Number of elements in the maps */
787 3, /* Extensions before this member */
788 1, /* Strict enumeration */
789 0, /* Native long size */
790 0
791};
Lev Walkina7591b52014-10-12 18:37:35 -0700792static const ber_tlv_tag_t asn_DEF_Enum5_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700793 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
794};
795asn_TYPE_descriptor_t asn_DEF_Enum5 = {
796 "Enum5",
797 "Enum5",
798 Enum5_free,
799 Enum5_print,
800 Enum5_constraint,
801 Enum5_decode_ber,
802 Enum5_encode_der,
803 Enum5_decode_xer,
804 Enum5_encode_xer,
805 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkina46ab9c2017-07-06 07:57:15 -0700806 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700807 0, /* Use generic outmost tag fetcher */
808 asn_DEF_Enum5_tags_1,
809 sizeof(asn_DEF_Enum5_tags_1)
810 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
811 asn_DEF_Enum5_tags_1, /* Same as above */
812 sizeof(asn_DEF_Enum5_tags_1)
813 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
814 0, /* No PER visible constraints */
815 0, 0, /* Defined elsewhere */
816 &asn_SPC_Enum5_specs_1 /* Additional specs */
817};
818