blob: 420e914a4430437338883741bad4b4cb6c3a2110 [file] [log] [blame]
Lev Walkin006de1c2004-08-20 13:37:45 +00001
2/*** <<< INCLUDES [Int1] >>> ***/
3
4#include <INTEGER.h>
5
6/*** <<< TYPE-DECLS [Int1] >>> ***/
7
Lev Walkin006de1c2004-08-20 13:37:45 +00008typedef INTEGER_t Int1_t;
9
Lev Walkin006de1c2004-08-20 13:37:45 +000010/*** <<< FUNC-DECLS [Int1] >>> ***/
11
Lev Walkincaf0d5a2005-03-04 23:48:19 +000012extern asn_TYPE_descriptor_t asn_DEF_Int1;
13asn_struct_free_f Int1_free;
14asn_struct_print_f Int1_print;
15asn_constr_check_f Int1_constraint;
16ber_type_decoder_f Int1_decode_ber;
17der_type_encoder_f Int1_encode_der;
18xer_type_decoder_f Int1_decode_xer;
19xer_type_encoder_f Int1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +000020
21/*** <<< CODE [Int1] >>> ***/
22
Lev Walkincaf0d5a2005-03-04 23:48:19 +000023/*
24 * This type is implemented using INTEGER,
25 * so here we adjust the DEF accordingly.
26 */
Lev Walkincaf0d5a2005-03-04 23:48:19 +000027
28/*** <<< STAT-DEFS [Int1] >>> ***/
29
Lev Walkina7591b52014-10-12 18:37:35 -070030static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +000031 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
32};
33asn_TYPE_descriptor_t asn_DEF_Int1 = {
34 "Int1",
35 "Int1",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +080036 &asn_OP_INTEGER,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080037 INTEGER_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +000038 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 */
Lev Walkinb33425f2017-07-14 14:59:52 +040044 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +000045 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +000046 0, 0, /* No members */
47 0 /* No specifics */
48};
Lev Walkin006de1c2004-08-20 13:37:45 +000049
50
51/*** <<< INCLUDES [Int2] >>> ***/
52
Lev Walkin22b5ed42006-09-13 02:51:20 +000053#include "Int1.h"
Lev Walkin006de1c2004-08-20 13:37:45 +000054
55/*** <<< TYPE-DECLS [Int2] >>> ***/
56
Lev Walkin006de1c2004-08-20 13:37:45 +000057typedef Int1_t Int2_t;
58
Lev Walkin006de1c2004-08-20 13:37:45 +000059/*** <<< FUNC-DECLS [Int2] >>> ***/
60
Lev Walkindfae9752004-09-29 13:19:37 +000061extern asn_TYPE_descriptor_t asn_DEF_Int2;
Lev Walkina9cc46e2004-09-22 16:06:28 +000062asn_struct_free_f Int2_free;
63asn_struct_print_f Int2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +000064asn_constr_check_f Int2_constraint;
65ber_type_decoder_f Int2_decode_ber;
66der_type_encoder_f Int2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +000067xer_type_decoder_f Int2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +000068xer_type_encoder_f Int2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +000069
70/*** <<< CODE [Int2] >>> ***/
71
72int
Lev Walkindfae9752004-09-29 13:19:37 +000073Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000074 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +000075 const Int1_t *st = (const Int1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +000076 long value;
77
78 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070079 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +000080 "%s: value not given (%s:%d)",
81 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +000082 return -1;
83 }
84
Lev Walkin44467432004-09-07 06:43:57 +000085 /* Check if the sign bit is present */
86 value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
Lev Walkin006de1c2004-08-20 13:37:45 +000087
88 if((value >= 0)) {
89 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +000090 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +000091 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -070092 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +000093 "%s: constraint failed (%s:%d)",
94 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +000095 return -1;
96 }
97}
98
99/*
100 * This type is implemented using Int1,
Lev Walkinc3808c12004-09-23 22:14:58 +0000101 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000102 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000103
104/*** <<< STAT-DEFS [Int2] >>> ***/
105
Lev Walkina7591b52014-10-12 18:37:35 -0700106static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000107 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000108};
Lev Walkindfae9752004-09-29 13:19:37 +0000109asn_TYPE_descriptor_t asn_DEF_Int2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000110 "Int2",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000111 "Int2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800112 &asn_OP_INTEGER,
Lev Walkin006de1c2004-08-20 13:37:45 +0000113 Int2_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000114 asn_DEF_Int2_tags_1,
115 sizeof(asn_DEF_Int2_tags_1)
116 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
117 asn_DEF_Int2_tags_1, /* Same as above */
118 sizeof(asn_DEF_Int2_tags_1)
119 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400120 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000121 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000122 0, 0, /* No members */
123 0 /* No specifics */
124};
125
126
127/*** <<< INCLUDES [Int3] >>> ***/
128
Lev Walkin22b5ed42006-09-13 02:51:20 +0000129#include "Int2.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000130
131/*** <<< TYPE-DECLS [Int3] >>> ***/
132
Lev Walkin006de1c2004-08-20 13:37:45 +0000133typedef Int2_t Int3_t;
134
Lev Walkin006de1c2004-08-20 13:37:45 +0000135/*** <<< FUNC-DECLS [Int3] >>> ***/
136
Lev Walkindfae9752004-09-29 13:19:37 +0000137extern asn_TYPE_descriptor_t asn_DEF_Int3;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000138asn_struct_free_f Int3_free;
139asn_struct_print_f Int3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000140asn_constr_check_f Int3_constraint;
141ber_type_decoder_f Int3_decode_ber;
142der_type_encoder_f Int3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000143xer_type_decoder_f Int3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000144xer_type_encoder_f Int3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000145
146/*** <<< CODE [Int3] >>> ***/
147
148int
Lev Walkindfae9752004-09-29 13:19:37 +0000149Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000150 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000151 const Int2_t *st = (const Int2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000152 long value;
153
154 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700155 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000156 "%s: value not given (%s:%d)",
157 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000158 return -1;
159 }
160
Lev Walkindfae9752004-09-29 13:19:37 +0000161 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700162 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000163 "%s: value too large (%s:%d)",
164 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000165 return -1;
166 }
167
168 if((value >= 0 && value <= 10)) {
169 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000170 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000171 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700172 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000173 "%s: constraint failed (%s:%d)",
174 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000175 return -1;
176 }
177}
178
179/*
180 * This type is implemented using Int2,
Lev Walkinc3808c12004-09-23 22:14:58 +0000181 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000182 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000183
184/*** <<< STAT-DEFS [Int3] >>> ***/
185
Lev Walkina7591b52014-10-12 18:37:35 -0700186static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000187 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000188};
Lev Walkindfae9752004-09-29 13:19:37 +0000189asn_TYPE_descriptor_t asn_DEF_Int3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000190 "Int3",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000191 "Int3",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800192 &asn_OP_INTEGER,
Lev Walkin006de1c2004-08-20 13:37:45 +0000193 Int3_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000194 asn_DEF_Int3_tags_1,
195 sizeof(asn_DEF_Int3_tags_1)
196 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
197 asn_DEF_Int3_tags_1, /* Same as above */
198 sizeof(asn_DEF_Int3_tags_1)
199 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400200 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000201 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000202 0, 0, /* No members */
203 0 /* No specifics */
204};
205
206
207/*** <<< INCLUDES [Int4] >>> ***/
208
Lev Walkin22b5ed42006-09-13 02:51:20 +0000209#include "Int3.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000210
211/*** <<< TYPE-DECLS [Int4] >>> ***/
212
Lev Walkin006de1c2004-08-20 13:37:45 +0000213typedef Int3_t Int4_t;
214
Lev Walkin006de1c2004-08-20 13:37:45 +0000215/*** <<< FUNC-DECLS [Int4] >>> ***/
216
Lev Walkindfae9752004-09-29 13:19:37 +0000217extern asn_TYPE_descriptor_t asn_DEF_Int4;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000218asn_struct_free_f Int4_free;
219asn_struct_print_f Int4_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000220asn_constr_check_f Int4_constraint;
221ber_type_decoder_f Int4_decode_ber;
222der_type_encoder_f Int4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000223xer_type_decoder_f Int4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000224xer_type_encoder_f Int4_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000225
226/*** <<< CODE [Int4] >>> ***/
227
228int
Lev Walkindfae9752004-09-29 13:19:37 +0000229Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000230 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000231 const Int3_t *st = (const Int3_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000232 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000233
234 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700235 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000236 "%s: value not given (%s:%d)",
237 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000238 return -1;
239 }
240
Lev Walkindfae9752004-09-29 13:19:37 +0000241 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700242 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000243 "%s: value too large (%s:%d)",
244 td->name, __FILE__, __LINE__);
245 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000246 }
247
Lev Walkind35c8b52004-08-25 02:08:08 +0000248 if((value >= 1 && value <= 10)) {
249 /* Constraint check succeeded */
250 return 0;
251 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700252 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000253 "%s: constraint failed (%s:%d)",
254 td->name, __FILE__, __LINE__);
255 return -1;
256 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000257}
258
259/*
260 * This type is implemented using Int3,
Lev Walkinc3808c12004-09-23 22:14:58 +0000261 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000262 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000263
264/*** <<< STAT-DEFS [Int4] >>> ***/
265
Lev Walkina7591b52014-10-12 18:37:35 -0700266static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000267 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000268};
Lev Walkindfae9752004-09-29 13:19:37 +0000269asn_TYPE_descriptor_t asn_DEF_Int4 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000270 "Int4",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000271 "Int4",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800272 &asn_OP_INTEGER,
Lev Walkin006de1c2004-08-20 13:37:45 +0000273 Int4_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000274 asn_DEF_Int4_tags_1,
275 sizeof(asn_DEF_Int4_tags_1)
276 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
277 asn_DEF_Int4_tags_1, /* Same as above */
278 sizeof(asn_DEF_Int4_tags_1)
279 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400280 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000281 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000282 0, 0, /* No members */
283 0 /* No specifics */
284};
285
286
287/*** <<< INCLUDES [Int5] >>> ***/
288
Lev Walkin22b5ed42006-09-13 02:51:20 +0000289#include "Int4.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000290
291/*** <<< TYPE-DECLS [Int5] >>> ***/
292
Lev Walkin006de1c2004-08-20 13:37:45 +0000293typedef Int4_t Int5_t;
294
Lev Walkin006de1c2004-08-20 13:37:45 +0000295/*** <<< FUNC-DECLS [Int5] >>> ***/
296
Lev Walkindfae9752004-09-29 13:19:37 +0000297extern asn_TYPE_descriptor_t asn_DEF_Int5;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000298asn_struct_free_f Int5_free;
299asn_struct_print_f Int5_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000300asn_constr_check_f Int5_constraint;
301ber_type_decoder_f Int5_decode_ber;
302der_type_encoder_f Int5_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000303xer_type_decoder_f Int5_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000304xer_type_encoder_f Int5_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000305
306/*** <<< CODE [Int5] >>> ***/
307
308int
Lev Walkindfae9752004-09-29 13:19:37 +0000309Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000310 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000311 const Int4_t *st = (const Int4_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000312 long value;
313
314 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700315 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000316 "%s: value not given (%s:%d)",
317 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000318 return -1;
319 }
320
Lev Walkindfae9752004-09-29 13:19:37 +0000321 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700322 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000323 "%s: value too large (%s:%d)",
324 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000325 return -1;
326 }
327
328 if((value == 5)) {
329 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000330 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000331 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700332 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000333 "%s: constraint failed (%s:%d)",
334 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000335 return -1;
336 }
337}
338
339/*
340 * This type is implemented using Int4,
Lev Walkinc3808c12004-09-23 22:14:58 +0000341 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000342 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000343
344/*** <<< STAT-DEFS [Int5] >>> ***/
345
Lev Walkina7591b52014-10-12 18:37:35 -0700346static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000347 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000348};
Lev Walkindfae9752004-09-29 13:19:37 +0000349asn_TYPE_descriptor_t asn_DEF_Int5 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000350 "Int5",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000351 "Int5",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800352 &asn_OP_INTEGER,
Lev Walkin006de1c2004-08-20 13:37:45 +0000353 Int5_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000354 asn_DEF_Int5_tags_1,
355 sizeof(asn_DEF_Int5_tags_1)
356 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
357 asn_DEF_Int5_tags_1, /* Same as above */
358 sizeof(asn_DEF_Int5_tags_1)
359 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400360 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000361 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000362 0, 0, /* No members */
363 0 /* No specifics */
364};
365
366
367/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
368
369#include <INTEGER.h>
370
371/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
372
Lev Walkin006de1c2004-08-20 13:37:45 +0000373typedef INTEGER_t ExtensibleExtensions_t;
374
Lev Walkin006de1c2004-08-20 13:37:45 +0000375/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
376
Lev Walkindfae9752004-09-29 13:19:37 +0000377extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000378asn_struct_free_f ExtensibleExtensions_free;
379asn_struct_print_f ExtensibleExtensions_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000380asn_constr_check_f ExtensibleExtensions_constraint;
381ber_type_decoder_f ExtensibleExtensions_decode_ber;
382der_type_encoder_f ExtensibleExtensions_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000383xer_type_decoder_f ExtensibleExtensions_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000384xer_type_encoder_f ExtensibleExtensions_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000385
386/*** <<< CODE [ExtensibleExtensions] >>> ***/
387
388int
Lev Walkindfae9752004-09-29 13:19:37 +0000389ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000390 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000391 const INTEGER_t *st = (const INTEGER_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000392 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000393
394 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700395 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000396 "%s: value not given (%s:%d)",
397 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000398 return -1;
399 }
400
Lev Walkindfae9752004-09-29 13:19:37 +0000401 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700402 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000403 "%s: value too large (%s:%d)",
404 td->name, __FILE__, __LINE__);
405 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000406 }
407
Lev Walkin0c686452017-09-07 22:59:36 -0700408 if((value >= 1 && value <= 255)) {
Lev Walkind35c8b52004-08-25 02:08:08 +0000409 /* Constraint check succeeded */
410 return 0;
411 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700412 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000413 "%s: constraint failed (%s:%d)",
414 td->name, __FILE__, __LINE__);
415 return -1;
416 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000417}
418
419/*
420 * This type is implemented using INTEGER,
Lev Walkinc3808c12004-09-23 22:14:58 +0000421 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000422 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000423
424/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
425
Lev Walkina7591b52014-10-12 18:37:35 -0700426static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000427 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
428};
Lev Walkindfae9752004-09-29 13:19:37 +0000429asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000430 "ExtensibleExtensions",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000431 "ExtensibleExtensions",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800432 &asn_OP_INTEGER,
Lev Walkin006de1c2004-08-20 13:37:45 +0000433 ExtensibleExtensions_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000434 asn_DEF_ExtensibleExtensions_tags_1,
435 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
436 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
437 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
438 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
439 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400440 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000441 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000442 0, 0, /* No members */
443 0 /* No specifics */
444};
445
446
447/*** <<< INCLUDES [Str1] >>> ***/
448
449#include <IA5String.h>
450
451/*** <<< TYPE-DECLS [Str1] >>> ***/
452
Lev Walkin006de1c2004-08-20 13:37:45 +0000453typedef IA5String_t Str1_t;
454
Lev Walkin006de1c2004-08-20 13:37:45 +0000455/*** <<< FUNC-DECLS [Str1] >>> ***/
456
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000457extern asn_TYPE_descriptor_t asn_DEF_Str1;
458asn_struct_free_f Str1_free;
459asn_struct_print_f Str1_print;
460asn_constr_check_f Str1_constraint;
461ber_type_decoder_f Str1_decode_ber;
462der_type_encoder_f Str1_encode_der;
463xer_type_decoder_f Str1_decode_xer;
464xer_type_encoder_f Str1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000465
466/*** <<< CODE [Str1] >>> ***/
467
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000468/*
469 * This type is implemented using IA5String,
470 * so here we adjust the DEF accordingly.
471 */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000472
473/*** <<< STAT-DEFS [Str1] >>> ***/
474
Lev Walkina7591b52014-10-12 18:37:35 -0700475static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000476 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
477};
478asn_TYPE_descriptor_t asn_DEF_Str1 = {
479 "Str1",
480 "Str1",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800481 &asn_OP_IA5String,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800482 IA5String_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000483 asn_DEF_Str1_tags_1,
484 sizeof(asn_DEF_Str1_tags_1)
485 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
486 asn_DEF_Str1_tags_1, /* Same as above */
487 sizeof(asn_DEF_Str1_tags_1)
488 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400489 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000490 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000491 0, 0, /* No members */
492 0 /* No specifics */
493};
Lev Walkin006de1c2004-08-20 13:37:45 +0000494
495
496/*** <<< INCLUDES [Str2] >>> ***/
497
Lev Walkin22b5ed42006-09-13 02:51:20 +0000498#include "Str1.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000499
500/*** <<< TYPE-DECLS [Str2] >>> ***/
501
Lev Walkin006de1c2004-08-20 13:37:45 +0000502typedef Str1_t Str2_t;
503
Lev Walkin006de1c2004-08-20 13:37:45 +0000504/*** <<< FUNC-DECLS [Str2] >>> ***/
505
Lev Walkindfae9752004-09-29 13:19:37 +0000506extern asn_TYPE_descriptor_t asn_DEF_Str2;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000507asn_struct_free_f Str2_free;
508asn_struct_print_f Str2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000509asn_constr_check_f Str2_constraint;
510ber_type_decoder_f Str2_decode_ber;
511der_type_encoder_f Str2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000512xer_type_decoder_f Str2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000513xer_type_encoder_f Str2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000514
515/*** <<< CTABLES [Str2] >>> ***/
516
Lev Walkine8318b82005-03-06 09:29:03 +0000517static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000518 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000519 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000520 const uint8_t *ch = st->buf;
521 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000522
523 for(; ch < end; ch++) {
524 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000525 if(!(cv <= 127)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000526 }
Lev Walkin775885e2004-08-22 12:47:03 +0000527 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000528}
529
530
531/*** <<< CODE [Str2] >>> ***/
532
533int
Lev Walkindfae9752004-09-29 13:19:37 +0000534Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000535 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000536 const Str1_t *st = (const Str1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000537 size_t size;
538
539 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700540 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000541 "%s: value not given (%s:%d)",
542 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000543 return -1;
544 }
545
546 size = st->size;
547
548 if(((size <= 20) || (size >= 25 && size <= 30))
Lev Walkine8318b82005-03-06 09:29:03 +0000549 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000550 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000551 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000552 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700553 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000554 "%s: constraint failed (%s:%d)",
555 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000556 return -1;
557 }
558}
559
560/*
561 * This type is implemented using Str1,
Lev Walkinc3808c12004-09-23 22:14:58 +0000562 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000563 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000564
565/*** <<< STAT-DEFS [Str2] >>> ***/
566
Lev Walkina7591b52014-10-12 18:37:35 -0700567static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000568 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000569};
Lev Walkindfae9752004-09-29 13:19:37 +0000570asn_TYPE_descriptor_t asn_DEF_Str2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000571 "Str2",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000572 "Str2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800573 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +0000574 Str2_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000575 asn_DEF_Str2_tags_1,
576 sizeof(asn_DEF_Str2_tags_1)
577 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
578 asn_DEF_Str2_tags_1, /* Same as above */
579 sizeof(asn_DEF_Str2_tags_1)
580 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400581 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000582 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000583 0, 0, /* No members */
584 0 /* No specifics */
585};
586
587
588/*** <<< INCLUDES [Str3] >>> ***/
589
Lev Walkin22b5ed42006-09-13 02:51:20 +0000590#include "Str2.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000591
592/*** <<< TYPE-DECLS [Str3] >>> ***/
593
Lev Walkin006de1c2004-08-20 13:37:45 +0000594typedef Str2_t Str3_t;
595
Lev Walkin006de1c2004-08-20 13:37:45 +0000596/*** <<< FUNC-DECLS [Str3] >>> ***/
597
Lev Walkindfae9752004-09-29 13:19:37 +0000598extern asn_TYPE_descriptor_t asn_DEF_Str3;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000599asn_struct_free_f Str3_free;
600asn_struct_print_f Str3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000601asn_constr_check_f Str3_constraint;
602ber_type_decoder_f Str3_decode_ber;
603der_type_encoder_f Str3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000604xer_type_decoder_f Str3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000605xer_type_encoder_f Str3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000606
607/*** <<< CTABLES [Str3] >>> ***/
608
Lev Walkina7591b52014-10-12 18:37:35 -0700609static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000610 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
611 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
612 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
613 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
614 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
615 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
616 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin006de1c2004-08-20 13:37:45 +0000617};
618
Lev Walkine8318b82005-03-06 09:29:03 +0000619static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -0700620 const int *table = permitted_alphabet_table_1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000621 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000622 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000623 const uint8_t *ch = st->buf;
624 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000625
626 for(; ch < end; ch++) {
627 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000628 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000629 }
Lev Walkin775885e2004-08-22 12:47:03 +0000630 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000631}
632
633
634/*** <<< CODE [Str3] >>> ***/
635
636int
Lev Walkindfae9752004-09-29 13:19:37 +0000637Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000638 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000639 const Str2_t *st = (const Str2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000640 size_t size;
641
642 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700643 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000644 "%s: value not given (%s:%d)",
645 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000646 return -1;
647 }
648
649 size = st->size;
650
651 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
Lev Walkine8318b82005-03-06 09:29:03 +0000652 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000653 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000654 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000655 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700656 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000657 "%s: constraint failed (%s:%d)",
658 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000659 return -1;
660 }
661}
662
663/*
664 * This type is implemented using Str2,
Lev Walkinc3808c12004-09-23 22:14:58 +0000665 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000666 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000667
668/*** <<< STAT-DEFS [Str3] >>> ***/
669
Lev Walkina7591b52014-10-12 18:37:35 -0700670static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000671 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000672};
Lev Walkindfae9752004-09-29 13:19:37 +0000673asn_TYPE_descriptor_t asn_DEF_Str3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000674 "Str3",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000675 "Str3",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800676 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +0000677 Str3_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000678 asn_DEF_Str3_tags_1,
679 sizeof(asn_DEF_Str3_tags_1)
680 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
681 asn_DEF_Str3_tags_1, /* Same as above */
682 sizeof(asn_DEF_Str3_tags_1)
683 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400684 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000685 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000686 0, 0, /* No members */
687 0 /* No specifics */
688};
689
690
Lev Walkin8a99bf72004-09-10 06:07:39 +0000691/*** <<< INCLUDES [Str4] >>> ***/
692
693#include <IA5String.h>
694
695/*** <<< TYPE-DECLS [Str4] >>> ***/
696
Lev Walkin8a99bf72004-09-10 06:07:39 +0000697typedef IA5String_t Str4_t;
698
699/*** <<< FUNC-DECLS [Str4] >>> ***/
700
Lev Walkindfae9752004-09-29 13:19:37 +0000701extern asn_TYPE_descriptor_t asn_DEF_Str4;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000702asn_struct_free_f Str4_free;
703asn_struct_print_f Str4_print;
Lev Walkin8a99bf72004-09-10 06:07:39 +0000704asn_constr_check_f Str4_constraint;
705ber_type_decoder_f Str4_decode_ber;
706der_type_encoder_f Str4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000707xer_type_decoder_f Str4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000708xer_type_encoder_f Str4_encode_xer;
Lev Walkin8a99bf72004-09-10 06:07:39 +0000709
710/*** <<< CTABLES [Str4] >>> ***/
711
Lev Walkine8318b82005-03-06 09:29:03 +0000712static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin8a99bf72004-09-10 06:07:39 +0000713 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000714 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +0000715 const uint8_t *ch = st->buf;
716 const uint8_t *end = ch + st->size;
717
718 for(; ch < end; ch++) {
719 uint8_t cv = *ch;
720 if(!(cv <= 127)) return -1;
721 }
722 return 0;
723}
724
725
726/*** <<< CODE [Str4] >>> ***/
727
728int
Lev Walkindfae9752004-09-29 13:19:37 +0000729Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000730 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000731 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +0000732
733 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700734 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +0000735 "%s: value not given (%s:%d)",
736 td->name, __FILE__, __LINE__);
737 return -1;
738 }
739
740
Lev Walkine8318b82005-03-06 09:29:03 +0000741 if(!check_permitted_alphabet_1(st)) {
Lev Walkin8a99bf72004-09-10 06:07:39 +0000742 /* Constraint check succeeded */
743 return 0;
744 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700745 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +0000746 "%s: constraint failed (%s:%d)",
747 td->name, __FILE__, __LINE__);
748 return -1;
749 }
750}
751
752/*
753 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +0000754 * so here we adjust the DEF accordingly.
Lev Walkin8a99bf72004-09-10 06:07:39 +0000755 */
Lev Walkin8a99bf72004-09-10 06:07:39 +0000756
757/*** <<< STAT-DEFS [Str4] >>> ***/
758
Lev Walkina7591b52014-10-12 18:37:35 -0700759static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
Lev Walkin8a99bf72004-09-10 06:07:39 +0000760 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
761};
Lev Walkindfae9752004-09-29 13:19:37 +0000762asn_TYPE_descriptor_t asn_DEF_Str4 = {
Lev Walkin8a99bf72004-09-10 06:07:39 +0000763 "Str4",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000764 "Str4",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800765 &asn_OP_IA5String,
Lev Walkin8a99bf72004-09-10 06:07:39 +0000766 Str4_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000767 asn_DEF_Str4_tags_1,
768 sizeof(asn_DEF_Str4_tags_1)
769 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
770 asn_DEF_Str4_tags_1, /* Same as above */
771 sizeof(asn_DEF_Str4_tags_1)
772 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400773 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000774 0, /* No PER visible constraints */
Lev Walkin8a99bf72004-09-10 06:07:39 +0000775 0, 0, /* No members */
776 0 /* No specifics */
777};
778
779
Lev Walkin006de1c2004-08-20 13:37:45 +0000780/*** <<< INCLUDES [PER-Visible] >>> ***/
781
782#include <IA5String.h>
783
784/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
785
Lev Walkin006de1c2004-08-20 13:37:45 +0000786typedef IA5String_t PER_Visible_t;
787
Lev Walkin006de1c2004-08-20 13:37:45 +0000788/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
789
Lev Walkindfae9752004-09-29 13:19:37 +0000790extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000791asn_struct_free_f PER_Visible_free;
792asn_struct_print_f PER_Visible_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000793asn_constr_check_f PER_Visible_constraint;
794ber_type_decoder_f PER_Visible_decode_ber;
795der_type_encoder_f PER_Visible_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000796xer_type_decoder_f PER_Visible_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000797xer_type_encoder_f PER_Visible_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000798
799/*** <<< CTABLES [PER-Visible] >>> ***/
800
Lev Walkine8318b82005-03-06 09:29:03 +0000801static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000802 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000803 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000804 const uint8_t *ch = st->buf;
805 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000806
807 for(; ch < end; ch++) {
808 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000809 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000810 }
Lev Walkin775885e2004-08-22 12:47:03 +0000811 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000812}
813
814
815/*** <<< CODE [PER-Visible] >>> ***/
816
817int
Lev Walkindfae9752004-09-29 13:19:37 +0000818PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000819 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000820 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000821
822 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700823 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000824 "%s: value not given (%s:%d)",
825 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000826 return -1;
827 }
828
829
Lev Walkine8318b82005-03-06 09:29:03 +0000830 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000831 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000832 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000833 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700834 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000835 "%s: constraint failed (%s:%d)",
836 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000837 return -1;
838 }
839}
840
841/*
842 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +0000843 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000844 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000845
846/*** <<< STAT-DEFS [PER-Visible] >>> ***/
847
Lev Walkina7591b52014-10-12 18:37:35 -0700848static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000849 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
850};
Lev Walkindfae9752004-09-29 13:19:37 +0000851asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000852 "PER-Visible",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000853 "PER-Visible",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800854 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +0000855 PER_Visible_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000856 asn_DEF_PER_Visible_tags_1,
857 sizeof(asn_DEF_PER_Visible_tags_1)
858 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
859 asn_DEF_PER_Visible_tags_1, /* Same as above */
860 sizeof(asn_DEF_PER_Visible_tags_1)
861 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400862 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000863 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000864 0, 0, /* No members */
865 0 /* No specifics */
866};
867
868
869/*** <<< INCLUDES [PER-Visible-2] >>> ***/
870
Lev Walkin22b5ed42006-09-13 02:51:20 +0000871#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000872
873/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
874
Lev Walkin006de1c2004-08-20 13:37:45 +0000875typedef PER_Visible_t PER_Visible_2_t;
876
Lev Walkin006de1c2004-08-20 13:37:45 +0000877/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
878
Lev Walkindfae9752004-09-29 13:19:37 +0000879extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000880asn_struct_free_f PER_Visible_2_free;
881asn_struct_print_f PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000882asn_constr_check_f PER_Visible_2_constraint;
883ber_type_decoder_f PER_Visible_2_decode_ber;
884der_type_encoder_f PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000885xer_type_decoder_f PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000886xer_type_encoder_f PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000887
888/*** <<< CTABLES [PER-Visible-2] >>> ***/
889
Lev Walkine8318b82005-03-06 09:29:03 +0000890static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000891 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000892 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000893 const uint8_t *ch = st->buf;
894 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000895
896 for(; ch < end; ch++) {
897 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000898 if(!(cv >= 69 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000899 }
Lev Walkin775885e2004-08-22 12:47:03 +0000900 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000901}
902
903
904/*** <<< CODE [PER-Visible-2] >>> ***/
905
906int
Lev Walkindfae9752004-09-29 13:19:37 +0000907PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000908 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000909 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000910
911 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700912 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000913 "%s: value not given (%s:%d)",
914 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000915 return -1;
916 }
917
918
Lev Walkine8318b82005-03-06 09:29:03 +0000919 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000920 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000921 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000922 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700923 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000924 "%s: constraint failed (%s:%d)",
925 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000926 return -1;
927 }
928}
929
930/*
931 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +0000932 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000933 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000934
935/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
936
Lev Walkina7591b52014-10-12 18:37:35 -0700937static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000938 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000939};
Lev Walkindfae9752004-09-29 13:19:37 +0000940asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000941 "PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000942 "PER-Visible-2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800943 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +0000944 PER_Visible_2_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000945 asn_DEF_PER_Visible_2_tags_1,
946 sizeof(asn_DEF_PER_Visible_2_tags_1)
947 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
948 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
949 sizeof(asn_DEF_PER_Visible_2_tags_1)
950 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400951 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000952 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000953 0, 0, /* No members */
954 0 /* No specifics */
955};
956
957
958/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
959
Lev Walkin22b5ed42006-09-13 02:51:20 +0000960#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000961
962/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
963
Lev Walkin006de1c2004-08-20 13:37:45 +0000964typedef PER_Visible_t Not_PER_Visible_1_t;
965
Lev Walkin006de1c2004-08-20 13:37:45 +0000966/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
967
Lev Walkindfae9752004-09-29 13:19:37 +0000968extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000969asn_struct_free_f Not_PER_Visible_1_free;
970asn_struct_print_f Not_PER_Visible_1_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000971asn_constr_check_f Not_PER_Visible_1_constraint;
972ber_type_decoder_f Not_PER_Visible_1_decode_ber;
973der_type_encoder_f Not_PER_Visible_1_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000974xer_type_decoder_f Not_PER_Visible_1_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000975xer_type_encoder_f Not_PER_Visible_1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000976
977/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
978
Lev Walkine8318b82005-03-06 09:29:03 +0000979static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000980 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000981 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000982 const uint8_t *ch = st->buf;
983 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000984
985 for(; ch < end; ch++) {
986 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000987 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000988 }
Lev Walkin775885e2004-08-22 12:47:03 +0000989 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000990}
991
992
993/*** <<< CODE [Not-PER-Visible-1] >>> ***/
994
995int
Lev Walkindfae9752004-09-29 13:19:37 +0000996Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000997 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000998 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000999
1000 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001001 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001002 "%s: value not given (%s:%d)",
1003 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001004 return -1;
1005 }
1006
1007
Lev Walkine8318b82005-03-06 09:29:03 +00001008 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001009 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001010 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001011 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001012 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001013 "%s: constraint failed (%s:%d)",
1014 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001015 return -1;
1016 }
1017}
1018
1019/*
1020 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001021 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001022 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001023
1024/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
1025
Lev Walkina7591b52014-10-12 18:37:35 -07001026static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001027 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001028};
Lev Walkindfae9752004-09-29 13:19:37 +00001029asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001030 "Not-PER-Visible-1",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001031 "Not-PER-Visible-1",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001032 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +00001033 Not_PER_Visible_1_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001034 asn_DEF_Not_PER_Visible_1_tags_1,
1035 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1036 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
1037 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
1038 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1039 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001040 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001041 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001042 0, 0, /* No members */
1043 0 /* No specifics */
1044};
1045
1046
1047/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
1048
Lev Walkin22b5ed42006-09-13 02:51:20 +00001049#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001050
1051/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
1052
Lev Walkin006de1c2004-08-20 13:37:45 +00001053typedef PER_Visible_t Not_PER_Visible_2_t;
1054
Lev Walkin006de1c2004-08-20 13:37:45 +00001055/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
1056
Lev Walkindfae9752004-09-29 13:19:37 +00001057extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001058asn_struct_free_f Not_PER_Visible_2_free;
1059asn_struct_print_f Not_PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001060asn_constr_check_f Not_PER_Visible_2_constraint;
1061ber_type_decoder_f Not_PER_Visible_2_decode_ber;
1062der_type_encoder_f Not_PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001063xer_type_decoder_f Not_PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001064xer_type_encoder_f Not_PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001065
Lev Walkind35c8b52004-08-25 02:08:08 +00001066/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
1067
Lev Walkine8318b82005-03-06 09:29:03 +00001068static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001069 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001070 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00001071 const uint8_t *ch = st->buf;
1072 const uint8_t *end = ch + st->size;
1073
1074 for(; ch < end; ch++) {
1075 uint8_t cv = *ch;
1076 if(!(cv >= 65 && cv <= 66)) return -1;
1077 }
1078 return 0;
1079}
1080
1081
Lev Walkin006de1c2004-08-20 13:37:45 +00001082/*** <<< CODE [Not-PER-Visible-2] >>> ***/
1083
1084int
Lev Walkindfae9752004-09-29 13:19:37 +00001085Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001086 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001087 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001088
1089 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001090 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001091 "%s: value not given (%s:%d)",
1092 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001093 return -1;
1094 }
1095
1096
Lev Walkine8318b82005-03-06 09:29:03 +00001097 if(!check_permitted_alphabet_1(st)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001098 /* Constraint check succeeded */
1099 return 0;
1100 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001101 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +00001102 "%s: constraint failed (%s:%d)",
1103 td->name, __FILE__, __LINE__);
1104 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001105 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001106}
1107
1108/*
1109 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001110 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001111 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001112
1113/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
1114
Lev Walkina7591b52014-10-12 18:37:35 -07001115static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001116 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001117};
Lev Walkindfae9752004-09-29 13:19:37 +00001118asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001119 "Not-PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001120 "Not-PER-Visible-2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001121 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +00001122 Not_PER_Visible_2_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001123 asn_DEF_Not_PER_Visible_2_tags_1,
1124 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1125 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
1126 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
1127 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1128 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001129 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001130 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001131 0, 0, /* No members */
1132 0 /* No specifics */
1133};
1134
1135
1136/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
1137
Lev Walkin22b5ed42006-09-13 02:51:20 +00001138#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001139
1140/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
1141
Lev Walkin006de1c2004-08-20 13:37:45 +00001142typedef PER_Visible_t Not_PER_Visible_3_t;
1143
Lev Walkin006de1c2004-08-20 13:37:45 +00001144/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
1145
Lev Walkindfae9752004-09-29 13:19:37 +00001146extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001147asn_struct_free_f Not_PER_Visible_3_free;
1148asn_struct_print_f Not_PER_Visible_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001149asn_constr_check_f Not_PER_Visible_3_constraint;
1150ber_type_decoder_f Not_PER_Visible_3_decode_ber;
1151der_type_encoder_f Not_PER_Visible_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001152xer_type_decoder_f Not_PER_Visible_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001153xer_type_encoder_f Not_PER_Visible_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001154
Lev Walkind35c8b52004-08-25 02:08:08 +00001155/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
1156
Lev Walkine8318b82005-03-06 09:29:03 +00001157static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001158 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001159 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00001160 const uint8_t *ch = st->buf;
1161 const uint8_t *end = ch + st->size;
1162
1163 for(; ch < end; ch++) {
1164 uint8_t cv = *ch;
1165 if(!(cv >= 65 && cv <= 66)) return -1;
1166 }
1167 return 0;
1168}
1169
1170
Lev Walkin006de1c2004-08-20 13:37:45 +00001171/*** <<< CODE [Not-PER-Visible-3] >>> ***/
1172
1173int
Lev Walkindfae9752004-09-29 13:19:37 +00001174Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001175 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001176 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001177
1178 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001179 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001180 "%s: value not given (%s:%d)",
1181 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001182 return -1;
1183 }
1184
1185
Lev Walkine8318b82005-03-06 09:29:03 +00001186 if(!check_permitted_alphabet_1(st)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001187 /* Constraint check succeeded */
1188 return 0;
1189 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001190 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +00001191 "%s: constraint failed (%s:%d)",
1192 td->name, __FILE__, __LINE__);
1193 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001194 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001195}
1196
1197/*
1198 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001199 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001200 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001201
1202/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
1203
Lev Walkina7591b52014-10-12 18:37:35 -07001204static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001205 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001206};
Lev Walkindfae9752004-09-29 13:19:37 +00001207asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001208 "Not-PER-Visible-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001209 "Not-PER-Visible-3",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001210 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +00001211 Not_PER_Visible_3_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001212 asn_DEF_Not_PER_Visible_3_tags_1,
1213 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1214 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
1215 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
1216 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1217 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001218 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001219 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001220 0, 0, /* No members */
1221 0 /* No specifics */
1222};
1223
1224
1225/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
1226
Lev Walkin22b5ed42006-09-13 02:51:20 +00001227#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001228
1229/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
1230
Lev Walkin006de1c2004-08-20 13:37:45 +00001231typedef PER_Visible_t SIZE_but_not_FROM_t;
1232
Lev Walkin006de1c2004-08-20 13:37:45 +00001233/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
1234
Lev Walkindfae9752004-09-29 13:19:37 +00001235extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001236asn_struct_free_f SIZE_but_not_FROM_free;
1237asn_struct_print_f SIZE_but_not_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001238asn_constr_check_f SIZE_but_not_FROM_constraint;
1239ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
1240der_type_encoder_f SIZE_but_not_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001241xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001242xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001243
1244/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
1245
Lev Walkine8318b82005-03-06 09:29:03 +00001246static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001247 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001248 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001249 const uint8_t *ch = st->buf;
1250 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001251
1252 for(; ch < end; ch++) {
1253 uint8_t cv = *ch;
Lev Walkind35c8b52004-08-25 02:08:08 +00001254 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001255 }
Lev Walkin775885e2004-08-22 12:47:03 +00001256 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001257}
1258
1259
1260/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
1261
1262int
Lev Walkindfae9752004-09-29 13:19:37 +00001263SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001264 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001265 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001266 size_t size;
1267
1268 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001269 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001270 "%s: value not given (%s:%d)",
1271 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001272 return -1;
1273 }
1274
1275 size = st->size;
1276
1277 if((size >= 1 && size <= 4)
Lev Walkine8318b82005-03-06 09:29:03 +00001278 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001279 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001280 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001281 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001282 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001283 "%s: constraint failed (%s:%d)",
1284 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001285 return -1;
1286 }
1287}
1288
1289/*
1290 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001291 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001292 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001293
1294/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
1295
Lev Walkina7591b52014-10-12 18:37:35 -07001296static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001297 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001298};
Lev Walkindfae9752004-09-29 13:19:37 +00001299asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001300 "SIZE-but-not-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001301 "SIZE-but-not-FROM",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001302 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +00001303 SIZE_but_not_FROM_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001304 asn_DEF_SIZE_but_not_FROM_tags_1,
1305 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1306 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
1307 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
1308 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1309 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001310 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001311 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001312 0, 0, /* No members */
1313 0 /* No specifics */
1314};
1315
1316
1317/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
1318
Lev Walkin22b5ed42006-09-13 02:51:20 +00001319#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001320
1321/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
1322
Lev Walkin006de1c2004-08-20 13:37:45 +00001323typedef PER_Visible_t SIZE_and_FROM_t;
1324
Lev Walkin006de1c2004-08-20 13:37:45 +00001325/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
1326
Lev Walkindfae9752004-09-29 13:19:37 +00001327extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001328asn_struct_free_f SIZE_and_FROM_free;
1329asn_struct_print_f SIZE_and_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001330asn_constr_check_f SIZE_and_FROM_constraint;
1331ber_type_decoder_f SIZE_and_FROM_decode_ber;
1332der_type_encoder_f SIZE_and_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001333xer_type_decoder_f SIZE_and_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001334xer_type_encoder_f SIZE_and_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001335
1336/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
1337
Lev Walkine8318b82005-03-06 09:29:03 +00001338static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001339 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001340 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001341 const uint8_t *ch = st->buf;
1342 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001343
1344 for(; ch < end; ch++) {
1345 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001346 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001347 }
Lev Walkin775885e2004-08-22 12:47:03 +00001348 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001349}
1350
1351
1352/*** <<< CODE [SIZE-and-FROM] >>> ***/
1353
1354int
Lev Walkindfae9752004-09-29 13:19:37 +00001355SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001356 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001357 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001358 size_t size;
1359
1360 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001361 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001362 "%s: value not given (%s:%d)",
1363 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001364 return -1;
1365 }
1366
1367 size = st->size;
1368
1369 if((size >= 1 && size <= 4)
Lev Walkine8318b82005-03-06 09:29:03 +00001370 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001371 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001372 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001373 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001374 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001375 "%s: constraint failed (%s:%d)",
1376 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001377 return -1;
1378 }
1379}
1380
1381/*
1382 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001383 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001384 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001385
1386/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
1387
Lev Walkina7591b52014-10-12 18:37:35 -07001388static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001389 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001390};
Lev Walkindfae9752004-09-29 13:19:37 +00001391asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001392 "SIZE-and-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001393 "SIZE-and-FROM",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001394 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +00001395 SIZE_and_FROM_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001396 asn_DEF_SIZE_and_FROM_tags_1,
1397 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1398 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
1399 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
1400 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1401 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001402 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001403 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001404 0, 0, /* No members */
1405 0 /* No specifics */
1406};
1407
1408
1409/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
1410
Lev Walkin22b5ed42006-09-13 02:51:20 +00001411#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001412
1413/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1414
Lev Walkin006de1c2004-08-20 13:37:45 +00001415typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
1416
Lev Walkin006de1c2004-08-20 13:37:45 +00001417/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1418
Lev Walkindfae9752004-09-29 13:19:37 +00001419extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001420asn_struct_free_f Neither_SIZE_nor_FROM_free;
1421asn_struct_print_f Neither_SIZE_nor_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001422asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
1423ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
1424der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001425xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001426xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001427
1428/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
1429
Lev Walkine8318b82005-03-06 09:29:03 +00001430static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001431 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001432 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001433 const uint8_t *ch = st->buf;
1434 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001435
1436 for(; ch < end; ch++) {
1437 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001438 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001439 }
Lev Walkin775885e2004-08-22 12:47:03 +00001440 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001441}
1442
1443
1444/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
1445
1446int
Lev Walkindfae9752004-09-29 13:19:37 +00001447Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001448 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001449 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001450
1451 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001452 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001453 "%s: value not given (%s:%d)",
1454 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001455 return -1;
1456 }
1457
1458
Lev Walkine8318b82005-03-06 09:29:03 +00001459 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001460 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001461 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001462 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001463 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001464 "%s: constraint failed (%s:%d)",
1465 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001466 return -1;
1467 }
1468}
1469
1470/*
1471 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001472 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001473 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001474
1475/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
1476
Lev Walkina7591b52014-10-12 18:37:35 -07001477static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001478 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001479};
Lev Walkindfae9752004-09-29 13:19:37 +00001480asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001481 "Neither-SIZE-nor-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001482 "Neither-SIZE-nor-FROM",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001483 &asn_OP_IA5String,
Lev Walkin006de1c2004-08-20 13:37:45 +00001484 Neither_SIZE_nor_FROM_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001485 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
1486 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1487 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
1488 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
1489 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1490 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001491 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001492 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001493 0, 0, /* No members */
1494 0 /* No specifics */
1495};
1496
1497
Lev Walkin55cc44a2004-10-03 09:14:32 +00001498/*** <<< INCLUDES [Utf8-4] >>> ***/
1499
1500#include <UTF8String.h>
1501
1502/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
1503
Lev Walkin55cc44a2004-10-03 09:14:32 +00001504typedef UTF8String_t Utf8_4_t;
1505
1506/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
1507
1508extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
1509asn_struct_free_f Utf8_4_free;
1510asn_struct_print_f Utf8_4_print;
1511asn_constr_check_f Utf8_4_constraint;
1512ber_type_decoder_f Utf8_4_decode_ber;
1513der_type_encoder_f Utf8_4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001514xer_type_decoder_f Utf8_4_decode_xer;
Lev Walkin55cc44a2004-10-03 09:14:32 +00001515xer_type_encoder_f Utf8_4_encode_xer;
1516
1517/*** <<< CTABLES [Utf8-4] >>> ***/
1518
Lev Walkine8318b82005-03-06 09:29:03 +00001519static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00001520 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
1521 return -1; /* Alphabet (sic!) test failed. */
1522
1523 return 0;
1524}
1525
1526
1527/*** <<< CODE [Utf8-4] >>> ***/
1528
1529int
1530Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001531 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001532 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin55cc44a2004-10-03 09:14:32 +00001533
1534 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001535 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin55cc44a2004-10-03 09:14:32 +00001536 "%s: value not given (%s:%d)",
1537 td->name, __FILE__, __LINE__);
1538 return -1;
1539 }
1540
1541
Lev Walkine8318b82005-03-06 09:29:03 +00001542 if(!check_permitted_alphabet_1(st)) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00001543 /* Constraint check succeeded */
1544 return 0;
1545 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001546 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin55cc44a2004-10-03 09:14:32 +00001547 "%s: constraint failed (%s:%d)",
1548 td->name, __FILE__, __LINE__);
1549 return -1;
1550 }
1551}
1552
1553/*
1554 * This type is implemented using UTF8String,
1555 * so here we adjust the DEF accordingly.
1556 */
Lev Walkin55cc44a2004-10-03 09:14:32 +00001557
1558/*** <<< STAT-DEFS [Utf8-4] >>> ***/
1559
Lev Walkina7591b52014-10-12 18:37:35 -07001560static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
Lev Walkin55cc44a2004-10-03 09:14:32 +00001561 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
1562};
1563asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
1564 "Utf8-4",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001565 "Utf8-4",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001566 &asn_OP_UTF8String,
Lev Walkin55cc44a2004-10-03 09:14:32 +00001567 Utf8_4_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001568 asn_DEF_Utf8_4_tags_1,
1569 sizeof(asn_DEF_Utf8_4_tags_1)
1570 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
1571 asn_DEF_Utf8_4_tags_1, /* Same as above */
1572 sizeof(asn_DEF_Utf8_4_tags_1)
1573 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001574 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001575 0, /* No PER visible constraints */
Lev Walkin55cc44a2004-10-03 09:14:32 +00001576 0, 0, /* No members */
1577 0 /* No specifics */
1578};
1579
1580
Lev Walkin006de1c2004-08-20 13:37:45 +00001581/*** <<< INCLUDES [Utf8-3] >>> ***/
1582
Lev Walkin22b5ed42006-09-13 02:51:20 +00001583#include "Utf8-2.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001584
1585/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
1586
Lev Walkin006de1c2004-08-20 13:37:45 +00001587typedef Utf8_2_t Utf8_3_t;
1588
Lev Walkin006de1c2004-08-20 13:37:45 +00001589/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
1590
Lev Walkindfae9752004-09-29 13:19:37 +00001591extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001592asn_struct_free_f Utf8_3_free;
1593asn_struct_print_f Utf8_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001594asn_constr_check_f Utf8_3_constraint;
1595ber_type_decoder_f Utf8_3_decode_ber;
1596der_type_encoder_f Utf8_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001597xer_type_decoder_f Utf8_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001598xer_type_encoder_f Utf8_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001599
1600/*** <<< CTABLES [Utf8-3] >>> ***/
1601
Lev Walkina7591b52014-10-12 18:37:35 -07001602static const int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1604 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1605 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1606 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1607 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
160816,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
1609 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
161042,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin006de1c2004-08-20 13:37:45 +00001611};
1612
Lev Walkine8318b82005-03-06 09:29:03 +00001613static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07001614 const int *table = permitted_alphabet_table_1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001615 /* The underlying type is UTF8String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001616 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001617 const uint8_t *ch = st->buf;
1618 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001619
1620 for(; ch < end; ch++) {
1621 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001622 if(cv >= 0x80) return -1;
1623 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001624 }
Lev Walkin775885e2004-08-22 12:47:03 +00001625 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001626}
1627
1628
1629/*** <<< CODE [Utf8-3] >>> ***/
1630
1631int
Lev Walkindfae9752004-09-29 13:19:37 +00001632Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001633 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001634 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001635 size_t size;
1636
1637 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001638 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001639 "%s: value not given (%s:%d)",
1640 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001641 return -1;
1642 }
1643
Lev Walkinfac2e942004-10-02 16:33:46 +00001644 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00001645 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001646 ASN__CTFAIL(app_key, td, sptr,
Lev Walkinfac2e942004-10-02 16:33:46 +00001647 "%s: UTF-8: broken encoding (%s:%d)",
1648 td->name, __FILE__, __LINE__);
1649 return -1;
1650 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001651
1652 if((size >= 1 && size <= 2)
Lev Walkine8318b82005-03-06 09:29:03 +00001653 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001654 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001655 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001656 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001657 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001658 "%s: constraint failed (%s:%d)",
1659 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001660 return -1;
1661 }
1662}
1663
1664/*
1665 * This type is implemented using Utf8_2,
Lev Walkinc3808c12004-09-23 22:14:58 +00001666 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001667 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001668
1669/*** <<< STAT-DEFS [Utf8-3] >>> ***/
1670
Lev Walkina7591b52014-10-12 18:37:35 -07001671static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001672 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001673};
Lev Walkindfae9752004-09-29 13:19:37 +00001674asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001675 "Utf8-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001676 "Utf8-3",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001677 &asn_OP_UTF8String,
Lev Walkin006de1c2004-08-20 13:37:45 +00001678 Utf8_3_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001679 asn_DEF_Utf8_3_tags_1,
1680 sizeof(asn_DEF_Utf8_3_tags_1)
1681 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
1682 asn_DEF_Utf8_3_tags_1, /* Same as above */
1683 sizeof(asn_DEF_Utf8_3_tags_1)
1684 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001685 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001686 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001687 0, 0, /* No members */
1688 0 /* No specifics */
1689};
1690
1691
1692/*** <<< INCLUDES [Utf8-2] >>> ***/
1693
Lev Walkin22b5ed42006-09-13 02:51:20 +00001694#include "Utf8-1.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001695
1696/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
1697
Lev Walkin006de1c2004-08-20 13:37:45 +00001698typedef Utf8_1_t Utf8_2_t;
1699
Lev Walkin006de1c2004-08-20 13:37:45 +00001700/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
1701
Lev Walkindfae9752004-09-29 13:19:37 +00001702extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001703asn_struct_free_f Utf8_2_free;
1704asn_struct_print_f Utf8_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001705asn_constr_check_f Utf8_2_constraint;
1706ber_type_decoder_f Utf8_2_decode_ber;
1707der_type_encoder_f Utf8_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001708xer_type_decoder_f Utf8_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001709xer_type_encoder_f Utf8_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001710
1711/*** <<< CODE [Utf8-2] >>> ***/
1712
1713int
Lev Walkindfae9752004-09-29 13:19:37 +00001714Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001715 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001716 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001717 size_t size;
1718
1719 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001720 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001721 "%s: value not given (%s:%d)",
1722 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001723 return -1;
1724 }
1725
Lev Walkinfac2e942004-10-02 16:33:46 +00001726 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00001727 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001728 ASN__CTFAIL(app_key, td, sptr,
Lev Walkinfac2e942004-10-02 16:33:46 +00001729 "%s: UTF-8: broken encoding (%s:%d)",
1730 td->name, __FILE__, __LINE__);
1731 return -1;
1732 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001733
1734 if((size >= 1 && size <= 2)) {
1735 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001736 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001737 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001738 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001739 "%s: constraint failed (%s:%d)",
1740 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001741 return -1;
1742 }
1743}
1744
1745/*
1746 * This type is implemented using Utf8_1,
Lev Walkinc3808c12004-09-23 22:14:58 +00001747 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001748 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001749
1750/*** <<< STAT-DEFS [Utf8-2] >>> ***/
1751
Lev Walkina7591b52014-10-12 18:37:35 -07001752static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001753 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001754};
Lev Walkindfae9752004-09-29 13:19:37 +00001755asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001756 "Utf8-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001757 "Utf8-2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001758 &asn_OP_UTF8String,
Lev Walkin006de1c2004-08-20 13:37:45 +00001759 Utf8_2_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001760 asn_DEF_Utf8_2_tags_1,
1761 sizeof(asn_DEF_Utf8_2_tags_1)
1762 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
1763 asn_DEF_Utf8_2_tags_1, /* Same as above */
1764 sizeof(asn_DEF_Utf8_2_tags_1)
1765 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001766 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001767 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001768 0, 0, /* No members */
1769 0 /* No specifics */
1770};
1771
1772
1773/*** <<< INCLUDES [Utf8-1] >>> ***/
1774
1775#include <UTF8String.h>
1776
1777/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
1778
Lev Walkin006de1c2004-08-20 13:37:45 +00001779typedef UTF8String_t Utf8_1_t;
1780
Lev Walkin006de1c2004-08-20 13:37:45 +00001781/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
1782
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001783extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
1784asn_struct_free_f Utf8_1_free;
1785asn_struct_print_f Utf8_1_print;
1786asn_constr_check_f Utf8_1_constraint;
1787ber_type_decoder_f Utf8_1_decode_ber;
1788der_type_encoder_f Utf8_1_encode_der;
1789xer_type_decoder_f Utf8_1_decode_xer;
1790xer_type_encoder_f Utf8_1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001791
1792/*** <<< CODE [Utf8-1] >>> ***/
1793
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001794/*
1795 * This type is implemented using UTF8String,
1796 * so here we adjust the DEF accordingly.
1797 */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001798
1799/*** <<< STAT-DEFS [Utf8-1] >>> ***/
1800
Lev Walkina7591b52014-10-12 18:37:35 -07001801static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001802 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
1803};
1804asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
1805 "Utf8-1",
1806 "Utf8-1",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001807 &asn_OP_UTF8String,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001808 UTF8String_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001809 asn_DEF_Utf8_1_tags_1,
1810 sizeof(asn_DEF_Utf8_1_tags_1)
1811 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
1812 asn_DEF_Utf8_1_tags_1, /* Same as above */
1813 sizeof(asn_DEF_Utf8_1_tags_1)
1814 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001815 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001816 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001817 0, 0, /* No members */
1818 0 /* No specifics */
1819};
Lev Walkin006de1c2004-08-20 13:37:45 +00001820
Lev Walkine4ca5ce2004-09-15 11:44:13 +00001821
1822/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
1823
Lev Walkin22b5ed42006-09-13 02:51:20 +00001824#include "Identifier.h"
Lev Walkine4ca5ce2004-09-15 11:44:13 +00001825
1826/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
1827
Lev Walkine4ca5ce2004-09-15 11:44:13 +00001828typedef Identifier_t VisibleIdentifier_t;
1829
1830/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
1831
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001832extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
1833asn_struct_free_f VisibleIdentifier_free;
1834asn_struct_print_f VisibleIdentifier_print;
1835asn_constr_check_f VisibleIdentifier_constraint;
1836ber_type_decoder_f VisibleIdentifier_decode_ber;
1837der_type_encoder_f VisibleIdentifier_encode_der;
1838xer_type_decoder_f VisibleIdentifier_decode_xer;
1839xer_type_encoder_f VisibleIdentifier_encode_xer;
1840
1841/*** <<< CTABLES [VisibleIdentifier] >>> ***/
1842
Lev Walkina7591b52014-10-12 18:37:35 -07001843static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001844 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1845 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1846 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
1847 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
1848 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
184927,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
1850 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
185154,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001852};
1853
Lev Walkine8318b82005-03-06 09:29:03 +00001854static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07001855 const int *table = permitted_alphabet_table_1;
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001856 /* The underlying type is VisibleString */
1857 const VisibleString_t *st = (const VisibleString_t *)sptr;
1858 const uint8_t *ch = st->buf;
1859 const uint8_t *end = ch + st->size;
1860
1861 for(; ch < end; ch++) {
1862 uint8_t cv = *ch;
1863 if(!table[cv]) return -1;
1864 }
1865 return 0;
1866}
1867
Lev Walkine4ca5ce2004-09-15 11:44:13 +00001868
Lev Walkin154aa182004-09-26 13:12:56 +00001869/*** <<< CODE [VisibleIdentifier] >>> ***/
1870
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001871int
1872VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001873 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001874 const Identifier_t *st = (const Identifier_t *)sptr;
1875 size_t size;
1876
1877 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001878 ASN__CTFAIL(app_key, td, sptr,
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001879 "%s: value not given (%s:%d)",
1880 td->name, __FILE__, __LINE__);
1881 return -1;
1882 }
1883
1884 size = st->size;
1885
1886 if((size >= 1 && size <= 32)
Lev Walkine8318b82005-03-06 09:29:03 +00001887 && !check_permitted_alphabet_1(st)) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001888 /* Constraint check succeeded */
1889 return 0;
1890 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001891 ASN__CTFAIL(app_key, td, sptr,
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001892 "%s: constraint failed (%s:%d)",
1893 td->name, __FILE__, __LINE__);
1894 return -1;
1895 }
1896}
1897
1898/*
1899 * This type is implemented using Identifier,
1900 * so here we adjust the DEF accordingly.
1901 */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001902
1903/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
1904
Lev Walkina7591b52014-10-12 18:37:35 -07001905static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001906 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
1907};
1908asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
1909 "VisibleIdentifier",
1910 "VisibleIdentifier",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08001911 &asn_OP_VisibleString,
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001912 VisibleIdentifier_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00001913 asn_DEF_VisibleIdentifier_tags_1,
1914 sizeof(asn_DEF_VisibleIdentifier_tags_1)
1915 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
1916 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
1917 sizeof(asn_DEF_VisibleIdentifier_tags_1)
1918 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001919 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001920 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001921 0, 0, /* No members */
1922 0 /* No specifics */
1923};
Lev Walkin154aa182004-09-26 13:12:56 +00001924
1925
Lev Walkin59b176e2005-11-26 11:25:14 +00001926/*** <<< INCLUDES [Sequence] >>> ***/
1927
Lev Walkin22b5ed42006-09-13 02:51:20 +00001928#include "Int1.h"
1929#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001930#include <BOOLEAN.h>
1931#include <ENUMERATED.h>
1932#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00001933#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001934#include <constr_SEQUENCE.h>
1935
1936/*** <<< DEPS [Sequence] >>> ***/
1937
1938typedef enum enum_c {
1939 enum_c_one = 1,
1940 enum_c_two = 2,
1941 /*
1942 * Enumeration is extensible
1943 */
1944 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00001945} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00001946
1947/*** <<< TYPE-DECLS [Sequence] >>> ***/
1948
1949typedef struct Sequence {
1950 Int1_t *int1_c /* DEFAULT 3 */;
1951 Int4_t int4;
1952 Int4_t int4_c;
Lev Walkin2a744a72013-03-27 01:56:23 -07001953 BOOLEAN_t *Bool /* DEFAULT 1 */;
Lev Walkin59b176e2005-11-26 11:25:14 +00001954 ENUMERATED_t enum_c;
1955 NULL_t *null /* OPTIONAL */;
1956 /*
1957 * This type is extensible,
1958 * possible extensions are below.
1959 */
1960 Int5_t *int5_c /* OPTIONAL */;
1961
1962 /* Context for parsing across buffer boundaries */
1963 asn_struct_ctx_t _asn_ctx;
1964} Sequence_t;
1965
1966/*** <<< FUNC-DECLS [Sequence] >>> ***/
1967
1968/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
1969extern asn_TYPE_descriptor_t asn_DEF_Sequence;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001970extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
1971extern asn_TYPE_member_t asn_MBR_Sequence_1[7];
Lev Walkin59b176e2005-11-26 11:25:14 +00001972
1973/*** <<< CODE [Sequence] >>> ***/
1974
Lev Walkin59b176e2005-11-26 11:25:14 +00001975/*
1976 * This type is implemented using ENUMERATED,
1977 * so here we adjust the DEF accordingly.
1978 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001979static int
1980memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001981 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001982 const Int1_t *st = (const Int1_t *)sptr;
1983 long value;
1984
1985 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001986 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001987 "%s: value not given (%s:%d)",
1988 td->name, __FILE__, __LINE__);
1989 return -1;
1990 }
1991
1992 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001993 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001994 "%s: value too large (%s:%d)",
1995 td->name, __FILE__, __LINE__);
1996 return -1;
1997 }
1998
1999 if((value >= -2)) {
2000 /* Constraint check succeeded */
2001 return 0;
2002 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002003 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002004 "%s: constraint failed (%s:%d)",
2005 td->name, __FILE__, __LINE__);
2006 return -1;
2007 }
2008}
2009
2010static int
2011memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002012 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002013 const Int4_t *st = (const Int4_t *)sptr;
2014 long value;
2015
2016 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002017 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002018 "%s: value not given (%s:%d)",
2019 td->name, __FILE__, __LINE__);
2020 return -1;
2021 }
2022
2023 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002024 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002025 "%s: value too large (%s:%d)",
2026 td->name, __FILE__, __LINE__);
2027 return -1;
2028 }
2029
2030 if((value >= 5 && value <= 7)) {
2031 /* Constraint check succeeded */
2032 return 0;
2033 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002034 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002035 "%s: constraint failed (%s:%d)",
2036 td->name, __FILE__, __LINE__);
2037 return -1;
2038 }
2039}
2040
2041static int
2042memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002043 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002044 const Int5_t *st = (const Int5_t *)sptr;
2045 long value;
2046
2047 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002048 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002049 "%s: value not given (%s:%d)",
2050 td->name, __FILE__, __LINE__);
2051 return -1;
2052 }
2053
2054 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002055 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002056 "%s: value too large (%s:%d)",
2057 td->name, __FILE__, __LINE__);
2058 return -1;
2059 }
2060
2061 if((value == 5)) {
2062 /* Constraint check succeeded */
2063 return 0;
2064 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002065 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002066 "%s: constraint failed (%s:%d)",
2067 td->name, __FILE__, __LINE__);
2068 return -1;
2069 }
2070}
2071
2072
2073/*** <<< STAT-DEFS [Sequence] >>> ***/
2074
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002075static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002076 Int1_t *st = *sptr;
2077
2078 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002079 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00002080 st = (*sptr = CALLOC(1, sizeof(*st)));
2081 if(!st) return -1;
2082 }
2083
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002084 if(set_value) {
2085 /* Install default value 3 */
2086 return asn_long2INTEGER(st, 3);
2087 } else {
2088 /* Test default value 3 */
2089 long value;
2090 if(asn_INTEGER2long(st, &value))
2091 return -1;
2092 return (value == 3);
2093 }
Lev Walkin59b176e2005-11-26 11:25:14 +00002094}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002095static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002096 BOOLEAN_t *st = *sptr;
2097
2098 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002099 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00002100 st = (*sptr = CALLOC(1, sizeof(*st)));
2101 if(!st) return -1;
2102 }
2103
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002104 if(set_value) {
2105 /* Install default value 1 */
2106 *st = 1;
2107 return 0;
2108 } else {
2109 /* Test default value 1 */
2110 return (*st == 1);
2111 }
Lev Walkin59b176e2005-11-26 11:25:14 +00002112}
Lev Walkina7591b52014-10-12 18:37:35 -07002113static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002114 { 1, 3, "one" },
2115 { 2, 3, "two" },
2116 { 3, 5, "three" }
2117 /* This list is extensible */
2118};
Lev Walkina7591b52014-10-12 18:37:35 -07002119static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002120 0, /* one(1) */
2121 2, /* three(3) */
2122 1 /* two(2) */
2123 /* This list is extensible */
2124};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002125static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002126 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
2127 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
2128 3, /* Number of elements in the maps */
2129 3, /* Extensions before this member */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002130 1, /* Strict enumeration */
2131 0, /* Native long size */
2132 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002133};
Lev Walkina7591b52014-10-12 18:37:35 -07002134static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002135 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2136};
2137static /* Use -fall-defs-global to expose */
2138asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
2139 "enum-c",
2140 "enum-c",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08002141 &asn_OP_ENUMERATED,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002142 ENUMERATED_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00002143 asn_DEF_enum_c_tags_6,
2144 sizeof(asn_DEF_enum_c_tags_6)
2145 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
2146 asn_DEF_enum_c_tags_6, /* Same as above */
2147 sizeof(asn_DEF_enum_c_tags_6)
2148 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002149 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002150 0, /* No PER visible constraints */
2151 0, 0, /* Defined elsewhere */
2152 &asn_SPC_enum_c_specs_6 /* Additional specs */
2153};
2154
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002155asn_TYPE_member_t asn_MBR_Sequence_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002156 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
2157 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2158 .tag_mode = 0,
2159 .type = &asn_DEF_Int1,
Lev Walkin67a30122017-08-10 05:48:54 -07002160 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +00002161 .memb_constraints = memb_int1_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002162 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002163 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2164 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
2165 .name = "int1-c"
2166 },
2167 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
2168 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
2169 .tag_mode = +1, /* EXPLICIT tag at current level */
2170 .type = &asn_DEF_Int4,
Lev Walkin67a30122017-08-10 05:48:54 -07002171 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +00002172 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002173 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002174 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2175 .default_value = 0,
2176 .name = "int4"
2177 },
2178 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
2179 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2180 .tag_mode = 0,
2181 .type = &asn_DEF_Int4,
Lev Walkin67a30122017-08-10 05:48:54 -07002182 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +00002183 .memb_constraints = memb_int4_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002184 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002185 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2186 .default_value = 0,
2187 .name = "int4-c"
2188 },
Lev Walkin2a744a72013-03-27 01:56:23 -07002189 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +00002190 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
2191 .tag_mode = 0,
2192 .type = &asn_DEF_BOOLEAN,
Lev Walkin67a30122017-08-10 05:48:54 -07002193 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +00002194 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002195 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002196 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2197 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
2198 .name = "bool"
2199 },
2200 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
2201 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
2202 .tag_mode = 0,
2203 .type = &asn_DEF_enum_c_6,
Lev Walkin67a30122017-08-10 05:48:54 -07002204 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +00002205 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002206 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002207 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2208 .default_value = 0,
2209 .name = "enum-c"
2210 },
2211 { ATF_POINTER, 2, offsetof(struct Sequence, null),
2212 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
2213 .tag_mode = 0,
2214 .type = &asn_DEF_NULL,
Lev Walkin67a30122017-08-10 05:48:54 -07002215 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +00002216 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002217 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002218 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2219 .default_value = 0,
2220 .name = "null"
2221 },
2222 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
2223 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2224 .tag_mode = 0,
2225 .type = &asn_DEF_Int5,
Lev Walkin67a30122017-08-10 05:48:54 -07002226 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +00002227 .memb_constraints = memb_int5_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002228 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002229 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2230 .default_value = 0,
2231 .name = "int5-c"
2232 },
2233};
Lev Walkina7591b52014-10-12 18:37:35 -07002234static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002235 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2236};
Lev Walkina7591b52014-10-12 18:37:35 -07002237static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -07002238 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
2239 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
2240 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
2241 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
2242 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
2243 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
2244 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002245};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002246asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002247 sizeof(struct Sequence),
2248 offsetof(struct Sequence, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -07002249 .tag2el = asn_MAP_Sequence_tag2el_1,
2250 .tag2el_count = 7, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +00002251 0, 0, 0, /* Optional elements (not needed) */
2252 5, /* Start extensions */
2253 8 /* Stop extensions */
2254};
2255asn_TYPE_descriptor_t asn_DEF_Sequence = {
2256 "Sequence",
2257 "Sequence",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08002258 &asn_OP_SEQUENCE,
Lev Walkin59b176e2005-11-26 11:25:14 +00002259 SEQUENCE_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00002260 asn_DEF_Sequence_tags_1,
2261 sizeof(asn_DEF_Sequence_tags_1)
2262 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
2263 asn_DEF_Sequence_tags_1, /* Same as above */
2264 sizeof(asn_DEF_Sequence_tags_1)
2265 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002266 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002267 0, /* No PER visible constraints */
2268 asn_MBR_Sequence_1,
2269 7, /* Elements count */
2270 &asn_SPC_Sequence_specs_1 /* Additional specs */
2271};
2272
2273
2274/*** <<< INCLUDES [SequenceOf] >>> ***/
2275
2276#include <asn_SEQUENCE_OF.h>
2277#include <constr_SEQUENCE_OF.h>
2278
2279/*** <<< FWD-DECLS [SequenceOf] >>> ***/
2280
2281struct Sequence;
2282
2283/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
2284
2285typedef struct SequenceOf {
2286 A_SEQUENCE_OF(struct Sequence) list;
2287
2288 /* Context for parsing across buffer boundaries */
2289 asn_struct_ctx_t _asn_ctx;
2290} SequenceOf_t;
2291
2292/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
2293
2294extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
2295
2296/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
2297
Lev Walkin22b5ed42006-09-13 02:51:20 +00002298#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002299
2300/*** <<< STAT-DEFS [SequenceOf] >>> ***/
2301
2302static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
2303 { ATF_POINTER, 0, 0,
2304 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
2305 .tag_mode = 0,
2306 .type = &asn_DEF_Sequence,
Lev Walkin67a30122017-08-10 05:48:54 -07002307 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +00002308 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002309 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002310 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2311 .default_value = 0,
2312 .name = ""
2313 },
2314};
Lev Walkina7591b52014-10-12 18:37:35 -07002315static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002316 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2317};
2318static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
2319 sizeof(struct SequenceOf),
2320 offsetof(struct SequenceOf, _asn_ctx),
2321 0, /* XER encoding is XMLDelimitedItemList */
2322};
2323asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
2324 "SequenceOf",
2325 "SequenceOf",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08002326 &asn_OP_SEQUENCE_OF,
Lev Walkin59b176e2005-11-26 11:25:14 +00002327 SEQUENCE_OF_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00002328 asn_DEF_SequenceOf_tags_1,
2329 sizeof(asn_DEF_SequenceOf_tags_1)
2330 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
2331 asn_DEF_SequenceOf_tags_1, /* Same as above */
2332 sizeof(asn_DEF_SequenceOf_tags_1)
2333 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002334 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002335 0, /* No PER visible constraints */
2336 asn_MBR_SequenceOf_1,
2337 1, /* Single element */
2338 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
2339};
2340
2341
2342/*** <<< INCLUDES [Enum0] >>> ***/
2343
2344#include <ENUMERATED.h>
2345
2346/*** <<< DEPS [Enum0] >>> ***/
2347
2348typedef enum Enum0 {
2349 Enum0_one = 0,
2350 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00002351} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00002352
2353/*** <<< TYPE-DECLS [Enum0] >>> ***/
2354
2355typedef ENUMERATED_t Enum0_t;
2356
2357/*** <<< FUNC-DECLS [Enum0] >>> ***/
2358
2359extern asn_TYPE_descriptor_t asn_DEF_Enum0;
2360asn_struct_free_f Enum0_free;
2361asn_struct_print_f Enum0_print;
2362asn_constr_check_f Enum0_constraint;
2363ber_type_decoder_f Enum0_decode_ber;
2364der_type_encoder_f Enum0_encode_der;
2365xer_type_decoder_f Enum0_decode_xer;
2366xer_type_encoder_f Enum0_encode_xer;
2367
2368/*** <<< CODE [Enum0] >>> ***/
2369
Lev Walkin59b176e2005-11-26 11:25:14 +00002370/*
2371 * This type is implemented using ENUMERATED,
2372 * so here we adjust the DEF accordingly.
2373 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002374
2375/*** <<< STAT-DEFS [Enum0] >>> ***/
2376
Lev Walkina7591b52014-10-12 18:37:35 -07002377static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002378 { 0, 3, "one" },
2379 { 1, 3, "two" }
2380};
Lev Walkina7591b52014-10-12 18:37:35 -07002381static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002382 0, /* one(0) */
2383 1 /* two(1) */
2384};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002385static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002386 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
2387 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
2388 2, /* Number of elements in the maps */
2389 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002390 1, /* Strict enumeration */
2391 0, /* Native long size */
2392 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002393};
Lev Walkina7591b52014-10-12 18:37:35 -07002394static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002395 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2396};
2397asn_TYPE_descriptor_t asn_DEF_Enum0 = {
2398 "Enum0",
2399 "Enum0",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08002400 &asn_OP_ENUMERATED,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002401 ENUMERATED_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00002402 asn_DEF_Enum0_tags_1,
2403 sizeof(asn_DEF_Enum0_tags_1)
2404 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
2405 asn_DEF_Enum0_tags_1, /* Same as above */
2406 sizeof(asn_DEF_Enum0_tags_1)
2407 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002408 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002409 0, /* No PER visible constraints */
2410 0, 0, /* Defined elsewhere */
2411 &asn_SPC_Enum0_specs_1 /* Additional specs */
2412};
2413
2414
2415/*** <<< INCLUDES [Enum1] >>> ***/
2416
2417#include <NativeEnumerated.h>
2418
2419/*** <<< DEPS [Enum1] >>> ***/
2420
2421typedef enum Enum1 {
2422 Enum1_one = 0,
2423 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00002424} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00002425
2426/*** <<< TYPE-DECLS [Enum1] >>> ***/
2427
2428typedef long Enum1_t;
2429
2430/*** <<< FUNC-DECLS [Enum1] >>> ***/
2431
2432extern asn_TYPE_descriptor_t asn_DEF_Enum1;
2433asn_struct_free_f Enum1_free;
2434asn_struct_print_f Enum1_print;
2435asn_constr_check_f Enum1_constraint;
2436ber_type_decoder_f Enum1_decode_ber;
2437der_type_encoder_f Enum1_encode_der;
2438xer_type_decoder_f Enum1_decode_xer;
2439xer_type_encoder_f Enum1_encode_xer;
2440
2441/*** <<< CODE [Enum1] >>> ***/
2442
2443int
2444Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002445 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002446 long value;
2447
2448 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002449 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002450 "%s: value not given (%s:%d)",
2451 td->name, __FILE__, __LINE__);
2452 return -1;
2453 }
2454
2455 value = *(const long *)sptr;
2456
2457 if((value == 0)) {
2458 /* Constraint check succeeded */
2459 return 0;
2460 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002461 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002462 "%s: constraint failed (%s:%d)",
2463 td->name, __FILE__, __LINE__);
2464 return -1;
2465 }
2466}
2467
2468/*
2469 * This type is implemented using NativeEnumerated,
2470 * so here we adjust the DEF accordingly.
2471 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002472
2473/*** <<< STAT-DEFS [Enum1] >>> ***/
2474
Lev Walkina7591b52014-10-12 18:37:35 -07002475static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002476 { 0, 3, "one" },
2477 { 1, 3, "two" }
2478};
Lev Walkina7591b52014-10-12 18:37:35 -07002479static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002480 0, /* one(0) */
2481 1 /* two(1) */
2482};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002483static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002484 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
2485 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
2486 2, /* Number of elements in the maps */
2487 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002488 1, /* Strict enumeration */
2489 0, /* Native long size */
2490 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002491};
Lev Walkina7591b52014-10-12 18:37:35 -07002492static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002493 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2494};
2495asn_TYPE_descriptor_t asn_DEF_Enum1 = {
2496 "Enum1",
2497 "Enum1",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08002498 &asn_OP_NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00002499 Enum1_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00002500 asn_DEF_Enum1_tags_1,
2501 sizeof(asn_DEF_Enum1_tags_1)
2502 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
2503 asn_DEF_Enum1_tags_1, /* Same as above */
2504 sizeof(asn_DEF_Enum1_tags_1)
2505 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002506 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002507 0, /* No PER visible constraints */
2508 0, 0, /* Defined elsewhere */
2509 &asn_SPC_Enum1_specs_1 /* Additional specs */
2510};
2511
2512
Lev Walkin154aa182004-09-26 13:12:56 +00002513/*** <<< INCLUDES [Identifier] >>> ***/
2514
2515#include <VisibleString.h>
2516
2517/*** <<< TYPE-DECLS [Identifier] >>> ***/
2518
Lev Walkin154aa182004-09-26 13:12:56 +00002519typedef VisibleString_t Identifier_t;
2520
2521/*** <<< FUNC-DECLS [Identifier] >>> ***/
2522
Lev Walkindfae9752004-09-29 13:19:37 +00002523extern asn_TYPE_descriptor_t asn_DEF_Identifier;
Lev Walkin154aa182004-09-26 13:12:56 +00002524asn_struct_free_f Identifier_free;
2525asn_struct_print_f Identifier_print;
2526asn_constr_check_f Identifier_constraint;
2527ber_type_decoder_f Identifier_decode_ber;
2528der_type_encoder_f Identifier_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002529xer_type_decoder_f Identifier_decode_xer;
Lev Walkin154aa182004-09-26 13:12:56 +00002530xer_type_encoder_f Identifier_encode_xer;
2531
2532/*** <<< CTABLES [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002533
Lev Walkina7591b52014-10-12 18:37:35 -07002534static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00002535 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2536 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2537 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
2538 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
2539 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
254027,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
2541 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
254254,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002543};
2544
Lev Walkine8318b82005-03-06 09:29:03 +00002545static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07002546 const int *table = permitted_alphabet_table_1;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002547 /* The underlying type is VisibleString */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002548 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002549 const uint8_t *ch = st->buf;
2550 const uint8_t *end = ch + st->size;
2551
2552 for(; ch < end; ch++) {
2553 uint8_t cv = *ch;
2554 if(!table[cv]) return -1;
2555 }
2556 return 0;
2557}
2558
2559
Lev Walkin154aa182004-09-26 13:12:56 +00002560/*** <<< CODE [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002561
2562int
Lev Walkindfae9752004-09-29 13:19:37 +00002563Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002564 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002565 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002566 size_t size;
2567
2568 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002569 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002570 "%s: value not given (%s:%d)",
2571 td->name, __FILE__, __LINE__);
2572 return -1;
2573 }
2574
2575 size = st->size;
2576
2577 if((size >= 1 && size <= 32)
Lev Walkine8318b82005-03-06 09:29:03 +00002578 && !check_permitted_alphabet_1(st)) {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002579 /* Constraint check succeeded */
2580 return 0;
2581 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002582 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002583 "%s: constraint failed (%s:%d)",
2584 td->name, __FILE__, __LINE__);
2585 return -1;
2586 }
2587}
2588
2589/*
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002590 * This type is implemented using VisibleString,
Lev Walkinc3808c12004-09-23 22:14:58 +00002591 * so here we adjust the DEF accordingly.
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002592 */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002593
2594/*** <<< STAT-DEFS [Identifier] >>> ***/
2595
Lev Walkina7591b52014-10-12 18:37:35 -07002596static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002597 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
2598};
Lev Walkindfae9752004-09-29 13:19:37 +00002599asn_TYPE_descriptor_t asn_DEF_Identifier = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002600 "Identifier",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002601 "Identifier",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +08002602 &asn_OP_VisibleString,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002603 Identifier_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +00002604 asn_DEF_Identifier_tags_1,
2605 sizeof(asn_DEF_Identifier_tags_1)
2606 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
2607 asn_DEF_Identifier_tags_1, /* Same as above */
2608 sizeof(asn_DEF_Identifier_tags_1)
2609 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002610 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002611 0, /* No PER visible constraints */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002612 0, 0, /* No members */
2613 0 /* No specifics */
2614};
2615