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