0bf4501782248d599b5c94845c609d03bb14dfcd
[com/asn1c.git] / tests / tests-asn1c-compiler / 50-constraint-OK.asn1.-Pgen-PER
1
2 /*** <<< INCLUDES [Int1] >>> ***/
3
4 #include <NativeInteger.h>
5
6 /*** <<< TYPE-DECLS [Int1] >>> ***/
7
8 typedef long     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 per_type_decoder_f Int1_decode_uper;
21 per_type_encoder_f Int1_encode_uper;
22 per_type_decoder_f Int1_decode_aper;
23 per_type_encoder_f Int1_encode_aper;
24 #define Int1_ten        ((Int1_t)10)
25
26 /*** <<< CODE [Int1] >>> ***/
27
28 /*
29  * This type is implemented using NativeInteger,
30  * so here we adjust the DEF accordingly.
31  */
32
33 /*** <<< STAT-DEFS [Int1] >>> ***/
34
35 static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
36         (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
37 };
38 asn_TYPE_descriptor_t asn_DEF_Int1 = {
39         "Int1",
40         "Int1",
41         &asn_OP_NativeInteger,
42         asn_DEF_Int1_tags_1,
43         sizeof(asn_DEF_Int1_tags_1)
44                 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
45         asn_DEF_Int1_tags_1,    /* Same as above */
46         sizeof(asn_DEF_Int1_tags_1)
47                 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
48         { 0, 0, NativeInteger_constraint },
49         0, 0,   /* No members */
50         0       /* No specifics */
51 };
52
53
54 /*** <<< INCLUDES [Int2] >>> ***/
55
56 #include "Int1.h"
57
58 /*** <<< TYPE-DECLS [Int2] >>> ***/
59
60 typedef Int1_t   Int2_t;
61
62 /*** <<< FUNC-DECLS [Int2] >>> ***/
63
64 extern asn_per_constraints_t asn_PER_type_Int2_constr_1;
65 extern asn_TYPE_descriptor_t asn_DEF_Int2;
66 asn_struct_free_f Int2_free;
67 asn_struct_print_f Int2_print;
68 asn_constr_check_f Int2_constraint;
69 ber_type_decoder_f Int2_decode_ber;
70 der_type_encoder_f Int2_encode_der;
71 xer_type_decoder_f Int2_decode_xer;
72 xer_type_encoder_f Int2_encode_xer;
73 per_type_decoder_f Int2_decode_uper;
74 per_type_encoder_f Int2_encode_uper;
75 per_type_decoder_f Int2_decode_aper;
76 per_type_encoder_f Int2_encode_aper;
77
78 /*** <<< CODE [Int2] >>> ***/
79
80 int
81 Int2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
82                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
83         unsigned long value;
84         
85         if(!sptr) {
86                 ASN__CTFAIL(app_key, td, sptr,
87                         "%s: value not given (%s:%d)",
88                         td->name, __FILE__, __LINE__);
89                 return -1;
90         }
91         
92         value = *(const long *)sptr;
93         
94         if(1 /* No applicable constraints whatsoever */) {
95                 (void)value; /* Unused variable */
96                 /* Nothing is here. See below */
97         }
98         
99         return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
100 }
101
102 /*
103  * This type is implemented using Int1,
104  * so here we adjust the DEF accordingly.
105  */
106
107 /*** <<< CTDEFS [Int2] >>> ***/
108
109 asn_per_constraints_t asn_PER_type_Int2_constr_1 CC_NOTUSED = {
110         { APC_SEMI_CONSTRAINED, -1, -1,  0,  0 }        /* (0..MAX) */,
111         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
112         0, 0    /* No PER value map */
113 };
114
115 /*** <<< STAT-DEFS [Int2] >>> ***/
116
117 static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
118         (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
119 };
120 asn_TYPE_descriptor_t asn_DEF_Int2 = {
121         "Int2",
122         "Int2",
123         &asn_OP_NativeInteger,
124         asn_DEF_Int2_tags_1,
125         sizeof(asn_DEF_Int2_tags_1)
126                 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
127         asn_DEF_Int2_tags_1,    /* Same as above */
128         sizeof(asn_DEF_Int2_tags_1)
129                 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
130         { 0, &asn_PER_type_Int2_constr_1, Int2_constraint },
131         0, 0,   /* No members */
132         0       /* No specifics */
133 };
134
135
136 /*** <<< INCLUDES [Int3] >>> ***/
137
138 #include "Int2.h"
139
140 /*** <<< TYPE-DECLS [Int3] >>> ***/
141
142 typedef Int2_t   Int3_t;
143
144 /*** <<< FUNC-DECLS [Int3] >>> ***/
145
146 extern asn_per_constraints_t asn_PER_type_Int3_constr_1;
147 extern asn_TYPE_descriptor_t asn_DEF_Int3;
148 asn_struct_free_f Int3_free;
149 asn_struct_print_f Int3_print;
150 asn_constr_check_f Int3_constraint;
151 ber_type_decoder_f Int3_decode_ber;
152 der_type_encoder_f Int3_encode_der;
153 xer_type_decoder_f Int3_decode_xer;
154 xer_type_encoder_f Int3_encode_xer;
155 per_type_decoder_f Int3_decode_uper;
156 per_type_encoder_f Int3_encode_uper;
157 per_type_decoder_f Int3_decode_aper;
158 per_type_encoder_f Int3_encode_aper;
159
160 /*** <<< CODE [Int3] >>> ***/
161
162 int
163 Int3_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
164                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
165         long value;
166         
167         if(!sptr) {
168                 ASN__CTFAIL(app_key, td, sptr,
169                         "%s: value not given (%s:%d)",
170                         td->name, __FILE__, __LINE__);
171                 return -1;
172         }
173         
174         value = *(const long *)sptr;
175         
176         if((value >= 0 && value <= 10)) {
177                 /* Constraint check succeeded */
178                 return 0;
179         } else {
180                 ASN__CTFAIL(app_key, td, sptr,
181                         "%s: constraint failed (%s:%d)",
182                         td->name, __FILE__, __LINE__);
183                 return -1;
184         }
185 }
186
187 /*
188  * This type is implemented using Int2,
189  * so here we adjust the DEF accordingly.
190  */
191
192 /*** <<< CTDEFS [Int3] >>> ***/
193
194 asn_per_constraints_t asn_PER_type_Int3_constr_1 CC_NOTUSED = {
195         { APC_CONSTRAINED,       4,  4,  0,  10 }       /* (0..10) */,
196         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
197         0, 0    /* No PER value map */
198 };
199
200 /*** <<< STAT-DEFS [Int3] >>> ***/
201
202 static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
203         (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
204 };
205 asn_TYPE_descriptor_t asn_DEF_Int3 = {
206         "Int3",
207         "Int3",
208         &asn_OP_NativeInteger,
209         asn_DEF_Int3_tags_1,
210         sizeof(asn_DEF_Int3_tags_1)
211                 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
212         asn_DEF_Int3_tags_1,    /* Same as above */
213         sizeof(asn_DEF_Int3_tags_1)
214                 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
215         { 0, &asn_PER_type_Int3_constr_1, Int3_constraint },
216         0, 0,   /* No members */
217         0       /* No specifics */
218 };
219
220
221 /*** <<< INCLUDES [Int4] >>> ***/
222
223 #include "Int3.h"
224
225 /*** <<< TYPE-DECLS [Int4] >>> ***/
226
227 typedef Int3_t   Int4_t;
228
229 /*** <<< FUNC-DECLS [Int4] >>> ***/
230
231 extern asn_per_constraints_t asn_PER_type_Int4_constr_1;
232 extern asn_TYPE_descriptor_t asn_DEF_Int4;
233 asn_struct_free_f Int4_free;
234 asn_struct_print_f Int4_print;
235 asn_constr_check_f Int4_constraint;
236 ber_type_decoder_f Int4_decode_ber;
237 der_type_encoder_f Int4_encode_der;
238 xer_type_decoder_f Int4_decode_xer;
239 xer_type_encoder_f Int4_encode_xer;
240 per_type_decoder_f Int4_decode_uper;
241 per_type_encoder_f Int4_encode_uper;
242 per_type_decoder_f Int4_decode_aper;
243 per_type_encoder_f Int4_encode_aper;
244
245 /*** <<< CODE [Int4] >>> ***/
246
247 int
248 Int4_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
249                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
250         long value;
251         
252         if(!sptr) {
253                 ASN__CTFAIL(app_key, td, sptr,
254                         "%s: value not given (%s:%d)",
255                         td->name, __FILE__, __LINE__);
256                 return -1;
257         }
258         
259         value = *(const long *)sptr;
260         
261         if((value >= 1 && value <= 10)) {
262                 /* Constraint check succeeded */
263                 return 0;
264         } else {
265                 ASN__CTFAIL(app_key, td, sptr,
266                         "%s: constraint failed (%s:%d)",
267                         td->name, __FILE__, __LINE__);
268                 return -1;
269         }
270 }
271
272 /*
273  * This type is implemented using Int3,
274  * so here we adjust the DEF accordingly.
275  */
276
277 /*** <<< CTDEFS [Int4] >>> ***/
278
279 asn_per_constraints_t asn_PER_type_Int4_constr_1 CC_NOTUSED = {
280         { APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  1,  10 }   /* (1..10,...) */,
281         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
282         0, 0    /* No PER value map */
283 };
284
285 /*** <<< STAT-DEFS [Int4] >>> ***/
286
287 static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
288         (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
289 };
290 asn_TYPE_descriptor_t asn_DEF_Int4 = {
291         "Int4",
292         "Int4",
293         &asn_OP_NativeInteger,
294         asn_DEF_Int4_tags_1,
295         sizeof(asn_DEF_Int4_tags_1)
296                 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
297         asn_DEF_Int4_tags_1,    /* Same as above */
298         sizeof(asn_DEF_Int4_tags_1)
299                 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
300         { 0, &asn_PER_type_Int4_constr_1, Int4_constraint },
301         0, 0,   /* No members */
302         0       /* No specifics */
303 };
304
305
306 /*** <<< INCLUDES [Int5] >>> ***/
307
308 #include "Int4.h"
309
310 /*** <<< TYPE-DECLS [Int5] >>> ***/
311
312 typedef Int4_t   Int5_t;
313
314 /*** <<< FUNC-DECLS [Int5] >>> ***/
315
316 extern asn_per_constraints_t asn_PER_type_Int5_constr_1;
317 extern asn_TYPE_descriptor_t asn_DEF_Int5;
318 asn_struct_free_f Int5_free;
319 asn_struct_print_f Int5_print;
320 asn_constr_check_f Int5_constraint;
321 ber_type_decoder_f Int5_decode_ber;
322 der_type_encoder_f Int5_encode_der;
323 xer_type_decoder_f Int5_decode_xer;
324 xer_type_encoder_f Int5_encode_xer;
325 per_type_decoder_f Int5_decode_uper;
326 per_type_encoder_f Int5_encode_uper;
327 per_type_decoder_f Int5_decode_aper;
328 per_type_encoder_f Int5_encode_aper;
329
330 /*** <<< CODE [Int5] >>> ***/
331
332 int
333 Int5_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
334                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
335         long value;
336         
337         if(!sptr) {
338                 ASN__CTFAIL(app_key, td, sptr,
339                         "%s: value not given (%s:%d)",
340                         td->name, __FILE__, __LINE__);
341                 return -1;
342         }
343         
344         value = *(const long *)sptr;
345         
346         if((value == 5)) {
347                 /* Constraint check succeeded */
348                 return 0;
349         } else {
350                 ASN__CTFAIL(app_key, td, sptr,
351                         "%s: constraint failed (%s:%d)",
352                         td->name, __FILE__, __LINE__);
353                 return -1;
354         }
355 }
356
357 /*
358  * This type is implemented using Int4,
359  * so here we adjust the DEF accordingly.
360  */
361
362 /*** <<< CTDEFS [Int5] >>> ***/
363
364 asn_per_constraints_t asn_PER_type_Int5_constr_1 CC_NOTUSED = {
365         { APC_CONSTRAINED,       0,  0,  5,  5 }        /* (5..5) */,
366         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
367         0, 0    /* No PER value map */
368 };
369
370 /*** <<< STAT-DEFS [Int5] >>> ***/
371
372 static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
373         (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
374 };
375 asn_TYPE_descriptor_t asn_DEF_Int5 = {
376         "Int5",
377         "Int5",
378         &asn_OP_NativeInteger,
379         asn_DEF_Int5_tags_1,
380         sizeof(asn_DEF_Int5_tags_1)
381                 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
382         asn_DEF_Int5_tags_1,    /* Same as above */
383         sizeof(asn_DEF_Int5_tags_1)
384                 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
385         { 0, &asn_PER_type_Int5_constr_1, Int5_constraint },
386         0, 0,   /* No members */
387         0       /* No specifics */
388 };
389
390
391 /*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
392
393 #include <NativeInteger.h>
394
395 /*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
396
397 typedef long     ExtensibleExtensions_t;
398
399 /*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
400
401 extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
402 asn_struct_free_f ExtensibleExtensions_free;
403 asn_struct_print_f ExtensibleExtensions_print;
404 asn_constr_check_f ExtensibleExtensions_constraint;
405 ber_type_decoder_f ExtensibleExtensions_decode_ber;
406 der_type_encoder_f ExtensibleExtensions_encode_der;
407 xer_type_decoder_f ExtensibleExtensions_decode_xer;
408 xer_type_encoder_f ExtensibleExtensions_encode_xer;
409 per_type_decoder_f ExtensibleExtensions_decode_uper;
410 per_type_encoder_f ExtensibleExtensions_encode_uper;
411 per_type_decoder_f ExtensibleExtensions_decode_aper;
412 per_type_encoder_f ExtensibleExtensions_encode_aper;
413
414 /*** <<< CODE [ExtensibleExtensions] >>> ***/
415
416 int
417 ExtensibleExtensions_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
418                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
419         long value;
420         
421         if(!sptr) {
422                 ASN__CTFAIL(app_key, td, sptr,
423                         "%s: value not given (%s:%d)",
424                         td->name, __FILE__, __LINE__);
425                 return -1;
426         }
427         
428         value = *(const long *)sptr;
429         
430         if((value >= 1 && value <= 255)) {
431                 /* Constraint check succeeded */
432                 return 0;
433         } else {
434                 ASN__CTFAIL(app_key, td, sptr,
435                         "%s: constraint failed (%s:%d)",
436                         td->name, __FILE__, __LINE__);
437                 return -1;
438         }
439 }
440
441 /*
442  * This type is implemented using NativeInteger,
443  * so here we adjust the DEF accordingly.
444  */
445
446 /*** <<< CTDEFS [ExtensibleExtensions] >>> ***/
447
448 static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 CC_NOTUSED = {
449         { APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  255 }  /* (1..255,...) */,
450         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
451         0, 0    /* No PER value map */
452 };
453
454 /*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
455
456 static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
457         (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
458 };
459 asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
460         "ExtensibleExtensions",
461         "ExtensibleExtensions",
462         &asn_OP_NativeInteger,
463         asn_DEF_ExtensibleExtensions_tags_1,
464         sizeof(asn_DEF_ExtensibleExtensions_tags_1)
465                 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
466         asn_DEF_ExtensibleExtensions_tags_1,    /* Same as above */
467         sizeof(asn_DEF_ExtensibleExtensions_tags_1)
468                 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
469         { 0, &asn_PER_type_ExtensibleExtensions_constr_1, ExtensibleExtensions_constraint },
470         0, 0,   /* No members */
471         0       /* No specifics */
472 };
473
474
475 /*** <<< INCLUDES [Str1] >>> ***/
476
477 #include <IA5String.h>
478
479 /*** <<< TYPE-DECLS [Str1] >>> ***/
480
481 typedef IA5String_t      Str1_t;
482
483 /*** <<< FUNC-DECLS [Str1] >>> ***/
484
485 extern asn_per_constraints_t asn_PER_type_Str1_constr_1;
486 extern asn_TYPE_descriptor_t asn_DEF_Str1;
487 asn_struct_free_f Str1_free;
488 asn_struct_print_f Str1_print;
489 asn_constr_check_f Str1_constraint;
490 ber_type_decoder_f Str1_decode_ber;
491 der_type_encoder_f Str1_encode_der;
492 xer_type_decoder_f Str1_decode_xer;
493 xer_type_encoder_f Str1_encode_xer;
494 per_type_decoder_f Str1_decode_uper;
495 per_type_encoder_f Str1_encode_uper;
496 per_type_decoder_f Str1_decode_aper;
497 per_type_encoder_f Str1_encode_aper;
498
499 /*** <<< CODE [Str1] >>> ***/
500
501 /*
502  * This type is implemented using IA5String,
503  * so here we adjust the DEF accordingly.
504  */
505
506 /*** <<< CTDEFS [Str1] >>> ***/
507
508 asn_per_constraints_t asn_PER_type_Str1_constr_1 CC_NOTUSED = {
509         { APC_CONSTRAINED,       7,  7,  0,  127 }      /* (0..127) */,
510         { APC_SEMI_CONSTRAINED, -1, -1,  0,  0 }        /* (SIZE(0..MAX)) */,
511         0, 0    /* No PER character map necessary */
512 };
513
514 /*** <<< STAT-DEFS [Str1] >>> ***/
515
516 static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
517         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
518 };
519 asn_TYPE_descriptor_t asn_DEF_Str1 = {
520         "Str1",
521         "Str1",
522         &asn_OP_IA5String,
523         asn_DEF_Str1_tags_1,
524         sizeof(asn_DEF_Str1_tags_1)
525                 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
526         asn_DEF_Str1_tags_1,    /* Same as above */
527         sizeof(asn_DEF_Str1_tags_1)
528                 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
529         { 0, &asn_PER_type_Str1_constr_1, IA5String_constraint },
530         0, 0,   /* No members */
531         0       /* No specifics */
532 };
533
534
535 /*** <<< INCLUDES [Str2] >>> ***/
536
537 #include "Str1.h"
538
539 /*** <<< TYPE-DECLS [Str2] >>> ***/
540
541 typedef Str1_t   Str2_t;
542
543 /*** <<< FUNC-DECLS [Str2] >>> ***/
544
545 extern asn_per_constraints_t asn_PER_type_Str2_constr_1;
546 extern asn_TYPE_descriptor_t asn_DEF_Str2;
547 asn_struct_free_f Str2_free;
548 asn_struct_print_f Str2_print;
549 asn_constr_check_f Str2_constraint;
550 ber_type_decoder_f Str2_decode_ber;
551 der_type_encoder_f Str2_encode_der;
552 xer_type_decoder_f Str2_decode_xer;
553 xer_type_encoder_f Str2_encode_xer;
554 per_type_decoder_f Str2_decode_uper;
555 per_type_encoder_f Str2_encode_uper;
556 per_type_decoder_f Str2_decode_aper;
557 per_type_encoder_f Str2_encode_aper;
558
559 /*** <<< CTABLES [Str2] >>> ***/
560
561 static int check_permitted_alphabet_1(const void *sptr) {
562         /* The underlying type is IA5String */
563         const IA5String_t *st = (const IA5String_t *)sptr;
564         const uint8_t *ch = st->buf;
565         const uint8_t *end = ch + st->size;
566         
567         for(; ch < end; ch++) {
568                 uint8_t cv = *ch;
569                 if(!(cv <= 127)) return -1;
570         }
571         return 0;
572 }
573
574
575 /*** <<< CODE [Str2] >>> ***/
576
577 int
578 Str2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
579                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
580         const Str1_t *st = (const Str1_t *)sptr;
581         size_t size;
582         
583         if(!sptr) {
584                 ASN__CTFAIL(app_key, td, sptr,
585                         "%s: value not given (%s:%d)",
586                         td->name, __FILE__, __LINE__);
587                 return -1;
588         }
589         
590         size = st->size;
591         
592         if(((size <= 20) || (size >= 25 && size <= 30))
593                  && !check_permitted_alphabet_1(st)) {
594                 /* Constraint check succeeded */
595                 return 0;
596         } else {
597                 ASN__CTFAIL(app_key, td, sptr,
598                         "%s: constraint failed (%s:%d)",
599                         td->name, __FILE__, __LINE__);
600                 return -1;
601         }
602 }
603
604 /*
605  * This type is implemented using Str1,
606  * so here we adjust the DEF accordingly.
607  */
608
609 /*** <<< CTDEFS [Str2] >>> ***/
610
611 asn_per_constraints_t asn_PER_type_Str2_constr_1 CC_NOTUSED = {
612         { APC_CONSTRAINED,       7,  7,  0,  127 }      /* (0..127) */,
613         { APC_CONSTRAINED,       5,  5,  0,  30 }       /* (SIZE(0..30)) */,
614         0, 0    /* No PER character map necessary */
615 };
616
617 /*** <<< STAT-DEFS [Str2] >>> ***/
618
619 static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
620         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
621 };
622 asn_TYPE_descriptor_t asn_DEF_Str2 = {
623         "Str2",
624         "Str2",
625         &asn_OP_IA5String,
626         asn_DEF_Str2_tags_1,
627         sizeof(asn_DEF_Str2_tags_1)
628                 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
629         asn_DEF_Str2_tags_1,    /* Same as above */
630         sizeof(asn_DEF_Str2_tags_1)
631                 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
632         { 0, &asn_PER_type_Str2_constr_1, Str2_constraint },
633         0, 0,   /* No members */
634         0       /* No specifics */
635 };
636
637
638 /*** <<< INCLUDES [Str3] >>> ***/
639
640 #include "Str2.h"
641
642 /*** <<< TYPE-DECLS [Str3] >>> ***/
643
644 typedef Str2_t   Str3_t;
645
646 /*** <<< FUNC-DECLS [Str3] >>> ***/
647
648 extern asn_TYPE_descriptor_t asn_DEF_Str3;
649 asn_struct_free_f Str3_free;
650 asn_struct_print_f Str3_print;
651 asn_constr_check_f Str3_constraint;
652 ber_type_decoder_f Str3_decode_ber;
653 der_type_encoder_f Str3_encode_der;
654 xer_type_decoder_f Str3_decode_xer;
655 xer_type_encoder_f Str3_encode_xer;
656 per_type_decoder_f Str3_decode_uper;
657 per_type_encoder_f Str3_encode_uper;
658 per_type_decoder_f Str3_decode_aper;
659 per_type_encoder_f Str3_encode_aper;
660
661 /*** <<< CTABLES [Str3] >>> ***/
662
663 static const int permitted_alphabet_table_1[256] = {
664  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
665  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
666  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
667  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
668  0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*  ABC             */
669  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
670  0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*     def          */
671 };
672 static const int permitted_alphabet_code2value_1[6] = {
673 65,66,67,100,101,102,};
674
675
676 static int check_permitted_alphabet_1(const void *sptr) {
677         const int *table = permitted_alphabet_table_1;
678         /* The underlying type is IA5String */
679         const IA5String_t *st = (const IA5String_t *)sptr;
680         const uint8_t *ch = st->buf;
681         const uint8_t *end = ch + st->size;
682         
683         for(; ch < end; ch++) {
684                 uint8_t cv = *ch;
685                 if(!table[cv]) return -1;
686         }
687         return 0;
688 }
689
690
691 /*** <<< CODE [Str3] >>> ***/
692
693 int
694 Str3_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
695                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
696         const Str2_t *st = (const Str2_t *)sptr;
697         size_t size;
698         
699         if(!sptr) {
700                 ASN__CTFAIL(app_key, td, sptr,
701                         "%s: value not given (%s:%d)",
702                         td->name, __FILE__, __LINE__);
703                 return -1;
704         }
705         
706         size = st->size;
707         
708         if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
709                  && !check_permitted_alphabet_1(st)) {
710                 /* Constraint check succeeded */
711                 return 0;
712         } else {
713                 ASN__CTFAIL(app_key, td, sptr,
714                         "%s: constraint failed (%s:%d)",
715                         td->name, __FILE__, __LINE__);
716                 return -1;
717         }
718 }
719
720 static int asn_PER_MAP_Str3_1_v2c(unsigned int value) {
721         if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
722                 return -1;
723         return permitted_alphabet_table_1[value] - 1;
724 }
725 static int asn_PER_MAP_Str3_1_c2v(unsigned int code) {
726         if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
727                 return -1;
728         return permitted_alphabet_code2value_1[code];
729 }
730 /*
731  * This type is implemented using Str2,
732  * so here we adjust the DEF accordingly.
733  */
734
735 /*** <<< CTDEFS [Str3] >>> ***/
736
737 static asn_per_constraints_t asn_PER_type_Str3_constr_1 CC_NOTUSED = {
738         { APC_CONSTRAINED,       3,  3,  65,  102 }     /* (65..102) */,
739         { APC_CONSTRAINED,       5,  5,  10,  27 }      /* (SIZE(10..27)) */,
740         asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */
741         asn_PER_MAP_Str3_1_c2v  /* PER code to value map */
742 };
743
744 /*** <<< STAT-DEFS [Str3] >>> ***/
745
746 static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
747         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
748 };
749 asn_TYPE_descriptor_t asn_DEF_Str3 = {
750         "Str3",
751         "Str3",
752         &asn_OP_IA5String,
753         asn_DEF_Str3_tags_1,
754         sizeof(asn_DEF_Str3_tags_1)
755                 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
756         asn_DEF_Str3_tags_1,    /* Same as above */
757         sizeof(asn_DEF_Str3_tags_1)
758                 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
759         { 0, &asn_PER_type_Str3_constr_1, Str3_constraint },
760         0, 0,   /* No members */
761         0       /* No specifics */
762 };
763
764
765 /*** <<< INCLUDES [Str4] >>> ***/
766
767 #include <IA5String.h>
768
769 /*** <<< TYPE-DECLS [Str4] >>> ***/
770
771 typedef IA5String_t      Str4_t;
772
773 /*** <<< FUNC-DECLS [Str4] >>> ***/
774
775 extern asn_TYPE_descriptor_t asn_DEF_Str4;
776 asn_struct_free_f Str4_free;
777 asn_struct_print_f Str4_print;
778 asn_constr_check_f Str4_constraint;
779 ber_type_decoder_f Str4_decode_ber;
780 der_type_encoder_f Str4_encode_der;
781 xer_type_decoder_f Str4_decode_xer;
782 xer_type_encoder_f Str4_encode_xer;
783 per_type_decoder_f Str4_decode_uper;
784 per_type_encoder_f Str4_encode_uper;
785 per_type_decoder_f Str4_decode_aper;
786 per_type_encoder_f Str4_encode_aper;
787
788 /*** <<< CTABLES [Str4] >>> ***/
789
790 static int check_permitted_alphabet_1(const void *sptr) {
791         /* The underlying type is IA5String */
792         const IA5String_t *st = (const IA5String_t *)sptr;
793         const uint8_t *ch = st->buf;
794         const uint8_t *end = ch + st->size;
795         
796         for(; ch < end; ch++) {
797                 uint8_t cv = *ch;
798                 if(!(cv <= 127)) return -1;
799         }
800         return 0;
801 }
802
803
804 /*** <<< CODE [Str4] >>> ***/
805
806 int
807 Str4_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
808                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
809         const IA5String_t *st = (const IA5String_t *)sptr;
810         
811         if(!sptr) {
812                 ASN__CTFAIL(app_key, td, sptr,
813                         "%s: value not given (%s:%d)",
814                         td->name, __FILE__, __LINE__);
815                 return -1;
816         }
817         
818         
819         if(!check_permitted_alphabet_1(st)) {
820                 /* Constraint check succeeded */
821                 return 0;
822         } else {
823                 ASN__CTFAIL(app_key, td, sptr,
824                         "%s: constraint failed (%s:%d)",
825                         td->name, __FILE__, __LINE__);
826                 return -1;
827         }
828 }
829
830 /*
831  * This type is implemented using IA5String,
832  * so here we adjust the DEF accordingly.
833  */
834
835 /*** <<< CTDEFS [Str4] >>> ***/
836
837 static asn_per_constraints_t asn_PER_type_Str4_constr_1 CC_NOTUSED = {
838         { APC_CONSTRAINED,       7,  7,  0,  127 }      /* (0..127) */,
839         { APC_SEMI_CONSTRAINED, -1, -1,  0,  0 }        /* (SIZE(0..MAX)) */,
840         0, 0    /* No PER character map necessary */
841 };
842
843 /*** <<< STAT-DEFS [Str4] >>> ***/
844
845 static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
846         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
847 };
848 asn_TYPE_descriptor_t asn_DEF_Str4 = {
849         "Str4",
850         "Str4",
851         &asn_OP_IA5String,
852         asn_DEF_Str4_tags_1,
853         sizeof(asn_DEF_Str4_tags_1)
854                 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
855         asn_DEF_Str4_tags_1,    /* Same as above */
856         sizeof(asn_DEF_Str4_tags_1)
857                 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
858         { 0, &asn_PER_type_Str4_constr_1, Str4_constraint },
859         0, 0,   /* No members */
860         0       /* No specifics */
861 };
862
863
864 /*** <<< INCLUDES [PER-Visible] >>> ***/
865
866 #include <IA5String.h>
867
868 /*** <<< TYPE-DECLS [PER-Visible] >>> ***/
869
870 typedef IA5String_t      PER_Visible_t;
871
872 /*** <<< FUNC-DECLS [PER-Visible] >>> ***/
873
874 extern asn_per_constraints_t asn_PER_type_PER_Visible_constr_1;
875 extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
876 asn_struct_free_f PER_Visible_free;
877 asn_struct_print_f PER_Visible_print;
878 asn_constr_check_f PER_Visible_constraint;
879 ber_type_decoder_f PER_Visible_decode_ber;
880 der_type_encoder_f PER_Visible_encode_der;
881 xer_type_decoder_f PER_Visible_decode_xer;
882 xer_type_encoder_f PER_Visible_encode_xer;
883 per_type_decoder_f PER_Visible_decode_uper;
884 per_type_encoder_f PER_Visible_encode_uper;
885 per_type_decoder_f PER_Visible_decode_aper;
886 per_type_encoder_f PER_Visible_encode_aper;
887
888 /*** <<< CTABLES [PER-Visible] >>> ***/
889
890 static int check_permitted_alphabet_1(const void *sptr) {
891         /* The underlying type is IA5String */
892         const IA5String_t *st = (const IA5String_t *)sptr;
893         const uint8_t *ch = st->buf;
894         const uint8_t *end = ch + st->size;
895         
896         for(; ch < end; ch++) {
897                 uint8_t cv = *ch;
898                 if(!(cv >= 65 && cv <= 70)) return -1;
899         }
900         return 0;
901 }
902
903
904 /*** <<< CODE [PER-Visible] >>> ***/
905
906 int
907 PER_Visible_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
908                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
909         const IA5String_t *st = (const IA5String_t *)sptr;
910         
911         if(!sptr) {
912                 ASN__CTFAIL(app_key, td, sptr,
913                         "%s: value not given (%s:%d)",
914                         td->name, __FILE__, __LINE__);
915                 return -1;
916         }
917         
918         
919         if(!check_permitted_alphabet_1(st)) {
920                 /* Constraint check succeeded */
921                 return 0;
922         } else {
923                 ASN__CTFAIL(app_key, td, sptr,
924                         "%s: constraint failed (%s:%d)",
925                         td->name, __FILE__, __LINE__);
926                 return -1;
927         }
928 }
929
930 /*
931  * This type is implemented using IA5String,
932  * so here we adjust the DEF accordingly.
933  */
934
935 /*** <<< CTDEFS [PER-Visible] >>> ***/
936
937 asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 CC_NOTUSED = {
938         { APC_CONSTRAINED,       3,  3,  65,  70 }      /* (65..70) */,
939         { APC_SEMI_CONSTRAINED, -1, -1,  0,  0 }        /* (SIZE(0..MAX)) */,
940         0, 0    /* No PER character map necessary */
941 };
942
943 /*** <<< STAT-DEFS [PER-Visible] >>> ***/
944
945 static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
946         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
947 };
948 asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
949         "PER-Visible",
950         "PER-Visible",
951         &asn_OP_IA5String,
952         asn_DEF_PER_Visible_tags_1,
953         sizeof(asn_DEF_PER_Visible_tags_1)
954                 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
955         asn_DEF_PER_Visible_tags_1,     /* Same as above */
956         sizeof(asn_DEF_PER_Visible_tags_1)
957                 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
958         { 0, &asn_PER_type_PER_Visible_constr_1, PER_Visible_constraint },
959         0, 0,   /* No members */
960         0       /* No specifics */
961 };
962
963
964 /*** <<< INCLUDES [PER-Visible-2] >>> ***/
965
966 #include "PER-Visible.h"
967
968 /*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
969
970 typedef PER_Visible_t    PER_Visible_2_t;
971
972 /*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
973
974 extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
975 asn_struct_free_f PER_Visible_2_free;
976 asn_struct_print_f PER_Visible_2_print;
977 asn_constr_check_f PER_Visible_2_constraint;
978 ber_type_decoder_f PER_Visible_2_decode_ber;
979 der_type_encoder_f PER_Visible_2_encode_der;
980 xer_type_decoder_f PER_Visible_2_decode_xer;
981 xer_type_encoder_f PER_Visible_2_encode_xer;
982 per_type_decoder_f PER_Visible_2_decode_uper;
983 per_type_encoder_f PER_Visible_2_encode_uper;
984 per_type_decoder_f PER_Visible_2_decode_aper;
985 per_type_encoder_f PER_Visible_2_encode_aper;
986
987 /*** <<< CTABLES [PER-Visible-2] >>> ***/
988
989 static int check_permitted_alphabet_1(const void *sptr) {
990         /* The underlying type is IA5String */
991         const IA5String_t *st = (const IA5String_t *)sptr;
992         const uint8_t *ch = st->buf;
993         const uint8_t *end = ch + st->size;
994         
995         for(; ch < end; ch++) {
996                 uint8_t cv = *ch;
997                 if(!(cv >= 69 && cv <= 70)) return -1;
998         }
999         return 0;
1000 }
1001
1002
1003 /*** <<< CODE [PER-Visible-2] >>> ***/
1004
1005 int
1006 PER_Visible_2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1007                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1008         const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1009         
1010         if(!sptr) {
1011                 ASN__CTFAIL(app_key, td, sptr,
1012                         "%s: value not given (%s:%d)",
1013                         td->name, __FILE__, __LINE__);
1014                 return -1;
1015         }
1016         
1017         
1018         if(!check_permitted_alphabet_1(st)) {
1019                 /* Constraint check succeeded */
1020                 return 0;
1021         } else {
1022                 ASN__CTFAIL(app_key, td, sptr,
1023                         "%s: constraint failed (%s:%d)",
1024                         td->name, __FILE__, __LINE__);
1025                 return -1;
1026         }
1027 }
1028
1029 /*
1030  * This type is implemented using PER_Visible,
1031  * so here we adjust the DEF accordingly.
1032  */
1033
1034 /*** <<< CTDEFS [PER-Visible-2] >>> ***/
1035
1036 static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 CC_NOTUSED = {
1037         { APC_CONSTRAINED,       1,  1,  69,  70 }      /* (69..70) */,
1038         { APC_SEMI_CONSTRAINED, -1, -1,  0,  0 }        /* (SIZE(0..MAX)) */,
1039         0, 0    /* No PER character map necessary */
1040 };
1041
1042 /*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
1043
1044 static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
1045         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1046 };
1047 asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
1048         "PER-Visible-2",
1049         "PER-Visible-2",
1050         &asn_OP_IA5String,
1051         asn_DEF_PER_Visible_2_tags_1,
1052         sizeof(asn_DEF_PER_Visible_2_tags_1)
1053                 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
1054         asn_DEF_PER_Visible_2_tags_1,   /* Same as above */
1055         sizeof(asn_DEF_PER_Visible_2_tags_1)
1056                 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
1057         { 0, &asn_PER_type_PER_Visible_2_constr_1, PER_Visible_2_constraint },
1058         0, 0,   /* No members */
1059         0       /* No specifics */
1060 };
1061
1062
1063 /*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
1064
1065 #include "PER-Visible.h"
1066
1067 /*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
1068
1069 typedef PER_Visible_t    Not_PER_Visible_1_t;
1070
1071 /*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
1072
1073 extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
1074 asn_struct_free_f Not_PER_Visible_1_free;
1075 asn_struct_print_f Not_PER_Visible_1_print;
1076 asn_constr_check_f Not_PER_Visible_1_constraint;
1077 ber_type_decoder_f Not_PER_Visible_1_decode_ber;
1078 der_type_encoder_f Not_PER_Visible_1_encode_der;
1079 xer_type_decoder_f Not_PER_Visible_1_decode_xer;
1080 xer_type_encoder_f Not_PER_Visible_1_encode_xer;
1081 per_type_decoder_f Not_PER_Visible_1_decode_uper;
1082 per_type_encoder_f Not_PER_Visible_1_encode_uper;
1083 per_type_decoder_f Not_PER_Visible_1_decode_aper;
1084 per_type_encoder_f Not_PER_Visible_1_encode_aper;
1085
1086 /*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
1087
1088 static int check_permitted_alphabet_1(const void *sptr) {
1089         /* The underlying type is IA5String */
1090         const IA5String_t *st = (const IA5String_t *)sptr;
1091         const uint8_t *ch = st->buf;
1092         const uint8_t *end = ch + st->size;
1093         
1094         for(; ch < end; ch++) {
1095                 uint8_t cv = *ch;
1096                 if(!(cv >= 65 && cv <= 70)) return -1;
1097         }
1098         return 0;
1099 }
1100
1101
1102 /*** <<< CODE [Not-PER-Visible-1] >>> ***/
1103
1104 int
1105 Not_PER_Visible_1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1106                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1107         const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1108         
1109         if(!sptr) {
1110                 ASN__CTFAIL(app_key, td, sptr,
1111                         "%s: value not given (%s:%d)",
1112                         td->name, __FILE__, __LINE__);
1113                 return -1;
1114         }
1115         
1116         
1117         if(!check_permitted_alphabet_1(st)) {
1118                 /* Constraint check succeeded */
1119                 return 0;
1120         } else {
1121                 ASN__CTFAIL(app_key, td, sptr,
1122                         "%s: constraint failed (%s:%d)",
1123                         td->name, __FILE__, __LINE__);
1124                 return -1;
1125         }
1126 }
1127
1128 /*
1129  * This type is implemented using PER_Visible,
1130  * so here we adjust the DEF accordingly.
1131  */
1132
1133 /*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/
1134
1135 static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 CC_NOTUSED = {
1136         { APC_CONSTRAINED,       3,  3,  65,  70 }      /* (65..70) */,
1137         { APC_SEMI_CONSTRAINED, -1, -1,  0,  0 }        /* (SIZE(0..MAX)) */,
1138         0, 0    /* No PER character map necessary */
1139 };
1140
1141 /*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
1142
1143 static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
1144         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1145 };
1146 asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
1147         "Not-PER-Visible-1",
1148         "Not-PER-Visible-1",
1149         &asn_OP_IA5String,
1150         asn_DEF_Not_PER_Visible_1_tags_1,
1151         sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1152                 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
1153         asn_DEF_Not_PER_Visible_1_tags_1,       /* Same as above */
1154         sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1155                 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
1156         { 0, &asn_PER_type_Not_PER_Visible_1_constr_1, Not_PER_Visible_1_constraint },
1157         0, 0,   /* No members */
1158         0       /* No specifics */
1159 };
1160
1161
1162 /*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
1163
1164 #include "PER-Visible.h"
1165
1166 /*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
1167
1168 typedef PER_Visible_t    Not_PER_Visible_2_t;
1169
1170 /*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
1171
1172 extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
1173 asn_struct_free_f Not_PER_Visible_2_free;
1174 asn_struct_print_f Not_PER_Visible_2_print;
1175 asn_constr_check_f Not_PER_Visible_2_constraint;
1176 ber_type_decoder_f Not_PER_Visible_2_decode_ber;
1177 der_type_encoder_f Not_PER_Visible_2_encode_der;
1178 xer_type_decoder_f Not_PER_Visible_2_decode_xer;
1179 xer_type_encoder_f Not_PER_Visible_2_encode_xer;
1180 per_type_decoder_f Not_PER_Visible_2_decode_uper;
1181 per_type_encoder_f Not_PER_Visible_2_encode_uper;
1182 per_type_decoder_f Not_PER_Visible_2_decode_aper;
1183 per_type_encoder_f Not_PER_Visible_2_encode_aper;
1184
1185 /*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
1186
1187 static int check_permitted_alphabet_1(const void *sptr) {
1188         /* The underlying type is IA5String */
1189         const IA5String_t *st = (const IA5String_t *)sptr;
1190         const uint8_t *ch = st->buf;
1191         const uint8_t *end = ch + st->size;
1192         
1193         for(; ch < end; ch++) {
1194                 uint8_t cv = *ch;
1195                 if(!(cv >= 65 && cv <= 66)) return -1;
1196         }
1197         return 0;
1198 }
1199
1200
1201 /*** <<< CODE [Not-PER-Visible-2] >>> ***/
1202
1203 int
1204 Not_PER_Visible_2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1205                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1206         const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1207         
1208         if(!sptr) {
1209                 ASN__CTFAIL(app_key, td, sptr,
1210                         "%s: value not given (%s:%d)",
1211                         td->name, __FILE__, __LINE__);
1212                 return -1;
1213         }
1214         
1215         
1216         if(!check_permitted_alphabet_1(st)) {
1217                 /* Constraint check succeeded */
1218                 return 0;
1219         } else {
1220                 ASN__CTFAIL(app_key, td, sptr,
1221                         "%s: constraint failed (%s:%d)",
1222                         td->name, __FILE__, __LINE__);
1223                 return -1;
1224         }
1225 }
1226
1227 /*
1228  * This type is implemented using PER_Visible,
1229  * so here we adjust the DEF accordingly.
1230  */
1231
1232 /*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/
1233
1234 static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 CC_NOTUSED = {
1235         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
1236         { APC_SEMI_CONSTRAINED, -1, -1,  0,  0 }        /* (SIZE(0..MAX)) */,
1237         0, 0    /* No PER character map necessary */
1238 };
1239
1240 /*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
1241
1242 static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
1243         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1244 };
1245 asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
1246         "Not-PER-Visible-2",
1247         "Not-PER-Visible-2",
1248         &asn_OP_IA5String,
1249         asn_DEF_Not_PER_Visible_2_tags_1,
1250         sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1251                 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
1252         asn_DEF_Not_PER_Visible_2_tags_1,       /* Same as above */
1253         sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1254                 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
1255         { 0, &asn_PER_type_Not_PER_Visible_2_constr_1, Not_PER_Visible_2_constraint },
1256         0, 0,   /* No members */
1257         0       /* No specifics */
1258 };
1259
1260
1261 /*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
1262
1263 #include "PER-Visible.h"
1264
1265 /*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
1266
1267 typedef PER_Visible_t    Not_PER_Visible_3_t;
1268
1269 /*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
1270
1271 extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
1272 asn_struct_free_f Not_PER_Visible_3_free;
1273 asn_struct_print_f Not_PER_Visible_3_print;
1274 asn_constr_check_f Not_PER_Visible_3_constraint;
1275 ber_type_decoder_f Not_PER_Visible_3_decode_ber;
1276 der_type_encoder_f Not_PER_Visible_3_encode_der;
1277 xer_type_decoder_f Not_PER_Visible_3_decode_xer;
1278 xer_type_encoder_f Not_PER_Visible_3_encode_xer;
1279 per_type_decoder_f Not_PER_Visible_3_decode_uper;
1280 per_type_encoder_f Not_PER_Visible_3_encode_uper;
1281 per_type_decoder_f Not_PER_Visible_3_decode_aper;
1282 per_type_encoder_f Not_PER_Visible_3_encode_aper;
1283
1284 /*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
1285
1286 static int check_permitted_alphabet_1(const void *sptr) {
1287         /* The underlying type is IA5String */
1288         const IA5String_t *st = (const IA5String_t *)sptr;
1289         const uint8_t *ch = st->buf;
1290         const uint8_t *end = ch + st->size;
1291         
1292         for(; ch < end; ch++) {
1293                 uint8_t cv = *ch;
1294                 if(!(cv >= 65 && cv <= 66)) return -1;
1295         }
1296         return 0;
1297 }
1298
1299
1300 /*** <<< CODE [Not-PER-Visible-3] >>> ***/
1301
1302 int
1303 Not_PER_Visible_3_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1304                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1305         const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1306         
1307         if(!sptr) {
1308                 ASN__CTFAIL(app_key, td, sptr,
1309                         "%s: value not given (%s:%d)",
1310                         td->name, __FILE__, __LINE__);
1311                 return -1;
1312         }
1313         
1314         
1315         if(!check_permitted_alphabet_1(st)) {
1316                 /* Constraint check succeeded */
1317                 return 0;
1318         } else {
1319                 ASN__CTFAIL(app_key, td, sptr,
1320                         "%s: constraint failed (%s:%d)",
1321                         td->name, __FILE__, __LINE__);
1322                 return -1;
1323         }
1324 }
1325
1326 /*
1327  * This type is implemented using PER_Visible,
1328  * so here we adjust the DEF accordingly.
1329  */
1330
1331 /*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/
1332
1333 static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 CC_NOTUSED = {
1334         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
1335         { APC_SEMI_CONSTRAINED, -1, -1,  0,  0 }        /* (SIZE(0..MAX)) */,
1336         0, 0    /* No PER character map necessary */
1337 };
1338
1339 /*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
1340
1341 static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
1342         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1343 };
1344 asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
1345         "Not-PER-Visible-3",
1346         "Not-PER-Visible-3",
1347         &asn_OP_IA5String,
1348         asn_DEF_Not_PER_Visible_3_tags_1,
1349         sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1350                 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
1351         asn_DEF_Not_PER_Visible_3_tags_1,       /* Same as above */
1352         sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1353                 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
1354         { 0, &asn_PER_type_Not_PER_Visible_3_constr_1, Not_PER_Visible_3_constraint },
1355         0, 0,   /* No members */
1356         0       /* No specifics */
1357 };
1358
1359
1360 /*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
1361
1362 #include "PER-Visible.h"
1363
1364 /*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
1365
1366 typedef PER_Visible_t    SIZE_but_not_FROM_t;
1367
1368 /*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
1369
1370 extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
1371 asn_struct_free_f SIZE_but_not_FROM_free;
1372 asn_struct_print_f SIZE_but_not_FROM_print;
1373 asn_constr_check_f SIZE_but_not_FROM_constraint;
1374 ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
1375 der_type_encoder_f SIZE_but_not_FROM_encode_der;
1376 xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
1377 xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
1378 per_type_decoder_f SIZE_but_not_FROM_decode_uper;
1379 per_type_encoder_f SIZE_but_not_FROM_encode_uper;
1380 per_type_decoder_f SIZE_but_not_FROM_decode_aper;
1381 per_type_encoder_f SIZE_but_not_FROM_encode_aper;
1382
1383 /*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
1384
1385 static int check_permitted_alphabet_1(const void *sptr) {
1386         /* The underlying type is IA5String */
1387         const IA5String_t *st = (const IA5String_t *)sptr;
1388         const uint8_t *ch = st->buf;
1389         const uint8_t *end = ch + st->size;
1390         
1391         for(; ch < end; ch++) {
1392                 uint8_t cv = *ch;
1393                 if(!(cv >= 65 && cv <= 68)) return -1;
1394         }
1395         return 0;
1396 }
1397
1398
1399 /*** <<< CODE [SIZE-but-not-FROM] >>> ***/
1400
1401 int
1402 SIZE_but_not_FROM_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1403                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1404         const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1405         size_t size;
1406         
1407         if(!sptr) {
1408                 ASN__CTFAIL(app_key, td, sptr,
1409                         "%s: value not given (%s:%d)",
1410                         td->name, __FILE__, __LINE__);
1411                 return -1;
1412         }
1413         
1414         size = st->size;
1415         
1416         if((size >= 1 && size <= 4)
1417                  && !check_permitted_alphabet_1(st)) {
1418                 /* Constraint check succeeded */
1419                 return 0;
1420         } else {
1421                 ASN__CTFAIL(app_key, td, sptr,
1422                         "%s: constraint failed (%s:%d)",
1423                         td->name, __FILE__, __LINE__);
1424                 return -1;
1425         }
1426 }
1427
1428 /*
1429  * This type is implemented using PER_Visible,
1430  * so here we adjust the DEF accordingly.
1431  */
1432
1433 /*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/
1434
1435 static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 CC_NOTUSED = {
1436         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
1437         { APC_CONSTRAINED,       2,  2,  1,  4 }        /* (SIZE(1..4)) */,
1438         0, 0    /* No PER character map necessary */
1439 };
1440
1441 /*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
1442
1443 static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
1444         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1445 };
1446 asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
1447         "SIZE-but-not-FROM",
1448         "SIZE-but-not-FROM",
1449         &asn_OP_IA5String,
1450         asn_DEF_SIZE_but_not_FROM_tags_1,
1451         sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1452                 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
1453         asn_DEF_SIZE_but_not_FROM_tags_1,       /* Same as above */
1454         sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1455                 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
1456         { 0, &asn_PER_type_SIZE_but_not_FROM_constr_1, SIZE_but_not_FROM_constraint },
1457         0, 0,   /* No members */
1458         0       /* No specifics */
1459 };
1460
1461
1462 /*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
1463
1464 #include "PER-Visible.h"
1465
1466 /*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
1467
1468 typedef PER_Visible_t    SIZE_and_FROM_t;
1469
1470 /*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
1471
1472 extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
1473 asn_struct_free_f SIZE_and_FROM_free;
1474 asn_struct_print_f SIZE_and_FROM_print;
1475 asn_constr_check_f SIZE_and_FROM_constraint;
1476 ber_type_decoder_f SIZE_and_FROM_decode_ber;
1477 der_type_encoder_f SIZE_and_FROM_encode_der;
1478 xer_type_decoder_f SIZE_and_FROM_decode_xer;
1479 xer_type_encoder_f SIZE_and_FROM_encode_xer;
1480 per_type_decoder_f SIZE_and_FROM_decode_uper;
1481 per_type_encoder_f SIZE_and_FROM_encode_uper;
1482 per_type_decoder_f SIZE_and_FROM_decode_aper;
1483 per_type_encoder_f SIZE_and_FROM_encode_aper;
1484
1485 /*** <<< CTABLES [SIZE-and-FROM] >>> ***/
1486
1487 static int check_permitted_alphabet_1(const void *sptr) {
1488         /* The underlying type is IA5String */
1489         const IA5String_t *st = (const IA5String_t *)sptr;
1490         const uint8_t *ch = st->buf;
1491         const uint8_t *end = ch + st->size;
1492         
1493         for(; ch < end; ch++) {
1494                 uint8_t cv = *ch;
1495                 if(!(cv >= 65 && cv <= 68)) return -1;
1496         }
1497         return 0;
1498 }
1499
1500
1501 /*** <<< CODE [SIZE-and-FROM] >>> ***/
1502
1503 int
1504 SIZE_and_FROM_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1505                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1506         const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1507         size_t size;
1508         
1509         if(!sptr) {
1510                 ASN__CTFAIL(app_key, td, sptr,
1511                         "%s: value not given (%s:%d)",
1512                         td->name, __FILE__, __LINE__);
1513                 return -1;
1514         }
1515         
1516         size = st->size;
1517         
1518         if((size >= 1 && size <= 4)
1519                  && !check_permitted_alphabet_1(st)) {
1520                 /* Constraint check succeeded */
1521                 return 0;
1522         } else {
1523                 ASN__CTFAIL(app_key, td, sptr,
1524                         "%s: constraint failed (%s:%d)",
1525                         td->name, __FILE__, __LINE__);
1526                 return -1;
1527         }
1528 }
1529
1530 /*
1531  * This type is implemented using PER_Visible,
1532  * so here we adjust the DEF accordingly.
1533  */
1534
1535 /*** <<< CTDEFS [SIZE-and-FROM] >>> ***/
1536
1537 static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 CC_NOTUSED = {
1538         { APC_CONSTRAINED,       2,  2,  65,  68 }      /* (65..68) */,
1539         { APC_CONSTRAINED,       2,  2,  1,  4 }        /* (SIZE(1..4)) */,
1540         0, 0    /* No PER character map necessary */
1541 };
1542
1543 /*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
1544
1545 static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
1546         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1547 };
1548 asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
1549         "SIZE-and-FROM",
1550         "SIZE-and-FROM",
1551         &asn_OP_IA5String,
1552         asn_DEF_SIZE_and_FROM_tags_1,
1553         sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1554                 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
1555         asn_DEF_SIZE_and_FROM_tags_1,   /* Same as above */
1556         sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1557                 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
1558         { 0, &asn_PER_type_SIZE_and_FROM_constr_1, SIZE_and_FROM_constraint },
1559         0, 0,   /* No members */
1560         0       /* No specifics */
1561 };
1562
1563
1564 /*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
1565
1566 #include "PER-Visible.h"
1567
1568 /*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1569
1570 typedef PER_Visible_t    Neither_SIZE_nor_FROM_t;
1571
1572 /*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1573
1574 extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
1575 asn_struct_free_f Neither_SIZE_nor_FROM_free;
1576 asn_struct_print_f Neither_SIZE_nor_FROM_print;
1577 asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
1578 ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
1579 der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
1580 xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
1581 xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
1582 per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
1583 per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
1584 per_type_decoder_f Neither_SIZE_nor_FROM_decode_aper;
1585 per_type_encoder_f Neither_SIZE_nor_FROM_encode_aper;
1586
1587 /*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
1588
1589 static int check_permitted_alphabet_1(const void *sptr) {
1590         /* The underlying type is IA5String */
1591         const IA5String_t *st = (const IA5String_t *)sptr;
1592         const uint8_t *ch = st->buf;
1593         const uint8_t *end = ch + st->size;
1594         
1595         for(; ch < end; ch++) {
1596                 uint8_t cv = *ch;
1597                 if(!(cv >= 65 && cv <= 70)) return -1;
1598         }
1599         return 0;
1600 }
1601
1602
1603 /*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
1604
1605 int
1606 Neither_SIZE_nor_FROM_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1607                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1608         const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1609         
1610         if(!sptr) {
1611                 ASN__CTFAIL(app_key, td, sptr,
1612                         "%s: value not given (%s:%d)",
1613                         td->name, __FILE__, __LINE__);
1614                 return -1;
1615         }
1616         
1617         
1618         if(!check_permitted_alphabet_1(st)) {
1619                 /* Constraint check succeeded */
1620                 return 0;
1621         } else {
1622                 ASN__CTFAIL(app_key, td, sptr,
1623                         "%s: constraint failed (%s:%d)",
1624                         td->name, __FILE__, __LINE__);
1625                 return -1;
1626         }
1627 }
1628
1629 /*
1630  * This type is implemented using PER_Visible,
1631  * so here we adjust the DEF accordingly.
1632  */
1633
1634 /*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/
1635
1636 static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 CC_NOTUSED = {
1637         { APC_CONSTRAINED,       3,  3,  65,  70 }      /* (65..70) */,
1638         { APC_SEMI_CONSTRAINED, -1, -1,  0,  0 }        /* (SIZE(0..MAX)) */,
1639         0, 0    /* No PER character map necessary */
1640 };
1641
1642 /*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
1643
1644 static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
1645         (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1646 };
1647 asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
1648         "Neither-SIZE-nor-FROM",
1649         "Neither-SIZE-nor-FROM",
1650         &asn_OP_IA5String,
1651         asn_DEF_Neither_SIZE_nor_FROM_tags_1,
1652         sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1653                 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
1654         asn_DEF_Neither_SIZE_nor_FROM_tags_1,   /* Same as above */
1655         sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1656                 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
1657         { 0, &asn_PER_type_Neither_SIZE_nor_FROM_constr_1, Neither_SIZE_nor_FROM_constraint },
1658         0, 0,   /* No members */
1659         0       /* No specifics */
1660 };
1661
1662
1663 /*** <<< INCLUDES [Utf8-4] >>> ***/
1664
1665 #include <UTF8String.h>
1666
1667 /*** <<< TYPE-DECLS [Utf8-4] >>> ***/
1668
1669 typedef UTF8String_t     Utf8_4_t;
1670
1671 /*** <<< FUNC-DECLS [Utf8-4] >>> ***/
1672
1673 extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
1674 asn_struct_free_f Utf8_4_free;
1675 asn_struct_print_f Utf8_4_print;
1676 asn_constr_check_f Utf8_4_constraint;
1677 ber_type_decoder_f Utf8_4_decode_ber;
1678 der_type_encoder_f Utf8_4_encode_der;
1679 xer_type_decoder_f Utf8_4_decode_xer;
1680 xer_type_encoder_f Utf8_4_encode_xer;
1681 per_type_decoder_f Utf8_4_decode_uper;
1682 per_type_encoder_f Utf8_4_encode_uper;
1683 per_type_decoder_f Utf8_4_decode_aper;
1684 per_type_encoder_f Utf8_4_encode_aper;
1685
1686 /*** <<< CTABLES [Utf8-4] >>> ***/
1687
1688 static int check_permitted_alphabet_1(const void *sptr) {
1689         if(UTF8String_length((const UTF8String_t *)sptr) < 0)
1690                 return -1; /* Alphabet (sic!) test failed. */
1691         
1692         return 0;
1693 }
1694
1695
1696 /*** <<< CODE [Utf8-4] >>> ***/
1697
1698 int
1699 Utf8_4_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1700                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1701         const UTF8String_t *st = (const UTF8String_t *)sptr;
1702         
1703         if(!sptr) {
1704                 ASN__CTFAIL(app_key, td, sptr,
1705                         "%s: value not given (%s:%d)",
1706                         td->name, __FILE__, __LINE__);
1707                 return -1;
1708         }
1709         
1710         
1711         if(!check_permitted_alphabet_1(st)) {
1712                 /* Constraint check succeeded */
1713                 return 0;
1714         } else {
1715                 ASN__CTFAIL(app_key, td, sptr,
1716                         "%s: constraint failed (%s:%d)",
1717                         td->name, __FILE__, __LINE__);
1718                 return -1;
1719         }
1720 }
1721
1722 /*
1723  * This type is implemented using UTF8String,
1724  * so here we adjust the DEF accordingly.
1725  */
1726
1727 /*** <<< CTDEFS [Utf8-4] >>> ***/
1728
1729 static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 CC_NOTUSED = {
1730         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
1731         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
1732         0, 0    /* No PER value map */
1733 };
1734
1735 /*** <<< STAT-DEFS [Utf8-4] >>> ***/
1736
1737 static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
1738         (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
1739 };
1740 asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
1741         "Utf8-4",
1742         "Utf8-4",
1743         &asn_OP_UTF8String,
1744         asn_DEF_Utf8_4_tags_1,
1745         sizeof(asn_DEF_Utf8_4_tags_1)
1746                 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
1747         asn_DEF_Utf8_4_tags_1,  /* Same as above */
1748         sizeof(asn_DEF_Utf8_4_tags_1)
1749                 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
1750         { 0, &asn_PER_type_Utf8_4_constr_1, Utf8_4_constraint },
1751         0, 0,   /* No members */
1752         0       /* No specifics */
1753 };
1754
1755
1756 /*** <<< INCLUDES [Utf8-3] >>> ***/
1757
1758 #include "Utf8-2.h"
1759
1760 /*** <<< TYPE-DECLS [Utf8-3] >>> ***/
1761
1762 typedef Utf8_2_t         Utf8_3_t;
1763
1764 /*** <<< FUNC-DECLS [Utf8-3] >>> ***/
1765
1766 extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
1767 asn_struct_free_f Utf8_3_free;
1768 asn_struct_print_f Utf8_3_print;
1769 asn_constr_check_f Utf8_3_constraint;
1770 ber_type_decoder_f Utf8_3_decode_ber;
1771 der_type_encoder_f Utf8_3_encode_der;
1772 xer_type_decoder_f Utf8_3_decode_xer;
1773 xer_type_encoder_f Utf8_3_encode_xer;
1774 per_type_decoder_f Utf8_3_decode_uper;
1775 per_type_encoder_f Utf8_3_encode_uper;
1776 per_type_decoder_f Utf8_3_decode_aper;
1777 per_type_encoder_f Utf8_3_encode_aper;
1778
1779 /*** <<< CTABLES [Utf8-3] >>> ***/
1780
1781 static const int permitted_alphabet_table_1[128] = {
1782  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
1783  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
1784  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
1785  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
1786  0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,        /*  ABCDEFGHIJKLMNO */
1787 16,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0,        /* PQRSTUVWXYZ      */
1788  0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,        /*  abcdefghijklmno */
1789 42,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0,        /* pqrstuvwxyz      */
1790 };
1791
1792 static int check_permitted_alphabet_1(const void *sptr) {
1793         const int *table = permitted_alphabet_table_1;
1794         /* The underlying type is UTF8String */
1795         const UTF8String_t *st = (const UTF8String_t *)sptr;
1796         const uint8_t *ch = st->buf;
1797         const uint8_t *end = ch + st->size;
1798         
1799         for(; ch < end; ch++) {
1800                 uint8_t cv = *ch;
1801                 if(cv >= 0x80) return -1;
1802                 if(!table[cv]) return -1;
1803         }
1804         return 0;
1805 }
1806
1807
1808 /*** <<< CODE [Utf8-3] >>> ***/
1809
1810 int
1811 Utf8_3_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1812                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1813         const Utf8_2_t *st = (const Utf8_2_t *)sptr;
1814         size_t size;
1815         
1816         if(!sptr) {
1817                 ASN__CTFAIL(app_key, td, sptr,
1818                         "%s: value not given (%s:%d)",
1819                         td->name, __FILE__, __LINE__);
1820                 return -1;
1821         }
1822         
1823         size = UTF8String_length(st);
1824         if((ssize_t)size < 0) {
1825                 ASN__CTFAIL(app_key, td, sptr,
1826                         "%s: UTF-8: broken encoding (%s:%d)",
1827                         td->name, __FILE__, __LINE__);
1828                 return -1;
1829         }
1830         
1831         if((size >= 1 && size <= 2)
1832                  && !check_permitted_alphabet_1(st)) {
1833                 /* Constraint check succeeded */
1834                 return 0;
1835         } else {
1836                 ASN__CTFAIL(app_key, td, sptr,
1837                         "%s: constraint failed (%s:%d)",
1838                         td->name, __FILE__, __LINE__);
1839                 return -1;
1840         }
1841 }
1842
1843 /*
1844  * This type is implemented using Utf8_2,
1845  * so here we adjust the DEF accordingly.
1846  */
1847
1848 /*** <<< CTDEFS [Utf8-3] >>> ***/
1849
1850 static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 CC_NOTUSED = {
1851         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
1852         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
1853         0, 0    /* No PER value map */
1854 };
1855
1856 /*** <<< STAT-DEFS [Utf8-3] >>> ***/
1857
1858 static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
1859         (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
1860 };
1861 asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
1862         "Utf8-3",
1863         "Utf8-3",
1864         &asn_OP_UTF8String,
1865         asn_DEF_Utf8_3_tags_1,
1866         sizeof(asn_DEF_Utf8_3_tags_1)
1867                 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
1868         asn_DEF_Utf8_3_tags_1,  /* Same as above */
1869         sizeof(asn_DEF_Utf8_3_tags_1)
1870                 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
1871         { 0, &asn_PER_type_Utf8_3_constr_1, Utf8_3_constraint },
1872         0, 0,   /* No members */
1873         0       /* No specifics */
1874 };
1875
1876
1877 /*** <<< INCLUDES [Utf8-2] >>> ***/
1878
1879 #include "Utf8-1.h"
1880
1881 /*** <<< TYPE-DECLS [Utf8-2] >>> ***/
1882
1883 typedef Utf8_1_t         Utf8_2_t;
1884
1885 /*** <<< FUNC-DECLS [Utf8-2] >>> ***/
1886
1887 extern asn_per_constraints_t asn_PER_type_Utf8_2_constr_1;
1888 extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
1889 asn_struct_free_f Utf8_2_free;
1890 asn_struct_print_f Utf8_2_print;
1891 asn_constr_check_f Utf8_2_constraint;
1892 ber_type_decoder_f Utf8_2_decode_ber;
1893 der_type_encoder_f Utf8_2_encode_der;
1894 xer_type_decoder_f Utf8_2_decode_xer;
1895 xer_type_encoder_f Utf8_2_encode_xer;
1896 per_type_decoder_f Utf8_2_decode_uper;
1897 per_type_encoder_f Utf8_2_encode_uper;
1898 per_type_decoder_f Utf8_2_decode_aper;
1899 per_type_encoder_f Utf8_2_encode_aper;
1900
1901 /*** <<< CODE [Utf8-2] >>> ***/
1902
1903 int
1904 Utf8_2_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
1905                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
1906         const Utf8_1_t *st = (const Utf8_1_t *)sptr;
1907         size_t size;
1908         
1909         if(!sptr) {
1910                 ASN__CTFAIL(app_key, td, sptr,
1911                         "%s: value not given (%s:%d)",
1912                         td->name, __FILE__, __LINE__);
1913                 return -1;
1914         }
1915         
1916         size = UTF8String_length(st);
1917         if((ssize_t)size < 0) {
1918                 ASN__CTFAIL(app_key, td, sptr,
1919                         "%s: UTF-8: broken encoding (%s:%d)",
1920                         td->name, __FILE__, __LINE__);
1921                 return -1;
1922         }
1923         
1924         if((size >= 1 && size <= 2)) {
1925                 /* Constraint check succeeded */
1926                 return 0;
1927         } else {
1928                 ASN__CTFAIL(app_key, td, sptr,
1929                         "%s: constraint failed (%s:%d)",
1930                         td->name, __FILE__, __LINE__);
1931                 return -1;
1932         }
1933 }
1934
1935 /*
1936  * This type is implemented using Utf8_1,
1937  * so here we adjust the DEF accordingly.
1938  */
1939
1940 /*** <<< CTDEFS [Utf8-2] >>> ***/
1941
1942 asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 CC_NOTUSED = {
1943         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
1944         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
1945         0, 0    /* No PER value map */
1946 };
1947
1948 /*** <<< STAT-DEFS [Utf8-2] >>> ***/
1949
1950 static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
1951         (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
1952 };
1953 asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
1954         "Utf8-2",
1955         "Utf8-2",
1956         &asn_OP_UTF8String,
1957         asn_DEF_Utf8_2_tags_1,
1958         sizeof(asn_DEF_Utf8_2_tags_1)
1959                 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
1960         asn_DEF_Utf8_2_tags_1,  /* Same as above */
1961         sizeof(asn_DEF_Utf8_2_tags_1)
1962                 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
1963         { 0, &asn_PER_type_Utf8_2_constr_1, Utf8_2_constraint },
1964         0, 0,   /* No members */
1965         0       /* No specifics */
1966 };
1967
1968
1969 /*** <<< INCLUDES [Utf8-1] >>> ***/
1970
1971 #include <UTF8String.h>
1972
1973 /*** <<< TYPE-DECLS [Utf8-1] >>> ***/
1974
1975 typedef UTF8String_t     Utf8_1_t;
1976
1977 /*** <<< FUNC-DECLS [Utf8-1] >>> ***/
1978
1979 extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
1980 asn_struct_free_f Utf8_1_free;
1981 asn_struct_print_f Utf8_1_print;
1982 asn_constr_check_f Utf8_1_constraint;
1983 ber_type_decoder_f Utf8_1_decode_ber;
1984 der_type_encoder_f Utf8_1_encode_der;
1985 xer_type_decoder_f Utf8_1_decode_xer;
1986 xer_type_encoder_f Utf8_1_encode_xer;
1987 per_type_decoder_f Utf8_1_decode_uper;
1988 per_type_encoder_f Utf8_1_encode_uper;
1989 per_type_decoder_f Utf8_1_decode_aper;
1990 per_type_encoder_f Utf8_1_encode_aper;
1991
1992 /*** <<< CODE [Utf8-1] >>> ***/
1993
1994 /*
1995  * This type is implemented using UTF8String,
1996  * so here we adjust the DEF accordingly.
1997  */
1998
1999 /*** <<< STAT-DEFS [Utf8-1] >>> ***/
2000
2001 static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
2002         (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2003 };
2004 asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
2005         "Utf8-1",
2006         "Utf8-1",
2007         &asn_OP_UTF8String,
2008         asn_DEF_Utf8_1_tags_1,
2009         sizeof(asn_DEF_Utf8_1_tags_1)
2010                 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
2011         asn_DEF_Utf8_1_tags_1,  /* Same as above */
2012         sizeof(asn_DEF_Utf8_1_tags_1)
2013                 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
2014         { 0, 0, UTF8String_constraint },
2015         0, 0,   /* No members */
2016         0       /* No specifics */
2017 };
2018
2019
2020 /*** <<< INCLUDES [VisibleIdentifier] >>> ***/
2021
2022 #include "Identifier.h"
2023
2024 /*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
2025
2026 typedef Identifier_t     VisibleIdentifier_t;
2027
2028 /*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
2029
2030 extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
2031 asn_struct_free_f VisibleIdentifier_free;
2032 asn_struct_print_f VisibleIdentifier_print;
2033 asn_constr_check_f VisibleIdentifier_constraint;
2034 ber_type_decoder_f VisibleIdentifier_decode_ber;
2035 der_type_encoder_f VisibleIdentifier_encode_der;
2036 xer_type_decoder_f VisibleIdentifier_decode_xer;
2037 xer_type_encoder_f VisibleIdentifier_encode_xer;
2038 per_type_decoder_f VisibleIdentifier_decode_uper;
2039 per_type_encoder_f VisibleIdentifier_encode_uper;
2040 per_type_decoder_f VisibleIdentifier_decode_aper;
2041 per_type_encoder_f VisibleIdentifier_encode_aper;
2042
2043 /*** <<< CTABLES [VisibleIdentifier] >>> ***/
2044
2045 static const int permitted_alphabet_table_1[256] = {
2046  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
2047  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
2048  0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*     $            */
2049  2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0,        /* 0123456789       */
2050  0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,        /*  ABCDEFGHIJKLMNO */
2051 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38,        /* PQRSTUVWXYZ    _ */
2052  0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,        /*  abcdefghijklmno */
2053 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0,        /* pqrstuvwxyz      */
2054 };
2055 static const int permitted_alphabet_code2value_1[64] = {
2056 36,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
2057 70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
2058 86,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
2059 107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
2060 };
2061
2062
2063 static int check_permitted_alphabet_1(const void *sptr) {
2064         const int *table = permitted_alphabet_table_1;
2065         /* The underlying type is VisibleString */
2066         const VisibleString_t *st = (const VisibleString_t *)sptr;
2067         const uint8_t *ch = st->buf;
2068         const uint8_t *end = ch + st->size;
2069         
2070         for(; ch < end; ch++) {
2071                 uint8_t cv = *ch;
2072                 if(!table[cv]) return -1;
2073         }
2074         return 0;
2075 }
2076
2077
2078 /*** <<< CODE [VisibleIdentifier] >>> ***/
2079
2080 int
2081 VisibleIdentifier_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
2082                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2083         const Identifier_t *st = (const Identifier_t *)sptr;
2084         size_t size;
2085         
2086         if(!sptr) {
2087                 ASN__CTFAIL(app_key, td, sptr,
2088                         "%s: value not given (%s:%d)",
2089                         td->name, __FILE__, __LINE__);
2090                 return -1;
2091         }
2092         
2093         size = st->size;
2094         
2095         if((size >= 1 && size <= 32)
2096                  && !check_permitted_alphabet_1(st)) {
2097                 /* Constraint check succeeded */
2098                 return 0;
2099         } else {
2100                 ASN__CTFAIL(app_key, td, sptr,
2101                         "%s: constraint failed (%s:%d)",
2102                         td->name, __FILE__, __LINE__);
2103                 return -1;
2104         }
2105 }
2106
2107 static int asn_PER_MAP_VisibleIdentifier_1_v2c(unsigned int value) {
2108         if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
2109                 return -1;
2110         return permitted_alphabet_table_1[value] - 1;
2111 }
2112 static int asn_PER_MAP_VisibleIdentifier_1_c2v(unsigned int code) {
2113         if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
2114                 return -1;
2115         return permitted_alphabet_code2value_1[code];
2116 }
2117 /*
2118  * This type is implemented using Identifier,
2119  * so here we adjust the DEF accordingly.
2120  */
2121
2122 /*** <<< CTDEFS [VisibleIdentifier] >>> ***/
2123
2124 static asn_per_constraints_t asn_PER_type_VisibleIdentifier_constr_1 CC_NOTUSED = {
2125         { APC_CONSTRAINED,       6,  6,  36,  122 }     /* (36..122) */,
2126         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
2127         asn_PER_MAP_VisibleIdentifier_1_v2c,    /* Value to PER code map */
2128         asn_PER_MAP_VisibleIdentifier_1_c2v     /* PER code to value map */
2129 };
2130
2131 /*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
2132
2133 static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
2134         (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
2135 };
2136 asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
2137         "VisibleIdentifier",
2138         "VisibleIdentifier",
2139         &asn_OP_VisibleString,
2140         asn_DEF_VisibleIdentifier_tags_1,
2141         sizeof(asn_DEF_VisibleIdentifier_tags_1)
2142                 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
2143         asn_DEF_VisibleIdentifier_tags_1,       /* Same as above */
2144         sizeof(asn_DEF_VisibleIdentifier_tags_1)
2145                 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
2146         { 0, &asn_PER_type_VisibleIdentifier_constr_1, VisibleIdentifier_constraint },
2147         0, 0,   /* No members */
2148         0       /* No specifics */
2149 };
2150
2151
2152 /*** <<< INCLUDES [Sequence] >>> ***/
2153
2154 #include "Int1.h"
2155 #include "Int4.h"
2156 #include <BOOLEAN.h>
2157 #include <NativeEnumerated.h>
2158 #include <NULL.h>
2159 #include "Int5.h"
2160 #include <constr_SEQUENCE.h>
2161
2162 /*** <<< DEPS [Sequence] >>> ***/
2163
2164 typedef enum enum_c {
2165         enum_c_one      = 1,
2166         enum_c_two      = 2,
2167         /*
2168          * Enumeration is extensible
2169          */
2170         enum_c_three    = 3
2171 } e_enum_c;
2172
2173 /*** <<< TYPE-DECLS [Sequence] >>> ***/
2174
2175 typedef struct Sequence {
2176         Int1_t  *int1_c;        /* DEFAULT 3 */
2177         Int4_t   int4;
2178         Int4_t   int4_c;
2179         BOOLEAN_t       *Bool;  /* DEFAULT 1 */
2180         long     enum_c;
2181         NULL_t  *null;  /* OPTIONAL */
2182         /*
2183          * This type is extensible,
2184          * possible extensions are below.
2185          */
2186         Int5_t  *int5_c;        /* OPTIONAL */
2187         
2188         /* Context for parsing across buffer boundaries */
2189         asn_struct_ctx_t _asn_ctx;
2190 } Sequence_t;
2191
2192 /*** <<< FUNC-DECLS [Sequence] >>> ***/
2193
2194 /* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6;       // (Use -fall-defs-global to expose) */
2195 extern asn_TYPE_descriptor_t asn_DEF_Sequence;
2196 extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
2197 extern asn_TYPE_member_t asn_MBR_Sequence_1[7];
2198
2199 /*** <<< CODE [Sequence] >>> ***/
2200
2201 /*
2202  * This type is implemented using NativeEnumerated,
2203  * so here we adjust the DEF accordingly.
2204  */
2205 static int
2206 memb_int1_c_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
2207                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2208         long value;
2209         
2210         if(!sptr) {
2211                 ASN__CTFAIL(app_key, td, sptr,
2212                         "%s: value not given (%s:%d)",
2213                         td->name, __FILE__, __LINE__);
2214                 return -1;
2215         }
2216         
2217         value = *(const long *)sptr;
2218         
2219         if((value >= -2)) {
2220                 /* Constraint check succeeded */
2221                 return 0;
2222         } else {
2223                 ASN__CTFAIL(app_key, td, sptr,
2224                         "%s: constraint failed (%s:%d)",
2225                         td->name, __FILE__, __LINE__);
2226                 return -1;
2227         }
2228 }
2229
2230 static int
2231 memb_int4_c_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
2232                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2233         long value;
2234         
2235         if(!sptr) {
2236                 ASN__CTFAIL(app_key, td, sptr,
2237                         "%s: value not given (%s:%d)",
2238                         td->name, __FILE__, __LINE__);
2239                 return -1;
2240         }
2241         
2242         value = *(const long *)sptr;
2243         
2244         if((value >= 5 && value <= 7)) {
2245                 /* Constraint check succeeded */
2246                 return 0;
2247         } else {
2248                 ASN__CTFAIL(app_key, td, sptr,
2249                         "%s: constraint failed (%s:%d)",
2250                         td->name, __FILE__, __LINE__);
2251                 return -1;
2252         }
2253 }
2254
2255 static int
2256 memb_int5_c_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
2257                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2258         long value;
2259         
2260         if(!sptr) {
2261                 ASN__CTFAIL(app_key, td, sptr,
2262                         "%s: value not given (%s:%d)",
2263                         td->name, __FILE__, __LINE__);
2264                 return -1;
2265         }
2266         
2267         value = *(const long *)sptr;
2268         
2269         if((value == 5)) {
2270                 /* Constraint check succeeded */
2271                 return 0;
2272         } else {
2273                 ASN__CTFAIL(app_key, td, sptr,
2274                         "%s: constraint failed (%s:%d)",
2275                         td->name, __FILE__, __LINE__);
2276                 return -1;
2277         }
2278 }
2279
2280
2281 /*** <<< CTDEFS [Sequence] >>> ***/
2282
2283 static asn_per_constraints_t asn_PER_type_enum_c_constr_6 CC_NOTUSED = {
2284         { APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }    /* (0..1,...) */,
2285         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
2286         0, 0    /* No PER value map */
2287 };
2288 static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 CC_NOTUSED = {
2289         { APC_SEMI_CONSTRAINED, -1, -1, -2,  0 }        /* (-2..MAX) */,
2290         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
2291         0, 0    /* No PER value map */
2292 };
2293 static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 CC_NOTUSED = {
2294         { APC_CONSTRAINED,       2,  2,  5,  7 }        /* (5..7) */,
2295         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
2296         0, 0    /* No PER value map */
2297 };
2298 static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 CC_NOTUSED = {
2299         { APC_CONSTRAINED,       0,  0,  5,  5 }        /* (5..5) */,
2300         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
2301         0, 0    /* No PER value map */
2302 };
2303
2304 /*** <<< STAT-DEFS [Sequence] >>> ***/
2305
2306 static int asn_DFL_2_cmp_3(const void *sptr) {
2307         const Int1_t *st = sptr;
2308         
2309         if(!st) {
2310                 return -1; /* No value is not a default value */
2311         }
2312         
2313         /* Test default value 3 */
2314         return (*st != 3);
2315 }
2316 static int asn_DFL_2_set_3(void **sptr) {
2317         Int1_t *st = *sptr;
2318         
2319         if(!st) {
2320                 st = (*sptr = CALLOC(1, sizeof(*st)));
2321                 if(!st) return -1;
2322         }
2323         
2324         /* Install default value 3 */
2325         *st = 3;
2326         return 0;
2327 }
2328 static int asn_DFL_5_cmp_1(const void *sptr) {
2329         const BOOLEAN_t *st = sptr;
2330         
2331         if(!st) {
2332                 return -1; /* No value is not a default value */
2333         }
2334         
2335         /* Test default value 1 */
2336         return (*st != 1);
2337 }
2338 static int asn_DFL_5_set_1(void **sptr) {
2339         BOOLEAN_t *st = *sptr;
2340         
2341         if(!st) {
2342                 st = (*sptr = CALLOC(1, sizeof(*st)));
2343                 if(!st) return -1;
2344         }
2345         
2346         /* Install default value 1 */
2347         *st = 1;
2348         return 0;
2349 }
2350 static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
2351         { 1,    3,      "one" },
2352         { 2,    3,      "two" },
2353         { 3,    5,      "three" }
2354         /* This list is extensible */
2355 };
2356 static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
2357         0,      /* one(1) */
2358         2,      /* three(3) */
2359         1       /* two(2) */
2360         /* This list is extensible */
2361 };
2362 static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
2363         asn_MAP_enum_c_value2enum_6,    /* "tag" => N; sorted by tag */
2364         asn_MAP_enum_c_enum2value_6,    /* N => "tag"; sorted by N */
2365         3,      /* Number of elements in the maps */
2366         3,      /* Extensions before this member */
2367         1,      /* Strict enumeration */
2368         0,      /* Native long size */
2369         0
2370 };
2371 static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
2372         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2373 };
2374 static /* Use -fall-defs-global to expose */
2375 asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
2376         "enum-c",
2377         "enum-c",
2378         &asn_OP_NativeEnumerated,
2379         asn_DEF_enum_c_tags_6,
2380         sizeof(asn_DEF_enum_c_tags_6)
2381                 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
2382         asn_DEF_enum_c_tags_6,  /* Same as above */
2383         sizeof(asn_DEF_enum_c_tags_6)
2384                 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
2385         { 0, &asn_PER_type_enum_c_constr_6, NativeEnumerated_constraint },
2386         0, 0,   /* Defined elsewhere */
2387         &asn_SPC_enum_c_specs_6 /* Additional specs */
2388 };
2389
2390 asn_TYPE_member_t asn_MBR_Sequence_1[] = {
2391         { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
2392                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2393                 .tag_mode = 0,
2394                 .type = &asn_DEF_Int1,
2395                 .type_selector = 0,
2396                 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_int1_c_constr_2, .general_constraints =  memb_int1_c_constraint_1 },
2397                 .default_value_cmp = &asn_DFL_2_cmp_3,  /* Compare DEFAULT 3 */
2398                 .default_value_set = &asn_DFL_2_set_3,  /* Set DEFAULT 3 */
2399                 .name = "int1-c"
2400                 },
2401         { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
2402                 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
2403                 .tag_mode = +1, /* EXPLICIT tag at current level */
2404                 .type = &asn_DEF_Int4,
2405                 .type_selector = 0,
2406                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
2407                 0, 0, /* No default value */
2408                 .name = "int4"
2409                 },
2410         { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
2411                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2412                 .tag_mode = 0,
2413                 .type = &asn_DEF_Int4,
2414                 .type_selector = 0,
2415                 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_int4_c_constr_4, .general_constraints =  memb_int4_c_constraint_1 },
2416                 0, 0, /* No default value */
2417                 .name = "int4-c"
2418                 },
2419         { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
2420                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
2421                 .tag_mode = 0,
2422                 .type = &asn_DEF_BOOLEAN,
2423                 .type_selector = 0,
2424                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
2425                 .default_value_cmp = &asn_DFL_5_cmp_1,  /* Compare DEFAULT 1 */
2426                 .default_value_set = &asn_DFL_5_set_1,  /* Set DEFAULT 1 */
2427                 .name = "bool"
2428                 },
2429         { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
2430                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
2431                 .tag_mode = 0,
2432                 .type = &asn_DEF_enum_c_6,
2433                 .type_selector = 0,
2434                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
2435                 0, 0, /* No default value */
2436                 .name = "enum-c"
2437                 },
2438         { ATF_POINTER, 2, offsetof(struct Sequence, null),
2439                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
2440                 .tag_mode = 0,
2441                 .type = &asn_DEF_NULL,
2442                 .type_selector = 0,
2443                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
2444                 0, 0, /* No default value */
2445                 .name = "null"
2446                 },
2447         { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
2448                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2449                 .tag_mode = 0,
2450                 .type = &asn_DEF_Int5,
2451                 .type_selector = 0,
2452                 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_int5_c_constr_13, .general_constraints =  memb_int5_c_constraint_1 },
2453                 0, 0, /* No default value */
2454                 .name = "int5-c"
2455                 },
2456 };
2457 static const int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
2458 static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
2459         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2460 };
2461 static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
2462     { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
2463     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
2464     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
2465     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
2466     { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
2467     { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
2468     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
2469 };
2470 asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
2471         sizeof(struct Sequence),
2472         offsetof(struct Sequence, _asn_ctx),
2473         .tag2el = asn_MAP_Sequence_tag2el_1,
2474         .tag2el_count = 7,      /* Count of tags in the map */
2475         asn_MAP_Sequence_oms_1, /* Optional members */
2476         3, 1,   /* Root/Additions */
2477         6,      /* First extension addition */
2478 };
2479 asn_TYPE_descriptor_t asn_DEF_Sequence = {
2480         "Sequence",
2481         "Sequence",
2482         &asn_OP_SEQUENCE,
2483         asn_DEF_Sequence_tags_1,
2484         sizeof(asn_DEF_Sequence_tags_1)
2485                 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
2486         asn_DEF_Sequence_tags_1,        /* Same as above */
2487         sizeof(asn_DEF_Sequence_tags_1)
2488                 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
2489         { 0, 0, SEQUENCE_constraint },
2490         asn_MBR_Sequence_1,
2491         7,      /* Elements count */
2492         &asn_SPC_Sequence_specs_1       /* Additional specs */
2493 };
2494
2495
2496 /*** <<< INCLUDES [SequenceOf] >>> ***/
2497
2498 #include <asn_SEQUENCE_OF.h>
2499 #include <constr_SEQUENCE_OF.h>
2500
2501 /*** <<< FWD-DECLS [SequenceOf] >>> ***/
2502
2503 struct Sequence;
2504
2505 /*** <<< TYPE-DECLS [SequenceOf] >>> ***/
2506
2507 typedef struct SequenceOf {
2508         A_SEQUENCE_OF(struct Sequence) list;
2509         
2510         /* Context for parsing across buffer boundaries */
2511         asn_struct_ctx_t _asn_ctx;
2512 } SequenceOf_t;
2513
2514 /*** <<< FUNC-DECLS [SequenceOf] >>> ***/
2515
2516 extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
2517
2518 /*** <<< POST-INCLUDE [SequenceOf] >>> ***/
2519
2520 #include "Sequence.h"
2521
2522 /*** <<< CTDEFS [SequenceOf] >>> ***/
2523
2524 static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 CC_NOTUSED = {
2525         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
2526         { APC_CONSTRAINED,       1,  1,  1,  2 }        /* (SIZE(1..2)) */,
2527         0, 0    /* No PER value map */
2528 };
2529
2530 /*** <<< STAT-DEFS [SequenceOf] >>> ***/
2531
2532 static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
2533         { ATF_POINTER, 0, 0,
2534                 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
2535                 .tag_mode = 0,
2536                 .type = &asn_DEF_Sequence,
2537                 .type_selector = 0,
2538                 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
2539                 0, 0, /* No default value */
2540                 .name = ""
2541                 },
2542 };
2543 static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
2544         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2545 };
2546 static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
2547         sizeof(struct SequenceOf),
2548         offsetof(struct SequenceOf, _asn_ctx),
2549         0,      /* XER encoding is XMLDelimitedItemList */
2550 };
2551 asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
2552         "SequenceOf",
2553         "SequenceOf",
2554         &asn_OP_SEQUENCE_OF,
2555         asn_DEF_SequenceOf_tags_1,
2556         sizeof(asn_DEF_SequenceOf_tags_1)
2557                 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
2558         asn_DEF_SequenceOf_tags_1,      /* Same as above */
2559         sizeof(asn_DEF_SequenceOf_tags_1)
2560                 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
2561         { 0, &asn_PER_type_SequenceOf_constr_1, SEQUENCE_OF_constraint },
2562         asn_MBR_SequenceOf_1,
2563         1,      /* Single element */
2564         &asn_SPC_SequenceOf_specs_1     /* Additional specs */
2565 };
2566
2567
2568 /*** <<< INCLUDES [Enum0] >>> ***/
2569
2570 #include <NativeEnumerated.h>
2571
2572 /*** <<< DEPS [Enum0] >>> ***/
2573
2574 typedef enum Enum0 {
2575         Enum0_one       = 0,
2576         Enum0_two       = 1
2577 } e_Enum0;
2578
2579 /*** <<< TYPE-DECLS [Enum0] >>> ***/
2580
2581 typedef long     Enum0_t;
2582
2583 /*** <<< FUNC-DECLS [Enum0] >>> ***/
2584
2585 extern asn_TYPE_descriptor_t asn_DEF_Enum0;
2586 asn_struct_free_f Enum0_free;
2587 asn_struct_print_f Enum0_print;
2588 asn_constr_check_f Enum0_constraint;
2589 ber_type_decoder_f Enum0_decode_ber;
2590 der_type_encoder_f Enum0_encode_der;
2591 xer_type_decoder_f Enum0_decode_xer;
2592 xer_type_encoder_f Enum0_encode_xer;
2593 per_type_decoder_f Enum0_decode_uper;
2594 per_type_encoder_f Enum0_encode_uper;
2595 per_type_decoder_f Enum0_decode_aper;
2596 per_type_encoder_f Enum0_encode_aper;
2597
2598 /*** <<< CODE [Enum0] >>> ***/
2599
2600 /*
2601  * This type is implemented using NativeEnumerated,
2602  * so here we adjust the DEF accordingly.
2603  */
2604
2605 /*** <<< CTDEFS [Enum0] >>> ***/
2606
2607 static asn_per_constraints_t asn_PER_type_Enum0_constr_1 CC_NOTUSED = {
2608         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
2609         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
2610         0, 0    /* No PER value map */
2611 };
2612
2613 /*** <<< STAT-DEFS [Enum0] >>> ***/
2614
2615 static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
2616         { 0,    3,      "one" },
2617         { 1,    3,      "two" }
2618 };
2619 static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
2620         0,      /* one(0) */
2621         1       /* two(1) */
2622 };
2623 static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
2624         asn_MAP_Enum0_value2enum_1,     /* "tag" => N; sorted by tag */
2625         asn_MAP_Enum0_enum2value_1,     /* N => "tag"; sorted by N */
2626         2,      /* Number of elements in the maps */
2627         0,      /* Enumeration is not extensible */
2628         1,      /* Strict enumeration */
2629         0,      /* Native long size */
2630         0
2631 };
2632 static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
2633         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2634 };
2635 asn_TYPE_descriptor_t asn_DEF_Enum0 = {
2636         "Enum0",
2637         "Enum0",
2638         &asn_OP_NativeEnumerated,
2639         asn_DEF_Enum0_tags_1,
2640         sizeof(asn_DEF_Enum0_tags_1)
2641                 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
2642         asn_DEF_Enum0_tags_1,   /* Same as above */
2643         sizeof(asn_DEF_Enum0_tags_1)
2644                 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
2645         { 0, &asn_PER_type_Enum0_constr_1, NativeEnumerated_constraint },
2646         0, 0,   /* Defined elsewhere */
2647         &asn_SPC_Enum0_specs_1  /* Additional specs */
2648 };
2649
2650
2651 /*** <<< INCLUDES [Enum1] >>> ***/
2652
2653 #include <NativeEnumerated.h>
2654
2655 /*** <<< DEPS [Enum1] >>> ***/
2656
2657 typedef enum Enum1 {
2658         Enum1_one       = 0,
2659         Enum1_two       = 1
2660 } e_Enum1;
2661
2662 /*** <<< TYPE-DECLS [Enum1] >>> ***/
2663
2664 typedef long     Enum1_t;
2665
2666 /*** <<< FUNC-DECLS [Enum1] >>> ***/
2667
2668 extern asn_TYPE_descriptor_t asn_DEF_Enum1;
2669 asn_struct_free_f Enum1_free;
2670 asn_struct_print_f Enum1_print;
2671 asn_constr_check_f Enum1_constraint;
2672 ber_type_decoder_f Enum1_decode_ber;
2673 der_type_encoder_f Enum1_encode_der;
2674 xer_type_decoder_f Enum1_decode_xer;
2675 xer_type_encoder_f Enum1_encode_xer;
2676 per_type_decoder_f Enum1_decode_uper;
2677 per_type_encoder_f Enum1_encode_uper;
2678 per_type_decoder_f Enum1_decode_aper;
2679 per_type_encoder_f Enum1_encode_aper;
2680
2681 /*** <<< CODE [Enum1] >>> ***/
2682
2683 int
2684 Enum1_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
2685                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2686         long value;
2687         
2688         if(!sptr) {
2689                 ASN__CTFAIL(app_key, td, sptr,
2690                         "%s: value not given (%s:%d)",
2691                         td->name, __FILE__, __LINE__);
2692                 return -1;
2693         }
2694         
2695         value = *(const long *)sptr;
2696         
2697         if((value == 0)) {
2698                 /* Constraint check succeeded */
2699                 return 0;
2700         } else {
2701                 ASN__CTFAIL(app_key, td, sptr,
2702                         "%s: constraint failed (%s:%d)",
2703                         td->name, __FILE__, __LINE__);
2704                 return -1;
2705         }
2706 }
2707
2708 /*
2709  * This type is implemented using NativeEnumerated,
2710  * so here we adjust the DEF accordingly.
2711  */
2712
2713 /*** <<< CTDEFS [Enum1] >>> ***/
2714
2715 static asn_per_constraints_t asn_PER_type_Enum1_constr_1 CC_NOTUSED = {
2716         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
2717         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
2718         0, 0    /* No PER value map */
2719 };
2720
2721 /*** <<< STAT-DEFS [Enum1] >>> ***/
2722
2723 static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
2724         { 0,    3,      "one" },
2725         { 1,    3,      "two" }
2726 };
2727 static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
2728         0,      /* one(0) */
2729         1       /* two(1) */
2730 };
2731 static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
2732         asn_MAP_Enum1_value2enum_1,     /* "tag" => N; sorted by tag */
2733         asn_MAP_Enum1_enum2value_1,     /* N => "tag"; sorted by N */
2734         2,      /* Number of elements in the maps */
2735         0,      /* Enumeration is not extensible */
2736         1,      /* Strict enumeration */
2737         0,      /* Native long size */
2738         0
2739 };
2740 static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
2741         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2742 };
2743 asn_TYPE_descriptor_t asn_DEF_Enum1 = {
2744         "Enum1",
2745         "Enum1",
2746         &asn_OP_NativeEnumerated,
2747         asn_DEF_Enum1_tags_1,
2748         sizeof(asn_DEF_Enum1_tags_1)
2749                 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
2750         asn_DEF_Enum1_tags_1,   /* Same as above */
2751         sizeof(asn_DEF_Enum1_tags_1)
2752                 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
2753         { 0, &asn_PER_type_Enum1_constr_1, Enum1_constraint },
2754         0, 0,   /* Defined elsewhere */
2755         &asn_SPC_Enum1_specs_1  /* Additional specs */
2756 };
2757
2758
2759 /*** <<< INCLUDES [Identifier] >>> ***/
2760
2761 #include <VisibleString.h>
2762
2763 /*** <<< TYPE-DECLS [Identifier] >>> ***/
2764
2765 typedef VisibleString_t  Identifier_t;
2766
2767 /*** <<< FUNC-DECLS [Identifier] >>> ***/
2768
2769 extern asn_per_constraints_t asn_PER_type_Identifier_constr_1;
2770 extern asn_TYPE_descriptor_t asn_DEF_Identifier;
2771 asn_struct_free_f Identifier_free;
2772 asn_struct_print_f Identifier_print;
2773 asn_constr_check_f Identifier_constraint;
2774 ber_type_decoder_f Identifier_decode_ber;
2775 der_type_encoder_f Identifier_encode_der;
2776 xer_type_decoder_f Identifier_decode_xer;
2777 xer_type_encoder_f Identifier_encode_xer;
2778 per_type_decoder_f Identifier_decode_uper;
2779 per_type_encoder_f Identifier_encode_uper;
2780 per_type_decoder_f Identifier_decode_aper;
2781 per_type_encoder_f Identifier_encode_aper;
2782
2783 /*** <<< CTABLES [Identifier] >>> ***/
2784
2785 static const int permitted_alphabet_table_1[256] = {
2786  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
2787  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
2788  0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*     $            */
2789  2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0,        /* 0123456789       */
2790  0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,        /*  ABCDEFGHIJKLMNO */
2791 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38,        /* PQRSTUVWXYZ    _ */
2792  0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,        /*  abcdefghijklmno */
2793 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0,        /* pqrstuvwxyz      */
2794 };
2795 static const int permitted_alphabet_code2value_1[64] = {
2796 36,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
2797 70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
2798 86,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
2799 107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
2800 };
2801
2802
2803 static int check_permitted_alphabet_1(const void *sptr) {
2804         const int *table = permitted_alphabet_table_1;
2805         /* The underlying type is VisibleString */
2806         const VisibleString_t *st = (const VisibleString_t *)sptr;
2807         const uint8_t *ch = st->buf;
2808         const uint8_t *end = ch + st->size;
2809         
2810         for(; ch < end; ch++) {
2811                 uint8_t cv = *ch;
2812                 if(!table[cv]) return -1;
2813         }
2814         return 0;
2815 }
2816
2817
2818 /*** <<< CODE [Identifier] >>> ***/
2819
2820 int
2821 Identifier_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
2822                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2823         const VisibleString_t *st = (const VisibleString_t *)sptr;
2824         size_t size;
2825         
2826         if(!sptr) {
2827                 ASN__CTFAIL(app_key, td, sptr,
2828                         "%s: value not given (%s:%d)",
2829                         td->name, __FILE__, __LINE__);
2830                 return -1;
2831         }
2832         
2833         size = st->size;
2834         
2835         if((size >= 1 && size <= 32)
2836                  && !check_permitted_alphabet_1(st)) {
2837                 /* Constraint check succeeded */
2838                 return 0;
2839         } else {
2840                 ASN__CTFAIL(app_key, td, sptr,
2841                         "%s: constraint failed (%s:%d)",
2842                         td->name, __FILE__, __LINE__);
2843                 return -1;
2844         }
2845 }
2846
2847 static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) {
2848         if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
2849                 return -1;
2850         return permitted_alphabet_table_1[value] - 1;
2851 }
2852 static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) {
2853         if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
2854                 return -1;
2855         return permitted_alphabet_code2value_1[code];
2856 }
2857 /*
2858  * This type is implemented using VisibleString,
2859  * so here we adjust the DEF accordingly.
2860  */
2861
2862 /*** <<< CTDEFS [Identifier] >>> ***/
2863
2864 asn_per_constraints_t asn_PER_type_Identifier_constr_1 CC_NOTUSED = {
2865         { APC_CONSTRAINED,       6,  6,  36,  122 }     /* (36..122) */,
2866         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
2867         asn_PER_MAP_Identifier_1_v2c,   /* Value to PER code map */
2868         asn_PER_MAP_Identifier_1_c2v    /* PER code to value map */
2869 };
2870
2871 /*** <<< STAT-DEFS [Identifier] >>> ***/
2872
2873 static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
2874         (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
2875 };
2876 asn_TYPE_descriptor_t asn_DEF_Identifier = {
2877         "Identifier",
2878         "Identifier",
2879         &asn_OP_VisibleString,
2880         asn_DEF_Identifier_tags_1,
2881         sizeof(asn_DEF_Identifier_tags_1)
2882                 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
2883         asn_DEF_Identifier_tags_1,      /* Same as above */
2884         sizeof(asn_DEF_Identifier_tags_1)
2885                 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
2886         { 0, &asn_PER_type_Identifier_constr_1, Identifier_constraint },
2887         0, 0,   /* No members */
2888         0       /* No specifics */
2889 };
2890
2891
2892 /*** <<< asn_constant.h >>> ***/
2893
2894 /*
2895  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
2896  */
2897
2898 #ifndef _ASN_CONSTANT_H
2899 #define _ASN_CONSTANT_H
2900
2901 #ifdef __cplusplus
2902 extern "C" {
2903 #endif
2904
2905 #define maxIdentifier (32)
2906
2907
2908 #ifdef __cplusplus
2909 }
2910 #endif
2911
2912 #endif /* _ASN_CONSTANT_H */