blob: 901824eaa53646d91d9f2ebd8270bf6b41ddb74d [file] [log] [blame]
Lev Walkin006de1c2004-08-20 13:37:45 +00001
2/*** <<< INCLUDES [Int1] >>> ***/
3
4#include <INTEGER.h>
5
6/*** <<< TYPE-DECLS [Int1] >>> ***/
7
Lev Walkin006de1c2004-08-20 13:37:45 +00008typedef INTEGER_t Int1_t;
9
Lev Walkin006de1c2004-08-20 13:37:45 +000010/*** <<< FUNC-DECLS [Int1] >>> ***/
11
Lev Walkincaf0d5a2005-03-04 23:48:19 +000012extern asn_TYPE_descriptor_t asn_DEF_Int1;
13asn_struct_free_f Int1_free;
14asn_struct_print_f Int1_print;
15asn_constr_check_f Int1_constraint;
16ber_type_decoder_f Int1_decode_ber;
17der_type_encoder_f Int1_encode_der;
18xer_type_decoder_f Int1_decode_xer;
19xer_type_encoder_f Int1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +000020
21/*** <<< CODE [Int1] >>> ***/
22
Lev Walkincaf0d5a2005-03-04 23:48:19 +000023/*
24 * This type is implemented using INTEGER,
25 * so here we adjust the DEF accordingly.
26 */
Lev Walkincaf0d5a2005-03-04 23:48:19 +000027
28/*** <<< STAT-DEFS [Int1] >>> ***/
29
Lev Walkina7591b52014-10-12 18:37:35 -070030static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +000031 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
32};
33asn_TYPE_descriptor_t asn_DEF_Int1 = {
34 "Int1",
35 "Int1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080036 INTEGER_free,
37 INTEGER_print,
38 INTEGER_constraint,
39 INTEGER_decode_ber,
40 INTEGER_encode_der,
41 INTEGER_decode_xer,
42 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -070043 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +040044 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +000045 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +000046 asn_DEF_Int1_tags_1,
47 sizeof(asn_DEF_Int1_tags_1)
48 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
49 asn_DEF_Int1_tags_1, /* Same as above */
50 sizeof(asn_DEF_Int1_tags_1)
51 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +040052 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +000053 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +000054 0, 0, /* No members */
55 0 /* No specifics */
56};
Lev Walkin006de1c2004-08-20 13:37:45 +000057
58
59/*** <<< INCLUDES [Int2] >>> ***/
60
Lev Walkin22b5ed42006-09-13 02:51:20 +000061#include "Int1.h"
Lev Walkin006de1c2004-08-20 13:37:45 +000062
63/*** <<< TYPE-DECLS [Int2] >>> ***/
64
Lev Walkin006de1c2004-08-20 13:37:45 +000065typedef Int1_t Int2_t;
66
Lev Walkin006de1c2004-08-20 13:37:45 +000067/*** <<< FUNC-DECLS [Int2] >>> ***/
68
Lev Walkindfae9752004-09-29 13:19:37 +000069extern asn_TYPE_descriptor_t asn_DEF_Int2;
Lev Walkina9cc46e2004-09-22 16:06:28 +000070asn_struct_free_f Int2_free;
71asn_struct_print_f Int2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +000072asn_constr_check_f Int2_constraint;
73ber_type_decoder_f Int2_decode_ber;
74der_type_encoder_f Int2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +000075xer_type_decoder_f Int2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +000076xer_type_encoder_f Int2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +000077
78/*** <<< CODE [Int2] >>> ***/
79
80int
Lev Walkindfae9752004-09-29 13:19:37 +000081Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000082 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +000083 const Int1_t *st = (const Int1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +000084 long value;
85
86 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070087 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +000088 "%s: value not given (%s:%d)",
89 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +000090 return -1;
91 }
92
Lev Walkin44467432004-09-07 06:43:57 +000093 /* Check if the sign bit is present */
94 value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
Lev Walkin006de1c2004-08-20 13:37:45 +000095
96 if((value >= 0)) {
97 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +000098 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +000099 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700100 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000101 "%s: constraint failed (%s:%d)",
102 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000103 return -1;
104 }
105}
106
107/*
108 * This type is implemented using Int1,
Lev Walkinc3808c12004-09-23 22:14:58 +0000109 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000110 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000111
112/*** <<< STAT-DEFS [Int2] >>> ***/
113
Lev Walkina7591b52014-10-12 18:37:35 -0700114static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000115 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000116};
Lev Walkindfae9752004-09-29 13:19:37 +0000117asn_TYPE_descriptor_t asn_DEF_Int2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000118 "Int2",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000119 "Int2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800120 INTEGER_free,
121 INTEGER_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000122 Int2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800123 INTEGER_decode_ber,
124 INTEGER_encode_der,
125 INTEGER_decode_xer,
126 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700127 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400128 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000129 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000130 asn_DEF_Int2_tags_1,
131 sizeof(asn_DEF_Int2_tags_1)
132 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
133 asn_DEF_Int2_tags_1, /* Same as above */
134 sizeof(asn_DEF_Int2_tags_1)
135 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400136 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000137 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000138 0, 0, /* No members */
139 0 /* No specifics */
140};
141
142
143/*** <<< INCLUDES [Int3] >>> ***/
144
Lev Walkin22b5ed42006-09-13 02:51:20 +0000145#include "Int2.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000146
147/*** <<< TYPE-DECLS [Int3] >>> ***/
148
Lev Walkin006de1c2004-08-20 13:37:45 +0000149typedef Int2_t Int3_t;
150
Lev Walkin006de1c2004-08-20 13:37:45 +0000151/*** <<< FUNC-DECLS [Int3] >>> ***/
152
Lev Walkindfae9752004-09-29 13:19:37 +0000153extern asn_TYPE_descriptor_t asn_DEF_Int3;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000154asn_struct_free_f Int3_free;
155asn_struct_print_f Int3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000156asn_constr_check_f Int3_constraint;
157ber_type_decoder_f Int3_decode_ber;
158der_type_encoder_f Int3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000159xer_type_decoder_f Int3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000160xer_type_encoder_f Int3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000161
162/*** <<< CODE [Int3] >>> ***/
163
164int
Lev Walkindfae9752004-09-29 13:19:37 +0000165Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000166 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000167 const Int2_t *st = (const Int2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000168 long value;
169
170 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700171 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000172 "%s: value not given (%s:%d)",
173 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000174 return -1;
175 }
176
Lev Walkindfae9752004-09-29 13:19:37 +0000177 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700178 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000179 "%s: value too large (%s:%d)",
180 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000181 return -1;
182 }
183
184 if((value >= 0 && value <= 10)) {
185 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000186 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000187 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700188 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000189 "%s: constraint failed (%s:%d)",
190 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000191 return -1;
192 }
193}
194
195/*
196 * This type is implemented using Int2,
Lev Walkinc3808c12004-09-23 22:14:58 +0000197 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000198 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000199
200/*** <<< STAT-DEFS [Int3] >>> ***/
201
Lev Walkina7591b52014-10-12 18:37:35 -0700202static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000203 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000204};
Lev Walkindfae9752004-09-29 13:19:37 +0000205asn_TYPE_descriptor_t asn_DEF_Int3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000206 "Int3",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000207 "Int3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800208 INTEGER_free,
209 INTEGER_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000210 Int3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800211 INTEGER_decode_ber,
212 INTEGER_encode_der,
213 INTEGER_decode_xer,
214 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700215 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400216 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000217 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000218 asn_DEF_Int3_tags_1,
219 sizeof(asn_DEF_Int3_tags_1)
220 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
221 asn_DEF_Int3_tags_1, /* Same as above */
222 sizeof(asn_DEF_Int3_tags_1)
223 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400224 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000225 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000226 0, 0, /* No members */
227 0 /* No specifics */
228};
229
230
231/*** <<< INCLUDES [Int4] >>> ***/
232
Lev Walkin22b5ed42006-09-13 02:51:20 +0000233#include "Int3.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000234
235/*** <<< TYPE-DECLS [Int4] >>> ***/
236
Lev Walkin006de1c2004-08-20 13:37:45 +0000237typedef Int3_t Int4_t;
238
Lev Walkin006de1c2004-08-20 13:37:45 +0000239/*** <<< FUNC-DECLS [Int4] >>> ***/
240
Lev Walkindfae9752004-09-29 13:19:37 +0000241extern asn_TYPE_descriptor_t asn_DEF_Int4;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000242asn_struct_free_f Int4_free;
243asn_struct_print_f Int4_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000244asn_constr_check_f Int4_constraint;
245ber_type_decoder_f Int4_decode_ber;
246der_type_encoder_f Int4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000247xer_type_decoder_f Int4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000248xer_type_encoder_f Int4_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000249
250/*** <<< CODE [Int4] >>> ***/
251
252int
Lev Walkindfae9752004-09-29 13:19:37 +0000253Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000254 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000255 const Int3_t *st = (const Int3_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000256 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000257
258 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700259 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000260 "%s: value not given (%s:%d)",
261 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000262 return -1;
263 }
264
Lev Walkindfae9752004-09-29 13:19:37 +0000265 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700266 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000267 "%s: value too large (%s:%d)",
268 td->name, __FILE__, __LINE__);
269 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000270 }
271
Lev Walkind35c8b52004-08-25 02:08:08 +0000272 if((value >= 1 && value <= 10)) {
273 /* Constraint check succeeded */
274 return 0;
275 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700276 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000277 "%s: constraint failed (%s:%d)",
278 td->name, __FILE__, __LINE__);
279 return -1;
280 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000281}
282
283/*
284 * This type is implemented using Int3,
Lev Walkinc3808c12004-09-23 22:14:58 +0000285 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000286 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000287
288/*** <<< STAT-DEFS [Int4] >>> ***/
289
Lev Walkina7591b52014-10-12 18:37:35 -0700290static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000291 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000292};
Lev Walkindfae9752004-09-29 13:19:37 +0000293asn_TYPE_descriptor_t asn_DEF_Int4 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000294 "Int4",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000295 "Int4",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800296 INTEGER_free,
297 INTEGER_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000298 Int4_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800299 INTEGER_decode_ber,
300 INTEGER_encode_der,
301 INTEGER_decode_xer,
302 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700303 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400304 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000305 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000306 asn_DEF_Int4_tags_1,
307 sizeof(asn_DEF_Int4_tags_1)
308 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
309 asn_DEF_Int4_tags_1, /* Same as above */
310 sizeof(asn_DEF_Int4_tags_1)
311 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400312 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000313 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000314 0, 0, /* No members */
315 0 /* No specifics */
316};
317
318
319/*** <<< INCLUDES [Int5] >>> ***/
320
Lev Walkin22b5ed42006-09-13 02:51:20 +0000321#include "Int4.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000322
323/*** <<< TYPE-DECLS [Int5] >>> ***/
324
Lev Walkin006de1c2004-08-20 13:37:45 +0000325typedef Int4_t Int5_t;
326
Lev Walkin006de1c2004-08-20 13:37:45 +0000327/*** <<< FUNC-DECLS [Int5] >>> ***/
328
Lev Walkindfae9752004-09-29 13:19:37 +0000329extern asn_TYPE_descriptor_t asn_DEF_Int5;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000330asn_struct_free_f Int5_free;
331asn_struct_print_f Int5_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000332asn_constr_check_f Int5_constraint;
333ber_type_decoder_f Int5_decode_ber;
334der_type_encoder_f Int5_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000335xer_type_decoder_f Int5_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000336xer_type_encoder_f Int5_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000337
338/*** <<< CODE [Int5] >>> ***/
339
340int
Lev Walkindfae9752004-09-29 13:19:37 +0000341Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000342 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000343 const Int4_t *st = (const Int4_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000344 long value;
345
346 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700347 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000348 "%s: value not given (%s:%d)",
349 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000350 return -1;
351 }
352
Lev Walkindfae9752004-09-29 13:19:37 +0000353 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700354 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000355 "%s: value too large (%s:%d)",
356 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000357 return -1;
358 }
359
360 if((value == 5)) {
361 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000362 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000363 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700364 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000365 "%s: constraint failed (%s:%d)",
366 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000367 return -1;
368 }
369}
370
371/*
372 * This type is implemented using Int4,
Lev Walkinc3808c12004-09-23 22:14:58 +0000373 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000374 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000375
376/*** <<< STAT-DEFS [Int5] >>> ***/
377
Lev Walkina7591b52014-10-12 18:37:35 -0700378static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000379 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000380};
Lev Walkindfae9752004-09-29 13:19:37 +0000381asn_TYPE_descriptor_t asn_DEF_Int5 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000382 "Int5",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000383 "Int5",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800384 INTEGER_free,
385 INTEGER_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000386 Int5_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800387 INTEGER_decode_ber,
388 INTEGER_encode_der,
389 INTEGER_decode_xer,
390 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700391 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400392 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000393 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000394 asn_DEF_Int5_tags_1,
395 sizeof(asn_DEF_Int5_tags_1)
396 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
397 asn_DEF_Int5_tags_1, /* Same as above */
398 sizeof(asn_DEF_Int5_tags_1)
399 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400400 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000401 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000402 0, 0, /* No members */
403 0 /* No specifics */
404};
405
406
407/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
408
409#include <INTEGER.h>
410
411/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
412
Lev Walkin006de1c2004-08-20 13:37:45 +0000413typedef INTEGER_t ExtensibleExtensions_t;
414
Lev Walkin006de1c2004-08-20 13:37:45 +0000415/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
416
Lev Walkindfae9752004-09-29 13:19:37 +0000417extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000418asn_struct_free_f ExtensibleExtensions_free;
419asn_struct_print_f ExtensibleExtensions_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000420asn_constr_check_f ExtensibleExtensions_constraint;
421ber_type_decoder_f ExtensibleExtensions_decode_ber;
422der_type_encoder_f ExtensibleExtensions_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000423xer_type_decoder_f ExtensibleExtensions_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000424xer_type_encoder_f ExtensibleExtensions_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000425
426/*** <<< CODE [ExtensibleExtensions] >>> ***/
427
428int
Lev Walkindfae9752004-09-29 13:19:37 +0000429ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000430 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000431 const INTEGER_t *st = (const INTEGER_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000432 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000433
434 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700435 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000436 "%s: value not given (%s:%d)",
437 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000438 return -1;
439 }
440
Lev Walkindfae9752004-09-29 13:19:37 +0000441 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700442 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000443 "%s: value too large (%s:%d)",
444 td->name, __FILE__, __LINE__);
445 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000446 }
447
Lev Walkind35c8b52004-08-25 02:08:08 +0000448 if((value >= 1 && value <= 256)) {
449 /* Constraint check succeeded */
450 return 0;
451 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700452 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000453 "%s: constraint failed (%s:%d)",
454 td->name, __FILE__, __LINE__);
455 return -1;
456 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000457}
458
459/*
460 * This type is implemented using INTEGER,
Lev Walkinc3808c12004-09-23 22:14:58 +0000461 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000462 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000463
464/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
465
Lev Walkina7591b52014-10-12 18:37:35 -0700466static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000467 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
468};
Lev Walkindfae9752004-09-29 13:19:37 +0000469asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000470 "ExtensibleExtensions",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000471 "ExtensibleExtensions",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800472 INTEGER_free,
473 INTEGER_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000474 ExtensibleExtensions_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800475 INTEGER_decode_ber,
476 INTEGER_encode_der,
477 INTEGER_decode_xer,
478 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700479 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400480 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000481 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000482 asn_DEF_ExtensibleExtensions_tags_1,
483 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
484 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
485 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
486 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
487 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400488 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000489 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000490 0, 0, /* No members */
491 0 /* No specifics */
492};
493
494
495/*** <<< INCLUDES [Str1] >>> ***/
496
497#include <IA5String.h>
498
499/*** <<< TYPE-DECLS [Str1] >>> ***/
500
Lev Walkin006de1c2004-08-20 13:37:45 +0000501typedef IA5String_t Str1_t;
502
Lev Walkin006de1c2004-08-20 13:37:45 +0000503/*** <<< FUNC-DECLS [Str1] >>> ***/
504
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000505extern asn_TYPE_descriptor_t asn_DEF_Str1;
506asn_struct_free_f Str1_free;
507asn_struct_print_f Str1_print;
508asn_constr_check_f Str1_constraint;
509ber_type_decoder_f Str1_decode_ber;
510der_type_encoder_f Str1_encode_der;
511xer_type_decoder_f Str1_decode_xer;
512xer_type_encoder_f Str1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000513
514/*** <<< CODE [Str1] >>> ***/
515
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000516/*
517 * This type is implemented using IA5String,
518 * so here we adjust the DEF accordingly.
519 */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000520
521/*** <<< STAT-DEFS [Str1] >>> ***/
522
Lev Walkina7591b52014-10-12 18:37:35 -0700523static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000524 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
525};
526asn_TYPE_descriptor_t asn_DEF_Str1 = {
527 "Str1",
528 "Str1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800529 IA5String_free,
530 IA5String_print,
531 IA5String_constraint,
532 IA5String_decode_ber,
533 IA5String_encode_der,
534 IA5String_decode_xer,
535 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700536 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400537 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000538 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000539 asn_DEF_Str1_tags_1,
540 sizeof(asn_DEF_Str1_tags_1)
541 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
542 asn_DEF_Str1_tags_1, /* Same as above */
543 sizeof(asn_DEF_Str1_tags_1)
544 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400545 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000546 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000547 0, 0, /* No members */
548 0 /* No specifics */
549};
Lev Walkin006de1c2004-08-20 13:37:45 +0000550
551
552/*** <<< INCLUDES [Str2] >>> ***/
553
Lev Walkin22b5ed42006-09-13 02:51:20 +0000554#include "Str1.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000555
556/*** <<< TYPE-DECLS [Str2] >>> ***/
557
Lev Walkin006de1c2004-08-20 13:37:45 +0000558typedef Str1_t Str2_t;
559
Lev Walkin006de1c2004-08-20 13:37:45 +0000560/*** <<< FUNC-DECLS [Str2] >>> ***/
561
Lev Walkindfae9752004-09-29 13:19:37 +0000562extern asn_TYPE_descriptor_t asn_DEF_Str2;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000563asn_struct_free_f Str2_free;
564asn_struct_print_f Str2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000565asn_constr_check_f Str2_constraint;
566ber_type_decoder_f Str2_decode_ber;
567der_type_encoder_f Str2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000568xer_type_decoder_f Str2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000569xer_type_encoder_f Str2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000570
571/*** <<< CTABLES [Str2] >>> ***/
572
Lev Walkine8318b82005-03-06 09:29:03 +0000573static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000574 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000575 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000576 const uint8_t *ch = st->buf;
577 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000578
579 for(; ch < end; ch++) {
580 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000581 if(!(cv <= 127)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000582 }
Lev Walkin775885e2004-08-22 12:47:03 +0000583 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000584}
585
586
587/*** <<< CODE [Str2] >>> ***/
588
589int
Lev Walkindfae9752004-09-29 13:19:37 +0000590Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000591 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000592 const Str1_t *st = (const Str1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000593 size_t size;
594
595 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700596 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000597 "%s: value not given (%s:%d)",
598 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000599 return -1;
600 }
601
602 size = st->size;
603
604 if(((size <= 20) || (size >= 25 && size <= 30))
Lev Walkine8318b82005-03-06 09:29:03 +0000605 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000606 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000607 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000608 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700609 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000610 "%s: constraint failed (%s:%d)",
611 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000612 return -1;
613 }
614}
615
616/*
617 * This type is implemented using Str1,
Lev Walkinc3808c12004-09-23 22:14:58 +0000618 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000619 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000620
621/*** <<< STAT-DEFS [Str2] >>> ***/
622
Lev Walkina7591b52014-10-12 18:37:35 -0700623static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000624 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000625};
Lev Walkindfae9752004-09-29 13:19:37 +0000626asn_TYPE_descriptor_t asn_DEF_Str2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000627 "Str2",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000628 "Str2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800629 IA5String_free,
630 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000631 Str2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800632 IA5String_decode_ber,
633 IA5String_encode_der,
634 IA5String_decode_xer,
635 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700636 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400637 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000638 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000639 asn_DEF_Str2_tags_1,
640 sizeof(asn_DEF_Str2_tags_1)
641 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
642 asn_DEF_Str2_tags_1, /* Same as above */
643 sizeof(asn_DEF_Str2_tags_1)
644 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400645 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000646 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000647 0, 0, /* No members */
648 0 /* No specifics */
649};
650
651
652/*** <<< INCLUDES [Str3] >>> ***/
653
Lev Walkin22b5ed42006-09-13 02:51:20 +0000654#include "Str2.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000655
656/*** <<< TYPE-DECLS [Str3] >>> ***/
657
Lev Walkin006de1c2004-08-20 13:37:45 +0000658typedef Str2_t Str3_t;
659
Lev Walkin006de1c2004-08-20 13:37:45 +0000660/*** <<< FUNC-DECLS [Str3] >>> ***/
661
Lev Walkindfae9752004-09-29 13:19:37 +0000662extern asn_TYPE_descriptor_t asn_DEF_Str3;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000663asn_struct_free_f Str3_free;
664asn_struct_print_f Str3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000665asn_constr_check_f Str3_constraint;
666ber_type_decoder_f Str3_decode_ber;
667der_type_encoder_f Str3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000668xer_type_decoder_f Str3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000669xer_type_encoder_f Str3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000670
671/*** <<< CTABLES [Str3] >>> ***/
672
Lev Walkina7591b52014-10-12 18:37:35 -0700673static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000674 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
675 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
676 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
677 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
678 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
679 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
680 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin006de1c2004-08-20 13:37:45 +0000681};
682
Lev Walkine8318b82005-03-06 09:29:03 +0000683static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -0700684 const int *table = permitted_alphabet_table_1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000685 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000686 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000687 const uint8_t *ch = st->buf;
688 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000689
690 for(; ch < end; ch++) {
691 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000692 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000693 }
Lev Walkin775885e2004-08-22 12:47:03 +0000694 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000695}
696
697
698/*** <<< CODE [Str3] >>> ***/
699
700int
Lev Walkindfae9752004-09-29 13:19:37 +0000701Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000702 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000703 const Str2_t *st = (const Str2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000704 size_t size;
705
706 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700707 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000708 "%s: value not given (%s:%d)",
709 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000710 return -1;
711 }
712
713 size = st->size;
714
715 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
Lev Walkine8318b82005-03-06 09:29:03 +0000716 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000717 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000718 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000719 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700720 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000721 "%s: constraint failed (%s:%d)",
722 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000723 return -1;
724 }
725}
726
727/*
728 * This type is implemented using Str2,
Lev Walkinc3808c12004-09-23 22:14:58 +0000729 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000730 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000731
732/*** <<< STAT-DEFS [Str3] >>> ***/
733
Lev Walkina7591b52014-10-12 18:37:35 -0700734static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000735 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000736};
Lev Walkindfae9752004-09-29 13:19:37 +0000737asn_TYPE_descriptor_t asn_DEF_Str3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000738 "Str3",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000739 "Str3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800740 IA5String_free,
741 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000742 Str3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800743 IA5String_decode_ber,
744 IA5String_encode_der,
745 IA5String_decode_xer,
746 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700747 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400748 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000749 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000750 asn_DEF_Str3_tags_1,
751 sizeof(asn_DEF_Str3_tags_1)
752 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
753 asn_DEF_Str3_tags_1, /* Same as above */
754 sizeof(asn_DEF_Str3_tags_1)
755 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400756 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000757 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000758 0, 0, /* No members */
759 0 /* No specifics */
760};
761
762
Lev Walkin8a99bf72004-09-10 06:07:39 +0000763/*** <<< INCLUDES [Str4] >>> ***/
764
765#include <IA5String.h>
766
767/*** <<< TYPE-DECLS [Str4] >>> ***/
768
Lev Walkin8a99bf72004-09-10 06:07:39 +0000769typedef IA5String_t Str4_t;
770
771/*** <<< FUNC-DECLS [Str4] >>> ***/
772
Lev Walkindfae9752004-09-29 13:19:37 +0000773extern asn_TYPE_descriptor_t asn_DEF_Str4;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000774asn_struct_free_f Str4_free;
775asn_struct_print_f Str4_print;
Lev Walkin8a99bf72004-09-10 06:07:39 +0000776asn_constr_check_f Str4_constraint;
777ber_type_decoder_f Str4_decode_ber;
778der_type_encoder_f Str4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000779xer_type_decoder_f Str4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000780xer_type_encoder_f Str4_encode_xer;
Lev Walkin8a99bf72004-09-10 06:07:39 +0000781
782/*** <<< CTABLES [Str4] >>> ***/
783
Lev Walkine8318b82005-03-06 09:29:03 +0000784static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin8a99bf72004-09-10 06:07:39 +0000785 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000786 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +0000787 const uint8_t *ch = st->buf;
788 const uint8_t *end = ch + st->size;
789
790 for(; ch < end; ch++) {
791 uint8_t cv = *ch;
792 if(!(cv <= 127)) return -1;
793 }
794 return 0;
795}
796
797
798/*** <<< CODE [Str4] >>> ***/
799
800int
Lev Walkindfae9752004-09-29 13:19:37 +0000801Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000802 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000803 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +0000804
805 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700806 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +0000807 "%s: value not given (%s:%d)",
808 td->name, __FILE__, __LINE__);
809 return -1;
810 }
811
812
Lev Walkine8318b82005-03-06 09:29:03 +0000813 if(!check_permitted_alphabet_1(st)) {
Lev Walkin8a99bf72004-09-10 06:07:39 +0000814 /* Constraint check succeeded */
815 return 0;
816 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700817 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +0000818 "%s: constraint failed (%s:%d)",
819 td->name, __FILE__, __LINE__);
820 return -1;
821 }
822}
823
824/*
825 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +0000826 * so here we adjust the DEF accordingly.
Lev Walkin8a99bf72004-09-10 06:07:39 +0000827 */
Lev Walkin8a99bf72004-09-10 06:07:39 +0000828
829/*** <<< STAT-DEFS [Str4] >>> ***/
830
Lev Walkina7591b52014-10-12 18:37:35 -0700831static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
Lev Walkin8a99bf72004-09-10 06:07:39 +0000832 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
833};
Lev Walkindfae9752004-09-29 13:19:37 +0000834asn_TYPE_descriptor_t asn_DEF_Str4 = {
Lev Walkin8a99bf72004-09-10 06:07:39 +0000835 "Str4",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000836 "Str4",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800837 IA5String_free,
838 IA5String_print,
Lev Walkin8a99bf72004-09-10 06:07:39 +0000839 Str4_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800840 IA5String_decode_ber,
841 IA5String_encode_der,
842 IA5String_decode_xer,
843 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700844 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400845 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin8a99bf72004-09-10 06:07:39 +0000846 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000847 asn_DEF_Str4_tags_1,
848 sizeof(asn_DEF_Str4_tags_1)
849 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
850 asn_DEF_Str4_tags_1, /* Same as above */
851 sizeof(asn_DEF_Str4_tags_1)
852 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400853 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000854 0, /* No PER visible constraints */
Lev Walkin8a99bf72004-09-10 06:07:39 +0000855 0, 0, /* No members */
856 0 /* No specifics */
857};
858
859
Lev Walkin006de1c2004-08-20 13:37:45 +0000860/*** <<< INCLUDES [PER-Visible] >>> ***/
861
862#include <IA5String.h>
863
864/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
865
Lev Walkin006de1c2004-08-20 13:37:45 +0000866typedef IA5String_t PER_Visible_t;
867
Lev Walkin006de1c2004-08-20 13:37:45 +0000868/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
869
Lev Walkindfae9752004-09-29 13:19:37 +0000870extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000871asn_struct_free_f PER_Visible_free;
872asn_struct_print_f PER_Visible_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000873asn_constr_check_f PER_Visible_constraint;
874ber_type_decoder_f PER_Visible_decode_ber;
875der_type_encoder_f PER_Visible_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000876xer_type_decoder_f PER_Visible_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000877xer_type_encoder_f PER_Visible_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000878
879/*** <<< CTABLES [PER-Visible] >>> ***/
880
Lev Walkine8318b82005-03-06 09:29:03 +0000881static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000882 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000883 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000884 const uint8_t *ch = st->buf;
885 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000886
887 for(; ch < end; ch++) {
888 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000889 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000890 }
Lev Walkin775885e2004-08-22 12:47:03 +0000891 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000892}
893
894
895/*** <<< CODE [PER-Visible] >>> ***/
896
897int
Lev Walkindfae9752004-09-29 13:19:37 +0000898PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000899 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000900 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000901
902 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700903 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000904 "%s: value not given (%s:%d)",
905 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000906 return -1;
907 }
908
909
Lev Walkine8318b82005-03-06 09:29:03 +0000910 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000911 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000912 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000913 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700914 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000915 "%s: constraint failed (%s:%d)",
916 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000917 return -1;
918 }
919}
920
921/*
922 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +0000923 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000924 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000925
926/*** <<< STAT-DEFS [PER-Visible] >>> ***/
927
Lev Walkina7591b52014-10-12 18:37:35 -0700928static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000929 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
930};
Lev Walkindfae9752004-09-29 13:19:37 +0000931asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000932 "PER-Visible",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000933 "PER-Visible",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800934 IA5String_free,
935 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000936 PER_Visible_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800937 IA5String_decode_ber,
938 IA5String_encode_der,
939 IA5String_decode_xer,
940 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700941 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400942 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000943 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000944 asn_DEF_PER_Visible_tags_1,
945 sizeof(asn_DEF_PER_Visible_tags_1)
946 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
947 asn_DEF_PER_Visible_tags_1, /* Same as above */
948 sizeof(asn_DEF_PER_Visible_tags_1)
949 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400950 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000951 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000952 0, 0, /* No members */
953 0 /* No specifics */
954};
955
956
957/*** <<< INCLUDES [PER-Visible-2] >>> ***/
958
Lev Walkin22b5ed42006-09-13 02:51:20 +0000959#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000960
961/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
962
Lev Walkin006de1c2004-08-20 13:37:45 +0000963typedef PER_Visible_t PER_Visible_2_t;
964
Lev Walkin006de1c2004-08-20 13:37:45 +0000965/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
966
Lev Walkindfae9752004-09-29 13:19:37 +0000967extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000968asn_struct_free_f PER_Visible_2_free;
969asn_struct_print_f PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000970asn_constr_check_f PER_Visible_2_constraint;
971ber_type_decoder_f PER_Visible_2_decode_ber;
972der_type_encoder_f PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000973xer_type_decoder_f PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000974xer_type_encoder_f PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000975
976/*** <<< CTABLES [PER-Visible-2] >>> ***/
977
Lev Walkine8318b82005-03-06 09:29:03 +0000978static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000979 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000980 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000981 const uint8_t *ch = st->buf;
982 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000983
984 for(; ch < end; ch++) {
985 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000986 if(!(cv >= 69 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000987 }
Lev Walkin775885e2004-08-22 12:47:03 +0000988 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000989}
990
991
992/*** <<< CODE [PER-Visible-2] >>> ***/
993
994int
Lev Walkindfae9752004-09-29 13:19:37 +0000995PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000996 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000997 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000998
999 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001000 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001001 "%s: value not given (%s:%d)",
1002 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001003 return -1;
1004 }
1005
1006
Lev Walkine8318b82005-03-06 09:29:03 +00001007 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001008 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001009 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001010 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001011 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001012 "%s: constraint failed (%s:%d)",
1013 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001014 return -1;
1015 }
1016}
1017
1018/*
1019 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001020 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001021 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001022
1023/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
1024
Lev Walkina7591b52014-10-12 18:37:35 -07001025static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001026 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001027};
Lev Walkindfae9752004-09-29 13:19:37 +00001028asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001029 "PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001030 "PER-Visible-2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001031 IA5String_free,
1032 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001033 PER_Visible_2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001034 IA5String_decode_ber,
1035 IA5String_encode_der,
1036 IA5String_decode_xer,
1037 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001038 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001039 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001040 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001041 asn_DEF_PER_Visible_2_tags_1,
1042 sizeof(asn_DEF_PER_Visible_2_tags_1)
1043 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
1044 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
1045 sizeof(asn_DEF_PER_Visible_2_tags_1)
1046 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001047 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001048 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001049 0, 0, /* No members */
1050 0 /* No specifics */
1051};
1052
1053
1054/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
1055
Lev Walkin22b5ed42006-09-13 02:51:20 +00001056#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001057
1058/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
1059
Lev Walkin006de1c2004-08-20 13:37:45 +00001060typedef PER_Visible_t Not_PER_Visible_1_t;
1061
Lev Walkin006de1c2004-08-20 13:37:45 +00001062/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
1063
Lev Walkindfae9752004-09-29 13:19:37 +00001064extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001065asn_struct_free_f Not_PER_Visible_1_free;
1066asn_struct_print_f Not_PER_Visible_1_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001067asn_constr_check_f Not_PER_Visible_1_constraint;
1068ber_type_decoder_f Not_PER_Visible_1_decode_ber;
1069der_type_encoder_f Not_PER_Visible_1_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001070xer_type_decoder_f Not_PER_Visible_1_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001071xer_type_encoder_f Not_PER_Visible_1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001072
1073/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
1074
Lev Walkine8318b82005-03-06 09:29:03 +00001075static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001076 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001077 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001078 const uint8_t *ch = st->buf;
1079 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001080
1081 for(; ch < end; ch++) {
1082 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001083 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001084 }
Lev Walkin775885e2004-08-22 12:47:03 +00001085 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001086}
1087
1088
1089/*** <<< CODE [Not-PER-Visible-1] >>> ***/
1090
1091int
Lev Walkindfae9752004-09-29 13:19:37 +00001092Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001093 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001094 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001095
1096 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001097 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001098 "%s: value not given (%s:%d)",
1099 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001100 return -1;
1101 }
1102
1103
Lev Walkine8318b82005-03-06 09:29:03 +00001104 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001105 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001106 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001107 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001108 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001109 "%s: constraint failed (%s:%d)",
1110 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001111 return -1;
1112 }
1113}
1114
1115/*
1116 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001117 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001118 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001119
1120/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
1121
Lev Walkina7591b52014-10-12 18:37:35 -07001122static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001123 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001124};
Lev Walkindfae9752004-09-29 13:19:37 +00001125asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001126 "Not-PER-Visible-1",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001127 "Not-PER-Visible-1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001128 IA5String_free,
1129 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001130 Not_PER_Visible_1_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001131 IA5String_decode_ber,
1132 IA5String_encode_der,
1133 IA5String_decode_xer,
1134 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001135 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001136 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001137 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001138 asn_DEF_Not_PER_Visible_1_tags_1,
1139 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1140 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
1141 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
1142 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
1143 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001144 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001145 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001146 0, 0, /* No members */
1147 0 /* No specifics */
1148};
1149
1150
1151/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
1152
Lev Walkin22b5ed42006-09-13 02:51:20 +00001153#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001154
1155/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
1156
Lev Walkin006de1c2004-08-20 13:37:45 +00001157typedef PER_Visible_t Not_PER_Visible_2_t;
1158
Lev Walkin006de1c2004-08-20 13:37:45 +00001159/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
1160
Lev Walkindfae9752004-09-29 13:19:37 +00001161extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001162asn_struct_free_f Not_PER_Visible_2_free;
1163asn_struct_print_f Not_PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001164asn_constr_check_f Not_PER_Visible_2_constraint;
1165ber_type_decoder_f Not_PER_Visible_2_decode_ber;
1166der_type_encoder_f Not_PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001167xer_type_decoder_f Not_PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001168xer_type_encoder_f Not_PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001169
Lev Walkind35c8b52004-08-25 02:08:08 +00001170/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
1171
Lev Walkine8318b82005-03-06 09:29:03 +00001172static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001173 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001174 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00001175 const uint8_t *ch = st->buf;
1176 const uint8_t *end = ch + st->size;
1177
1178 for(; ch < end; ch++) {
1179 uint8_t cv = *ch;
1180 if(!(cv >= 65 && cv <= 66)) return -1;
1181 }
1182 return 0;
1183}
1184
1185
Lev Walkin006de1c2004-08-20 13:37:45 +00001186/*** <<< CODE [Not-PER-Visible-2] >>> ***/
1187
1188int
Lev Walkindfae9752004-09-29 13:19:37 +00001189Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001190 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001191 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001192
1193 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001194 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001195 "%s: value not given (%s:%d)",
1196 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001197 return -1;
1198 }
1199
1200
Lev Walkine8318b82005-03-06 09:29:03 +00001201 if(!check_permitted_alphabet_1(st)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001202 /* Constraint check succeeded */
1203 return 0;
1204 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001205 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +00001206 "%s: constraint failed (%s:%d)",
1207 td->name, __FILE__, __LINE__);
1208 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001209 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001210}
1211
1212/*
1213 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001214 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001215 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001216
1217/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
1218
Lev Walkina7591b52014-10-12 18:37:35 -07001219static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001220 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001221};
Lev Walkindfae9752004-09-29 13:19:37 +00001222asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001223 "Not-PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001224 "Not-PER-Visible-2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001225 IA5String_free,
1226 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001227 Not_PER_Visible_2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001228 IA5String_decode_ber,
1229 IA5String_encode_der,
1230 IA5String_decode_xer,
1231 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001232 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001233 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001234 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001235 asn_DEF_Not_PER_Visible_2_tags_1,
1236 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1237 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
1238 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
1239 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
1240 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001241 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001242 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001243 0, 0, /* No members */
1244 0 /* No specifics */
1245};
1246
1247
1248/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
1249
Lev Walkin22b5ed42006-09-13 02:51:20 +00001250#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001251
1252/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
1253
Lev Walkin006de1c2004-08-20 13:37:45 +00001254typedef PER_Visible_t Not_PER_Visible_3_t;
1255
Lev Walkin006de1c2004-08-20 13:37:45 +00001256/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
1257
Lev Walkindfae9752004-09-29 13:19:37 +00001258extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001259asn_struct_free_f Not_PER_Visible_3_free;
1260asn_struct_print_f Not_PER_Visible_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001261asn_constr_check_f Not_PER_Visible_3_constraint;
1262ber_type_decoder_f Not_PER_Visible_3_decode_ber;
1263der_type_encoder_f Not_PER_Visible_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001264xer_type_decoder_f Not_PER_Visible_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001265xer_type_encoder_f Not_PER_Visible_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001266
Lev Walkind35c8b52004-08-25 02:08:08 +00001267/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
1268
Lev Walkine8318b82005-03-06 09:29:03 +00001269static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001270 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001271 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00001272 const uint8_t *ch = st->buf;
1273 const uint8_t *end = ch + st->size;
1274
1275 for(; ch < end; ch++) {
1276 uint8_t cv = *ch;
1277 if(!(cv >= 65 && cv <= 66)) return -1;
1278 }
1279 return 0;
1280}
1281
1282
Lev Walkin006de1c2004-08-20 13:37:45 +00001283/*** <<< CODE [Not-PER-Visible-3] >>> ***/
1284
1285int
Lev Walkindfae9752004-09-29 13:19:37 +00001286Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001287 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001288 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001289
1290 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001291 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001292 "%s: value not given (%s:%d)",
1293 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001294 return -1;
1295 }
1296
1297
Lev Walkine8318b82005-03-06 09:29:03 +00001298 if(!check_permitted_alphabet_1(st)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001299 /* Constraint check succeeded */
1300 return 0;
1301 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001302 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +00001303 "%s: constraint failed (%s:%d)",
1304 td->name, __FILE__, __LINE__);
1305 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001306 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001307}
1308
1309/*
1310 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001311 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001312 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001313
1314/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
1315
Lev Walkina7591b52014-10-12 18:37:35 -07001316static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001317 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001318};
Lev Walkindfae9752004-09-29 13:19:37 +00001319asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001320 "Not-PER-Visible-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001321 "Not-PER-Visible-3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001322 IA5String_free,
1323 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001324 Not_PER_Visible_3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001325 IA5String_decode_ber,
1326 IA5String_encode_der,
1327 IA5String_decode_xer,
1328 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001329 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001330 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001331 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001332 asn_DEF_Not_PER_Visible_3_tags_1,
1333 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1334 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
1335 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
1336 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
1337 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001338 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001339 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001340 0, 0, /* No members */
1341 0 /* No specifics */
1342};
1343
1344
1345/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
1346
Lev Walkin22b5ed42006-09-13 02:51:20 +00001347#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001348
1349/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
1350
Lev Walkin006de1c2004-08-20 13:37:45 +00001351typedef PER_Visible_t SIZE_but_not_FROM_t;
1352
Lev Walkin006de1c2004-08-20 13:37:45 +00001353/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
1354
Lev Walkindfae9752004-09-29 13:19:37 +00001355extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001356asn_struct_free_f SIZE_but_not_FROM_free;
1357asn_struct_print_f SIZE_but_not_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001358asn_constr_check_f SIZE_but_not_FROM_constraint;
1359ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
1360der_type_encoder_f SIZE_but_not_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001361xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001362xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001363
1364/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
1365
Lev Walkine8318b82005-03-06 09:29:03 +00001366static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001367 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001368 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001369 const uint8_t *ch = st->buf;
1370 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001371
1372 for(; ch < end; ch++) {
1373 uint8_t cv = *ch;
Lev Walkind35c8b52004-08-25 02:08:08 +00001374 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001375 }
Lev Walkin775885e2004-08-22 12:47:03 +00001376 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001377}
1378
1379
1380/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
1381
1382int
Lev Walkindfae9752004-09-29 13:19:37 +00001383SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001384 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001385 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001386 size_t size;
1387
1388 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001389 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001390 "%s: value not given (%s:%d)",
1391 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001392 return -1;
1393 }
1394
1395 size = st->size;
1396
1397 if((size >= 1 && size <= 4)
Lev Walkine8318b82005-03-06 09:29:03 +00001398 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001399 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001400 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001401 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001402 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001403 "%s: constraint failed (%s:%d)",
1404 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001405 return -1;
1406 }
1407}
1408
1409/*
1410 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001411 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001412 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001413
1414/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
1415
Lev Walkina7591b52014-10-12 18:37:35 -07001416static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001417 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001418};
Lev Walkindfae9752004-09-29 13:19:37 +00001419asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001420 "SIZE-but-not-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001421 "SIZE-but-not-FROM",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001422 IA5String_free,
1423 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001424 SIZE_but_not_FROM_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001425 IA5String_decode_ber,
1426 IA5String_encode_der,
1427 IA5String_decode_xer,
1428 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001429 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001430 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001431 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001432 asn_DEF_SIZE_but_not_FROM_tags_1,
1433 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1434 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
1435 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
1436 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
1437 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001438 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001439 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001440 0, 0, /* No members */
1441 0 /* No specifics */
1442};
1443
1444
1445/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
1446
Lev Walkin22b5ed42006-09-13 02:51:20 +00001447#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001448
1449/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
1450
Lev Walkin006de1c2004-08-20 13:37:45 +00001451typedef PER_Visible_t SIZE_and_FROM_t;
1452
Lev Walkin006de1c2004-08-20 13:37:45 +00001453/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
1454
Lev Walkindfae9752004-09-29 13:19:37 +00001455extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001456asn_struct_free_f SIZE_and_FROM_free;
1457asn_struct_print_f SIZE_and_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001458asn_constr_check_f SIZE_and_FROM_constraint;
1459ber_type_decoder_f SIZE_and_FROM_decode_ber;
1460der_type_encoder_f SIZE_and_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001461xer_type_decoder_f SIZE_and_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001462xer_type_encoder_f SIZE_and_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001463
1464/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
1465
Lev Walkine8318b82005-03-06 09:29:03 +00001466static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001467 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001468 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001469 const uint8_t *ch = st->buf;
1470 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001471
1472 for(; ch < end; ch++) {
1473 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001474 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001475 }
Lev Walkin775885e2004-08-22 12:47:03 +00001476 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001477}
1478
1479
1480/*** <<< CODE [SIZE-and-FROM] >>> ***/
1481
1482int
Lev Walkindfae9752004-09-29 13:19:37 +00001483SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001484 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001485 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001486 size_t size;
1487
1488 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001489 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001490 "%s: value not given (%s:%d)",
1491 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001492 return -1;
1493 }
1494
1495 size = st->size;
1496
1497 if((size >= 1 && size <= 4)
Lev Walkine8318b82005-03-06 09:29:03 +00001498 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001499 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001500 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001501 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001502 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001503 "%s: constraint failed (%s:%d)",
1504 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001505 return -1;
1506 }
1507}
1508
1509/*
1510 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001511 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001512 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001513
1514/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
1515
Lev Walkina7591b52014-10-12 18:37:35 -07001516static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001517 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001518};
Lev Walkindfae9752004-09-29 13:19:37 +00001519asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001520 "SIZE-and-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001521 "SIZE-and-FROM",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001522 IA5String_free,
1523 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001524 SIZE_and_FROM_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001525 IA5String_decode_ber,
1526 IA5String_encode_der,
1527 IA5String_decode_xer,
1528 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001529 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001530 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001531 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001532 asn_DEF_SIZE_and_FROM_tags_1,
1533 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1534 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
1535 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
1536 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
1537 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001538 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001539 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001540 0, 0, /* No members */
1541 0 /* No specifics */
1542};
1543
1544
1545/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
1546
Lev Walkin22b5ed42006-09-13 02:51:20 +00001547#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001548
1549/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1550
Lev Walkin006de1c2004-08-20 13:37:45 +00001551typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
1552
Lev Walkin006de1c2004-08-20 13:37:45 +00001553/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
1554
Lev Walkindfae9752004-09-29 13:19:37 +00001555extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001556asn_struct_free_f Neither_SIZE_nor_FROM_free;
1557asn_struct_print_f Neither_SIZE_nor_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001558asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
1559ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
1560der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001561xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001562xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001563
1564/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
1565
Lev Walkine8318b82005-03-06 09:29:03 +00001566static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001567 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001568 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001569 const uint8_t *ch = st->buf;
1570 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001571
1572 for(; ch < end; ch++) {
1573 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001574 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001575 }
Lev Walkin775885e2004-08-22 12:47:03 +00001576 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001577}
1578
1579
1580/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
1581
1582int
Lev Walkindfae9752004-09-29 13:19:37 +00001583Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001584 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001585 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001586
1587 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001588 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001589 "%s: value not given (%s:%d)",
1590 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001591 return -1;
1592 }
1593
1594
Lev Walkine8318b82005-03-06 09:29:03 +00001595 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001596 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001597 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001598 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001599 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001600 "%s: constraint failed (%s:%d)",
1601 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001602 return -1;
1603 }
1604}
1605
1606/*
1607 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001608 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001609 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001610
1611/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
1612
Lev Walkina7591b52014-10-12 18:37:35 -07001613static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001614 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001615};
Lev Walkindfae9752004-09-29 13:19:37 +00001616asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001617 "Neither-SIZE-nor-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001618 "Neither-SIZE-nor-FROM",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001619 IA5String_free,
1620 IA5String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001621 Neither_SIZE_nor_FROM_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001622 IA5String_decode_ber,
1623 IA5String_encode_der,
1624 IA5String_decode_xer,
1625 IA5String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001626 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001627 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001628 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001629 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
1630 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1631 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
1632 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
1633 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
1634 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001635 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001636 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001637 0, 0, /* No members */
1638 0 /* No specifics */
1639};
1640
1641
Lev Walkin55cc44a2004-10-03 09:14:32 +00001642/*** <<< INCLUDES [Utf8-4] >>> ***/
1643
1644#include <UTF8String.h>
1645
1646/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
1647
Lev Walkin55cc44a2004-10-03 09:14:32 +00001648typedef UTF8String_t Utf8_4_t;
1649
1650/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
1651
1652extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
1653asn_struct_free_f Utf8_4_free;
1654asn_struct_print_f Utf8_4_print;
1655asn_constr_check_f Utf8_4_constraint;
1656ber_type_decoder_f Utf8_4_decode_ber;
1657der_type_encoder_f Utf8_4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001658xer_type_decoder_f Utf8_4_decode_xer;
Lev Walkin55cc44a2004-10-03 09:14:32 +00001659xer_type_encoder_f Utf8_4_encode_xer;
1660
1661/*** <<< CTABLES [Utf8-4] >>> ***/
1662
Lev Walkine8318b82005-03-06 09:29:03 +00001663static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00001664 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
1665 return -1; /* Alphabet (sic!) test failed. */
1666
1667 return 0;
1668}
1669
1670
1671/*** <<< CODE [Utf8-4] >>> ***/
1672
1673int
1674Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001675 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001676 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin55cc44a2004-10-03 09:14:32 +00001677
1678 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001679 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin55cc44a2004-10-03 09:14:32 +00001680 "%s: value not given (%s:%d)",
1681 td->name, __FILE__, __LINE__);
1682 return -1;
1683 }
1684
1685
Lev Walkine8318b82005-03-06 09:29:03 +00001686 if(!check_permitted_alphabet_1(st)) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00001687 /* Constraint check succeeded */
1688 return 0;
1689 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001690 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin55cc44a2004-10-03 09:14:32 +00001691 "%s: constraint failed (%s:%d)",
1692 td->name, __FILE__, __LINE__);
1693 return -1;
1694 }
1695}
1696
1697/*
1698 * This type is implemented using UTF8String,
1699 * so here we adjust the DEF accordingly.
1700 */
Lev Walkin55cc44a2004-10-03 09:14:32 +00001701
1702/*** <<< STAT-DEFS [Utf8-4] >>> ***/
1703
Lev Walkina7591b52014-10-12 18:37:35 -07001704static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
Lev Walkin55cc44a2004-10-03 09:14:32 +00001705 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
1706};
1707asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
1708 "Utf8-4",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001709 "Utf8-4",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001710 UTF8String_free,
1711 UTF8String_print,
Lev Walkin55cc44a2004-10-03 09:14:32 +00001712 Utf8_4_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001713 UTF8String_decode_ber,
1714 UTF8String_encode_der,
1715 UTF8String_decode_xer,
1716 UTF8String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001717 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001718 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin55cc44a2004-10-03 09:14:32 +00001719 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001720 asn_DEF_Utf8_4_tags_1,
1721 sizeof(asn_DEF_Utf8_4_tags_1)
1722 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
1723 asn_DEF_Utf8_4_tags_1, /* Same as above */
1724 sizeof(asn_DEF_Utf8_4_tags_1)
1725 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001726 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001727 0, /* No PER visible constraints */
Lev Walkin55cc44a2004-10-03 09:14:32 +00001728 0, 0, /* No members */
1729 0 /* No specifics */
1730};
1731
1732
Lev Walkin006de1c2004-08-20 13:37:45 +00001733/*** <<< INCLUDES [Utf8-3] >>> ***/
1734
Lev Walkin22b5ed42006-09-13 02:51:20 +00001735#include "Utf8-2.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001736
1737/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
1738
Lev Walkin006de1c2004-08-20 13:37:45 +00001739typedef Utf8_2_t Utf8_3_t;
1740
Lev Walkin006de1c2004-08-20 13:37:45 +00001741/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
1742
Lev Walkindfae9752004-09-29 13:19:37 +00001743extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001744asn_struct_free_f Utf8_3_free;
1745asn_struct_print_f Utf8_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001746asn_constr_check_f Utf8_3_constraint;
1747ber_type_decoder_f Utf8_3_decode_ber;
1748der_type_encoder_f Utf8_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001749xer_type_decoder_f Utf8_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001750xer_type_encoder_f Utf8_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001751
1752/*** <<< CTABLES [Utf8-3] >>> ***/
1753
Lev Walkina7591b52014-10-12 18:37:35 -07001754static const int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001755 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1756 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1757 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1758 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1759 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
176016,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
1761 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
176242,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin006de1c2004-08-20 13:37:45 +00001763};
1764
Lev Walkine8318b82005-03-06 09:29:03 +00001765static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07001766 const int *table = permitted_alphabet_table_1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001767 /* The underlying type is UTF8String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001768 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001769 const uint8_t *ch = st->buf;
1770 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001771
1772 for(; ch < end; ch++) {
1773 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001774 if(cv >= 0x80) return -1;
1775 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001776 }
Lev Walkin775885e2004-08-22 12:47:03 +00001777 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001778}
1779
1780
1781/*** <<< CODE [Utf8-3] >>> ***/
1782
1783int
Lev Walkindfae9752004-09-29 13:19:37 +00001784Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001785 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001786 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001787 size_t size;
1788
1789 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001790 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001791 "%s: value not given (%s:%d)",
1792 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001793 return -1;
1794 }
1795
Lev Walkinfac2e942004-10-02 16:33:46 +00001796 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00001797 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001798 ASN__CTFAIL(app_key, td, sptr,
Lev Walkinfac2e942004-10-02 16:33:46 +00001799 "%s: UTF-8: broken encoding (%s:%d)",
1800 td->name, __FILE__, __LINE__);
1801 return -1;
1802 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001803
1804 if((size >= 1 && size <= 2)
Lev Walkine8318b82005-03-06 09:29:03 +00001805 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001806 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001807 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001808 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001809 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001810 "%s: constraint failed (%s:%d)",
1811 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001812 return -1;
1813 }
1814}
1815
1816/*
1817 * This type is implemented using Utf8_2,
Lev Walkinc3808c12004-09-23 22:14:58 +00001818 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001819 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001820
1821/*** <<< STAT-DEFS [Utf8-3] >>> ***/
1822
Lev Walkina7591b52014-10-12 18:37:35 -07001823static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001824 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001825};
Lev Walkindfae9752004-09-29 13:19:37 +00001826asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001827 "Utf8-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001828 "Utf8-3",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001829 UTF8String_free,
1830 UTF8String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001831 Utf8_3_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001832 UTF8String_decode_ber,
1833 UTF8String_encode_der,
1834 UTF8String_decode_xer,
1835 UTF8String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001836 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001837 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001838 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001839 asn_DEF_Utf8_3_tags_1,
1840 sizeof(asn_DEF_Utf8_3_tags_1)
1841 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
1842 asn_DEF_Utf8_3_tags_1, /* Same as above */
1843 sizeof(asn_DEF_Utf8_3_tags_1)
1844 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001845 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001846 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001847 0, 0, /* No members */
1848 0 /* No specifics */
1849};
1850
1851
1852/*** <<< INCLUDES [Utf8-2] >>> ***/
1853
Lev Walkin22b5ed42006-09-13 02:51:20 +00001854#include "Utf8-1.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001855
1856/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
1857
Lev Walkin006de1c2004-08-20 13:37:45 +00001858typedef Utf8_1_t Utf8_2_t;
1859
Lev Walkin006de1c2004-08-20 13:37:45 +00001860/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
1861
Lev Walkindfae9752004-09-29 13:19:37 +00001862extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001863asn_struct_free_f Utf8_2_free;
1864asn_struct_print_f Utf8_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001865asn_constr_check_f Utf8_2_constraint;
1866ber_type_decoder_f Utf8_2_decode_ber;
1867der_type_encoder_f Utf8_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001868xer_type_decoder_f Utf8_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001869xer_type_encoder_f Utf8_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001870
1871/*** <<< CODE [Utf8-2] >>> ***/
1872
1873int
Lev Walkindfae9752004-09-29 13:19:37 +00001874Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001875 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001876 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001877 size_t size;
1878
1879 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001880 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001881 "%s: value not given (%s:%d)",
1882 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001883 return -1;
1884 }
1885
Lev Walkinfac2e942004-10-02 16:33:46 +00001886 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00001887 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001888 ASN__CTFAIL(app_key, td, sptr,
Lev Walkinfac2e942004-10-02 16:33:46 +00001889 "%s: UTF-8: broken encoding (%s:%d)",
1890 td->name, __FILE__, __LINE__);
1891 return -1;
1892 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001893
1894 if((size >= 1 && size <= 2)) {
1895 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001896 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001897 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001898 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001899 "%s: constraint failed (%s:%d)",
1900 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001901 return -1;
1902 }
1903}
1904
1905/*
1906 * This type is implemented using Utf8_1,
Lev Walkinc3808c12004-09-23 22:14:58 +00001907 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001908 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001909
1910/*** <<< STAT-DEFS [Utf8-2] >>> ***/
1911
Lev Walkina7591b52014-10-12 18:37:35 -07001912static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001913 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001914};
Lev Walkindfae9752004-09-29 13:19:37 +00001915asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001916 "Utf8-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001917 "Utf8-2",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001918 UTF8String_free,
1919 UTF8String_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001920 Utf8_2_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001921 UTF8String_decode_ber,
1922 UTF8String_encode_der,
1923 UTF8String_decode_xer,
1924 UTF8String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001925 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001926 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001927 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001928 asn_DEF_Utf8_2_tags_1,
1929 sizeof(asn_DEF_Utf8_2_tags_1)
1930 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
1931 asn_DEF_Utf8_2_tags_1, /* Same as above */
1932 sizeof(asn_DEF_Utf8_2_tags_1)
1933 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001934 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001935 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001936 0, 0, /* No members */
1937 0 /* No specifics */
1938};
1939
1940
1941/*** <<< INCLUDES [Utf8-1] >>> ***/
1942
1943#include <UTF8String.h>
1944
1945/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
1946
Lev Walkin006de1c2004-08-20 13:37:45 +00001947typedef UTF8String_t Utf8_1_t;
1948
Lev Walkin006de1c2004-08-20 13:37:45 +00001949/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
1950
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001951extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
1952asn_struct_free_f Utf8_1_free;
1953asn_struct_print_f Utf8_1_print;
1954asn_constr_check_f Utf8_1_constraint;
1955ber_type_decoder_f Utf8_1_decode_ber;
1956der_type_encoder_f Utf8_1_encode_der;
1957xer_type_decoder_f Utf8_1_decode_xer;
1958xer_type_encoder_f Utf8_1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001959
1960/*** <<< CODE [Utf8-1] >>> ***/
1961
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001962/*
1963 * This type is implemented using UTF8String,
1964 * so here we adjust the DEF accordingly.
1965 */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001966
1967/*** <<< STAT-DEFS [Utf8-1] >>> ***/
1968
Lev Walkina7591b52014-10-12 18:37:35 -07001969static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001970 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
1971};
1972asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
1973 "Utf8-1",
1974 "Utf8-1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08001975 UTF8String_free,
1976 UTF8String_print,
1977 UTF8String_constraint,
1978 UTF8String_decode_ber,
1979 UTF8String_encode_der,
1980 UTF8String_decode_xer,
1981 UTF8String_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001982 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001983 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001984 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001985 asn_DEF_Utf8_1_tags_1,
1986 sizeof(asn_DEF_Utf8_1_tags_1)
1987 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
1988 asn_DEF_Utf8_1_tags_1, /* Same as above */
1989 sizeof(asn_DEF_Utf8_1_tags_1)
1990 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001991 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001992 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001993 0, 0, /* No members */
1994 0 /* No specifics */
1995};
Lev Walkin006de1c2004-08-20 13:37:45 +00001996
Lev Walkine4ca5ce2004-09-15 11:44:13 +00001997
1998/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
1999
Lev Walkin22b5ed42006-09-13 02:51:20 +00002000#include "Identifier.h"
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002001
2002/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
2003
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002004typedef Identifier_t VisibleIdentifier_t;
2005
2006/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
2007
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002008extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
2009asn_struct_free_f VisibleIdentifier_free;
2010asn_struct_print_f VisibleIdentifier_print;
2011asn_constr_check_f VisibleIdentifier_constraint;
2012ber_type_decoder_f VisibleIdentifier_decode_ber;
2013der_type_encoder_f VisibleIdentifier_encode_der;
2014xer_type_decoder_f VisibleIdentifier_decode_xer;
2015xer_type_encoder_f VisibleIdentifier_encode_xer;
2016
2017/*** <<< CTABLES [VisibleIdentifier] >>> ***/
2018
Lev Walkina7591b52014-10-12 18:37:35 -07002019static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00002020 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2021 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2022 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
2023 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
2024 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
202527,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
2026 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
202754,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002028};
2029
Lev Walkine8318b82005-03-06 09:29:03 +00002030static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07002031 const int *table = permitted_alphabet_table_1;
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002032 /* The underlying type is VisibleString */
2033 const VisibleString_t *st = (const VisibleString_t *)sptr;
2034 const uint8_t *ch = st->buf;
2035 const uint8_t *end = ch + st->size;
2036
2037 for(; ch < end; ch++) {
2038 uint8_t cv = *ch;
2039 if(!table[cv]) return -1;
2040 }
2041 return 0;
2042}
2043
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002044
Lev Walkin154aa182004-09-26 13:12:56 +00002045/*** <<< CODE [VisibleIdentifier] >>> ***/
2046
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002047int
2048VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002049 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002050 const Identifier_t *st = (const Identifier_t *)sptr;
2051 size_t size;
2052
2053 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002054 ASN__CTFAIL(app_key, td, sptr,
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002055 "%s: value not given (%s:%d)",
2056 td->name, __FILE__, __LINE__);
2057 return -1;
2058 }
2059
2060 size = st->size;
2061
2062 if((size >= 1 && size <= 32)
Lev Walkine8318b82005-03-06 09:29:03 +00002063 && !check_permitted_alphabet_1(st)) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002064 /* Constraint check succeeded */
2065 return 0;
2066 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002067 ASN__CTFAIL(app_key, td, sptr,
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002068 "%s: constraint failed (%s:%d)",
2069 td->name, __FILE__, __LINE__);
2070 return -1;
2071 }
2072}
2073
2074/*
2075 * This type is implemented using Identifier,
2076 * so here we adjust the DEF accordingly.
2077 */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002078
2079/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
2080
Lev Walkina7591b52014-10-12 18:37:35 -07002081static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002082 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
2083};
2084asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
2085 "VisibleIdentifier",
2086 "VisibleIdentifier",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002087 VisibleString_free,
2088 VisibleString_print,
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002089 VisibleIdentifier_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002090 VisibleString_decode_ber,
2091 VisibleString_encode_der,
2092 VisibleString_decode_xer,
2093 VisibleString_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002094 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002095 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002096 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002097 asn_DEF_VisibleIdentifier_tags_1,
2098 sizeof(asn_DEF_VisibleIdentifier_tags_1)
2099 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
2100 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
2101 sizeof(asn_DEF_VisibleIdentifier_tags_1)
2102 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002103 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002104 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002105 0, 0, /* No members */
2106 0 /* No specifics */
2107};
Lev Walkin154aa182004-09-26 13:12:56 +00002108
2109
Lev Walkin59b176e2005-11-26 11:25:14 +00002110/*** <<< INCLUDES [Sequence] >>> ***/
2111
Lev Walkin22b5ed42006-09-13 02:51:20 +00002112#include "Int1.h"
2113#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002114#include <BOOLEAN.h>
2115#include <ENUMERATED.h>
2116#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00002117#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002118#include <constr_SEQUENCE.h>
2119
2120/*** <<< DEPS [Sequence] >>> ***/
2121
2122typedef enum enum_c {
2123 enum_c_one = 1,
2124 enum_c_two = 2,
2125 /*
2126 * Enumeration is extensible
2127 */
2128 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00002129} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00002130
2131/*** <<< TYPE-DECLS [Sequence] >>> ***/
2132
2133typedef struct Sequence {
2134 Int1_t *int1_c /* DEFAULT 3 */;
2135 Int4_t int4;
2136 Int4_t int4_c;
Lev Walkin2a744a72013-03-27 01:56:23 -07002137 BOOLEAN_t *Bool /* DEFAULT 1 */;
Lev Walkin59b176e2005-11-26 11:25:14 +00002138 ENUMERATED_t enum_c;
2139 NULL_t *null /* OPTIONAL */;
2140 /*
2141 * This type is extensible,
2142 * possible extensions are below.
2143 */
2144 Int5_t *int5_c /* OPTIONAL */;
2145
2146 /* Context for parsing across buffer boundaries */
2147 asn_struct_ctx_t _asn_ctx;
2148} Sequence_t;
2149
2150/*** <<< FUNC-DECLS [Sequence] >>> ***/
2151
2152/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
2153extern asn_TYPE_descriptor_t asn_DEF_Sequence;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002154extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1;
2155extern asn_TYPE_member_t asn_MBR_Sequence_1[7];
Lev Walkin59b176e2005-11-26 11:25:14 +00002156
2157/*** <<< CODE [Sequence] >>> ***/
2158
Lev Walkin59b176e2005-11-26 11:25:14 +00002159/*
2160 * This type is implemented using ENUMERATED,
2161 * so here we adjust the DEF accordingly.
2162 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002163static int
2164memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002165 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002166 const Int1_t *st = (const Int1_t *)sptr;
2167 long value;
2168
2169 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002170 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002171 "%s: value not given (%s:%d)",
2172 td->name, __FILE__, __LINE__);
2173 return -1;
2174 }
2175
2176 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002177 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002178 "%s: value too large (%s:%d)",
2179 td->name, __FILE__, __LINE__);
2180 return -1;
2181 }
2182
2183 if((value >= -2)) {
2184 /* Constraint check succeeded */
2185 return 0;
2186 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002187 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002188 "%s: constraint failed (%s:%d)",
2189 td->name, __FILE__, __LINE__);
2190 return -1;
2191 }
2192}
2193
2194static int
2195memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002196 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002197 const Int4_t *st = (const Int4_t *)sptr;
2198 long value;
2199
2200 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002201 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002202 "%s: value not given (%s:%d)",
2203 td->name, __FILE__, __LINE__);
2204 return -1;
2205 }
2206
2207 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002208 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002209 "%s: value too large (%s:%d)",
2210 td->name, __FILE__, __LINE__);
2211 return -1;
2212 }
2213
2214 if((value >= 5 && value <= 7)) {
2215 /* Constraint check succeeded */
2216 return 0;
2217 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002218 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002219 "%s: constraint failed (%s:%d)",
2220 td->name, __FILE__, __LINE__);
2221 return -1;
2222 }
2223}
2224
2225static int
2226memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002227 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002228 const Int5_t *st = (const Int5_t *)sptr;
2229 long value;
2230
2231 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002232 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002233 "%s: value not given (%s:%d)",
2234 td->name, __FILE__, __LINE__);
2235 return -1;
2236 }
2237
2238 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002239 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002240 "%s: value too large (%s:%d)",
2241 td->name, __FILE__, __LINE__);
2242 return -1;
2243 }
2244
2245 if((value == 5)) {
2246 /* Constraint check succeeded */
2247 return 0;
2248 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002249 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002250 "%s: constraint failed (%s:%d)",
2251 td->name, __FILE__, __LINE__);
2252 return -1;
2253 }
2254}
2255
2256
2257/*** <<< STAT-DEFS [Sequence] >>> ***/
2258
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002259static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002260 Int1_t *st = *sptr;
2261
2262 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002263 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00002264 st = (*sptr = CALLOC(1, sizeof(*st)));
2265 if(!st) return -1;
2266 }
2267
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002268 if(set_value) {
2269 /* Install default value 3 */
2270 return asn_long2INTEGER(st, 3);
2271 } else {
2272 /* Test default value 3 */
2273 long value;
2274 if(asn_INTEGER2long(st, &value))
2275 return -1;
2276 return (value == 3);
2277 }
Lev Walkin59b176e2005-11-26 11:25:14 +00002278}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002279static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002280 BOOLEAN_t *st = *sptr;
2281
2282 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002283 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00002284 st = (*sptr = CALLOC(1, sizeof(*st)));
2285 if(!st) return -1;
2286 }
2287
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002288 if(set_value) {
2289 /* Install default value 1 */
2290 *st = 1;
2291 return 0;
2292 } else {
2293 /* Test default value 1 */
2294 return (*st == 1);
2295 }
Lev Walkin59b176e2005-11-26 11:25:14 +00002296}
Lev Walkina7591b52014-10-12 18:37:35 -07002297static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002298 { 1, 3, "one" },
2299 { 2, 3, "two" },
2300 { 3, 5, "three" }
2301 /* This list is extensible */
2302};
Lev Walkina7591b52014-10-12 18:37:35 -07002303static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002304 0, /* one(1) */
2305 2, /* three(3) */
2306 1 /* two(2) */
2307 /* This list is extensible */
2308};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002309static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002310 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
2311 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
2312 3, /* Number of elements in the maps */
2313 3, /* Extensions before this member */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002314 1, /* Strict enumeration */
2315 0, /* Native long size */
2316 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002317};
Lev Walkina7591b52014-10-12 18:37:35 -07002318static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002319 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2320};
2321static /* Use -fall-defs-global to expose */
2322asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
2323 "enum-c",
2324 "enum-c",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002325 ENUMERATED_free,
2326 ENUMERATED_print,
2327 ENUMERATED_constraint,
2328 ENUMERATED_decode_ber,
2329 ENUMERATED_encode_der,
2330 ENUMERATED_decode_xer,
2331 ENUMERATED_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002332 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002333 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002334 0, /* Use generic outmost tag fetcher */
2335 asn_DEF_enum_c_tags_6,
2336 sizeof(asn_DEF_enum_c_tags_6)
2337 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
2338 asn_DEF_enum_c_tags_6, /* Same as above */
2339 sizeof(asn_DEF_enum_c_tags_6)
2340 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002341 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002342 0, /* No PER visible constraints */
2343 0, 0, /* Defined elsewhere */
2344 &asn_SPC_enum_c_specs_6 /* Additional specs */
2345};
2346
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002347asn_TYPE_member_t asn_MBR_Sequence_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002348 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
2349 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2350 .tag_mode = 0,
2351 .type = &asn_DEF_Int1,
2352 .memb_constraints = memb_int1_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002353 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002354 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2355 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
2356 .name = "int1-c"
2357 },
2358 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
2359 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
2360 .tag_mode = +1, /* EXPLICIT tag at current level */
2361 .type = &asn_DEF_Int4,
2362 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002363 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002364 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2365 .default_value = 0,
2366 .name = "int4"
2367 },
2368 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
2369 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2370 .tag_mode = 0,
2371 .type = &asn_DEF_Int4,
2372 .memb_constraints = memb_int4_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002373 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002374 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2375 .default_value = 0,
2376 .name = "int4-c"
2377 },
Lev Walkin2a744a72013-03-27 01:56:23 -07002378 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +00002379 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
2380 .tag_mode = 0,
2381 .type = &asn_DEF_BOOLEAN,
2382 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002383 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002384 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2385 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
2386 .name = "bool"
2387 },
2388 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
2389 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
2390 .tag_mode = 0,
2391 .type = &asn_DEF_enum_c_6,
2392 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002393 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002394 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2395 .default_value = 0,
2396 .name = "enum-c"
2397 },
2398 { ATF_POINTER, 2, offsetof(struct Sequence, null),
2399 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
2400 .tag_mode = 0,
2401 .type = &asn_DEF_NULL,
2402 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002403 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002404 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2405 .default_value = 0,
2406 .name = "null"
2407 },
2408 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
2409 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
2410 .tag_mode = 0,
2411 .type = &asn_DEF_Int5,
2412 .memb_constraints = memb_int5_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04002413 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002414 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2415 .default_value = 0,
2416 .name = "int5-c"
2417 },
2418};
Lev Walkina7591b52014-10-12 18:37:35 -07002419static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002420 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2421};
Lev Walkina7591b52014-10-12 18:37:35 -07002422static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -07002423 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
2424 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
2425 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
2426 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
2427 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
2428 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
2429 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002430};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002431asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002432 sizeof(struct Sequence),
2433 offsetof(struct Sequence, _asn_ctx),
2434 asn_MAP_Sequence_tag2el_1,
2435 7, /* Count of tags in the map */
2436 0, 0, 0, /* Optional elements (not needed) */
2437 5, /* Start extensions */
2438 8 /* Stop extensions */
2439};
2440asn_TYPE_descriptor_t asn_DEF_Sequence = {
2441 "Sequence",
2442 "Sequence",
2443 SEQUENCE_free,
2444 SEQUENCE_print,
2445 SEQUENCE_constraint,
2446 SEQUENCE_decode_ber,
2447 SEQUENCE_encode_der,
2448 SEQUENCE_decode_xer,
2449 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002450 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002451 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002452 0, /* Use generic outmost tag fetcher */
2453 asn_DEF_Sequence_tags_1,
2454 sizeof(asn_DEF_Sequence_tags_1)
2455 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
2456 asn_DEF_Sequence_tags_1, /* Same as above */
2457 sizeof(asn_DEF_Sequence_tags_1)
2458 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002459 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002460 0, /* No PER visible constraints */
2461 asn_MBR_Sequence_1,
2462 7, /* Elements count */
2463 &asn_SPC_Sequence_specs_1 /* Additional specs */
2464};
2465
2466
2467/*** <<< INCLUDES [SequenceOf] >>> ***/
2468
2469#include <asn_SEQUENCE_OF.h>
2470#include <constr_SEQUENCE_OF.h>
2471
2472/*** <<< FWD-DECLS [SequenceOf] >>> ***/
2473
2474struct Sequence;
2475
2476/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
2477
2478typedef struct SequenceOf {
2479 A_SEQUENCE_OF(struct Sequence) list;
2480
2481 /* Context for parsing across buffer boundaries */
2482 asn_struct_ctx_t _asn_ctx;
2483} SequenceOf_t;
2484
2485/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
2486
2487extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
2488
2489/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
2490
Lev Walkin22b5ed42006-09-13 02:51:20 +00002491#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002492
2493/*** <<< STAT-DEFS [SequenceOf] >>> ***/
2494
2495static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
2496 { ATF_POINTER, 0, 0,
2497 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
2498 .tag_mode = 0,
2499 .type = &asn_DEF_Sequence,
2500 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04002501 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00002502 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
2503 .default_value = 0,
2504 .name = ""
2505 },
2506};
Lev Walkina7591b52014-10-12 18:37:35 -07002507static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002508 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
2509};
2510static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
2511 sizeof(struct SequenceOf),
2512 offsetof(struct SequenceOf, _asn_ctx),
2513 0, /* XER encoding is XMLDelimitedItemList */
2514};
2515asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
2516 "SequenceOf",
2517 "SequenceOf",
2518 SEQUENCE_OF_free,
2519 SEQUENCE_OF_print,
2520 SEQUENCE_OF_constraint,
2521 SEQUENCE_OF_decode_ber,
2522 SEQUENCE_OF_encode_der,
2523 SEQUENCE_OF_decode_xer,
2524 SEQUENCE_OF_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002525 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002526 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002527 0, /* Use generic outmost tag fetcher */
2528 asn_DEF_SequenceOf_tags_1,
2529 sizeof(asn_DEF_SequenceOf_tags_1)
2530 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
2531 asn_DEF_SequenceOf_tags_1, /* Same as above */
2532 sizeof(asn_DEF_SequenceOf_tags_1)
2533 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002534 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002535 0, /* No PER visible constraints */
2536 asn_MBR_SequenceOf_1,
2537 1, /* Single element */
2538 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
2539};
2540
2541
2542/*** <<< INCLUDES [Enum0] >>> ***/
2543
2544#include <ENUMERATED.h>
2545
2546/*** <<< DEPS [Enum0] >>> ***/
2547
2548typedef enum Enum0 {
2549 Enum0_one = 0,
2550 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00002551} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00002552
2553/*** <<< TYPE-DECLS [Enum0] >>> ***/
2554
2555typedef ENUMERATED_t Enum0_t;
2556
2557/*** <<< FUNC-DECLS [Enum0] >>> ***/
2558
2559extern asn_TYPE_descriptor_t asn_DEF_Enum0;
2560asn_struct_free_f Enum0_free;
2561asn_struct_print_f Enum0_print;
2562asn_constr_check_f Enum0_constraint;
2563ber_type_decoder_f Enum0_decode_ber;
2564der_type_encoder_f Enum0_encode_der;
2565xer_type_decoder_f Enum0_decode_xer;
2566xer_type_encoder_f Enum0_encode_xer;
2567
2568/*** <<< CODE [Enum0] >>> ***/
2569
Lev Walkin59b176e2005-11-26 11:25:14 +00002570/*
2571 * This type is implemented using ENUMERATED,
2572 * so here we adjust the DEF accordingly.
2573 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002574
2575/*** <<< STAT-DEFS [Enum0] >>> ***/
2576
Lev Walkina7591b52014-10-12 18:37:35 -07002577static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002578 { 0, 3, "one" },
2579 { 1, 3, "two" }
2580};
Lev Walkina7591b52014-10-12 18:37:35 -07002581static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002582 0, /* one(0) */
2583 1 /* two(1) */
2584};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002585static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002586 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
2587 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
2588 2, /* Number of elements in the maps */
2589 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002590 1, /* Strict enumeration */
2591 0, /* Native long size */
2592 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002593};
Lev Walkina7591b52014-10-12 18:37:35 -07002594static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002595 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2596};
2597asn_TYPE_descriptor_t asn_DEF_Enum0 = {
2598 "Enum0",
2599 "Enum0",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002600 ENUMERATED_free,
2601 ENUMERATED_print,
2602 ENUMERATED_constraint,
2603 ENUMERATED_decode_ber,
2604 ENUMERATED_encode_der,
2605 ENUMERATED_decode_xer,
2606 ENUMERATED_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002607 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002608 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002609 0, /* Use generic outmost tag fetcher */
2610 asn_DEF_Enum0_tags_1,
2611 sizeof(asn_DEF_Enum0_tags_1)
2612 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
2613 asn_DEF_Enum0_tags_1, /* Same as above */
2614 sizeof(asn_DEF_Enum0_tags_1)
2615 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002616 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002617 0, /* No PER visible constraints */
2618 0, 0, /* Defined elsewhere */
2619 &asn_SPC_Enum0_specs_1 /* Additional specs */
2620};
2621
2622
2623/*** <<< INCLUDES [Enum1] >>> ***/
2624
2625#include <NativeEnumerated.h>
2626
2627/*** <<< DEPS [Enum1] >>> ***/
2628
2629typedef enum Enum1 {
2630 Enum1_one = 0,
2631 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00002632} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00002633
2634/*** <<< TYPE-DECLS [Enum1] >>> ***/
2635
2636typedef long Enum1_t;
2637
2638/*** <<< FUNC-DECLS [Enum1] >>> ***/
2639
2640extern asn_TYPE_descriptor_t asn_DEF_Enum1;
2641asn_struct_free_f Enum1_free;
2642asn_struct_print_f Enum1_print;
2643asn_constr_check_f Enum1_constraint;
2644ber_type_decoder_f Enum1_decode_ber;
2645der_type_encoder_f Enum1_encode_der;
2646xer_type_decoder_f Enum1_decode_xer;
2647xer_type_encoder_f Enum1_encode_xer;
2648
2649/*** <<< CODE [Enum1] >>> ***/
2650
2651int
2652Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002653 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002654 long value;
2655
2656 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002657 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002658 "%s: value not given (%s:%d)",
2659 td->name, __FILE__, __LINE__);
2660 return -1;
2661 }
2662
2663 value = *(const long *)sptr;
2664
2665 if((value == 0)) {
2666 /* Constraint check succeeded */
2667 return 0;
2668 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002669 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002670 "%s: constraint failed (%s:%d)",
2671 td->name, __FILE__, __LINE__);
2672 return -1;
2673 }
2674}
2675
2676/*
2677 * This type is implemented using NativeEnumerated,
2678 * so here we adjust the DEF accordingly.
2679 */
Lev Walkin59b176e2005-11-26 11:25:14 +00002680
2681/*** <<< STAT-DEFS [Enum1] >>> ***/
2682
Lev Walkina7591b52014-10-12 18:37:35 -07002683static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002684 { 0, 3, "one" },
2685 { 1, 3, "two" }
2686};
Lev Walkina7591b52014-10-12 18:37:35 -07002687static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002688 0, /* one(0) */
2689 1 /* two(1) */
2690};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002691static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002692 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
2693 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
2694 2, /* Number of elements in the maps */
2695 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002696 1, /* Strict enumeration */
2697 0, /* Native long size */
2698 0
Lev Walkin59b176e2005-11-26 11:25:14 +00002699};
Lev Walkina7591b52014-10-12 18:37:35 -07002700static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002701 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
2702};
2703asn_TYPE_descriptor_t asn_DEF_Enum1 = {
2704 "Enum1",
2705 "Enum1",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002706 NativeEnumerated_free,
2707 NativeEnumerated_print,
Lev Walkin59b176e2005-11-26 11:25:14 +00002708 Enum1_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002709 NativeEnumerated_decode_ber,
2710 NativeEnumerated_encode_der,
2711 NativeEnumerated_decode_xer,
2712 NativeEnumerated_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002713 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002714 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002715 0, /* Use generic outmost tag fetcher */
2716 asn_DEF_Enum1_tags_1,
2717 sizeof(asn_DEF_Enum1_tags_1)
2718 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
2719 asn_DEF_Enum1_tags_1, /* Same as above */
2720 sizeof(asn_DEF_Enum1_tags_1)
2721 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002722 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002723 0, /* No PER visible constraints */
2724 0, 0, /* Defined elsewhere */
2725 &asn_SPC_Enum1_specs_1 /* Additional specs */
2726};
2727
2728
Lev Walkin154aa182004-09-26 13:12:56 +00002729/*** <<< INCLUDES [Identifier] >>> ***/
2730
2731#include <VisibleString.h>
2732
2733/*** <<< TYPE-DECLS [Identifier] >>> ***/
2734
Lev Walkin154aa182004-09-26 13:12:56 +00002735typedef VisibleString_t Identifier_t;
2736
2737/*** <<< FUNC-DECLS [Identifier] >>> ***/
2738
Lev Walkindfae9752004-09-29 13:19:37 +00002739extern asn_TYPE_descriptor_t asn_DEF_Identifier;
Lev Walkin154aa182004-09-26 13:12:56 +00002740asn_struct_free_f Identifier_free;
2741asn_struct_print_f Identifier_print;
2742asn_constr_check_f Identifier_constraint;
2743ber_type_decoder_f Identifier_decode_ber;
2744der_type_encoder_f Identifier_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002745xer_type_decoder_f Identifier_decode_xer;
Lev Walkin154aa182004-09-26 13:12:56 +00002746xer_type_encoder_f Identifier_encode_xer;
2747
2748/*** <<< CTABLES [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002749
Lev Walkina7591b52014-10-12 18:37:35 -07002750static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00002751 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2752 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
2753 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
2754 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
2755 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
275627,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
2757 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
275854,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002759};
2760
Lev Walkine8318b82005-03-06 09:29:03 +00002761static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07002762 const int *table = permitted_alphabet_table_1;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002763 /* The underlying type is VisibleString */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002764 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002765 const uint8_t *ch = st->buf;
2766 const uint8_t *end = ch + st->size;
2767
2768 for(; ch < end; ch++) {
2769 uint8_t cv = *ch;
2770 if(!table[cv]) return -1;
2771 }
2772 return 0;
2773}
2774
2775
Lev Walkin154aa182004-09-26 13:12:56 +00002776/*** <<< CODE [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002777
2778int
Lev Walkindfae9752004-09-29 13:19:37 +00002779Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002780 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002781 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002782 size_t size;
2783
2784 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002785 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002786 "%s: value not given (%s:%d)",
2787 td->name, __FILE__, __LINE__);
2788 return -1;
2789 }
2790
2791 size = st->size;
2792
2793 if((size >= 1 && size <= 32)
Lev Walkine8318b82005-03-06 09:29:03 +00002794 && !check_permitted_alphabet_1(st)) {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002795 /* Constraint check succeeded */
2796 return 0;
2797 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002798 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002799 "%s: constraint failed (%s:%d)",
2800 td->name, __FILE__, __LINE__);
2801 return -1;
2802 }
2803}
2804
2805/*
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002806 * This type is implemented using VisibleString,
Lev Walkinc3808c12004-09-23 22:14:58 +00002807 * so here we adjust the DEF accordingly.
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002808 */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002809
2810/*** <<< STAT-DEFS [Identifier] >>> ***/
2811
Lev Walkina7591b52014-10-12 18:37:35 -07002812static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002813 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
2814};
Lev Walkindfae9752004-09-29 13:19:37 +00002815asn_TYPE_descriptor_t asn_DEF_Identifier = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002816 "Identifier",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002817 "Identifier",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002818 VisibleString_free,
2819 VisibleString_print,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002820 Identifier_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +08002821 VisibleString_decode_ber,
2822 VisibleString_encode_der,
2823 VisibleString_decode_xer,
2824 VisibleString_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002825 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002826 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002827 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002828 asn_DEF_Identifier_tags_1,
2829 sizeof(asn_DEF_Identifier_tags_1)
2830 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
2831 asn_DEF_Identifier_tags_1, /* Same as above */
2832 sizeof(asn_DEF_Identifier_tags_1)
2833 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002834 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002835 0, /* No PER visible constraints */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002836 0, 0, /* No members */
2837 0 /* No specifics */
2838};
2839