blob: 1e22d99f55f5344fbe559d229e237d2afcb7333b [file] [log] [blame]
Lev Walkin59b176e2005-11-26 11:25:14 +00001
2/*** <<< INCLUDES [Int1] >>> ***/
3
Lev Walkin2a744a72013-03-27 01:56:23 -07004#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00005
6/*** <<< TYPE-DECLS [Int1] >>> ***/
7
Lev Walkin2a744a72013-03-27 01:56:23 -07008typedef long Int1_t;
Lev Walkin59b176e2005-11-26 11:25:14 +00009
10/*** <<< FUNC-DECLS [Int1] >>> ***/
11
12extern 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;
20per_type_decoder_f Int1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000021per_type_encoder_f Int1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +000022
23/*** <<< CODE [Int1] >>> ***/
24
Lev Walkin59b176e2005-11-26 11:25:14 +000025/*
Lev Walkin2a744a72013-03-27 01:56:23 -070026 * This type is implemented using NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +000027 * so here we adjust the DEF accordingly.
28 */
Lev Walkin59b176e2005-11-26 11:25:14 +000029
30/*** <<< STAT-DEFS [Int1] >>> ***/
31
Lev Walkina7591b52014-10-12 18:37:35 -070032static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +000033 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
34};
35asn_TYPE_descriptor_t asn_DEF_Int1 = {
36 "Int1",
37 "Int1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080038 NativeInteger_free,
39 NativeInteger_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -070040 NativeInteger_compare,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080041 NativeInteger_constraint,
42 NativeInteger_decode_ber,
43 NativeInteger_encode_der,
44 NativeInteger_decode_xer,
45 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +040046 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080047 NativeInteger_decode_uper,
48 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +000049 0, /* Use generic outmost tag fetcher */
50 asn_DEF_Int1_tags_1,
51 sizeof(asn_DEF_Int1_tags_1)
52 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
53 asn_DEF_Int1_tags_1, /* Same as above */
54 sizeof(asn_DEF_Int1_tags_1)
55 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +040056 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +000057 0, /* No PER visible constraints */
58 0, 0, /* No members */
59 0 /* No specifics */
60};
61
62
63/*** <<< INCLUDES [Int2] >>> ***/
64
Lev Walkin22b5ed42006-09-13 02:51:20 +000065#include "Int1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +000066
67/*** <<< TYPE-DECLS [Int2] >>> ***/
68
69typedef Int1_t Int2_t;
70
71/*** <<< FUNC-DECLS [Int2] >>> ***/
72
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080073extern asn_per_constraints_t asn_PER_type_Int2_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +000074extern asn_TYPE_descriptor_t asn_DEF_Int2;
75asn_struct_free_f Int2_free;
76asn_struct_print_f Int2_print;
77asn_constr_check_f Int2_constraint;
78ber_type_decoder_f Int2_decode_ber;
79der_type_encoder_f Int2_encode_der;
80xer_type_decoder_f Int2_decode_xer;
81xer_type_encoder_f Int2_encode_xer;
82per_type_decoder_f Int2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000083per_type_encoder_f Int2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +000084
85/*** <<< CODE [Int2] >>> ***/
86
87int
88Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000089 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +000090 long value;
91
92 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070093 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +000094 "%s: value not given (%s:%d)",
95 td->name, __FILE__, __LINE__);
96 return -1;
97 }
98
Lev Walkin2a744a72013-03-27 01:56:23 -070099 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000100
101 if((value >= 0)) {
102 /* Constraint check succeeded */
103 return 0;
104 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700105 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000106 "%s: constraint failed (%s:%d)",
107 td->name, __FILE__, __LINE__);
108 return -1;
109 }
110}
111
112/*
113 * This type is implemented using Int1,
114 * so here we adjust the DEF accordingly.
115 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000116
Lev Walkin725883b2006-10-09 12:07:58 +0000117/*** <<< CTDEFS [Int2] >>> ***/
118
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800119asn_per_constraints_t asn_PER_type_Int2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000120 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
121 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
122 0, 0 /* No PER value map */
123};
124
Lev Walkin59b176e2005-11-26 11:25:14 +0000125/*** <<< STAT-DEFS [Int2] >>> ***/
126
Lev Walkina7591b52014-10-12 18:37:35 -0700127static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000128 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
129};
Lev Walkin59b176e2005-11-26 11:25:14 +0000130asn_TYPE_descriptor_t asn_DEF_Int2 = {
131 "Int2",
132 "Int2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800133 NativeInteger_free,
134 NativeInteger_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700135 NativeInteger_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000136 Int2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800137 NativeInteger_decode_ber,
138 NativeInteger_encode_der,
139 NativeInteger_decode_xer,
140 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400141 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800142 NativeInteger_decode_uper,
143 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000144 0, /* Use generic outmost tag fetcher */
145 asn_DEF_Int2_tags_1,
146 sizeof(asn_DEF_Int2_tags_1)
147 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
148 asn_DEF_Int2_tags_1, /* Same as above */
149 sizeof(asn_DEF_Int2_tags_1)
150 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400151 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000152 &asn_PER_type_Int2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000153 0, 0, /* No members */
154 0 /* No specifics */
155};
156
157
158/*** <<< INCLUDES [Int3] >>> ***/
159
Lev Walkin22b5ed42006-09-13 02:51:20 +0000160#include "Int2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000161
162/*** <<< TYPE-DECLS [Int3] >>> ***/
163
164typedef Int2_t Int3_t;
165
166/*** <<< FUNC-DECLS [Int3] >>> ***/
167
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800168extern asn_per_constraints_t asn_PER_type_Int3_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000169extern asn_TYPE_descriptor_t asn_DEF_Int3;
170asn_struct_free_f Int3_free;
171asn_struct_print_f Int3_print;
172asn_constr_check_f Int3_constraint;
173ber_type_decoder_f Int3_decode_ber;
174der_type_encoder_f Int3_encode_der;
175xer_type_decoder_f Int3_decode_xer;
176xer_type_encoder_f Int3_encode_xer;
177per_type_decoder_f Int3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000178per_type_encoder_f Int3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000179
180/*** <<< CODE [Int3] >>> ***/
181
182int
183Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000184 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000185 long value;
186
187 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700188 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000189 "%s: value not given (%s:%d)",
190 td->name, __FILE__, __LINE__);
191 return -1;
192 }
193
Lev Walkin2a744a72013-03-27 01:56:23 -0700194 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000195
196 if((value >= 0 && value <= 10)) {
197 /* Constraint check succeeded */
198 return 0;
199 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700200 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000201 "%s: constraint failed (%s:%d)",
202 td->name, __FILE__, __LINE__);
203 return -1;
204 }
205}
206
207/*
208 * This type is implemented using Int2,
209 * so here we adjust the DEF accordingly.
210 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000211
Lev Walkin725883b2006-10-09 12:07:58 +0000212/*** <<< CTDEFS [Int3] >>> ***/
213
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800214asn_per_constraints_t asn_PER_type_Int3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000215 { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
216 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
217 0, 0 /* No PER value map */
218};
219
Lev Walkin59b176e2005-11-26 11:25:14 +0000220/*** <<< STAT-DEFS [Int3] >>> ***/
221
Lev Walkina7591b52014-10-12 18:37:35 -0700222static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000223 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
224};
Lev Walkin59b176e2005-11-26 11:25:14 +0000225asn_TYPE_descriptor_t asn_DEF_Int3 = {
226 "Int3",
227 "Int3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800228 NativeInteger_free,
229 NativeInteger_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700230 NativeInteger_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000231 Int3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800232 NativeInteger_decode_ber,
233 NativeInteger_encode_der,
234 NativeInteger_decode_xer,
235 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400236 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800237 NativeInteger_decode_uper,
238 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000239 0, /* Use generic outmost tag fetcher */
240 asn_DEF_Int3_tags_1,
241 sizeof(asn_DEF_Int3_tags_1)
242 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
243 asn_DEF_Int3_tags_1, /* Same as above */
244 sizeof(asn_DEF_Int3_tags_1)
245 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400246 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000247 &asn_PER_type_Int3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000248 0, 0, /* No members */
249 0 /* No specifics */
250};
251
252
253/*** <<< INCLUDES [Int4] >>> ***/
254
Lev Walkin22b5ed42006-09-13 02:51:20 +0000255#include "Int3.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000256
257/*** <<< TYPE-DECLS [Int4] >>> ***/
258
259typedef Int3_t Int4_t;
260
261/*** <<< FUNC-DECLS [Int4] >>> ***/
262
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800263extern asn_per_constraints_t asn_PER_type_Int4_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000264extern asn_TYPE_descriptor_t asn_DEF_Int4;
265asn_struct_free_f Int4_free;
266asn_struct_print_f Int4_print;
267asn_constr_check_f Int4_constraint;
268ber_type_decoder_f Int4_decode_ber;
269der_type_encoder_f Int4_encode_der;
270xer_type_decoder_f Int4_decode_xer;
271xer_type_encoder_f Int4_encode_xer;
272per_type_decoder_f Int4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000273per_type_encoder_f Int4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000274
275/*** <<< CODE [Int4] >>> ***/
276
277int
278Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000279 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000280 long value;
281
282 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700283 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000284 "%s: value not given (%s:%d)",
285 td->name, __FILE__, __LINE__);
286 return -1;
287 }
288
Lev Walkin2a744a72013-03-27 01:56:23 -0700289 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000290
291 if((value >= 1 && value <= 10)) {
292 /* Constraint check succeeded */
293 return 0;
294 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700295 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000296 "%s: constraint failed (%s:%d)",
297 td->name, __FILE__, __LINE__);
298 return -1;
299 }
300}
301
302/*
303 * This type is implemented using Int3,
304 * so here we adjust the DEF accordingly.
305 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000306
Lev Walkin725883b2006-10-09 12:07:58 +0000307/*** <<< CTDEFS [Int4] >>> ***/
308
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800309asn_per_constraints_t asn_PER_type_Int4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000310 { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
311 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
312 0, 0 /* No PER value map */
313};
314
Lev Walkin59b176e2005-11-26 11:25:14 +0000315/*** <<< STAT-DEFS [Int4] >>> ***/
316
Lev Walkina7591b52014-10-12 18:37:35 -0700317static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000318 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
319};
Lev Walkin59b176e2005-11-26 11:25:14 +0000320asn_TYPE_descriptor_t asn_DEF_Int4 = {
321 "Int4",
322 "Int4",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800323 NativeInteger_free,
324 NativeInteger_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700325 NativeInteger_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000326 Int4_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800327 NativeInteger_decode_ber,
328 NativeInteger_encode_der,
329 NativeInteger_decode_xer,
330 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400331 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800332 NativeInteger_decode_uper,
333 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000334 0, /* Use generic outmost tag fetcher */
335 asn_DEF_Int4_tags_1,
336 sizeof(asn_DEF_Int4_tags_1)
337 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
338 asn_DEF_Int4_tags_1, /* Same as above */
339 sizeof(asn_DEF_Int4_tags_1)
340 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400341 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000342 &asn_PER_type_Int4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000343 0, 0, /* No members */
344 0 /* No specifics */
345};
346
347
348/*** <<< INCLUDES [Int5] >>> ***/
349
Lev Walkin22b5ed42006-09-13 02:51:20 +0000350#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000351
352/*** <<< TYPE-DECLS [Int5] >>> ***/
353
354typedef Int4_t Int5_t;
355
356/*** <<< FUNC-DECLS [Int5] >>> ***/
357
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800358extern asn_per_constraints_t asn_PER_type_Int5_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000359extern asn_TYPE_descriptor_t asn_DEF_Int5;
360asn_struct_free_f Int5_free;
361asn_struct_print_f Int5_print;
362asn_constr_check_f Int5_constraint;
363ber_type_decoder_f Int5_decode_ber;
364der_type_encoder_f Int5_encode_der;
365xer_type_decoder_f Int5_decode_xer;
366xer_type_encoder_f Int5_encode_xer;
367per_type_decoder_f Int5_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000368per_type_encoder_f Int5_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000369
370/*** <<< CODE [Int5] >>> ***/
371
372int
373Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000374 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000375 long value;
376
377 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700378 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000379 "%s: value not given (%s:%d)",
380 td->name, __FILE__, __LINE__);
381 return -1;
382 }
383
Lev Walkin2a744a72013-03-27 01:56:23 -0700384 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000385
386 if((value == 5)) {
387 /* Constraint check succeeded */
388 return 0;
389 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700390 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000391 "%s: constraint failed (%s:%d)",
392 td->name, __FILE__, __LINE__);
393 return -1;
394 }
395}
396
397/*
398 * This type is implemented using Int4,
399 * so here we adjust the DEF accordingly.
400 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000401
Lev Walkin725883b2006-10-09 12:07:58 +0000402/*** <<< CTDEFS [Int5] >>> ***/
403
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800404asn_per_constraints_t asn_PER_type_Int5_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000405 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
406 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
407 0, 0 /* No PER value map */
408};
409
Lev Walkin59b176e2005-11-26 11:25:14 +0000410/*** <<< STAT-DEFS [Int5] >>> ***/
411
Lev Walkina7591b52014-10-12 18:37:35 -0700412static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000413 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
414};
Lev Walkin59b176e2005-11-26 11:25:14 +0000415asn_TYPE_descriptor_t asn_DEF_Int5 = {
416 "Int5",
417 "Int5",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800418 NativeInteger_free,
419 NativeInteger_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700420 NativeInteger_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000421 Int5_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800422 NativeInteger_decode_ber,
423 NativeInteger_encode_der,
424 NativeInteger_decode_xer,
425 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400426 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800427 NativeInteger_decode_uper,
428 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000429 0, /* Use generic outmost tag fetcher */
430 asn_DEF_Int5_tags_1,
431 sizeof(asn_DEF_Int5_tags_1)
432 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
433 asn_DEF_Int5_tags_1, /* Same as above */
434 sizeof(asn_DEF_Int5_tags_1)
435 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400436 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000437 &asn_PER_type_Int5_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000438 0, 0, /* No members */
439 0 /* No specifics */
440};
441
442
443/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
444
Lev Walkin2a744a72013-03-27 01:56:23 -0700445#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +0000446
447/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
448
Lev Walkin2a744a72013-03-27 01:56:23 -0700449typedef long ExtensibleExtensions_t;
Lev Walkin59b176e2005-11-26 11:25:14 +0000450
451/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
452
453extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
454asn_struct_free_f ExtensibleExtensions_free;
455asn_struct_print_f ExtensibleExtensions_print;
456asn_constr_check_f ExtensibleExtensions_constraint;
457ber_type_decoder_f ExtensibleExtensions_decode_ber;
458der_type_encoder_f ExtensibleExtensions_encode_der;
459xer_type_decoder_f ExtensibleExtensions_decode_xer;
460xer_type_encoder_f ExtensibleExtensions_encode_xer;
461per_type_decoder_f ExtensibleExtensions_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000462per_type_encoder_f ExtensibleExtensions_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000463
464/*** <<< CODE [ExtensibleExtensions] >>> ***/
465
466int
467ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000468 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000469 long value;
470
471 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700472 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000473 "%s: value not given (%s:%d)",
474 td->name, __FILE__, __LINE__);
475 return -1;
476 }
477
Lev Walkin2a744a72013-03-27 01:56:23 -0700478 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000479
480 if((value >= 1 && value <= 256)) {
481 /* Constraint check succeeded */
482 return 0;
483 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700484 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000485 "%s: constraint failed (%s:%d)",
486 td->name, __FILE__, __LINE__);
487 return -1;
488 }
489}
490
491/*
Lev Walkin2a744a72013-03-27 01:56:23 -0700492 * This type is implemented using NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +0000493 * so here we adjust the DEF accordingly.
494 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000495
Lev Walkin725883b2006-10-09 12:07:58 +0000496/*** <<< CTDEFS [ExtensibleExtensions] >>> ***/
497
Lev Walkin2fce55d2013-03-28 05:00:39 -0700498static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000499 { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
500 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
501 0, 0 /* No PER value map */
502};
503
Lev Walkin59b176e2005-11-26 11:25:14 +0000504/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
505
Lev Walkina7591b52014-10-12 18:37:35 -0700506static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000507 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
508};
Lev Walkin59b176e2005-11-26 11:25:14 +0000509asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
510 "ExtensibleExtensions",
511 "ExtensibleExtensions",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800512 NativeInteger_free,
513 NativeInteger_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700514 NativeInteger_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000515 ExtensibleExtensions_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800516 NativeInteger_decode_ber,
517 NativeInteger_encode_der,
518 NativeInteger_decode_xer,
519 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400520 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800521 NativeInteger_decode_uper,
522 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000523 0, /* Use generic outmost tag fetcher */
524 asn_DEF_ExtensibleExtensions_tags_1,
525 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
526 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
527 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
528 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
529 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400530 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000531 &asn_PER_type_ExtensibleExtensions_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000532 0, 0, /* No members */
533 0 /* No specifics */
534};
535
536
537/*** <<< INCLUDES [Str1] >>> ***/
538
539#include <IA5String.h>
540
541/*** <<< TYPE-DECLS [Str1] >>> ***/
542
543typedef IA5String_t Str1_t;
544
545/*** <<< FUNC-DECLS [Str1] >>> ***/
546
547extern asn_TYPE_descriptor_t asn_DEF_Str1;
548asn_struct_free_f Str1_free;
549asn_struct_print_f Str1_print;
550asn_constr_check_f Str1_constraint;
551ber_type_decoder_f Str1_decode_ber;
552der_type_encoder_f Str1_encode_der;
553xer_type_decoder_f Str1_decode_xer;
554xer_type_encoder_f Str1_encode_xer;
555per_type_decoder_f Str1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000556per_type_encoder_f Str1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000557
558/*** <<< CODE [Str1] >>> ***/
559
Lev Walkin59b176e2005-11-26 11:25:14 +0000560/*
561 * This type is implemented using IA5String,
562 * so here we adjust the DEF accordingly.
563 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000564
565/*** <<< STAT-DEFS [Str1] >>> ***/
566
Lev Walkina7591b52014-10-12 18:37:35 -0700567static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000568 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
569};
570asn_TYPE_descriptor_t asn_DEF_Str1 = {
571 "Str1",
572 "Str1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800573 IA5String_free,
574 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700575 IA5String_compare,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800576 IA5String_constraint,
577 IA5String_decode_ber,
578 IA5String_encode_der,
579 IA5String_decode_xer,
580 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400581 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800582 IA5String_decode_uper,
583 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000584 0, /* Use generic outmost tag fetcher */
585 asn_DEF_Str1_tags_1,
586 sizeof(asn_DEF_Str1_tags_1)
587 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
588 asn_DEF_Str1_tags_1, /* Same as above */
589 sizeof(asn_DEF_Str1_tags_1)
590 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400591 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000592 0, /* No PER visible constraints */
593 0, 0, /* No members */
594 0 /* No specifics */
595};
596
597
598/*** <<< INCLUDES [Str2] >>> ***/
599
Lev Walkin22b5ed42006-09-13 02:51:20 +0000600#include "Str1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000601
602/*** <<< TYPE-DECLS [Str2] >>> ***/
603
604typedef Str1_t Str2_t;
605
606/*** <<< FUNC-DECLS [Str2] >>> ***/
607
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800608extern asn_per_constraints_t asn_PER_type_Str2_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000609extern asn_TYPE_descriptor_t asn_DEF_Str2;
610asn_struct_free_f Str2_free;
611asn_struct_print_f Str2_print;
612asn_constr_check_f Str2_constraint;
613ber_type_decoder_f Str2_decode_ber;
614der_type_encoder_f Str2_encode_der;
615xer_type_decoder_f Str2_decode_xer;
616xer_type_encoder_f Str2_encode_xer;
617per_type_decoder_f Str2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000618per_type_encoder_f Str2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000619
620/*** <<< CTABLES [Str2] >>> ***/
621
622static int check_permitted_alphabet_1(const void *sptr) {
623 /* The underlying type is IA5String */
624 const IA5String_t *st = (const IA5String_t *)sptr;
625 const uint8_t *ch = st->buf;
626 const uint8_t *end = ch + st->size;
627
628 for(; ch < end; ch++) {
629 uint8_t cv = *ch;
630 if(!(cv <= 127)) return -1;
631 }
632 return 0;
633}
634
635
636/*** <<< CODE [Str2] >>> ***/
637
638int
639Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000640 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000641 const Str1_t *st = (const Str1_t *)sptr;
642 size_t size;
643
644 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700645 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000646 "%s: value not given (%s:%d)",
647 td->name, __FILE__, __LINE__);
648 return -1;
649 }
650
651 size = st->size;
652
653 if(((size <= 20) || (size >= 25 && size <= 30))
654 && !check_permitted_alphabet_1(st)) {
655 /* Constraint check succeeded */
656 return 0;
657 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700658 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000659 "%s: constraint failed (%s:%d)",
660 td->name, __FILE__, __LINE__);
661 return -1;
662 }
663}
664
665/*
666 * This type is implemented using Str1,
667 * so here we adjust the DEF accordingly.
668 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000669
Lev Walkin725883b2006-10-09 12:07:58 +0000670/*** <<< CTDEFS [Str2] >>> ***/
671
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800672asn_per_constraints_t asn_PER_type_Str2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000673 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
674 { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */,
675 0, 0 /* No PER character map necessary */
676};
677
Lev Walkin59b176e2005-11-26 11:25:14 +0000678/*** <<< STAT-DEFS [Str2] >>> ***/
679
Lev Walkina7591b52014-10-12 18:37:35 -0700680static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000681 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
682};
Lev Walkin59b176e2005-11-26 11:25:14 +0000683asn_TYPE_descriptor_t asn_DEF_Str2 = {
684 "Str2",
685 "Str2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800686 IA5String_free,
687 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700688 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000689 Str2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800690 IA5String_decode_ber,
691 IA5String_encode_der,
692 IA5String_decode_xer,
693 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400694 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800695 IA5String_decode_uper,
696 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000697 0, /* Use generic outmost tag fetcher */
698 asn_DEF_Str2_tags_1,
699 sizeof(asn_DEF_Str2_tags_1)
700 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
701 asn_DEF_Str2_tags_1, /* Same as above */
702 sizeof(asn_DEF_Str2_tags_1)
703 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400704 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000705 &asn_PER_type_Str2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000706 0, 0, /* No members */
707 0 /* No specifics */
708};
709
710
711/*** <<< INCLUDES [Str3] >>> ***/
712
Lev Walkin22b5ed42006-09-13 02:51:20 +0000713#include "Str2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000714
715/*** <<< TYPE-DECLS [Str3] >>> ***/
716
717typedef Str2_t Str3_t;
718
719/*** <<< FUNC-DECLS [Str3] >>> ***/
720
721extern asn_TYPE_descriptor_t asn_DEF_Str3;
722asn_struct_free_f Str3_free;
723asn_struct_print_f Str3_print;
724asn_constr_check_f Str3_constraint;
725ber_type_decoder_f Str3_decode_ber;
726der_type_encoder_f Str3_encode_der;
727xer_type_decoder_f Str3_decode_xer;
728xer_type_encoder_f Str3_encode_xer;
729per_type_decoder_f Str3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000730per_type_encoder_f Str3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000731
732/*** <<< CTABLES [Str3] >>> ***/
733
Lev Walkina7591b52014-10-12 18:37:35 -0700734static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000735 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
736 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
737 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
738 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
739 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
740 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
741 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin59b176e2005-11-26 11:25:14 +0000742};
Lev Walkina7591b52014-10-12 18:37:35 -0700743static const int permitted_alphabet_code2value_1[6] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +000074465,66,67,100,101,102,};
745
Lev Walkin59b176e2005-11-26 11:25:14 +0000746
747static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -0700748 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000749 /* The underlying type is IA5String */
750 const IA5String_t *st = (const IA5String_t *)sptr;
751 const uint8_t *ch = st->buf;
752 const uint8_t *end = ch + st->size;
753
754 for(; ch < end; ch++) {
755 uint8_t cv = *ch;
756 if(!table[cv]) return -1;
757 }
758 return 0;
759}
760
761
762/*** <<< CODE [Str3] >>> ***/
763
764int
765Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000766 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000767 const Str2_t *st = (const Str2_t *)sptr;
768 size_t size;
769
770 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700771 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000772 "%s: value not given (%s:%d)",
773 td->name, __FILE__, __LINE__);
774 return -1;
775 }
776
777 size = st->size;
778
779 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
780 && !check_permitted_alphabet_1(st)) {
781 /* Constraint check succeeded */
782 return 0;
783 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700784 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000785 "%s: constraint failed (%s:%d)",
786 td->name, __FILE__, __LINE__);
787 return -1;
788 }
789}
790
Lev Walkin725883b2006-10-09 12:07:58 +0000791static int asn_PER_MAP_Str3_1_v2c(unsigned int value) {
792 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
793 return -1;
794 return permitted_alphabet_table_1[value] - 1;
795}
796static int asn_PER_MAP_Str3_1_c2v(unsigned int code) {
797 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
798 return -1;
799 return permitted_alphabet_code2value_1[code];
800}
Lev Walkin59b176e2005-11-26 11:25:14 +0000801/*
802 * This type is implemented using Str2,
803 * so here we adjust the DEF accordingly.
804 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000805
Lev Walkin725883b2006-10-09 12:07:58 +0000806/*** <<< CTDEFS [Str3] >>> ***/
807
Lev Walkin2fce55d2013-03-28 05:00:39 -0700808static asn_per_constraints_t asn_PER_type_Str3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000809 { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */,
810 { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */,
811 asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */
812 asn_PER_MAP_Str3_1_c2v /* PER code to value map */
813};
814
Lev Walkin59b176e2005-11-26 11:25:14 +0000815/*** <<< STAT-DEFS [Str3] >>> ***/
816
Lev Walkina7591b52014-10-12 18:37:35 -0700817static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000818 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
819};
Lev Walkin59b176e2005-11-26 11:25:14 +0000820asn_TYPE_descriptor_t asn_DEF_Str3 = {
821 "Str3",
822 "Str3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800823 IA5String_free,
824 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700825 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000826 Str3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800827 IA5String_decode_ber,
828 IA5String_encode_der,
829 IA5String_decode_xer,
830 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400831 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800832 IA5String_decode_uper,
833 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000834 0, /* Use generic outmost tag fetcher */
835 asn_DEF_Str3_tags_1,
836 sizeof(asn_DEF_Str3_tags_1)
837 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
838 asn_DEF_Str3_tags_1, /* Same as above */
839 sizeof(asn_DEF_Str3_tags_1)
840 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400841 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000842 &asn_PER_type_Str3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000843 0, 0, /* No members */
844 0 /* No specifics */
845};
846
847
848/*** <<< INCLUDES [Str4] >>> ***/
849
850#include <IA5String.h>
851
852/*** <<< TYPE-DECLS [Str4] >>> ***/
853
854typedef IA5String_t Str4_t;
855
856/*** <<< FUNC-DECLS [Str4] >>> ***/
857
858extern asn_TYPE_descriptor_t asn_DEF_Str4;
859asn_struct_free_f Str4_free;
860asn_struct_print_f Str4_print;
861asn_constr_check_f Str4_constraint;
862ber_type_decoder_f Str4_decode_ber;
863der_type_encoder_f Str4_encode_der;
864xer_type_decoder_f Str4_decode_xer;
865xer_type_encoder_f Str4_encode_xer;
866per_type_decoder_f Str4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000867per_type_encoder_f Str4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000868
869/*** <<< CTABLES [Str4] >>> ***/
870
871static int check_permitted_alphabet_1(const void *sptr) {
872 /* The underlying type is IA5String */
873 const IA5String_t *st = (const IA5String_t *)sptr;
874 const uint8_t *ch = st->buf;
875 const uint8_t *end = ch + st->size;
876
877 for(; ch < end; ch++) {
878 uint8_t cv = *ch;
879 if(!(cv <= 127)) return -1;
880 }
881 return 0;
882}
883
884
885/*** <<< CODE [Str4] >>> ***/
886
887int
888Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000889 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000890 const IA5String_t *st = (const IA5String_t *)sptr;
891
892 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700893 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000894 "%s: value not given (%s:%d)",
895 td->name, __FILE__, __LINE__);
896 return -1;
897 }
898
899
900 if(!check_permitted_alphabet_1(st)) {
901 /* Constraint check succeeded */
902 return 0;
903 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700904 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000905 "%s: constraint failed (%s:%d)",
906 td->name, __FILE__, __LINE__);
907 return -1;
908 }
909}
910
911/*
912 * This type is implemented using IA5String,
913 * so here we adjust the DEF accordingly.
914 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000915
Lev Walkin725883b2006-10-09 12:07:58 +0000916/*** <<< CTDEFS [Str4] >>> ***/
917
Lev Walkin2fce55d2013-03-28 05:00:39 -0700918static asn_per_constraints_t asn_PER_type_Str4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000919 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
920 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
921 0, 0 /* No PER character map necessary */
922};
923
Lev Walkin59b176e2005-11-26 11:25:14 +0000924/*** <<< STAT-DEFS [Str4] >>> ***/
925
Lev Walkina7591b52014-10-12 18:37:35 -0700926static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000927 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
928};
Lev Walkin59b176e2005-11-26 11:25:14 +0000929asn_TYPE_descriptor_t asn_DEF_Str4 = {
930 "Str4",
931 "Str4",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800932 IA5String_free,
933 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700934 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +0000935 Str4_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800936 IA5String_decode_ber,
937 IA5String_encode_der,
938 IA5String_decode_xer,
939 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400940 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800941 IA5String_decode_uper,
942 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000943 0, /* Use generic outmost tag fetcher */
944 asn_DEF_Str4_tags_1,
945 sizeof(asn_DEF_Str4_tags_1)
946 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
947 asn_DEF_Str4_tags_1, /* Same as above */
948 sizeof(asn_DEF_Str4_tags_1)
949 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400950 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000951 &asn_PER_type_Str4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000952 0, 0, /* No members */
953 0 /* No specifics */
954};
955
956
957/*** <<< INCLUDES [PER-Visible] >>> ***/
958
959#include <IA5String.h>
960
961/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
962
963typedef IA5String_t PER_Visible_t;
964
965/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
966
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800967extern asn_per_constraints_t asn_PER_type_PER_Visible_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000968extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
969asn_struct_free_f PER_Visible_free;
970asn_struct_print_f PER_Visible_print;
971asn_constr_check_f PER_Visible_constraint;
972ber_type_decoder_f PER_Visible_decode_ber;
973der_type_encoder_f PER_Visible_encode_der;
974xer_type_decoder_f PER_Visible_decode_xer;
975xer_type_encoder_f PER_Visible_encode_xer;
976per_type_decoder_f PER_Visible_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000977per_type_encoder_f PER_Visible_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000978
979/*** <<< CTABLES [PER-Visible] >>> ***/
980
981static int check_permitted_alphabet_1(const void *sptr) {
982 /* The underlying type is IA5String */
983 const IA5String_t *st = (const IA5String_t *)sptr;
984 const uint8_t *ch = st->buf;
985 const uint8_t *end = ch + st->size;
986
987 for(; ch < end; ch++) {
988 uint8_t cv = *ch;
989 if(!(cv >= 65 && cv <= 70)) return -1;
990 }
991 return 0;
992}
993
994
995/*** <<< CODE [PER-Visible] >>> ***/
996
997int
998PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000999 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001000 const IA5String_t *st = (const IA5String_t *)sptr;
1001
1002 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001003 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001004 "%s: value not given (%s:%d)",
1005 td->name, __FILE__, __LINE__);
1006 return -1;
1007 }
1008
1009
1010 if(!check_permitted_alphabet_1(st)) {
1011 /* Constraint check succeeded */
1012 return 0;
1013 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001014 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001015 "%s: constraint failed (%s:%d)",
1016 td->name, __FILE__, __LINE__);
1017 return -1;
1018 }
1019}
1020
1021/*
1022 * This type is implemented using IA5String,
1023 * so here we adjust the DEF accordingly.
1024 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001025
Lev Walkin725883b2006-10-09 12:07:58 +00001026/*** <<< CTDEFS [PER-Visible] >>> ***/
1027
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001028asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001029 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1030 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1031 0, 0 /* No PER character map necessary */
1032};
1033
Lev Walkin59b176e2005-11-26 11:25:14 +00001034/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1035
Lev Walkina7591b52014-10-12 18:37:35 -07001036static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001037 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1038};
Lev Walkin59b176e2005-11-26 11:25:14 +00001039asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1040 "PER-Visible",
1041 "PER-Visible",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001042 IA5String_free,
1043 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07001044 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00001045 PER_Visible_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001046 IA5String_decode_ber,
1047 IA5String_encode_der,
1048 IA5String_decode_xer,
1049 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001050 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001051 IA5String_decode_uper,
1052 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001053 0, /* Use generic outmost tag fetcher */
1054 asn_DEF_PER_Visible_tags_1,
1055 sizeof(asn_DEF_PER_Visible_tags_1)
1056 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1057 asn_DEF_PER_Visible_tags_1, /* Same as above */
1058 sizeof(asn_DEF_PER_Visible_tags_1)
1059 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001060 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001061 &asn_PER_type_PER_Visible_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001062 0, 0, /* No members */
1063 0 /* No specifics */
1064};
1065
1066
1067/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1068
Lev Walkin22b5ed42006-09-13 02:51:20 +00001069#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001070
1071/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1072
1073typedef PER_Visible_t PER_Visible_2_t;
1074
1075/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1076
1077extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1078asn_struct_free_f PER_Visible_2_free;
1079asn_struct_print_f PER_Visible_2_print;
1080asn_constr_check_f PER_Visible_2_constraint;
1081ber_type_decoder_f PER_Visible_2_decode_ber;
1082der_type_encoder_f PER_Visible_2_encode_der;
1083xer_type_decoder_f PER_Visible_2_decode_xer;
1084xer_type_encoder_f PER_Visible_2_encode_xer;
1085per_type_decoder_f PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001086per_type_encoder_f PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001087
1088/*** <<< CTABLES [PER-Visible-2] >>> ***/
1089
1090static int check_permitted_alphabet_1(const void *sptr) {
1091 /* The underlying type is IA5String */
1092 const IA5String_t *st = (const IA5String_t *)sptr;
1093 const uint8_t *ch = st->buf;
1094 const uint8_t *end = ch + st->size;
1095
1096 for(; ch < end; ch++) {
1097 uint8_t cv = *ch;
1098 if(!(cv >= 69 && cv <= 70)) return -1;
1099 }
1100 return 0;
1101}
1102
1103
1104/*** <<< CODE [PER-Visible-2] >>> ***/
1105
1106int
1107PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001108 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001109 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1110
1111 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001112 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001113 "%s: value not given (%s:%d)",
1114 td->name, __FILE__, __LINE__);
1115 return -1;
1116 }
1117
1118
1119 if(!check_permitted_alphabet_1(st)) {
1120 /* Constraint check succeeded */
1121 return 0;
1122 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001123 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001124 "%s: constraint failed (%s:%d)",
1125 td->name, __FILE__, __LINE__);
1126 return -1;
1127 }
1128}
1129
1130/*
1131 * This type is implemented using PER_Visible,
1132 * so here we adjust the DEF accordingly.
1133 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001134
Lev Walkin725883b2006-10-09 12:07:58 +00001135/*** <<< CTDEFS [PER-Visible-2] >>> ***/
1136
Lev Walkin2fce55d2013-03-28 05:00:39 -07001137static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001138 { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */,
1139 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1140 0, 0 /* No PER character map necessary */
1141};
1142
Lev Walkin59b176e2005-11-26 11:25:14 +00001143/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
1144
Lev Walkina7591b52014-10-12 18:37:35 -07001145static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001146 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1147};
Lev Walkin59b176e2005-11-26 11:25:14 +00001148asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
1149 "PER-Visible-2",
1150 "PER-Visible-2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001151 IA5String_free,
1152 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07001153 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00001154 PER_Visible_2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001155 IA5String_decode_ber,
1156 IA5String_encode_der,
1157 IA5String_decode_xer,
1158 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001159 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001160 IA5String_decode_uper,
1161 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001162 0, /* Use generic outmost tag fetcher */
1163 asn_DEF_PER_Visible_2_tags_1,
1164 sizeof(asn_DEF_PER_Visible_2_tags_1)
1165 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
1166 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
1167 sizeof(asn_DEF_PER_Visible_2_tags_1)
1168 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001169 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001170 &asn_PER_type_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001171 0, 0, /* No members */
1172 0 /* No specifics */
1173};
1174
1175
1176/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
1177
Lev Walkin22b5ed42006-09-13 02:51:20 +00001178#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001179
1180/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
1181
1182typedef PER_Visible_t Not_PER_Visible_1_t;
1183
1184/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
1185
1186extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
1187asn_struct_free_f Not_PER_Visible_1_free;
1188asn_struct_print_f Not_PER_Visible_1_print;
1189asn_constr_check_f Not_PER_Visible_1_constraint;
1190ber_type_decoder_f Not_PER_Visible_1_decode_ber;
1191der_type_encoder_f Not_PER_Visible_1_encode_der;
1192xer_type_decoder_f Not_PER_Visible_1_decode_xer;
1193xer_type_encoder_f Not_PER_Visible_1_encode_xer;
1194per_type_decoder_f Not_PER_Visible_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001195per_type_encoder_f Not_PER_Visible_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001196
1197/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
1198
1199static int check_permitted_alphabet_1(const void *sptr) {
1200 /* The underlying type is IA5String */
1201 const IA5String_t *st = (const IA5String_t *)sptr;
1202 const uint8_t *ch = st->buf;
1203 const uint8_t *end = ch + st->size;
1204
1205 for(; ch < end; ch++) {
1206 uint8_t cv = *ch;
1207 if(!(cv >= 65 && cv <= 70)) return -1;
1208 }
1209 return 0;
1210}
1211
1212
1213/*** <<< CODE [Not-PER-Visible-1] >>> ***/
1214
1215int
1216Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001217 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001218 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1219
1220 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001221 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001222 "%s: value not given (%s:%d)",
1223 td->name, __FILE__, __LINE__);
1224 return -1;
1225 }
1226
1227
1228 if(!check_permitted_alphabet_1(st)) {
1229 /* Constraint check succeeded */
1230 return 0;
1231 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001232 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001233 "%s: constraint failed (%s:%d)",
1234 td->name, __FILE__, __LINE__);
1235 return -1;
1236 }
1237}
1238
1239/*
1240 * This type is implemented using PER_Visible,
1241 * so here we adjust the DEF accordingly.
1242 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001243
Lev Walkin725883b2006-10-09 12:07:58 +00001244/*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/
1245
Lev Walkin2fce55d2013-03-28 05:00:39 -07001246static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001247 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1248 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1249 0, 0 /* No PER character map necessary */
1250};
1251
Lev Walkin59b176e2005-11-26 11:25:14 +00001252/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
1253
Lev Walkina7591b52014-10-12 18:37:35 -07001254static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001255 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1256};
Lev Walkin59b176e2005-11-26 11:25:14 +00001257asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
1258 "Not-PER-Visible-1",
1259 "Not-PER-Visible-1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001260 IA5String_free,
1261 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07001262 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00001263 Not_PER_Visible_1_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001264 IA5String_decode_ber,
1265 IA5String_encode_der,
1266 IA5String_decode_xer,
1267 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001268 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001269 IA5String_decode_uper,
1270 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001271 0, /* Use generic outmost tag fetcher */
1272 asn_DEF_Not_PER_Visible_1_tags_1,
1273 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1274 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
1275 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
1276 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1277 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001278 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001279 &asn_PER_type_Not_PER_Visible_1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001280 0, 0, /* No members */
1281 0 /* No specifics */
1282};
1283
1284
1285/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
1286
Lev Walkin22b5ed42006-09-13 02:51:20 +00001287#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001288
1289/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
1290
1291typedef PER_Visible_t Not_PER_Visible_2_t;
1292
1293/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
1294
1295extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
1296asn_struct_free_f Not_PER_Visible_2_free;
1297asn_struct_print_f Not_PER_Visible_2_print;
1298asn_constr_check_f Not_PER_Visible_2_constraint;
1299ber_type_decoder_f Not_PER_Visible_2_decode_ber;
1300der_type_encoder_f Not_PER_Visible_2_encode_der;
1301xer_type_decoder_f Not_PER_Visible_2_decode_xer;
1302xer_type_encoder_f Not_PER_Visible_2_encode_xer;
1303per_type_decoder_f Not_PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001304per_type_encoder_f Not_PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001305
1306/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
1307
1308static int check_permitted_alphabet_1(const void *sptr) {
1309 /* The underlying type is IA5String */
1310 const IA5String_t *st = (const IA5String_t *)sptr;
1311 const uint8_t *ch = st->buf;
1312 const uint8_t *end = ch + st->size;
1313
1314 for(; ch < end; ch++) {
1315 uint8_t cv = *ch;
1316 if(!(cv >= 65 && cv <= 66)) return -1;
1317 }
1318 return 0;
1319}
1320
1321
1322/*** <<< CODE [Not-PER-Visible-2] >>> ***/
1323
1324int
1325Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001326 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001327 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1328
1329 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001330 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001331 "%s: value not given (%s:%d)",
1332 td->name, __FILE__, __LINE__);
1333 return -1;
1334 }
1335
1336
1337 if(!check_permitted_alphabet_1(st)) {
1338 /* Constraint check succeeded */
1339 return 0;
1340 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001341 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001342 "%s: constraint failed (%s:%d)",
1343 td->name, __FILE__, __LINE__);
1344 return -1;
1345 }
1346}
1347
1348/*
1349 * This type is implemented using PER_Visible,
1350 * so here we adjust the DEF accordingly.
1351 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001352
Lev Walkin725883b2006-10-09 12:07:58 +00001353/*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/
1354
Lev Walkin2fce55d2013-03-28 05:00:39 -07001355static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001356 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1357 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1358 0, 0 /* No PER character map necessary */
1359};
1360
Lev Walkin59b176e2005-11-26 11:25:14 +00001361/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
1362
Lev Walkina7591b52014-10-12 18:37:35 -07001363static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001364 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1365};
Lev Walkin59b176e2005-11-26 11:25:14 +00001366asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
1367 "Not-PER-Visible-2",
1368 "Not-PER-Visible-2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001369 IA5String_free,
1370 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07001371 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00001372 Not_PER_Visible_2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001373 IA5String_decode_ber,
1374 IA5String_encode_der,
1375 IA5String_decode_xer,
1376 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001377 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001378 IA5String_decode_uper,
1379 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001380 0, /* Use generic outmost tag fetcher */
1381 asn_DEF_Not_PER_Visible_2_tags_1,
1382 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1383 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
1384 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
1385 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1386 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001387 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001388 &asn_PER_type_Not_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001389 0, 0, /* No members */
1390 0 /* No specifics */
1391};
1392
1393
1394/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
1395
Lev Walkin22b5ed42006-09-13 02:51:20 +00001396#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001397
1398/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
1399
1400typedef PER_Visible_t Not_PER_Visible_3_t;
1401
1402/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
1403
1404extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
1405asn_struct_free_f Not_PER_Visible_3_free;
1406asn_struct_print_f Not_PER_Visible_3_print;
1407asn_constr_check_f Not_PER_Visible_3_constraint;
1408ber_type_decoder_f Not_PER_Visible_3_decode_ber;
1409der_type_encoder_f Not_PER_Visible_3_encode_der;
1410xer_type_decoder_f Not_PER_Visible_3_decode_xer;
1411xer_type_encoder_f Not_PER_Visible_3_encode_xer;
1412per_type_decoder_f Not_PER_Visible_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001413per_type_encoder_f Not_PER_Visible_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001414
1415/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
1416
1417static int check_permitted_alphabet_1(const void *sptr) {
1418 /* The underlying type is IA5String */
1419 const IA5String_t *st = (const IA5String_t *)sptr;
1420 const uint8_t *ch = st->buf;
1421 const uint8_t *end = ch + st->size;
1422
1423 for(; ch < end; ch++) {
1424 uint8_t cv = *ch;
1425 if(!(cv >= 65 && cv <= 66)) return -1;
1426 }
1427 return 0;
1428}
1429
1430
1431/*** <<< CODE [Not-PER-Visible-3] >>> ***/
1432
1433int
1434Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001435 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001436 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1437
1438 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001439 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001440 "%s: value not given (%s:%d)",
1441 td->name, __FILE__, __LINE__);
1442 return -1;
1443 }
1444
1445
1446 if(!check_permitted_alphabet_1(st)) {
1447 /* Constraint check succeeded */
1448 return 0;
1449 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001450 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001451 "%s: constraint failed (%s:%d)",
1452 td->name, __FILE__, __LINE__);
1453 return -1;
1454 }
1455}
1456
1457/*
1458 * This type is implemented using PER_Visible,
1459 * so here we adjust the DEF accordingly.
1460 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001461
Lev Walkin725883b2006-10-09 12:07:58 +00001462/*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/
1463
Lev Walkin2fce55d2013-03-28 05:00:39 -07001464static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001465 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1466 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1467 0, 0 /* No PER character map necessary */
1468};
1469
Lev Walkin59b176e2005-11-26 11:25:14 +00001470/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
1471
Lev Walkina7591b52014-10-12 18:37:35 -07001472static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001473 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1474};
Lev Walkin59b176e2005-11-26 11:25:14 +00001475asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
1476 "Not-PER-Visible-3",
1477 "Not-PER-Visible-3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001478 IA5String_free,
1479 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07001480 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00001481 Not_PER_Visible_3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001482 IA5String_decode_ber,
1483 IA5String_encode_der,
1484 IA5String_decode_xer,
1485 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001486 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001487 IA5String_decode_uper,
1488 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001489 0, /* Use generic outmost tag fetcher */
1490 asn_DEF_Not_PER_Visible_3_tags_1,
1491 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1492 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
1493 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
1494 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1495 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001496 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001497 &asn_PER_type_Not_PER_Visible_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001498 0, 0, /* No members */
1499 0 /* No specifics */
1500};
1501
1502
1503/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
1504
Lev Walkin22b5ed42006-09-13 02:51:20 +00001505#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001506
1507/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
1508
1509typedef PER_Visible_t SIZE_but_not_FROM_t;
1510
1511/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
1512
1513extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
1514asn_struct_free_f SIZE_but_not_FROM_free;
1515asn_struct_print_f SIZE_but_not_FROM_print;
1516asn_constr_check_f SIZE_but_not_FROM_constraint;
1517ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
1518der_type_encoder_f SIZE_but_not_FROM_encode_der;
1519xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
1520xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
1521per_type_decoder_f SIZE_but_not_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001522per_type_encoder_f SIZE_but_not_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001523
1524/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
1525
1526static int check_permitted_alphabet_1(const void *sptr) {
1527 /* The underlying type is IA5String */
1528 const IA5String_t *st = (const IA5String_t *)sptr;
1529 const uint8_t *ch = st->buf;
1530 const uint8_t *end = ch + st->size;
1531
1532 for(; ch < end; ch++) {
1533 uint8_t cv = *ch;
1534 if(!(cv >= 65 && cv <= 68)) return -1;
1535 }
1536 return 0;
1537}
1538
1539
1540/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
1541
1542int
1543SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001544 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001545 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1546 size_t size;
1547
1548 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001549 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001550 "%s: value not given (%s:%d)",
1551 td->name, __FILE__, __LINE__);
1552 return -1;
1553 }
1554
1555 size = st->size;
1556
1557 if((size >= 1 && size <= 4)
1558 && !check_permitted_alphabet_1(st)) {
1559 /* Constraint check succeeded */
1560 return 0;
1561 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001562 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001563 "%s: constraint failed (%s:%d)",
1564 td->name, __FILE__, __LINE__);
1565 return -1;
1566 }
1567}
1568
1569/*
1570 * This type is implemented using PER_Visible,
1571 * so here we adjust the DEF accordingly.
1572 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001573
Lev Walkin725883b2006-10-09 12:07:58 +00001574/*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/
1575
Lev Walkin2fce55d2013-03-28 05:00:39 -07001576static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001577 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1578 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
1579 0, 0 /* No PER character map necessary */
1580};
1581
Lev Walkin59b176e2005-11-26 11:25:14 +00001582/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
1583
Lev Walkina7591b52014-10-12 18:37:35 -07001584static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001585 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1586};
Lev Walkin59b176e2005-11-26 11:25:14 +00001587asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
1588 "SIZE-but-not-FROM",
1589 "SIZE-but-not-FROM",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001590 IA5String_free,
1591 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07001592 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00001593 SIZE_but_not_FROM_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001594 IA5String_decode_ber,
1595 IA5String_encode_der,
1596 IA5String_decode_xer,
1597 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001598 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001599 IA5String_decode_uper,
1600 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001601 0, /* Use generic outmost tag fetcher */
1602 asn_DEF_SIZE_but_not_FROM_tags_1,
1603 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1604 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
1605 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
1606 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1607 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001608 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001609 &asn_PER_type_SIZE_but_not_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001610 0, 0, /* No members */
1611 0 /* No specifics */
1612};
1613
1614
1615/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
1616
Lev Walkin22b5ed42006-09-13 02:51:20 +00001617#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001618
1619/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
1620
1621typedef PER_Visible_t SIZE_and_FROM_t;
1622
1623/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
1624
1625extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
1626asn_struct_free_f SIZE_and_FROM_free;
1627asn_struct_print_f SIZE_and_FROM_print;
1628asn_constr_check_f SIZE_and_FROM_constraint;
1629ber_type_decoder_f SIZE_and_FROM_decode_ber;
1630der_type_encoder_f SIZE_and_FROM_encode_der;
1631xer_type_decoder_f SIZE_and_FROM_decode_xer;
1632xer_type_encoder_f SIZE_and_FROM_encode_xer;
1633per_type_decoder_f SIZE_and_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001634per_type_encoder_f SIZE_and_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001635
1636/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
1637
1638static int check_permitted_alphabet_1(const void *sptr) {
1639 /* The underlying type is IA5String */
1640 const IA5String_t *st = (const IA5String_t *)sptr;
1641 const uint8_t *ch = st->buf;
1642 const uint8_t *end = ch + st->size;
1643
1644 for(; ch < end; ch++) {
1645 uint8_t cv = *ch;
1646 if(!(cv >= 65 && cv <= 68)) return -1;
1647 }
1648 return 0;
1649}
1650
1651
1652/*** <<< CODE [SIZE-and-FROM] >>> ***/
1653
1654int
1655SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001656 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001657 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1658 size_t size;
1659
1660 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001661 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001662 "%s: value not given (%s:%d)",
1663 td->name, __FILE__, __LINE__);
1664 return -1;
1665 }
1666
1667 size = st->size;
1668
1669 if((size >= 1 && size <= 4)
1670 && !check_permitted_alphabet_1(st)) {
1671 /* Constraint check succeeded */
1672 return 0;
1673 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001674 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001675 "%s: constraint failed (%s:%d)",
1676 td->name, __FILE__, __LINE__);
1677 return -1;
1678 }
1679}
1680
1681/*
1682 * This type is implemented using PER_Visible,
1683 * so here we adjust the DEF accordingly.
1684 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001685
Lev Walkin725883b2006-10-09 12:07:58 +00001686/*** <<< CTDEFS [SIZE-and-FROM] >>> ***/
1687
Lev Walkin2fce55d2013-03-28 05:00:39 -07001688static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001689 { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */,
1690 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
1691 0, 0 /* No PER character map necessary */
1692};
1693
Lev Walkin59b176e2005-11-26 11:25:14 +00001694/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
1695
Lev Walkina7591b52014-10-12 18:37:35 -07001696static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001697 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1698};
Lev Walkin59b176e2005-11-26 11:25:14 +00001699asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
1700 "SIZE-and-FROM",
1701 "SIZE-and-FROM",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001702 IA5String_free,
1703 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07001704 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00001705 SIZE_and_FROM_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001706 IA5String_decode_ber,
1707 IA5String_encode_der,
1708 IA5String_decode_xer,
1709 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001710 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001711 IA5String_decode_uper,
1712 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001713 0, /* Use generic outmost tag fetcher */
1714 asn_DEF_SIZE_and_FROM_tags_1,
1715 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1716 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
1717 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
1718 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1719 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001720 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001721 &asn_PER_type_SIZE_and_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001722 0, 0, /* No members */
1723 0 /* No specifics */
1724};
1725
1726
1727/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
1728
Lev Walkin22b5ed42006-09-13 02:51:20 +00001729#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001730
1731/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1732
1733typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
1734
1735/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1736
1737extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
1738asn_struct_free_f Neither_SIZE_nor_FROM_free;
1739asn_struct_print_f Neither_SIZE_nor_FROM_print;
1740asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
1741ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
1742der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
1743xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
1744xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
1745per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001746per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001747
1748/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
1749
1750static int check_permitted_alphabet_1(const void *sptr) {
1751 /* The underlying type is IA5String */
1752 const IA5String_t *st = (const IA5String_t *)sptr;
1753 const uint8_t *ch = st->buf;
1754 const uint8_t *end = ch + st->size;
1755
1756 for(; ch < end; ch++) {
1757 uint8_t cv = *ch;
1758 if(!(cv >= 65 && cv <= 70)) return -1;
1759 }
1760 return 0;
1761}
1762
1763
1764/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
1765
1766int
1767Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001768 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001769 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1770
1771 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001772 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001773 "%s: value not given (%s:%d)",
1774 td->name, __FILE__, __LINE__);
1775 return -1;
1776 }
1777
1778
1779 if(!check_permitted_alphabet_1(st)) {
1780 /* Constraint check succeeded */
1781 return 0;
1782 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001783 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001784 "%s: constraint failed (%s:%d)",
1785 td->name, __FILE__, __LINE__);
1786 return -1;
1787 }
1788}
1789
1790/*
1791 * This type is implemented using PER_Visible,
1792 * so here we adjust the DEF accordingly.
1793 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001794
Lev Walkin725883b2006-10-09 12:07:58 +00001795/*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/
1796
Lev Walkin2fce55d2013-03-28 05:00:39 -07001797static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001798 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1799 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1800 0, 0 /* No PER character map necessary */
1801};
1802
Lev Walkin59b176e2005-11-26 11:25:14 +00001803/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
1804
Lev Walkina7591b52014-10-12 18:37:35 -07001805static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001806 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1807};
Lev Walkin59b176e2005-11-26 11:25:14 +00001808asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
1809 "Neither-SIZE-nor-FROM",
1810 "Neither-SIZE-nor-FROM",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001811 IA5String_free,
1812 IA5String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07001813 IA5String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00001814 Neither_SIZE_nor_FROM_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001815 IA5String_decode_ber,
1816 IA5String_encode_der,
1817 IA5String_decode_xer,
1818 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001819 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001820 IA5String_decode_uper,
1821 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001822 0, /* Use generic outmost tag fetcher */
1823 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
1824 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1825 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
1826 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
1827 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1828 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001829 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001830 &asn_PER_type_Neither_SIZE_nor_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001831 0, 0, /* No members */
1832 0 /* No specifics */
1833};
1834
1835
1836/*** <<< INCLUDES [Utf8-4] >>> ***/
1837
1838#include <UTF8String.h>
1839
1840/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
1841
1842typedef UTF8String_t Utf8_4_t;
1843
1844/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
1845
1846extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
1847asn_struct_free_f Utf8_4_free;
1848asn_struct_print_f Utf8_4_print;
1849asn_constr_check_f Utf8_4_constraint;
1850ber_type_decoder_f Utf8_4_decode_ber;
1851der_type_encoder_f Utf8_4_encode_der;
1852xer_type_decoder_f Utf8_4_decode_xer;
1853xer_type_encoder_f Utf8_4_encode_xer;
1854per_type_decoder_f Utf8_4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001855per_type_encoder_f Utf8_4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001856
1857/*** <<< CTABLES [Utf8-4] >>> ***/
1858
1859static int check_permitted_alphabet_1(const void *sptr) {
1860 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
1861 return -1; /* Alphabet (sic!) test failed. */
1862
1863 return 0;
1864}
1865
1866
1867/*** <<< CODE [Utf8-4] >>> ***/
1868
1869int
1870Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001871 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001872 const UTF8String_t *st = (const UTF8String_t *)sptr;
1873
1874 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001875 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001876 "%s: value not given (%s:%d)",
1877 td->name, __FILE__, __LINE__);
1878 return -1;
1879 }
1880
1881
1882 if(!check_permitted_alphabet_1(st)) {
1883 /* Constraint check succeeded */
1884 return 0;
1885 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001886 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001887 "%s: constraint failed (%s:%d)",
1888 td->name, __FILE__, __LINE__);
1889 return -1;
1890 }
1891}
1892
1893/*
1894 * This type is implemented using UTF8String,
1895 * so here we adjust the DEF accordingly.
1896 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001897
Lev Walkin725883b2006-10-09 12:07:58 +00001898/*** <<< CTDEFS [Utf8-4] >>> ***/
1899
Lev Walkin2fce55d2013-03-28 05:00:39 -07001900static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001901 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1902 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1903 0, 0 /* No PER value map */
1904};
1905
Lev Walkin59b176e2005-11-26 11:25:14 +00001906/*** <<< STAT-DEFS [Utf8-4] >>> ***/
1907
Lev Walkina7591b52014-10-12 18:37:35 -07001908static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001909 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
1910};
Lev Walkin59b176e2005-11-26 11:25:14 +00001911asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
1912 "Utf8-4",
1913 "Utf8-4",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001914 UTF8String_free,
1915 UTF8String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07001916 UTF8String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00001917 Utf8_4_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001918 UTF8String_decode_ber,
1919 UTF8String_encode_der,
1920 UTF8String_decode_xer,
1921 UTF8String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001922 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001923 UTF8String_decode_uper,
1924 UTF8String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001925 0, /* Use generic outmost tag fetcher */
1926 asn_DEF_Utf8_4_tags_1,
1927 sizeof(asn_DEF_Utf8_4_tags_1)
1928 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
1929 asn_DEF_Utf8_4_tags_1, /* Same as above */
1930 sizeof(asn_DEF_Utf8_4_tags_1)
1931 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001932 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001933 &asn_PER_type_Utf8_4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001934 0, 0, /* No members */
1935 0 /* No specifics */
1936};
1937
1938
1939/*** <<< INCLUDES [Utf8-3] >>> ***/
1940
Lev Walkin22b5ed42006-09-13 02:51:20 +00001941#include "Utf8-2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001942
1943/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
1944
1945typedef Utf8_2_t Utf8_3_t;
1946
1947/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
1948
1949extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
1950asn_struct_free_f Utf8_3_free;
1951asn_struct_print_f Utf8_3_print;
1952asn_constr_check_f Utf8_3_constraint;
1953ber_type_decoder_f Utf8_3_decode_ber;
1954der_type_encoder_f Utf8_3_encode_der;
1955xer_type_decoder_f Utf8_3_decode_xer;
1956xer_type_encoder_f Utf8_3_encode_xer;
1957per_type_decoder_f Utf8_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001958per_type_encoder_f Utf8_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001959
1960/*** <<< CTABLES [Utf8-3] >>> ***/
1961
Lev Walkina7591b52014-10-12 18:37:35 -07001962static const int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001963 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1964 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1965 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1966 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1967 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
196816,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
1969 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
197042,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00001971};
1972
1973static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07001974 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00001975 /* The underlying type is UTF8String */
1976 const UTF8String_t *st = (const UTF8String_t *)sptr;
1977 const uint8_t *ch = st->buf;
1978 const uint8_t *end = ch + st->size;
1979
1980 for(; ch < end; ch++) {
1981 uint8_t cv = *ch;
1982 if(cv >= 0x80) return -1;
1983 if(!table[cv]) return -1;
1984 }
1985 return 0;
1986}
1987
1988
1989/*** <<< CODE [Utf8-3] >>> ***/
1990
1991int
1992Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001993 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001994 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
1995 size_t size;
1996
1997 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001998 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001999 "%s: value not given (%s:%d)",
2000 td->name, __FILE__, __LINE__);
2001 return -1;
2002 }
2003
2004 size = UTF8String_length(st);
2005 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002006 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002007 "%s: UTF-8: broken encoding (%s:%d)",
2008 td->name, __FILE__, __LINE__);
2009 return -1;
2010 }
2011
2012 if((size >= 1 && size <= 2)
2013 && !check_permitted_alphabet_1(st)) {
2014 /* Constraint check succeeded */
2015 return 0;
2016 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002017 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002018 "%s: constraint failed (%s:%d)",
2019 td->name, __FILE__, __LINE__);
2020 return -1;
2021 }
2022}
2023
2024/*
2025 * This type is implemented using Utf8_2,
2026 * so here we adjust the DEF accordingly.
2027 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002028
Lev Walkin725883b2006-10-09 12:07:58 +00002029/*** <<< CTDEFS [Utf8-3] >>> ***/
2030
Lev Walkin2fce55d2013-03-28 05:00:39 -07002031static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002032 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2033 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2034 0, 0 /* No PER value map */
2035};
2036
Lev Walkin59b176e2005-11-26 11:25:14 +00002037/*** <<< STAT-DEFS [Utf8-3] >>> ***/
2038
Lev Walkina7591b52014-10-12 18:37:35 -07002039static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002040 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2041};
Lev Walkin59b176e2005-11-26 11:25:14 +00002042asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
2043 "Utf8-3",
2044 "Utf8-3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002045 UTF8String_free,
2046 UTF8String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07002047 UTF8String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00002048 Utf8_3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002049 UTF8String_decode_ber,
2050 UTF8String_encode_der,
2051 UTF8String_decode_xer,
2052 UTF8String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002053 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002054 UTF8String_decode_uper,
2055 UTF8String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002056 0, /* Use generic outmost tag fetcher */
2057 asn_DEF_Utf8_3_tags_1,
2058 sizeof(asn_DEF_Utf8_3_tags_1)
2059 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
2060 asn_DEF_Utf8_3_tags_1, /* Same as above */
2061 sizeof(asn_DEF_Utf8_3_tags_1)
2062 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002063 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002064 &asn_PER_type_Utf8_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002065 0, 0, /* No members */
2066 0 /* No specifics */
2067};
2068
2069
2070/*** <<< INCLUDES [Utf8-2] >>> ***/
2071
Lev Walkin22b5ed42006-09-13 02:51:20 +00002072#include "Utf8-1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002073
2074/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
2075
2076typedef Utf8_1_t Utf8_2_t;
2077
2078/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
2079
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002080extern asn_per_constraints_t asn_PER_type_Utf8_2_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00002081extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
2082asn_struct_free_f Utf8_2_free;
2083asn_struct_print_f Utf8_2_print;
2084asn_constr_check_f Utf8_2_constraint;
2085ber_type_decoder_f Utf8_2_decode_ber;
2086der_type_encoder_f Utf8_2_encode_der;
2087xer_type_decoder_f Utf8_2_decode_xer;
2088xer_type_encoder_f Utf8_2_encode_xer;
2089per_type_decoder_f Utf8_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002090per_type_encoder_f Utf8_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002091
2092/*** <<< CODE [Utf8-2] >>> ***/
2093
2094int
2095Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002096 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002097 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
2098 size_t size;
2099
2100 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002101 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002102 "%s: value not given (%s:%d)",
2103 td->name, __FILE__, __LINE__);
2104 return -1;
2105 }
2106
2107 size = UTF8String_length(st);
2108 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002109 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002110 "%s: UTF-8: broken encoding (%s:%d)",
2111 td->name, __FILE__, __LINE__);
2112 return -1;
2113 }
2114
2115 if((size >= 1 && size <= 2)) {
2116 /* Constraint check succeeded */
2117 return 0;
2118 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002119 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002120 "%s: constraint failed (%s:%d)",
2121 td->name, __FILE__, __LINE__);
2122 return -1;
2123 }
2124}
2125
2126/*
2127 * This type is implemented using Utf8_1,
2128 * so here we adjust the DEF accordingly.
2129 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002130
Lev Walkin725883b2006-10-09 12:07:58 +00002131/*** <<< CTDEFS [Utf8-2] >>> ***/
2132
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002133asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002134 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2135 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2136 0, 0 /* No PER value map */
2137};
2138
Lev Walkin59b176e2005-11-26 11:25:14 +00002139/*** <<< STAT-DEFS [Utf8-2] >>> ***/
2140
Lev Walkina7591b52014-10-12 18:37:35 -07002141static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002142 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2143};
Lev Walkin59b176e2005-11-26 11:25:14 +00002144asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
2145 "Utf8-2",
2146 "Utf8-2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002147 UTF8String_free,
2148 UTF8String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07002149 UTF8String_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00002150 Utf8_2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002151 UTF8String_decode_ber,
2152 UTF8String_encode_der,
2153 UTF8String_decode_xer,
2154 UTF8String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002155 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002156 UTF8String_decode_uper,
2157 UTF8String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002158 0, /* Use generic outmost tag fetcher */
2159 asn_DEF_Utf8_2_tags_1,
2160 sizeof(asn_DEF_Utf8_2_tags_1)
2161 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
2162 asn_DEF_Utf8_2_tags_1, /* Same as above */
2163 sizeof(asn_DEF_Utf8_2_tags_1)
2164 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002165 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002166 &asn_PER_type_Utf8_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002167 0, 0, /* No members */
2168 0 /* No specifics */
2169};
2170
2171
2172/*** <<< INCLUDES [Utf8-1] >>> ***/
2173
2174#include <UTF8String.h>
2175
2176/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
2177
2178typedef UTF8String_t Utf8_1_t;
2179
2180/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
2181
2182extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
2183asn_struct_free_f Utf8_1_free;
2184asn_struct_print_f Utf8_1_print;
2185asn_constr_check_f Utf8_1_constraint;
2186ber_type_decoder_f Utf8_1_decode_ber;
2187der_type_encoder_f Utf8_1_encode_der;
2188xer_type_decoder_f Utf8_1_decode_xer;
2189xer_type_encoder_f Utf8_1_encode_xer;
2190per_type_decoder_f Utf8_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002191per_type_encoder_f Utf8_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002192
2193/*** <<< CODE [Utf8-1] >>> ***/
2194
Lev Walkin59b176e2005-11-26 11:25:14 +00002195/*
2196 * This type is implemented using UTF8String,
2197 * so here we adjust the DEF accordingly.
2198 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002199
2200/*** <<< STAT-DEFS [Utf8-1] >>> ***/
2201
Lev Walkina7591b52014-10-12 18:37:35 -07002202static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002203 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2204};
2205asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
2206 "Utf8-1",
2207 "Utf8-1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002208 UTF8String_free,
2209 UTF8String_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07002210 UTF8String_compare,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002211 UTF8String_constraint,
2212 UTF8String_decode_ber,
2213 UTF8String_encode_der,
2214 UTF8String_decode_xer,
2215 UTF8String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002216 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002217 UTF8String_decode_uper,
2218 UTF8String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002219 0, /* Use generic outmost tag fetcher */
2220 asn_DEF_Utf8_1_tags_1,
2221 sizeof(asn_DEF_Utf8_1_tags_1)
2222 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
2223 asn_DEF_Utf8_1_tags_1, /* Same as above */
2224 sizeof(asn_DEF_Utf8_1_tags_1)
2225 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002226 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002227 0, /* No PER visible constraints */
2228 0, 0, /* No members */
2229 0 /* No specifics */
2230};
2231
2232
2233/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
2234
Lev Walkin22b5ed42006-09-13 02:51:20 +00002235#include "Identifier.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002236
2237/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
2238
2239typedef Identifier_t VisibleIdentifier_t;
2240
2241/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
2242
2243extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
2244asn_struct_free_f VisibleIdentifier_free;
2245asn_struct_print_f VisibleIdentifier_print;
2246asn_constr_check_f VisibleIdentifier_constraint;
2247ber_type_decoder_f VisibleIdentifier_decode_ber;
2248der_type_encoder_f VisibleIdentifier_encode_der;
2249xer_type_decoder_f VisibleIdentifier_decode_xer;
2250xer_type_encoder_f VisibleIdentifier_encode_xer;
2251per_type_decoder_f VisibleIdentifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002252per_type_encoder_f VisibleIdentifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002253
2254/*** <<< CTABLES [VisibleIdentifier] >>> ***/
2255
Lev Walkina7591b52014-10-12 18:37:35 -07002256static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00002257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2259 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
2260 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
2261 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
226227,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
2263 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
226454,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00002265};
Lev Walkina7591b52014-10-12 18:37:35 -07002266static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000226736,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
226870,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
226986,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
2270107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
2271};
2272
Lev Walkin59b176e2005-11-26 11:25:14 +00002273
2274static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07002275 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00002276 /* The underlying type is VisibleString */
2277 const VisibleString_t *st = (const VisibleString_t *)sptr;
2278 const uint8_t *ch = st->buf;
2279 const uint8_t *end = ch + st->size;
2280
2281 for(; ch < end; ch++) {
2282 uint8_t cv = *ch;
2283 if(!table[cv]) return -1;
2284 }
2285 return 0;
2286}
2287
2288
2289/*** <<< CODE [VisibleIdentifier] >>> ***/
2290
2291int
2292VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002293 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002294 const Identifier_t *st = (const Identifier_t *)sptr;
2295 size_t size;
2296
2297 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002298 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002299 "%s: value not given (%s:%d)",
2300 td->name, __FILE__, __LINE__);
2301 return -1;
2302 }
2303
2304 size = st->size;
2305
2306 if((size >= 1 && size <= 32)
2307 && !check_permitted_alphabet_1(st)) {
2308 /* Constraint check succeeded */
2309 return 0;
2310 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002311 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002312 "%s: constraint failed (%s:%d)",
2313 td->name, __FILE__, __LINE__);
2314 return -1;
2315 }
2316}
2317
2318/*
2319 * This type is implemented using Identifier,
2320 * so here we adjust the DEF accordingly.
2321 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002322
2323/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
2324
Lev Walkina7591b52014-10-12 18:37:35 -07002325static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002326 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
2327};
2328asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
2329 "VisibleIdentifier",
2330 "VisibleIdentifier",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002331 VisibleString_free,
2332 VisibleString_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07002333 VisibleString_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00002334 VisibleIdentifier_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002335 VisibleString_decode_ber,
2336 VisibleString_encode_der,
2337 VisibleString_decode_xer,
2338 VisibleString_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002339 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002340 VisibleString_decode_uper,
2341 VisibleString_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002342 0, /* Use generic outmost tag fetcher */
2343 asn_DEF_VisibleIdentifier_tags_1,
2344 sizeof(asn_DEF_VisibleIdentifier_tags_1)
2345 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
2346 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
2347 sizeof(asn_DEF_VisibleIdentifier_tags_1)
2348 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002349 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002350 0, /* No PER visible constraints */
2351 0, 0, /* No members */
2352 0 /* No specifics */
2353};
2354
2355
2356/*** <<< INCLUDES [Sequence] >>> ***/
2357
Lev Walkin22b5ed42006-09-13 02:51:20 +00002358#include "Int1.h"
2359#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002360#include <BOOLEAN.h>
Lev Walkin2a744a72013-03-27 01:56:23 -07002361#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00002362#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00002363#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002364#include <constr_SEQUENCE.h>
2365
2366/*** <<< DEPS [Sequence] >>> ***/
2367
2368typedef enum enum_c {
2369 enum_c_one = 1,
2370 enum_c_two = 2,
2371 /*
2372 * Enumeration is extensible
2373 */
2374 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00002375} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00002376
2377/*** <<< TYPE-DECLS [Sequence] >>> ***/
2378
2379typedef struct Sequence {
2380 Int1_t *int1_c /* DEFAULT 3 */;
2381 Int4_t int4;
2382 Int4_t int4_c;
Lev Walkin2a744a72013-03-27 01:56:23 -07002383 BOOLEAN_t *Bool /* DEFAULT 1 */;
2384 long enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00002385 NULL_t *null /* OPTIONAL */;
2386 /*
2387 * This type is extensible,
2388 * possible extensions are below.
2389 */
2390 Int5_t *int5_c /* OPTIONAL */;
2391
2392 /* Context for parsing across buffer boundaries */
2393 asn_struct_ctx_t _asn_ctx;
2394} Sequence_t;
2395
2396/*** <<< FUNC-DECLS [Sequence] >>> ***/
2397
2398/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
2399extern asn_TYPE_descriptor_t asn_DEF_Sequence;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002400extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
2401extern asn_TYPE_member_t asn_MBR_Sequence_1[7];
Lev Walkin59b176e2005-11-26 11:25:14 +00002402
2403/*** <<< CODE [Sequence] >>> ***/
2404
Lev Walkin59b176e2005-11-26 11:25:14 +00002405/*
Lev Walkin2a744a72013-03-27 01:56:23 -07002406 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00002407 * so here we adjust the DEF accordingly.
2408 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002409static int
2410memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002411 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002412 long value;
2413
2414 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002415 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002416 "%s: value not given (%s:%d)",
2417 td->name, __FILE__, __LINE__);
2418 return -1;
2419 }
2420
Lev Walkin2a744a72013-03-27 01:56:23 -07002421 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00002422
2423 if((value >= -2)) {
2424 /* Constraint check succeeded */
2425 return 0;
2426 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002427 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002428 "%s: constraint failed (%s:%d)",
2429 td->name, __FILE__, __LINE__);
2430 return -1;
2431 }
2432}
2433
2434static int
2435memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002436 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002437 long value;
2438
2439 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002440 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002441 "%s: value not given (%s:%d)",
2442 td->name, __FILE__, __LINE__);
2443 return -1;
2444 }
2445
Lev Walkin2a744a72013-03-27 01:56:23 -07002446 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00002447
2448 if((value >= 5 && value <= 7)) {
2449 /* Constraint check succeeded */
2450 return 0;
2451 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002452 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002453 "%s: constraint failed (%s:%d)",
2454 td->name, __FILE__, __LINE__);
2455 return -1;
2456 }
2457}
2458
2459static int
2460memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002461 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002462 long value;
2463
2464 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002465 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002466 "%s: value not given (%s:%d)",
2467 td->name, __FILE__, __LINE__);
2468 return -1;
2469 }
2470
Lev Walkin2a744a72013-03-27 01:56:23 -07002471 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00002472
2473 if((value == 5)) {
2474 /* Constraint check succeeded */
2475 return 0;
2476 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002477 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002478 "%s: constraint failed (%s:%d)",
2479 td->name, __FILE__, __LINE__);
2480 return -1;
2481 }
2482}
2483
2484
Lev Walkin725883b2006-10-09 12:07:58 +00002485/*** <<< CTDEFS [Sequence] >>> ***/
2486
Lev Walkin2fce55d2013-03-28 05:00:39 -07002487static asn_per_constraints_t asn_PER_type_enum_c_constr_6 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002488 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
2489 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2490 0, 0 /* No PER value map */
2491};
Lev Walkin2fce55d2013-03-28 05:00:39 -07002492static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002493 { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
2494 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2495 0, 0 /* No PER value map */
2496};
Lev Walkin2fce55d2013-03-28 05:00:39 -07002497static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002498 { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
2499 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2500 0, 0 /* No PER value map */
2501};
Lev Walkin2fce55d2013-03-28 05:00:39 -07002502static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002503 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
2504 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2505 0, 0 /* No PER value map */
2506};
2507
Lev Walkin59b176e2005-11-26 11:25:14 +00002508/*** <<< STAT-DEFS [Sequence] >>> ***/
2509
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002510static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002511 Int1_t *st = *sptr;
2512
2513 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002514 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00002515 st = (*sptr = CALLOC(1, sizeof(*st)));
2516 if(!st) return -1;
2517 }
2518
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002519 if(set_value) {
2520 /* Install default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07002521 *st = 3;
2522 return 0;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002523 } else {
2524 /* Test default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07002525 return (*st == 3);
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002526 }
Lev Walkin59b176e2005-11-26 11:25:14 +00002527}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002528static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002529 BOOLEAN_t *st = *sptr;
2530
2531 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002532 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00002533 st = (*sptr = CALLOC(1, sizeof(*st)));
2534 if(!st) return -1;
2535 }
2536
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002537 if(set_value) {
2538 /* Install default value 1 */
2539 *st = 1;
2540 return 0;
2541 } else {
2542 /* Test default value 1 */
2543 return (*st == 1);
2544 }
Lev Walkin59b176e2005-11-26 11:25:14 +00002545}
Lev Walkina7591b52014-10-12 18:37:35 -07002546static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002547 { 1, 3, "one" },
2548 { 2, 3, "two" },
2549 { 3, 5, "three" }
2550 /* This list is extensible */
2551};
Lev Walkina7591b52014-10-12 18:37:35 -07002552static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002553 0, /* one(1) */
2554 2, /* three(3) */
2555 1 /* two(2) */
2556 /* This list is extensible */
2557};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002558static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002559 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
2560 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
2561 3, /* Number of elements in the maps */
2562 3, /* Extensions before this member */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002563 1, /* Strict enumeration */
2564 0, /* Native long size */
2565 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002566};
Lev Walkina7591b52014-10-12 18:37:35 -07002567static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002568 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2569};
Lev Walkin59b176e2005-11-26 11:25:14 +00002570static /* Use -fall-defs-global to expose */
2571asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
2572 "enum-c",
2573 "enum-c",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002574 NativeEnumerated_free,
2575 NativeEnumerated_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07002576 NativeEnumerated_compare,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002577 NativeEnumerated_constraint,
2578 NativeEnumerated_decode_ber,
2579 NativeEnumerated_encode_der,
2580 NativeEnumerated_decode_xer,
2581 NativeEnumerated_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002582 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002583 NativeEnumerated_decode_uper,
2584 NativeEnumerated_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002585 0, /* Use generic outmost tag fetcher */
2586 asn_DEF_enum_c_tags_6,
2587 sizeof(asn_DEF_enum_c_tags_6)
2588 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
2589 asn_DEF_enum_c_tags_6, /* Same as above */
2590 sizeof(asn_DEF_enum_c_tags_6)
2591 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002592 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002593 &asn_PER_type_enum_c_constr_6,
Lev Walkin59b176e2005-11-26 11:25:14 +00002594 0, 0, /* Defined elsewhere */
2595 &asn_SPC_enum_c_specs_6 /* Additional specs */
2596};
2597
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002598asn_TYPE_member_t asn_MBR_Sequence_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002599 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
2600 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2601 .tag_mode = 0,
2602 .type = &asn_DEF_Int1,
2603 .memb_constraints = memb_int1_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002604 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002605 .per_constraints = &asn_PER_memb_int1_c_constr_2,
Lev Walkin59b176e2005-11-26 11:25:14 +00002606 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
2607 .name = "int1-c"
2608 },
2609 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
2610 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
2611 .tag_mode = +1, /* EXPLICIT tag at current level */
2612 .type = &asn_DEF_Int4,
2613 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002614 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002615 .per_constraints = 0, /* No PER visible constraints */
2616 .default_value = 0,
2617 .name = "int4"
2618 },
2619 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
2620 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2621 .tag_mode = 0,
2622 .type = &asn_DEF_Int4,
2623 .memb_constraints = memb_int4_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002624 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002625 .per_constraints = &asn_PER_memb_int4_c_constr_4,
Lev Walkin59b176e2005-11-26 11:25:14 +00002626 .default_value = 0,
2627 .name = "int4-c"
2628 },
Lev Walkin2a744a72013-03-27 01:56:23 -07002629 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +00002630 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
2631 .tag_mode = 0,
2632 .type = &asn_DEF_BOOLEAN,
2633 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002634 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002635 .per_constraints = 0, /* No PER visible constraints */
2636 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
2637 .name = "bool"
2638 },
2639 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
2640 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
2641 .tag_mode = 0,
2642 .type = &asn_DEF_enum_c_6,
2643 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002644 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin07aaa342006-10-09 12:52:15 +00002645 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002646 .default_value = 0,
2647 .name = "enum-c"
2648 },
2649 { ATF_POINTER, 2, offsetof(struct Sequence, null),
2650 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
2651 .tag_mode = 0,
2652 .type = &asn_DEF_NULL,
2653 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002654 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002655 .per_constraints = 0, /* No PER visible constraints */
2656 .default_value = 0,
2657 .name = "null"
2658 },
2659 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
2660 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2661 .tag_mode = 0,
2662 .type = &asn_DEF_Int5,
2663 .memb_constraints = memb_int5_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002664 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002665 .per_constraints = &asn_PER_memb_int5_c_constr_13,
Lev Walkin59b176e2005-11-26 11:25:14 +00002666 .default_value = 0,
2667 .name = "int5-c"
2668 },
2669};
Lev Walkina7591b52014-10-12 18:37:35 -07002670static const int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
2671static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002672 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2673};
Lev Walkina7591b52014-10-12 18:37:35 -07002674static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -07002675 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
2676 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
2677 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
2678 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
2679 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
2680 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
2681 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002682};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002683asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002684 sizeof(struct Sequence),
2685 offsetof(struct Sequence, _asn_ctx),
2686 asn_MAP_Sequence_tag2el_1,
2687 7, /* Count of tags in the map */
2688 asn_MAP_Sequence_oms_1, /* Optional members */
2689 3, 1, /* Root/Additions */
2690 5, /* Start extensions */
2691 8 /* Stop extensions */
2692};
2693asn_TYPE_descriptor_t asn_DEF_Sequence = {
2694 "Sequence",
2695 "Sequence",
2696 SEQUENCE_free,
2697 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07002698 SEQUENCE_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00002699 SEQUENCE_constraint,
2700 SEQUENCE_decode_ber,
2701 SEQUENCE_encode_der,
2702 SEQUENCE_decode_xer,
2703 SEQUENCE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002704 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002705 SEQUENCE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002706 SEQUENCE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002707 0, /* Use generic outmost tag fetcher */
2708 asn_DEF_Sequence_tags_1,
2709 sizeof(asn_DEF_Sequence_tags_1)
2710 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
2711 asn_DEF_Sequence_tags_1, /* Same as above */
2712 sizeof(asn_DEF_Sequence_tags_1)
2713 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002714 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002715 0, /* No PER visible constraints */
2716 asn_MBR_Sequence_1,
2717 7, /* Elements count */
2718 &asn_SPC_Sequence_specs_1 /* Additional specs */
2719};
2720
2721
2722/*** <<< INCLUDES [SequenceOf] >>> ***/
2723
2724#include <asn_SEQUENCE_OF.h>
2725#include <constr_SEQUENCE_OF.h>
2726
2727/*** <<< FWD-DECLS [SequenceOf] >>> ***/
2728
2729struct Sequence;
2730
2731/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
2732
2733typedef struct SequenceOf {
2734 A_SEQUENCE_OF(struct Sequence) list;
2735
2736 /* Context for parsing across buffer boundaries */
2737 asn_struct_ctx_t _asn_ctx;
2738} SequenceOf_t;
2739
2740/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
2741
2742extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
2743
2744/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
2745
Lev Walkin22b5ed42006-09-13 02:51:20 +00002746#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002747
Lev Walkin725883b2006-10-09 12:07:58 +00002748/*** <<< CTDEFS [SequenceOf] >>> ***/
2749
Lev Walkin2fce55d2013-03-28 05:00:39 -07002750static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002751 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2752 { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */,
2753 0, 0 /* No PER value map */
2754};
2755
Lev Walkin59b176e2005-11-26 11:25:14 +00002756/*** <<< STAT-DEFS [SequenceOf] >>> ***/
2757
2758static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
2759 { ATF_POINTER, 0, 0,
2760 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
2761 .tag_mode = 0,
2762 .type = &asn_DEF_Sequence,
2763 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002764 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002765 .per_constraints = 0, /* No PER visible constraints */
2766 .default_value = 0,
2767 .name = ""
2768 },
2769};
Lev Walkina7591b52014-10-12 18:37:35 -07002770static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002771 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2772};
2773static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
2774 sizeof(struct SequenceOf),
2775 offsetof(struct SequenceOf, _asn_ctx),
2776 0, /* XER encoding is XMLDelimitedItemList */
2777};
Lev Walkin59b176e2005-11-26 11:25:14 +00002778asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
2779 "SequenceOf",
2780 "SequenceOf",
2781 SEQUENCE_OF_free,
2782 SEQUENCE_OF_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07002783 SEQUENCE_OF_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00002784 SEQUENCE_OF_constraint,
2785 SEQUENCE_OF_decode_ber,
2786 SEQUENCE_OF_encode_der,
2787 SEQUENCE_OF_decode_xer,
2788 SEQUENCE_OF_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002789 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002790 SEQUENCE_OF_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002791 SEQUENCE_OF_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002792 0, /* Use generic outmost tag fetcher */
2793 asn_DEF_SequenceOf_tags_1,
2794 sizeof(asn_DEF_SequenceOf_tags_1)
2795 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
2796 asn_DEF_SequenceOf_tags_1, /* Same as above */
2797 sizeof(asn_DEF_SequenceOf_tags_1)
2798 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002799 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002800 &asn_PER_type_SequenceOf_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002801 asn_MBR_SequenceOf_1,
2802 1, /* Single element */
2803 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
2804};
2805
2806
2807/*** <<< INCLUDES [Enum0] >>> ***/
2808
Lev Walkin2a744a72013-03-27 01:56:23 -07002809#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00002810
2811/*** <<< DEPS [Enum0] >>> ***/
2812
2813typedef enum Enum0 {
2814 Enum0_one = 0,
2815 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00002816} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00002817
2818/*** <<< TYPE-DECLS [Enum0] >>> ***/
2819
Lev Walkin2a744a72013-03-27 01:56:23 -07002820typedef long Enum0_t;
Lev Walkin59b176e2005-11-26 11:25:14 +00002821
2822/*** <<< FUNC-DECLS [Enum0] >>> ***/
2823
2824extern asn_TYPE_descriptor_t asn_DEF_Enum0;
2825asn_struct_free_f Enum0_free;
2826asn_struct_print_f Enum0_print;
2827asn_constr_check_f Enum0_constraint;
2828ber_type_decoder_f Enum0_decode_ber;
2829der_type_encoder_f Enum0_encode_der;
2830xer_type_decoder_f Enum0_decode_xer;
2831xer_type_encoder_f Enum0_encode_xer;
2832per_type_decoder_f Enum0_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002833per_type_encoder_f Enum0_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002834
2835/*** <<< CODE [Enum0] >>> ***/
2836
Lev Walkin59b176e2005-11-26 11:25:14 +00002837/*
Lev Walkin2a744a72013-03-27 01:56:23 -07002838 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00002839 * so here we adjust the DEF accordingly.
2840 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002841
Lev Walkin725883b2006-10-09 12:07:58 +00002842/*** <<< CTDEFS [Enum0] >>> ***/
2843
Lev Walkin2fce55d2013-03-28 05:00:39 -07002844static asn_per_constraints_t asn_PER_type_Enum0_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002845 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
2846 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2847 0, 0 /* No PER value map */
2848};
2849
Lev Walkin59b176e2005-11-26 11:25:14 +00002850/*** <<< STAT-DEFS [Enum0] >>> ***/
2851
Lev Walkina7591b52014-10-12 18:37:35 -07002852static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002853 { 0, 3, "one" },
2854 { 1, 3, "two" }
2855};
Lev Walkina7591b52014-10-12 18:37:35 -07002856static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002857 0, /* one(0) */
2858 1 /* two(1) */
2859};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002860static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002861 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
2862 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
2863 2, /* Number of elements in the maps */
2864 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002865 1, /* Strict enumeration */
2866 0, /* Native long size */
2867 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002868};
Lev Walkina7591b52014-10-12 18:37:35 -07002869static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002870 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2871};
Lev Walkin59b176e2005-11-26 11:25:14 +00002872asn_TYPE_descriptor_t asn_DEF_Enum0 = {
2873 "Enum0",
2874 "Enum0",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002875 NativeEnumerated_free,
2876 NativeEnumerated_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07002877 NativeEnumerated_compare,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002878 NativeEnumerated_constraint,
2879 NativeEnumerated_decode_ber,
2880 NativeEnumerated_encode_der,
2881 NativeEnumerated_decode_xer,
2882 NativeEnumerated_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002883 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002884 NativeEnumerated_decode_uper,
2885 NativeEnumerated_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002886 0, /* Use generic outmost tag fetcher */
2887 asn_DEF_Enum0_tags_1,
2888 sizeof(asn_DEF_Enum0_tags_1)
2889 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
2890 asn_DEF_Enum0_tags_1, /* Same as above */
2891 sizeof(asn_DEF_Enum0_tags_1)
2892 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002893 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002894 &asn_PER_type_Enum0_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002895 0, 0, /* Defined elsewhere */
2896 &asn_SPC_Enum0_specs_1 /* Additional specs */
2897};
2898
2899
2900/*** <<< INCLUDES [Enum1] >>> ***/
2901
2902#include <NativeEnumerated.h>
2903
2904/*** <<< DEPS [Enum1] >>> ***/
2905
2906typedef enum Enum1 {
2907 Enum1_one = 0,
2908 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00002909} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00002910
2911/*** <<< TYPE-DECLS [Enum1] >>> ***/
2912
2913typedef long Enum1_t;
2914
2915/*** <<< FUNC-DECLS [Enum1] >>> ***/
2916
2917extern asn_TYPE_descriptor_t asn_DEF_Enum1;
2918asn_struct_free_f Enum1_free;
2919asn_struct_print_f Enum1_print;
2920asn_constr_check_f Enum1_constraint;
2921ber_type_decoder_f Enum1_decode_ber;
2922der_type_encoder_f Enum1_encode_der;
2923xer_type_decoder_f Enum1_decode_xer;
2924xer_type_encoder_f Enum1_encode_xer;
2925per_type_decoder_f Enum1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002926per_type_encoder_f Enum1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002927
2928/*** <<< CODE [Enum1] >>> ***/
2929
2930int
2931Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002932 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002933 long value;
2934
2935 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002936 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002937 "%s: value not given (%s:%d)",
2938 td->name, __FILE__, __LINE__);
2939 return -1;
2940 }
2941
2942 value = *(const long *)sptr;
2943
2944 if((value == 0)) {
2945 /* Constraint check succeeded */
2946 return 0;
2947 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002948 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002949 "%s: constraint failed (%s:%d)",
2950 td->name, __FILE__, __LINE__);
2951 return -1;
2952 }
2953}
2954
2955/*
2956 * This type is implemented using NativeEnumerated,
2957 * so here we adjust the DEF accordingly.
2958 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002959
Lev Walkin725883b2006-10-09 12:07:58 +00002960/*** <<< CTDEFS [Enum1] >>> ***/
2961
Lev Walkin2fce55d2013-03-28 05:00:39 -07002962static asn_per_constraints_t asn_PER_type_Enum1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002963 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
2964 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2965 0, 0 /* No PER value map */
2966};
2967
Lev Walkin59b176e2005-11-26 11:25:14 +00002968/*** <<< STAT-DEFS [Enum1] >>> ***/
2969
Lev Walkina7591b52014-10-12 18:37:35 -07002970static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002971 { 0, 3, "one" },
2972 { 1, 3, "two" }
2973};
Lev Walkina7591b52014-10-12 18:37:35 -07002974static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002975 0, /* one(0) */
2976 1 /* two(1) */
2977};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002978static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002979 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
2980 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
2981 2, /* Number of elements in the maps */
2982 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002983 1, /* Strict enumeration */
2984 0, /* Native long size */
2985 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002986};
Lev Walkina7591b52014-10-12 18:37:35 -07002987static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002988 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2989};
Lev Walkin59b176e2005-11-26 11:25:14 +00002990asn_TYPE_descriptor_t asn_DEF_Enum1 = {
2991 "Enum1",
2992 "Enum1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002993 NativeEnumerated_free,
2994 NativeEnumerated_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07002995 NativeEnumerated_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00002996 Enum1_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002997 NativeEnumerated_decode_ber,
2998 NativeEnumerated_encode_der,
2999 NativeEnumerated_decode_xer,
3000 NativeEnumerated_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04003001 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003002 NativeEnumerated_decode_uper,
3003 NativeEnumerated_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003004 0, /* Use generic outmost tag fetcher */
3005 asn_DEF_Enum1_tags_1,
3006 sizeof(asn_DEF_Enum1_tags_1)
3007 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
3008 asn_DEF_Enum1_tags_1, /* Same as above */
3009 sizeof(asn_DEF_Enum1_tags_1)
3010 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003011 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003012 &asn_PER_type_Enum1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003013 0, 0, /* Defined elsewhere */
3014 &asn_SPC_Enum1_specs_1 /* Additional specs */
3015};
3016
3017
3018/*** <<< INCLUDES [Identifier] >>> ***/
3019
3020#include <VisibleString.h>
3021
3022/*** <<< TYPE-DECLS [Identifier] >>> ***/
3023
3024typedef VisibleString_t Identifier_t;
3025
3026/*** <<< FUNC-DECLS [Identifier] >>> ***/
3027
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003028extern asn_per_constraints_t asn_PER_type_Identifier_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00003029extern asn_TYPE_descriptor_t asn_DEF_Identifier;
3030asn_struct_free_f Identifier_free;
3031asn_struct_print_f Identifier_print;
3032asn_constr_check_f Identifier_constraint;
3033ber_type_decoder_f Identifier_decode_ber;
3034der_type_encoder_f Identifier_encode_der;
3035xer_type_decoder_f Identifier_decode_xer;
3036xer_type_encoder_f Identifier_encode_xer;
3037per_type_decoder_f Identifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003038per_type_encoder_f Identifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003039
3040/*** <<< CTABLES [Identifier] >>> ***/
3041
Lev Walkina7591b52014-10-12 18:37:35 -07003042static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003043 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3044 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3045 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
3046 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
3047 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
304827,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
3049 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
305054,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003051};
Lev Walkina7591b52014-10-12 18:37:35 -07003052static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000305336,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
305470,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
305586,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
3056107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
3057};
3058
Lev Walkin59b176e2005-11-26 11:25:14 +00003059
3060static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07003061 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00003062 /* The underlying type is VisibleString */
3063 const VisibleString_t *st = (const VisibleString_t *)sptr;
3064 const uint8_t *ch = st->buf;
3065 const uint8_t *end = ch + st->size;
3066
3067 for(; ch < end; ch++) {
3068 uint8_t cv = *ch;
3069 if(!table[cv]) return -1;
3070 }
3071 return 0;
3072}
3073
3074
3075/*** <<< CODE [Identifier] >>> ***/
3076
3077int
3078Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003079 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003080 const VisibleString_t *st = (const VisibleString_t *)sptr;
3081 size_t size;
3082
3083 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003084 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003085 "%s: value not given (%s:%d)",
3086 td->name, __FILE__, __LINE__);
3087 return -1;
3088 }
3089
3090 size = st->size;
3091
3092 if((size >= 1 && size <= 32)
3093 && !check_permitted_alphabet_1(st)) {
3094 /* Constraint check succeeded */
3095 return 0;
3096 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003097 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003098 "%s: constraint failed (%s:%d)",
3099 td->name, __FILE__, __LINE__);
3100 return -1;
3101 }
3102}
3103
Lev Walkin725883b2006-10-09 12:07:58 +00003104static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) {
3105 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
3106 return -1;
3107 return permitted_alphabet_table_1[value] - 1;
3108}
3109static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) {
3110 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
3111 return -1;
3112 return permitted_alphabet_code2value_1[code];
3113}
Lev Walkin59b176e2005-11-26 11:25:14 +00003114/*
3115 * This type is implemented using VisibleString,
3116 * so here we adjust the DEF accordingly.
3117 */
Lev Walkin59b176e2005-11-26 11:25:14 +00003118
Lev Walkin725883b2006-10-09 12:07:58 +00003119/*** <<< CTDEFS [Identifier] >>> ***/
3120
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003121asn_per_constraints_t asn_PER_type_Identifier_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003122 { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */,
3123 { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
3124 asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */
3125 asn_PER_MAP_Identifier_1_c2v /* PER code to value map */
3126};
3127
Lev Walkin59b176e2005-11-26 11:25:14 +00003128/*** <<< STAT-DEFS [Identifier] >>> ***/
3129
Lev Walkina7591b52014-10-12 18:37:35 -07003130static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003131 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
3132};
Lev Walkin59b176e2005-11-26 11:25:14 +00003133asn_TYPE_descriptor_t asn_DEF_Identifier = {
3134 "Identifier",
3135 "Identifier",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003136 VisibleString_free,
3137 VisibleString_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -07003138 VisibleString_compare,
Lev Walkin59b176e2005-11-26 11:25:14 +00003139 Identifier_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003140 VisibleString_decode_ber,
3141 VisibleString_encode_der,
3142 VisibleString_decode_xer,
3143 VisibleString_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04003144 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003145 VisibleString_decode_uper,
3146 VisibleString_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003147 0, /* Use generic outmost tag fetcher */
3148 asn_DEF_Identifier_tags_1,
3149 sizeof(asn_DEF_Identifier_tags_1)
3150 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
3151 asn_DEF_Identifier_tags_1, /* Same as above */
3152 sizeof(asn_DEF_Identifier_tags_1)
3153 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003154 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003155 &asn_PER_type_Identifier_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003156 0, 0, /* No members */
3157 0 /* No specifics */
3158};
3159