blob: b525b54ee9bee9db1995153bfd0ab37c7950674b [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 Walkinb33425f2017-07-14 14:59:52 +040060 if(!td->oer_constraints)
61 td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -070062 if(!td->per_constraints)
63 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
64 td->elements = asn_DEF_ENUMERATED.elements;
65 td->elements_count = asn_DEF_ENUMERATED.elements_count;
66 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
67}
68
69void
70Enum1_free(asn_TYPE_descriptor_t *td,
71 void *struct_ptr, int contents_only) {
72 Enum1_1_inherit_TYPE_descriptor(td);
73 td->free_struct(td, struct_ptr, contents_only);
74}
75
76int
77Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
78 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
79 Enum1_1_inherit_TYPE_descriptor(td);
80 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
81}
82
83asn_dec_rval_t
84Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
85 void **structure, const void *bufptr, size_t size, int tag_mode) {
86 Enum1_1_inherit_TYPE_descriptor(td);
87 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
88}
89
90asn_enc_rval_t
91Enum1_encode_der(asn_TYPE_descriptor_t *td,
92 void *structure, int tag_mode, ber_tlv_tag_t tag,
93 asn_app_consume_bytes_f *cb, void *app_key) {
94 Enum1_1_inherit_TYPE_descriptor(td);
95 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
96}
97
98asn_dec_rval_t
99Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
100 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
101 Enum1_1_inherit_TYPE_descriptor(td);
102 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
103}
104
105asn_enc_rval_t
106Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
107 int ilevel, enum xer_encoder_flags_e flags,
108 asn_app_consume_bytes_f *cb, void *app_key) {
109 Enum1_1_inherit_TYPE_descriptor(td);
110 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
111}
112
113
114/*** <<< STAT-DEFS [Enum1] >>> ***/
115
Lev Walkina7591b52014-10-12 18:37:35 -0700116static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700117 { 0, 3, "red" },
118 { 1, 5, "green" },
119 { 4, 4, "blue" },
120 { 5, 5, "alpha" }
121 /* This list is extensible */
122};
Lev Walkina7591b52014-10-12 18:37:35 -0700123static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700124 3, /* alpha(5) */
125 2, /* blue(4) */
126 1, /* green(1) */
127 0 /* red(0) */
128 /* This list is extensible */
129};
johvike70c4072017-05-09 11:06:12 +0200130static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700131 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
132 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
133 4, /* Number of elements in the maps */
134 5, /* Extensions before this member */
135 1, /* Strict enumeration */
136 0, /* Native long size */
137 0
138};
Lev Walkina7591b52014-10-12 18:37:35 -0700139static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700140 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
141};
142asn_TYPE_descriptor_t asn_DEF_Enum1 = {
143 "Enum1",
144 "Enum1",
145 Enum1_free,
146 Enum1_print,
147 Enum1_constraint,
148 Enum1_decode_ber,
149 Enum1_encode_der,
150 Enum1_decode_xer,
151 Enum1_encode_xer,
Lev Walkina46ab9c2017-07-06 07:57:15 -0700152 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400153 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700154 0, /* Use generic outmost tag fetcher */
155 asn_DEF_Enum1_tags_1,
156 sizeof(asn_DEF_Enum1_tags_1)
157 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
158 asn_DEF_Enum1_tags_1, /* Same as above */
159 sizeof(asn_DEF_Enum1_tags_1)
160 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400161 0, /* No OER visible constraints */
Lev Walkinffe79f42010-10-25 00:10:34 -0700162 0, /* No PER visible constraints */
163 0, 0, /* Defined elsewhere */
164 &asn_SPC_Enum1_specs_1 /* Additional specs */
165};
166
167
168/*** <<< INCLUDES [Enum2] >>> ***/
169
170#include <ENUMERATED.h>
171
172/*** <<< DEPS [Enum2] >>> ***/
173
174typedef enum Enum2 {
175 Enum2_red = 0,
176 Enum2_green = 1,
177 Enum2_blue = 45,
178 Enum2_orange = 23,
179 Enum2_alpha = 46,
180 /*
181 * Enumeration is extensible
182 */
183 Enum2_beta = 12,
184 Enum2_gamma = 103
185} e_Enum2;
186
187/*** <<< TYPE-DECLS [Enum2] >>> ***/
188
189typedef ENUMERATED_t Enum2_t;
190
191/*** <<< FUNC-DECLS [Enum2] >>> ***/
192
193extern asn_TYPE_descriptor_t asn_DEF_Enum2;
194asn_struct_free_f Enum2_free;
195asn_struct_print_f Enum2_print;
196asn_constr_check_f Enum2_constraint;
197ber_type_decoder_f Enum2_decode_ber;
198der_type_encoder_f Enum2_encode_der;
199xer_type_decoder_f Enum2_decode_xer;
200xer_type_encoder_f Enum2_encode_xer;
201
202/*** <<< CODE [Enum2] >>> ***/
203
204int
205Enum2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
206 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
207 /* Replace with underlying type checker */
208 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
209 return td->check_constraints(td, sptr, ctfailcb, app_key);
210}
211
212/*
213 * This type is implemented using ENUMERATED,
214 * so here we adjust the DEF accordingly.
215 */
216static void
217Enum2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
218 td->free_struct = asn_DEF_ENUMERATED.free_struct;
219 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800220 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700221 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
222 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
223 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
224 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
225 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
226 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700227 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
228 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400229 if(!td->oer_constraints)
230 td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700231 if(!td->per_constraints)
232 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
233 td->elements = asn_DEF_ENUMERATED.elements;
234 td->elements_count = asn_DEF_ENUMERATED.elements_count;
235 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
236}
237
238void
239Enum2_free(asn_TYPE_descriptor_t *td,
240 void *struct_ptr, int contents_only) {
241 Enum2_1_inherit_TYPE_descriptor(td);
242 td->free_struct(td, struct_ptr, contents_only);
243}
244
245int
246Enum2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
247 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
248 Enum2_1_inherit_TYPE_descriptor(td);
249 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
250}
251
252asn_dec_rval_t
253Enum2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
254 void **structure, const void *bufptr, size_t size, int tag_mode) {
255 Enum2_1_inherit_TYPE_descriptor(td);
256 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
257}
258
259asn_enc_rval_t
260Enum2_encode_der(asn_TYPE_descriptor_t *td,
261 void *structure, int tag_mode, ber_tlv_tag_t tag,
262 asn_app_consume_bytes_f *cb, void *app_key) {
263 Enum2_1_inherit_TYPE_descriptor(td);
264 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
265}
266
267asn_dec_rval_t
268Enum2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
269 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
270 Enum2_1_inherit_TYPE_descriptor(td);
271 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
272}
273
274asn_enc_rval_t
275Enum2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
276 int ilevel, enum xer_encoder_flags_e flags,
277 asn_app_consume_bytes_f *cb, void *app_key) {
278 Enum2_1_inherit_TYPE_descriptor(td);
279 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
280}
281
282
283/*** <<< STAT-DEFS [Enum2] >>> ***/
284
Lev Walkina7591b52014-10-12 18:37:35 -0700285static const asn_INTEGER_enum_map_t asn_MAP_Enum2_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700286 { 0, 3, "red" },
287 { 1, 5, "green" },
288 { 12, 4, "beta" },
289 { 23, 6, "orange" },
290 { 45, 4, "blue" },
291 { 46, 5, "alpha" },
292 { 103, 5, "gamma" }
293 /* This list is extensible */
294};
Lev Walkina7591b52014-10-12 18:37:35 -0700295static const unsigned int asn_MAP_Enum2_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700296 5, /* alpha(46) */
297 2, /* beta(12) */
298 4, /* blue(45) */
299 6, /* gamma(103) */
300 1, /* green(1) */
301 3, /* orange(23) */
302 0 /* red(0) */
303 /* This list is extensible */
304};
johvike70c4072017-05-09 11:06:12 +0200305static asn_INTEGER_specifics_t asn_SPC_Enum2_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700306 asn_MAP_Enum2_value2enum_1, /* "tag" => N; sorted by tag */
307 asn_MAP_Enum2_enum2value_1, /* N => "tag"; sorted by N */
308 7, /* Number of elements in the maps */
309 6, /* Extensions before this member */
310 1, /* Strict enumeration */
311 0, /* Native long size */
312 0
313};
Lev Walkina7591b52014-10-12 18:37:35 -0700314static const ber_tlv_tag_t asn_DEF_Enum2_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700315 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
316};
317asn_TYPE_descriptor_t asn_DEF_Enum2 = {
318 "Enum2",
319 "Enum2",
320 Enum2_free,
321 Enum2_print,
322 Enum2_constraint,
323 Enum2_decode_ber,
324 Enum2_encode_der,
325 Enum2_decode_xer,
326 Enum2_encode_xer,
Lev Walkina46ab9c2017-07-06 07:57:15 -0700327 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400328 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700329 0, /* Use generic outmost tag fetcher */
330 asn_DEF_Enum2_tags_1,
331 sizeof(asn_DEF_Enum2_tags_1)
332 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
333 asn_DEF_Enum2_tags_1, /* Same as above */
334 sizeof(asn_DEF_Enum2_tags_1)
335 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400336 0, /* No OER visible constraints */
Lev Walkinffe79f42010-10-25 00:10:34 -0700337 0, /* No PER visible constraints */
338 0, 0, /* Defined elsewhere */
339 &asn_SPC_Enum2_specs_1 /* Additional specs */
340};
341
342
343/*** <<< INCLUDES [Enum3] >>> ***/
344
345#include <ENUMERATED.h>
346
347/*** <<< DEPS [Enum3] >>> ***/
348
349typedef enum Enum3 {
350 Enum3_a = 0,
351 Enum3_b = 3,
352 /*
353 * Enumeration is extensible
354 */
355 Enum3_c = 1
356} e_Enum3;
357
358/*** <<< TYPE-DECLS [Enum3] >>> ***/
359
360typedef ENUMERATED_t Enum3_t;
361
362/*** <<< FUNC-DECLS [Enum3] >>> ***/
363
364extern asn_TYPE_descriptor_t asn_DEF_Enum3;
365asn_struct_free_f Enum3_free;
366asn_struct_print_f Enum3_print;
367asn_constr_check_f Enum3_constraint;
368ber_type_decoder_f Enum3_decode_ber;
369der_type_encoder_f Enum3_encode_der;
370xer_type_decoder_f Enum3_decode_xer;
371xer_type_encoder_f Enum3_encode_xer;
372
373/*** <<< CODE [Enum3] >>> ***/
374
375int
376Enum3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
377 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
378 /* Replace with underlying type checker */
379 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
380 return td->check_constraints(td, sptr, ctfailcb, app_key);
381}
382
383/*
384 * This type is implemented using ENUMERATED,
385 * so here we adjust the DEF accordingly.
386 */
387static void
388Enum3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
389 td->free_struct = asn_DEF_ENUMERATED.free_struct;
390 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800391 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700392 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
393 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
394 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
395 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
396 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
397 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700398 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
399 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400400 if(!td->oer_constraints)
401 td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700402 if(!td->per_constraints)
403 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
404 td->elements = asn_DEF_ENUMERATED.elements;
405 td->elements_count = asn_DEF_ENUMERATED.elements_count;
406 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
407}
408
409void
410Enum3_free(asn_TYPE_descriptor_t *td,
411 void *struct_ptr, int contents_only) {
412 Enum3_1_inherit_TYPE_descriptor(td);
413 td->free_struct(td, struct_ptr, contents_only);
414}
415
416int
417Enum3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
418 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
419 Enum3_1_inherit_TYPE_descriptor(td);
420 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
421}
422
423asn_dec_rval_t
424Enum3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
425 void **structure, const void *bufptr, size_t size, int tag_mode) {
426 Enum3_1_inherit_TYPE_descriptor(td);
427 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
428}
429
430asn_enc_rval_t
431Enum3_encode_der(asn_TYPE_descriptor_t *td,
432 void *structure, int tag_mode, ber_tlv_tag_t tag,
433 asn_app_consume_bytes_f *cb, void *app_key) {
434 Enum3_1_inherit_TYPE_descriptor(td);
435 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
436}
437
438asn_dec_rval_t
439Enum3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
440 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
441 Enum3_1_inherit_TYPE_descriptor(td);
442 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
443}
444
445asn_enc_rval_t
446Enum3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
447 int ilevel, enum xer_encoder_flags_e flags,
448 asn_app_consume_bytes_f *cb, void *app_key) {
449 Enum3_1_inherit_TYPE_descriptor(td);
450 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
451}
452
453
454/*** <<< STAT-DEFS [Enum3] >>> ***/
455
Lev Walkina7591b52014-10-12 18:37:35 -0700456static const asn_INTEGER_enum_map_t asn_MAP_Enum3_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700457 { 0, 1, "a" },
458 { 1, 1, "c" },
459 { 3, 1, "b" }
460 /* This list is extensible */
461};
Lev Walkina7591b52014-10-12 18:37:35 -0700462static const unsigned int asn_MAP_Enum3_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700463 0, /* a(0) */
464 2, /* b(3) */
465 1 /* c(1) */
466 /* This list is extensible */
467};
johvike70c4072017-05-09 11:06:12 +0200468static asn_INTEGER_specifics_t asn_SPC_Enum3_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700469 asn_MAP_Enum3_value2enum_1, /* "tag" => N; sorted by tag */
470 asn_MAP_Enum3_enum2value_1, /* N => "tag"; sorted by N */
471 3, /* Number of elements in the maps */
472 3, /* Extensions before this member */
473 1, /* Strict enumeration */
474 0, /* Native long size */
475 0
476};
Lev Walkina7591b52014-10-12 18:37:35 -0700477static const ber_tlv_tag_t asn_DEF_Enum3_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700478 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
479};
480asn_TYPE_descriptor_t asn_DEF_Enum3 = {
481 "Enum3",
482 "Enum3",
483 Enum3_free,
484 Enum3_print,
485 Enum3_constraint,
486 Enum3_decode_ber,
487 Enum3_encode_der,
488 Enum3_decode_xer,
489 Enum3_encode_xer,
Lev Walkina46ab9c2017-07-06 07:57:15 -0700490 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400491 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700492 0, /* Use generic outmost tag fetcher */
493 asn_DEF_Enum3_tags_1,
494 sizeof(asn_DEF_Enum3_tags_1)
495 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
496 asn_DEF_Enum3_tags_1, /* Same as above */
497 sizeof(asn_DEF_Enum3_tags_1)
498 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400499 0, /* No OER visible constraints */
Lev Walkinffe79f42010-10-25 00:10:34 -0700500 0, /* No PER visible constraints */
501 0, 0, /* Defined elsewhere */
502 &asn_SPC_Enum3_specs_1 /* Additional specs */
503};
504
505
506/*** <<< INCLUDES [Enum4] >>> ***/
507
508#include <ENUMERATED.h>
509
510/*** <<< DEPS [Enum4] >>> ***/
511
512typedef enum Enum4 {
513 Enum4_a = 0,
514 Enum4_b = 1,
515 /*
516 * Enumeration is extensible
517 */
518 Enum4_c = 3,
519 Enum4_d = 4
520} e_Enum4;
521
522/*** <<< TYPE-DECLS [Enum4] >>> ***/
523
524typedef ENUMERATED_t Enum4_t;
525
526/*** <<< FUNC-DECLS [Enum4] >>> ***/
527
528extern asn_TYPE_descriptor_t asn_DEF_Enum4;
529asn_struct_free_f Enum4_free;
530asn_struct_print_f Enum4_print;
531asn_constr_check_f Enum4_constraint;
532ber_type_decoder_f Enum4_decode_ber;
533der_type_encoder_f Enum4_encode_der;
534xer_type_decoder_f Enum4_decode_xer;
535xer_type_encoder_f Enum4_encode_xer;
536
537/*** <<< CODE [Enum4] >>> ***/
538
539int
540Enum4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
541 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
542 /* Replace with underlying type checker */
543 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
544 return td->check_constraints(td, sptr, ctfailcb, app_key);
545}
546
547/*
548 * This type is implemented using ENUMERATED,
549 * so here we adjust the DEF accordingly.
550 */
551static void
552Enum4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
553 td->free_struct = asn_DEF_ENUMERATED.free_struct;
554 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800555 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700556 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
557 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
558 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
559 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
560 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
561 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700562 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
563 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400564 if(!td->oer_constraints)
565 td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700566 if(!td->per_constraints)
567 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
568 td->elements = asn_DEF_ENUMERATED.elements;
569 td->elements_count = asn_DEF_ENUMERATED.elements_count;
570 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
571}
572
573void
574Enum4_free(asn_TYPE_descriptor_t *td,
575 void *struct_ptr, int contents_only) {
576 Enum4_1_inherit_TYPE_descriptor(td);
577 td->free_struct(td, struct_ptr, contents_only);
578}
579
580int
581Enum4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
582 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
583 Enum4_1_inherit_TYPE_descriptor(td);
584 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
585}
586
587asn_dec_rval_t
588Enum4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
589 void **structure, const void *bufptr, size_t size, int tag_mode) {
590 Enum4_1_inherit_TYPE_descriptor(td);
591 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
592}
593
594asn_enc_rval_t
595Enum4_encode_der(asn_TYPE_descriptor_t *td,
596 void *structure, int tag_mode, ber_tlv_tag_t tag,
597 asn_app_consume_bytes_f *cb, void *app_key) {
598 Enum4_1_inherit_TYPE_descriptor(td);
599 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
600}
601
602asn_dec_rval_t
603Enum4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
604 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
605 Enum4_1_inherit_TYPE_descriptor(td);
606 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
607}
608
609asn_enc_rval_t
610Enum4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
611 int ilevel, enum xer_encoder_flags_e flags,
612 asn_app_consume_bytes_f *cb, void *app_key) {
613 Enum4_1_inherit_TYPE_descriptor(td);
614 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
615}
616
617
618/*** <<< STAT-DEFS [Enum4] >>> ***/
619
Lev Walkina7591b52014-10-12 18:37:35 -0700620static const asn_INTEGER_enum_map_t asn_MAP_Enum4_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700621 { 0, 1, "a" },
622 { 1, 1, "b" },
623 { 3, 1, "c" },
624 { 4, 1, "d" }
625 /* This list is extensible */
626};
Lev Walkina7591b52014-10-12 18:37:35 -0700627static const unsigned int asn_MAP_Enum4_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700628 0, /* a(0) */
629 1, /* b(1) */
630 2, /* c(3) */
631 3 /* d(4) */
632 /* This list is extensible */
633};
johvike70c4072017-05-09 11:06:12 +0200634static asn_INTEGER_specifics_t asn_SPC_Enum4_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700635 asn_MAP_Enum4_value2enum_1, /* "tag" => N; sorted by tag */
636 asn_MAP_Enum4_enum2value_1, /* N => "tag"; sorted by N */
637 4, /* Number of elements in the maps */
638 3, /* Extensions before this member */
639 1, /* Strict enumeration */
640 0, /* Native long size */
641 0
642};
Lev Walkina7591b52014-10-12 18:37:35 -0700643static const ber_tlv_tag_t asn_DEF_Enum4_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700644 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
645};
646asn_TYPE_descriptor_t asn_DEF_Enum4 = {
647 "Enum4",
648 "Enum4",
649 Enum4_free,
650 Enum4_print,
651 Enum4_constraint,
652 Enum4_decode_ber,
653 Enum4_encode_der,
654 Enum4_decode_xer,
655 Enum4_encode_xer,
Lev Walkina46ab9c2017-07-06 07:57:15 -0700656 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400657 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700658 0, /* Use generic outmost tag fetcher */
659 asn_DEF_Enum4_tags_1,
660 sizeof(asn_DEF_Enum4_tags_1)
661 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
662 asn_DEF_Enum4_tags_1, /* Same as above */
663 sizeof(asn_DEF_Enum4_tags_1)
664 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400665 0, /* No OER visible constraints */
Lev Walkinffe79f42010-10-25 00:10:34 -0700666 0, /* No PER visible constraints */
667 0, 0, /* Defined elsewhere */
668 &asn_SPC_Enum4_specs_1 /* Additional specs */
669};
670
671
672/*** <<< INCLUDES [Enum5] >>> ***/
673
674#include <ENUMERATED.h>
675
676/*** <<< DEPS [Enum5] >>> ***/
677
678typedef enum Enum5 {
679 Enum5_a = 0,
680 Enum5_z = 25,
681 /*
682 * Enumeration is extensible
683 */
684 Enum5_d = 26
685} e_Enum5;
686
687/*** <<< TYPE-DECLS [Enum5] >>> ***/
688
689typedef ENUMERATED_t Enum5_t;
690
691/*** <<< FUNC-DECLS [Enum5] >>> ***/
692
693extern asn_TYPE_descriptor_t asn_DEF_Enum5;
694asn_struct_free_f Enum5_free;
695asn_struct_print_f Enum5_print;
696asn_constr_check_f Enum5_constraint;
697ber_type_decoder_f Enum5_decode_ber;
698der_type_encoder_f Enum5_encode_der;
699xer_type_decoder_f Enum5_decode_xer;
700xer_type_encoder_f Enum5_encode_xer;
701
702/*** <<< CODE [Enum5] >>> ***/
703
704int
705Enum5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
706 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
707 /* Replace with underlying type checker */
708 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
709 return td->check_constraints(td, sptr, ctfailcb, app_key);
710}
711
712/*
713 * This type is implemented using ENUMERATED,
714 * so here we adjust the DEF accordingly.
715 */
716static void
717Enum5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
718 td->free_struct = asn_DEF_ENUMERATED.free_struct;
719 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800720 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700721 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
722 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
723 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
724 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
725 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
726 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700727 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
728 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400729 if(!td->oer_constraints)
730 td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700731 if(!td->per_constraints)
732 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
733 td->elements = asn_DEF_ENUMERATED.elements;
734 td->elements_count = asn_DEF_ENUMERATED.elements_count;
735 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
736}
737
738void
739Enum5_free(asn_TYPE_descriptor_t *td,
740 void *struct_ptr, int contents_only) {
741 Enum5_1_inherit_TYPE_descriptor(td);
742 td->free_struct(td, struct_ptr, contents_only);
743}
744
745int
746Enum5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
747 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
748 Enum5_1_inherit_TYPE_descriptor(td);
749 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
750}
751
752asn_dec_rval_t
753Enum5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
754 void **structure, const void *bufptr, size_t size, int tag_mode) {
755 Enum5_1_inherit_TYPE_descriptor(td);
756 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
757}
758
759asn_enc_rval_t
760Enum5_encode_der(asn_TYPE_descriptor_t *td,
761 void *structure, int tag_mode, ber_tlv_tag_t tag,
762 asn_app_consume_bytes_f *cb, void *app_key) {
763 Enum5_1_inherit_TYPE_descriptor(td);
764 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
765}
766
767asn_dec_rval_t
768Enum5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
769 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
770 Enum5_1_inherit_TYPE_descriptor(td);
771 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
772}
773
774asn_enc_rval_t
775Enum5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
776 int ilevel, enum xer_encoder_flags_e flags,
777 asn_app_consume_bytes_f *cb, void *app_key) {
778 Enum5_1_inherit_TYPE_descriptor(td);
779 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
780}
781
782
783/*** <<< STAT-DEFS [Enum5] >>> ***/
784
Lev Walkina7591b52014-10-12 18:37:35 -0700785static const asn_INTEGER_enum_map_t asn_MAP_Enum5_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700786 { 0, 1, "a" },
787 { 25, 1, "z" },
788 { 26, 1, "d" }
789 /* This list is extensible */
790};
Lev Walkina7591b52014-10-12 18:37:35 -0700791static const unsigned int asn_MAP_Enum5_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700792 0, /* a(0) */
793 2, /* d(26) */
794 1 /* z(25) */
795 /* This list is extensible */
796};
johvike70c4072017-05-09 11:06:12 +0200797static asn_INTEGER_specifics_t asn_SPC_Enum5_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700798 asn_MAP_Enum5_value2enum_1, /* "tag" => N; sorted by tag */
799 asn_MAP_Enum5_enum2value_1, /* N => "tag"; sorted by N */
800 3, /* Number of elements in the maps */
801 3, /* Extensions before this member */
802 1, /* Strict enumeration */
803 0, /* Native long size */
804 0
805};
Lev Walkina7591b52014-10-12 18:37:35 -0700806static const ber_tlv_tag_t asn_DEF_Enum5_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700807 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
808};
809asn_TYPE_descriptor_t asn_DEF_Enum5 = {
810 "Enum5",
811 "Enum5",
812 Enum5_free,
813 Enum5_print,
814 Enum5_constraint,
815 Enum5_decode_ber,
816 Enum5_encode_der,
817 Enum5_decode_xer,
818 Enum5_encode_xer,
Lev Walkina46ab9c2017-07-06 07:57:15 -0700819 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400820 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinffe79f42010-10-25 00:10:34 -0700821 0, /* Use generic outmost tag fetcher */
822 asn_DEF_Enum5_tags_1,
823 sizeof(asn_DEF_Enum5_tags_1)
824 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
825 asn_DEF_Enum5_tags_1, /* Same as above */
826 sizeof(asn_DEF_Enum5_tags_1)
827 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400828 0, /* No OER visible constraints */
Lev Walkinffe79f42010-10-25 00:10:34 -0700829 0, /* No PER visible constraints */
830 0, 0, /* Defined elsewhere */
831 &asn_SPC_Enum5_specs_1 /* Additional specs */
832};
833