blob: 04682138df5ef18f52325eddd99ef859b3e79835 [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,
40 NativeInteger_constraint,
41 NativeInteger_decode_ber,
42 NativeInteger_encode_der,
43 NativeInteger_decode_xer,
44 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +040045 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080046 NativeInteger_decode_uper,
47 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +000048 0, /* Use generic outmost tag fetcher */
49 asn_DEF_Int1_tags_1,
50 sizeof(asn_DEF_Int1_tags_1)
51 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
52 asn_DEF_Int1_tags_1, /* Same as above */
53 sizeof(asn_DEF_Int1_tags_1)
54 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +040055 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +000056 0, /* No PER visible constraints */
57 0, 0, /* No members */
58 0 /* No specifics */
59};
60
61
62/*** <<< INCLUDES [Int2] >>> ***/
63
Lev Walkin22b5ed42006-09-13 02:51:20 +000064#include "Int1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +000065
66/*** <<< TYPE-DECLS [Int2] >>> ***/
67
68typedef Int1_t Int2_t;
69
70/*** <<< FUNC-DECLS [Int2] >>> ***/
71
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080072extern asn_per_constraints_t asn_PER_type_Int2_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +000073extern asn_TYPE_descriptor_t asn_DEF_Int2;
74asn_struct_free_f Int2_free;
75asn_struct_print_f Int2_print;
76asn_constr_check_f Int2_constraint;
77ber_type_decoder_f Int2_decode_ber;
78der_type_encoder_f Int2_encode_der;
79xer_type_decoder_f Int2_decode_xer;
80xer_type_encoder_f Int2_encode_xer;
81per_type_decoder_f Int2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000082per_type_encoder_f Int2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +000083
84/*** <<< CODE [Int2] >>> ***/
85
86int
87Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000088 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +000089 long value;
90
91 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070092 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +000093 "%s: value not given (%s:%d)",
94 td->name, __FILE__, __LINE__);
95 return -1;
96 }
97
Lev Walkin2a744a72013-03-27 01:56:23 -070098 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +000099
100 if((value >= 0)) {
101 /* Constraint check succeeded */
102 return 0;
103 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700104 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000105 "%s: constraint failed (%s:%d)",
106 td->name, __FILE__, __LINE__);
107 return -1;
108 }
109}
110
111/*
112 * This type is implemented using Int1,
113 * so here we adjust the DEF accordingly.
114 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000115
Lev Walkin725883b2006-10-09 12:07:58 +0000116/*** <<< CTDEFS [Int2] >>> ***/
117
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800118asn_per_constraints_t asn_PER_type_Int2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000119 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
120 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
121 0, 0 /* No PER value map */
122};
123
Lev Walkin59b176e2005-11-26 11:25:14 +0000124/*** <<< STAT-DEFS [Int2] >>> ***/
125
Lev Walkina7591b52014-10-12 18:37:35 -0700126static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000127 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
128};
Lev Walkin59b176e2005-11-26 11:25:14 +0000129asn_TYPE_descriptor_t asn_DEF_Int2 = {
130 "Int2",
131 "Int2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800132 NativeInteger_free,
133 NativeInteger_print,
Lev Walkin59b176e2005-11-26 11:25:14 +0000134 Int2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800135 NativeInteger_decode_ber,
136 NativeInteger_encode_der,
137 NativeInteger_decode_xer,
138 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400139 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800140 NativeInteger_decode_uper,
141 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000142 0, /* Use generic outmost tag fetcher */
143 asn_DEF_Int2_tags_1,
144 sizeof(asn_DEF_Int2_tags_1)
145 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
146 asn_DEF_Int2_tags_1, /* Same as above */
147 sizeof(asn_DEF_Int2_tags_1)
148 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400149 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000150 &asn_PER_type_Int2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000151 0, 0, /* No members */
152 0 /* No specifics */
153};
154
155
156/*** <<< INCLUDES [Int3] >>> ***/
157
Lev Walkin22b5ed42006-09-13 02:51:20 +0000158#include "Int2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000159
160/*** <<< TYPE-DECLS [Int3] >>> ***/
161
162typedef Int2_t Int3_t;
163
164/*** <<< FUNC-DECLS [Int3] >>> ***/
165
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800166extern asn_per_constraints_t asn_PER_type_Int3_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000167extern asn_TYPE_descriptor_t asn_DEF_Int3;
168asn_struct_free_f Int3_free;
169asn_struct_print_f Int3_print;
170asn_constr_check_f Int3_constraint;
171ber_type_decoder_f Int3_decode_ber;
172der_type_encoder_f Int3_encode_der;
173xer_type_decoder_f Int3_decode_xer;
174xer_type_encoder_f Int3_encode_xer;
175per_type_decoder_f Int3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000176per_type_encoder_f Int3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000177
178/*** <<< CODE [Int3] >>> ***/
179
180int
181Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000182 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000183 long value;
184
185 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700186 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000187 "%s: value not given (%s:%d)",
188 td->name, __FILE__, __LINE__);
189 return -1;
190 }
191
Lev Walkin2a744a72013-03-27 01:56:23 -0700192 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000193
194 if((value >= 0 && value <= 10)) {
195 /* Constraint check succeeded */
196 return 0;
197 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700198 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000199 "%s: constraint failed (%s:%d)",
200 td->name, __FILE__, __LINE__);
201 return -1;
202 }
203}
204
205/*
206 * This type is implemented using Int2,
207 * so here we adjust the DEF accordingly.
208 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000209
Lev Walkin725883b2006-10-09 12:07:58 +0000210/*** <<< CTDEFS [Int3] >>> ***/
211
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800212asn_per_constraints_t asn_PER_type_Int3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000213 { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
214 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
215 0, 0 /* No PER value map */
216};
217
Lev Walkin59b176e2005-11-26 11:25:14 +0000218/*** <<< STAT-DEFS [Int3] >>> ***/
219
Lev Walkina7591b52014-10-12 18:37:35 -0700220static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000221 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
222};
Lev Walkin59b176e2005-11-26 11:25:14 +0000223asn_TYPE_descriptor_t asn_DEF_Int3 = {
224 "Int3",
225 "Int3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800226 NativeInteger_free,
227 NativeInteger_print,
Lev Walkin59b176e2005-11-26 11:25:14 +0000228 Int3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800229 NativeInteger_decode_ber,
230 NativeInteger_encode_der,
231 NativeInteger_decode_xer,
232 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400233 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800234 NativeInteger_decode_uper,
235 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000236 0, /* Use generic outmost tag fetcher */
237 asn_DEF_Int3_tags_1,
238 sizeof(asn_DEF_Int3_tags_1)
239 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
240 asn_DEF_Int3_tags_1, /* Same as above */
241 sizeof(asn_DEF_Int3_tags_1)
242 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400243 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000244 &asn_PER_type_Int3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000245 0, 0, /* No members */
246 0 /* No specifics */
247};
248
249
250/*** <<< INCLUDES [Int4] >>> ***/
251
Lev Walkin22b5ed42006-09-13 02:51:20 +0000252#include "Int3.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000253
254/*** <<< TYPE-DECLS [Int4] >>> ***/
255
256typedef Int3_t Int4_t;
257
258/*** <<< FUNC-DECLS [Int4] >>> ***/
259
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800260extern asn_per_constraints_t asn_PER_type_Int4_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000261extern asn_TYPE_descriptor_t asn_DEF_Int4;
262asn_struct_free_f Int4_free;
263asn_struct_print_f Int4_print;
264asn_constr_check_f Int4_constraint;
265ber_type_decoder_f Int4_decode_ber;
266der_type_encoder_f Int4_encode_der;
267xer_type_decoder_f Int4_decode_xer;
268xer_type_encoder_f Int4_encode_xer;
269per_type_decoder_f Int4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000270per_type_encoder_f Int4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000271
272/*** <<< CODE [Int4] >>> ***/
273
274int
275Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000276 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000277 long value;
278
279 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700280 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000281 "%s: value not given (%s:%d)",
282 td->name, __FILE__, __LINE__);
283 return -1;
284 }
285
Lev Walkin2a744a72013-03-27 01:56:23 -0700286 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000287
288 if((value >= 1 && value <= 10)) {
289 /* Constraint check succeeded */
290 return 0;
291 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700292 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000293 "%s: constraint failed (%s:%d)",
294 td->name, __FILE__, __LINE__);
295 return -1;
296 }
297}
298
299/*
300 * This type is implemented using Int3,
301 * so here we adjust the DEF accordingly.
302 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000303
Lev Walkin725883b2006-10-09 12:07:58 +0000304/*** <<< CTDEFS [Int4] >>> ***/
305
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800306asn_per_constraints_t asn_PER_type_Int4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000307 { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
308 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
309 0, 0 /* No PER value map */
310};
311
Lev Walkin59b176e2005-11-26 11:25:14 +0000312/*** <<< STAT-DEFS [Int4] >>> ***/
313
Lev Walkina7591b52014-10-12 18:37:35 -0700314static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000315 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
316};
Lev Walkin59b176e2005-11-26 11:25:14 +0000317asn_TYPE_descriptor_t asn_DEF_Int4 = {
318 "Int4",
319 "Int4",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800320 NativeInteger_free,
321 NativeInteger_print,
Lev Walkin59b176e2005-11-26 11:25:14 +0000322 Int4_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800323 NativeInteger_decode_ber,
324 NativeInteger_encode_der,
325 NativeInteger_decode_xer,
326 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400327 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800328 NativeInteger_decode_uper,
329 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000330 0, /* Use generic outmost tag fetcher */
331 asn_DEF_Int4_tags_1,
332 sizeof(asn_DEF_Int4_tags_1)
333 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
334 asn_DEF_Int4_tags_1, /* Same as above */
335 sizeof(asn_DEF_Int4_tags_1)
336 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400337 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000338 &asn_PER_type_Int4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000339 0, 0, /* No members */
340 0 /* No specifics */
341};
342
343
344/*** <<< INCLUDES [Int5] >>> ***/
345
Lev Walkin22b5ed42006-09-13 02:51:20 +0000346#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000347
348/*** <<< TYPE-DECLS [Int5] >>> ***/
349
350typedef Int4_t Int5_t;
351
352/*** <<< FUNC-DECLS [Int5] >>> ***/
353
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800354extern asn_per_constraints_t asn_PER_type_Int5_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000355extern asn_TYPE_descriptor_t asn_DEF_Int5;
356asn_struct_free_f Int5_free;
357asn_struct_print_f Int5_print;
358asn_constr_check_f Int5_constraint;
359ber_type_decoder_f Int5_decode_ber;
360der_type_encoder_f Int5_encode_der;
361xer_type_decoder_f Int5_decode_xer;
362xer_type_encoder_f Int5_encode_xer;
363per_type_decoder_f Int5_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000364per_type_encoder_f Int5_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000365
366/*** <<< CODE [Int5] >>> ***/
367
368int
369Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000370 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000371 long value;
372
373 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700374 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000375 "%s: value not given (%s:%d)",
376 td->name, __FILE__, __LINE__);
377 return -1;
378 }
379
Lev Walkin2a744a72013-03-27 01:56:23 -0700380 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000381
382 if((value == 5)) {
383 /* Constraint check succeeded */
384 return 0;
385 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700386 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000387 "%s: constraint failed (%s:%d)",
388 td->name, __FILE__, __LINE__);
389 return -1;
390 }
391}
392
393/*
394 * This type is implemented using Int4,
395 * so here we adjust the DEF accordingly.
396 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000397
Lev Walkin725883b2006-10-09 12:07:58 +0000398/*** <<< CTDEFS [Int5] >>> ***/
399
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800400asn_per_constraints_t asn_PER_type_Int5_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000401 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
402 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
403 0, 0 /* No PER value map */
404};
405
Lev Walkin59b176e2005-11-26 11:25:14 +0000406/*** <<< STAT-DEFS [Int5] >>> ***/
407
Lev Walkina7591b52014-10-12 18:37:35 -0700408static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000409 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
410};
Lev Walkin59b176e2005-11-26 11:25:14 +0000411asn_TYPE_descriptor_t asn_DEF_Int5 = {
412 "Int5",
413 "Int5",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800414 NativeInteger_free,
415 NativeInteger_print,
Lev Walkin59b176e2005-11-26 11:25:14 +0000416 Int5_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800417 NativeInteger_decode_ber,
418 NativeInteger_encode_der,
419 NativeInteger_decode_xer,
420 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400421 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800422 NativeInteger_decode_uper,
423 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000424 0, /* Use generic outmost tag fetcher */
425 asn_DEF_Int5_tags_1,
426 sizeof(asn_DEF_Int5_tags_1)
427 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
428 asn_DEF_Int5_tags_1, /* Same as above */
429 sizeof(asn_DEF_Int5_tags_1)
430 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400431 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000432 &asn_PER_type_Int5_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000433 0, 0, /* No members */
434 0 /* No specifics */
435};
436
437
438/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
439
Lev Walkin2a744a72013-03-27 01:56:23 -0700440#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +0000441
442/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
443
Lev Walkin2a744a72013-03-27 01:56:23 -0700444typedef long ExtensibleExtensions_t;
Lev Walkin59b176e2005-11-26 11:25:14 +0000445
446/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
447
448extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
449asn_struct_free_f ExtensibleExtensions_free;
450asn_struct_print_f ExtensibleExtensions_print;
451asn_constr_check_f ExtensibleExtensions_constraint;
452ber_type_decoder_f ExtensibleExtensions_decode_ber;
453der_type_encoder_f ExtensibleExtensions_encode_der;
454xer_type_decoder_f ExtensibleExtensions_decode_xer;
455xer_type_encoder_f ExtensibleExtensions_encode_xer;
456per_type_decoder_f ExtensibleExtensions_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000457per_type_encoder_f ExtensibleExtensions_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000458
459/*** <<< CODE [ExtensibleExtensions] >>> ***/
460
461int
462ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000463 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000464 long value;
465
466 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700467 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000468 "%s: value not given (%s:%d)",
469 td->name, __FILE__, __LINE__);
470 return -1;
471 }
472
Lev Walkin2a744a72013-03-27 01:56:23 -0700473 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000474
475 if((value >= 1 && value <= 256)) {
476 /* Constraint check succeeded */
477 return 0;
478 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700479 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000480 "%s: constraint failed (%s:%d)",
481 td->name, __FILE__, __LINE__);
482 return -1;
483 }
484}
485
486/*
Lev Walkin2a744a72013-03-27 01:56:23 -0700487 * This type is implemented using NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +0000488 * so here we adjust the DEF accordingly.
489 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000490
Lev Walkin725883b2006-10-09 12:07:58 +0000491/*** <<< CTDEFS [ExtensibleExtensions] >>> ***/
492
Lev Walkin2fce55d2013-03-28 05:00:39 -0700493static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000494 { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
495 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
496 0, 0 /* No PER value map */
497};
498
Lev Walkin59b176e2005-11-26 11:25:14 +0000499/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
500
Lev Walkina7591b52014-10-12 18:37:35 -0700501static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000502 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
503};
Lev Walkin59b176e2005-11-26 11:25:14 +0000504asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
505 "ExtensibleExtensions",
506 "ExtensibleExtensions",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800507 NativeInteger_free,
508 NativeInteger_print,
Lev Walkin59b176e2005-11-26 11:25:14 +0000509 ExtensibleExtensions_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800510 NativeInteger_decode_ber,
511 NativeInteger_encode_der,
512 NativeInteger_decode_xer,
513 NativeInteger_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400514 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800515 NativeInteger_decode_uper,
516 NativeInteger_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000517 0, /* Use generic outmost tag fetcher */
518 asn_DEF_ExtensibleExtensions_tags_1,
519 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
520 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
521 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
522 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
523 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400524 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000525 &asn_PER_type_ExtensibleExtensions_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000526 0, 0, /* No members */
527 0 /* No specifics */
528};
529
530
531/*** <<< INCLUDES [Str1] >>> ***/
532
533#include <IA5String.h>
534
535/*** <<< TYPE-DECLS [Str1] >>> ***/
536
537typedef IA5String_t Str1_t;
538
539/*** <<< FUNC-DECLS [Str1] >>> ***/
540
541extern asn_TYPE_descriptor_t asn_DEF_Str1;
542asn_struct_free_f Str1_free;
543asn_struct_print_f Str1_print;
544asn_constr_check_f Str1_constraint;
545ber_type_decoder_f Str1_decode_ber;
546der_type_encoder_f Str1_encode_der;
547xer_type_decoder_f Str1_decode_xer;
548xer_type_encoder_f Str1_encode_xer;
549per_type_decoder_f Str1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000550per_type_encoder_f Str1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000551
552/*** <<< CODE [Str1] >>> ***/
553
Lev Walkin59b176e2005-11-26 11:25:14 +0000554/*
555 * This type is implemented using IA5String,
556 * so here we adjust the DEF accordingly.
557 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000558
559/*** <<< STAT-DEFS [Str1] >>> ***/
560
Lev Walkina7591b52014-10-12 18:37:35 -0700561static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000562 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
563};
564asn_TYPE_descriptor_t asn_DEF_Str1 = {
565 "Str1",
566 "Str1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800567 IA5String_free,
568 IA5String_print,
569 IA5String_constraint,
570 IA5String_decode_ber,
571 IA5String_encode_der,
572 IA5String_decode_xer,
573 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400574 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800575 IA5String_decode_uper,
576 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000577 0, /* Use generic outmost tag fetcher */
578 asn_DEF_Str1_tags_1,
579 sizeof(asn_DEF_Str1_tags_1)
580 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
581 asn_DEF_Str1_tags_1, /* Same as above */
582 sizeof(asn_DEF_Str1_tags_1)
583 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400584 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000585 0, /* No PER visible constraints */
586 0, 0, /* No members */
587 0 /* No specifics */
588};
589
590
591/*** <<< INCLUDES [Str2] >>> ***/
592
Lev Walkin22b5ed42006-09-13 02:51:20 +0000593#include "Str1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000594
595/*** <<< TYPE-DECLS [Str2] >>> ***/
596
597typedef Str1_t Str2_t;
598
599/*** <<< FUNC-DECLS [Str2] >>> ***/
600
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800601extern asn_per_constraints_t asn_PER_type_Str2_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000602extern asn_TYPE_descriptor_t asn_DEF_Str2;
603asn_struct_free_f Str2_free;
604asn_struct_print_f Str2_print;
605asn_constr_check_f Str2_constraint;
606ber_type_decoder_f Str2_decode_ber;
607der_type_encoder_f Str2_encode_der;
608xer_type_decoder_f Str2_decode_xer;
609xer_type_encoder_f Str2_encode_xer;
610per_type_decoder_f Str2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000611per_type_encoder_f Str2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000612
613/*** <<< CTABLES [Str2] >>> ***/
614
615static int check_permitted_alphabet_1(const void *sptr) {
616 /* The underlying type is IA5String */
617 const IA5String_t *st = (const IA5String_t *)sptr;
618 const uint8_t *ch = st->buf;
619 const uint8_t *end = ch + st->size;
620
621 for(; ch < end; ch++) {
622 uint8_t cv = *ch;
623 if(!(cv <= 127)) return -1;
624 }
625 return 0;
626}
627
628
629/*** <<< CODE [Str2] >>> ***/
630
631int
632Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000633 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000634 const Str1_t *st = (const Str1_t *)sptr;
635 size_t size;
636
637 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700638 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000639 "%s: value not given (%s:%d)",
640 td->name, __FILE__, __LINE__);
641 return -1;
642 }
643
644 size = st->size;
645
646 if(((size <= 20) || (size >= 25 && size <= 30))
647 && !check_permitted_alphabet_1(st)) {
648 /* Constraint check succeeded */
649 return 0;
650 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700651 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000652 "%s: constraint failed (%s:%d)",
653 td->name, __FILE__, __LINE__);
654 return -1;
655 }
656}
657
658/*
659 * This type is implemented using Str1,
660 * so here we adjust the DEF accordingly.
661 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000662
Lev Walkin725883b2006-10-09 12:07:58 +0000663/*** <<< CTDEFS [Str2] >>> ***/
664
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800665asn_per_constraints_t asn_PER_type_Str2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000666 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
667 { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */,
668 0, 0 /* No PER character map necessary */
669};
670
Lev Walkin59b176e2005-11-26 11:25:14 +0000671/*** <<< STAT-DEFS [Str2] >>> ***/
672
Lev Walkina7591b52014-10-12 18:37:35 -0700673static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000674 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
675};
Lev Walkin59b176e2005-11-26 11:25:14 +0000676asn_TYPE_descriptor_t asn_DEF_Str2 = {
677 "Str2",
678 "Str2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800679 IA5String_free,
680 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +0000681 Str2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800682 IA5String_decode_ber,
683 IA5String_encode_der,
684 IA5String_decode_xer,
685 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400686 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800687 IA5String_decode_uper,
688 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000689 0, /* Use generic outmost tag fetcher */
690 asn_DEF_Str2_tags_1,
691 sizeof(asn_DEF_Str2_tags_1)
692 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
693 asn_DEF_Str2_tags_1, /* Same as above */
694 sizeof(asn_DEF_Str2_tags_1)
695 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400696 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000697 &asn_PER_type_Str2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000698 0, 0, /* No members */
699 0 /* No specifics */
700};
701
702
703/*** <<< INCLUDES [Str3] >>> ***/
704
Lev Walkin22b5ed42006-09-13 02:51:20 +0000705#include "Str2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000706
707/*** <<< TYPE-DECLS [Str3] >>> ***/
708
709typedef Str2_t Str3_t;
710
711/*** <<< FUNC-DECLS [Str3] >>> ***/
712
713extern asn_TYPE_descriptor_t asn_DEF_Str3;
714asn_struct_free_f Str3_free;
715asn_struct_print_f Str3_print;
716asn_constr_check_f Str3_constraint;
717ber_type_decoder_f Str3_decode_ber;
718der_type_encoder_f Str3_encode_der;
719xer_type_decoder_f Str3_decode_xer;
720xer_type_encoder_f Str3_encode_xer;
721per_type_decoder_f Str3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000722per_type_encoder_f Str3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000723
724/*** <<< CTABLES [Str3] >>> ***/
725
Lev Walkina7591b52014-10-12 18:37:35 -0700726static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000727 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
728 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
729 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
730 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
731 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
732 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
733 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin59b176e2005-11-26 11:25:14 +0000734};
Lev Walkina7591b52014-10-12 18:37:35 -0700735static const int permitted_alphabet_code2value_1[6] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +000073665,66,67,100,101,102,};
737
Lev Walkin59b176e2005-11-26 11:25:14 +0000738
739static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -0700740 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000741 /* The underlying type is IA5String */
742 const IA5String_t *st = (const IA5String_t *)sptr;
743 const uint8_t *ch = st->buf;
744 const uint8_t *end = ch + st->size;
745
746 for(; ch < end; ch++) {
747 uint8_t cv = *ch;
748 if(!table[cv]) return -1;
749 }
750 return 0;
751}
752
753
754/*** <<< CODE [Str3] >>> ***/
755
756int
757Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000758 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000759 const Str2_t *st = (const Str2_t *)sptr;
760 size_t size;
761
762 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700763 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000764 "%s: value not given (%s:%d)",
765 td->name, __FILE__, __LINE__);
766 return -1;
767 }
768
769 size = st->size;
770
771 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
772 && !check_permitted_alphabet_1(st)) {
773 /* Constraint check succeeded */
774 return 0;
775 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700776 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000777 "%s: constraint failed (%s:%d)",
778 td->name, __FILE__, __LINE__);
779 return -1;
780 }
781}
782
Lev Walkin725883b2006-10-09 12:07:58 +0000783static int asn_PER_MAP_Str3_1_v2c(unsigned int value) {
784 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
785 return -1;
786 return permitted_alphabet_table_1[value] - 1;
787}
788static int asn_PER_MAP_Str3_1_c2v(unsigned int code) {
789 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
790 return -1;
791 return permitted_alphabet_code2value_1[code];
792}
Lev Walkin59b176e2005-11-26 11:25:14 +0000793/*
794 * This type is implemented using Str2,
795 * so here we adjust the DEF accordingly.
796 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000797
Lev Walkin725883b2006-10-09 12:07:58 +0000798/*** <<< CTDEFS [Str3] >>> ***/
799
Lev Walkin2fce55d2013-03-28 05:00:39 -0700800static asn_per_constraints_t asn_PER_type_Str3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000801 { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */,
802 { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */,
803 asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */
804 asn_PER_MAP_Str3_1_c2v /* PER code to value map */
805};
806
Lev Walkin59b176e2005-11-26 11:25:14 +0000807/*** <<< STAT-DEFS [Str3] >>> ***/
808
Lev Walkina7591b52014-10-12 18:37:35 -0700809static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000810 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
811};
Lev Walkin59b176e2005-11-26 11:25:14 +0000812asn_TYPE_descriptor_t asn_DEF_Str3 = {
813 "Str3",
814 "Str3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800815 IA5String_free,
816 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +0000817 Str3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800818 IA5String_decode_ber,
819 IA5String_encode_der,
820 IA5String_decode_xer,
821 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400822 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800823 IA5String_decode_uper,
824 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000825 0, /* Use generic outmost tag fetcher */
826 asn_DEF_Str3_tags_1,
827 sizeof(asn_DEF_Str3_tags_1)
828 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
829 asn_DEF_Str3_tags_1, /* Same as above */
830 sizeof(asn_DEF_Str3_tags_1)
831 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400832 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000833 &asn_PER_type_Str3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000834 0, 0, /* No members */
835 0 /* No specifics */
836};
837
838
839/*** <<< INCLUDES [Str4] >>> ***/
840
841#include <IA5String.h>
842
843/*** <<< TYPE-DECLS [Str4] >>> ***/
844
845typedef IA5String_t Str4_t;
846
847/*** <<< FUNC-DECLS [Str4] >>> ***/
848
849extern asn_TYPE_descriptor_t asn_DEF_Str4;
850asn_struct_free_f Str4_free;
851asn_struct_print_f Str4_print;
852asn_constr_check_f Str4_constraint;
853ber_type_decoder_f Str4_decode_ber;
854der_type_encoder_f Str4_encode_der;
855xer_type_decoder_f Str4_decode_xer;
856xer_type_encoder_f Str4_encode_xer;
857per_type_decoder_f Str4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000858per_type_encoder_f Str4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000859
860/*** <<< CTABLES [Str4] >>> ***/
861
862static int check_permitted_alphabet_1(const void *sptr) {
863 /* The underlying type is IA5String */
864 const IA5String_t *st = (const IA5String_t *)sptr;
865 const uint8_t *ch = st->buf;
866 const uint8_t *end = ch + st->size;
867
868 for(; ch < end; ch++) {
869 uint8_t cv = *ch;
870 if(!(cv <= 127)) return -1;
871 }
872 return 0;
873}
874
875
876/*** <<< CODE [Str4] >>> ***/
877
878int
879Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000880 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000881 const IA5String_t *st = (const IA5String_t *)sptr;
882
883 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700884 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000885 "%s: value not given (%s:%d)",
886 td->name, __FILE__, __LINE__);
887 return -1;
888 }
889
890
891 if(!check_permitted_alphabet_1(st)) {
892 /* Constraint check succeeded */
893 return 0;
894 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700895 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000896 "%s: constraint failed (%s:%d)",
897 td->name, __FILE__, __LINE__);
898 return -1;
899 }
900}
901
902/*
903 * This type is implemented using IA5String,
904 * so here we adjust the DEF accordingly.
905 */
Lev Walkin59b176e2005-11-26 11:25:14 +0000906
Lev Walkin725883b2006-10-09 12:07:58 +0000907/*** <<< CTDEFS [Str4] >>> ***/
908
Lev Walkin2fce55d2013-03-28 05:00:39 -0700909static asn_per_constraints_t asn_PER_type_Str4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000910 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
911 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
912 0, 0 /* No PER character map necessary */
913};
914
Lev Walkin59b176e2005-11-26 11:25:14 +0000915/*** <<< STAT-DEFS [Str4] >>> ***/
916
Lev Walkina7591b52014-10-12 18:37:35 -0700917static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000918 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
919};
Lev Walkin59b176e2005-11-26 11:25:14 +0000920asn_TYPE_descriptor_t asn_DEF_Str4 = {
921 "Str4",
922 "Str4",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800923 IA5String_free,
924 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +0000925 Str4_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800926 IA5String_decode_ber,
927 IA5String_encode_der,
928 IA5String_decode_xer,
929 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400930 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800931 IA5String_decode_uper,
932 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000933 0, /* Use generic outmost tag fetcher */
934 asn_DEF_Str4_tags_1,
935 sizeof(asn_DEF_Str4_tags_1)
936 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
937 asn_DEF_Str4_tags_1, /* Same as above */
938 sizeof(asn_DEF_Str4_tags_1)
939 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400940 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000941 &asn_PER_type_Str4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000942 0, 0, /* No members */
943 0 /* No specifics */
944};
945
946
947/*** <<< INCLUDES [PER-Visible] >>> ***/
948
949#include <IA5String.h>
950
951/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
952
953typedef IA5String_t PER_Visible_t;
954
955/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
956
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800957extern asn_per_constraints_t asn_PER_type_PER_Visible_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +0000958extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
959asn_struct_free_f PER_Visible_free;
960asn_struct_print_f PER_Visible_print;
961asn_constr_check_f PER_Visible_constraint;
962ber_type_decoder_f PER_Visible_decode_ber;
963der_type_encoder_f PER_Visible_encode_der;
964xer_type_decoder_f PER_Visible_decode_xer;
965xer_type_encoder_f PER_Visible_encode_xer;
966per_type_decoder_f PER_Visible_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000967per_type_encoder_f PER_Visible_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000968
969/*** <<< CTABLES [PER-Visible] >>> ***/
970
971static int check_permitted_alphabet_1(const void *sptr) {
972 /* The underlying type is IA5String */
973 const IA5String_t *st = (const IA5String_t *)sptr;
974 const uint8_t *ch = st->buf;
975 const uint8_t *end = ch + st->size;
976
977 for(; ch < end; ch++) {
978 uint8_t cv = *ch;
979 if(!(cv >= 65 && cv <= 70)) return -1;
980 }
981 return 0;
982}
983
984
985/*** <<< CODE [PER-Visible] >>> ***/
986
987int
988PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000989 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000990 const IA5String_t *st = (const IA5String_t *)sptr;
991
992 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700993 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000994 "%s: value not given (%s:%d)",
995 td->name, __FILE__, __LINE__);
996 return -1;
997 }
998
999
1000 if(!check_permitted_alphabet_1(st)) {
1001 /* Constraint check succeeded */
1002 return 0;
1003 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001004 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001005 "%s: constraint failed (%s:%d)",
1006 td->name, __FILE__, __LINE__);
1007 return -1;
1008 }
1009}
1010
1011/*
1012 * This type is implemented using IA5String,
1013 * so here we adjust the DEF accordingly.
1014 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001015
Lev Walkin725883b2006-10-09 12:07:58 +00001016/*** <<< CTDEFS [PER-Visible] >>> ***/
1017
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001018asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001019 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1020 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1021 0, 0 /* No PER character map necessary */
1022};
1023
Lev Walkin59b176e2005-11-26 11:25:14 +00001024/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1025
Lev Walkina7591b52014-10-12 18:37:35 -07001026static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001027 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1028};
Lev Walkin59b176e2005-11-26 11:25:14 +00001029asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1030 "PER-Visible",
1031 "PER-Visible",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001032 IA5String_free,
1033 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00001034 PER_Visible_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001035 IA5String_decode_ber,
1036 IA5String_encode_der,
1037 IA5String_decode_xer,
1038 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001039 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001040 IA5String_decode_uper,
1041 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001042 0, /* Use generic outmost tag fetcher */
1043 asn_DEF_PER_Visible_tags_1,
1044 sizeof(asn_DEF_PER_Visible_tags_1)
1045 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1046 asn_DEF_PER_Visible_tags_1, /* Same as above */
1047 sizeof(asn_DEF_PER_Visible_tags_1)
1048 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001049 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001050 &asn_PER_type_PER_Visible_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001051 0, 0, /* No members */
1052 0 /* No specifics */
1053};
1054
1055
1056/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1057
Lev Walkin22b5ed42006-09-13 02:51:20 +00001058#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001059
1060/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1061
1062typedef PER_Visible_t PER_Visible_2_t;
1063
1064/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1065
1066extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1067asn_struct_free_f PER_Visible_2_free;
1068asn_struct_print_f PER_Visible_2_print;
1069asn_constr_check_f PER_Visible_2_constraint;
1070ber_type_decoder_f PER_Visible_2_decode_ber;
1071der_type_encoder_f PER_Visible_2_encode_der;
1072xer_type_decoder_f PER_Visible_2_decode_xer;
1073xer_type_encoder_f PER_Visible_2_encode_xer;
1074per_type_decoder_f PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001075per_type_encoder_f PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001076
1077/*** <<< CTABLES [PER-Visible-2] >>> ***/
1078
1079static int check_permitted_alphabet_1(const void *sptr) {
1080 /* The underlying type is IA5String */
1081 const IA5String_t *st = (const IA5String_t *)sptr;
1082 const uint8_t *ch = st->buf;
1083 const uint8_t *end = ch + st->size;
1084
1085 for(; ch < end; ch++) {
1086 uint8_t cv = *ch;
1087 if(!(cv >= 69 && cv <= 70)) return -1;
1088 }
1089 return 0;
1090}
1091
1092
1093/*** <<< CODE [PER-Visible-2] >>> ***/
1094
1095int
1096PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001097 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001098 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1099
1100 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001101 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001102 "%s: value not given (%s:%d)",
1103 td->name, __FILE__, __LINE__);
1104 return -1;
1105 }
1106
1107
1108 if(!check_permitted_alphabet_1(st)) {
1109 /* Constraint check succeeded */
1110 return 0;
1111 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001112 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001113 "%s: constraint failed (%s:%d)",
1114 td->name, __FILE__, __LINE__);
1115 return -1;
1116 }
1117}
1118
1119/*
1120 * This type is implemented using PER_Visible,
1121 * so here we adjust the DEF accordingly.
1122 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001123
Lev Walkin725883b2006-10-09 12:07:58 +00001124/*** <<< CTDEFS [PER-Visible-2] >>> ***/
1125
Lev Walkin2fce55d2013-03-28 05:00:39 -07001126static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001127 { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */,
1128 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1129 0, 0 /* No PER character map necessary */
1130};
1131
Lev Walkin59b176e2005-11-26 11:25:14 +00001132/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
1133
Lev Walkina7591b52014-10-12 18:37:35 -07001134static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001135 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1136};
Lev Walkin59b176e2005-11-26 11:25:14 +00001137asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
1138 "PER-Visible-2",
1139 "PER-Visible-2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001140 IA5String_free,
1141 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00001142 PER_Visible_2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001143 IA5String_decode_ber,
1144 IA5String_encode_der,
1145 IA5String_decode_xer,
1146 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001147 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001148 IA5String_decode_uper,
1149 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001150 0, /* Use generic outmost tag fetcher */
1151 asn_DEF_PER_Visible_2_tags_1,
1152 sizeof(asn_DEF_PER_Visible_2_tags_1)
1153 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
1154 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
1155 sizeof(asn_DEF_PER_Visible_2_tags_1)
1156 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001157 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001158 &asn_PER_type_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001159 0, 0, /* No members */
1160 0 /* No specifics */
1161};
1162
1163
1164/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
1165
Lev Walkin22b5ed42006-09-13 02:51:20 +00001166#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001167
1168/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
1169
1170typedef PER_Visible_t Not_PER_Visible_1_t;
1171
1172/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
1173
1174extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
1175asn_struct_free_f Not_PER_Visible_1_free;
1176asn_struct_print_f Not_PER_Visible_1_print;
1177asn_constr_check_f Not_PER_Visible_1_constraint;
1178ber_type_decoder_f Not_PER_Visible_1_decode_ber;
1179der_type_encoder_f Not_PER_Visible_1_encode_der;
1180xer_type_decoder_f Not_PER_Visible_1_decode_xer;
1181xer_type_encoder_f Not_PER_Visible_1_encode_xer;
1182per_type_decoder_f Not_PER_Visible_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001183per_type_encoder_f Not_PER_Visible_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001184
1185/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
1186
1187static int check_permitted_alphabet_1(const void *sptr) {
1188 /* The underlying type is IA5String */
1189 const IA5String_t *st = (const IA5String_t *)sptr;
1190 const uint8_t *ch = st->buf;
1191 const uint8_t *end = ch + st->size;
1192
1193 for(; ch < end; ch++) {
1194 uint8_t cv = *ch;
1195 if(!(cv >= 65 && cv <= 70)) return -1;
1196 }
1197 return 0;
1198}
1199
1200
1201/*** <<< CODE [Not-PER-Visible-1] >>> ***/
1202
1203int
1204Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001205 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001206 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1207
1208 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001209 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001210 "%s: value not given (%s:%d)",
1211 td->name, __FILE__, __LINE__);
1212 return -1;
1213 }
1214
1215
1216 if(!check_permitted_alphabet_1(st)) {
1217 /* Constraint check succeeded */
1218 return 0;
1219 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001220 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001221 "%s: constraint failed (%s:%d)",
1222 td->name, __FILE__, __LINE__);
1223 return -1;
1224 }
1225}
1226
1227/*
1228 * This type is implemented using PER_Visible,
1229 * so here we adjust the DEF accordingly.
1230 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001231
Lev Walkin725883b2006-10-09 12:07:58 +00001232/*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/
1233
Lev Walkin2fce55d2013-03-28 05:00:39 -07001234static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001235 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1236 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1237 0, 0 /* No PER character map necessary */
1238};
1239
Lev Walkin59b176e2005-11-26 11:25:14 +00001240/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
1241
Lev Walkina7591b52014-10-12 18:37:35 -07001242static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001243 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1244};
Lev Walkin59b176e2005-11-26 11:25:14 +00001245asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
1246 "Not-PER-Visible-1",
1247 "Not-PER-Visible-1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001248 IA5String_free,
1249 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00001250 Not_PER_Visible_1_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001251 IA5String_decode_ber,
1252 IA5String_encode_der,
1253 IA5String_decode_xer,
1254 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001255 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001256 IA5String_decode_uper,
1257 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001258 0, /* Use generic outmost tag fetcher */
1259 asn_DEF_Not_PER_Visible_1_tags_1,
1260 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1261 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
1262 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
1263 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1264 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001265 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001266 &asn_PER_type_Not_PER_Visible_1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001267 0, 0, /* No members */
1268 0 /* No specifics */
1269};
1270
1271
1272/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
1273
Lev Walkin22b5ed42006-09-13 02:51:20 +00001274#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001275
1276/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
1277
1278typedef PER_Visible_t Not_PER_Visible_2_t;
1279
1280/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
1281
1282extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
1283asn_struct_free_f Not_PER_Visible_2_free;
1284asn_struct_print_f Not_PER_Visible_2_print;
1285asn_constr_check_f Not_PER_Visible_2_constraint;
1286ber_type_decoder_f Not_PER_Visible_2_decode_ber;
1287der_type_encoder_f Not_PER_Visible_2_encode_der;
1288xer_type_decoder_f Not_PER_Visible_2_decode_xer;
1289xer_type_encoder_f Not_PER_Visible_2_encode_xer;
1290per_type_decoder_f Not_PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001291per_type_encoder_f Not_PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001292
1293/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
1294
1295static int check_permitted_alphabet_1(const void *sptr) {
1296 /* The underlying type is IA5String */
1297 const IA5String_t *st = (const IA5String_t *)sptr;
1298 const uint8_t *ch = st->buf;
1299 const uint8_t *end = ch + st->size;
1300
1301 for(; ch < end; ch++) {
1302 uint8_t cv = *ch;
1303 if(!(cv >= 65 && cv <= 66)) return -1;
1304 }
1305 return 0;
1306}
1307
1308
1309/*** <<< CODE [Not-PER-Visible-2] >>> ***/
1310
1311int
1312Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001313 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001314 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1315
1316 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001317 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001318 "%s: value not given (%s:%d)",
1319 td->name, __FILE__, __LINE__);
1320 return -1;
1321 }
1322
1323
1324 if(!check_permitted_alphabet_1(st)) {
1325 /* Constraint check succeeded */
1326 return 0;
1327 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001328 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001329 "%s: constraint failed (%s:%d)",
1330 td->name, __FILE__, __LINE__);
1331 return -1;
1332 }
1333}
1334
1335/*
1336 * This type is implemented using PER_Visible,
1337 * so here we adjust the DEF accordingly.
1338 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001339
Lev Walkin725883b2006-10-09 12:07:58 +00001340/*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/
1341
Lev Walkin2fce55d2013-03-28 05:00:39 -07001342static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001343 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1344 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1345 0, 0 /* No PER character map necessary */
1346};
1347
Lev Walkin59b176e2005-11-26 11:25:14 +00001348/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
1349
Lev Walkina7591b52014-10-12 18:37:35 -07001350static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001351 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1352};
Lev Walkin59b176e2005-11-26 11:25:14 +00001353asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
1354 "Not-PER-Visible-2",
1355 "Not-PER-Visible-2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001356 IA5String_free,
1357 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00001358 Not_PER_Visible_2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001359 IA5String_decode_ber,
1360 IA5String_encode_der,
1361 IA5String_decode_xer,
1362 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001363 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001364 IA5String_decode_uper,
1365 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001366 0, /* Use generic outmost tag fetcher */
1367 asn_DEF_Not_PER_Visible_2_tags_1,
1368 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1369 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
1370 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
1371 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1372 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001373 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001374 &asn_PER_type_Not_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001375 0, 0, /* No members */
1376 0 /* No specifics */
1377};
1378
1379
1380/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
1381
Lev Walkin22b5ed42006-09-13 02:51:20 +00001382#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001383
1384/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
1385
1386typedef PER_Visible_t Not_PER_Visible_3_t;
1387
1388/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
1389
1390extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
1391asn_struct_free_f Not_PER_Visible_3_free;
1392asn_struct_print_f Not_PER_Visible_3_print;
1393asn_constr_check_f Not_PER_Visible_3_constraint;
1394ber_type_decoder_f Not_PER_Visible_3_decode_ber;
1395der_type_encoder_f Not_PER_Visible_3_encode_der;
1396xer_type_decoder_f Not_PER_Visible_3_decode_xer;
1397xer_type_encoder_f Not_PER_Visible_3_encode_xer;
1398per_type_decoder_f Not_PER_Visible_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001399per_type_encoder_f Not_PER_Visible_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001400
1401/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
1402
1403static int check_permitted_alphabet_1(const void *sptr) {
1404 /* The underlying type is IA5String */
1405 const IA5String_t *st = (const IA5String_t *)sptr;
1406 const uint8_t *ch = st->buf;
1407 const uint8_t *end = ch + st->size;
1408
1409 for(; ch < end; ch++) {
1410 uint8_t cv = *ch;
1411 if(!(cv >= 65 && cv <= 66)) return -1;
1412 }
1413 return 0;
1414}
1415
1416
1417/*** <<< CODE [Not-PER-Visible-3] >>> ***/
1418
1419int
1420Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001421 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001422 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1423
1424 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001425 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001426 "%s: value not given (%s:%d)",
1427 td->name, __FILE__, __LINE__);
1428 return -1;
1429 }
1430
1431
1432 if(!check_permitted_alphabet_1(st)) {
1433 /* Constraint check succeeded */
1434 return 0;
1435 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001436 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001437 "%s: constraint failed (%s:%d)",
1438 td->name, __FILE__, __LINE__);
1439 return -1;
1440 }
1441}
1442
1443/*
1444 * This type is implemented using PER_Visible,
1445 * so here we adjust the DEF accordingly.
1446 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001447
Lev Walkin725883b2006-10-09 12:07:58 +00001448/*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/
1449
Lev Walkin2fce55d2013-03-28 05:00:39 -07001450static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001451 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1452 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1453 0, 0 /* No PER character map necessary */
1454};
1455
Lev Walkin59b176e2005-11-26 11:25:14 +00001456/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
1457
Lev Walkina7591b52014-10-12 18:37:35 -07001458static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001459 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1460};
Lev Walkin59b176e2005-11-26 11:25:14 +00001461asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
1462 "Not-PER-Visible-3",
1463 "Not-PER-Visible-3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001464 IA5String_free,
1465 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00001466 Not_PER_Visible_3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001467 IA5String_decode_ber,
1468 IA5String_encode_der,
1469 IA5String_decode_xer,
1470 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001471 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001472 IA5String_decode_uper,
1473 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001474 0, /* Use generic outmost tag fetcher */
1475 asn_DEF_Not_PER_Visible_3_tags_1,
1476 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1477 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
1478 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
1479 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1480 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001481 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001482 &asn_PER_type_Not_PER_Visible_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001483 0, 0, /* No members */
1484 0 /* No specifics */
1485};
1486
1487
1488/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
1489
Lev Walkin22b5ed42006-09-13 02:51:20 +00001490#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001491
1492/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
1493
1494typedef PER_Visible_t SIZE_but_not_FROM_t;
1495
1496/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
1497
1498extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
1499asn_struct_free_f SIZE_but_not_FROM_free;
1500asn_struct_print_f SIZE_but_not_FROM_print;
1501asn_constr_check_f SIZE_but_not_FROM_constraint;
1502ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
1503der_type_encoder_f SIZE_but_not_FROM_encode_der;
1504xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
1505xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
1506per_type_decoder_f SIZE_but_not_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001507per_type_encoder_f SIZE_but_not_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001508
1509/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
1510
1511static int check_permitted_alphabet_1(const void *sptr) {
1512 /* The underlying type is IA5String */
1513 const IA5String_t *st = (const IA5String_t *)sptr;
1514 const uint8_t *ch = st->buf;
1515 const uint8_t *end = ch + st->size;
1516
1517 for(; ch < end; ch++) {
1518 uint8_t cv = *ch;
1519 if(!(cv >= 65 && cv <= 68)) return -1;
1520 }
1521 return 0;
1522}
1523
1524
1525/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
1526
1527int
1528SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001529 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001530 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1531 size_t size;
1532
1533 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001534 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001535 "%s: value not given (%s:%d)",
1536 td->name, __FILE__, __LINE__);
1537 return -1;
1538 }
1539
1540 size = st->size;
1541
1542 if((size >= 1 && size <= 4)
1543 && !check_permitted_alphabet_1(st)) {
1544 /* Constraint check succeeded */
1545 return 0;
1546 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001547 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001548 "%s: constraint failed (%s:%d)",
1549 td->name, __FILE__, __LINE__);
1550 return -1;
1551 }
1552}
1553
1554/*
1555 * This type is implemented using PER_Visible,
1556 * so here we adjust the DEF accordingly.
1557 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001558
Lev Walkin725883b2006-10-09 12:07:58 +00001559/*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/
1560
Lev Walkin2fce55d2013-03-28 05:00:39 -07001561static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001562 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1563 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
1564 0, 0 /* No PER character map necessary */
1565};
1566
Lev Walkin59b176e2005-11-26 11:25:14 +00001567/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
1568
Lev Walkina7591b52014-10-12 18:37:35 -07001569static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001570 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1571};
Lev Walkin59b176e2005-11-26 11:25:14 +00001572asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
1573 "SIZE-but-not-FROM",
1574 "SIZE-but-not-FROM",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001575 IA5String_free,
1576 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00001577 SIZE_but_not_FROM_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001578 IA5String_decode_ber,
1579 IA5String_encode_der,
1580 IA5String_decode_xer,
1581 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001582 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001583 IA5String_decode_uper,
1584 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001585 0, /* Use generic outmost tag fetcher */
1586 asn_DEF_SIZE_but_not_FROM_tags_1,
1587 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1588 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
1589 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
1590 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1591 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001592 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001593 &asn_PER_type_SIZE_but_not_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001594 0, 0, /* No members */
1595 0 /* No specifics */
1596};
1597
1598
1599/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
1600
Lev Walkin22b5ed42006-09-13 02:51:20 +00001601#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001602
1603/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
1604
1605typedef PER_Visible_t SIZE_and_FROM_t;
1606
1607/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
1608
1609extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
1610asn_struct_free_f SIZE_and_FROM_free;
1611asn_struct_print_f SIZE_and_FROM_print;
1612asn_constr_check_f SIZE_and_FROM_constraint;
1613ber_type_decoder_f SIZE_and_FROM_decode_ber;
1614der_type_encoder_f SIZE_and_FROM_encode_der;
1615xer_type_decoder_f SIZE_and_FROM_decode_xer;
1616xer_type_encoder_f SIZE_and_FROM_encode_xer;
1617per_type_decoder_f SIZE_and_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001618per_type_encoder_f SIZE_and_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001619
1620/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
1621
1622static int check_permitted_alphabet_1(const void *sptr) {
1623 /* The underlying type is IA5String */
1624 const IA5String_t *st = (const IA5String_t *)sptr;
1625 const uint8_t *ch = st->buf;
1626 const uint8_t *end = ch + st->size;
1627
1628 for(; ch < end; ch++) {
1629 uint8_t cv = *ch;
1630 if(!(cv >= 65 && cv <= 68)) return -1;
1631 }
1632 return 0;
1633}
1634
1635
1636/*** <<< CODE [SIZE-and-FROM] >>> ***/
1637
1638int
1639SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001640 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001641 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1642 size_t size;
1643
1644 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001645 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001646 "%s: value not given (%s:%d)",
1647 td->name, __FILE__, __LINE__);
1648 return -1;
1649 }
1650
1651 size = st->size;
1652
1653 if((size >= 1 && size <= 4)
1654 && !check_permitted_alphabet_1(st)) {
1655 /* Constraint check succeeded */
1656 return 0;
1657 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001658 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001659 "%s: constraint failed (%s:%d)",
1660 td->name, __FILE__, __LINE__);
1661 return -1;
1662 }
1663}
1664
1665/*
1666 * This type is implemented using PER_Visible,
1667 * so here we adjust the DEF accordingly.
1668 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001669
Lev Walkin725883b2006-10-09 12:07:58 +00001670/*** <<< CTDEFS [SIZE-and-FROM] >>> ***/
1671
Lev Walkin2fce55d2013-03-28 05:00:39 -07001672static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001673 { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */,
1674 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
1675 0, 0 /* No PER character map necessary */
1676};
1677
Lev Walkin59b176e2005-11-26 11:25:14 +00001678/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
1679
Lev Walkina7591b52014-10-12 18:37:35 -07001680static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001681 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1682};
Lev Walkin59b176e2005-11-26 11:25:14 +00001683asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
1684 "SIZE-and-FROM",
1685 "SIZE-and-FROM",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001686 IA5String_free,
1687 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00001688 SIZE_and_FROM_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001689 IA5String_decode_ber,
1690 IA5String_encode_der,
1691 IA5String_decode_xer,
1692 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001693 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001694 IA5String_decode_uper,
1695 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001696 0, /* Use generic outmost tag fetcher */
1697 asn_DEF_SIZE_and_FROM_tags_1,
1698 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1699 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
1700 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
1701 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1702 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001703 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001704 &asn_PER_type_SIZE_and_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001705 0, 0, /* No members */
1706 0 /* No specifics */
1707};
1708
1709
1710/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
1711
Lev Walkin22b5ed42006-09-13 02:51:20 +00001712#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001713
1714/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1715
1716typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
1717
1718/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1719
1720extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
1721asn_struct_free_f Neither_SIZE_nor_FROM_free;
1722asn_struct_print_f Neither_SIZE_nor_FROM_print;
1723asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
1724ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
1725der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
1726xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
1727xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
1728per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001729per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001730
1731/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
1732
1733static int check_permitted_alphabet_1(const void *sptr) {
1734 /* The underlying type is IA5String */
1735 const IA5String_t *st = (const IA5String_t *)sptr;
1736 const uint8_t *ch = st->buf;
1737 const uint8_t *end = ch + st->size;
1738
1739 for(; ch < end; ch++) {
1740 uint8_t cv = *ch;
1741 if(!(cv >= 65 && cv <= 70)) return -1;
1742 }
1743 return 0;
1744}
1745
1746
1747/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
1748
1749int
1750Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001751 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001752 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1753
1754 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001755 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001756 "%s: value not given (%s:%d)",
1757 td->name, __FILE__, __LINE__);
1758 return -1;
1759 }
1760
1761
1762 if(!check_permitted_alphabet_1(st)) {
1763 /* Constraint check succeeded */
1764 return 0;
1765 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001766 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001767 "%s: constraint failed (%s:%d)",
1768 td->name, __FILE__, __LINE__);
1769 return -1;
1770 }
1771}
1772
1773/*
1774 * This type is implemented using PER_Visible,
1775 * so here we adjust the DEF accordingly.
1776 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001777
Lev Walkin725883b2006-10-09 12:07:58 +00001778/*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/
1779
Lev Walkin2fce55d2013-03-28 05:00:39 -07001780static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001781 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1782 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1783 0, 0 /* No PER character map necessary */
1784};
1785
Lev Walkin59b176e2005-11-26 11:25:14 +00001786/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
1787
Lev Walkina7591b52014-10-12 18:37:35 -07001788static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001789 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1790};
Lev Walkin59b176e2005-11-26 11:25:14 +00001791asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
1792 "Neither-SIZE-nor-FROM",
1793 "Neither-SIZE-nor-FROM",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001794 IA5String_free,
1795 IA5String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00001796 Neither_SIZE_nor_FROM_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001797 IA5String_decode_ber,
1798 IA5String_encode_der,
1799 IA5String_decode_xer,
1800 IA5String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001801 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001802 IA5String_decode_uper,
1803 IA5String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001804 0, /* Use generic outmost tag fetcher */
1805 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
1806 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1807 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
1808 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
1809 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1810 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001811 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001812 &asn_PER_type_Neither_SIZE_nor_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001813 0, 0, /* No members */
1814 0 /* No specifics */
1815};
1816
1817
1818/*** <<< INCLUDES [Utf8-4] >>> ***/
1819
1820#include <UTF8String.h>
1821
1822/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
1823
1824typedef UTF8String_t Utf8_4_t;
1825
1826/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
1827
1828extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
1829asn_struct_free_f Utf8_4_free;
1830asn_struct_print_f Utf8_4_print;
1831asn_constr_check_f Utf8_4_constraint;
1832ber_type_decoder_f Utf8_4_decode_ber;
1833der_type_encoder_f Utf8_4_encode_der;
1834xer_type_decoder_f Utf8_4_decode_xer;
1835xer_type_encoder_f Utf8_4_encode_xer;
1836per_type_decoder_f Utf8_4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001837per_type_encoder_f Utf8_4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001838
1839/*** <<< CTABLES [Utf8-4] >>> ***/
1840
1841static int check_permitted_alphabet_1(const void *sptr) {
1842 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
1843 return -1; /* Alphabet (sic!) test failed. */
1844
1845 return 0;
1846}
1847
1848
1849/*** <<< CODE [Utf8-4] >>> ***/
1850
1851int
1852Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001853 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001854 const UTF8String_t *st = (const UTF8String_t *)sptr;
1855
1856 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001857 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001858 "%s: value not given (%s:%d)",
1859 td->name, __FILE__, __LINE__);
1860 return -1;
1861 }
1862
1863
1864 if(!check_permitted_alphabet_1(st)) {
1865 /* Constraint check succeeded */
1866 return 0;
1867 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001868 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001869 "%s: constraint failed (%s:%d)",
1870 td->name, __FILE__, __LINE__);
1871 return -1;
1872 }
1873}
1874
1875/*
1876 * This type is implemented using UTF8String,
1877 * so here we adjust the DEF accordingly.
1878 */
Lev Walkin59b176e2005-11-26 11:25:14 +00001879
Lev Walkin725883b2006-10-09 12:07:58 +00001880/*** <<< CTDEFS [Utf8-4] >>> ***/
1881
Lev Walkin2fce55d2013-03-28 05:00:39 -07001882static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001883 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1884 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1885 0, 0 /* No PER value map */
1886};
1887
Lev Walkin59b176e2005-11-26 11:25:14 +00001888/*** <<< STAT-DEFS [Utf8-4] >>> ***/
1889
Lev Walkina7591b52014-10-12 18:37:35 -07001890static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001891 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
1892};
Lev Walkin59b176e2005-11-26 11:25:14 +00001893asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
1894 "Utf8-4",
1895 "Utf8-4",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001896 UTF8String_free,
1897 UTF8String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00001898 Utf8_4_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001899 UTF8String_decode_ber,
1900 UTF8String_encode_der,
1901 UTF8String_decode_xer,
1902 UTF8String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001903 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001904 UTF8String_decode_uper,
1905 UTF8String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001906 0, /* Use generic outmost tag fetcher */
1907 asn_DEF_Utf8_4_tags_1,
1908 sizeof(asn_DEF_Utf8_4_tags_1)
1909 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
1910 asn_DEF_Utf8_4_tags_1, /* Same as above */
1911 sizeof(asn_DEF_Utf8_4_tags_1)
1912 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001913 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001914 &asn_PER_type_Utf8_4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001915 0, 0, /* No members */
1916 0 /* No specifics */
1917};
1918
1919
1920/*** <<< INCLUDES [Utf8-3] >>> ***/
1921
Lev Walkin22b5ed42006-09-13 02:51:20 +00001922#include "Utf8-2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001923
1924/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
1925
1926typedef Utf8_2_t Utf8_3_t;
1927
1928/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
1929
1930extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
1931asn_struct_free_f Utf8_3_free;
1932asn_struct_print_f Utf8_3_print;
1933asn_constr_check_f Utf8_3_constraint;
1934ber_type_decoder_f Utf8_3_decode_ber;
1935der_type_encoder_f Utf8_3_encode_der;
1936xer_type_decoder_f Utf8_3_decode_xer;
1937xer_type_encoder_f Utf8_3_encode_xer;
1938per_type_decoder_f Utf8_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001939per_type_encoder_f Utf8_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001940
1941/*** <<< CTABLES [Utf8-3] >>> ***/
1942
Lev Walkina7591b52014-10-12 18:37:35 -07001943static const int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001944 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1945 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1946 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1947 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1948 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
194916,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
1950 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
195142,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00001952};
1953
1954static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07001955 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00001956 /* The underlying type is UTF8String */
1957 const UTF8String_t *st = (const UTF8String_t *)sptr;
1958 const uint8_t *ch = st->buf;
1959 const uint8_t *end = ch + st->size;
1960
1961 for(; ch < end; ch++) {
1962 uint8_t cv = *ch;
1963 if(cv >= 0x80) return -1;
1964 if(!table[cv]) return -1;
1965 }
1966 return 0;
1967}
1968
1969
1970/*** <<< CODE [Utf8-3] >>> ***/
1971
1972int
1973Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001974 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001975 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
1976 size_t size;
1977
1978 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001979 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001980 "%s: value not given (%s:%d)",
1981 td->name, __FILE__, __LINE__);
1982 return -1;
1983 }
1984
1985 size = UTF8String_length(st);
1986 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001987 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001988 "%s: UTF-8: broken encoding (%s:%d)",
1989 td->name, __FILE__, __LINE__);
1990 return -1;
1991 }
1992
1993 if((size >= 1 && size <= 2)
1994 && !check_permitted_alphabet_1(st)) {
1995 /* Constraint check succeeded */
1996 return 0;
1997 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001998 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001999 "%s: constraint failed (%s:%d)",
2000 td->name, __FILE__, __LINE__);
2001 return -1;
2002 }
2003}
2004
2005/*
2006 * This type is implemented using Utf8_2,
2007 * so here we adjust the DEF accordingly.
2008 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002009
Lev Walkin725883b2006-10-09 12:07:58 +00002010/*** <<< CTDEFS [Utf8-3] >>> ***/
2011
Lev Walkin2fce55d2013-03-28 05:00:39 -07002012static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002013 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2014 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2015 0, 0 /* No PER value map */
2016};
2017
Lev Walkin59b176e2005-11-26 11:25:14 +00002018/*** <<< STAT-DEFS [Utf8-3] >>> ***/
2019
Lev Walkina7591b52014-10-12 18:37:35 -07002020static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002021 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2022};
Lev Walkin59b176e2005-11-26 11:25:14 +00002023asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
2024 "Utf8-3",
2025 "Utf8-3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002026 UTF8String_free,
2027 UTF8String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00002028 Utf8_3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002029 UTF8String_decode_ber,
2030 UTF8String_encode_der,
2031 UTF8String_decode_xer,
2032 UTF8String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002033 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002034 UTF8String_decode_uper,
2035 UTF8String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002036 0, /* Use generic outmost tag fetcher */
2037 asn_DEF_Utf8_3_tags_1,
2038 sizeof(asn_DEF_Utf8_3_tags_1)
2039 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
2040 asn_DEF_Utf8_3_tags_1, /* Same as above */
2041 sizeof(asn_DEF_Utf8_3_tags_1)
2042 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002043 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002044 &asn_PER_type_Utf8_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002045 0, 0, /* No members */
2046 0 /* No specifics */
2047};
2048
2049
2050/*** <<< INCLUDES [Utf8-2] >>> ***/
2051
Lev Walkin22b5ed42006-09-13 02:51:20 +00002052#include "Utf8-1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002053
2054/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
2055
2056typedef Utf8_1_t Utf8_2_t;
2057
2058/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
2059
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002060extern asn_per_constraints_t asn_PER_type_Utf8_2_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00002061extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
2062asn_struct_free_f Utf8_2_free;
2063asn_struct_print_f Utf8_2_print;
2064asn_constr_check_f Utf8_2_constraint;
2065ber_type_decoder_f Utf8_2_decode_ber;
2066der_type_encoder_f Utf8_2_encode_der;
2067xer_type_decoder_f Utf8_2_decode_xer;
2068xer_type_encoder_f Utf8_2_encode_xer;
2069per_type_decoder_f Utf8_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002070per_type_encoder_f Utf8_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002071
2072/*** <<< CODE [Utf8-2] >>> ***/
2073
2074int
2075Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002076 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002077 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
2078 size_t size;
2079
2080 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002081 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002082 "%s: value not given (%s:%d)",
2083 td->name, __FILE__, __LINE__);
2084 return -1;
2085 }
2086
2087 size = UTF8String_length(st);
2088 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002089 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002090 "%s: UTF-8: broken encoding (%s:%d)",
2091 td->name, __FILE__, __LINE__);
2092 return -1;
2093 }
2094
2095 if((size >= 1 && size <= 2)) {
2096 /* Constraint check succeeded */
2097 return 0;
2098 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002099 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002100 "%s: constraint failed (%s:%d)",
2101 td->name, __FILE__, __LINE__);
2102 return -1;
2103 }
2104}
2105
2106/*
2107 * This type is implemented using Utf8_1,
2108 * so here we adjust the DEF accordingly.
2109 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002110
Lev Walkin725883b2006-10-09 12:07:58 +00002111/*** <<< CTDEFS [Utf8-2] >>> ***/
2112
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002113asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002114 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2115 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2116 0, 0 /* No PER value map */
2117};
2118
Lev Walkin59b176e2005-11-26 11:25:14 +00002119/*** <<< STAT-DEFS [Utf8-2] >>> ***/
2120
Lev Walkina7591b52014-10-12 18:37:35 -07002121static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002122 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2123};
Lev Walkin59b176e2005-11-26 11:25:14 +00002124asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
2125 "Utf8-2",
2126 "Utf8-2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002127 UTF8String_free,
2128 UTF8String_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00002129 Utf8_2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002130 UTF8String_decode_ber,
2131 UTF8String_encode_der,
2132 UTF8String_decode_xer,
2133 UTF8String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002134 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002135 UTF8String_decode_uper,
2136 UTF8String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002137 0, /* Use generic outmost tag fetcher */
2138 asn_DEF_Utf8_2_tags_1,
2139 sizeof(asn_DEF_Utf8_2_tags_1)
2140 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
2141 asn_DEF_Utf8_2_tags_1, /* Same as above */
2142 sizeof(asn_DEF_Utf8_2_tags_1)
2143 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002144 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002145 &asn_PER_type_Utf8_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002146 0, 0, /* No members */
2147 0 /* No specifics */
2148};
2149
2150
2151/*** <<< INCLUDES [Utf8-1] >>> ***/
2152
2153#include <UTF8String.h>
2154
2155/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
2156
2157typedef UTF8String_t Utf8_1_t;
2158
2159/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
2160
2161extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
2162asn_struct_free_f Utf8_1_free;
2163asn_struct_print_f Utf8_1_print;
2164asn_constr_check_f Utf8_1_constraint;
2165ber_type_decoder_f Utf8_1_decode_ber;
2166der_type_encoder_f Utf8_1_encode_der;
2167xer_type_decoder_f Utf8_1_decode_xer;
2168xer_type_encoder_f Utf8_1_encode_xer;
2169per_type_decoder_f Utf8_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002170per_type_encoder_f Utf8_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002171
2172/*** <<< CODE [Utf8-1] >>> ***/
2173
Lev Walkin59b176e2005-11-26 11:25:14 +00002174/*
2175 * This type is implemented using UTF8String,
2176 * so here we adjust the DEF accordingly.
2177 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002178
2179/*** <<< STAT-DEFS [Utf8-1] >>> ***/
2180
Lev Walkina7591b52014-10-12 18:37:35 -07002181static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002182 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2183};
2184asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
2185 "Utf8-1",
2186 "Utf8-1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002187 UTF8String_free,
2188 UTF8String_print,
2189 UTF8String_constraint,
2190 UTF8String_decode_ber,
2191 UTF8String_encode_der,
2192 UTF8String_decode_xer,
2193 UTF8String_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002194 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002195 UTF8String_decode_uper,
2196 UTF8String_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002197 0, /* Use generic outmost tag fetcher */
2198 asn_DEF_Utf8_1_tags_1,
2199 sizeof(asn_DEF_Utf8_1_tags_1)
2200 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
2201 asn_DEF_Utf8_1_tags_1, /* Same as above */
2202 sizeof(asn_DEF_Utf8_1_tags_1)
2203 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002204 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002205 0, /* No PER visible constraints */
2206 0, 0, /* No members */
2207 0 /* No specifics */
2208};
2209
2210
2211/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
2212
Lev Walkin22b5ed42006-09-13 02:51:20 +00002213#include "Identifier.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002214
2215/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
2216
2217typedef Identifier_t VisibleIdentifier_t;
2218
2219/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
2220
2221extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
2222asn_struct_free_f VisibleIdentifier_free;
2223asn_struct_print_f VisibleIdentifier_print;
2224asn_constr_check_f VisibleIdentifier_constraint;
2225ber_type_decoder_f VisibleIdentifier_decode_ber;
2226der_type_encoder_f VisibleIdentifier_encode_der;
2227xer_type_decoder_f VisibleIdentifier_decode_xer;
2228xer_type_encoder_f VisibleIdentifier_encode_xer;
2229per_type_decoder_f VisibleIdentifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002230per_type_encoder_f VisibleIdentifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002231
2232/*** <<< CTABLES [VisibleIdentifier] >>> ***/
2233
Lev Walkina7591b52014-10-12 18:37:35 -07002234static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00002235 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2236 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2237 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
2238 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
2239 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
224027,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
2241 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
224254,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00002243};
Lev Walkina7591b52014-10-12 18:37:35 -07002244static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000224536,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
224670,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
224786,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
2248107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
2249};
2250
Lev Walkin59b176e2005-11-26 11:25:14 +00002251
2252static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07002253 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00002254 /* The underlying type is VisibleString */
2255 const VisibleString_t *st = (const VisibleString_t *)sptr;
2256 const uint8_t *ch = st->buf;
2257 const uint8_t *end = ch + st->size;
2258
2259 for(; ch < end; ch++) {
2260 uint8_t cv = *ch;
2261 if(!table[cv]) return -1;
2262 }
2263 return 0;
2264}
2265
2266
2267/*** <<< CODE [VisibleIdentifier] >>> ***/
2268
2269int
2270VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002271 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002272 const Identifier_t *st = (const Identifier_t *)sptr;
2273 size_t size;
2274
2275 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002276 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002277 "%s: value not given (%s:%d)",
2278 td->name, __FILE__, __LINE__);
2279 return -1;
2280 }
2281
2282 size = st->size;
2283
2284 if((size >= 1 && size <= 32)
2285 && !check_permitted_alphabet_1(st)) {
2286 /* Constraint check succeeded */
2287 return 0;
2288 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002289 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002290 "%s: constraint failed (%s:%d)",
2291 td->name, __FILE__, __LINE__);
2292 return -1;
2293 }
2294}
2295
2296/*
2297 * This type is implemented using Identifier,
2298 * so here we adjust the DEF accordingly.
2299 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002300
2301/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
2302
Lev Walkina7591b52014-10-12 18:37:35 -07002303static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002304 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
2305};
2306asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
2307 "VisibleIdentifier",
2308 "VisibleIdentifier",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002309 VisibleString_free,
2310 VisibleString_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00002311 VisibleIdentifier_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002312 VisibleString_decode_ber,
2313 VisibleString_encode_der,
2314 VisibleString_decode_xer,
2315 VisibleString_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002316 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002317 VisibleString_decode_uper,
2318 VisibleString_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002319 0, /* Use generic outmost tag fetcher */
2320 asn_DEF_VisibleIdentifier_tags_1,
2321 sizeof(asn_DEF_VisibleIdentifier_tags_1)
2322 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
2323 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
2324 sizeof(asn_DEF_VisibleIdentifier_tags_1)
2325 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002326 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002327 0, /* No PER visible constraints */
2328 0, 0, /* No members */
2329 0 /* No specifics */
2330};
2331
2332
2333/*** <<< INCLUDES [Sequence] >>> ***/
2334
Lev Walkin22b5ed42006-09-13 02:51:20 +00002335#include "Int1.h"
2336#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002337#include <BOOLEAN.h>
Lev Walkin2a744a72013-03-27 01:56:23 -07002338#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00002339#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00002340#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002341#include <constr_SEQUENCE.h>
2342
2343/*** <<< DEPS [Sequence] >>> ***/
2344
2345typedef enum enum_c {
2346 enum_c_one = 1,
2347 enum_c_two = 2,
2348 /*
2349 * Enumeration is extensible
2350 */
2351 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00002352} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00002353
2354/*** <<< TYPE-DECLS [Sequence] >>> ***/
2355
2356typedef struct Sequence {
2357 Int1_t *int1_c /* DEFAULT 3 */;
2358 Int4_t int4;
2359 Int4_t int4_c;
Lev Walkin2a744a72013-03-27 01:56:23 -07002360 BOOLEAN_t *Bool /* DEFAULT 1 */;
2361 long enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00002362 NULL_t *null /* OPTIONAL */;
2363 /*
2364 * This type is extensible,
2365 * possible extensions are below.
2366 */
2367 Int5_t *int5_c /* OPTIONAL */;
2368
2369 /* Context for parsing across buffer boundaries */
2370 asn_struct_ctx_t _asn_ctx;
2371} Sequence_t;
2372
2373/*** <<< FUNC-DECLS [Sequence] >>> ***/
2374
2375/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
2376extern asn_TYPE_descriptor_t asn_DEF_Sequence;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002377extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
2378extern asn_TYPE_member_t asn_MBR_Sequence_1[7];
Lev Walkin59b176e2005-11-26 11:25:14 +00002379
2380/*** <<< CODE [Sequence] >>> ***/
2381
Lev Walkin59b176e2005-11-26 11:25:14 +00002382/*
Lev Walkin2a744a72013-03-27 01:56:23 -07002383 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00002384 * so here we adjust the DEF accordingly.
2385 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002386static int
2387memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002388 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002389 long value;
2390
2391 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002392 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002393 "%s: value not given (%s:%d)",
2394 td->name, __FILE__, __LINE__);
2395 return -1;
2396 }
2397
Lev Walkin2a744a72013-03-27 01:56:23 -07002398 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00002399
2400 if((value >= -2)) {
2401 /* Constraint check succeeded */
2402 return 0;
2403 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002404 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002405 "%s: constraint failed (%s:%d)",
2406 td->name, __FILE__, __LINE__);
2407 return -1;
2408 }
2409}
2410
2411static int
2412memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002413 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002414 long value;
2415
2416 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002417 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002418 "%s: value not given (%s:%d)",
2419 td->name, __FILE__, __LINE__);
2420 return -1;
2421 }
2422
Lev Walkin2a744a72013-03-27 01:56:23 -07002423 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00002424
2425 if((value >= 5 && value <= 7)) {
2426 /* Constraint check succeeded */
2427 return 0;
2428 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002429 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002430 "%s: constraint failed (%s:%d)",
2431 td->name, __FILE__, __LINE__);
2432 return -1;
2433 }
2434}
2435
2436static int
2437memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002438 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002439 long value;
2440
2441 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002442 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002443 "%s: value not given (%s:%d)",
2444 td->name, __FILE__, __LINE__);
2445 return -1;
2446 }
2447
Lev Walkin2a744a72013-03-27 01:56:23 -07002448 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00002449
2450 if((value == 5)) {
2451 /* Constraint check succeeded */
2452 return 0;
2453 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002454 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002455 "%s: constraint failed (%s:%d)",
2456 td->name, __FILE__, __LINE__);
2457 return -1;
2458 }
2459}
2460
2461
Lev Walkin725883b2006-10-09 12:07:58 +00002462/*** <<< CTDEFS [Sequence] >>> ***/
2463
Lev Walkin2fce55d2013-03-28 05:00:39 -07002464static asn_per_constraints_t asn_PER_type_enum_c_constr_6 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002465 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
2466 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2467 0, 0 /* No PER value map */
2468};
Lev Walkin2fce55d2013-03-28 05:00:39 -07002469static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002470 { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
2471 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2472 0, 0 /* No PER value map */
2473};
Lev Walkin2fce55d2013-03-28 05:00:39 -07002474static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002475 { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
2476 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2477 0, 0 /* No PER value map */
2478};
Lev Walkin2fce55d2013-03-28 05:00:39 -07002479static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002480 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
2481 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2482 0, 0 /* No PER value map */
2483};
2484
Lev Walkin59b176e2005-11-26 11:25:14 +00002485/*** <<< STAT-DEFS [Sequence] >>> ***/
2486
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002487static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002488 Int1_t *st = *sptr;
2489
2490 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002491 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00002492 st = (*sptr = CALLOC(1, sizeof(*st)));
2493 if(!st) return -1;
2494 }
2495
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002496 if(set_value) {
2497 /* Install default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07002498 *st = 3;
2499 return 0;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002500 } else {
2501 /* Test default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07002502 return (*st == 3);
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002503 }
Lev Walkin59b176e2005-11-26 11:25:14 +00002504}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002505static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002506 BOOLEAN_t *st = *sptr;
2507
2508 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002509 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00002510 st = (*sptr = CALLOC(1, sizeof(*st)));
2511 if(!st) return -1;
2512 }
2513
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002514 if(set_value) {
2515 /* Install default value 1 */
2516 *st = 1;
2517 return 0;
2518 } else {
2519 /* Test default value 1 */
2520 return (*st == 1);
2521 }
Lev Walkin59b176e2005-11-26 11:25:14 +00002522}
Lev Walkina7591b52014-10-12 18:37:35 -07002523static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002524 { 1, 3, "one" },
2525 { 2, 3, "two" },
2526 { 3, 5, "three" }
2527 /* This list is extensible */
2528};
Lev Walkina7591b52014-10-12 18:37:35 -07002529static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002530 0, /* one(1) */
2531 2, /* three(3) */
2532 1 /* two(2) */
2533 /* This list is extensible */
2534};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002535static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002536 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
2537 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
2538 3, /* Number of elements in the maps */
2539 3, /* Extensions before this member */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002540 1, /* Strict enumeration */
2541 0, /* Native long size */
2542 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002543};
Lev Walkina7591b52014-10-12 18:37:35 -07002544static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002545 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2546};
Lev Walkin59b176e2005-11-26 11:25:14 +00002547static /* Use -fall-defs-global to expose */
2548asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
2549 "enum-c",
2550 "enum-c",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002551 NativeEnumerated_free,
2552 NativeEnumerated_print,
2553 NativeEnumerated_constraint,
2554 NativeEnumerated_decode_ber,
2555 NativeEnumerated_encode_der,
2556 NativeEnumerated_decode_xer,
2557 NativeEnumerated_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002558 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002559 NativeEnumerated_decode_uper,
2560 NativeEnumerated_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002561 0, /* Use generic outmost tag fetcher */
2562 asn_DEF_enum_c_tags_6,
2563 sizeof(asn_DEF_enum_c_tags_6)
2564 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
2565 asn_DEF_enum_c_tags_6, /* Same as above */
2566 sizeof(asn_DEF_enum_c_tags_6)
2567 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002568 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002569 &asn_PER_type_enum_c_constr_6,
Lev Walkin59b176e2005-11-26 11:25:14 +00002570 0, 0, /* Defined elsewhere */
2571 &asn_SPC_enum_c_specs_6 /* Additional specs */
2572};
2573
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002574asn_TYPE_member_t asn_MBR_Sequence_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002575 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
2576 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2577 .tag_mode = 0,
2578 .type = &asn_DEF_Int1,
2579 .memb_constraints = memb_int1_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002580 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002581 .per_constraints = &asn_PER_memb_int1_c_constr_2,
Lev Walkin59b176e2005-11-26 11:25:14 +00002582 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
2583 .name = "int1-c"
2584 },
2585 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
2586 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
2587 .tag_mode = +1, /* EXPLICIT tag at current level */
2588 .type = &asn_DEF_Int4,
2589 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002590 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002591 .per_constraints = 0, /* No PER visible constraints */
2592 .default_value = 0,
2593 .name = "int4"
2594 },
2595 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
2596 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2597 .tag_mode = 0,
2598 .type = &asn_DEF_Int4,
2599 .memb_constraints = memb_int4_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002600 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002601 .per_constraints = &asn_PER_memb_int4_c_constr_4,
Lev Walkin59b176e2005-11-26 11:25:14 +00002602 .default_value = 0,
2603 .name = "int4-c"
2604 },
Lev Walkin2a744a72013-03-27 01:56:23 -07002605 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +00002606 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
2607 .tag_mode = 0,
2608 .type = &asn_DEF_BOOLEAN,
2609 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002610 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002611 .per_constraints = 0, /* No PER visible constraints */
2612 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
2613 .name = "bool"
2614 },
2615 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
2616 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
2617 .tag_mode = 0,
2618 .type = &asn_DEF_enum_c_6,
2619 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002620 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin07aaa342006-10-09 12:52:15 +00002621 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002622 .default_value = 0,
2623 .name = "enum-c"
2624 },
2625 { ATF_POINTER, 2, offsetof(struct Sequence, null),
2626 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
2627 .tag_mode = 0,
2628 .type = &asn_DEF_NULL,
2629 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002630 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002631 .per_constraints = 0, /* No PER visible constraints */
2632 .default_value = 0,
2633 .name = "null"
2634 },
2635 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
2636 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2637 .tag_mode = 0,
2638 .type = &asn_DEF_Int5,
2639 .memb_constraints = memb_int5_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002640 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002641 .per_constraints = &asn_PER_memb_int5_c_constr_13,
Lev Walkin59b176e2005-11-26 11:25:14 +00002642 .default_value = 0,
2643 .name = "int5-c"
2644 },
2645};
Lev Walkina7591b52014-10-12 18:37:35 -07002646static const int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
2647static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002648 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2649};
Lev Walkina7591b52014-10-12 18:37:35 -07002650static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -07002651 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
2652 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
2653 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
2654 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
2655 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
2656 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
2657 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002658};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002659asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002660 sizeof(struct Sequence),
2661 offsetof(struct Sequence, _asn_ctx),
2662 asn_MAP_Sequence_tag2el_1,
2663 7, /* Count of tags in the map */
2664 asn_MAP_Sequence_oms_1, /* Optional members */
2665 3, 1, /* Root/Additions */
2666 5, /* Start extensions */
2667 8 /* Stop extensions */
2668};
2669asn_TYPE_descriptor_t asn_DEF_Sequence = {
2670 "Sequence",
2671 "Sequence",
2672 SEQUENCE_free,
2673 SEQUENCE_print,
2674 SEQUENCE_constraint,
2675 SEQUENCE_decode_ber,
2676 SEQUENCE_encode_der,
2677 SEQUENCE_decode_xer,
2678 SEQUENCE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002679 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002680 SEQUENCE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002681 SEQUENCE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002682 0, /* Use generic outmost tag fetcher */
2683 asn_DEF_Sequence_tags_1,
2684 sizeof(asn_DEF_Sequence_tags_1)
2685 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
2686 asn_DEF_Sequence_tags_1, /* Same as above */
2687 sizeof(asn_DEF_Sequence_tags_1)
2688 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002689 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002690 0, /* No PER visible constraints */
2691 asn_MBR_Sequence_1,
2692 7, /* Elements count */
2693 &asn_SPC_Sequence_specs_1 /* Additional specs */
2694};
2695
2696
2697/*** <<< INCLUDES [SequenceOf] >>> ***/
2698
2699#include <asn_SEQUENCE_OF.h>
2700#include <constr_SEQUENCE_OF.h>
2701
2702/*** <<< FWD-DECLS [SequenceOf] >>> ***/
2703
2704struct Sequence;
2705
2706/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
2707
2708typedef struct SequenceOf {
2709 A_SEQUENCE_OF(struct Sequence) list;
2710
2711 /* Context for parsing across buffer boundaries */
2712 asn_struct_ctx_t _asn_ctx;
2713} SequenceOf_t;
2714
2715/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
2716
2717extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
2718
2719/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
2720
Lev Walkin22b5ed42006-09-13 02:51:20 +00002721#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002722
Lev Walkin725883b2006-10-09 12:07:58 +00002723/*** <<< CTDEFS [SequenceOf] >>> ***/
2724
Lev Walkin2fce55d2013-03-28 05:00:39 -07002725static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002726 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2727 { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */,
2728 0, 0 /* No PER value map */
2729};
2730
Lev Walkin59b176e2005-11-26 11:25:14 +00002731/*** <<< STAT-DEFS [SequenceOf] >>> ***/
2732
2733static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
2734 { ATF_POINTER, 0, 0,
2735 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
2736 .tag_mode = 0,
2737 .type = &asn_DEF_Sequence,
2738 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002739 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002740 .per_constraints = 0, /* No PER visible constraints */
2741 .default_value = 0,
2742 .name = ""
2743 },
2744};
Lev Walkina7591b52014-10-12 18:37:35 -07002745static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002746 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2747};
2748static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
2749 sizeof(struct SequenceOf),
2750 offsetof(struct SequenceOf, _asn_ctx),
2751 0, /* XER encoding is XMLDelimitedItemList */
2752};
Lev Walkin59b176e2005-11-26 11:25:14 +00002753asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
2754 "SequenceOf",
2755 "SequenceOf",
2756 SEQUENCE_OF_free,
2757 SEQUENCE_OF_print,
2758 SEQUENCE_OF_constraint,
2759 SEQUENCE_OF_decode_ber,
2760 SEQUENCE_OF_encode_der,
2761 SEQUENCE_OF_decode_xer,
2762 SEQUENCE_OF_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002763 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002764 SEQUENCE_OF_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002765 SEQUENCE_OF_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002766 0, /* Use generic outmost tag fetcher */
2767 asn_DEF_SequenceOf_tags_1,
2768 sizeof(asn_DEF_SequenceOf_tags_1)
2769 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
2770 asn_DEF_SequenceOf_tags_1, /* Same as above */
2771 sizeof(asn_DEF_SequenceOf_tags_1)
2772 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002773 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002774 &asn_PER_type_SequenceOf_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002775 asn_MBR_SequenceOf_1,
2776 1, /* Single element */
2777 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
2778};
2779
2780
2781/*** <<< INCLUDES [Enum0] >>> ***/
2782
Lev Walkin2a744a72013-03-27 01:56:23 -07002783#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00002784
2785/*** <<< DEPS [Enum0] >>> ***/
2786
2787typedef enum Enum0 {
2788 Enum0_one = 0,
2789 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00002790} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00002791
2792/*** <<< TYPE-DECLS [Enum0] >>> ***/
2793
Lev Walkin2a744a72013-03-27 01:56:23 -07002794typedef long Enum0_t;
Lev Walkin59b176e2005-11-26 11:25:14 +00002795
2796/*** <<< FUNC-DECLS [Enum0] >>> ***/
2797
2798extern asn_TYPE_descriptor_t asn_DEF_Enum0;
2799asn_struct_free_f Enum0_free;
2800asn_struct_print_f Enum0_print;
2801asn_constr_check_f Enum0_constraint;
2802ber_type_decoder_f Enum0_decode_ber;
2803der_type_encoder_f Enum0_encode_der;
2804xer_type_decoder_f Enum0_decode_xer;
2805xer_type_encoder_f Enum0_encode_xer;
2806per_type_decoder_f Enum0_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002807per_type_encoder_f Enum0_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002808
2809/*** <<< CODE [Enum0] >>> ***/
2810
Lev Walkin59b176e2005-11-26 11:25:14 +00002811/*
Lev Walkin2a744a72013-03-27 01:56:23 -07002812 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00002813 * so here we adjust the DEF accordingly.
2814 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002815
Lev Walkin725883b2006-10-09 12:07:58 +00002816/*** <<< CTDEFS [Enum0] >>> ***/
2817
Lev Walkin2fce55d2013-03-28 05:00:39 -07002818static asn_per_constraints_t asn_PER_type_Enum0_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002819 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
2820 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2821 0, 0 /* No PER value map */
2822};
2823
Lev Walkin59b176e2005-11-26 11:25:14 +00002824/*** <<< STAT-DEFS [Enum0] >>> ***/
2825
Lev Walkina7591b52014-10-12 18:37:35 -07002826static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002827 { 0, 3, "one" },
2828 { 1, 3, "two" }
2829};
Lev Walkina7591b52014-10-12 18:37:35 -07002830static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002831 0, /* one(0) */
2832 1 /* two(1) */
2833};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002834static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002835 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
2836 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
2837 2, /* Number of elements in the maps */
2838 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002839 1, /* Strict enumeration */
2840 0, /* Native long size */
2841 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002842};
Lev Walkina7591b52014-10-12 18:37:35 -07002843static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002844 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2845};
Lev Walkin59b176e2005-11-26 11:25:14 +00002846asn_TYPE_descriptor_t asn_DEF_Enum0 = {
2847 "Enum0",
2848 "Enum0",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002849 NativeEnumerated_free,
2850 NativeEnumerated_print,
2851 NativeEnumerated_constraint,
2852 NativeEnumerated_decode_ber,
2853 NativeEnumerated_encode_der,
2854 NativeEnumerated_decode_xer,
2855 NativeEnumerated_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002856 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002857 NativeEnumerated_decode_uper,
2858 NativeEnumerated_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002859 0, /* Use generic outmost tag fetcher */
2860 asn_DEF_Enum0_tags_1,
2861 sizeof(asn_DEF_Enum0_tags_1)
2862 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
2863 asn_DEF_Enum0_tags_1, /* Same as above */
2864 sizeof(asn_DEF_Enum0_tags_1)
2865 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002866 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002867 &asn_PER_type_Enum0_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002868 0, 0, /* Defined elsewhere */
2869 &asn_SPC_Enum0_specs_1 /* Additional specs */
2870};
2871
2872
2873/*** <<< INCLUDES [Enum1] >>> ***/
2874
2875#include <NativeEnumerated.h>
2876
2877/*** <<< DEPS [Enum1] >>> ***/
2878
2879typedef enum Enum1 {
2880 Enum1_one = 0,
2881 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00002882} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00002883
2884/*** <<< TYPE-DECLS [Enum1] >>> ***/
2885
2886typedef long Enum1_t;
2887
2888/*** <<< FUNC-DECLS [Enum1] >>> ***/
2889
2890extern asn_TYPE_descriptor_t asn_DEF_Enum1;
2891asn_struct_free_f Enum1_free;
2892asn_struct_print_f Enum1_print;
2893asn_constr_check_f Enum1_constraint;
2894ber_type_decoder_f Enum1_decode_ber;
2895der_type_encoder_f Enum1_encode_der;
2896xer_type_decoder_f Enum1_decode_xer;
2897xer_type_encoder_f Enum1_encode_xer;
2898per_type_decoder_f Enum1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002899per_type_encoder_f Enum1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002900
2901/*** <<< CODE [Enum1] >>> ***/
2902
2903int
2904Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002905 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002906 long value;
2907
2908 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002909 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002910 "%s: value not given (%s:%d)",
2911 td->name, __FILE__, __LINE__);
2912 return -1;
2913 }
2914
2915 value = *(const long *)sptr;
2916
2917 if((value == 0)) {
2918 /* Constraint check succeeded */
2919 return 0;
2920 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002921 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002922 "%s: constraint failed (%s:%d)",
2923 td->name, __FILE__, __LINE__);
2924 return -1;
2925 }
2926}
2927
2928/*
2929 * This type is implemented using NativeEnumerated,
2930 * so here we adjust the DEF accordingly.
2931 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002932
Lev Walkin725883b2006-10-09 12:07:58 +00002933/*** <<< CTDEFS [Enum1] >>> ***/
2934
Lev Walkin2fce55d2013-03-28 05:00:39 -07002935static asn_per_constraints_t asn_PER_type_Enum1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002936 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
2937 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2938 0, 0 /* No PER value map */
2939};
2940
Lev Walkin59b176e2005-11-26 11:25:14 +00002941/*** <<< STAT-DEFS [Enum1] >>> ***/
2942
Lev Walkina7591b52014-10-12 18:37:35 -07002943static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002944 { 0, 3, "one" },
2945 { 1, 3, "two" }
2946};
Lev Walkina7591b52014-10-12 18:37:35 -07002947static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002948 0, /* one(0) */
2949 1 /* two(1) */
2950};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002951static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002952 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
2953 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
2954 2, /* Number of elements in the maps */
2955 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002956 1, /* Strict enumeration */
2957 0, /* Native long size */
2958 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002959};
Lev Walkina7591b52014-10-12 18:37:35 -07002960static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002961 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2962};
Lev Walkin59b176e2005-11-26 11:25:14 +00002963asn_TYPE_descriptor_t asn_DEF_Enum1 = {
2964 "Enum1",
2965 "Enum1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002966 NativeEnumerated_free,
2967 NativeEnumerated_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00002968 Enum1_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002969 NativeEnumerated_decode_ber,
2970 NativeEnumerated_encode_der,
2971 NativeEnumerated_decode_xer,
2972 NativeEnumerated_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002973 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002974 NativeEnumerated_decode_uper,
2975 NativeEnumerated_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002976 0, /* Use generic outmost tag fetcher */
2977 asn_DEF_Enum1_tags_1,
2978 sizeof(asn_DEF_Enum1_tags_1)
2979 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
2980 asn_DEF_Enum1_tags_1, /* Same as above */
2981 sizeof(asn_DEF_Enum1_tags_1)
2982 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002983 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002984 &asn_PER_type_Enum1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002985 0, 0, /* Defined elsewhere */
2986 &asn_SPC_Enum1_specs_1 /* Additional specs */
2987};
2988
2989
2990/*** <<< INCLUDES [Identifier] >>> ***/
2991
2992#include <VisibleString.h>
2993
2994/*** <<< TYPE-DECLS [Identifier] >>> ***/
2995
2996typedef VisibleString_t Identifier_t;
2997
2998/*** <<< FUNC-DECLS [Identifier] >>> ***/
2999
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003000extern asn_per_constraints_t asn_PER_type_Identifier_constr_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00003001extern asn_TYPE_descriptor_t asn_DEF_Identifier;
3002asn_struct_free_f Identifier_free;
3003asn_struct_print_f Identifier_print;
3004asn_constr_check_f Identifier_constraint;
3005ber_type_decoder_f Identifier_decode_ber;
3006der_type_encoder_f Identifier_encode_der;
3007xer_type_decoder_f Identifier_decode_xer;
3008xer_type_encoder_f Identifier_encode_xer;
3009per_type_decoder_f Identifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003010per_type_encoder_f Identifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003011
3012/*** <<< CTABLES [Identifier] >>> ***/
3013
Lev Walkina7591b52014-10-12 18:37:35 -07003014static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003015 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3016 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3017 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
3018 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
3019 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
302027,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
3021 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
302254,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003023};
Lev Walkina7591b52014-10-12 18:37:35 -07003024static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000302536,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
302670,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
302786,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
3028107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
3029};
3030
Lev Walkin59b176e2005-11-26 11:25:14 +00003031
3032static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07003033 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00003034 /* The underlying type is VisibleString */
3035 const VisibleString_t *st = (const VisibleString_t *)sptr;
3036 const uint8_t *ch = st->buf;
3037 const uint8_t *end = ch + st->size;
3038
3039 for(; ch < end; ch++) {
3040 uint8_t cv = *ch;
3041 if(!table[cv]) return -1;
3042 }
3043 return 0;
3044}
3045
3046
3047/*** <<< CODE [Identifier] >>> ***/
3048
3049int
3050Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003051 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003052 const VisibleString_t *st = (const VisibleString_t *)sptr;
3053 size_t size;
3054
3055 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003056 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003057 "%s: value not given (%s:%d)",
3058 td->name, __FILE__, __LINE__);
3059 return -1;
3060 }
3061
3062 size = st->size;
3063
3064 if((size >= 1 && size <= 32)
3065 && !check_permitted_alphabet_1(st)) {
3066 /* Constraint check succeeded */
3067 return 0;
3068 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003069 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003070 "%s: constraint failed (%s:%d)",
3071 td->name, __FILE__, __LINE__);
3072 return -1;
3073 }
3074}
3075
Lev Walkin725883b2006-10-09 12:07:58 +00003076static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) {
3077 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
3078 return -1;
3079 return permitted_alphabet_table_1[value] - 1;
3080}
3081static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) {
3082 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
3083 return -1;
3084 return permitted_alphabet_code2value_1[code];
3085}
Lev Walkin59b176e2005-11-26 11:25:14 +00003086/*
3087 * This type is implemented using VisibleString,
3088 * so here we adjust the DEF accordingly.
3089 */
Lev Walkin59b176e2005-11-26 11:25:14 +00003090
Lev Walkin725883b2006-10-09 12:07:58 +00003091/*** <<< CTDEFS [Identifier] >>> ***/
3092
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003093asn_per_constraints_t asn_PER_type_Identifier_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003094 { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */,
3095 { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
3096 asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */
3097 asn_PER_MAP_Identifier_1_c2v /* PER code to value map */
3098};
3099
Lev Walkin59b176e2005-11-26 11:25:14 +00003100/*** <<< STAT-DEFS [Identifier] >>> ***/
3101
Lev Walkina7591b52014-10-12 18:37:35 -07003102static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003103 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
3104};
Lev Walkin59b176e2005-11-26 11:25:14 +00003105asn_TYPE_descriptor_t asn_DEF_Identifier = {
3106 "Identifier",
3107 "Identifier",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003108 VisibleString_free,
3109 VisibleString_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00003110 Identifier_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003111 VisibleString_decode_ber,
3112 VisibleString_encode_der,
3113 VisibleString_decode_xer,
3114 VisibleString_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04003115 0, 0, /* No OER support, use "-gen-OER" to enable */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08003116 VisibleString_decode_uper,
3117 VisibleString_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003118 0, /* Use generic outmost tag fetcher */
3119 asn_DEF_Identifier_tags_1,
3120 sizeof(asn_DEF_Identifier_tags_1)
3121 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
3122 asn_DEF_Identifier_tags_1, /* Same as above */
3123 sizeof(asn_DEF_Identifier_tags_1)
3124 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003125 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003126 &asn_PER_type_Identifier_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003127 0, 0, /* No members */
3128 0 /* No specifics */
3129};
3130