Debian Codegraph @

tests/50-constraint-OK.asn1.-Pfwide-types

raw
1
2 /*** <<< INCLUDES [Int1] >>> ***/
3
4 #include <INTEGER.h>
5
6 /*** <<< TYPE-DECLS [Int1] >>> ***/
7
8 typedef INTEGER_t Int1_t;
9
10 /*** <<< FUNC-DECLS [Int1] >>> ***/
11
12 extern asn_TYPE_descriptor_t asn_DEF_Int1;
13 asn_struct_free_f Int1_free;
14 asn_struct_print_f Int1_print;
15 asn_constr_check_f Int1_constraint;
16 ber_type_decoder_f Int1_decode_ber;
17 der_type_encoder_f Int1_encode_der;
18 xer_type_decoder_f Int1_decode_xer;
19 xer_type_encoder_f Int1_encode_xer;
20
21 /*** <<< CODE [Int1] >>> ***/
22
23 int
24 Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
25 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
26 /* Replace with underlying type checker */
27 td->check_constraints = asn_DEF_INTEGER.check_constraints;
28 return td->check_constraints(td, sptr, ctfailcb, app_key);
29 }
30
31 /*
32 * This type is implemented using INTEGER,
33 * so here we adjust the DEF accordingly.
34 */
35 static void
36 Int1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
37 td->free_struct = asn_DEF_INTEGER.free_struct;
38 td->print_struct = asn_DEF_INTEGER.print_struct;
39 td->check_constraints = asn_DEF_INTEGER.check_constraints;
40 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
41 td->der_encoder = asn_DEF_INTEGER.der_encoder;
42 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
43 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
44 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
45 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
46 if(!td->per_constraints)
47 td->per_constraints = asn_DEF_INTEGER.per_constraints;
48 td->elements = asn_DEF_INTEGER.elements;
49 td->elements_count = asn_DEF_INTEGER.elements_count;
50 td->specifics = asn_DEF_INTEGER.specifics;
51 }
52
53 void
54 Int1_free(asn_TYPE_descriptor_t *td,
55 void *struct_ptr, int contents_only) {
56 Int1_1_inherit_TYPE_descriptor(td);
57 td->free_struct(td, struct_ptr, contents_only);
58 }
59
60 int
61 Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
62 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
63 Int1_1_inherit_TYPE_descriptor(td);
64 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
65 }
66
67 asn_dec_rval_t
68 Int1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
69 void **structure, const void *bufptr, size_t size, int tag_mode) {
70 Int1_1_inherit_TYPE_descriptor(td);
71 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
72 }
73
74 asn_enc_rval_t
75 Int1_encode_der(asn_TYPE_descriptor_t *td,
76 void *structure, int tag_mode, ber_tlv_tag_t tag,
77 asn_app_consume_bytes_f *cb, void *app_key) {
78 Int1_1_inherit_TYPE_descriptor(td);
79 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
80 }
81
82 asn_dec_rval_t
83 Int1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
84 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
85 Int1_1_inherit_TYPE_descriptor(td);
86 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
87 }
88
89 asn_enc_rval_t
90 Int1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
91 int ilevel, enum xer_encoder_flags_e flags,
92 asn_app_consume_bytes_f *cb, void *app_key) {
93 Int1_1_inherit_TYPE_descriptor(td);
94 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
95 }
96
97
98 /*** <<< STAT-DEFS [Int1] >>> ***/
99
100 static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
101 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
102 };
103 asn_TYPE_descriptor_t asn_DEF_Int1 = {
104 "Int1",
105 "Int1",
106 Int1_free,
107 Int1_print,
108 Int1_constraint,
109 Int1_decode_ber,
110 Int1_encode_der,
111 Int1_decode_xer,
112 Int1_encode_xer,
113 0, 0, /* No PER support, use "-gen-PER" to enable */
114 0, /* Use generic outmost tag fetcher */
115 asn_DEF_Int1_tags_1,
116 sizeof(asn_DEF_Int1_tags_1)
117 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
118 asn_DEF_Int1_tags_1, /* Same as above */
119 sizeof(asn_DEF_Int1_tags_1)
120 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
121 0, /* No PER visible constraints */
122 0, 0, /* No members */
123 0 /* No specifics */
124 };
125
126
127 /*** <<< INCLUDES [Int2] >>> ***/
128
129 #include "Int1.h"
130
131 /*** <<< TYPE-DECLS [Int2] >>> ***/
132
133 typedef Int1_t Int2_t;
134
135 /*** <<< FUNC-DECLS [Int2] >>> ***/
136
137 extern asn_TYPE_descriptor_t asn_DEF_Int2;
138 asn_struct_free_f Int2_free;
139 asn_struct_print_f Int2_print;
140 asn_constr_check_f Int2_constraint;
141 ber_type_decoder_f Int2_decode_ber;
142 der_type_encoder_f Int2_encode_der;
143 xer_type_decoder_f Int2_decode_xer;
144 xer_type_encoder_f Int2_encode_xer;
145
146 /*** <<< CODE [Int2] >>> ***/
147
148 int
149 Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
150 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
151 const Int1_t *st = (const Int1_t *)sptr;
152 long value;
153
154 if(!sptr) {
155 ASN__CTFAIL(app_key, td, sptr,
156 "%s: value not given (%s:%d)",
157 td->name, __FILE__, __LINE__);
158 return -1;
159 }
160
161 /* Check if the sign bit is present */
162 value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
163
164 if((value >= 0)) {
165 /* Constraint check succeeded */
166 return 0;
167 } else {
168 ASN__CTFAIL(app_key, td, sptr,
169 "%s: constraint failed (%s:%d)",
170 td->name, __FILE__, __LINE__);
171 return -1;
172 }
173 }
174
175 /*
176 * This type is implemented using Int1,
177 * so here we adjust the DEF accordingly.
178 */
179 static void
180 Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
181 td->free_struct = asn_DEF_Int1.free_struct;
182 td->print_struct = asn_DEF_Int1.print_struct;
183 td->check_constraints = asn_DEF_Int1.check_constraints;
184 td->ber_decoder = asn_DEF_Int1.ber_decoder;
185 td->der_encoder = asn_DEF_Int1.der_encoder;
186 td->xer_decoder = asn_DEF_Int1.xer_decoder;
187 td->xer_encoder = asn_DEF_Int1.xer_encoder;
188 td->uper_decoder = asn_DEF_Int1.uper_decoder;
189 td->uper_encoder = asn_DEF_Int1.uper_encoder;
190 if(!td->per_constraints)
191 td->per_constraints = asn_DEF_Int1.per_constraints;
192 td->elements = asn_DEF_Int1.elements;
193 td->elements_count = asn_DEF_Int1.elements_count;
194 td->specifics = asn_DEF_Int1.specifics;
195 }
196
197 void
198 Int2_free(asn_TYPE_descriptor_t *td,
199 void *struct_ptr, int contents_only) {
200 Int2_1_inherit_TYPE_descriptor(td);
201 td->free_struct(td, struct_ptr, contents_only);
202 }
203
204 int
205 Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
206 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
207 Int2_1_inherit_TYPE_descriptor(td);
208 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
209 }
210
211 asn_dec_rval_t
212 Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
213 void **structure, const void *bufptr, size_t size, int tag_mode) {
214 Int2_1_inherit_TYPE_descriptor(td);
215 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
216 }
217
218 asn_enc_rval_t
219 Int2_encode_der(asn_TYPE_descriptor_t *td,
220 void *structure, int tag_mode, ber_tlv_tag_t tag,
221 asn_app_consume_bytes_f *cb, void *app_key) {
222 Int2_1_inherit_TYPE_descriptor(td);
223 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
224 }
225
226 asn_dec_rval_t
227 Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
228 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
229 Int2_1_inherit_TYPE_descriptor(td);
230 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
231 }
232
233 asn_enc_rval_t
234 Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
235 int ilevel, enum xer_encoder_flags_e flags,
236 asn_app_consume_bytes_f *cb, void *app_key) {
237 Int2_1_inherit_TYPE_descriptor(td);
238 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
239 }
240
241
242 /*** <<< STAT-DEFS [Int2] >>> ***/
243
244 static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
245 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
246 };
247 asn_TYPE_descriptor_t asn_DEF_Int2 = {
248 "Int2",
249 "Int2",
250 Int2_free,
251 Int2_print,
252 Int2_constraint,
253 Int2_decode_ber,
254 Int2_encode_der,
255 Int2_decode_xer,
256 Int2_encode_xer,
257 0, 0, /* No PER support, use "-gen-PER" to enable */
258 0, /* Use generic outmost tag fetcher */
259 asn_DEF_Int2_tags_1,
260 sizeof(asn_DEF_Int2_tags_1)
261 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
262 asn_DEF_Int2_tags_1, /* Same as above */
263 sizeof(asn_DEF_Int2_tags_1)
264 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
265 0, /* No PER visible constraints */
266 0, 0, /* No members */
267 0 /* No specifics */
268 };
269
270
271 /*** <<< INCLUDES [Int3] >>> ***/
272
273 #include "Int2.h"
274
275 /*** <<< TYPE-DECLS [Int3] >>> ***/
276
277 typedef Int2_t Int3_t;
278
279 /*** <<< FUNC-DECLS [Int3] >>> ***/
280
281 extern asn_TYPE_descriptor_t asn_DEF_Int3;
282 asn_struct_free_f Int3_free;
283 asn_struct_print_f Int3_print;
284 asn_constr_check_f Int3_constraint;
285 ber_type_decoder_f Int3_decode_ber;
286 der_type_encoder_f Int3_encode_der;
287 xer_type_decoder_f Int3_decode_xer;
288 xer_type_encoder_f Int3_encode_xer;
289
290 /*** <<< CODE [Int3] >>> ***/
291
292 int
293 Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
294 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
295 const Int2_t *st = (const Int2_t *)sptr;
296 long value;
297
298 if(!sptr) {
299 ASN__CTFAIL(app_key, td, sptr,
300 "%s: value not given (%s:%d)",
301 td->name, __FILE__, __LINE__);
302 return -1;
303 }
304
305 if(asn_INTEGER2long(st, &value)) {
306 ASN__CTFAIL(app_key, td, sptr,
307 "%s: value too large (%s:%d)",
308 td->name, __FILE__, __LINE__);
309 return -1;
310 }
311
312 if((value >= 0 && value <= 10)) {
313 /* Constraint check succeeded */
314 return 0;
315 } else {
316 ASN__CTFAIL(app_key, td, sptr,
317 "%s: constraint failed (%s:%d)",
318 td->name, __FILE__, __LINE__);
319 return -1;
320 }
321 }
322
323 /*
324 * This type is implemented using Int2,
325 * so here we adjust the DEF accordingly.
326 */
327 static void
328 Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
329 td->free_struct = asn_DEF_Int2.free_struct;
330 td->print_struct = asn_DEF_Int2.print_struct;
331 td->check_constraints = asn_DEF_Int2.check_constraints;
332 td->ber_decoder = asn_DEF_Int2.ber_decoder;
333 td->der_encoder = asn_DEF_Int2.der_encoder;
334 td->xer_decoder = asn_DEF_Int2.xer_decoder;
335 td->xer_encoder = asn_DEF_Int2.xer_encoder;
336 td->uper_decoder = asn_DEF_Int2.uper_decoder;
337 td->uper_encoder = asn_DEF_Int2.uper_encoder;
338 if(!td->per_constraints)
339 td->per_constraints = asn_DEF_Int2.per_constraints;
340 td->elements = asn_DEF_Int2.elements;
341 td->elements_count = asn_DEF_Int2.elements_count;
342 td->specifics = asn_DEF_Int2.specifics;
343 }
344
345 void
346 Int3_free(asn_TYPE_descriptor_t *td,
347 void *struct_ptr, int contents_only) {
348 Int3_1_inherit_TYPE_descriptor(td);
349 td->free_struct(td, struct_ptr, contents_only);
350 }
351
352 int
353 Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
354 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
355 Int3_1_inherit_TYPE_descriptor(td);
356 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
357 }
358
359 asn_dec_rval_t
360 Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
361 void **structure, const void *bufptr, size_t size, int tag_mode) {
362 Int3_1_inherit_TYPE_descriptor(td);
363 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
364 }
365
366 asn_enc_rval_t
367 Int3_encode_der(asn_TYPE_descriptor_t *td,
368 void *structure, int tag_mode, ber_tlv_tag_t tag,
369 asn_app_consume_bytes_f *cb, void *app_key) {
370 Int3_1_inherit_TYPE_descriptor(td);
371 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
372 }
373
374 asn_dec_rval_t
375 Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
376 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
377 Int3_1_inherit_TYPE_descriptor(td);
378 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
379 }
380
381 asn_enc_rval_t
382 Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
383 int ilevel, enum xer_encoder_flags_e flags,
384 asn_app_consume_bytes_f *cb, void *app_key) {
385 Int3_1_inherit_TYPE_descriptor(td);
386 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
387 }
388
389
390 /*** <<< STAT-DEFS [Int3] >>> ***/
391
392 static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
393 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
394 };
395 asn_TYPE_descriptor_t asn_DEF_Int3 = {
396 "Int3",
397 "Int3",
398 Int3_free,
399 Int3_print,
400 Int3_constraint,
401 Int3_decode_ber,
402 Int3_encode_der,
403 Int3_decode_xer,
404 Int3_encode_xer,
405 0, 0, /* No PER support, use "-gen-PER" to enable */
406 0, /* Use generic outmost tag fetcher */
407 asn_DEF_Int3_tags_1,
408 sizeof(asn_DEF_Int3_tags_1)
409 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
410 asn_DEF_Int3_tags_1, /* Same as above */
411 sizeof(asn_DEF_Int3_tags_1)
412 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
413 0, /* No PER visible constraints */
414 0, 0, /* No members */
415 0 /* No specifics */
416 };
417
418
419 /*** <<< INCLUDES [Int4] >>> ***/
420
421 #include "Int3.h"
422
423 /*** <<< TYPE-DECLS [Int4] >>> ***/
424
425 typedef Int3_t Int4_t;
426
427 /*** <<< FUNC-DECLS [Int4] >>> ***/
428
429 extern asn_TYPE_descriptor_t asn_DEF_Int4;
430 asn_struct_free_f Int4_free;
431 asn_struct_print_f Int4_print;
432 asn_constr_check_f Int4_constraint;
433 ber_type_decoder_f Int4_decode_ber;
434 der_type_encoder_f Int4_encode_der;
435 xer_type_decoder_f Int4_decode_xer;
436 xer_type_encoder_f Int4_encode_xer;
437
438 /*** <<< CODE [Int4] >>> ***/
439
440 int
441 Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
442 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
443 const Int3_t *st = (const Int3_t *)sptr;
444 long value;
445
446 if(!sptr) {
447 ASN__CTFAIL(app_key, td, sptr,
448 "%s: value not given (%s:%d)",
449 td->name, __FILE__, __LINE__);
450 return -1;
451 }
452
453 if(asn_INTEGER2long(st, &value)) {
454 ASN__CTFAIL(app_key, td, sptr,
455 "%s: value too large (%s:%d)",
456 td->name, __FILE__, __LINE__);
457 return -1;
458 }
459
460 if((value >= 1 && value <= 10)) {
461 /* Constraint check succeeded */
462 return 0;
463 } else {
464 ASN__CTFAIL(app_key, td, sptr,
465 "%s: constraint failed (%s:%d)",
466 td->name, __FILE__, __LINE__);
467 return -1;
468 }
469 }
470
471 /*
472 * This type is implemented using Int3,
473 * so here we adjust the DEF accordingly.
474 */
475 static void
476 Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
477 td->free_struct = asn_DEF_Int3.free_struct;
478 td->print_struct = asn_DEF_Int3.print_struct;
479 td->check_constraints = asn_DEF_Int3.check_constraints;
480 td->ber_decoder = asn_DEF_Int3.ber_decoder;
481 td->der_encoder = asn_DEF_Int3.der_encoder;
482 td->xer_decoder = asn_DEF_Int3.xer_decoder;
483 td->xer_encoder = asn_DEF_Int3.xer_encoder;
484 td->uper_decoder = asn_DEF_Int3.uper_decoder;
485 td->uper_encoder = asn_DEF_Int3.uper_encoder;
486 if(!td->per_constraints)
487 td->per_constraints = asn_DEF_Int3.per_constraints;
488 td->elements = asn_DEF_Int3.elements;
489 td->elements_count = asn_DEF_Int3.elements_count;
490 td->specifics = asn_DEF_Int3.specifics;
491 }
492
493 void
494 Int4_free(asn_TYPE_descriptor_t *td,
495 void *struct_ptr, int contents_only) {
496 Int4_1_inherit_TYPE_descriptor(td);
497 td->free_struct(td, struct_ptr, contents_only);
498 }
499
500 int
501 Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
502 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
503 Int4_1_inherit_TYPE_descriptor(td);
504 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
505 }
506
507 asn_dec_rval_t
508 Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
509 void **structure, const void *bufptr, size_t size, int tag_mode) {
510 Int4_1_inherit_TYPE_descriptor(td);
511 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
512 }
513
514 asn_enc_rval_t
515 Int4_encode_der(asn_TYPE_descriptor_t *td,
516 void *structure, int tag_mode, ber_tlv_tag_t tag,
517 asn_app_consume_bytes_f *cb, void *app_key) {
518 Int4_1_inherit_TYPE_descriptor(td);
519 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
520 }
521
522 asn_dec_rval_t
523 Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
524 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
525 Int4_1_inherit_TYPE_descriptor(td);
526 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
527 }
528
529 asn_enc_rval_t
530 Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
531 int ilevel, enum xer_encoder_flags_e flags,
532 asn_app_consume_bytes_f *cb, void *app_key) {
533 Int4_1_inherit_TYPE_descriptor(td);
534 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
535 }
536
537
538 /*** <<< STAT-DEFS [Int4] >>> ***/
539
540 static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
541 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
542 };
543 asn_TYPE_descriptor_t asn_DEF_Int4 = {
544 "Int4",
545 "Int4",
546 Int4_free,
547 Int4_print,
548 Int4_constraint,
549 Int4_decode_ber,
550 Int4_encode_der,
551 Int4_decode_xer,
552 Int4_encode_xer,
553 0, 0, /* No PER support, use "-gen-PER" to enable */
554 0, /* Use generic outmost tag fetcher */
555 asn_DEF_Int4_tags_1,
556 sizeof(asn_DEF_Int4_tags_1)
557 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
558 asn_DEF_Int4_tags_1, /* Same as above */
559 sizeof(asn_DEF_Int4_tags_1)
560 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
561 0, /* No PER visible constraints */
562 0, 0, /* No members */
563 0 /* No specifics */
564 };
565
566
567 /*** <<< INCLUDES [Int5] >>> ***/
568
569 #include "Int4.h"
570
571 /*** <<< TYPE-DECLS [Int5] >>> ***/
572
573 typedef Int4_t Int5_t;
574
575 /*** <<< FUNC-DECLS [Int5] >>> ***/
576
577 extern asn_TYPE_descriptor_t asn_DEF_Int5;
578 asn_struct_free_f Int5_free;
579 asn_struct_print_f Int5_print;
580 asn_constr_check_f Int5_constraint;
581 ber_type_decoder_f Int5_decode_ber;
582 der_type_encoder_f Int5_encode_der;
583 xer_type_decoder_f Int5_decode_xer;
584 xer_type_encoder_f Int5_encode_xer;
585
586 /*** <<< CODE [Int5] >>> ***/
587
588 int
589 Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
590 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
591 const Int4_t *st = (const Int4_t *)sptr;
592 long value;
593
594 if(!sptr) {
595 ASN__CTFAIL(app_key, td, sptr,
596 "%s: value not given (%s:%d)",
597 td->name, __FILE__, __LINE__);
598 return -1;
599 }
600
601 if(asn_INTEGER2long(st, &value)) {
602 ASN__CTFAIL(app_key, td, sptr,
603 "%s: value too large (%s:%d)",
604 td->name, __FILE__, __LINE__);
605 return -1;
606 }
607
608 if((value == 5)) {
609 /* Constraint check succeeded */
610 return 0;
611 } else {
612 ASN__CTFAIL(app_key, td, sptr,
613 "%s: constraint failed (%s:%d)",
614 td->name, __FILE__, __LINE__);
615 return -1;
616 }
617 }
618
619 /*
620 * This type is implemented using Int4,
621 * so here we adjust the DEF accordingly.
622 */
623 static void
624 Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
625 td->free_struct = asn_DEF_Int4.free_struct;
626 td->print_struct = asn_DEF_Int4.print_struct;
627 td->check_constraints = asn_DEF_Int4.check_constraints;
628 td->ber_decoder = asn_DEF_Int4.ber_decoder;
629 td->der_encoder = asn_DEF_Int4.der_encoder;
630 td->xer_decoder = asn_DEF_Int4.xer_decoder;
631 td->xer_encoder = asn_DEF_Int4.xer_encoder;
632 td->uper_decoder = asn_DEF_Int4.uper_decoder;
633 td->uper_encoder = asn_DEF_Int4.uper_encoder;
634 if(!td->per_constraints)
635 td->per_constraints = asn_DEF_Int4.per_constraints;
636 td->elements = asn_DEF_Int4.elements;
637 td->elements_count = asn_DEF_Int4.elements_count;
638 td->specifics = asn_DEF_Int4.specifics;
639 }
640
641 void
642 Int5_free(asn_TYPE_descriptor_t *td,
643 void *struct_ptr, int contents_only) {
644 Int5_1_inherit_TYPE_descriptor(td);
645 td->free_struct(td, struct_ptr, contents_only);
646 }
647
648 int
649 Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
650 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
651 Int5_1_inherit_TYPE_descriptor(td);
652 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
653 }
654
655 asn_dec_rval_t
656 Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
657 void **structure, const void *bufptr, size_t size, int tag_mode) {
658 Int5_1_inherit_TYPE_descriptor(td);
659 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
660 }
661
662 asn_enc_rval_t
663 Int5_encode_der(asn_TYPE_descriptor_t *td,
664 void *structure, int tag_mode, ber_tlv_tag_t tag,
665 asn_app_consume_bytes_f *cb, void *app_key) {
666 Int5_1_inherit_TYPE_descriptor(td);
667 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
668 }
669
670 asn_dec_rval_t
671 Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
672 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
673 Int5_1_inherit_TYPE_descriptor(td);
674 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
675 }
676
677 asn_enc_rval_t
678 Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
679 int ilevel, enum xer_encoder_flags_e flags,
680 asn_app_consume_bytes_f *cb, void *app_key) {
681 Int5_1_inherit_TYPE_descriptor(td);
682 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
683 }
684
685
686 /*** <<< STAT-DEFS [Int5] >>> ***/
687
688 static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
689 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
690 };
691 asn_TYPE_descriptor_t asn_DEF_Int5 = {
692 "Int5",
693 "Int5",
694 Int5_free,
695 Int5_print,
696 Int5_constraint,
697 Int5_decode_ber,
698 Int5_encode_der,
699 Int5_decode_xer,
700 Int5_encode_xer,
701 0, 0, /* No PER support, use "-gen-PER" to enable */
702 0, /* Use generic outmost tag fetcher */
703 asn_DEF_Int5_tags_1,
704 sizeof(asn_DEF_Int5_tags_1)
705 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
706 asn_DEF_Int5_tags_1, /* Same as above */
707 sizeof(asn_DEF_Int5_tags_1)
708 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
709 0, /* No PER visible constraints */
710 0, 0, /* No members */
711 0 /* No specifics */
712 };
713
714
715 /*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
716
717 #include <INTEGER.h>
718
719 /*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
720
721 typedef INTEGER_t ExtensibleExtensions_t;
722
723 /*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
724
725 extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
726 asn_struct_free_f ExtensibleExtensions_free;
727 asn_struct_print_f ExtensibleExtensions_print;
728 asn_constr_check_f ExtensibleExtensions_constraint;
729 ber_type_decoder_f ExtensibleExtensions_decode_ber;
730 der_type_encoder_f ExtensibleExtensions_encode_der;
731 xer_type_decoder_f ExtensibleExtensions_decode_xer;
732 xer_type_encoder_f ExtensibleExtensions_encode_xer;
733
734 /*** <<< CODE [ExtensibleExtensions] >>> ***/
735
736 int
737 ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
738 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
739 const INTEGER_t *st = (const INTEGER_t *)sptr;
740 long value;
741
742 if(!sptr) {
743 ASN__CTFAIL(app_key, td, sptr,
744 "%s: value not given (%s:%d)",
745 td->name, __FILE__, __LINE__);
746 return -1;
747 }
748
749 if(asn_INTEGER2long(st, &value)) {
750 ASN__CTFAIL(app_key, td, sptr,
751 "%s: value too large (%s:%d)",
752 td->name, __FILE__, __LINE__);
753 return -1;
754 }
755
756 if((value >= 1 && value <= 256)) {
757 /* Constraint check succeeded */
758 return 0;
759 } else {
760 ASN__CTFAIL(app_key, td, sptr,
761 "%s: constraint failed (%s:%d)",
762 td->name, __FILE__, __LINE__);
763 return -1;
764 }
765 }
766
767 /*
768 * This type is implemented using INTEGER,
769 * so here we adjust the DEF accordingly.
770 */
771 static void
772 ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
773 td->free_struct = asn_DEF_INTEGER.free_struct;
774 td->print_struct = asn_DEF_INTEGER.print_struct;
775 td->check_constraints = asn_DEF_INTEGER.check_constraints;
776 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
777 td->der_encoder = asn_DEF_INTEGER.der_encoder;
778 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
779 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
780 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
781 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
782 if(!td->per_constraints)
783 td->per_constraints = asn_DEF_INTEGER.per_constraints;
784 td->elements = asn_DEF_INTEGER.elements;
785 td->elements_count = asn_DEF_INTEGER.elements_count;
786 td->specifics = asn_DEF_INTEGER.specifics;
787 }
788
789 void
790 ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
791 void *struct_ptr, int contents_only) {
792 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
793 td->free_struct(td, struct_ptr, contents_only);
794 }
795
796 int
797 ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
798 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
799 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
800 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
801 }
802
803 asn_dec_rval_t
804 ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
805 void **structure, const void *bufptr, size_t size, int tag_mode) {
806 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
807 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
808 }
809
810 asn_enc_rval_t
811 ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
812 void *structure, int tag_mode, ber_tlv_tag_t tag,
813 asn_app_consume_bytes_f *cb, void *app_key) {
814 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
815 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
816 }
817
818 asn_dec_rval_t
819 ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
820 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
821 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
822 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
823 }
824
825 asn_enc_rval_t
826 ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
827 int ilevel, enum xer_encoder_flags_e flags,
828 asn_app_consume_bytes_f *cb, void *app_key) {
829 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
830 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
831 }
832
833
834 /*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
835
836 static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
837 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
838 };
839 asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
840 "ExtensibleExtensions",
841 "ExtensibleExtensions",
842 ExtensibleExtensions_free,
843 ExtensibleExtensions_print,
844 ExtensibleExtensions_constraint,
845 ExtensibleExtensions_decode_ber,
846 ExtensibleExtensions_encode_der,
847 ExtensibleExtensions_decode_xer,
848 ExtensibleExtensions_encode_xer,
849 0, 0, /* No PER support, use "-gen-PER" to enable */
850 0, /* Use generic outmost tag fetcher */
851 asn_DEF_ExtensibleExtensions_tags_1,
852 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
853 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
854 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
855 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
856 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
857 0, /* No PER visible constraints */
858 0, 0, /* No members */
859 0 /* No specifics */
860 };
861
862
863 /*** <<< INCLUDES [Str1] >>> ***/
864
865 #include <IA5String.h>
866
867 /*** <<< TYPE-DECLS [Str1] >>> ***/
868
869 typedef IA5String_t Str1_t;
870
871 /*** <<< FUNC-DECLS [Str1] >>> ***/
872
873 extern asn_TYPE_descriptor_t asn_DEF_Str1;
874 asn_struct_free_f Str1_free;
875 asn_struct_print_f Str1_print;
876 asn_constr_check_f Str1_constraint;
877 ber_type_decoder_f Str1_decode_ber;
878 der_type_encoder_f Str1_encode_der;
879 xer_type_decoder_f Str1_decode_xer;
880 xer_type_encoder_f Str1_encode_xer;
881
882 /*** <<< CODE [Str1] >>> ***/
883
884 int
885 Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
886 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
887 /* Replace with underlying type checker */
888 td->check_constraints = asn_DEF_IA5String.check_constraints;
889 return td->check_constraints(td, sptr, ctfailcb, app_key);
890 }
891
892 /*
893 * This type is implemented using IA5String,
894 * so here we adjust the DEF accordingly.
895 */
896 static void
897 Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
898 td->free_struct = asn_DEF_IA5String.free_struct;
899 td->print_struct = asn_DEF_IA5String.print_struct;
900 td->check_constraints = asn_DEF_IA5String.check_constraints;
901 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
902 td->der_encoder = asn_DEF_IA5String.der_encoder;
903 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
904 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
905 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
906 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
907 if(!td->per_constraints)
908 td->per_constraints = asn_DEF_IA5String.per_constraints;
909 td->elements = asn_DEF_IA5String.elements;
910 td->elements_count = asn_DEF_IA5String.elements_count;
911 td->specifics = asn_DEF_IA5String.specifics;
912 }
913
914 void
915 Str1_free(asn_TYPE_descriptor_t *td,
916 void *struct_ptr, int contents_only) {
917 Str1_1_inherit_TYPE_descriptor(td);
918 td->free_struct(td, struct_ptr, contents_only);
919 }
920
921 int
922 Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
923 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
924 Str1_1_inherit_TYPE_descriptor(td);
925 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
926 }
927
928 asn_dec_rval_t
929 Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
930 void **structure, const void *bufptr, size_t size, int tag_mode) {
931 Str1_1_inherit_TYPE_descriptor(td);
932 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
933 }
934
935 asn_enc_rval_t
936 Str1_encode_der(asn_TYPE_descriptor_t *td,
937 void *structure, int tag_mode, ber_tlv_tag_t tag,
938 asn_app_consume_bytes_f *cb, void *app_key) {
939 Str1_1_inherit_TYPE_descriptor(td);
940 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
941 }
942
943 asn_dec_rval_t
944 Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
945 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
946 Str1_1_inherit_TYPE_descriptor(td);
947 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
948 }
949
950 asn_enc_rval_t
951 Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
952 int ilevel, enum xer_encoder_flags_e flags,
953 asn_app_consume_bytes_f *cb, void *app_key) {
954 Str1_1_inherit_TYPE_descriptor(td);
955 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
956 }
957
958
959 /*** <<< STAT-DEFS [Str1] >>> ***/
960
961 static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
962 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
963 };
964 asn_TYPE_descriptor_t asn_DEF_Str1 = {
965 "Str1",
966 "Str1",
967 Str1_free,
968 Str1_print,
969 Str1_constraint,
970 Str1_decode_ber,
971 Str1_encode_der,
972 Str1_decode_xer,
973 Str1_encode_xer,
974 0, 0, /* No PER support, use "-gen-PER" to enable */
975 0, /* Use generic outmost tag fetcher */
976 asn_DEF_Str1_tags_1,
977 sizeof(asn_DEF_Str1_tags_1)
978 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
979 asn_DEF_Str1_tags_1, /* Same as above */
980 sizeof(asn_DEF_Str1_tags_1)
981 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
982 0, /* No PER visible constraints */
983 0, 0, /* No members */
984 0 /* No specifics */
985 };
986
987
988 /*** <<< INCLUDES [Str2] >>> ***/
989
990 #include "Str1.h"
991
992 /*** <<< TYPE-DECLS [Str2] >>> ***/
993
994 typedef Str1_t Str2_t;
995
996 /*** <<< FUNC-DECLS [Str2] >>> ***/
997
998 extern asn_TYPE_descriptor_t asn_DEF_Str2;
999 asn_struct_free_f Str2_free;
1000 asn_struct_print_f Str2_print;
1001 asn_constr_check_f Str2_constraint;
1002 ber_type_decoder_f Str2_decode_ber;
1003 der_type_encoder_f Str2_encode_der;
1004 xer_type_decoder_f Str2_decode_xer;
1005 xer_type_encoder_f Str2_encode_xer;
1006
1007 /*** <<< CTABLES [Str2] >>> ***/
1008
1009 static int check_permitted_alphabet_1(const void *sptr) {
1010 /* The underlying type is IA5String */
1011 const IA5String_t *st = (const IA5String_t *)sptr;
1012 const uint8_t *ch = st->buf;
1013 const uint8_t *end = ch + st->size;
1014
1015 for(; ch < end; ch++) {
1016 uint8_t cv = *ch;
1017 if(!(cv <= 127)) return -1;
1018 }
1019 return 0;
1020 }
1021
1022
1023 /*** <<< CODE [Str2] >>> ***/
1024
1025 int
1026 Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
1027 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1028 const Str1_t *st = (const Str1_t *)sptr;
1029 size_t size;
1030
1031 if(!sptr) {
1032 ASN__CTFAIL(app_key, td, sptr,
1033 "%s: value not given (%s:%d)",
1034 td->name, __FILE__, __LINE__);
1035 return -1;
1036 }
1037
1038 size = st->size;
1039
1040 if(((size <= 20) || (size >= 25 && size <= 30))
1041 && !check_permitted_alphabet_1(st)) {
1042 /* Constraint check succeeded */
1043 return 0;
1044 } else {
1045 ASN__CTFAIL(app_key, td, sptr,
1046 "%s: constraint failed (%s:%d)",
1047 td->name, __FILE__, __LINE__);
1048 return -1;
1049 }
1050 }
1051
1052 /*
1053 * This type is implemented using Str1,
1054 * so here we adjust the DEF accordingly.
1055 */
1056 static void
1057 Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1058 td->free_struct = asn_DEF_Str1.free_struct;
1059 td->print_struct = asn_DEF_Str1.print_struct;
1060 td->check_constraints = asn_DEF_Str1.check_constraints;
1061 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1062 td->der_encoder = asn_DEF_Str1.der_encoder;
1063 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1064 td->xer_encoder = asn_DEF_Str1.xer_encoder;
1065 td->uper_decoder = asn_DEF_Str1.uper_decoder;
1066 td->uper_encoder = asn_DEF_Str1.uper_encoder;
1067 if(!td->per_constraints)
1068 td->per_constraints = asn_DEF_Str1.per_constraints;
1069 td->elements = asn_DEF_Str1.elements;
1070 td->elements_count = asn_DEF_Str1.elements_count;
1071 td->specifics = asn_DEF_Str1.specifics;
1072 }
1073
1074 void
1075 Str2_free(asn_TYPE_descriptor_t *td,
1076 void *struct_ptr, int contents_only) {
1077 Str2_1_inherit_TYPE_descriptor(td);
1078 td->free_struct(td, struct_ptr, contents_only);
1079 }
1080
1081 int
1082 Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1083 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1084 Str2_1_inherit_TYPE_descriptor(td);
1085 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1086 }
1087
1088 asn_dec_rval_t
1089 Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1090 void **structure, const void *bufptr, size_t size, int tag_mode) {
1091 Str2_1_inherit_TYPE_descriptor(td);
1092 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1093 }
1094
1095 asn_enc_rval_t
1096 Str2_encode_der(asn_TYPE_descriptor_t *td,
1097 void *structure, int tag_mode, ber_tlv_tag_t tag,
1098 asn_app_consume_bytes_f *cb, void *app_key) {
1099 Str2_1_inherit_TYPE_descriptor(td);
1100 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1101 }
1102
1103 asn_dec_rval_t
1104 Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1105 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1106 Str2_1_inherit_TYPE_descriptor(td);
1107 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1108 }
1109
1110 asn_enc_rval_t
1111 Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1112 int ilevel, enum xer_encoder_flags_e flags,
1113 asn_app_consume_bytes_f *cb, void *app_key) {
1114 Str2_1_inherit_TYPE_descriptor(td);
1115 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1116 }
1117
1118
1119 /*** <<< STAT-DEFS [Str2] >>> ***/
1120
1121 static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
1122 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1123 };
1124 asn_TYPE_descriptor_t asn_DEF_Str2 = {
1125 "Str2",
1126 "Str2",
1127 Str2_free,
1128 Str2_print,
1129 Str2_constraint,
1130 Str2_decode_ber,
1131 Str2_encode_der,
1132 Str2_decode_xer,
1133 Str2_encode_xer,
1134 0, 0, /* No PER support, use "-gen-PER" to enable */
1135 0, /* Use generic outmost tag fetcher */
1136 asn_DEF_Str2_tags_1,
1137 sizeof(asn_DEF_Str2_tags_1)
1138 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1139 asn_DEF_Str2_tags_1, /* Same as above */
1140 sizeof(asn_DEF_Str2_tags_1)
1141 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1142 0, /* No PER visible constraints */
1143 0, 0, /* No members */
1144 0 /* No specifics */
1145 };
1146
1147
1148 /*** <<< INCLUDES [Str3] >>> ***/
1149
1150 #include "Str2.h"
1151
1152 /*** <<< TYPE-DECLS [Str3] >>> ***/
1153
1154 typedef Str2_t Str3_t;
1155
1156 /*** <<< FUNC-DECLS [Str3] >>> ***/
1157
1158 extern asn_TYPE_descriptor_t asn_DEF_Str3;
1159 asn_struct_free_f Str3_free;
1160 asn_struct_print_f Str3_print;
1161 asn_constr_check_f Str3_constraint;
1162 ber_type_decoder_f Str3_decode_ber;
1163 der_type_encoder_f Str3_encode_der;
1164 xer_type_decoder_f Str3_decode_xer;
1165 xer_type_encoder_f Str3_encode_xer;
1166
1167 /*** <<< CTABLES [Str3] >>> ***/
1168
1169 static const int permitted_alphabet_table_1[256] = {
1170 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1171 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1172 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1173 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1174 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
1175 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1176 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
1177 };
1178
1179 static int check_permitted_alphabet_1(const void *sptr) {
1180 const int *table = permitted_alphabet_table_1;
1181 /* The underlying type is IA5String */
1182 const IA5String_t *st = (const IA5String_t *)sptr;
1183 const uint8_t *ch = st->buf;
1184 const uint8_t *end = ch + st->size;
1185
1186 for(; ch < end; ch++) {
1187 uint8_t cv = *ch;
1188 if(!table[cv]) return -1;
1189 }
1190 return 0;
1191 }
1192
1193
1194 /*** <<< CODE [Str3] >>> ***/
1195
1196 int
1197 Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
1198 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1199 const Str2_t *st = (const Str2_t *)sptr;
1200 size_t size;
1201
1202 if(!sptr) {
1203 ASN__CTFAIL(app_key, td, sptr,
1204 "%s: value not given (%s:%d)",
1205 td->name, __FILE__, __LINE__);
1206 return -1;
1207 }
1208
1209 size = st->size;
1210
1211 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
1212 && !check_permitted_alphabet_1(st)) {
1213 /* Constraint check succeeded */
1214 return 0;
1215 } else {
1216 ASN__CTFAIL(app_key, td, sptr,
1217 "%s: constraint failed (%s:%d)",
1218 td->name, __FILE__, __LINE__);
1219 return -1;
1220 }
1221 }
1222
1223 /*
1224 * This type is implemented using Str2,
1225 * so here we adjust the DEF accordingly.
1226 */
1227 static void
1228 Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1229 td->free_struct = asn_DEF_Str2.free_struct;
1230 td->print_struct = asn_DEF_Str2.print_struct;
1231 td->check_constraints = asn_DEF_Str2.check_constraints;
1232 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1233 td->der_encoder = asn_DEF_Str2.der_encoder;
1234 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1235 td->xer_encoder = asn_DEF_Str2.xer_encoder;
1236 td->uper_decoder = asn_DEF_Str2.uper_decoder;
1237 td->uper_encoder = asn_DEF_Str2.uper_encoder;
1238 if(!td->per_constraints)
1239 td->per_constraints = asn_DEF_Str2.per_constraints;
1240 td->elements = asn_DEF_Str2.elements;
1241 td->elements_count = asn_DEF_Str2.elements_count;
1242 td->specifics = asn_DEF_Str2.specifics;
1243 }
1244
1245 void
1246 Str3_free(asn_TYPE_descriptor_t *td,
1247 void *struct_ptr, int contents_only) {
1248 Str3_1_inherit_TYPE_descriptor(td);
1249 td->free_struct(td, struct_ptr, contents_only);
1250 }
1251
1252 int
1253 Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1254 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1255 Str3_1_inherit_TYPE_descriptor(td);
1256 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1257 }
1258
1259 asn_dec_rval_t
1260 Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1261 void **structure, const void *bufptr, size_t size, int tag_mode) {
1262 Str3_1_inherit_TYPE_descriptor(td);
1263 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1264 }
1265
1266 asn_enc_rval_t
1267 Str3_encode_der(asn_TYPE_descriptor_t *td,
1268 void *structure, int tag_mode, ber_tlv_tag_t tag,
1269 asn_app_consume_bytes_f *cb, void *app_key) {
1270 Str3_1_inherit_TYPE_descriptor(td);
1271 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1272 }
1273
1274 asn_dec_rval_t
1275 Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1276 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1277 Str3_1_inherit_TYPE_descriptor(td);
1278 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1279 }
1280
1281 asn_enc_rval_t
1282 Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1283 int ilevel, enum xer_encoder_flags_e flags,
1284 asn_app_consume_bytes_f *cb, void *app_key) {
1285 Str3_1_inherit_TYPE_descriptor(td);
1286 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1287 }
1288
1289
1290 /*** <<< STAT-DEFS [Str3] >>> ***/
1291
1292 static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
1293 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1294 };
1295 asn_TYPE_descriptor_t asn_DEF_Str3 = {
1296 "Str3",
1297 "Str3",
1298 Str3_free,
1299 Str3_print,
1300 Str3_constraint,
1301 Str3_decode_ber,
1302 Str3_encode_der,
1303 Str3_decode_xer,
1304 Str3_encode_xer,
1305 0, 0, /* No PER support, use "-gen-PER" to enable */
1306 0, /* Use generic outmost tag fetcher */
1307 asn_DEF_Str3_tags_1,
1308 sizeof(asn_DEF_Str3_tags_1)
1309 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1310 asn_DEF_Str3_tags_1, /* Same as above */
1311 sizeof(asn_DEF_Str3_tags_1)
1312 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1313 0, /* No PER visible constraints */
1314 0, 0, /* No members */
1315 0 /* No specifics */
1316 };
1317
1318
1319 /*** <<< INCLUDES [Str4] >>> ***/
1320
1321 #include <IA5String.h>
1322
1323 /*** <<< TYPE-DECLS [Str4] >>> ***/
1324
1325 typedef IA5String_t Str4_t;
1326
1327 /*** <<< FUNC-DECLS [Str4] >>> ***/
1328
1329 extern asn_TYPE_descriptor_t asn_DEF_Str4;
1330 asn_struct_free_f Str4_free;
1331 asn_struct_print_f Str4_print;
1332 asn_constr_check_f Str4_constraint;
1333 ber_type_decoder_f Str4_decode_ber;
1334 der_type_encoder_f Str4_encode_der;
1335 xer_type_decoder_f Str4_decode_xer;
1336 xer_type_encoder_f Str4_encode_xer;
1337
1338 /*** <<< CTABLES [Str4] >>> ***/
1339
1340 static int check_permitted_alphabet_1(const void *sptr) {
1341 /* The underlying type is IA5String */
1342 const IA5String_t *st = (const IA5String_t *)sptr;
1343 const uint8_t *ch = st->buf;
1344 const uint8_t *end = ch + st->size;
1345
1346 for(; ch < end; ch++) {
1347 uint8_t cv = *ch;
1348 if(!(cv <= 127)) return -1;
1349 }
1350 return 0;
1351 }
1352
1353
1354 /*** <<< CODE [Str4] >>> ***/
1355
1356 int
1357 Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
1358 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1359 const IA5String_t *st = (const IA5String_t *)sptr;
1360
1361 if(!sptr) {
1362 ASN__CTFAIL(app_key, td, sptr,
1363 "%s: value not given (%s:%d)",
1364 td->name, __FILE__, __LINE__);
1365 return -1;
1366 }
1367
1368
1369 if(!check_permitted_alphabet_1(st)) {
1370 /* Constraint check succeeded */
1371 return 0;
1372 } else {
1373 ASN__CTFAIL(app_key, td, sptr,
1374 "%s: constraint failed (%s:%d)",
1375 td->name, __FILE__, __LINE__);
1376 return -1;
1377 }
1378 }
1379
1380 /*
1381 * This type is implemented using IA5String,
1382 * so here we adjust the DEF accordingly.
1383 */
1384 static void
1385 Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1386 td->free_struct = asn_DEF_IA5String.free_struct;
1387 td->print_struct = asn_DEF_IA5String.print_struct;
1388 td->check_constraints = asn_DEF_IA5String.check_constraints;
1389 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1390 td->der_encoder = asn_DEF_IA5String.der_encoder;
1391 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1392 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1393 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
1394 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
1395 if(!td->per_constraints)
1396 td->per_constraints = asn_DEF_IA5String.per_constraints;
1397 td->elements = asn_DEF_IA5String.elements;
1398 td->elements_count = asn_DEF_IA5String.elements_count;
1399 td->specifics = asn_DEF_IA5String.specifics;
1400 }
1401
1402 void
1403 Str4_free(asn_TYPE_descriptor_t *td,
1404 void *struct_ptr, int contents_only) {
1405 Str4_1_inherit_TYPE_descriptor(td);
1406 td->free_struct(td, struct_ptr, contents_only);
1407 }
1408
1409 int
1410 Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1411 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1412 Str4_1_inherit_TYPE_descriptor(td);
1413 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1414 }
1415
1416 asn_dec_rval_t
1417 Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1418 void **structure, const void *bufptr, size_t size, int tag_mode) {
1419 Str4_1_inherit_TYPE_descriptor(td);
1420 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1421 }
1422
1423 asn_enc_rval_t
1424 Str4_encode_der(asn_TYPE_descriptor_t *td,
1425 void *structure, int tag_mode, ber_tlv_tag_t tag,
1426 asn_app_consume_bytes_f *cb, void *app_key) {
1427 Str4_1_inherit_TYPE_descriptor(td);
1428 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1429 }
1430
1431 asn_dec_rval_t
1432 Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1433 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1434 Str4_1_inherit_TYPE_descriptor(td);
1435 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1436 }
1437
1438 asn_enc_rval_t
1439 Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1440 int ilevel, enum xer_encoder_flags_e flags,
1441 asn_app_consume_bytes_f *cb, void *app_key) {
1442 Str4_1_inherit_TYPE_descriptor(td);
1443 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1444 }
1445
1446
1447 /*** <<< STAT-DEFS [Str4] >>> ***/
1448
1449 static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
1450 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1451 };
1452 asn_TYPE_descriptor_t asn_DEF_Str4 = {
1453 "Str4",
1454 "Str4",
1455 Str4_free,
1456 Str4_print,
1457 Str4_constraint,
1458 Str4_decode_ber,
1459 Str4_encode_der,
1460 Str4_decode_xer,
1461 Str4_encode_xer,
1462 0, 0, /* No PER support, use "-gen-PER" to enable */
1463 0, /* Use generic outmost tag fetcher */
1464 asn_DEF_Str4_tags_1,
1465 sizeof(asn_DEF_Str4_tags_1)
1466 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1467 asn_DEF_Str4_tags_1, /* Same as above */
1468 sizeof(asn_DEF_Str4_tags_1)
1469 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1470 0, /* No PER visible constraints */
1471 0, 0, /* No members */
1472 0 /* No specifics */
1473 };
1474
1475
1476 /*** <<< INCLUDES [PER-Visible] >>> ***/
1477
1478 #include <IA5String.h>
1479
1480 /*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1481
1482 typedef IA5String_t PER_Visible_t;
1483
1484 /*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1485
1486 extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
1487 asn_struct_free_f PER_Visible_free;
1488 asn_struct_print_f PER_Visible_print;
1489 asn_constr_check_f PER_Visible_constraint;
1490 ber_type_decoder_f PER_Visible_decode_ber;
1491 der_type_encoder_f PER_Visible_encode_der;
1492 xer_type_decoder_f PER_Visible_decode_xer;
1493 xer_type_encoder_f PER_Visible_encode_xer;
1494
1495 /*** <<< CTABLES [PER-Visible] >>> ***/
1496
1497 static int check_permitted_alphabet_1(const void *sptr) {
1498 /* The underlying type is IA5String */
1499 const IA5String_t *st = (const IA5String_t *)sptr;
1500 const uint8_t *ch = st->buf;
1501 const uint8_t *end = ch + st->size;
1502
1503 for(; ch < end; ch++) {
1504 uint8_t cv = *ch;
1505 if(!(cv >= 65 && cv <= 70)) return -1;
1506 }
1507 return 0;
1508 }
1509
1510
1511 /*** <<< CODE [PER-Visible] >>> ***/
1512
1513 int
1514 PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
1515 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1516 const IA5String_t *st = (const IA5String_t *)sptr;
1517
1518 if(!sptr) {
1519 ASN__CTFAIL(app_key, td, sptr,
1520 "%s: value not given (%s:%d)",
1521 td->name, __FILE__, __LINE__);
1522 return -1;
1523 }
1524
1525
1526 if(!check_permitted_alphabet_1(st)) {
1527 /* Constraint check succeeded */
1528 return 0;
1529 } else {
1530 ASN__CTFAIL(app_key, td, sptr,
1531 "%s: constraint failed (%s:%d)",
1532 td->name, __FILE__, __LINE__);
1533 return -1;
1534 }
1535 }
1536
1537 /*
1538 * This type is implemented using IA5String,
1539 * so here we adjust the DEF accordingly.
1540 */
1541 static void
1542 PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1543 td->free_struct = asn_DEF_IA5String.free_struct;
1544 td->print_struct = asn_DEF_IA5String.print_struct;
1545 td->check_constraints = asn_DEF_IA5String.check_constraints;
1546 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1547 td->der_encoder = asn_DEF_IA5String.der_encoder;
1548 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1549 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1550 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
1551 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
1552 if(!td->per_constraints)
1553 td->per_constraints = asn_DEF_IA5String.per_constraints;
1554 td->elements = asn_DEF_IA5String.elements;
1555 td->elements_count = asn_DEF_IA5String.elements_count;
1556 td->specifics = asn_DEF_IA5String.specifics;
1557 }
1558
1559 void
1560 PER_Visible_free(asn_TYPE_descriptor_t *td,
1561 void *struct_ptr, int contents_only) {
1562 PER_Visible_1_inherit_TYPE_descriptor(td);
1563 td->free_struct(td, struct_ptr, contents_only);
1564 }
1565
1566 int
1567 PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1568 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1569 PER_Visible_1_inherit_TYPE_descriptor(td);
1570 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1571 }
1572
1573 asn_dec_rval_t
1574 PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1575 void **structure, const void *bufptr, size_t size, int tag_mode) {
1576 PER_Visible_1_inherit_TYPE_descriptor(td);
1577 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1578 }
1579
1580 asn_enc_rval_t
1581 PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
1582 void *structure, int tag_mode, ber_tlv_tag_t tag,
1583 asn_app_consume_bytes_f *cb, void *app_key) {
1584 PER_Visible_1_inherit_TYPE_descriptor(td);
1585 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1586 }
1587
1588 asn_dec_rval_t
1589 PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1590 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1591 PER_Visible_1_inherit_TYPE_descriptor(td);
1592 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1593 }
1594
1595 asn_enc_rval_t
1596 PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1597 int ilevel, enum xer_encoder_flags_e flags,
1598 asn_app_consume_bytes_f *cb, void *app_key) {
1599 PER_Visible_1_inherit_TYPE_descriptor(td);
1600 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1601 }
1602
1603
1604 /*** <<< STAT-DEFS [PER-Visible] >>> ***/
1605
1606 static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
1607 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1608 };
1609 asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1610 "PER-Visible",
1611 "PER-Visible",
1612 PER_Visible_free,
1613 PER_Visible_print,
1614 PER_Visible_constraint,
1615 PER_Visible_decode_ber,
1616 PER_Visible_encode_der,
1617 PER_Visible_decode_xer,
1618 PER_Visible_encode_xer,
1619 0, 0, /* No PER support, use "-gen-PER" to enable */
1620 0, /* Use generic outmost tag fetcher */
1621 asn_DEF_PER_Visible_tags_1,
1622 sizeof(asn_DEF_PER_Visible_tags_1)
1623 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1624 asn_DEF_PER_Visible_tags_1, /* Same as above */
1625 sizeof(asn_DEF_PER_Visible_tags_1)
1626 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1627 0, /* No PER visible constraints */
1628 0, 0, /* No members */
1629 0 /* No specifics */
1630 };
1631
1632
1633 /*** <<< INCLUDES [PER-Visible-2] >>> ***/
1634
1635 #include "PER-Visible.h"
1636
1637 /*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1638
1639 typedef PER_Visible_t PER_Visible_2_t;
1640
1641 /*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1642
1643 extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1644 asn_struct_free_f PER_Visible_2_free;
1645 asn_struct_print_f PER_Visible_2_print;
1646 asn_constr_check_f PER_Visible_2_constraint;
1647 ber_type_decoder_f PER_Visible_2_decode_ber;
1648 der_type_encoder_f PER_Visible_2_encode_der;
1649 xer_type_decoder_f PER_Visible_2_decode_xer;
1650 xer_type_encoder_f PER_Visible_2_encode_xer;
1651
1652 /*** <<< CTABLES [PER-Visible-2] >>> ***/
1653
1654 static int check_permitted_alphabet_1(const void *sptr) {
1655 /* The underlying type is IA5String */
1656 const IA5String_t *st = (const IA5String_t *)sptr;
1657 const uint8_t *ch = st->buf;
1658 const uint8_t *end = ch + st->size;
1659
1660 for(; ch < end; ch++) {
1661 uint8_t cv = *ch;
1662 if(!(cv >= 69 && cv <= 70)) return -1;
1663 }
1664 return 0;
1665 }
1666
1667
1668 /*** <<< CODE [PER-Visible-2] >>> ***/
1669
1670 int
1671 PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
1672 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1673 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1674
1675 if(!sptr) {
1676 ASN__CTFAIL(app_key, td, sptr,
1677 "%s: value not given (%s:%d)",
1678 td->name, __FILE__, __LINE__);
1679 return -1;
1680 }
1681
1682
1683 if(!check_permitted_alphabet_1(st)) {
1684 /* Constraint check succeeded */
1685 return 0;
1686 } else {
1687 ASN__CTFAIL(app_key, td, sptr,
1688 "%s: constraint failed (%s:%d)",
1689 td->name, __FILE__, __LINE__);
1690 return -1;
1691 }
1692 }
1693
1694 /*
1695 * This type is implemented using PER_Visible,
1696 * so here we adjust the DEF accordingly.
1697 */
1698 static void
1699 PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1700 td->free_struct = asn_DEF_PER_Visible.free_struct;
1701 td->print_struct = asn_DEF_PER_Visible.print_struct;
1702 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
1703 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1704 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1705 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1706 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1707 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
1708 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
1709 if(!td->per_constraints)
1710 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
1711 td->elements = asn_DEF_PER_Visible.elements;
1712 td->elements_count = asn_DEF_PER_Visible.elements_count;
1713 td->specifics = asn_DEF_PER_Visible.specifics;
1714 }
1715
1716 void
1717 PER_Visible_2_free(asn_TYPE_descriptor_t *td,
1718 void *struct_ptr, int contents_only) {
1719 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1720 td->free_struct(td, struct_ptr, contents_only);
1721 }
1722
1723 int
1724 PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1725 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1726 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1727 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1728 }
1729
1730 asn_dec_rval_t
1731 PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1732 void **structure, const void *bufptr, size_t size, int tag_mode) {
1733 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1734 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1735 }
1736
1737 asn_enc_rval_t
1738 PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
1739 void *structure, int tag_mode, ber_tlv_tag_t tag,
1740 asn_app_consume_bytes_f *cb, void *app_key) {
1741 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1742 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1743 }
1744
1745 asn_dec_rval_t
1746 PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1747 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1748 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1749 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1750 }
1751
1752 asn_enc_rval_t
1753 PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1754 int ilevel, enum xer_encoder_flags_e flags,
1755 asn_app_consume_bytes_f *cb, void *app_key) {
1756 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1757 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1758 }
1759
1760
1761 /*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
1762
1763 static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
1764 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1765 };
1766 asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
1767 "PER-Visible-2",
1768 "PER-Visible-2",
1769 PER_Visible_2_free,
1770 PER_Visible_2_print,
1771 PER_Visible_2_constraint,
1772 PER_Visible_2_decode_ber,
1773 PER_Visible_2_encode_der,
1774 PER_Visible_2_decode_xer,
1775 PER_Visible_2_encode_xer,
1776 0, 0, /* No PER support, use "-gen-PER" to enable */
1777 0, /* Use generic outmost tag fetcher */
1778 asn_DEF_PER_Visible_2_tags_1,
1779 sizeof(asn_DEF_PER_Visible_2_tags_1)
1780 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
1781 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
1782 sizeof(asn_DEF_PER_Visible_2_tags_1)
1783 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
1784 0, /* No PER visible constraints */
1785 0, 0, /* No members */
1786 0 /* No specifics */
1787 };
1788
1789
1790 /*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
1791
1792 #include "PER-Visible.h"
1793
1794 /*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
1795
1796 typedef PER_Visible_t Not_PER_Visible_1_t;
1797
1798 /*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
1799
1800 extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
1801 asn_struct_free_f Not_PER_Visible_1_free;
1802 asn_struct_print_f Not_PER_Visible_1_print;
1803 asn_constr_check_f Not_PER_Visible_1_constraint;
1804 ber_type_decoder_f Not_PER_Visible_1_decode_ber;
1805 der_type_encoder_f Not_PER_Visible_1_encode_der;
1806 xer_type_decoder_f Not_PER_Visible_1_decode_xer;
1807 xer_type_encoder_f Not_PER_Visible_1_encode_xer;
1808
1809 /*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
1810
1811 static int check_permitted_alphabet_1(const void *sptr) {
1812 /* The underlying type is IA5String */
1813 const IA5String_t *st = (const IA5String_t *)sptr;
1814 const uint8_t *ch = st->buf;
1815 const uint8_t *end = ch + st->size;
1816
1817 for(; ch < end; ch++) {
1818 uint8_t cv = *ch;
1819 if(!(cv >= 65 && cv <= 70)) return -1;
1820 }
1821 return 0;
1822 }
1823
1824
1825 /*** <<< CODE [Not-PER-Visible-1] >>> ***/
1826
1827 int
1828 Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
1829 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1830 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1831
1832 if(!sptr) {
1833 ASN__CTFAIL(app_key, td, sptr,
1834 "%s: value not given (%s:%d)",
1835 td->name, __FILE__, __LINE__);
1836 return -1;
1837 }
1838
1839
1840 if(!check_permitted_alphabet_1(st)) {
1841 /* Constraint check succeeded */
1842 return 0;
1843 } else {
1844 ASN__CTFAIL(app_key, td, sptr,
1845 "%s: constraint failed (%s:%d)",
1846 td->name, __FILE__, __LINE__);
1847 return -1;
1848 }
1849 }
1850
1851 /*
1852 * This type is implemented using PER_Visible,
1853 * so here we adjust the DEF accordingly.
1854 */
1855 static void
1856 Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1857 td->free_struct = asn_DEF_PER_Visible.free_struct;
1858 td->print_struct = asn_DEF_PER_Visible.print_struct;
1859 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
1860 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1861 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1862 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1863 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1864 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
1865 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
1866 if(!td->per_constraints)
1867 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
1868 td->elements = asn_DEF_PER_Visible.elements;
1869 td->elements_count = asn_DEF_PER_Visible.elements_count;
1870 td->specifics = asn_DEF_PER_Visible.specifics;
1871 }
1872
1873 void
1874 Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
1875 void *struct_ptr, int contents_only) {
1876 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
1877 td->free_struct(td, struct_ptr, contents_only);
1878 }
1879
1880 int
1881 Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1882 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1883 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
1884 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1885 }
1886
1887 asn_dec_rval_t
1888 Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1889 void **structure, const void *bufptr, size_t size, int tag_mode) {
1890 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
1891 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1892 }
1893
1894 asn_enc_rval_t
1895 Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
1896 void *structure, int tag_mode, ber_tlv_tag_t tag,
1897 asn_app_consume_bytes_f *cb, void *app_key) {
1898 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
1899 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1900 }
1901
1902 asn_dec_rval_t
1903 Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1904 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1905 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
1906 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1907 }
1908
1909 asn_enc_rval_t
1910 Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1911 int ilevel, enum xer_encoder_flags_e flags,
1912 asn_app_consume_bytes_f *cb, void *app_key) {
1913 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
1914 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1915 }
1916
1917
1918 /*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
1919
1920 static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
1921 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1922 };
1923 asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
1924 "Not-PER-Visible-1",
1925 "Not-PER-Visible-1",
1926 Not_PER_Visible_1_free,
1927 Not_PER_Visible_1_print,
1928 Not_PER_Visible_1_constraint,
1929 Not_PER_Visible_1_decode_ber,
1930 Not_PER_Visible_1_encode_der,
1931 Not_PER_Visible_1_decode_xer,
1932 Not_PER_Visible_1_encode_xer,
1933 0, 0, /* No PER support, use "-gen-PER" to enable */
1934 0, /* Use generic outmost tag fetcher */
1935 asn_DEF_Not_PER_Visible_1_tags_1,
1936 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1937 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
1938 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
1939 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1940 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
1941 0, /* No PER visible constraints */
1942 0, 0, /* No members */
1943 0 /* No specifics */
1944 };
1945
1946
1947 /*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
1948
1949 #include "PER-Visible.h"
1950
1951 /*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
1952
1953 typedef PER_Visible_t Not_PER_Visible_2_t;
1954
1955 /*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
1956
1957 extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
1958 asn_struct_free_f Not_PER_Visible_2_free;
1959 asn_struct_print_f Not_PER_Visible_2_print;
1960 asn_constr_check_f Not_PER_Visible_2_constraint;
1961 ber_type_decoder_f Not_PER_Visible_2_decode_ber;
1962 der_type_encoder_f Not_PER_Visible_2_encode_der;
1963 xer_type_decoder_f Not_PER_Visible_2_decode_xer;
1964 xer_type_encoder_f Not_PER_Visible_2_encode_xer;
1965
1966 /*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
1967
1968 static int check_permitted_alphabet_1(const void *sptr) {
1969 /* The underlying type is IA5String */
1970 const IA5String_t *st = (const IA5String_t *)sptr;
1971 const uint8_t *ch = st->buf;
1972 const uint8_t *end = ch + st->size;
1973
1974 for(; ch < end; ch++) {
1975 uint8_t cv = *ch;
1976 if(!(cv >= 65 && cv <= 66)) return -1;
1977 }
1978 return 0;
1979 }
1980
1981
1982 /*** <<< CODE [Not-PER-Visible-2] >>> ***/
1983
1984 int
1985 Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
1986 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1987 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1988
1989 if(!sptr) {
1990 ASN__CTFAIL(app_key, td, sptr,
1991 "%s: value not given (%s:%d)",
1992 td->name, __FILE__, __LINE__);
1993 return -1;
1994 }
1995
1996
1997 if(!check_permitted_alphabet_1(st)) {
1998 /* Constraint check succeeded */
1999 return 0;
2000 } else {
2001 ASN__CTFAIL(app_key, td, sptr,
2002 "%s: constraint failed (%s:%d)",
2003 td->name, __FILE__, __LINE__);
2004 return -1;
2005 }
2006 }
2007
2008 /*
2009 * This type is implemented using PER_Visible,
2010 * so here we adjust the DEF accordingly.
2011 */
2012 static void
2013 Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2014 td->free_struct = asn_DEF_PER_Visible.free_struct;
2015 td->print_struct = asn_DEF_PER_Visible.print_struct;
2016 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
2017 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2018 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2019 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2020 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2021 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
2022 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
2023 if(!td->per_constraints)
2024 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2025 td->elements = asn_DEF_PER_Visible.elements;
2026 td->elements_count = asn_DEF_PER_Visible.elements_count;
2027 td->specifics = asn_DEF_PER_Visible.specifics;
2028 }
2029
2030 void
2031 Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2032 void *struct_ptr, int contents_only) {
2033 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2034 td->free_struct(td, struct_ptr, contents_only);
2035 }
2036
2037 int
2038 Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2039 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2040 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2041 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2042 }
2043
2044 asn_dec_rval_t
2045 Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2046 void **structure, const void *bufptr, size_t size, int tag_mode) {
2047 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2048 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2049 }
2050
2051 asn_enc_rval_t
2052 Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2053 void *structure, int tag_mode, ber_tlv_tag_t tag,
2054 asn_app_consume_bytes_f *cb, void *app_key) {
2055 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2056 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2057 }
2058
2059 asn_dec_rval_t
2060 Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2061 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2062 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2063 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2064 }
2065
2066 asn_enc_rval_t
2067 Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2068 int ilevel, enum xer_encoder_flags_e flags,
2069 asn_app_consume_bytes_f *cb, void *app_key) {
2070 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2071 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2072 }
2073
2074
2075 /*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
2076
2077 static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
2078 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2079 };
2080 asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
2081 "Not-PER-Visible-2",
2082 "Not-PER-Visible-2",
2083 Not_PER_Visible_2_free,
2084 Not_PER_Visible_2_print,
2085 Not_PER_Visible_2_constraint,
2086 Not_PER_Visible_2_decode_ber,
2087 Not_PER_Visible_2_encode_der,
2088 Not_PER_Visible_2_decode_xer,
2089 Not_PER_Visible_2_encode_xer,
2090 0, 0, /* No PER support, use "-gen-PER" to enable */
2091 0, /* Use generic outmost tag fetcher */
2092 asn_DEF_Not_PER_Visible_2_tags_1,
2093 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2094 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2095 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
2096 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2097 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2098 0, /* No PER visible constraints */
2099 0, 0, /* No members */
2100 0 /* No specifics */
2101 };
2102
2103
2104 /*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2105
2106 #include "PER-Visible.h"
2107
2108 /*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2109
2110 typedef PER_Visible_t Not_PER_Visible_3_t;
2111
2112 /*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2113
2114 extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
2115 asn_struct_free_f Not_PER_Visible_3_free;
2116 asn_struct_print_f Not_PER_Visible_3_print;
2117 asn_constr_check_f Not_PER_Visible_3_constraint;
2118 ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2119 der_type_encoder_f Not_PER_Visible_3_encode_der;
2120 xer_type_decoder_f Not_PER_Visible_3_decode_xer;
2121 xer_type_encoder_f Not_PER_Visible_3_encode_xer;
2122
2123 /*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2124
2125 static int check_permitted_alphabet_1(const void *sptr) {
2126 /* The underlying type is IA5String */
2127 const IA5String_t *st = (const IA5String_t *)sptr;
2128 const uint8_t *ch = st->buf;
2129 const uint8_t *end = ch + st->size;
2130
2131 for(; ch < end; ch++) {
2132 uint8_t cv = *ch;
2133 if(!(cv >= 65 && cv <= 66)) return -1;
2134 }
2135 return 0;
2136 }
2137
2138
2139 /*** <<< CODE [Not-PER-Visible-3] >>> ***/
2140
2141 int
2142 Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
2143 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2144 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2145
2146 if(!sptr) {
2147 ASN__CTFAIL(app_key, td, sptr,
2148 "%s: value not given (%s:%d)",
2149 td->name, __FILE__, __LINE__);
2150 return -1;
2151 }
2152
2153
2154 if(!check_permitted_alphabet_1(st)) {
2155 /* Constraint check succeeded */
2156 return 0;
2157 } else {
2158 ASN__CTFAIL(app_key, td, sptr,
2159 "%s: constraint failed (%s:%d)",
2160 td->name, __FILE__, __LINE__);
2161 return -1;
2162 }
2163 }
2164
2165 /*
2166 * This type is implemented using PER_Visible,
2167 * so here we adjust the DEF accordingly.
2168 */
2169 static void
2170 Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2171 td->free_struct = asn_DEF_PER_Visible.free_struct;
2172 td->print_struct = asn_DEF_PER_Visible.print_struct;
2173 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
2174 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2175 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2176 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2177 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2178 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
2179 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
2180 if(!td->per_constraints)
2181 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2182 td->elements = asn_DEF_PER_Visible.elements;
2183 td->elements_count = asn_DEF_PER_Visible.elements_count;
2184 td->specifics = asn_DEF_PER_Visible.specifics;
2185 }
2186
2187 void
2188 Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
2189 void *struct_ptr, int contents_only) {
2190 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2191 td->free_struct(td, struct_ptr, contents_only);
2192 }
2193
2194 int
2195 Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2196 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2197 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2198 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2199 }
2200
2201 asn_dec_rval_t
2202 Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2203 void **structure, const void *bufptr, size_t size, int tag_mode) {
2204 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2205 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2206 }
2207
2208 asn_enc_rval_t
2209 Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
2210 void *structure, int tag_mode, ber_tlv_tag_t tag,
2211 asn_app_consume_bytes_f *cb, void *app_key) {
2212 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2213 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2214 }
2215
2216 asn_dec_rval_t
2217 Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2218 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2219 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2220 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2221 }
2222
2223 asn_enc_rval_t
2224 Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2225 int ilevel, enum xer_encoder_flags_e flags,
2226 asn_app_consume_bytes_f *cb, void *app_key) {
2227 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2228 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2229 }
2230
2231
2232 /*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2233
2234 static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
2235 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2236 };
2237 asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
2238 "Not-PER-Visible-3",
2239 "Not-PER-Visible-3",
2240 Not_PER_Visible_3_free,
2241 Not_PER_Visible_3_print,
2242 Not_PER_Visible_3_constraint,
2243 Not_PER_Visible_3_decode_ber,
2244 Not_PER_Visible_3_encode_der,
2245 Not_PER_Visible_3_decode_xer,
2246 Not_PER_Visible_3_encode_xer,
2247 0, 0, /* No PER support, use "-gen-PER" to enable */
2248 0, /* Use generic outmost tag fetcher */
2249 asn_DEF_Not_PER_Visible_3_tags_1,
2250 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2251 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2252 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
2253 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2254 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2255 0, /* No PER visible constraints */
2256 0, 0, /* No members */
2257 0 /* No specifics */
2258 };
2259
2260
2261 /*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2262
2263 #include "PER-Visible.h"
2264
2265 /*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2266
2267 typedef PER_Visible_t SIZE_but_not_FROM_t;
2268
2269 /*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2270
2271 extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
2272 asn_struct_free_f SIZE_but_not_FROM_free;
2273 asn_struct_print_f SIZE_but_not_FROM_print;
2274 asn_constr_check_f SIZE_but_not_FROM_constraint;
2275 ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2276 der_type_encoder_f SIZE_but_not_FROM_encode_der;
2277 xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
2278 xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
2279
2280 /*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2281
2282 static int check_permitted_alphabet_1(const void *sptr) {
2283 /* The underlying type is IA5String */
2284 const IA5String_t *st = (const IA5String_t *)sptr;
2285 const uint8_t *ch = st->buf;
2286 const uint8_t *end = ch + st->size;
2287
2288 for(; ch < end; ch++) {
2289 uint8_t cv = *ch;
2290 if(!(cv >= 65 && cv <= 68)) return -1;
2291 }
2292 return 0;
2293 }
2294
2295
2296 /*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2297
2298 int
2299 SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
2300 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2301 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2302 size_t size;
2303
2304 if(!sptr) {
2305 ASN__CTFAIL(app_key, td, sptr,
2306 "%s: value not given (%s:%d)",
2307 td->name, __FILE__, __LINE__);
2308 return -1;
2309 }
2310
2311 size = st->size;
2312
2313 if((size >= 1 && size <= 4)
2314 && !check_permitted_alphabet_1(st)) {
2315 /* Constraint check succeeded */
2316 return 0;
2317 } else {
2318 ASN__CTFAIL(app_key, td, sptr,
2319 "%s: constraint failed (%s:%d)",
2320 td->name, __FILE__, __LINE__);
2321 return -1;
2322 }
2323 }
2324
2325 /*
2326 * This type is implemented using PER_Visible,
2327 * so here we adjust the DEF accordingly.
2328 */
2329 static void
2330 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2331 td->free_struct = asn_DEF_PER_Visible.free_struct;
2332 td->print_struct = asn_DEF_PER_Visible.print_struct;
2333 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
2334 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2335 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2336 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2337 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2338 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
2339 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
2340 if(!td->per_constraints)
2341 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2342 td->elements = asn_DEF_PER_Visible.elements;
2343 td->elements_count = asn_DEF_PER_Visible.elements_count;
2344 td->specifics = asn_DEF_PER_Visible.specifics;
2345 }
2346
2347 void
2348 SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
2349 void *struct_ptr, int contents_only) {
2350 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2351 td->free_struct(td, struct_ptr, contents_only);
2352 }
2353
2354 int
2355 SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2356 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2357 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2358 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2359 }
2360
2361 asn_dec_rval_t
2362 SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2363 void **structure, const void *bufptr, size_t size, int tag_mode) {
2364 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2365 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2366 }
2367
2368 asn_enc_rval_t
2369 SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
2370 void *structure, int tag_mode, ber_tlv_tag_t tag,
2371 asn_app_consume_bytes_f *cb, void *app_key) {
2372 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2373 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2374 }
2375
2376 asn_dec_rval_t
2377 SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2378 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2379 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2380 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2381 }
2382
2383 asn_enc_rval_t
2384 SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2385 int ilevel, enum xer_encoder_flags_e flags,
2386 asn_app_consume_bytes_f *cb, void *app_key) {
2387 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2388 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2389 }
2390
2391
2392 /*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2393
2394 static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
2395 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2396 };
2397 asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
2398 "SIZE-but-not-FROM",
2399 "SIZE-but-not-FROM",
2400 SIZE_but_not_FROM_free,
2401 SIZE_but_not_FROM_print,
2402 SIZE_but_not_FROM_constraint,
2403 SIZE_but_not_FROM_decode_ber,
2404 SIZE_but_not_FROM_encode_der,
2405 SIZE_but_not_FROM_decode_xer,
2406 SIZE_but_not_FROM_encode_xer,
2407 0, 0, /* No PER support, use "-gen-PER" to enable */
2408 0, /* Use generic outmost tag fetcher */
2409 asn_DEF_SIZE_but_not_FROM_tags_1,
2410 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2411 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2412 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
2413 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2414 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2415 0, /* No PER visible constraints */
2416 0, 0, /* No members */
2417 0 /* No specifics */
2418 };
2419
2420
2421 /*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2422
2423 #include "PER-Visible.h"
2424
2425 /*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2426
2427 typedef PER_Visible_t SIZE_and_FROM_t;
2428
2429 /*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2430
2431 extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
2432 asn_struct_free_f SIZE_and_FROM_free;
2433 asn_struct_print_f SIZE_and_FROM_print;
2434 asn_constr_check_f SIZE_and_FROM_constraint;
2435 ber_type_decoder_f SIZE_and_FROM_decode_ber;
2436 der_type_encoder_f SIZE_and_FROM_encode_der;
2437 xer_type_decoder_f SIZE_and_FROM_decode_xer;
2438 xer_type_encoder_f SIZE_and_FROM_encode_xer;
2439
2440 /*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2441
2442 static int check_permitted_alphabet_1(const void *sptr) {
2443 /* The underlying type is IA5String */
2444 const IA5String_t *st = (const IA5String_t *)sptr;
2445 const uint8_t *ch = st->buf;
2446 const uint8_t *end = ch + st->size;
2447
2448 for(; ch < end; ch++) {
2449 uint8_t cv = *ch;
2450 if(!(cv >= 65 && cv <= 68)) return -1;
2451 }
2452 return 0;
2453 }
2454
2455
2456 /*** <<< CODE [SIZE-and-FROM] >>> ***/
2457
2458 int
2459 SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
2460 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2461 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2462 size_t size;
2463
2464 if(!sptr) {
2465 ASN__CTFAIL(app_key, td, sptr,
2466 "%s: value not given (%s:%d)",
2467 td->name, __FILE__, __LINE__);
2468 return -1;
2469 }
2470
2471 size = st->size;
2472
2473 if((size >= 1 && size <= 4)
2474 && !check_permitted_alphabet_1(st)) {
2475 /* Constraint check succeeded */
2476 return 0;
2477 } else {
2478 ASN__CTFAIL(app_key, td, sptr,
2479 "%s: constraint failed (%s:%d)",
2480 td->name, __FILE__, __LINE__);
2481 return -1;
2482 }
2483 }
2484
2485 /*
2486 * This type is implemented using PER_Visible,
2487 * so here we adjust the DEF accordingly.
2488 */
2489 static void
2490 SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2491 td->free_struct = asn_DEF_PER_Visible.free_struct;
2492 td->print_struct = asn_DEF_PER_Visible.print_struct;
2493 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
2494 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2495 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2496 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2497 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2498 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
2499 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
2500 if(!td->per_constraints)
2501 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2502 td->elements = asn_DEF_PER_Visible.elements;
2503 td->elements_count = asn_DEF_PER_Visible.elements_count;
2504 td->specifics = asn_DEF_PER_Visible.specifics;
2505 }
2506
2507 void
2508 SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
2509 void *struct_ptr, int contents_only) {
2510 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2511 td->free_struct(td, struct_ptr, contents_only);
2512 }
2513
2514 int
2515 SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2516 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2517 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2518 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2519 }
2520
2521 asn_dec_rval_t
2522 SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2523 void **structure, const void *bufptr, size_t size, int tag_mode) {
2524 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2525 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2526 }
2527
2528 asn_enc_rval_t
2529 SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
2530 void *structure, int tag_mode, ber_tlv_tag_t tag,
2531 asn_app_consume_bytes_f *cb, void *app_key) {
2532 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2533 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2534 }
2535
2536 asn_dec_rval_t
2537 SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2538 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2539 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2540 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2541 }
2542
2543 asn_enc_rval_t
2544 SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2545 int ilevel, enum xer_encoder_flags_e flags,
2546 asn_app_consume_bytes_f *cb, void *app_key) {
2547 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2548 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2549 }
2550
2551
2552 /*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
2553
2554 static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
2555 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2556 };
2557 asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
2558 "SIZE-and-FROM",
2559 "SIZE-and-FROM",
2560 SIZE_and_FROM_free,
2561 SIZE_and_FROM_print,
2562 SIZE_and_FROM_constraint,
2563 SIZE_and_FROM_decode_ber,
2564 SIZE_and_FROM_encode_der,
2565 SIZE_and_FROM_decode_xer,
2566 SIZE_and_FROM_encode_xer,
2567 0, 0, /* No PER support, use "-gen-PER" to enable */
2568 0, /* Use generic outmost tag fetcher */
2569 asn_DEF_SIZE_and_FROM_tags_1,
2570 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2571 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2572 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
2573 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2574 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2575 0, /* No PER visible constraints */
2576 0, 0, /* No members */
2577 0 /* No specifics */
2578 };
2579
2580
2581 /*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
2582
2583 #include "PER-Visible.h"
2584
2585 /*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2586
2587 typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
2588
2589 /*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2590
2591 extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
2592 asn_struct_free_f Neither_SIZE_nor_FROM_free;
2593 asn_struct_print_f Neither_SIZE_nor_FROM_print;
2594 asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
2595 ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
2596 der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
2597 xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
2598 xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
2599
2600 /*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
2601
2602 static int check_permitted_alphabet_1(const void *sptr) {
2603 /* The underlying type is IA5String */
2604 const IA5String_t *st = (const IA5String_t *)sptr;
2605 const uint8_t *ch = st->buf;
2606 const uint8_t *end = ch + st->size;
2607
2608 for(; ch < end; ch++) {
2609 uint8_t cv = *ch;
2610 if(!(cv >= 65 && cv <= 70)) return -1;
2611 }
2612 return 0;
2613 }
2614
2615
2616 /*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
2617
2618 int
2619 Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
2620 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2621 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2622
2623 if(!sptr) {
2624 ASN__CTFAIL(app_key, td, sptr,
2625 "%s: value not given (%s:%d)",
2626 td->name, __FILE__, __LINE__);
2627 return -1;
2628 }
2629
2630
2631 if(!check_permitted_alphabet_1(st)) {
2632 /* Constraint check succeeded */
2633 return 0;
2634 } else {
2635 ASN__CTFAIL(app_key, td, sptr,
2636 "%s: constraint failed (%s:%d)",
2637 td->name, __FILE__, __LINE__);
2638 return -1;
2639 }
2640 }
2641
2642 /*
2643 * This type is implemented using PER_Visible,
2644 * so here we adjust the DEF accordingly.
2645 */
2646 static void
2647 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2648 td->free_struct = asn_DEF_PER_Visible.free_struct;
2649 td->print_struct = asn_DEF_PER_Visible.print_struct;
2650 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
2651 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2652 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2653 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2654 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2655 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
2656 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
2657 if(!td->per_constraints)
2658 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2659 td->elements = asn_DEF_PER_Visible.elements;
2660 td->elements_count = asn_DEF_PER_Visible.elements_count;
2661 td->specifics = asn_DEF_PER_Visible.specifics;
2662 }
2663
2664 void
2665 Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
2666 void *struct_ptr, int contents_only) {
2667 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
2668 td->free_struct(td, struct_ptr, contents_only);
2669 }
2670
2671 int
2672 Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2673 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2674 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
2675 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2676 }
2677
2678 asn_dec_rval_t
2679 Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2680 void **structure, const void *bufptr, size_t size, int tag_mode) {
2681 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
2682 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2683 }
2684
2685 asn_enc_rval_t
2686 Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
2687 void *structure, int tag_mode, ber_tlv_tag_t tag,
2688 asn_app_consume_bytes_f *cb, void *app_key) {
2689 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
2690 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2691 }
2692
2693 asn_dec_rval_t
2694 Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2695 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2696 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
2697 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2698 }
2699
2700 asn_enc_rval_t
2701 Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2702 int ilevel, enum xer_encoder_flags_e flags,
2703 asn_app_consume_bytes_f *cb, void *app_key) {
2704 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
2705 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2706 }
2707
2708
2709 /*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
2710
2711 static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
2712 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2713 };
2714 asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
2715 "Neither-SIZE-nor-FROM",
2716 "Neither-SIZE-nor-FROM",
2717 Neither_SIZE_nor_FROM_free,
2718 Neither_SIZE_nor_FROM_print,
2719 Neither_SIZE_nor_FROM_constraint,
2720 Neither_SIZE_nor_FROM_decode_ber,
2721 Neither_SIZE_nor_FROM_encode_der,
2722 Neither_SIZE_nor_FROM_decode_xer,
2723 Neither_SIZE_nor_FROM_encode_xer,
2724 0, 0, /* No PER support, use "-gen-PER" to enable */
2725 0, /* Use generic outmost tag fetcher */
2726 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
2727 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
2728 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
2729 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
2730 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
2731 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
2732 0, /* No PER visible constraints */
2733 0, 0, /* No members */
2734 0 /* No specifics */
2735 };
2736
2737
2738 /*** <<< INCLUDES [Utf8-4] >>> ***/
2739
2740 #include <UTF8String.h>
2741
2742 /*** <<< TYPE-DECLS [Utf8-4] >>> ***/
2743
2744 typedef UTF8String_t Utf8_4_t;
2745
2746 /*** <<< FUNC-DECLS [Utf8-4] >>> ***/
2747
2748 extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
2749 asn_struct_free_f Utf8_4_free;
2750 asn_struct_print_f Utf8_4_print;
2751 asn_constr_check_f Utf8_4_constraint;
2752 ber_type_decoder_f Utf8_4_decode_ber;
2753 der_type_encoder_f Utf8_4_encode_der;
2754 xer_type_decoder_f Utf8_4_decode_xer;
2755 xer_type_encoder_f Utf8_4_encode_xer;
2756
2757 /*** <<< CTABLES [Utf8-4] >>> ***/
2758
2759 static int check_permitted_alphabet_1(const void *sptr) {
2760 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
2761 return -1; /* Alphabet (sic!) test failed. */
2762
2763 return 0;
2764 }
2765
2766
2767 /*** <<< CODE [Utf8-4] >>> ***/
2768
2769 int
2770 Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
2771 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2772 const UTF8String_t *st = (const UTF8String_t *)sptr;
2773
2774 if(!sptr) {
2775 ASN__CTFAIL(app_key, td, sptr,
2776 "%s: value not given (%s:%d)",
2777 td->name, __FILE__, __LINE__);
2778 return -1;
2779 }
2780
2781
2782 if(!check_permitted_alphabet_1(st)) {
2783 /* Constraint check succeeded */
2784 return 0;
2785 } else {
2786 ASN__CTFAIL(app_key, td, sptr,
2787 "%s: constraint failed (%s:%d)",
2788 td->name, __FILE__, __LINE__);
2789 return -1;
2790 }
2791 }
2792
2793 /*
2794 * This type is implemented using UTF8String,
2795 * so here we adjust the DEF accordingly.
2796 */
2797 static void
2798 Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2799 td->free_struct = asn_DEF_UTF8String.free_struct;
2800 td->print_struct = asn_DEF_UTF8String.print_struct;
2801 td->check_constraints = asn_DEF_UTF8String.check_constraints;
2802 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
2803 td->der_encoder = asn_DEF_UTF8String.der_encoder;
2804 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
2805 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
2806 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
2807 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
2808 if(!td->per_constraints)
2809 td->per_constraints = asn_DEF_UTF8String.per_constraints;
2810 td->elements = asn_DEF_UTF8String.elements;
2811 td->elements_count = asn_DEF_UTF8String.elements_count;
2812 td->specifics = asn_DEF_UTF8String.specifics;
2813 }
2814
2815 void
2816 Utf8_4_free(asn_TYPE_descriptor_t *td,
2817 void *struct_ptr, int contents_only) {
2818 Utf8_4_1_inherit_TYPE_descriptor(td);
2819 td->free_struct(td, struct_ptr, contents_only);
2820 }
2821
2822 int
2823 Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2824 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2825 Utf8_4_1_inherit_TYPE_descriptor(td);
2826 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2827 }
2828
2829 asn_dec_rval_t
2830 Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2831 void **structure, const void *bufptr, size_t size, int tag_mode) {
2832 Utf8_4_1_inherit_TYPE_descriptor(td);
2833 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2834 }
2835
2836 asn_enc_rval_t
2837 Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
2838 void *structure, int tag_mode, ber_tlv_tag_t tag,
2839 asn_app_consume_bytes_f *cb, void *app_key) {
2840 Utf8_4_1_inherit_TYPE_descriptor(td);
2841 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2842 }
2843
2844 asn_dec_rval_t
2845 Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2846 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2847 Utf8_4_1_inherit_TYPE_descriptor(td);
2848 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2849 }
2850
2851 asn_enc_rval_t
2852 Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2853 int ilevel, enum xer_encoder_flags_e flags,
2854 asn_app_consume_bytes_f *cb, void *app_key) {
2855 Utf8_4_1_inherit_TYPE_descriptor(td);
2856 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2857 }
2858
2859
2860 /*** <<< STAT-DEFS [Utf8-4] >>> ***/
2861
2862 static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
2863 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2864 };
2865 asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
2866 "Utf8-4",
2867 "Utf8-4",
2868 Utf8_4_free,
2869 Utf8_4_print,
2870 Utf8_4_constraint,
2871 Utf8_4_decode_ber,
2872 Utf8_4_encode_der,
2873 Utf8_4_decode_xer,
2874 Utf8_4_encode_xer,
2875 0, 0, /* No PER support, use "-gen-PER" to enable */
2876 0, /* Use generic outmost tag fetcher */
2877 asn_DEF_Utf8_4_tags_1,
2878 sizeof(asn_DEF_Utf8_4_tags_1)
2879 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
2880 asn_DEF_Utf8_4_tags_1, /* Same as above */
2881 sizeof(asn_DEF_Utf8_4_tags_1)
2882 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
2883 0, /* No PER visible constraints */
2884 0, 0, /* No members */
2885 0 /* No specifics */
2886 };
2887
2888
2889 /*** <<< INCLUDES [Utf8-3] >>> ***/
2890
2891 #include "Utf8-2.h"
2892
2893 /*** <<< TYPE-DECLS [Utf8-3] >>> ***/
2894
2895 typedef Utf8_2_t Utf8_3_t;
2896
2897 /*** <<< FUNC-DECLS [Utf8-3] >>> ***/
2898
2899 extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
2900 asn_struct_free_f Utf8_3_free;
2901 asn_struct_print_f Utf8_3_print;
2902 asn_constr_check_f Utf8_3_constraint;
2903 ber_type_decoder_f Utf8_3_decode_ber;
2904 der_type_encoder_f Utf8_3_encode_der;
2905 xer_type_decoder_f Utf8_3_decode_xer;
2906 xer_type_encoder_f Utf8_3_encode_xer;
2907
2908 /*** <<< CTABLES [Utf8-3] >>> ***/
2909
2910 static const int permitted_alphabet_table_1[128] = {
2911 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2912 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2913 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2914 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2915 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
2916 16,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
2917 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
2918 42,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
2919 };
2920
2921 static int check_permitted_alphabet_1(const void *sptr) {
2922 const int *table = permitted_alphabet_table_1;
2923 /* The underlying type is UTF8String */
2924 const UTF8String_t *st = (const UTF8String_t *)sptr;
2925 const uint8_t *ch = st->buf;
2926 const uint8_t *end = ch + st->size;
2927
2928 for(; ch < end; ch++) {
2929 uint8_t cv = *ch;
2930 if(cv >= 0x80) return -1;
2931 if(!table[cv]) return -1;
2932 }
2933 return 0;
2934 }
2935
2936
2937 /*** <<< CODE [Utf8-3] >>> ***/
2938
2939 int
2940 Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
2941 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2942 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
2943 size_t size;
2944
2945 if(!sptr) {
2946 ASN__CTFAIL(app_key, td, sptr,
2947 "%s: value not given (%s:%d)",
2948 td->name, __FILE__, __LINE__);
2949 return -1;
2950 }
2951
2952 size = UTF8String_length(st);
2953 if((ssize_t)size < 0) {
2954 ASN__CTFAIL(app_key, td, sptr,
2955 "%s: UTF-8: broken encoding (%s:%d)",
2956 td->name, __FILE__, __LINE__);
2957 return -1;
2958 }
2959
2960 if((size >= 1 && size <= 2)
2961 && !check_permitted_alphabet_1(st)) {
2962 /* Constraint check succeeded */
2963 return 0;
2964 } else {
2965 ASN__CTFAIL(app_key, td, sptr,
2966 "%s: constraint failed (%s:%d)",
2967 td->name, __FILE__, __LINE__);
2968 return -1;
2969 }
2970 }
2971
2972 /*
2973 * This type is implemented using Utf8_2,
2974 * so here we adjust the DEF accordingly.
2975 */
2976 static void
2977 Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2978 td->free_struct = asn_DEF_Utf8_2.free_struct;
2979 td->print_struct = asn_DEF_Utf8_2.print_struct;
2980 td->check_constraints = asn_DEF_Utf8_2.check_constraints;
2981 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
2982 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
2983 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
2984 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
2985 td->uper_decoder = asn_DEF_Utf8_2.uper_decoder;
2986 td->uper_encoder = asn_DEF_Utf8_2.uper_encoder;
2987 if(!td->per_constraints)
2988 td->per_constraints = asn_DEF_Utf8_2.per_constraints;
2989 td->elements = asn_DEF_Utf8_2.elements;
2990 td->elements_count = asn_DEF_Utf8_2.elements_count;
2991 td->specifics = asn_DEF_Utf8_2.specifics;
2992 }
2993
2994 void
2995 Utf8_3_free(asn_TYPE_descriptor_t *td,
2996 void *struct_ptr, int contents_only) {
2997 Utf8_3_1_inherit_TYPE_descriptor(td);
2998 td->free_struct(td, struct_ptr, contents_only);
2999 }
3000
3001 int
3002 Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3003 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3004 Utf8_3_1_inherit_TYPE_descriptor(td);
3005 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3006 }
3007
3008 asn_dec_rval_t
3009 Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3010 void **structure, const void *bufptr, size_t size, int tag_mode) {
3011 Utf8_3_1_inherit_TYPE_descriptor(td);
3012 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3013 }
3014
3015 asn_enc_rval_t
3016 Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
3017 void *structure, int tag_mode, ber_tlv_tag_t tag,
3018 asn_app_consume_bytes_f *cb, void *app_key) {
3019 Utf8_3_1_inherit_TYPE_descriptor(td);
3020 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3021 }
3022
3023 asn_dec_rval_t
3024 Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3025 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3026 Utf8_3_1_inherit_TYPE_descriptor(td);
3027 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3028 }
3029
3030 asn_enc_rval_t
3031 Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3032 int ilevel, enum xer_encoder_flags_e flags,
3033 asn_app_consume_bytes_f *cb, void *app_key) {
3034 Utf8_3_1_inherit_TYPE_descriptor(td);
3035 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3036 }
3037
3038
3039 /*** <<< STAT-DEFS [Utf8-3] >>> ***/
3040
3041 static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
3042 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3043 };
3044 asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
3045 "Utf8-3",
3046 "Utf8-3",
3047 Utf8_3_free,
3048 Utf8_3_print,
3049 Utf8_3_constraint,
3050 Utf8_3_decode_ber,
3051 Utf8_3_encode_der,
3052 Utf8_3_decode_xer,
3053 Utf8_3_encode_xer,
3054 0, 0, /* No PER support, use "-gen-PER" to enable */
3055 0, /* Use generic outmost tag fetcher */
3056 asn_DEF_Utf8_3_tags_1,
3057 sizeof(asn_DEF_Utf8_3_tags_1)
3058 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3059 asn_DEF_Utf8_3_tags_1, /* Same as above */
3060 sizeof(asn_DEF_Utf8_3_tags_1)
3061 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3062 0, /* No PER visible constraints */
3063 0, 0, /* No members */
3064 0 /* No specifics */
3065 };
3066
3067
3068 /*** <<< INCLUDES [Utf8-2] >>> ***/
3069
3070 #include "Utf8-1.h"
3071
3072 /*** <<< TYPE-DECLS [Utf8-2] >>> ***/
3073
3074 typedef Utf8_1_t Utf8_2_t;
3075
3076 /*** <<< FUNC-DECLS [Utf8-2] >>> ***/
3077
3078 extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
3079 asn_struct_free_f Utf8_2_free;
3080 asn_struct_print_f Utf8_2_print;
3081 asn_constr_check_f Utf8_2_constraint;
3082 ber_type_decoder_f Utf8_2_decode_ber;
3083 der_type_encoder_f Utf8_2_encode_der;
3084 xer_type_decoder_f Utf8_2_decode_xer;
3085 xer_type_encoder_f Utf8_2_encode_xer;
3086
3087 /*** <<< CODE [Utf8-2] >>> ***/
3088
3089 int
3090 Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
3091 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
3092 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
3093 size_t size;
3094
3095 if(!sptr) {
3096 ASN__CTFAIL(app_key, td, sptr,
3097 "%s: value not given (%s:%d)",
3098 td->name, __FILE__, __LINE__);
3099 return -1;
3100 }
3101
3102 size = UTF8String_length(st);
3103 if((ssize_t)size < 0) {
3104 ASN__CTFAIL(app_key, td, sptr,
3105 "%s: UTF-8: broken encoding (%s:%d)",
3106 td->name, __FILE__, __LINE__);
3107 return -1;
3108 }
3109
3110 if((size >= 1 && size <= 2)) {
3111 /* Constraint check succeeded */
3112 return 0;
3113 } else {
3114 ASN__CTFAIL(app_key, td, sptr,
3115 "%s: constraint failed (%s:%d)",
3116 td->name, __FILE__, __LINE__);
3117 return -1;
3118 }
3119 }
3120
3121 /*
3122 * This type is implemented using Utf8_1,
3123 * so here we adjust the DEF accordingly.
3124 */
3125 static void
3126 Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3127 td->free_struct = asn_DEF_Utf8_1.free_struct;
3128 td->print_struct = asn_DEF_Utf8_1.print_struct;
3129 td->check_constraints = asn_DEF_Utf8_1.check_constraints;
3130 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
3131 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
3132 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
3133 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
3134 td->uper_decoder = asn_DEF_Utf8_1.uper_decoder;
3135 td->uper_encoder = asn_DEF_Utf8_1.uper_encoder;
3136 if(!td->per_constraints)
3137 td->per_constraints = asn_DEF_Utf8_1.per_constraints;
3138 td->elements = asn_DEF_Utf8_1.elements;
3139 td->elements_count = asn_DEF_Utf8_1.elements_count;
3140 td->specifics = asn_DEF_Utf8_1.specifics;
3141 }
3142
3143 void
3144 Utf8_2_free(asn_TYPE_descriptor_t *td,
3145 void *struct_ptr, int contents_only) {
3146 Utf8_2_1_inherit_TYPE_descriptor(td);
3147 td->free_struct(td, struct_ptr, contents_only);
3148 }
3149
3150 int
3151 Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3152 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3153 Utf8_2_1_inherit_TYPE_descriptor(td);
3154 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3155 }
3156
3157 asn_dec_rval_t
3158 Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3159 void **structure, const void *bufptr, size_t size, int tag_mode) {
3160 Utf8_2_1_inherit_TYPE_descriptor(td);
3161 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3162 }
3163
3164 asn_enc_rval_t
3165 Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
3166 void *structure, int tag_mode, ber_tlv_tag_t tag,
3167 asn_app_consume_bytes_f *cb, void *app_key) {
3168 Utf8_2_1_inherit_TYPE_descriptor(td);
3169 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3170 }
3171
3172 asn_dec_rval_t
3173 Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3174 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3175 Utf8_2_1_inherit_TYPE_descriptor(td);
3176 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3177 }
3178
3179 asn_enc_rval_t
3180 Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3181 int ilevel, enum xer_encoder_flags_e flags,
3182 asn_app_consume_bytes_f *cb, void *app_key) {
3183 Utf8_2_1_inherit_TYPE_descriptor(td);
3184 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3185 }
3186
3187
3188 /*** <<< STAT-DEFS [Utf8-2] >>> ***/
3189
3190 static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
3191 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3192 };
3193 asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
3194 "Utf8-2",
3195 "Utf8-2",
3196 Utf8_2_free,
3197 Utf8_2_print,
3198 Utf8_2_constraint,
3199 Utf8_2_decode_ber,
3200 Utf8_2_encode_der,
3201 Utf8_2_decode_xer,
3202 Utf8_2_encode_xer,
3203 0, 0, /* No PER support, use "-gen-PER" to enable */
3204 0, /* Use generic outmost tag fetcher */
3205 asn_DEF_Utf8_2_tags_1,
3206 sizeof(asn_DEF_Utf8_2_tags_1)
3207 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3208 asn_DEF_Utf8_2_tags_1, /* Same as above */
3209 sizeof(asn_DEF_Utf8_2_tags_1)
3210 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3211 0, /* No PER visible constraints */
3212 0, 0, /* No members */
3213 0 /* No specifics */
3214 };
3215
3216
3217 /*** <<< INCLUDES [Utf8-1] >>> ***/
3218
3219 #include <UTF8String.h>
3220
3221 /*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3222
3223 typedef UTF8String_t Utf8_1_t;
3224
3225 /*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3226
3227 extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3228 asn_struct_free_f Utf8_1_free;
3229 asn_struct_print_f Utf8_1_print;
3230 asn_constr_check_f Utf8_1_constraint;
3231 ber_type_decoder_f Utf8_1_decode_ber;
3232 der_type_encoder_f Utf8_1_encode_der;
3233 xer_type_decoder_f Utf8_1_decode_xer;
3234 xer_type_encoder_f Utf8_1_encode_xer;
3235
3236 /*** <<< CODE [Utf8-1] >>> ***/
3237
3238 int
3239 Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
3240 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
3241 /* Replace with underlying type checker */
3242 td->check_constraints = asn_DEF_UTF8String.check_constraints;
3243 return td->check_constraints(td, sptr, ctfailcb, app_key);
3244 }
3245
3246 /*
3247 * This type is implemented using UTF8String,
3248 * so here we adjust the DEF accordingly.
3249 */
3250 static void
3251 Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3252 td->free_struct = asn_DEF_UTF8String.free_struct;
3253 td->print_struct = asn_DEF_UTF8String.print_struct;
3254 td->check_constraints = asn_DEF_UTF8String.check_constraints;
3255 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3256 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3257 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3258 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3259 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
3260 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
3261 if(!td->per_constraints)
3262 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3263 td->elements = asn_DEF_UTF8String.elements;
3264 td->elements_count = asn_DEF_UTF8String.elements_count;
3265 td->specifics = asn_DEF_UTF8String.specifics;
3266 }
3267
3268 void
3269 Utf8_1_free(asn_TYPE_descriptor_t *td,
3270 void *struct_ptr, int contents_only) {
3271 Utf8_1_1_inherit_TYPE_descriptor(td);
3272 td->free_struct(td, struct_ptr, contents_only);
3273 }
3274
3275 int
3276 Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3277 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3278 Utf8_1_1_inherit_TYPE_descriptor(td);
3279 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3280 }
3281
3282 asn_dec_rval_t
3283 Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3284 void **structure, const void *bufptr, size_t size, int tag_mode) {
3285 Utf8_1_1_inherit_TYPE_descriptor(td);
3286 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3287 }
3288
3289 asn_enc_rval_t
3290 Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3291 void *structure, int tag_mode, ber_tlv_tag_t tag,
3292 asn_app_consume_bytes_f *cb, void *app_key) {
3293 Utf8_1_1_inherit_TYPE_descriptor(td);
3294 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3295 }
3296
3297 asn_dec_rval_t
3298 Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3299 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3300 Utf8_1_1_inherit_TYPE_descriptor(td);
3301 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3302 }
3303
3304 asn_enc_rval_t
3305 Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3306 int ilevel, enum xer_encoder_flags_e flags,
3307 asn_app_consume_bytes_f *cb, void *app_key) {
3308 Utf8_1_1_inherit_TYPE_descriptor(td);
3309 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3310 }
3311
3312
3313 /*** <<< STAT-DEFS [Utf8-1] >>> ***/
3314
3315 static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
3316 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3317 };
3318 asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3319 "Utf8-1",
3320 "Utf8-1",
3321 Utf8_1_free,
3322 Utf8_1_print,
3323 Utf8_1_constraint,
3324 Utf8_1_decode_ber,
3325 Utf8_1_encode_der,
3326 Utf8_1_decode_xer,
3327 Utf8_1_encode_xer,
3328 0, 0, /* No PER support, use "-gen-PER" to enable */
3329 0, /* Use generic outmost tag fetcher */
3330 asn_DEF_Utf8_1_tags_1,
3331 sizeof(asn_DEF_Utf8_1_tags_1)
3332 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3333 asn_DEF_Utf8_1_tags_1, /* Same as above */
3334 sizeof(asn_DEF_Utf8_1_tags_1)
3335 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3336 0, /* No PER visible constraints */
3337 0, 0, /* No members */
3338 0 /* No specifics */
3339 };
3340
3341
3342 /*** <<< INCLUDES [VisibleIdentifier] >>> ***/
3343
3344 #include "Identifier.h"
3345
3346 /*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
3347
3348 typedef Identifier_t VisibleIdentifier_t;
3349
3350 /*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
3351
3352 extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
3353 asn_struct_free_f VisibleIdentifier_free;
3354 asn_struct_print_f VisibleIdentifier_print;
3355 asn_constr_check_f VisibleIdentifier_constraint;
3356 ber_type_decoder_f VisibleIdentifier_decode_ber;
3357 der_type_encoder_f VisibleIdentifier_encode_der;
3358 xer_type_decoder_f VisibleIdentifier_decode_xer;
3359 xer_type_encoder_f VisibleIdentifier_encode_xer;
3360
3361 /*** <<< CTABLES [VisibleIdentifier] >>> ***/
3362
3363 static const int permitted_alphabet_table_1[256] = {
3364 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3365 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3366 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
3367 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
3368 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
3369 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
3370 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
3371 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
3372 };
3373
3374 static int check_permitted_alphabet_1(const void *sptr) {
3375 const int *table = permitted_alphabet_table_1;
3376 /* The underlying type is VisibleString */
3377 const VisibleString_t *st = (const VisibleString_t *)sptr;
3378 const uint8_t *ch = st->buf;
3379 const uint8_t *end = ch + st->size;
3380
3381 for(; ch < end; ch++) {
3382 uint8_t cv = *ch;
3383 if(!table[cv]) return -1;
3384 }
3385 return 0;
3386 }
3387
3388
3389 /*** <<< CODE [VisibleIdentifier] >>> ***/
3390
3391 int
3392 VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
3393 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
3394 const Identifier_t *st = (const Identifier_t *)sptr;
3395 size_t size;
3396
3397 if(!sptr) {
3398 ASN__CTFAIL(app_key, td, sptr,
3399 "%s: value not given (%s:%d)",
3400 td->name, __FILE__, __LINE__);
3401 return -1;
3402 }
3403
3404 size = st->size;
3405
3406 if((size >= 1 && size <= 32)
3407 && !check_permitted_alphabet_1(st)) {
3408 /* Constraint check succeeded */
3409 return 0;
3410 } else {
3411 ASN__CTFAIL(app_key, td, sptr,
3412 "%s: constraint failed (%s:%d)",
3413 td->name, __FILE__, __LINE__);
3414 return -1;
3415 }
3416 }
3417
3418 /*
3419 * This type is implemented using Identifier,
3420 * so here we adjust the DEF accordingly.
3421 */
3422 static void
3423 VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3424 td->free_struct = asn_DEF_Identifier.free_struct;
3425 td->print_struct = asn_DEF_Identifier.print_struct;
3426 td->check_constraints = asn_DEF_Identifier.check_constraints;
3427 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
3428 td->der_encoder = asn_DEF_Identifier.der_encoder;
3429 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
3430 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
3431 td->uper_decoder = asn_DEF_Identifier.uper_decoder;
3432 td->uper_encoder = asn_DEF_Identifier.uper_encoder;
3433 if(!td->per_constraints)
3434 td->per_constraints = asn_DEF_Identifier.per_constraints;
3435 td->elements = asn_DEF_Identifier.elements;
3436 td->elements_count = asn_DEF_Identifier.elements_count;
3437 td->specifics = asn_DEF_Identifier.specifics;
3438 }
3439
3440 void
3441 VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
3442 void *struct_ptr, int contents_only) {
3443 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3444 td->free_struct(td, struct_ptr, contents_only);
3445 }
3446
3447 int
3448 VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3449 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3450 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3451 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3452 }
3453
3454 asn_dec_rval_t
3455 VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3456 void **structure, const void *bufptr, size_t size, int tag_mode) {
3457 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3458 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3459 }
3460
3461 asn_enc_rval_t
3462 VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
3463 void *structure, int tag_mode, ber_tlv_tag_t tag,
3464 asn_app_consume_bytes_f *cb, void *app_key) {
3465 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3466 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3467 }
3468
3469 asn_dec_rval_t
3470 VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3471 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3472 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3473 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3474 }
3475
3476 asn_enc_rval_t
3477 VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3478 int ilevel, enum xer_encoder_flags_e flags,
3479 asn_app_consume_bytes_f *cb, void *app_key) {
3480 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3481 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3482 }
3483
3484
3485 /*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
3486
3487 static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
3488 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
3489 };
3490 asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
3491 "VisibleIdentifier",
3492 "VisibleIdentifier",
3493 VisibleIdentifier_free,
3494 VisibleIdentifier_print,
3495 VisibleIdentifier_constraint,
3496 VisibleIdentifier_decode_ber,
3497 VisibleIdentifier_encode_der,
3498 VisibleIdentifier_decode_xer,
3499 VisibleIdentifier_encode_xer,
3500 0, 0, /* No PER support, use "-gen-PER" to enable */
3501 0, /* Use generic outmost tag fetcher */
3502 asn_DEF_VisibleIdentifier_tags_1,
3503 sizeof(asn_DEF_VisibleIdentifier_tags_1)
3504 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
3505 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
3506 sizeof(asn_DEF_VisibleIdentifier_tags_1)
3507 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
3508 0, /* No PER visible constraints */
3509 0, 0, /* No members */
3510 0 /* No specifics */
3511 };
3512
3513
3514 /*** <<< INCLUDES [Sequence] >>> ***/
3515
3516 #include "Int1.h"
3517 #include "Int4.h"
3518 #include <BOOLEAN.h>
3519 #include <ENUMERATED.h>
3520 #include <NULL.h>
3521 #include "Int5.h"
3522 #include <constr_SEQUENCE.h>
3523
3524 /*** <<< DEPS [Sequence] >>> ***/
3525
3526 typedef enum enum_c {
3527 enum_c_one = 1,
3528 enum_c_two = 2,
3529 /*
3530 * Enumeration is extensible
3531 */
3532 enum_c_three = 3
3533 } e_enum_c;
3534
3535 /*** <<< TYPE-DECLS [Sequence] >>> ***/
3536
3537 typedef struct Sequence {
3538 Int1_t *int1_c /* DEFAULT 3 */;
3539 Int4_t int4;
3540 Int4_t int4_c;
3541 BOOLEAN_t *Bool /* DEFAULT 1 */;
3542 ENUMERATED_t enum_c;
3543 NULL_t *null /* OPTIONAL */;
3544 /*
3545 * This type is extensible,
3546 * possible extensions are below.
3547 */
3548 Int5_t *int5_c /* OPTIONAL */;
3549
3550 /* Context for parsing across buffer boundaries */
3551 asn_struct_ctx_t _asn_ctx;
3552 } Sequence_t;
3553
3554 /*** <<< FUNC-DECLS [Sequence] >>> ***/
3555
3556 /* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
3557 extern asn_TYPE_descriptor_t asn_DEF_Sequence;
3558
3559 /*** <<< CODE [Sequence] >>> ***/
3560
3561 static int
3562 enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
3563 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
3564 /* Replace with underlying type checker */
3565 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
3566 return td->check_constraints(td, sptr, ctfailcb, app_key);
3567 }
3568
3569 /*
3570 * This type is implemented using ENUMERATED,
3571 * so here we adjust the DEF accordingly.
3572 */
3573 static void
3574 enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3575 td->free_struct = asn_DEF_ENUMERATED.free_struct;
3576 td->print_struct = asn_DEF_ENUMERATED.print_struct;
3577 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
3578 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
3579 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
3580 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
3581 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
3582 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
3583 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
3584 if(!td->per_constraints)
3585 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
3586 td->elements = asn_DEF_ENUMERATED.elements;
3587 td->elements_count = asn_DEF_ENUMERATED.elements_count;
3588 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
3589 }
3590
3591 static void
3592 enum_c_6_free(asn_TYPE_descriptor_t *td,
3593 void *struct_ptr, int contents_only) {
3594 enum_c_6_inherit_TYPE_descriptor(td);
3595 td->free_struct(td, struct_ptr, contents_only);
3596 }
3597
3598 static int
3599 enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3600 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3601 enum_c_6_inherit_TYPE_descriptor(td);
3602 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3603 }
3604
3605 static asn_dec_rval_t
3606 enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3607 void **structure, const void *bufptr, size_t size, int tag_mode) {
3608 enum_c_6_inherit_TYPE_descriptor(td);
3609 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3610 }
3611
3612 static asn_enc_rval_t
3613 enum_c_6_encode_der(asn_TYPE_descriptor_t *td,
3614 void *structure, int tag_mode, ber_tlv_tag_t tag,
3615 asn_app_consume_bytes_f *cb, void *app_key) {
3616 enum_c_6_inherit_TYPE_descriptor(td);
3617 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3618 }
3619
3620 static asn_dec_rval_t
3621 enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3622 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3623 enum_c_6_inherit_TYPE_descriptor(td);
3624 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3625 }
3626
3627 static asn_enc_rval_t
3628 enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3629 int ilevel, enum xer_encoder_flags_e flags,
3630 asn_app_consume_bytes_f *cb, void *app_key) {
3631 enum_c_6_inherit_TYPE_descriptor(td);
3632 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3633 }
3634
3635 static int
3636 memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
3637 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
3638 const Int1_t *st = (const Int1_t *)sptr;
3639 long value;
3640
3641 if(!sptr) {
3642 ASN__CTFAIL(app_key, td, sptr,
3643 "%s: value not given (%s:%d)",
3644 td->name, __FILE__, __LINE__);
3645 return -1;
3646 }
3647
3648 if(asn_INTEGER2long(st, &value)) {
3649 ASN__CTFAIL(app_key, td, sptr,
3650 "%s: value too large (%s:%d)",
3651 td->name, __FILE__, __LINE__);
3652 return -1;
3653 }
3654
3655 if((value >= -2)) {
3656 /* Constraint check succeeded */
3657 return 0;
3658 } else {
3659 ASN__CTFAIL(app_key, td, sptr,
3660 "%s: constraint failed (%s:%d)",
3661 td->name, __FILE__, __LINE__);
3662 return -1;
3663 }
3664 }
3665
3666 static int
3667 memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
3668 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
3669 const Int4_t *st = (const Int4_t *)sptr;
3670 long value;
3671
3672 if(!sptr) {
3673 ASN__CTFAIL(app_key, td, sptr,
3674 "%s: value not given (%s:%d)",
3675 td->name, __FILE__, __LINE__);
3676 return -1;
3677 }
3678
3679 if(asn_INTEGER2long(st, &value)) {
3680 ASN__CTFAIL(app_key, td, sptr,
3681 "%s: value too large (%s:%d)",
3682 td->name, __FILE__, __LINE__);
3683 return -1;
3684 }
3685
3686 if((value >= 5 && value <= 7)) {
3687 /* Constraint check succeeded */
3688 return 0;
3689 } else {
3690 ASN__CTFAIL(app_key, td, sptr,
3691 "%s: constraint failed (%s:%d)",
3692 td->name, __FILE__, __LINE__);
3693 return -1;
3694 }
3695 }
3696
3697 static int
3698 memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
3699 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
3700 const Int5_t *st = (const Int5_t *)sptr;
3701 long value;
3702
3703 if(!sptr) {
3704 ASN__CTFAIL(app_key, td, sptr,
3705 "%s: value not given (%s:%d)",
3706 td->name, __FILE__, __LINE__);
3707 return -1;
3708 }
3709
3710 if(asn_INTEGER2long(st, &value)) {
3711 ASN__CTFAIL(app_key, td, sptr,
3712 "%s: value too large (%s:%d)",
3713 td->name, __FILE__, __LINE__);
3714 return -1;
3715 }
3716
3717 if((value == 5)) {
3718 /* Constraint check succeeded */
3719 return 0;
3720 } else {
3721 ASN__CTFAIL(app_key, td, sptr,
3722 "%s: constraint failed (%s:%d)",
3723 td->name, __FILE__, __LINE__);
3724 return -1;
3725 }
3726 }
3727
3728
3729 /*** <<< STAT-DEFS [Sequence] >>> ***/
3730
3731 static int asn_DFL_2_set_3(int set_value, void **sptr) {
3732 Int1_t *st = *sptr;
3733
3734 if(!st) {
3735 if(!set_value) return -1; /* Not a default value */
3736 st = (*sptr = CALLOC(1, sizeof(*st)));
3737 if(!st) return -1;
3738 }
3739
3740 if(set_value) {
3741 /* Install default value 3 */
3742 return asn_long2INTEGER(st, 3);
3743 } else {
3744 /* Test default value 3 */
3745 long value;
3746 if(asn_INTEGER2long(st, &value))
3747 return -1;
3748 return (value == 3);
3749 }
3750 }
3751 static int asn_DFL_5_set_1(int set_value, void **sptr) {
3752 BOOLEAN_t *st = *sptr;
3753
3754 if(!st) {
3755 if(!set_value) return -1; /* Not a default value */
3756 st = (*sptr = CALLOC(1, sizeof(*st)));
3757 if(!st) return -1;
3758 }
3759
3760 if(set_value) {
3761 /* Install default value 1 */
3762 *st = 1;
3763 return 0;
3764 } else {
3765 /* Test default value 1 */
3766 return (*st == 1);
3767 }
3768 }
3769 static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
3770 { 1, 3, "one" },
3771 { 2, 3, "two" },
3772 { 3, 5, "three" }
3773 /* This list is extensible */
3774 };
3775 static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
3776 0, /* one(1) */
3777 2, /* three(3) */
3778 1 /* two(2) */
3779 /* This list is extensible */
3780 };
3781 static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
3782 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
3783 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
3784 3, /* Number of elements in the maps */
3785 3, /* Extensions before this member */
3786 1, /* Strict enumeration */
3787 0, /* Native long size */
3788 0
3789 };
3790 static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
3791 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
3792 };
3793 static /* Use -fall-defs-global to expose */
3794 asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
3795 "enum-c",
3796 "enum-c",
3797 enum_c_6_free,
3798 enum_c_6_print,
3799 enum_c_6_constraint,
3800 enum_c_6_decode_ber,
3801 enum_c_6_encode_der,
3802 enum_c_6_decode_xer,
3803 enum_c_6_encode_xer,
3804 0, 0, /* No PER support, use "-gen-PER" to enable */
3805 0, /* Use generic outmost tag fetcher */
3806 asn_DEF_enum_c_tags_6,
3807 sizeof(asn_DEF_enum_c_tags_6)
3808 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
3809 asn_DEF_enum_c_tags_6, /* Same as above */
3810 sizeof(asn_DEF_enum_c_tags_6)
3811 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
3812 0, /* No PER visible constraints */
3813 0, 0, /* Defined elsewhere */
3814 &asn_SPC_enum_c_specs_6 /* Additional specs */
3815 };
3816
3817 static asn_TYPE_member_t asn_MBR_Sequence_1[] = {
3818 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
3819 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
3820 .tag_mode = 0,
3821 .type = &asn_DEF_Int1,
3822 .memb_constraints = memb_int1_c_constraint_1,
3823 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3824 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
3825 .name = "int1-c"
3826 },
3827 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
3828 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
3829 .tag_mode = +1, /* EXPLICIT tag at current level */
3830 .type = &asn_DEF_Int4,
3831 .memb_constraints = 0, /* Defer constraints checking to the member type */
3832 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3833 .default_value = 0,
3834 .name = "int4"
3835 },
3836 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
3837 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
3838 .tag_mode = 0,
3839 .type = &asn_DEF_Int4,
3840 .memb_constraints = memb_int4_c_constraint_1,
3841 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3842 .default_value = 0,
3843 .name = "int4-c"
3844 },
3845 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
3846 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
3847 .tag_mode = 0,
3848 .type = &asn_DEF_BOOLEAN,
3849 .memb_constraints = 0, /* Defer constraints checking to the member type */
3850 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3851 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
3852 .name = "bool"
3853 },
3854 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
3855 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
3856 .tag_mode = 0,
3857 .type = &asn_DEF_enum_c_6,
3858 .memb_constraints = 0, /* Defer constraints checking to the member type */
3859 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3860 .default_value = 0,
3861 .name = "enum-c"
3862 },
3863 { ATF_POINTER, 2, offsetof(struct Sequence, null),
3864 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
3865 .tag_mode = 0,
3866 .type = &asn_DEF_NULL,
3867 .memb_constraints = 0, /* Defer constraints checking to the member type */
3868 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3869 .default_value = 0,
3870 .name = "null"
3871 },
3872 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
3873 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
3874 .tag_mode = 0,
3875 .type = &asn_DEF_Int5,
3876 .memb_constraints = memb_int5_c_constraint_1,
3877 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3878 .default_value = 0,
3879 .name = "int5-c"
3880 },
3881 };
3882 static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
3883 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
3884 };
3885 static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
3886 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
3887 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
3888 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
3889 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
3890 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
3891 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
3892 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
3893 };
3894 static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
3895 sizeof(struct Sequence),
3896 offsetof(struct Sequence, _asn_ctx),
3897 asn_MAP_Sequence_tag2el_1,
3898 7, /* Count of tags in the map */
3899 0, 0, 0, /* Optional elements (not needed) */
3900 5, /* Start extensions */
3901 8 /* Stop extensions */
3902 };
3903 asn_TYPE_descriptor_t asn_DEF_Sequence = {
3904 "Sequence",
3905 "Sequence",
3906 SEQUENCE_free,
3907 SEQUENCE_print,
3908 SEQUENCE_constraint,
3909 SEQUENCE_decode_ber,
3910 SEQUENCE_encode_der,
3911 SEQUENCE_decode_xer,
3912 SEQUENCE_encode_xer,
3913 0, 0, /* No PER support, use "-gen-PER" to enable */
3914 0, /* Use generic outmost tag fetcher */
3915 asn_DEF_Sequence_tags_1,
3916 sizeof(asn_DEF_Sequence_tags_1)
3917 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
3918 asn_DEF_Sequence_tags_1, /* Same as above */
3919 sizeof(asn_DEF_Sequence_tags_1)
3920 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
3921 0, /* No PER visible constraints */
3922 asn_MBR_Sequence_1,
3923 7, /* Elements count */
3924 &asn_SPC_Sequence_specs_1 /* Additional specs */
3925 };
3926
3927
3928 /*** <<< INCLUDES [SequenceOf] >>> ***/
3929
3930 #include <asn_SEQUENCE_OF.h>
3931 #include <constr_SEQUENCE_OF.h>
3932
3933 /*** <<< FWD-DECLS [SequenceOf] >>> ***/
3934
3935 struct Sequence;
3936
3937 /*** <<< TYPE-DECLS [SequenceOf] >>> ***/
3938
3939 typedef struct SequenceOf {
3940 A_SEQUENCE_OF(struct Sequence) list;
3941
3942 /* Context for parsing across buffer boundaries */
3943 asn_struct_ctx_t _asn_ctx;
3944 } SequenceOf_t;
3945
3946 /*** <<< FUNC-DECLS [SequenceOf] >>> ***/
3947
3948 extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
3949
3950 /*** <<< POST-INCLUDE [SequenceOf] >>> ***/
3951
3952 #include "Sequence.h"
3953
3954 /*** <<< STAT-DEFS [SequenceOf] >>> ***/
3955
3956 static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
3957 { ATF_POINTER, 0, 0,
3958 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
3959 .tag_mode = 0,
3960 .type = &asn_DEF_Sequence,
3961 .memb_constraints = 0, /* Defer constraints checking to the member type */
3962 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3963 .default_value = 0,
3964 .name = ""
3965 },
3966 };
3967 static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
3968 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
3969 };
3970 static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
3971 sizeof(struct SequenceOf),
3972 offsetof(struct SequenceOf, _asn_ctx),
3973 0, /* XER encoding is XMLDelimitedItemList */
3974 };
3975 asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
3976 "SequenceOf",
3977 "SequenceOf",
3978 SEQUENCE_OF_free,
3979 SEQUENCE_OF_print,
3980 SEQUENCE_OF_constraint,
3981 SEQUENCE_OF_decode_ber,
3982 SEQUENCE_OF_encode_der,
3983 SEQUENCE_OF_decode_xer,
3984 SEQUENCE_OF_encode_xer,
3985 0, 0, /* No PER support, use "-gen-PER" to enable */
3986 0, /* Use generic outmost tag fetcher */
3987 asn_DEF_SequenceOf_tags_1,
3988 sizeof(asn_DEF_SequenceOf_tags_1)
3989 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
3990 asn_DEF_SequenceOf_tags_1, /* Same as above */
3991 sizeof(asn_DEF_SequenceOf_tags_1)
3992 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
3993 0, /* No PER visible constraints */
3994 asn_MBR_SequenceOf_1,
3995 1, /* Single element */
3996 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
3997 };
3998
3999
4000 /*** <<< INCLUDES [Enum0] >>> ***/
4001
4002 #include <ENUMERATED.h>
4003
4004 /*** <<< DEPS [Enum0] >>> ***/
4005
4006 typedef enum Enum0 {
4007 Enum0_one = 0,
4008 Enum0_two = 1
4009 } e_Enum0;
4010
4011 /*** <<< TYPE-DECLS [Enum0] >>> ***/
4012
4013 typedef ENUMERATED_t Enum0_t;
4014
4015 /*** <<< FUNC-DECLS [Enum0] >>> ***/
4016
4017 extern asn_TYPE_descriptor_t asn_DEF_Enum0;
4018 asn_struct_free_f Enum0_free;
4019 asn_struct_print_f Enum0_print;
4020 asn_constr_check_f Enum0_constraint;
4021 ber_type_decoder_f Enum0_decode_ber;
4022 der_type_encoder_f Enum0_encode_der;
4023 xer_type_decoder_f Enum0_decode_xer;
4024 xer_type_encoder_f Enum0_encode_xer;
4025
4026 /*** <<< CODE [Enum0] >>> ***/
4027
4028 int
4029 Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
4030 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
4031 /* Replace with underlying type checker */
4032 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
4033 return td->check_constraints(td, sptr, ctfailcb, app_key);
4034 }
4035
4036 /*
4037 * This type is implemented using ENUMERATED,
4038 * so here we adjust the DEF accordingly.
4039 */
4040 static void
4041 Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4042 td->free_struct = asn_DEF_ENUMERATED.free_struct;
4043 td->print_struct = asn_DEF_ENUMERATED.print_struct;
4044 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
4045 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
4046 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
4047 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
4048 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
4049 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
4050 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
4051 if(!td->per_constraints)
4052 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
4053 td->elements = asn_DEF_ENUMERATED.elements;
4054 td->elements_count = asn_DEF_ENUMERATED.elements_count;
4055 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
4056 }
4057
4058 void
4059 Enum0_free(asn_TYPE_descriptor_t *td,
4060 void *struct_ptr, int contents_only) {
4061 Enum0_1_inherit_TYPE_descriptor(td);
4062 td->free_struct(td, struct_ptr, contents_only);
4063 }
4064
4065 int
4066 Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4067 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4068 Enum0_1_inherit_TYPE_descriptor(td);
4069 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4070 }
4071
4072 asn_dec_rval_t
4073 Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4074 void **structure, const void *bufptr, size_t size, int tag_mode) {
4075 Enum0_1_inherit_TYPE_descriptor(td);
4076 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4077 }
4078
4079 asn_enc_rval_t
4080 Enum0_encode_der(asn_TYPE_descriptor_t *td,
4081 void *structure, int tag_mode, ber_tlv_tag_t tag,
4082 asn_app_consume_bytes_f *cb, void *app_key) {
4083 Enum0_1_inherit_TYPE_descriptor(td);
4084 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4085 }
4086
4087 asn_dec_rval_t
4088 Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4089 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4090 Enum0_1_inherit_TYPE_descriptor(td);
4091 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4092 }
4093
4094 asn_enc_rval_t
4095 Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4096 int ilevel, enum xer_encoder_flags_e flags,
4097 asn_app_consume_bytes_f *cb, void *app_key) {
4098 Enum0_1_inherit_TYPE_descriptor(td);
4099 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4100 }
4101
4102
4103 /*** <<< STAT-DEFS [Enum0] >>> ***/
4104
4105 static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
4106 { 0, 3, "one" },
4107 { 1, 3, "two" }
4108 };
4109 static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
4110 0, /* one(0) */
4111 1 /* two(1) */
4112 };
4113 static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
4114 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
4115 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
4116 2, /* Number of elements in the maps */
4117 0, /* Enumeration is not extensible */
4118 1, /* Strict enumeration */
4119 0, /* Native long size */
4120 0
4121 };
4122 static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
4123 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4124 };
4125 asn_TYPE_descriptor_t asn_DEF_Enum0 = {
4126 "Enum0",
4127 "Enum0",
4128 Enum0_free,
4129 Enum0_print,
4130 Enum0_constraint,
4131 Enum0_decode_ber,
4132 Enum0_encode_der,
4133 Enum0_decode_xer,
4134 Enum0_encode_xer,
4135 0, 0, /* No PER support, use "-gen-PER" to enable */
4136 0, /* Use generic outmost tag fetcher */
4137 asn_DEF_Enum0_tags_1,
4138 sizeof(asn_DEF_Enum0_tags_1)
4139 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4140 asn_DEF_Enum0_tags_1, /* Same as above */
4141 sizeof(asn_DEF_Enum0_tags_1)
4142 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4143 0, /* No PER visible constraints */
4144 0, 0, /* Defined elsewhere */
4145 &asn_SPC_Enum0_specs_1 /* Additional specs */
4146 };
4147
4148
4149 /*** <<< INCLUDES [Enum1] >>> ***/
4150
4151 #include <NativeEnumerated.h>
4152
4153 /*** <<< DEPS [Enum1] >>> ***/
4154
4155 typedef enum Enum1 {
4156 Enum1_one = 0,
4157 Enum1_two = 1
4158 } e_Enum1;
4159
4160 /*** <<< TYPE-DECLS [Enum1] >>> ***/
4161
4162 typedef long Enum1_t;
4163
4164 /*** <<< FUNC-DECLS [Enum1] >>> ***/
4165
4166 extern asn_TYPE_descriptor_t asn_DEF_Enum1;
4167 asn_struct_free_f Enum1_free;
4168 asn_struct_print_f Enum1_print;
4169 asn_constr_check_f Enum1_constraint;
4170 ber_type_decoder_f Enum1_decode_ber;
4171 der_type_encoder_f Enum1_encode_der;
4172 xer_type_decoder_f Enum1_decode_xer;
4173 xer_type_encoder_f Enum1_encode_xer;
4174
4175 /*** <<< CODE [Enum1] >>> ***/
4176
4177 int
4178 Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
4179 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
4180 long value;
4181
4182 if(!sptr) {
4183 ASN__CTFAIL(app_key, td, sptr,
4184 "%s: value not given (%s:%d)",
4185 td->name, __FILE__, __LINE__);
4186 return -1;
4187 }
4188
4189 value = *(const long *)sptr;
4190
4191 if((value == 0)) {
4192 /* Constraint check succeeded */
4193 return 0;
4194 } else {
4195 ASN__CTFAIL(app_key, td, sptr,
4196 "%s: constraint failed (%s:%d)",
4197 td->name, __FILE__, __LINE__);
4198 return -1;
4199 }
4200 }
4201
4202 /*
4203 * This type is implemented using NativeEnumerated,
4204 * so here we adjust the DEF accordingly.
4205 */
4206 static void
4207 Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4208 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4209 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
4210 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
4211 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4212 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4213 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4214 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4215 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
4216 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
4217 if(!td->per_constraints)
4218 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4219 td->elements = asn_DEF_NativeEnumerated.elements;
4220 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4221 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
4222 }
4223
4224 void
4225 Enum1_free(asn_TYPE_descriptor_t *td,
4226 void *struct_ptr, int contents_only) {
4227 Enum1_1_inherit_TYPE_descriptor(td);
4228 td->free_struct(td, struct_ptr, contents_only);
4229 }
4230
4231 int
4232 Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4233 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4234 Enum1_1_inherit_TYPE_descriptor(td);
4235 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4236 }
4237
4238 asn_dec_rval_t
4239 Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4240 void **structure, const void *bufptr, size_t size, int tag_mode) {
4241 Enum1_1_inherit_TYPE_descriptor(td);
4242 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4243 }
4244
4245 asn_enc_rval_t
4246 Enum1_encode_der(asn_TYPE_descriptor_t *td,
4247 void *structure, int tag_mode, ber_tlv_tag_t tag,
4248 asn_app_consume_bytes_f *cb, void *app_key) {
4249 Enum1_1_inherit_TYPE_descriptor(td);
4250 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4251 }
4252
4253 asn_dec_rval_t
4254 Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4255 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4256 Enum1_1_inherit_TYPE_descriptor(td);
4257 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4258 }
4259
4260 asn_enc_rval_t
4261 Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4262 int ilevel, enum xer_encoder_flags_e flags,
4263 asn_app_consume_bytes_f *cb, void *app_key) {
4264 Enum1_1_inherit_TYPE_descriptor(td);
4265 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4266 }
4267
4268
4269 /*** <<< STAT-DEFS [Enum1] >>> ***/
4270
4271 static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
4272 { 0, 3, "one" },
4273 { 1, 3, "two" }
4274 };
4275 static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
4276 0, /* one(0) */
4277 1 /* two(1) */
4278 };
4279 static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
4280 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
4281 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
4282 2, /* Number of elements in the maps */
4283 0, /* Enumeration is not extensible */
4284 1, /* Strict enumeration */
4285 0, /* Native long size */
4286 0
4287 };
4288 static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
4289 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4290 };
4291 asn_TYPE_descriptor_t asn_DEF_Enum1 = {
4292 "Enum1",
4293 "Enum1",
4294 Enum1_free,
4295 Enum1_print,
4296 Enum1_constraint,
4297 Enum1_decode_ber,
4298 Enum1_encode_der,
4299 Enum1_decode_xer,
4300 Enum1_encode_xer,
4301 0, 0, /* No PER support, use "-gen-PER" to enable */
4302 0, /* Use generic outmost tag fetcher */
4303 asn_DEF_Enum1_tags_1,
4304 sizeof(asn_DEF_Enum1_tags_1)
4305 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4306 asn_DEF_Enum1_tags_1, /* Same as above */
4307 sizeof(asn_DEF_Enum1_tags_1)
4308 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4309 0, /* No PER visible constraints */
4310 0, 0, /* Defined elsewhere */
4311 &asn_SPC_Enum1_specs_1 /* Additional specs */
4312 };
4313
4314
4315 /*** <<< INCLUDES [Identifier] >>> ***/
4316
4317 #include <VisibleString.h>
4318
4319 /*** <<< TYPE-DECLS [Identifier] >>> ***/
4320
4321 typedef VisibleString_t Identifier_t;
4322
4323 /*** <<< FUNC-DECLS [Identifier] >>> ***/
4324
4325 extern asn_TYPE_descriptor_t asn_DEF_Identifier;
4326 asn_struct_free_f Identifier_free;
4327 asn_struct_print_f Identifier_print;
4328 asn_constr_check_f Identifier_constraint;
4329 ber_type_decoder_f Identifier_decode_ber;
4330 der_type_encoder_f Identifier_encode_der;
4331 xer_type_decoder_f Identifier_decode_xer;
4332 xer_type_encoder_f Identifier_encode_xer;
4333
4334 /*** <<< CTABLES [Identifier] >>> ***/
4335
4336 static const int permitted_alphabet_table_1[256] = {
4337 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4339 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
4340 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
4341 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
4342 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
4343 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
4344 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
4345 };
4346
4347 static int check_permitted_alphabet_1(const void *sptr) {
4348 const int *table = permitted_alphabet_table_1;
4349 /* The underlying type is VisibleString */
4350 const VisibleString_t *st = (const VisibleString_t *)sptr;
4351 const uint8_t *ch = st->buf;
4352 const uint8_t *end = ch + st->size;
4353
4354 for(; ch < end; ch++) {
4355 uint8_t cv = *ch;
4356 if(!table[cv]) return -1;
4357 }
4358 return 0;
4359 }
4360
4361
4362 /*** <<< CODE [Identifier] >>> ***/
4363
4364 int
4365 Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
4366 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
4367 const VisibleString_t *st = (const VisibleString_t *)sptr;
4368 size_t size;
4369
4370 if(!sptr) {
4371 ASN__CTFAIL(app_key, td, sptr,
4372 "%s: value not given (%s:%d)",
4373 td->name, __FILE__, __LINE__);
4374 return -1;
4375 }
4376
4377 size = st->size;
4378
4379 if((size >= 1 && size <= 32)
4380 && !check_permitted_alphabet_1(st)) {
4381 /* Constraint check succeeded */
4382 return 0;
4383 } else {
4384 ASN__CTFAIL(app_key, td, sptr,
4385 "%s: constraint failed (%s:%d)",
4386 td->name, __FILE__, __LINE__);
4387 return -1;
4388 }
4389 }
4390
4391 /*
4392 * This type is implemented using VisibleString,
4393 * so here we adjust the DEF accordingly.
4394 */
4395 static void
4396 Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4397 td->free_struct = asn_DEF_VisibleString.free_struct;
4398 td->print_struct = asn_DEF_VisibleString.print_struct;
4399 td->check_constraints = asn_DEF_VisibleString.check_constraints;
4400 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
4401 td->der_encoder = asn_DEF_VisibleString.der_encoder;
4402 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
4403 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
4404 td->uper_decoder = asn_DEF_VisibleString.uper_decoder;
4405 td->uper_encoder = asn_DEF_VisibleString.uper_encoder;
4406 if(!td->per_constraints)
4407 td->per_constraints = asn_DEF_VisibleString.per_constraints;
4408 td->elements = asn_DEF_VisibleString.elements;
4409 td->elements_count = asn_DEF_VisibleString.elements_count;
4410 td->specifics = asn_DEF_VisibleString.specifics;
4411 }
4412
4413 void
4414 Identifier_free(asn_TYPE_descriptor_t *td,
4415 void *struct_ptr, int contents_only) {
4416 Identifier_1_inherit_TYPE_descriptor(td);
4417 td->free_struct(td, struct_ptr, contents_only);
4418 }
4419
4420 int
4421 Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4422 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4423 Identifier_1_inherit_TYPE_descriptor(td);
4424 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4425 }
4426
4427 asn_dec_rval_t
4428 Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4429 void **structure, const void *bufptr, size_t size, int tag_mode) {
4430 Identifier_1_inherit_TYPE_descriptor(td);
4431 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4432 }
4433
4434 asn_enc_rval_t
4435 Identifier_encode_der(asn_TYPE_descriptor_t *td,
4436 void *structure, int tag_mode, ber_tlv_tag_t tag,
4437 asn_app_consume_bytes_f *cb, void *app_key) {
4438 Identifier_1_inherit_TYPE_descriptor(td);
4439 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4440 }
4441
4442 asn_dec_rval_t
4443 Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4444 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4445 Identifier_1_inherit_TYPE_descriptor(td);
4446 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4447 }
4448
4449 asn_enc_rval_t
4450 Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4451 int ilevel, enum xer_encoder_flags_e flags,
4452 asn_app_consume_bytes_f *cb, void *app_key) {
4453 Identifier_1_inherit_TYPE_descriptor(td);
4454 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4455 }
4456
4457
4458 /*** <<< STAT-DEFS [Identifier] >>> ***/
4459
4460 static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
4461 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
4462 };
4463 asn_TYPE_descriptor_t asn_DEF_Identifier = {
4464 "Identifier",
4465 "Identifier",
4466 Identifier_free,
4467 Identifier_print,
4468 Identifier_constraint,
4469 Identifier_decode_ber,
4470 Identifier_encode_der,
4471 Identifier_decode_xer,
4472 Identifier_encode_xer,
4473 0, 0, /* No PER support, use "-gen-PER" to enable */
4474 0, /* Use generic outmost tag fetcher */
4475 asn_DEF_Identifier_tags_1,
4476 sizeof(asn_DEF_Identifier_tags_1)
4477 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
4478 asn_DEF_Identifier_tags_1, /* Same as above */
4479 sizeof(asn_DEF_Identifier_tags_1)
4480 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
4481 0, /* No PER visible constraints */
4482 0, 0, /* No members */
4483 0 /* No specifics */
4484 };
4485