blob: ee906c61538c540053dcb597b4f082968c86d594 [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};
Lev Walkina7591b52014-10-12 18:37:35 -0700126static const 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 */
149 0, /* Use generic outmost tag fetcher */
150 asn_DEF_Enum1_tags_1,
151 sizeof(asn_DEF_Enum1_tags_1)
152 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
153 asn_DEF_Enum1_tags_1, /* Same as above */
154 sizeof(asn_DEF_Enum1_tags_1)
155 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
156 0, /* No PER visible constraints */
157 0, 0, /* Defined elsewhere */
158 &asn_SPC_Enum1_specs_1 /* Additional specs */
159};
160
161
162/*** <<< INCLUDES [Enum2] >>> ***/
163
164#include <ENUMERATED.h>
165
166/*** <<< DEPS [Enum2] >>> ***/
167
168typedef enum Enum2 {
169 Enum2_red = 0,
170 Enum2_green = 1,
171 Enum2_blue = 45,
172 Enum2_orange = 23,
173 Enum2_alpha = 46,
174 /*
175 * Enumeration is extensible
176 */
177 Enum2_beta = 12,
178 Enum2_gamma = 103
179} e_Enum2;
180
181/*** <<< TYPE-DECLS [Enum2] >>> ***/
182
183typedef ENUMERATED_t Enum2_t;
184
185/*** <<< FUNC-DECLS [Enum2] >>> ***/
186
187extern asn_TYPE_descriptor_t asn_DEF_Enum2;
188asn_struct_free_f Enum2_free;
189asn_struct_print_f Enum2_print;
190asn_constr_check_f Enum2_constraint;
191ber_type_decoder_f Enum2_decode_ber;
192der_type_encoder_f Enum2_encode_der;
193xer_type_decoder_f Enum2_decode_xer;
194xer_type_encoder_f Enum2_encode_xer;
195
196/*** <<< CODE [Enum2] >>> ***/
197
198int
199Enum2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
200 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
201 /* Replace with underlying type checker */
202 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
203 return td->check_constraints(td, sptr, ctfailcb, app_key);
204}
205
206/*
207 * This type is implemented using ENUMERATED,
208 * so here we adjust the DEF accordingly.
209 */
210static void
211Enum2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
212 td->free_struct = asn_DEF_ENUMERATED.free_struct;
213 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800214 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700215 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
216 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
217 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
218 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
219 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
220 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
221 if(!td->per_constraints)
222 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
223 td->elements = asn_DEF_ENUMERATED.elements;
224 td->elements_count = asn_DEF_ENUMERATED.elements_count;
225 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
226}
227
228void
229Enum2_free(asn_TYPE_descriptor_t *td,
230 void *struct_ptr, int contents_only) {
231 Enum2_1_inherit_TYPE_descriptor(td);
232 td->free_struct(td, struct_ptr, contents_only);
233}
234
235int
236Enum2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
237 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
238 Enum2_1_inherit_TYPE_descriptor(td);
239 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
240}
241
242asn_dec_rval_t
243Enum2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
244 void **structure, const void *bufptr, size_t size, int tag_mode) {
245 Enum2_1_inherit_TYPE_descriptor(td);
246 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
247}
248
249asn_enc_rval_t
250Enum2_encode_der(asn_TYPE_descriptor_t *td,
251 void *structure, int tag_mode, ber_tlv_tag_t tag,
252 asn_app_consume_bytes_f *cb, void *app_key) {
253 Enum2_1_inherit_TYPE_descriptor(td);
254 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
255}
256
257asn_dec_rval_t
258Enum2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
259 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
260 Enum2_1_inherit_TYPE_descriptor(td);
261 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
262}
263
264asn_enc_rval_t
265Enum2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
266 int ilevel, enum xer_encoder_flags_e flags,
267 asn_app_consume_bytes_f *cb, void *app_key) {
268 Enum2_1_inherit_TYPE_descriptor(td);
269 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
270}
271
272
273/*** <<< STAT-DEFS [Enum2] >>> ***/
274
Lev Walkina7591b52014-10-12 18:37:35 -0700275static const asn_INTEGER_enum_map_t asn_MAP_Enum2_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700276 { 0, 3, "red" },
277 { 1, 5, "green" },
278 { 12, 4, "beta" },
279 { 23, 6, "orange" },
280 { 45, 4, "blue" },
281 { 46, 5, "alpha" },
282 { 103, 5, "gamma" }
283 /* This list is extensible */
284};
Lev Walkina7591b52014-10-12 18:37:35 -0700285static const unsigned int asn_MAP_Enum2_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700286 5, /* alpha(46) */
287 2, /* beta(12) */
288 4, /* blue(45) */
289 6, /* gamma(103) */
290 1, /* green(1) */
291 3, /* orange(23) */
292 0 /* red(0) */
293 /* This list is extensible */
294};
Lev Walkina7591b52014-10-12 18:37:35 -0700295static const asn_INTEGER_specifics_t asn_SPC_Enum2_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700296 asn_MAP_Enum2_value2enum_1, /* "tag" => N; sorted by tag */
297 asn_MAP_Enum2_enum2value_1, /* N => "tag"; sorted by N */
298 7, /* Number of elements in the maps */
299 6, /* Extensions before this member */
300 1, /* Strict enumeration */
301 0, /* Native long size */
302 0
303};
Lev Walkina7591b52014-10-12 18:37:35 -0700304static const ber_tlv_tag_t asn_DEF_Enum2_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700305 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
306};
307asn_TYPE_descriptor_t asn_DEF_Enum2 = {
308 "Enum2",
309 "Enum2",
310 Enum2_free,
311 Enum2_print,
312 Enum2_constraint,
313 Enum2_decode_ber,
314 Enum2_encode_der,
315 Enum2_decode_xer,
316 Enum2_encode_xer,
317 0, 0, /* No PER support, use "-gen-PER" to enable */
318 0, /* Use generic outmost tag fetcher */
319 asn_DEF_Enum2_tags_1,
320 sizeof(asn_DEF_Enum2_tags_1)
321 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
322 asn_DEF_Enum2_tags_1, /* Same as above */
323 sizeof(asn_DEF_Enum2_tags_1)
324 /sizeof(asn_DEF_Enum2_tags_1[0]), /* 1 */
325 0, /* No PER visible constraints */
326 0, 0, /* Defined elsewhere */
327 &asn_SPC_Enum2_specs_1 /* Additional specs */
328};
329
330
331/*** <<< INCLUDES [Enum3] >>> ***/
332
333#include <ENUMERATED.h>
334
335/*** <<< DEPS [Enum3] >>> ***/
336
337typedef enum Enum3 {
338 Enum3_a = 0,
339 Enum3_b = 3,
340 /*
341 * Enumeration is extensible
342 */
343 Enum3_c = 1
344} e_Enum3;
345
346/*** <<< TYPE-DECLS [Enum3] >>> ***/
347
348typedef ENUMERATED_t Enum3_t;
349
350/*** <<< FUNC-DECLS [Enum3] >>> ***/
351
352extern asn_TYPE_descriptor_t asn_DEF_Enum3;
353asn_struct_free_f Enum3_free;
354asn_struct_print_f Enum3_print;
355asn_constr_check_f Enum3_constraint;
356ber_type_decoder_f Enum3_decode_ber;
357der_type_encoder_f Enum3_encode_der;
358xer_type_decoder_f Enum3_decode_xer;
359xer_type_encoder_f Enum3_encode_xer;
360
361/*** <<< CODE [Enum3] >>> ***/
362
363int
364Enum3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
365 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
366 /* Replace with underlying type checker */
367 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
368 return td->check_constraints(td, sptr, ctfailcb, app_key);
369}
370
371/*
372 * This type is implemented using ENUMERATED,
373 * so here we adjust the DEF accordingly.
374 */
375static void
376Enum3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
377 td->free_struct = asn_DEF_ENUMERATED.free_struct;
378 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800379 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700380 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
381 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
382 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
383 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
384 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
385 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
386 if(!td->per_constraints)
387 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
388 td->elements = asn_DEF_ENUMERATED.elements;
389 td->elements_count = asn_DEF_ENUMERATED.elements_count;
390 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
391}
392
393void
394Enum3_free(asn_TYPE_descriptor_t *td,
395 void *struct_ptr, int contents_only) {
396 Enum3_1_inherit_TYPE_descriptor(td);
397 td->free_struct(td, struct_ptr, contents_only);
398}
399
400int
401Enum3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
402 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
403 Enum3_1_inherit_TYPE_descriptor(td);
404 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
405}
406
407asn_dec_rval_t
408Enum3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
409 void **structure, const void *bufptr, size_t size, int tag_mode) {
410 Enum3_1_inherit_TYPE_descriptor(td);
411 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
412}
413
414asn_enc_rval_t
415Enum3_encode_der(asn_TYPE_descriptor_t *td,
416 void *structure, int tag_mode, ber_tlv_tag_t tag,
417 asn_app_consume_bytes_f *cb, void *app_key) {
418 Enum3_1_inherit_TYPE_descriptor(td);
419 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
420}
421
422asn_dec_rval_t
423Enum3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
424 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
425 Enum3_1_inherit_TYPE_descriptor(td);
426 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
427}
428
429asn_enc_rval_t
430Enum3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
431 int ilevel, enum xer_encoder_flags_e flags,
432 asn_app_consume_bytes_f *cb, void *app_key) {
433 Enum3_1_inherit_TYPE_descriptor(td);
434 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
435}
436
437
438/*** <<< STAT-DEFS [Enum3] >>> ***/
439
Lev Walkina7591b52014-10-12 18:37:35 -0700440static const asn_INTEGER_enum_map_t asn_MAP_Enum3_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700441 { 0, 1, "a" },
442 { 1, 1, "c" },
443 { 3, 1, "b" }
444 /* This list is extensible */
445};
Lev Walkina7591b52014-10-12 18:37:35 -0700446static const unsigned int asn_MAP_Enum3_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700447 0, /* a(0) */
448 2, /* b(3) */
449 1 /* c(1) */
450 /* This list is extensible */
451};
Lev Walkina7591b52014-10-12 18:37:35 -0700452static const asn_INTEGER_specifics_t asn_SPC_Enum3_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700453 asn_MAP_Enum3_value2enum_1, /* "tag" => N; sorted by tag */
454 asn_MAP_Enum3_enum2value_1, /* N => "tag"; sorted by N */
455 3, /* Number of elements in the maps */
456 3, /* Extensions before this member */
457 1, /* Strict enumeration */
458 0, /* Native long size */
459 0
460};
Lev Walkina7591b52014-10-12 18:37:35 -0700461static const ber_tlv_tag_t asn_DEF_Enum3_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700462 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
463};
464asn_TYPE_descriptor_t asn_DEF_Enum3 = {
465 "Enum3",
466 "Enum3",
467 Enum3_free,
468 Enum3_print,
469 Enum3_constraint,
470 Enum3_decode_ber,
471 Enum3_encode_der,
472 Enum3_decode_xer,
473 Enum3_encode_xer,
474 0, 0, /* No PER support, use "-gen-PER" to enable */
475 0, /* Use generic outmost tag fetcher */
476 asn_DEF_Enum3_tags_1,
477 sizeof(asn_DEF_Enum3_tags_1)
478 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
479 asn_DEF_Enum3_tags_1, /* Same as above */
480 sizeof(asn_DEF_Enum3_tags_1)
481 /sizeof(asn_DEF_Enum3_tags_1[0]), /* 1 */
482 0, /* No PER visible constraints */
483 0, 0, /* Defined elsewhere */
484 &asn_SPC_Enum3_specs_1 /* Additional specs */
485};
486
487
488/*** <<< INCLUDES [Enum4] >>> ***/
489
490#include <ENUMERATED.h>
491
492/*** <<< DEPS [Enum4] >>> ***/
493
494typedef enum Enum4 {
495 Enum4_a = 0,
496 Enum4_b = 1,
497 /*
498 * Enumeration is extensible
499 */
500 Enum4_c = 3,
501 Enum4_d = 4
502} e_Enum4;
503
504/*** <<< TYPE-DECLS [Enum4] >>> ***/
505
506typedef ENUMERATED_t Enum4_t;
507
508/*** <<< FUNC-DECLS [Enum4] >>> ***/
509
510extern asn_TYPE_descriptor_t asn_DEF_Enum4;
511asn_struct_free_f Enum4_free;
512asn_struct_print_f Enum4_print;
513asn_constr_check_f Enum4_constraint;
514ber_type_decoder_f Enum4_decode_ber;
515der_type_encoder_f Enum4_encode_der;
516xer_type_decoder_f Enum4_decode_xer;
517xer_type_encoder_f Enum4_encode_xer;
518
519/*** <<< CODE [Enum4] >>> ***/
520
521int
522Enum4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
523 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
524 /* Replace with underlying type checker */
525 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
526 return td->check_constraints(td, sptr, ctfailcb, app_key);
527}
528
529/*
530 * This type is implemented using ENUMERATED,
531 * so here we adjust the DEF accordingly.
532 */
533static void
534Enum4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
535 td->free_struct = asn_DEF_ENUMERATED.free_struct;
536 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800537 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700538 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
539 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
540 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
541 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
542 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
543 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
544 if(!td->per_constraints)
545 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
546 td->elements = asn_DEF_ENUMERATED.elements;
547 td->elements_count = asn_DEF_ENUMERATED.elements_count;
548 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
549}
550
551void
552Enum4_free(asn_TYPE_descriptor_t *td,
553 void *struct_ptr, int contents_only) {
554 Enum4_1_inherit_TYPE_descriptor(td);
555 td->free_struct(td, struct_ptr, contents_only);
556}
557
558int
559Enum4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
560 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
561 Enum4_1_inherit_TYPE_descriptor(td);
562 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
563}
564
565asn_dec_rval_t
566Enum4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
567 void **structure, const void *bufptr, size_t size, int tag_mode) {
568 Enum4_1_inherit_TYPE_descriptor(td);
569 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
570}
571
572asn_enc_rval_t
573Enum4_encode_der(asn_TYPE_descriptor_t *td,
574 void *structure, int tag_mode, ber_tlv_tag_t tag,
575 asn_app_consume_bytes_f *cb, void *app_key) {
576 Enum4_1_inherit_TYPE_descriptor(td);
577 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
578}
579
580asn_dec_rval_t
581Enum4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
582 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
583 Enum4_1_inherit_TYPE_descriptor(td);
584 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
585}
586
587asn_enc_rval_t
588Enum4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
589 int ilevel, enum xer_encoder_flags_e flags,
590 asn_app_consume_bytes_f *cb, void *app_key) {
591 Enum4_1_inherit_TYPE_descriptor(td);
592 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
593}
594
595
596/*** <<< STAT-DEFS [Enum4] >>> ***/
597
Lev Walkina7591b52014-10-12 18:37:35 -0700598static const asn_INTEGER_enum_map_t asn_MAP_Enum4_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700599 { 0, 1, "a" },
600 { 1, 1, "b" },
601 { 3, 1, "c" },
602 { 4, 1, "d" }
603 /* This list is extensible */
604};
Lev Walkina7591b52014-10-12 18:37:35 -0700605static const unsigned int asn_MAP_Enum4_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700606 0, /* a(0) */
607 1, /* b(1) */
608 2, /* c(3) */
609 3 /* d(4) */
610 /* This list is extensible */
611};
Lev Walkina7591b52014-10-12 18:37:35 -0700612static const asn_INTEGER_specifics_t asn_SPC_Enum4_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700613 asn_MAP_Enum4_value2enum_1, /* "tag" => N; sorted by tag */
614 asn_MAP_Enum4_enum2value_1, /* N => "tag"; sorted by N */
615 4, /* Number of elements in the maps */
616 3, /* Extensions before this member */
617 1, /* Strict enumeration */
618 0, /* Native long size */
619 0
620};
Lev Walkina7591b52014-10-12 18:37:35 -0700621static const ber_tlv_tag_t asn_DEF_Enum4_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700622 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
623};
624asn_TYPE_descriptor_t asn_DEF_Enum4 = {
625 "Enum4",
626 "Enum4",
627 Enum4_free,
628 Enum4_print,
629 Enum4_constraint,
630 Enum4_decode_ber,
631 Enum4_encode_der,
632 Enum4_decode_xer,
633 Enum4_encode_xer,
634 0, 0, /* No PER support, use "-gen-PER" to enable */
635 0, /* Use generic outmost tag fetcher */
636 asn_DEF_Enum4_tags_1,
637 sizeof(asn_DEF_Enum4_tags_1)
638 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
639 asn_DEF_Enum4_tags_1, /* Same as above */
640 sizeof(asn_DEF_Enum4_tags_1)
641 /sizeof(asn_DEF_Enum4_tags_1[0]), /* 1 */
642 0, /* No PER visible constraints */
643 0, 0, /* Defined elsewhere */
644 &asn_SPC_Enum4_specs_1 /* Additional specs */
645};
646
647
648/*** <<< INCLUDES [Enum5] >>> ***/
649
650#include <ENUMERATED.h>
651
652/*** <<< DEPS [Enum5] >>> ***/
653
654typedef enum Enum5 {
655 Enum5_a = 0,
656 Enum5_z = 25,
657 /*
658 * Enumeration is extensible
659 */
660 Enum5_d = 26
661} e_Enum5;
662
663/*** <<< TYPE-DECLS [Enum5] >>> ***/
664
665typedef ENUMERATED_t Enum5_t;
666
667/*** <<< FUNC-DECLS [Enum5] >>> ***/
668
669extern asn_TYPE_descriptor_t asn_DEF_Enum5;
670asn_struct_free_f Enum5_free;
671asn_struct_print_f Enum5_print;
672asn_constr_check_f Enum5_constraint;
673ber_type_decoder_f Enum5_decode_ber;
674der_type_encoder_f Enum5_encode_der;
675xer_type_decoder_f Enum5_decode_xer;
676xer_type_encoder_f Enum5_encode_xer;
677
678/*** <<< CODE [Enum5] >>> ***/
679
680int
681Enum5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
682 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
683 /* Replace with underlying type checker */
684 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
685 return td->check_constraints(td, sptr, ctfailcb, app_key);
686}
687
688/*
689 * This type is implemented using ENUMERATED,
690 * so here we adjust the DEF accordingly.
691 */
692static void
693Enum5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
694 td->free_struct = asn_DEF_ENUMERATED.free_struct;
695 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800696 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinffe79f42010-10-25 00:10:34 -0700697 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
698 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
699 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
700 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
701 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
702 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
703 if(!td->per_constraints)
704 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
705 td->elements = asn_DEF_ENUMERATED.elements;
706 td->elements_count = asn_DEF_ENUMERATED.elements_count;
707 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
708}
709
710void
711Enum5_free(asn_TYPE_descriptor_t *td,
712 void *struct_ptr, int contents_only) {
713 Enum5_1_inherit_TYPE_descriptor(td);
714 td->free_struct(td, struct_ptr, contents_only);
715}
716
717int
718Enum5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
719 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
720 Enum5_1_inherit_TYPE_descriptor(td);
721 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
722}
723
724asn_dec_rval_t
725Enum5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
726 void **structure, const void *bufptr, size_t size, int tag_mode) {
727 Enum5_1_inherit_TYPE_descriptor(td);
728 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
729}
730
731asn_enc_rval_t
732Enum5_encode_der(asn_TYPE_descriptor_t *td,
733 void *structure, int tag_mode, ber_tlv_tag_t tag,
734 asn_app_consume_bytes_f *cb, void *app_key) {
735 Enum5_1_inherit_TYPE_descriptor(td);
736 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
737}
738
739asn_dec_rval_t
740Enum5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
741 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
742 Enum5_1_inherit_TYPE_descriptor(td);
743 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
744}
745
746asn_enc_rval_t
747Enum5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
748 int ilevel, enum xer_encoder_flags_e flags,
749 asn_app_consume_bytes_f *cb, void *app_key) {
750 Enum5_1_inherit_TYPE_descriptor(td);
751 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
752}
753
754
755/*** <<< STAT-DEFS [Enum5] >>> ***/
756
Lev Walkina7591b52014-10-12 18:37:35 -0700757static const asn_INTEGER_enum_map_t asn_MAP_Enum5_value2enum_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700758 { 0, 1, "a" },
759 { 25, 1, "z" },
760 { 26, 1, "d" }
761 /* This list is extensible */
762};
Lev Walkina7591b52014-10-12 18:37:35 -0700763static const unsigned int asn_MAP_Enum5_enum2value_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700764 0, /* a(0) */
765 2, /* d(26) */
766 1 /* z(25) */
767 /* This list is extensible */
768};
Lev Walkina7591b52014-10-12 18:37:35 -0700769static const asn_INTEGER_specifics_t asn_SPC_Enum5_specs_1 = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700770 asn_MAP_Enum5_value2enum_1, /* "tag" => N; sorted by tag */
771 asn_MAP_Enum5_enum2value_1, /* N => "tag"; sorted by N */
772 3, /* Number of elements in the maps */
773 3, /* Extensions before this member */
774 1, /* Strict enumeration */
775 0, /* Native long size */
776 0
777};
Lev Walkina7591b52014-10-12 18:37:35 -0700778static const ber_tlv_tag_t asn_DEF_Enum5_tags_1[] = {
Lev Walkinffe79f42010-10-25 00:10:34 -0700779 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
780};
781asn_TYPE_descriptor_t asn_DEF_Enum5 = {
782 "Enum5",
783 "Enum5",
784 Enum5_free,
785 Enum5_print,
786 Enum5_constraint,
787 Enum5_decode_ber,
788 Enum5_encode_der,
789 Enum5_decode_xer,
790 Enum5_encode_xer,
791 0, 0, /* No PER support, use "-gen-PER" to enable */
792 0, /* Use generic outmost tag fetcher */
793 asn_DEF_Enum5_tags_1,
794 sizeof(asn_DEF_Enum5_tags_1)
795 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
796 asn_DEF_Enum5_tags_1, /* Same as above */
797 sizeof(asn_DEF_Enum5_tags_1)
798 /sizeof(asn_DEF_Enum5_tags_1[0]), /* 1 */
799 0, /* No PER visible constraints */
800 0, 0, /* Defined elsewhere */
801 &asn_SPC_Enum5_specs_1 /* Additional specs */
802};
803