blob: d17d448a650d803d9ab0257a91d661804430b4a3 [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 +000023int
24Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000025 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +000026 /* Replace with underlying type checker */
27 td->check_constraints = asn_DEF_INTEGER.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +000028 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkincaf0d5a2005-03-04 23:48:19 +000029}
30
31/*
32 * This type is implemented using INTEGER,
33 * so here we adjust the DEF accordingly.
34 */
35static void
Lev Walkine8318b82005-03-06 09:29:03 +000036Int1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +000037 td->free_struct = asn_DEF_INTEGER.free_struct;
38 td->print_struct = asn_DEF_INTEGER.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -080039 td->check_constraints = asn_DEF_INTEGER.check_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +000040 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
41 td->der_encoder = asn_DEF_INTEGER.der_encoder;
42 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
43 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +000044 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000045 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -070046 td->oer_decoder = asn_DEF_INTEGER.oer_decoder;
47 td->oer_encoder = asn_DEF_INTEGER.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +040048 if(!td->oer_constraints)
49 td->oer_constraints = asn_DEF_INTEGER.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +000050 if(!td->per_constraints)
51 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +000052 td->elements = asn_DEF_INTEGER.elements;
53 td->elements_count = asn_DEF_INTEGER.elements_count;
54 td->specifics = asn_DEF_INTEGER.specifics;
55}
56
57void
58Int1_free(asn_TYPE_descriptor_t *td,
59 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +000060 Int1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +000061 td->free_struct(td, struct_ptr, contents_only);
62}
63
64int
65Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
66 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +000067 Int1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +000068 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
69}
70
71asn_dec_rval_t
72Int1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +000073 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +000074 Int1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +000075 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
76}
77
78asn_enc_rval_t
79Int1_encode_der(asn_TYPE_descriptor_t *td,
80 void *structure, int tag_mode, ber_tlv_tag_t tag,
81 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +000082 Int1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +000083 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
84}
85
86asn_dec_rval_t
87Int1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +000088 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +000089 Int1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +000090 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
91}
92
93asn_enc_rval_t
94Int1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
95 int ilevel, enum xer_encoder_flags_e flags,
96 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +000097 Int1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +000098 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
99}
100
101
102/*** <<< STAT-DEFS [Int1] >>> ***/
103
Lev Walkina7591b52014-10-12 18:37:35 -0700104static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000105 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
106};
107asn_TYPE_descriptor_t asn_DEF_Int1 = {
108 "Int1",
109 "Int1",
110 Int1_free,
111 Int1_print,
112 Int1_constraint,
113 Int1_decode_ber,
114 Int1_encode_der,
115 Int1_decode_xer,
116 Int1_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700117 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400118 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000119 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000120 asn_DEF_Int1_tags_1,
121 sizeof(asn_DEF_Int1_tags_1)
122 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
123 asn_DEF_Int1_tags_1, /* Same as above */
124 sizeof(asn_DEF_Int1_tags_1)
125 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400126 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000127 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000128 0, 0, /* No members */
129 0 /* No specifics */
130};
Lev Walkin006de1c2004-08-20 13:37:45 +0000131
132
133/*** <<< INCLUDES [Int2] >>> ***/
134
Lev Walkin22b5ed42006-09-13 02:51:20 +0000135#include "Int1.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000136
137/*** <<< TYPE-DECLS [Int2] >>> ***/
138
Lev Walkin006de1c2004-08-20 13:37:45 +0000139typedef Int1_t Int2_t;
140
Lev Walkin006de1c2004-08-20 13:37:45 +0000141/*** <<< FUNC-DECLS [Int2] >>> ***/
142
Lev Walkindfae9752004-09-29 13:19:37 +0000143extern asn_TYPE_descriptor_t asn_DEF_Int2;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000144asn_struct_free_f Int2_free;
145asn_struct_print_f Int2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000146asn_constr_check_f Int2_constraint;
147ber_type_decoder_f Int2_decode_ber;
148der_type_encoder_f Int2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000149xer_type_decoder_f Int2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000150xer_type_encoder_f Int2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000151
152/*** <<< CODE [Int2] >>> ***/
153
154int
Lev Walkindfae9752004-09-29 13:19:37 +0000155Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000156 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000157 const Int1_t *st = (const Int1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000158 long value;
159
160 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700161 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000162 "%s: value not given (%s:%d)",
163 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000164 return -1;
165 }
166
Lev Walkin44467432004-09-07 06:43:57 +0000167 /* Check if the sign bit is present */
168 value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000169
170 if((value >= 0)) {
171 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000172 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000173 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700174 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000175 "%s: constraint failed (%s:%d)",
176 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000177 return -1;
178 }
179}
180
181/*
182 * This type is implemented using Int1,
Lev Walkinc3808c12004-09-23 22:14:58 +0000183 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000184 */
185static void
Lev Walkine8318b82005-03-06 09:29:03 +0000186Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000187 td->free_struct = asn_DEF_Int1.free_struct;
188 td->print_struct = asn_DEF_Int1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800189 td->check_constraints = asn_DEF_Int1.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000190 td->ber_decoder = asn_DEF_Int1.ber_decoder;
191 td->der_encoder = asn_DEF_Int1.der_encoder;
192 td->xer_decoder = asn_DEF_Int1.xer_decoder;
193 td->xer_encoder = asn_DEF_Int1.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000194 td->uper_decoder = asn_DEF_Int1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000195 td->uper_encoder = asn_DEF_Int1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700196 td->oer_decoder = asn_DEF_Int1.oer_decoder;
197 td->oer_encoder = asn_DEF_Int1.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400198 if(!td->oer_constraints)
199 td->oer_constraints = asn_DEF_Int1.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000200 if(!td->per_constraints)
201 td->per_constraints = asn_DEF_Int1.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000202 td->elements = asn_DEF_Int1.elements;
203 td->elements_count = asn_DEF_Int1.elements_count;
204 td->specifics = asn_DEF_Int1.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000205}
206
Lev Walkina9cc46e2004-09-22 16:06:28 +0000207void
Lev Walkindfae9752004-09-29 13:19:37 +0000208Int2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000209 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +0000210 Int2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000211 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000212}
213
214int
Lev Walkindfae9752004-09-29 13:19:37 +0000215Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000216 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000217 Int2_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000218 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
219}
220
Lev Walkindc06f6b2004-10-20 15:50:55 +0000221asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000222Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000223 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +0000224 Int2_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000225 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000226}
227
228asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000229Int2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000230 void *structure, int tag_mode, ber_tlv_tag_t tag,
231 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000232 Int2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000233 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
234}
235
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000236asn_dec_rval_t
237Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000238 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +0000239 Int2_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000240 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
241}
242
Lev Walkina9cc46e2004-09-22 16:06:28 +0000243asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000244Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000245 int ilevel, enum xer_encoder_flags_e flags,
246 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000247 Int2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000248 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000249}
250
251
252/*** <<< STAT-DEFS [Int2] >>> ***/
253
Lev Walkina7591b52014-10-12 18:37:35 -0700254static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000255 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000256};
Lev Walkindfae9752004-09-29 13:19:37 +0000257asn_TYPE_descriptor_t asn_DEF_Int2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000258 "Int2",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000259 "Int2",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000260 Int2_free,
261 Int2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000262 Int2_constraint,
263 Int2_decode_ber,
264 Int2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000265 Int2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000266 Int2_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700267 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400268 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000269 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000270 asn_DEF_Int2_tags_1,
271 sizeof(asn_DEF_Int2_tags_1)
272 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
273 asn_DEF_Int2_tags_1, /* Same as above */
274 sizeof(asn_DEF_Int2_tags_1)
275 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400276 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000277 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000278 0, 0, /* No members */
279 0 /* No specifics */
280};
281
282
283/*** <<< INCLUDES [Int3] >>> ***/
284
Lev Walkin22b5ed42006-09-13 02:51:20 +0000285#include "Int2.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000286
287/*** <<< TYPE-DECLS [Int3] >>> ***/
288
Lev Walkin006de1c2004-08-20 13:37:45 +0000289typedef Int2_t Int3_t;
290
Lev Walkin006de1c2004-08-20 13:37:45 +0000291/*** <<< FUNC-DECLS [Int3] >>> ***/
292
Lev Walkindfae9752004-09-29 13:19:37 +0000293extern asn_TYPE_descriptor_t asn_DEF_Int3;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000294asn_struct_free_f Int3_free;
295asn_struct_print_f Int3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000296asn_constr_check_f Int3_constraint;
297ber_type_decoder_f Int3_decode_ber;
298der_type_encoder_f Int3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000299xer_type_decoder_f Int3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000300xer_type_encoder_f Int3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000301
302/*** <<< CODE [Int3] >>> ***/
303
304int
Lev Walkindfae9752004-09-29 13:19:37 +0000305Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000306 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000307 const Int2_t *st = (const Int2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000308 long value;
309
310 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700311 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000312 "%s: value not given (%s:%d)",
313 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000314 return -1;
315 }
316
Lev Walkindfae9752004-09-29 13:19:37 +0000317 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700318 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000319 "%s: value too large (%s:%d)",
320 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000321 return -1;
322 }
323
324 if((value >= 0 && value <= 10)) {
325 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000326 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000327 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700328 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000329 "%s: constraint failed (%s:%d)",
330 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000331 return -1;
332 }
333}
334
335/*
336 * This type is implemented using Int2,
Lev Walkinc3808c12004-09-23 22:14:58 +0000337 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000338 */
339static void
Lev Walkine8318b82005-03-06 09:29:03 +0000340Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000341 td->free_struct = asn_DEF_Int2.free_struct;
342 td->print_struct = asn_DEF_Int2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800343 td->check_constraints = asn_DEF_Int2.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000344 td->ber_decoder = asn_DEF_Int2.ber_decoder;
345 td->der_encoder = asn_DEF_Int2.der_encoder;
346 td->xer_decoder = asn_DEF_Int2.xer_decoder;
347 td->xer_encoder = asn_DEF_Int2.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000348 td->uper_decoder = asn_DEF_Int2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000349 td->uper_encoder = asn_DEF_Int2.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700350 td->oer_decoder = asn_DEF_Int2.oer_decoder;
351 td->oer_encoder = asn_DEF_Int2.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400352 if(!td->oer_constraints)
353 td->oer_constraints = asn_DEF_Int2.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000354 if(!td->per_constraints)
355 td->per_constraints = asn_DEF_Int2.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000356 td->elements = asn_DEF_Int2.elements;
357 td->elements_count = asn_DEF_Int2.elements_count;
358 td->specifics = asn_DEF_Int2.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000359}
360
Lev Walkina9cc46e2004-09-22 16:06:28 +0000361void
Lev Walkindfae9752004-09-29 13:19:37 +0000362Int3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000363 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +0000364 Int3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000365 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000366}
367
368int
Lev Walkindfae9752004-09-29 13:19:37 +0000369Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000370 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000371 Int3_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000372 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
373}
374
Lev Walkindc06f6b2004-10-20 15:50:55 +0000375asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000376Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000377 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +0000378 Int3_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000379 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000380}
381
382asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000383Int3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000384 void *structure, int tag_mode, ber_tlv_tag_t tag,
385 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000386 Int3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000387 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
388}
389
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000390asn_dec_rval_t
391Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000392 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +0000393 Int3_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000394 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
395}
396
Lev Walkina9cc46e2004-09-22 16:06:28 +0000397asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000398Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000399 int ilevel, enum xer_encoder_flags_e flags,
400 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000401 Int3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000402 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000403}
404
405
406/*** <<< STAT-DEFS [Int3] >>> ***/
407
Lev Walkina7591b52014-10-12 18:37:35 -0700408static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000409 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000410};
Lev Walkindfae9752004-09-29 13:19:37 +0000411asn_TYPE_descriptor_t asn_DEF_Int3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000412 "Int3",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000413 "Int3",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000414 Int3_free,
415 Int3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000416 Int3_constraint,
417 Int3_decode_ber,
418 Int3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000419 Int3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000420 Int3_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700421 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400422 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000423 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000424 asn_DEF_Int3_tags_1,
425 sizeof(asn_DEF_Int3_tags_1)
426 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
427 asn_DEF_Int3_tags_1, /* Same as above */
428 sizeof(asn_DEF_Int3_tags_1)
429 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400430 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000431 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000432 0, 0, /* No members */
433 0 /* No specifics */
434};
435
436
437/*** <<< INCLUDES [Int4] >>> ***/
438
Lev Walkin22b5ed42006-09-13 02:51:20 +0000439#include "Int3.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000440
441/*** <<< TYPE-DECLS [Int4] >>> ***/
442
Lev Walkin006de1c2004-08-20 13:37:45 +0000443typedef Int3_t Int4_t;
444
Lev Walkin006de1c2004-08-20 13:37:45 +0000445/*** <<< FUNC-DECLS [Int4] >>> ***/
446
Lev Walkindfae9752004-09-29 13:19:37 +0000447extern asn_TYPE_descriptor_t asn_DEF_Int4;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000448asn_struct_free_f Int4_free;
449asn_struct_print_f Int4_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000450asn_constr_check_f Int4_constraint;
451ber_type_decoder_f Int4_decode_ber;
452der_type_encoder_f Int4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000453xer_type_decoder_f Int4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000454xer_type_encoder_f Int4_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000455
456/*** <<< CODE [Int4] >>> ***/
457
458int
Lev Walkindfae9752004-09-29 13:19:37 +0000459Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000460 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000461 const Int3_t *st = (const Int3_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000462 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000463
464 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700465 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000466 "%s: value not given (%s:%d)",
467 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000468 return -1;
469 }
470
Lev Walkindfae9752004-09-29 13:19:37 +0000471 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700472 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000473 "%s: value too large (%s:%d)",
474 td->name, __FILE__, __LINE__);
475 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000476 }
477
Lev Walkind35c8b52004-08-25 02:08:08 +0000478 if((value >= 1 && value <= 10)) {
479 /* Constraint check succeeded */
480 return 0;
481 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700482 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000483 "%s: constraint failed (%s:%d)",
484 td->name, __FILE__, __LINE__);
485 return -1;
486 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000487}
488
489/*
490 * This type is implemented using Int3,
Lev Walkinc3808c12004-09-23 22:14:58 +0000491 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000492 */
493static void
Lev Walkine8318b82005-03-06 09:29:03 +0000494Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000495 td->free_struct = asn_DEF_Int3.free_struct;
496 td->print_struct = asn_DEF_Int3.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800497 td->check_constraints = asn_DEF_Int3.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000498 td->ber_decoder = asn_DEF_Int3.ber_decoder;
499 td->der_encoder = asn_DEF_Int3.der_encoder;
500 td->xer_decoder = asn_DEF_Int3.xer_decoder;
501 td->xer_encoder = asn_DEF_Int3.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000502 td->uper_decoder = asn_DEF_Int3.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000503 td->uper_encoder = asn_DEF_Int3.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700504 td->oer_decoder = asn_DEF_Int3.oer_decoder;
505 td->oer_encoder = asn_DEF_Int3.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400506 if(!td->oer_constraints)
507 td->oer_constraints = asn_DEF_Int3.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000508 if(!td->per_constraints)
509 td->per_constraints = asn_DEF_Int3.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000510 td->elements = asn_DEF_Int3.elements;
511 td->elements_count = asn_DEF_Int3.elements_count;
512 td->specifics = asn_DEF_Int3.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000513}
514
Lev Walkina9cc46e2004-09-22 16:06:28 +0000515void
Lev Walkindfae9752004-09-29 13:19:37 +0000516Int4_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000517 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +0000518 Int4_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000519 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000520}
521
522int
Lev Walkindfae9752004-09-29 13:19:37 +0000523Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000524 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000525 Int4_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000526 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
527}
528
Lev Walkindc06f6b2004-10-20 15:50:55 +0000529asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000530Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000531 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +0000532 Int4_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000533 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000534}
535
536asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000537Int4_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000538 void *structure, int tag_mode, ber_tlv_tag_t tag,
539 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000540 Int4_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000541 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
542}
543
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000544asn_dec_rval_t
545Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000546 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +0000547 Int4_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000548 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
549}
550
Lev Walkina9cc46e2004-09-22 16:06:28 +0000551asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000552Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000553 int ilevel, enum xer_encoder_flags_e flags,
554 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000555 Int4_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000556 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000557}
558
559
560/*** <<< STAT-DEFS [Int4] >>> ***/
561
Lev Walkina7591b52014-10-12 18:37:35 -0700562static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000563 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000564};
Lev Walkindfae9752004-09-29 13:19:37 +0000565asn_TYPE_descriptor_t asn_DEF_Int4 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000566 "Int4",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000567 "Int4",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000568 Int4_free,
569 Int4_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000570 Int4_constraint,
571 Int4_decode_ber,
572 Int4_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000573 Int4_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000574 Int4_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700575 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400576 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000577 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000578 asn_DEF_Int4_tags_1,
579 sizeof(asn_DEF_Int4_tags_1)
580 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
581 asn_DEF_Int4_tags_1, /* Same as above */
582 sizeof(asn_DEF_Int4_tags_1)
583 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400584 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000585 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000586 0, 0, /* No members */
587 0 /* No specifics */
588};
589
590
591/*** <<< INCLUDES [Int5] >>> ***/
592
Lev Walkin22b5ed42006-09-13 02:51:20 +0000593#include "Int4.h"
Lev Walkin006de1c2004-08-20 13:37:45 +0000594
595/*** <<< TYPE-DECLS [Int5] >>> ***/
596
Lev Walkin006de1c2004-08-20 13:37:45 +0000597typedef Int4_t Int5_t;
598
Lev Walkin006de1c2004-08-20 13:37:45 +0000599/*** <<< FUNC-DECLS [Int5] >>> ***/
600
Lev Walkindfae9752004-09-29 13:19:37 +0000601extern asn_TYPE_descriptor_t asn_DEF_Int5;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000602asn_struct_free_f Int5_free;
603asn_struct_print_f Int5_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000604asn_constr_check_f Int5_constraint;
605ber_type_decoder_f Int5_decode_ber;
606der_type_encoder_f Int5_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000607xer_type_decoder_f Int5_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000608xer_type_encoder_f Int5_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000609
610/*** <<< CODE [Int5] >>> ***/
611
612int
Lev Walkindfae9752004-09-29 13:19:37 +0000613Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000614 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000615 const Int4_t *st = (const Int4_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000616 long value;
617
618 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700619 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000620 "%s: value not given (%s:%d)",
621 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000622 return -1;
623 }
624
Lev Walkindfae9752004-09-29 13:19:37 +0000625 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700626 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000627 "%s: value too large (%s:%d)",
628 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000629 return -1;
630 }
631
632 if((value == 5)) {
633 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000634 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000635 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700636 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000637 "%s: constraint failed (%s:%d)",
638 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000639 return -1;
640 }
641}
642
643/*
644 * This type is implemented using Int4,
Lev Walkinc3808c12004-09-23 22:14:58 +0000645 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000646 */
647static void
Lev Walkine8318b82005-03-06 09:29:03 +0000648Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000649 td->free_struct = asn_DEF_Int4.free_struct;
650 td->print_struct = asn_DEF_Int4.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800651 td->check_constraints = asn_DEF_Int4.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000652 td->ber_decoder = asn_DEF_Int4.ber_decoder;
653 td->der_encoder = asn_DEF_Int4.der_encoder;
654 td->xer_decoder = asn_DEF_Int4.xer_decoder;
655 td->xer_encoder = asn_DEF_Int4.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000656 td->uper_decoder = asn_DEF_Int4.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000657 td->uper_encoder = asn_DEF_Int4.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700658 td->oer_decoder = asn_DEF_Int4.oer_decoder;
659 td->oer_encoder = asn_DEF_Int4.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400660 if(!td->oer_constraints)
661 td->oer_constraints = asn_DEF_Int4.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000662 if(!td->per_constraints)
663 td->per_constraints = asn_DEF_Int4.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000664 td->elements = asn_DEF_Int4.elements;
665 td->elements_count = asn_DEF_Int4.elements_count;
666 td->specifics = asn_DEF_Int4.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000667}
668
Lev Walkina9cc46e2004-09-22 16:06:28 +0000669void
Lev Walkindfae9752004-09-29 13:19:37 +0000670Int5_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000671 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +0000672 Int5_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000673 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000674}
675
676int
Lev Walkindfae9752004-09-29 13:19:37 +0000677Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000678 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000679 Int5_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000680 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
681}
682
Lev Walkindc06f6b2004-10-20 15:50:55 +0000683asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000684Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000685 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +0000686 Int5_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000687 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000688}
689
690asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000691Int5_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000692 void *structure, int tag_mode, ber_tlv_tag_t tag,
693 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000694 Int5_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000695 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
696}
697
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000698asn_dec_rval_t
699Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000700 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +0000701 Int5_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000702 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
703}
704
Lev Walkina9cc46e2004-09-22 16:06:28 +0000705asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000706Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000707 int ilevel, enum xer_encoder_flags_e flags,
708 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000709 Int5_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000710 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000711}
712
713
714/*** <<< STAT-DEFS [Int5] >>> ***/
715
Lev Walkina7591b52014-10-12 18:37:35 -0700716static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000717 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000718};
Lev Walkindfae9752004-09-29 13:19:37 +0000719asn_TYPE_descriptor_t asn_DEF_Int5 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000720 "Int5",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000721 "Int5",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000722 Int5_free,
723 Int5_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000724 Int5_constraint,
725 Int5_decode_ber,
726 Int5_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000727 Int5_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000728 Int5_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700729 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400730 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000731 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000732 asn_DEF_Int5_tags_1,
733 sizeof(asn_DEF_Int5_tags_1)
734 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
735 asn_DEF_Int5_tags_1, /* Same as above */
736 sizeof(asn_DEF_Int5_tags_1)
737 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400738 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000739 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000740 0, 0, /* No members */
741 0 /* No specifics */
742};
743
744
745/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
746
747#include <INTEGER.h>
748
749/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
750
Lev Walkin006de1c2004-08-20 13:37:45 +0000751typedef INTEGER_t ExtensibleExtensions_t;
752
Lev Walkin006de1c2004-08-20 13:37:45 +0000753/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
754
Lev Walkindfae9752004-09-29 13:19:37 +0000755extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000756asn_struct_free_f ExtensibleExtensions_free;
757asn_struct_print_f ExtensibleExtensions_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000758asn_constr_check_f ExtensibleExtensions_constraint;
759ber_type_decoder_f ExtensibleExtensions_decode_ber;
760der_type_encoder_f ExtensibleExtensions_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000761xer_type_decoder_f ExtensibleExtensions_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000762xer_type_encoder_f ExtensibleExtensions_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000763
764/*** <<< CODE [ExtensibleExtensions] >>> ***/
765
766int
Lev Walkindfae9752004-09-29 13:19:37 +0000767ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000768 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000769 const INTEGER_t *st = (const INTEGER_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000770 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000771
772 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700773 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +0000774 "%s: value not given (%s:%d)",
775 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000776 return -1;
777 }
778
Lev Walkindfae9752004-09-29 13:19:37 +0000779 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700780 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000781 "%s: value too large (%s:%d)",
782 td->name, __FILE__, __LINE__);
783 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000784 }
785
Lev Walkind35c8b52004-08-25 02:08:08 +0000786 if((value >= 1 && value <= 256)) {
787 /* Constraint check succeeded */
788 return 0;
789 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700790 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +0000791 "%s: constraint failed (%s:%d)",
792 td->name, __FILE__, __LINE__);
793 return -1;
794 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000795}
796
797/*
798 * This type is implemented using INTEGER,
Lev Walkinc3808c12004-09-23 22:14:58 +0000799 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000800 */
801static void
Lev Walkine8318b82005-03-06 09:29:03 +0000802ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000803 td->free_struct = asn_DEF_INTEGER.free_struct;
804 td->print_struct = asn_DEF_INTEGER.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800805 td->check_constraints = asn_DEF_INTEGER.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000806 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
807 td->der_encoder = asn_DEF_INTEGER.der_encoder;
808 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
809 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000810 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000811 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700812 td->oer_decoder = asn_DEF_INTEGER.oer_decoder;
813 td->oer_encoder = asn_DEF_INTEGER.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400814 if(!td->oer_constraints)
815 td->oer_constraints = asn_DEF_INTEGER.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000816 if(!td->per_constraints)
817 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +0000818 td->elements = asn_DEF_INTEGER.elements;
819 td->elements_count = asn_DEF_INTEGER.elements_count;
820 td->specifics = asn_DEF_INTEGER.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000821}
822
Lev Walkina9cc46e2004-09-22 16:06:28 +0000823void
Lev Walkindfae9752004-09-29 13:19:37 +0000824ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000825 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +0000826 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000827 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000828}
829
830int
Lev Walkindfae9752004-09-29 13:19:37 +0000831ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000832 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000833 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000834 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
835}
836
Lev Walkindc06f6b2004-10-20 15:50:55 +0000837asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000838ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000839 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +0000840 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000841 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000842}
843
844asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000845ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000846 void *structure, int tag_mode, ber_tlv_tag_t tag,
847 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000848 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000849 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
850}
851
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000852asn_dec_rval_t
853ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000854 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +0000855 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000856 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
857}
858
Lev Walkina9cc46e2004-09-22 16:06:28 +0000859asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000860ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000861 int ilevel, enum xer_encoder_flags_e flags,
862 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000863 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000864 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000865}
866
867
868/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
869
Lev Walkina7591b52014-10-12 18:37:35 -0700870static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000871 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
872};
Lev Walkindfae9752004-09-29 13:19:37 +0000873asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000874 "ExtensibleExtensions",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000875 "ExtensibleExtensions",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000876 ExtensibleExtensions_free,
877 ExtensibleExtensions_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000878 ExtensibleExtensions_constraint,
879 ExtensibleExtensions_decode_ber,
880 ExtensibleExtensions_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000881 ExtensibleExtensions_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000882 ExtensibleExtensions_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700883 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400884 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +0000885 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000886 asn_DEF_ExtensibleExtensions_tags_1,
887 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
888 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
889 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
890 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
891 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400892 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000893 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +0000894 0, 0, /* No members */
895 0 /* No specifics */
896};
897
898
899/*** <<< INCLUDES [Str1] >>> ***/
900
901#include <IA5String.h>
902
903/*** <<< TYPE-DECLS [Str1] >>> ***/
904
Lev Walkin006de1c2004-08-20 13:37:45 +0000905typedef IA5String_t Str1_t;
906
Lev Walkin006de1c2004-08-20 13:37:45 +0000907/*** <<< FUNC-DECLS [Str1] >>> ***/
908
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000909extern asn_TYPE_descriptor_t asn_DEF_Str1;
910asn_struct_free_f Str1_free;
911asn_struct_print_f Str1_print;
912asn_constr_check_f Str1_constraint;
913ber_type_decoder_f Str1_decode_ber;
914der_type_encoder_f Str1_encode_der;
915xer_type_decoder_f Str1_decode_xer;
916xer_type_encoder_f Str1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000917
918/*** <<< CODE [Str1] >>> ***/
919
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000920int
921Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000922 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000923 /* Replace with underlying type checker */
924 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000925 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000926}
927
928/*
929 * This type is implemented using IA5String,
930 * so here we adjust the DEF accordingly.
931 */
932static void
Lev Walkine8318b82005-03-06 09:29:03 +0000933Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000934 td->free_struct = asn_DEF_IA5String.free_struct;
935 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800936 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000937 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
938 td->der_encoder = asn_DEF_IA5String.der_encoder;
939 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
940 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000941 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000942 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700943 td->oer_decoder = asn_DEF_IA5String.oer_decoder;
944 td->oer_encoder = asn_DEF_IA5String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400945 if(!td->oer_constraints)
946 td->oer_constraints = asn_DEF_IA5String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000947 if(!td->per_constraints)
948 td->per_constraints = asn_DEF_IA5String.per_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000949 td->elements = asn_DEF_IA5String.elements;
950 td->elements_count = asn_DEF_IA5String.elements_count;
951 td->specifics = asn_DEF_IA5String.specifics;
952}
953
954void
955Str1_free(asn_TYPE_descriptor_t *td,
956 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +0000957 Str1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000958 td->free_struct(td, struct_ptr, contents_only);
959}
960
961int
962Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
963 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000964 Str1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000965 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
966}
967
968asn_dec_rval_t
969Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000970 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +0000971 Str1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000972 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
973}
974
975asn_enc_rval_t
976Str1_encode_der(asn_TYPE_descriptor_t *td,
977 void *structure, int tag_mode, ber_tlv_tag_t tag,
978 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000979 Str1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000980 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
981}
982
983asn_dec_rval_t
984Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000985 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +0000986 Str1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000987 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
988}
989
990asn_enc_rval_t
991Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
992 int ilevel, enum xer_encoder_flags_e flags,
993 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000994 Str1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000995 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
996}
997
998
999/*** <<< STAT-DEFS [Str1] >>> ***/
1000
Lev Walkina7591b52014-10-12 18:37:35 -07001001static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001002 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1003};
1004asn_TYPE_descriptor_t asn_DEF_Str1 = {
1005 "Str1",
1006 "Str1",
1007 Str1_free,
1008 Str1_print,
1009 Str1_constraint,
1010 Str1_decode_ber,
1011 Str1_encode_der,
1012 Str1_decode_xer,
1013 Str1_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001014 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001015 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001016 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001017 asn_DEF_Str1_tags_1,
1018 sizeof(asn_DEF_Str1_tags_1)
1019 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1020 asn_DEF_Str1_tags_1, /* Same as above */
1021 sizeof(asn_DEF_Str1_tags_1)
1022 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001023 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001024 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001025 0, 0, /* No members */
1026 0 /* No specifics */
1027};
Lev Walkin006de1c2004-08-20 13:37:45 +00001028
1029
1030/*** <<< INCLUDES [Str2] >>> ***/
1031
Lev Walkin22b5ed42006-09-13 02:51:20 +00001032#include "Str1.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001033
1034/*** <<< TYPE-DECLS [Str2] >>> ***/
1035
Lev Walkin006de1c2004-08-20 13:37:45 +00001036typedef Str1_t Str2_t;
1037
Lev Walkin006de1c2004-08-20 13:37:45 +00001038/*** <<< FUNC-DECLS [Str2] >>> ***/
1039
Lev Walkindfae9752004-09-29 13:19:37 +00001040extern asn_TYPE_descriptor_t asn_DEF_Str2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001041asn_struct_free_f Str2_free;
1042asn_struct_print_f Str2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001043asn_constr_check_f Str2_constraint;
1044ber_type_decoder_f Str2_decode_ber;
1045der_type_encoder_f Str2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001046xer_type_decoder_f Str2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001047xer_type_encoder_f Str2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001048
1049/*** <<< CTABLES [Str2] >>> ***/
1050
Lev Walkine8318b82005-03-06 09:29:03 +00001051static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001052 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001053 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001054 const uint8_t *ch = st->buf;
1055 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001056
1057 for(; ch < end; ch++) {
1058 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001059 if(!(cv <= 127)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001060 }
Lev Walkin775885e2004-08-22 12:47:03 +00001061 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001062}
1063
1064
1065/*** <<< CODE [Str2] >>> ***/
1066
1067int
Lev Walkindfae9752004-09-29 13:19:37 +00001068Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001069 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001070 const Str1_t *st = (const Str1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001071 size_t size;
1072
1073 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001074 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001075 "%s: value not given (%s:%d)",
1076 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001077 return -1;
1078 }
1079
1080 size = st->size;
1081
1082 if(((size <= 20) || (size >= 25 && size <= 30))
Lev Walkine8318b82005-03-06 09:29:03 +00001083 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001084 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001085 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001086 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001087 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001088 "%s: constraint failed (%s:%d)",
1089 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001090 return -1;
1091 }
1092}
1093
1094/*
1095 * This type is implemented using Str1,
Lev Walkinc3808c12004-09-23 22:14:58 +00001096 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001097 */
1098static void
Lev Walkine8318b82005-03-06 09:29:03 +00001099Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001100 td->free_struct = asn_DEF_Str1.free_struct;
1101 td->print_struct = asn_DEF_Str1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001102 td->check_constraints = asn_DEF_Str1.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001103 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1104 td->der_encoder = asn_DEF_Str1.der_encoder;
1105 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1106 td->xer_encoder = asn_DEF_Str1.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001107 td->uper_decoder = asn_DEF_Str1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001108 td->uper_encoder = asn_DEF_Str1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001109 td->oer_decoder = asn_DEF_Str1.oer_decoder;
1110 td->oer_encoder = asn_DEF_Str1.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001111 if(!td->oer_constraints)
1112 td->oer_constraints = asn_DEF_Str1.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001113 if(!td->per_constraints)
1114 td->per_constraints = asn_DEF_Str1.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001115 td->elements = asn_DEF_Str1.elements;
1116 td->elements_count = asn_DEF_Str1.elements_count;
1117 td->specifics = asn_DEF_Str1.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001118}
1119
Lev Walkina9cc46e2004-09-22 16:06:28 +00001120void
Lev Walkindfae9752004-09-29 13:19:37 +00001121Str2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001122 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00001123 Str2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001124 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001125}
1126
1127int
Lev Walkindfae9752004-09-29 13:19:37 +00001128Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001129 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001130 Str2_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001131 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1132}
1133
Lev Walkindc06f6b2004-10-20 15:50:55 +00001134asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001135Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001136 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00001137 Str2_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001138 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001139}
1140
1141asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001142Str2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001143 void *structure, int tag_mode, ber_tlv_tag_t tag,
1144 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001145 Str2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001146 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1147}
1148
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001149asn_dec_rval_t
1150Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001151 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00001152 Str2_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001153 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1154}
1155
Lev Walkina9cc46e2004-09-22 16:06:28 +00001156asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001157Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001158 int ilevel, enum xer_encoder_flags_e flags,
1159 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001160 Str2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001161 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001162}
1163
1164
1165/*** <<< STAT-DEFS [Str2] >>> ***/
1166
Lev Walkina7591b52014-10-12 18:37:35 -07001167static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001168 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001169};
Lev Walkindfae9752004-09-29 13:19:37 +00001170asn_TYPE_descriptor_t asn_DEF_Str2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001171 "Str2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001172 "Str2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001173 Str2_free,
1174 Str2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001175 Str2_constraint,
1176 Str2_decode_ber,
1177 Str2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001178 Str2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001179 Str2_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001180 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001181 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001182 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001183 asn_DEF_Str2_tags_1,
1184 sizeof(asn_DEF_Str2_tags_1)
1185 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1186 asn_DEF_Str2_tags_1, /* Same as above */
1187 sizeof(asn_DEF_Str2_tags_1)
1188 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001189 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001190 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001191 0, 0, /* No members */
1192 0 /* No specifics */
1193};
1194
1195
1196/*** <<< INCLUDES [Str3] >>> ***/
1197
Lev Walkin22b5ed42006-09-13 02:51:20 +00001198#include "Str2.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001199
1200/*** <<< TYPE-DECLS [Str3] >>> ***/
1201
Lev Walkin006de1c2004-08-20 13:37:45 +00001202typedef Str2_t Str3_t;
1203
Lev Walkin006de1c2004-08-20 13:37:45 +00001204/*** <<< FUNC-DECLS [Str3] >>> ***/
1205
Lev Walkindfae9752004-09-29 13:19:37 +00001206extern asn_TYPE_descriptor_t asn_DEF_Str3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001207asn_struct_free_f Str3_free;
1208asn_struct_print_f Str3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001209asn_constr_check_f Str3_constraint;
1210ber_type_decoder_f Str3_decode_ber;
1211der_type_encoder_f Str3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001212xer_type_decoder_f Str3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001213xer_type_encoder_f Str3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001214
1215/*** <<< CTABLES [Str3] >>> ***/
1216
Lev Walkina7591b52014-10-12 18:37:35 -07001217static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001218 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1219 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1220 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1221 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1222 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
1223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1224 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin006de1c2004-08-20 13:37:45 +00001225};
1226
Lev Walkine8318b82005-03-06 09:29:03 +00001227static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07001228 const int *table = permitted_alphabet_table_1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001229 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001230 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001231 const uint8_t *ch = st->buf;
1232 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001233
1234 for(; ch < end; ch++) {
1235 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001236 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001237 }
Lev Walkin775885e2004-08-22 12:47:03 +00001238 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001239}
1240
1241
1242/*** <<< CODE [Str3] >>> ***/
1243
1244int
Lev Walkindfae9752004-09-29 13:19:37 +00001245Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001246 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001247 const Str2_t *st = (const Str2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001248 size_t size;
1249
1250 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001251 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001252 "%s: value not given (%s:%d)",
1253 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001254 return -1;
1255 }
1256
1257 size = st->size;
1258
1259 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
Lev Walkine8318b82005-03-06 09:29:03 +00001260 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001261 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001262 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001263 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001264 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001265 "%s: constraint failed (%s:%d)",
1266 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001267 return -1;
1268 }
1269}
1270
1271/*
1272 * This type is implemented using Str2,
Lev Walkinc3808c12004-09-23 22:14:58 +00001273 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001274 */
1275static void
Lev Walkine8318b82005-03-06 09:29:03 +00001276Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001277 td->free_struct = asn_DEF_Str2.free_struct;
1278 td->print_struct = asn_DEF_Str2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001279 td->check_constraints = asn_DEF_Str2.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001280 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1281 td->der_encoder = asn_DEF_Str2.der_encoder;
1282 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1283 td->xer_encoder = asn_DEF_Str2.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001284 td->uper_decoder = asn_DEF_Str2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001285 td->uper_encoder = asn_DEF_Str2.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001286 td->oer_decoder = asn_DEF_Str2.oer_decoder;
1287 td->oer_encoder = asn_DEF_Str2.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001288 if(!td->oer_constraints)
1289 td->oer_constraints = asn_DEF_Str2.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001290 if(!td->per_constraints)
1291 td->per_constraints = asn_DEF_Str2.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001292 td->elements = asn_DEF_Str2.elements;
1293 td->elements_count = asn_DEF_Str2.elements_count;
1294 td->specifics = asn_DEF_Str2.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001295}
1296
Lev Walkina9cc46e2004-09-22 16:06:28 +00001297void
Lev Walkindfae9752004-09-29 13:19:37 +00001298Str3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001299 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00001300 Str3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001301 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001302}
1303
1304int
Lev Walkindfae9752004-09-29 13:19:37 +00001305Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001306 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001307 Str3_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001308 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1309}
1310
Lev Walkindc06f6b2004-10-20 15:50:55 +00001311asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001312Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001313 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00001314 Str3_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001315 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001316}
1317
1318asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001319Str3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001320 void *structure, int tag_mode, ber_tlv_tag_t tag,
1321 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001322 Str3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001323 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1324}
1325
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001326asn_dec_rval_t
1327Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001328 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00001329 Str3_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001330 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1331}
1332
Lev Walkina9cc46e2004-09-22 16:06:28 +00001333asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001334Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001335 int ilevel, enum xer_encoder_flags_e flags,
1336 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001337 Str3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001338 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001339}
1340
1341
1342/*** <<< STAT-DEFS [Str3] >>> ***/
1343
Lev Walkina7591b52014-10-12 18:37:35 -07001344static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001345 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001346};
Lev Walkindfae9752004-09-29 13:19:37 +00001347asn_TYPE_descriptor_t asn_DEF_Str3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001348 "Str3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001349 "Str3",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001350 Str3_free,
1351 Str3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001352 Str3_constraint,
1353 Str3_decode_ber,
1354 Str3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001355 Str3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001356 Str3_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001357 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001358 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001359 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001360 asn_DEF_Str3_tags_1,
1361 sizeof(asn_DEF_Str3_tags_1)
1362 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1363 asn_DEF_Str3_tags_1, /* Same as above */
1364 sizeof(asn_DEF_Str3_tags_1)
1365 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001366 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001367 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001368 0, 0, /* No members */
1369 0 /* No specifics */
1370};
1371
1372
Lev Walkin8a99bf72004-09-10 06:07:39 +00001373/*** <<< INCLUDES [Str4] >>> ***/
1374
1375#include <IA5String.h>
1376
1377/*** <<< TYPE-DECLS [Str4] >>> ***/
1378
Lev Walkin8a99bf72004-09-10 06:07:39 +00001379typedef IA5String_t Str4_t;
1380
1381/*** <<< FUNC-DECLS [Str4] >>> ***/
1382
Lev Walkindfae9752004-09-29 13:19:37 +00001383extern asn_TYPE_descriptor_t asn_DEF_Str4;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001384asn_struct_free_f Str4_free;
1385asn_struct_print_f Str4_print;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001386asn_constr_check_f Str4_constraint;
1387ber_type_decoder_f Str4_decode_ber;
1388der_type_encoder_f Str4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001389xer_type_decoder_f Str4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001390xer_type_encoder_f Str4_encode_xer;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001391
1392/*** <<< CTABLES [Str4] >>> ***/
1393
Lev Walkine8318b82005-03-06 09:29:03 +00001394static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001395 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001396 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001397 const uint8_t *ch = st->buf;
1398 const uint8_t *end = ch + st->size;
1399
1400 for(; ch < end; ch++) {
1401 uint8_t cv = *ch;
1402 if(!(cv <= 127)) return -1;
1403 }
1404 return 0;
1405}
1406
1407
1408/*** <<< CODE [Str4] >>> ***/
1409
1410int
Lev Walkindfae9752004-09-29 13:19:37 +00001411Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001412 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001413 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001414
1415 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001416 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001417 "%s: value not given (%s:%d)",
1418 td->name, __FILE__, __LINE__);
1419 return -1;
1420 }
1421
1422
Lev Walkine8318b82005-03-06 09:29:03 +00001423 if(!check_permitted_alphabet_1(st)) {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001424 /* Constraint check succeeded */
1425 return 0;
1426 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001427 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001428 "%s: constraint failed (%s:%d)",
1429 td->name, __FILE__, __LINE__);
1430 return -1;
1431 }
1432}
1433
1434/*
1435 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +00001436 * so here we adjust the DEF accordingly.
Lev Walkin8a99bf72004-09-10 06:07:39 +00001437 */
1438static void
Lev Walkine8318b82005-03-06 09:29:03 +00001439Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001440 td->free_struct = asn_DEF_IA5String.free_struct;
1441 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001442 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001443 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1444 td->der_encoder = asn_DEF_IA5String.der_encoder;
1445 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1446 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001447 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001448 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001449 td->oer_decoder = asn_DEF_IA5String.oer_decoder;
1450 td->oer_encoder = asn_DEF_IA5String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001451 if(!td->oer_constraints)
1452 td->oer_constraints = asn_DEF_IA5String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001453 if(!td->per_constraints)
1454 td->per_constraints = asn_DEF_IA5String.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001455 td->elements = asn_DEF_IA5String.elements;
1456 td->elements_count = asn_DEF_IA5String.elements_count;
1457 td->specifics = asn_DEF_IA5String.specifics;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001458}
1459
Lev Walkina9cc46e2004-09-22 16:06:28 +00001460void
Lev Walkindfae9752004-09-29 13:19:37 +00001461Str4_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001462 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00001463 Str4_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001464 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin8a99bf72004-09-10 06:07:39 +00001465}
1466
1467int
Lev Walkindfae9752004-09-29 13:19:37 +00001468Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001469 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001470 Str4_1_inherit_TYPE_descriptor(td);
Lev Walkin8a99bf72004-09-10 06:07:39 +00001471 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1472}
1473
Lev Walkindc06f6b2004-10-20 15:50:55 +00001474asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001475Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001476 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00001477 Str4_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001478 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001479}
1480
1481asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001482Str4_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001483 void *structure, int tag_mode, ber_tlv_tag_t tag,
1484 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001485 Str4_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001486 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1487}
1488
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001489asn_dec_rval_t
1490Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001491 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00001492 Str4_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001493 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1494}
1495
Lev Walkina9cc46e2004-09-22 16:06:28 +00001496asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001497Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001498 int ilevel, enum xer_encoder_flags_e flags,
1499 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001500 Str4_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001501 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin8a99bf72004-09-10 06:07:39 +00001502}
1503
1504
1505/*** <<< STAT-DEFS [Str4] >>> ***/
1506
Lev Walkina7591b52014-10-12 18:37:35 -07001507static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001508 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1509};
Lev Walkindfae9752004-09-29 13:19:37 +00001510asn_TYPE_descriptor_t asn_DEF_Str4 = {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001511 "Str4",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001512 "Str4",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001513 Str4_free,
1514 Str4_print,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001515 Str4_constraint,
1516 Str4_decode_ber,
1517 Str4_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001518 Str4_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001519 Str4_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001520 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001521 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin8a99bf72004-09-10 06:07:39 +00001522 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001523 asn_DEF_Str4_tags_1,
1524 sizeof(asn_DEF_Str4_tags_1)
1525 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1526 asn_DEF_Str4_tags_1, /* Same as above */
1527 sizeof(asn_DEF_Str4_tags_1)
1528 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001529 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001530 0, /* No PER visible constraints */
Lev Walkin8a99bf72004-09-10 06:07:39 +00001531 0, 0, /* No members */
1532 0 /* No specifics */
1533};
1534
1535
Lev Walkin006de1c2004-08-20 13:37:45 +00001536/*** <<< INCLUDES [PER-Visible] >>> ***/
1537
1538#include <IA5String.h>
1539
1540/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1541
Lev Walkin006de1c2004-08-20 13:37:45 +00001542typedef IA5String_t PER_Visible_t;
1543
Lev Walkin006de1c2004-08-20 13:37:45 +00001544/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1545
Lev Walkindfae9752004-09-29 13:19:37 +00001546extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001547asn_struct_free_f PER_Visible_free;
1548asn_struct_print_f PER_Visible_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001549asn_constr_check_f PER_Visible_constraint;
1550ber_type_decoder_f PER_Visible_decode_ber;
1551der_type_encoder_f PER_Visible_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001552xer_type_decoder_f PER_Visible_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001553xer_type_encoder_f PER_Visible_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001554
1555/*** <<< CTABLES [PER-Visible] >>> ***/
1556
Lev Walkine8318b82005-03-06 09:29:03 +00001557static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001558 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001559 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001560 const uint8_t *ch = st->buf;
1561 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001562
1563 for(; ch < end; ch++) {
1564 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001565 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001566 }
Lev Walkin775885e2004-08-22 12:47:03 +00001567 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001568}
1569
1570
1571/*** <<< CODE [PER-Visible] >>> ***/
1572
1573int
Lev Walkindfae9752004-09-29 13:19:37 +00001574PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001575 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001576 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001577
1578 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001579 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001580 "%s: value not given (%s:%d)",
1581 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001582 return -1;
1583 }
1584
1585
Lev Walkine8318b82005-03-06 09:29:03 +00001586 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001587 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001588 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001589 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001590 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001591 "%s: constraint failed (%s:%d)",
1592 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001593 return -1;
1594 }
1595}
1596
1597/*
1598 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +00001599 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001600 */
1601static void
Lev Walkine8318b82005-03-06 09:29:03 +00001602PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001603 td->free_struct = asn_DEF_IA5String.free_struct;
1604 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001605 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001606 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1607 td->der_encoder = asn_DEF_IA5String.der_encoder;
1608 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1609 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001610 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001611 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001612 td->oer_decoder = asn_DEF_IA5String.oer_decoder;
1613 td->oer_encoder = asn_DEF_IA5String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001614 if(!td->oer_constraints)
1615 td->oer_constraints = asn_DEF_IA5String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001616 if(!td->per_constraints)
1617 td->per_constraints = asn_DEF_IA5String.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001618 td->elements = asn_DEF_IA5String.elements;
1619 td->elements_count = asn_DEF_IA5String.elements_count;
1620 td->specifics = asn_DEF_IA5String.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001621}
1622
Lev Walkina9cc46e2004-09-22 16:06:28 +00001623void
Lev Walkindfae9752004-09-29 13:19:37 +00001624PER_Visible_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001625 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00001626 PER_Visible_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001627 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001628}
1629
1630int
Lev Walkindfae9752004-09-29 13:19:37 +00001631PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001632 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001633 PER_Visible_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001634 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1635}
1636
Lev Walkindc06f6b2004-10-20 15:50:55 +00001637asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001638PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001639 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00001640 PER_Visible_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001641 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001642}
1643
1644asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001645PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001646 void *structure, int tag_mode, ber_tlv_tag_t tag,
1647 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001648 PER_Visible_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001649 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1650}
1651
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001652asn_dec_rval_t
1653PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001654 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00001655 PER_Visible_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001656 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1657}
1658
Lev Walkina9cc46e2004-09-22 16:06:28 +00001659asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001660PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001661 int ilevel, enum xer_encoder_flags_e flags,
1662 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001663 PER_Visible_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001664 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001665}
1666
1667
1668/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1669
Lev Walkina7591b52014-10-12 18:37:35 -07001670static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001671 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1672};
Lev Walkindfae9752004-09-29 13:19:37 +00001673asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001674 "PER-Visible",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001675 "PER-Visible",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001676 PER_Visible_free,
1677 PER_Visible_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001678 PER_Visible_constraint,
1679 PER_Visible_decode_ber,
1680 PER_Visible_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001681 PER_Visible_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001682 PER_Visible_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001683 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001684 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001685 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001686 asn_DEF_PER_Visible_tags_1,
1687 sizeof(asn_DEF_PER_Visible_tags_1)
1688 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1689 asn_DEF_PER_Visible_tags_1, /* Same as above */
1690 sizeof(asn_DEF_PER_Visible_tags_1)
1691 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001692 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001693 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001694 0, 0, /* No members */
1695 0 /* No specifics */
1696};
1697
1698
1699/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1700
Lev Walkin22b5ed42006-09-13 02:51:20 +00001701#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001702
1703/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1704
Lev Walkin006de1c2004-08-20 13:37:45 +00001705typedef PER_Visible_t PER_Visible_2_t;
1706
Lev Walkin006de1c2004-08-20 13:37:45 +00001707/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1708
Lev Walkindfae9752004-09-29 13:19:37 +00001709extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001710asn_struct_free_f PER_Visible_2_free;
1711asn_struct_print_f PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001712asn_constr_check_f PER_Visible_2_constraint;
1713ber_type_decoder_f PER_Visible_2_decode_ber;
1714der_type_encoder_f PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001715xer_type_decoder_f PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001716xer_type_encoder_f PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001717
1718/*** <<< CTABLES [PER-Visible-2] >>> ***/
1719
Lev Walkine8318b82005-03-06 09:29:03 +00001720static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001721 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001722 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001723 const uint8_t *ch = st->buf;
1724 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001725
1726 for(; ch < end; ch++) {
1727 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001728 if(!(cv >= 69 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001729 }
Lev Walkin775885e2004-08-22 12:47:03 +00001730 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001731}
1732
1733
1734/*** <<< CODE [PER-Visible-2] >>> ***/
1735
1736int
Lev Walkindfae9752004-09-29 13:19:37 +00001737PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001738 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001739 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001740
1741 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001742 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001743 "%s: value not given (%s:%d)",
1744 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001745 return -1;
1746 }
1747
1748
Lev Walkine8318b82005-03-06 09:29:03 +00001749 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001750 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001751 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001752 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001753 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001754 "%s: constraint failed (%s:%d)",
1755 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001756 return -1;
1757 }
1758}
1759
1760/*
1761 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001762 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001763 */
1764static void
Lev Walkine8318b82005-03-06 09:29:03 +00001765PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001766 td->free_struct = asn_DEF_PER_Visible.free_struct;
1767 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001768 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001769 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1770 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1771 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1772 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001773 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001774 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001775 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
1776 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001777 if(!td->oer_constraints)
1778 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001779 if(!td->per_constraints)
1780 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001781 td->elements = asn_DEF_PER_Visible.elements;
1782 td->elements_count = asn_DEF_PER_Visible.elements_count;
1783 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001784}
1785
Lev Walkina9cc46e2004-09-22 16:06:28 +00001786void
Lev Walkindfae9752004-09-29 13:19:37 +00001787PER_Visible_2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001788 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00001789 PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001790 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001791}
1792
1793int
Lev Walkindfae9752004-09-29 13:19:37 +00001794PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001795 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001796 PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001797 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1798}
1799
Lev Walkindc06f6b2004-10-20 15:50:55 +00001800asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001801PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001802 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00001803 PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001804 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001805}
1806
1807asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001808PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001809 void *structure, int tag_mode, ber_tlv_tag_t tag,
1810 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001811 PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001812 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1813}
1814
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001815asn_dec_rval_t
1816PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001817 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00001818 PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001819 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1820}
1821
Lev Walkina9cc46e2004-09-22 16:06:28 +00001822asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001823PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001824 int ilevel, enum xer_encoder_flags_e flags,
1825 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001826 PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001827 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001828}
1829
1830
1831/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
1832
Lev Walkina7591b52014-10-12 18:37:35 -07001833static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001834 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001835};
Lev Walkindfae9752004-09-29 13:19:37 +00001836asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001837 "PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001838 "PER-Visible-2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001839 PER_Visible_2_free,
1840 PER_Visible_2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001841 PER_Visible_2_constraint,
1842 PER_Visible_2_decode_ber,
1843 PER_Visible_2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001844 PER_Visible_2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001845 PER_Visible_2_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07001846 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04001847 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00001848 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001849 asn_DEF_PER_Visible_2_tags_1,
1850 sizeof(asn_DEF_PER_Visible_2_tags_1)
1851 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
1852 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
1853 sizeof(asn_DEF_PER_Visible_2_tags_1)
1854 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001855 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001856 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00001857 0, 0, /* No members */
1858 0 /* No specifics */
1859};
1860
1861
1862/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
1863
Lev Walkin22b5ed42006-09-13 02:51:20 +00001864#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00001865
1866/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
1867
Lev Walkin006de1c2004-08-20 13:37:45 +00001868typedef PER_Visible_t Not_PER_Visible_1_t;
1869
Lev Walkin006de1c2004-08-20 13:37:45 +00001870/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
1871
Lev Walkindfae9752004-09-29 13:19:37 +00001872extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001873asn_struct_free_f Not_PER_Visible_1_free;
1874asn_struct_print_f Not_PER_Visible_1_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001875asn_constr_check_f Not_PER_Visible_1_constraint;
1876ber_type_decoder_f Not_PER_Visible_1_decode_ber;
1877der_type_encoder_f Not_PER_Visible_1_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001878xer_type_decoder_f Not_PER_Visible_1_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001879xer_type_encoder_f Not_PER_Visible_1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001880
1881/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
1882
Lev Walkine8318b82005-03-06 09:29:03 +00001883static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001884 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001885 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001886 const uint8_t *ch = st->buf;
1887 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001888
1889 for(; ch < end; ch++) {
1890 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001891 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001892 }
Lev Walkin775885e2004-08-22 12:47:03 +00001893 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001894}
1895
1896
1897/*** <<< CODE [Not-PER-Visible-1] >>> ***/
1898
1899int
Lev Walkindfae9752004-09-29 13:19:37 +00001900Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001901 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001902 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001903
1904 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001905 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001906 "%s: value not given (%s:%d)",
1907 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001908 return -1;
1909 }
1910
1911
Lev Walkine8318b82005-03-06 09:29:03 +00001912 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001913 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001914 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001915 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001916 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00001917 "%s: constraint failed (%s:%d)",
1918 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001919 return -1;
1920 }
1921}
1922
1923/*
1924 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001925 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001926 */
1927static void
Lev Walkine8318b82005-03-06 09:29:03 +00001928Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001929 td->free_struct = asn_DEF_PER_Visible.free_struct;
1930 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001931 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001932 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1933 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1934 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1935 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001936 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001937 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001938 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
1939 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001940 if(!td->oer_constraints)
1941 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001942 if(!td->per_constraints)
1943 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00001944 td->elements = asn_DEF_PER_Visible.elements;
1945 td->elements_count = asn_DEF_PER_Visible.elements_count;
1946 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001947}
1948
Lev Walkina9cc46e2004-09-22 16:06:28 +00001949void
Lev Walkindfae9752004-09-29 13:19:37 +00001950Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001951 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00001952 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001953 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001954}
1955
1956int
Lev Walkindfae9752004-09-29 13:19:37 +00001957Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001958 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001959 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001960 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1961}
1962
Lev Walkindc06f6b2004-10-20 15:50:55 +00001963asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001964Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001965 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00001966 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001967 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001968}
1969
1970asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001971Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001972 void *structure, int tag_mode, ber_tlv_tag_t tag,
1973 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001974 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001975 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1976}
1977
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001978asn_dec_rval_t
1979Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00001980 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00001981 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001982 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1983}
1984
Lev Walkina9cc46e2004-09-22 16:06:28 +00001985asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001986Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001987 int ilevel, enum xer_encoder_flags_e flags,
1988 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00001989 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001990 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001991}
1992
1993
1994/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
1995
Lev Walkina7591b52014-10-12 18:37:35 -07001996static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001997 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001998};
Lev Walkindfae9752004-09-29 13:19:37 +00001999asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002000 "Not-PER-Visible-1",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002001 "Not-PER-Visible-1",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002002 Not_PER_Visible_1_free,
2003 Not_PER_Visible_1_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002004 Not_PER_Visible_1_constraint,
2005 Not_PER_Visible_1_decode_ber,
2006 Not_PER_Visible_1_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002007 Not_PER_Visible_1_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002008 Not_PER_Visible_1_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002009 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002010 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00002011 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002012 asn_DEF_Not_PER_Visible_1_tags_1,
2013 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2014 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2015 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
2016 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2017 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002018 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002019 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00002020 0, 0, /* No members */
2021 0 /* No specifics */
2022};
2023
2024
2025/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
2026
Lev Walkin22b5ed42006-09-13 02:51:20 +00002027#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00002028
2029/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
2030
Lev Walkin006de1c2004-08-20 13:37:45 +00002031typedef PER_Visible_t Not_PER_Visible_2_t;
2032
Lev Walkin006de1c2004-08-20 13:37:45 +00002033/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
2034
Lev Walkindfae9752004-09-29 13:19:37 +00002035extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002036asn_struct_free_f Not_PER_Visible_2_free;
2037asn_struct_print_f Not_PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002038asn_constr_check_f Not_PER_Visible_2_constraint;
2039ber_type_decoder_f Not_PER_Visible_2_decode_ber;
2040der_type_encoder_f Not_PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002041xer_type_decoder_f Not_PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002042xer_type_encoder_f Not_PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002043
Lev Walkind35c8b52004-08-25 02:08:08 +00002044/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
2045
Lev Walkine8318b82005-03-06 09:29:03 +00002046static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00002047 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002048 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00002049 const uint8_t *ch = st->buf;
2050 const uint8_t *end = ch + st->size;
2051
2052 for(; ch < end; ch++) {
2053 uint8_t cv = *ch;
2054 if(!(cv >= 65 && cv <= 66)) return -1;
2055 }
2056 return 0;
2057}
2058
2059
Lev Walkin006de1c2004-08-20 13:37:45 +00002060/*** <<< CODE [Not-PER-Visible-2] >>> ***/
2061
2062int
Lev Walkindfae9752004-09-29 13:19:37 +00002063Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002064 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002065 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002066
2067 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002068 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00002069 "%s: value not given (%s:%d)",
2070 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002071 return -1;
2072 }
2073
2074
Lev Walkine8318b82005-03-06 09:29:03 +00002075 if(!check_permitted_alphabet_1(st)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00002076 /* Constraint check succeeded */
2077 return 0;
2078 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002079 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +00002080 "%s: constraint failed (%s:%d)",
2081 td->name, __FILE__, __LINE__);
2082 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002083 }
Lev Walkin006de1c2004-08-20 13:37:45 +00002084}
2085
2086/*
2087 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002088 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002089 */
2090static void
Lev Walkine8318b82005-03-06 09:29:03 +00002091Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002092 td->free_struct = asn_DEF_PER_Visible.free_struct;
2093 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002094 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002095 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2096 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2097 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2098 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002099 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002100 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002101 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2102 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002103 if(!td->oer_constraints)
2104 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002105 if(!td->per_constraints)
2106 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002107 td->elements = asn_DEF_PER_Visible.elements;
2108 td->elements_count = asn_DEF_PER_Visible.elements_count;
2109 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002110}
2111
Lev Walkina9cc46e2004-09-22 16:06:28 +00002112void
Lev Walkindfae9752004-09-29 13:19:37 +00002113Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002114 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00002115 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002116 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002117}
2118
2119int
Lev Walkindfae9752004-09-29 13:19:37 +00002120Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002121 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002122 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002123 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2124}
2125
Lev Walkindc06f6b2004-10-20 15:50:55 +00002126asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002127Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002128 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00002129 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002130 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002131}
2132
2133asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002134Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002135 void *structure, int tag_mode, ber_tlv_tag_t tag,
2136 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002137 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002138 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2139}
2140
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002141asn_dec_rval_t
2142Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002143 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00002144 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002145 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2146}
2147
Lev Walkina9cc46e2004-09-22 16:06:28 +00002148asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002149Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002150 int ilevel, enum xer_encoder_flags_e flags,
2151 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002152 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002153 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002154}
2155
2156
2157/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
2158
Lev Walkina7591b52014-10-12 18:37:35 -07002159static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002160 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002161};
Lev Walkindfae9752004-09-29 13:19:37 +00002162asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002163 "Not-PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002164 "Not-PER-Visible-2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002165 Not_PER_Visible_2_free,
2166 Not_PER_Visible_2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002167 Not_PER_Visible_2_constraint,
2168 Not_PER_Visible_2_decode_ber,
2169 Not_PER_Visible_2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002170 Not_PER_Visible_2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002171 Not_PER_Visible_2_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002172 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002173 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00002174 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002175 asn_DEF_Not_PER_Visible_2_tags_1,
2176 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2177 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2178 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
2179 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2180 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002181 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002182 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00002183 0, 0, /* No members */
2184 0 /* No specifics */
2185};
2186
2187
2188/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2189
Lev Walkin22b5ed42006-09-13 02:51:20 +00002190#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00002191
2192/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2193
Lev Walkin006de1c2004-08-20 13:37:45 +00002194typedef PER_Visible_t Not_PER_Visible_3_t;
2195
Lev Walkin006de1c2004-08-20 13:37:45 +00002196/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2197
Lev Walkindfae9752004-09-29 13:19:37 +00002198extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002199asn_struct_free_f Not_PER_Visible_3_free;
2200asn_struct_print_f Not_PER_Visible_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002201asn_constr_check_f Not_PER_Visible_3_constraint;
2202ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2203der_type_encoder_f Not_PER_Visible_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002204xer_type_decoder_f Not_PER_Visible_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002205xer_type_encoder_f Not_PER_Visible_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002206
Lev Walkind35c8b52004-08-25 02:08:08 +00002207/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2208
Lev Walkine8318b82005-03-06 09:29:03 +00002209static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00002210 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002211 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00002212 const uint8_t *ch = st->buf;
2213 const uint8_t *end = ch + st->size;
2214
2215 for(; ch < end; ch++) {
2216 uint8_t cv = *ch;
2217 if(!(cv >= 65 && cv <= 66)) return -1;
2218 }
2219 return 0;
2220}
2221
2222
Lev Walkin006de1c2004-08-20 13:37:45 +00002223/*** <<< CODE [Not-PER-Visible-3] >>> ***/
2224
2225int
Lev Walkindfae9752004-09-29 13:19:37 +00002226Not_PER_Visible_3_constraint(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 Walkin8a7af0e2005-02-15 03:40:07 +00002228 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002229
2230 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002231 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00002232 "%s: value not given (%s:%d)",
2233 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002234 return -1;
2235 }
2236
2237
Lev Walkine8318b82005-03-06 09:29:03 +00002238 if(!check_permitted_alphabet_1(st)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00002239 /* Constraint check succeeded */
2240 return 0;
2241 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002242 ASN__CTFAIL(app_key, td, sptr,
Lev Walkind35c8b52004-08-25 02:08:08 +00002243 "%s: constraint failed (%s:%d)",
2244 td->name, __FILE__, __LINE__);
2245 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002246 }
Lev Walkin006de1c2004-08-20 13:37:45 +00002247}
2248
2249/*
2250 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002251 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002252 */
2253static void
Lev Walkine8318b82005-03-06 09:29:03 +00002254Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002255 td->free_struct = asn_DEF_PER_Visible.free_struct;
2256 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002257 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002258 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2259 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2260 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2261 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002262 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002263 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002264 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2265 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002266 if(!td->oer_constraints)
2267 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002268 if(!td->per_constraints)
2269 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002270 td->elements = asn_DEF_PER_Visible.elements;
2271 td->elements_count = asn_DEF_PER_Visible.elements_count;
2272 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002273}
2274
Lev Walkina9cc46e2004-09-22 16:06:28 +00002275void
Lev Walkindfae9752004-09-29 13:19:37 +00002276Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002277 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00002278 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002279 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002280}
2281
2282int
Lev Walkindfae9752004-09-29 13:19:37 +00002283Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002284 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002285 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002286 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2287}
2288
Lev Walkindc06f6b2004-10-20 15:50:55 +00002289asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002290Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002291 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00002292 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002293 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002294}
2295
2296asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002297Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002298 void *structure, int tag_mode, ber_tlv_tag_t tag,
2299 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002300 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002301 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2302}
2303
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002304asn_dec_rval_t
2305Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002306 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00002307 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002308 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2309}
2310
Lev Walkina9cc46e2004-09-22 16:06:28 +00002311asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002312Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002313 int ilevel, enum xer_encoder_flags_e flags,
2314 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002315 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002316 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002317}
2318
2319
2320/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2321
Lev Walkina7591b52014-10-12 18:37:35 -07002322static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002323 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002324};
Lev Walkindfae9752004-09-29 13:19:37 +00002325asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002326 "Not-PER-Visible-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002327 "Not-PER-Visible-3",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002328 Not_PER_Visible_3_free,
2329 Not_PER_Visible_3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002330 Not_PER_Visible_3_constraint,
2331 Not_PER_Visible_3_decode_ber,
2332 Not_PER_Visible_3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002333 Not_PER_Visible_3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002334 Not_PER_Visible_3_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002335 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002336 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00002337 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002338 asn_DEF_Not_PER_Visible_3_tags_1,
2339 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2340 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2341 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
2342 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2343 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002344 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002345 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00002346 0, 0, /* No members */
2347 0 /* No specifics */
2348};
2349
2350
2351/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2352
Lev Walkin22b5ed42006-09-13 02:51:20 +00002353#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00002354
2355/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2356
Lev Walkin006de1c2004-08-20 13:37:45 +00002357typedef PER_Visible_t SIZE_but_not_FROM_t;
2358
Lev Walkin006de1c2004-08-20 13:37:45 +00002359/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2360
Lev Walkindfae9752004-09-29 13:19:37 +00002361extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002362asn_struct_free_f SIZE_but_not_FROM_free;
2363asn_struct_print_f SIZE_but_not_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002364asn_constr_check_f SIZE_but_not_FROM_constraint;
2365ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2366der_type_encoder_f SIZE_but_not_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002367xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002368xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002369
2370/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2371
Lev Walkine8318b82005-03-06 09:29:03 +00002372static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002373 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002374 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002375 const uint8_t *ch = st->buf;
2376 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002377
2378 for(; ch < end; ch++) {
2379 uint8_t cv = *ch;
Lev Walkind35c8b52004-08-25 02:08:08 +00002380 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002381 }
Lev Walkin775885e2004-08-22 12:47:03 +00002382 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002383}
2384
2385
2386/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2387
2388int
Lev Walkindfae9752004-09-29 13:19:37 +00002389SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002390 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002391 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002392 size_t size;
2393
2394 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002395 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00002396 "%s: value not given (%s:%d)",
2397 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002398 return -1;
2399 }
2400
2401 size = st->size;
2402
2403 if((size >= 1 && size <= 4)
Lev Walkine8318b82005-03-06 09:29:03 +00002404 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002405 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002406 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002407 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002408 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00002409 "%s: constraint failed (%s:%d)",
2410 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002411 return -1;
2412 }
2413}
2414
2415/*
2416 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002417 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002418 */
2419static void
Lev Walkine8318b82005-03-06 09:29:03 +00002420SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002421 td->free_struct = asn_DEF_PER_Visible.free_struct;
2422 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002423 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002424 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2425 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2426 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2427 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002428 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002429 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002430 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2431 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002432 if(!td->oer_constraints)
2433 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002434 if(!td->per_constraints)
2435 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002436 td->elements = asn_DEF_PER_Visible.elements;
2437 td->elements_count = asn_DEF_PER_Visible.elements_count;
2438 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002439}
2440
Lev Walkina9cc46e2004-09-22 16:06:28 +00002441void
Lev Walkindfae9752004-09-29 13:19:37 +00002442SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002443 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00002444 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002445 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002446}
2447
2448int
Lev Walkindfae9752004-09-29 13:19:37 +00002449SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002450 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002451 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002452 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2453}
2454
Lev Walkindc06f6b2004-10-20 15:50:55 +00002455asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002456SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002457 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00002458 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002459 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002460}
2461
2462asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002463SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002464 void *structure, int tag_mode, ber_tlv_tag_t tag,
2465 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002466 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002467 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2468}
2469
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002470asn_dec_rval_t
2471SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002472 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00002473 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002474 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2475}
2476
Lev Walkina9cc46e2004-09-22 16:06:28 +00002477asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002478SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002479 int ilevel, enum xer_encoder_flags_e flags,
2480 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002481 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002482 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002483}
2484
2485
2486/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2487
Lev Walkina7591b52014-10-12 18:37:35 -07002488static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002489 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002490};
Lev Walkindfae9752004-09-29 13:19:37 +00002491asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002492 "SIZE-but-not-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002493 "SIZE-but-not-FROM",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002494 SIZE_but_not_FROM_free,
2495 SIZE_but_not_FROM_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002496 SIZE_but_not_FROM_constraint,
2497 SIZE_but_not_FROM_decode_ber,
2498 SIZE_but_not_FROM_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002499 SIZE_but_not_FROM_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002500 SIZE_but_not_FROM_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002501 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002502 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00002503 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002504 asn_DEF_SIZE_but_not_FROM_tags_1,
2505 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2506 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2507 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
2508 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2509 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002510 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002511 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00002512 0, 0, /* No members */
2513 0 /* No specifics */
2514};
2515
2516
2517/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2518
Lev Walkin22b5ed42006-09-13 02:51:20 +00002519#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00002520
2521/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2522
Lev Walkin006de1c2004-08-20 13:37:45 +00002523typedef PER_Visible_t SIZE_and_FROM_t;
2524
Lev Walkin006de1c2004-08-20 13:37:45 +00002525/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2526
Lev Walkindfae9752004-09-29 13:19:37 +00002527extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002528asn_struct_free_f SIZE_and_FROM_free;
2529asn_struct_print_f SIZE_and_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002530asn_constr_check_f SIZE_and_FROM_constraint;
2531ber_type_decoder_f SIZE_and_FROM_decode_ber;
2532der_type_encoder_f SIZE_and_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002533xer_type_decoder_f SIZE_and_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002534xer_type_encoder_f SIZE_and_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002535
2536/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2537
Lev Walkine8318b82005-03-06 09:29:03 +00002538static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002539 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002540 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002541 const uint8_t *ch = st->buf;
2542 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002543
2544 for(; ch < end; ch++) {
2545 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00002546 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002547 }
Lev Walkin775885e2004-08-22 12:47:03 +00002548 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002549}
2550
2551
2552/*** <<< CODE [SIZE-and-FROM] >>> ***/
2553
2554int
Lev Walkindfae9752004-09-29 13:19:37 +00002555SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002556 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002557 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002558 size_t size;
2559
2560 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002561 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00002562 "%s: value not given (%s:%d)",
2563 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002564 return -1;
2565 }
2566
2567 size = st->size;
2568
2569 if((size >= 1 && size <= 4)
Lev Walkine8318b82005-03-06 09:29:03 +00002570 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002571 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002572 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002573 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002574 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00002575 "%s: constraint failed (%s:%d)",
2576 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002577 return -1;
2578 }
2579}
2580
2581/*
2582 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002583 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002584 */
2585static void
Lev Walkine8318b82005-03-06 09:29:03 +00002586SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002587 td->free_struct = asn_DEF_PER_Visible.free_struct;
2588 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002589 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002590 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2591 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2592 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2593 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002594 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002595 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002596 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2597 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002598 if(!td->oer_constraints)
2599 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002600 if(!td->per_constraints)
2601 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002602 td->elements = asn_DEF_PER_Visible.elements;
2603 td->elements_count = asn_DEF_PER_Visible.elements_count;
2604 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002605}
2606
Lev Walkina9cc46e2004-09-22 16:06:28 +00002607void
Lev Walkindfae9752004-09-29 13:19:37 +00002608SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002609 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00002610 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002611 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002612}
2613
2614int
Lev Walkindfae9752004-09-29 13:19:37 +00002615SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002616 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002617 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002618 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2619}
2620
Lev Walkindc06f6b2004-10-20 15:50:55 +00002621asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002622SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002623 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00002624 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002625 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002626}
2627
2628asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002629SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002630 void *structure, int tag_mode, ber_tlv_tag_t tag,
2631 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002632 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002633 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2634}
2635
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002636asn_dec_rval_t
2637SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002638 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00002639 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002640 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2641}
2642
Lev Walkina9cc46e2004-09-22 16:06:28 +00002643asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002644SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002645 int ilevel, enum xer_encoder_flags_e flags,
2646 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002647 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002648 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002649}
2650
2651
2652/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
2653
Lev Walkina7591b52014-10-12 18:37:35 -07002654static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002655 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002656};
Lev Walkindfae9752004-09-29 13:19:37 +00002657asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002658 "SIZE-and-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002659 "SIZE-and-FROM",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002660 SIZE_and_FROM_free,
2661 SIZE_and_FROM_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002662 SIZE_and_FROM_constraint,
2663 SIZE_and_FROM_decode_ber,
2664 SIZE_and_FROM_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002665 SIZE_and_FROM_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002666 SIZE_and_FROM_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002667 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002668 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00002669 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002670 asn_DEF_SIZE_and_FROM_tags_1,
2671 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2672 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2673 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
2674 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2675 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002676 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002677 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00002678 0, 0, /* No members */
2679 0 /* No specifics */
2680};
2681
2682
2683/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
2684
Lev Walkin22b5ed42006-09-13 02:51:20 +00002685#include "PER-Visible.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00002686
2687/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2688
Lev Walkin006de1c2004-08-20 13:37:45 +00002689typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
2690
Lev Walkin006de1c2004-08-20 13:37:45 +00002691/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2692
Lev Walkindfae9752004-09-29 13:19:37 +00002693extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002694asn_struct_free_f Neither_SIZE_nor_FROM_free;
2695asn_struct_print_f Neither_SIZE_nor_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002696asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
2697ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
2698der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002699xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002700xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002701
2702/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
2703
Lev Walkine8318b82005-03-06 09:29:03 +00002704static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002705 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002706 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002707 const uint8_t *ch = st->buf;
2708 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002709
2710 for(; ch < end; ch++) {
2711 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00002712 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002713 }
Lev Walkin775885e2004-08-22 12:47:03 +00002714 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002715}
2716
2717
2718/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
2719
2720int
Lev Walkindfae9752004-09-29 13:19:37 +00002721Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002722 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002723 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002724
2725 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002726 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00002727 "%s: value not given (%s:%d)",
2728 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002729 return -1;
2730 }
2731
2732
Lev Walkine8318b82005-03-06 09:29:03 +00002733 if(!check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002734 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002735 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002736 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002737 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00002738 "%s: constraint failed (%s:%d)",
2739 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002740 return -1;
2741 }
2742}
2743
2744/*
2745 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002746 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002747 */
2748static void
Lev Walkine8318b82005-03-06 09:29:03 +00002749Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002750 td->free_struct = asn_DEF_PER_Visible.free_struct;
2751 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002752 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002753 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2754 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2755 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2756 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002757 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002758 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002759 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2760 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002761 if(!td->oer_constraints)
2762 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002763 if(!td->per_constraints)
2764 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00002765 td->elements = asn_DEF_PER_Visible.elements;
2766 td->elements_count = asn_DEF_PER_Visible.elements_count;
2767 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002768}
2769
Lev Walkina9cc46e2004-09-22 16:06:28 +00002770void
Lev Walkindfae9752004-09-29 13:19:37 +00002771Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002772 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00002773 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002774 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002775}
2776
2777int
Lev Walkindfae9752004-09-29 13:19:37 +00002778Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002779 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002780 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002781 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2782}
2783
Lev Walkindc06f6b2004-10-20 15:50:55 +00002784asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002785Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002786 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00002787 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002788 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002789}
2790
2791asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002792Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002793 void *structure, int tag_mode, ber_tlv_tag_t tag,
2794 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002795 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002796 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2797}
2798
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002799asn_dec_rval_t
2800Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002801 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00002802 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002803 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2804}
2805
Lev Walkina9cc46e2004-09-22 16:06:28 +00002806asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002807Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002808 int ilevel, enum xer_encoder_flags_e flags,
2809 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002810 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002811 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002812}
2813
2814
2815/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
2816
Lev Walkina7591b52014-10-12 18:37:35 -07002817static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002818 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002819};
Lev Walkindfae9752004-09-29 13:19:37 +00002820asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002821 "Neither-SIZE-nor-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002822 "Neither-SIZE-nor-FROM",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002823 Neither_SIZE_nor_FROM_free,
2824 Neither_SIZE_nor_FROM_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002825 Neither_SIZE_nor_FROM_constraint,
2826 Neither_SIZE_nor_FROM_decode_ber,
2827 Neither_SIZE_nor_FROM_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002828 Neither_SIZE_nor_FROM_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002829 Neither_SIZE_nor_FROM_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002830 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002831 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00002832 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002833 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
2834 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
2835 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
2836 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
2837 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
2838 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002839 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002840 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00002841 0, 0, /* No members */
2842 0 /* No specifics */
2843};
2844
2845
Lev Walkin55cc44a2004-10-03 09:14:32 +00002846/*** <<< INCLUDES [Utf8-4] >>> ***/
2847
2848#include <UTF8String.h>
2849
2850/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
2851
Lev Walkin55cc44a2004-10-03 09:14:32 +00002852typedef UTF8String_t Utf8_4_t;
2853
2854/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
2855
2856extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
2857asn_struct_free_f Utf8_4_free;
2858asn_struct_print_f Utf8_4_print;
2859asn_constr_check_f Utf8_4_constraint;
2860ber_type_decoder_f Utf8_4_decode_ber;
2861der_type_encoder_f Utf8_4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002862xer_type_decoder_f Utf8_4_decode_xer;
Lev Walkin55cc44a2004-10-03 09:14:32 +00002863xer_type_encoder_f Utf8_4_encode_xer;
2864
2865/*** <<< CTABLES [Utf8-4] >>> ***/
2866
Lev Walkine8318b82005-03-06 09:29:03 +00002867static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002868 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
2869 return -1; /* Alphabet (sic!) test failed. */
2870
2871 return 0;
2872}
2873
2874
2875/*** <<< CODE [Utf8-4] >>> ***/
2876
2877int
2878Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002879 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002880 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin55cc44a2004-10-03 09:14:32 +00002881
2882 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002883 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin55cc44a2004-10-03 09:14:32 +00002884 "%s: value not given (%s:%d)",
2885 td->name, __FILE__, __LINE__);
2886 return -1;
2887 }
2888
2889
Lev Walkine8318b82005-03-06 09:29:03 +00002890 if(!check_permitted_alphabet_1(st)) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002891 /* Constraint check succeeded */
2892 return 0;
2893 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002894 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin55cc44a2004-10-03 09:14:32 +00002895 "%s: constraint failed (%s:%d)",
2896 td->name, __FILE__, __LINE__);
2897 return -1;
2898 }
2899}
2900
2901/*
2902 * This type is implemented using UTF8String,
2903 * so here we adjust the DEF accordingly.
2904 */
2905static void
Lev Walkine8318b82005-03-06 09:29:03 +00002906Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002907 td->free_struct = asn_DEF_UTF8String.free_struct;
2908 td->print_struct = asn_DEF_UTF8String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002909 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin55cc44a2004-10-03 09:14:32 +00002910 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
2911 td->der_encoder = asn_DEF_UTF8String.der_encoder;
2912 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
2913 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002914 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002915 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002916 td->oer_decoder = asn_DEF_UTF8String.oer_decoder;
2917 td->oer_encoder = asn_DEF_UTF8String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002918 if(!td->oer_constraints)
2919 td->oer_constraints = asn_DEF_UTF8String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002920 if(!td->per_constraints)
2921 td->per_constraints = asn_DEF_UTF8String.per_constraints;
Lev Walkin55cc44a2004-10-03 09:14:32 +00002922 td->elements = asn_DEF_UTF8String.elements;
2923 td->elements_count = asn_DEF_UTF8String.elements_count;
2924 td->specifics = asn_DEF_UTF8String.specifics;
2925}
2926
2927void
2928Utf8_4_free(asn_TYPE_descriptor_t *td,
2929 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00002930 Utf8_4_1_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002931 td->free_struct(td, struct_ptr, contents_only);
2932}
2933
2934int
2935Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2936 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002937 Utf8_4_1_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002938 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2939}
2940
Lev Walkindc06f6b2004-10-20 15:50:55 +00002941asn_dec_rval_t
Lev Walkin55cc44a2004-10-03 09:14:32 +00002942Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002943 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00002944 Utf8_4_1_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002945 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2946}
2947
2948asn_enc_rval_t
2949Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
2950 void *structure, int tag_mode, ber_tlv_tag_t tag,
2951 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002952 Utf8_4_1_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002953 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2954}
2955
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002956asn_dec_rval_t
2957Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00002958 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00002959 Utf8_4_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002960 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2961}
2962
Lev Walkin55cc44a2004-10-03 09:14:32 +00002963asn_enc_rval_t
2964Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2965 int ilevel, enum xer_encoder_flags_e flags,
2966 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00002967 Utf8_4_1_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002968 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2969}
2970
2971
2972/*** <<< STAT-DEFS [Utf8-4] >>> ***/
2973
Lev Walkina7591b52014-10-12 18:37:35 -07002974static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002975 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2976};
2977asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
2978 "Utf8-4",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002979 "Utf8-4",
Lev Walkin55cc44a2004-10-03 09:14:32 +00002980 Utf8_4_free,
2981 Utf8_4_print,
2982 Utf8_4_constraint,
2983 Utf8_4_decode_ber,
2984 Utf8_4_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002985 Utf8_4_decode_xer,
Lev Walkin55cc44a2004-10-03 09:14:32 +00002986 Utf8_4_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07002987 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04002988 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin55cc44a2004-10-03 09:14:32 +00002989 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002990 asn_DEF_Utf8_4_tags_1,
2991 sizeof(asn_DEF_Utf8_4_tags_1)
2992 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
2993 asn_DEF_Utf8_4_tags_1, /* Same as above */
2994 sizeof(asn_DEF_Utf8_4_tags_1)
2995 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002996 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00002997 0, /* No PER visible constraints */
Lev Walkin55cc44a2004-10-03 09:14:32 +00002998 0, 0, /* No members */
2999 0 /* No specifics */
3000};
3001
3002
Lev Walkin006de1c2004-08-20 13:37:45 +00003003/*** <<< INCLUDES [Utf8-3] >>> ***/
3004
Lev Walkin22b5ed42006-09-13 02:51:20 +00003005#include "Utf8-2.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00003006
3007/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
3008
Lev Walkin006de1c2004-08-20 13:37:45 +00003009typedef Utf8_2_t Utf8_3_t;
3010
Lev Walkin006de1c2004-08-20 13:37:45 +00003011/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
3012
Lev Walkindfae9752004-09-29 13:19:37 +00003013extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00003014asn_struct_free_f Utf8_3_free;
3015asn_struct_print_f Utf8_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00003016asn_constr_check_f Utf8_3_constraint;
3017ber_type_decoder_f Utf8_3_decode_ber;
3018der_type_encoder_f Utf8_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003019xer_type_decoder_f Utf8_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00003020xer_type_encoder_f Utf8_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00003021
3022/*** <<< CTABLES [Utf8-3] >>> ***/
3023
Lev Walkina7591b52014-10-12 18:37:35 -07003024static const int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003025 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3026 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3027 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3028 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3029 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
303016,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
3031 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
303242,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin006de1c2004-08-20 13:37:45 +00003033};
3034
Lev Walkine8318b82005-03-06 09:29:03 +00003035static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07003036 const int *table = permitted_alphabet_table_1;
Lev Walkin006de1c2004-08-20 13:37:45 +00003037 /* The underlying type is UTF8String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00003038 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00003039 const uint8_t *ch = st->buf;
3040 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00003041
3042 for(; ch < end; ch++) {
3043 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00003044 if(cv >= 0x80) return -1;
3045 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00003046 }
Lev Walkin775885e2004-08-22 12:47:03 +00003047 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00003048}
3049
3050
3051/*** <<< CODE [Utf8-3] >>> ***/
3052
3053int
Lev Walkindfae9752004-09-29 13:19:37 +00003054Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003055 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00003056 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00003057 size_t size;
3058
3059 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003060 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00003061 "%s: value not given (%s:%d)",
3062 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00003063 return -1;
3064 }
3065
Lev Walkinfac2e942004-10-02 16:33:46 +00003066 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00003067 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003068 ASN__CTFAIL(app_key, td, sptr,
Lev Walkinfac2e942004-10-02 16:33:46 +00003069 "%s: UTF-8: broken encoding (%s:%d)",
3070 td->name, __FILE__, __LINE__);
3071 return -1;
3072 }
Lev Walkin006de1c2004-08-20 13:37:45 +00003073
3074 if((size >= 1 && size <= 2)
Lev Walkine8318b82005-03-06 09:29:03 +00003075 && !check_permitted_alphabet_1(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00003076 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00003077 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00003078 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003079 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00003080 "%s: constraint failed (%s:%d)",
3081 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00003082 return -1;
3083 }
3084}
3085
3086/*
3087 * This type is implemented using Utf8_2,
Lev Walkinc3808c12004-09-23 22:14:58 +00003088 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00003089 */
3090static void
Lev Walkine8318b82005-03-06 09:29:03 +00003091Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00003092 td->free_struct = asn_DEF_Utf8_2.free_struct;
3093 td->print_struct = asn_DEF_Utf8_2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003094 td->check_constraints = asn_DEF_Utf8_2.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00003095 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
3096 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
3097 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
3098 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003099 td->uper_decoder = asn_DEF_Utf8_2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003100 td->uper_encoder = asn_DEF_Utf8_2.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003101 td->oer_decoder = asn_DEF_Utf8_2.oer_decoder;
3102 td->oer_encoder = asn_DEF_Utf8_2.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003103 if(!td->oer_constraints)
3104 td->oer_constraints = asn_DEF_Utf8_2.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003105 if(!td->per_constraints)
3106 td->per_constraints = asn_DEF_Utf8_2.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00003107 td->elements = asn_DEF_Utf8_2.elements;
3108 td->elements_count = asn_DEF_Utf8_2.elements_count;
3109 td->specifics = asn_DEF_Utf8_2.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00003110}
3111
Lev Walkina9cc46e2004-09-22 16:06:28 +00003112void
Lev Walkindfae9752004-09-29 13:19:37 +00003113Utf8_3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003114 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00003115 Utf8_3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003116 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00003117}
3118
3119int
Lev Walkindfae9752004-09-29 13:19:37 +00003120Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00003121 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003122 Utf8_3_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00003123 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3124}
3125
Lev Walkindc06f6b2004-10-20 15:50:55 +00003126asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003127Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00003128 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00003129 Utf8_3_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00003130 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003131}
3132
3133asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003134Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003135 void *structure, int tag_mode, ber_tlv_tag_t tag,
3136 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003137 Utf8_3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003138 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3139}
3140
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003141asn_dec_rval_t
3142Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00003143 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00003144 Utf8_3_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003145 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3146}
3147
Lev Walkina9cc46e2004-09-22 16:06:28 +00003148asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003149Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003150 int ilevel, enum xer_encoder_flags_e flags,
3151 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003152 Utf8_3_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003153 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00003154}
3155
3156
3157/*** <<< STAT-DEFS [Utf8-3] >>> ***/
3158
Lev Walkina7591b52014-10-12 18:37:35 -07003159static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00003160 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00003161};
Lev Walkindfae9752004-09-29 13:19:37 +00003162asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00003163 "Utf8-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00003164 "Utf8-3",
Lev Walkina9cc46e2004-09-22 16:06:28 +00003165 Utf8_3_free,
3166 Utf8_3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00003167 Utf8_3_constraint,
3168 Utf8_3_decode_ber,
3169 Utf8_3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003170 Utf8_3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003171 Utf8_3_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07003172 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04003173 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00003174 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00003175 asn_DEF_Utf8_3_tags_1,
3176 sizeof(asn_DEF_Utf8_3_tags_1)
3177 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3178 asn_DEF_Utf8_3_tags_1, /* Same as above */
3179 sizeof(asn_DEF_Utf8_3_tags_1)
3180 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003181 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00003182 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00003183 0, 0, /* No members */
3184 0 /* No specifics */
3185};
3186
3187
3188/*** <<< INCLUDES [Utf8-2] >>> ***/
3189
Lev Walkin22b5ed42006-09-13 02:51:20 +00003190#include "Utf8-1.h"
Lev Walkin006de1c2004-08-20 13:37:45 +00003191
3192/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
3193
Lev Walkin006de1c2004-08-20 13:37:45 +00003194typedef Utf8_1_t Utf8_2_t;
3195
Lev Walkin006de1c2004-08-20 13:37:45 +00003196/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
3197
Lev Walkindfae9752004-09-29 13:19:37 +00003198extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00003199asn_struct_free_f Utf8_2_free;
3200asn_struct_print_f Utf8_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00003201asn_constr_check_f Utf8_2_constraint;
3202ber_type_decoder_f Utf8_2_decode_ber;
3203der_type_encoder_f Utf8_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003204xer_type_decoder_f Utf8_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00003205xer_type_encoder_f Utf8_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00003206
3207/*** <<< CODE [Utf8-2] >>> ***/
3208
3209int
Lev Walkindfae9752004-09-29 13:19:37 +00003210Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003211 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00003212 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00003213 size_t size;
3214
3215 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003216 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00003217 "%s: value not given (%s:%d)",
3218 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00003219 return -1;
3220 }
3221
Lev Walkinfac2e942004-10-02 16:33:46 +00003222 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00003223 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003224 ASN__CTFAIL(app_key, td, sptr,
Lev Walkinfac2e942004-10-02 16:33:46 +00003225 "%s: UTF-8: broken encoding (%s:%d)",
3226 td->name, __FILE__, __LINE__);
3227 return -1;
3228 }
Lev Walkin006de1c2004-08-20 13:37:45 +00003229
3230 if((size >= 1 && size <= 2)) {
3231 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00003232 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00003233 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003234 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin16835b62004-08-22 13:47:59 +00003235 "%s: constraint failed (%s:%d)",
3236 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00003237 return -1;
3238 }
3239}
3240
3241/*
3242 * This type is implemented using Utf8_1,
Lev Walkinc3808c12004-09-23 22:14:58 +00003243 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00003244 */
3245static void
Lev Walkine8318b82005-03-06 09:29:03 +00003246Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00003247 td->free_struct = asn_DEF_Utf8_1.free_struct;
3248 td->print_struct = asn_DEF_Utf8_1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003249 td->check_constraints = asn_DEF_Utf8_1.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00003250 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
3251 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
3252 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
3253 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003254 td->uper_decoder = asn_DEF_Utf8_1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003255 td->uper_encoder = asn_DEF_Utf8_1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003256 td->oer_decoder = asn_DEF_Utf8_1.oer_decoder;
3257 td->oer_encoder = asn_DEF_Utf8_1.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003258 if(!td->oer_constraints)
3259 td->oer_constraints = asn_DEF_Utf8_1.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003260 if(!td->per_constraints)
3261 td->per_constraints = asn_DEF_Utf8_1.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00003262 td->elements = asn_DEF_Utf8_1.elements;
3263 td->elements_count = asn_DEF_Utf8_1.elements_count;
3264 td->specifics = asn_DEF_Utf8_1.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00003265}
3266
Lev Walkina9cc46e2004-09-22 16:06:28 +00003267void
Lev Walkindfae9752004-09-29 13:19:37 +00003268Utf8_2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003269 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00003270 Utf8_2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003271 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00003272}
3273
3274int
Lev Walkindfae9752004-09-29 13:19:37 +00003275Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00003276 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003277 Utf8_2_1_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00003278 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3279}
3280
Lev Walkindc06f6b2004-10-20 15:50:55 +00003281asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003282Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00003283 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00003284 Utf8_2_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00003285 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003286}
3287
3288asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003289Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003290 void *structure, int tag_mode, ber_tlv_tag_t tag,
3291 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003292 Utf8_2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003293 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3294}
3295
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003296asn_dec_rval_t
3297Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00003298 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00003299 Utf8_2_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003300 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3301}
3302
Lev Walkina9cc46e2004-09-22 16:06:28 +00003303asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003304Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003305 int ilevel, enum xer_encoder_flags_e flags,
3306 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003307 Utf8_2_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003308 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00003309}
3310
3311
3312/*** <<< STAT-DEFS [Utf8-2] >>> ***/
3313
Lev Walkina7591b52014-10-12 18:37:35 -07003314static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00003315 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00003316};
Lev Walkindfae9752004-09-29 13:19:37 +00003317asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00003318 "Utf8-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00003319 "Utf8-2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00003320 Utf8_2_free,
3321 Utf8_2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00003322 Utf8_2_constraint,
3323 Utf8_2_decode_ber,
3324 Utf8_2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003325 Utf8_2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003326 Utf8_2_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07003327 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04003328 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin006de1c2004-08-20 13:37:45 +00003329 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00003330 asn_DEF_Utf8_2_tags_1,
3331 sizeof(asn_DEF_Utf8_2_tags_1)
3332 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3333 asn_DEF_Utf8_2_tags_1, /* Same as above */
3334 sizeof(asn_DEF_Utf8_2_tags_1)
3335 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003336 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00003337 0, /* No PER visible constraints */
Lev Walkin006de1c2004-08-20 13:37:45 +00003338 0, 0, /* No members */
3339 0 /* No specifics */
3340};
3341
3342
3343/*** <<< INCLUDES [Utf8-1] >>> ***/
3344
3345#include <UTF8String.h>
3346
3347/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3348
Lev Walkin006de1c2004-08-20 13:37:45 +00003349typedef UTF8String_t Utf8_1_t;
3350
Lev Walkin006de1c2004-08-20 13:37:45 +00003351/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3352
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003353extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3354asn_struct_free_f Utf8_1_free;
3355asn_struct_print_f Utf8_1_print;
3356asn_constr_check_f Utf8_1_constraint;
3357ber_type_decoder_f Utf8_1_decode_ber;
3358der_type_encoder_f Utf8_1_encode_der;
3359xer_type_decoder_f Utf8_1_decode_xer;
3360xer_type_encoder_f Utf8_1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00003361
3362/*** <<< CODE [Utf8-1] >>> ***/
3363
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003364int
3365Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003366 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003367 /* Replace with underlying type checker */
3368 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00003369 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003370}
3371
3372/*
3373 * This type is implemented using UTF8String,
3374 * so here we adjust the DEF accordingly.
3375 */
3376static void
Lev Walkine8318b82005-03-06 09:29:03 +00003377Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003378 td->free_struct = asn_DEF_UTF8String.free_struct;
3379 td->print_struct = asn_DEF_UTF8String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003380 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003381 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3382 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3383 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3384 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003385 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003386 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003387 td->oer_decoder = asn_DEF_UTF8String.oer_decoder;
3388 td->oer_encoder = asn_DEF_UTF8String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003389 if(!td->oer_constraints)
3390 td->oer_constraints = asn_DEF_UTF8String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003391 if(!td->per_constraints)
3392 td->per_constraints = asn_DEF_UTF8String.per_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003393 td->elements = asn_DEF_UTF8String.elements;
3394 td->elements_count = asn_DEF_UTF8String.elements_count;
3395 td->specifics = asn_DEF_UTF8String.specifics;
3396}
3397
3398void
3399Utf8_1_free(asn_TYPE_descriptor_t *td,
3400 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00003401 Utf8_1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003402 td->free_struct(td, struct_ptr, contents_only);
3403}
3404
3405int
3406Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3407 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003408 Utf8_1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003409 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3410}
3411
3412asn_dec_rval_t
3413Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00003414 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00003415 Utf8_1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003416 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3417}
3418
3419asn_enc_rval_t
3420Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3421 void *structure, int tag_mode, ber_tlv_tag_t tag,
3422 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003423 Utf8_1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003424 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3425}
3426
3427asn_dec_rval_t
3428Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00003429 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00003430 Utf8_1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003431 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3432}
3433
3434asn_enc_rval_t
3435Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3436 int ilevel, enum xer_encoder_flags_e flags,
3437 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003438 Utf8_1_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003439 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3440}
3441
3442
3443/*** <<< STAT-DEFS [Utf8-1] >>> ***/
3444
Lev Walkina7591b52014-10-12 18:37:35 -07003445static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003446 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3447};
3448asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3449 "Utf8-1",
3450 "Utf8-1",
3451 Utf8_1_free,
3452 Utf8_1_print,
3453 Utf8_1_constraint,
3454 Utf8_1_decode_ber,
3455 Utf8_1_encode_der,
3456 Utf8_1_decode_xer,
3457 Utf8_1_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07003458 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04003459 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003460 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00003461 asn_DEF_Utf8_1_tags_1,
3462 sizeof(asn_DEF_Utf8_1_tags_1)
3463 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3464 asn_DEF_Utf8_1_tags_1, /* Same as above */
3465 sizeof(asn_DEF_Utf8_1_tags_1)
3466 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003467 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00003468 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003469 0, 0, /* No members */
3470 0 /* No specifics */
3471};
Lev Walkin006de1c2004-08-20 13:37:45 +00003472
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003473
3474/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
3475
Lev Walkin22b5ed42006-09-13 02:51:20 +00003476#include "Identifier.h"
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003477
3478/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
3479
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003480typedef Identifier_t VisibleIdentifier_t;
3481
3482/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
3483
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003484extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
3485asn_struct_free_f VisibleIdentifier_free;
3486asn_struct_print_f VisibleIdentifier_print;
3487asn_constr_check_f VisibleIdentifier_constraint;
3488ber_type_decoder_f VisibleIdentifier_decode_ber;
3489der_type_encoder_f VisibleIdentifier_encode_der;
3490xer_type_decoder_f VisibleIdentifier_decode_xer;
3491xer_type_encoder_f VisibleIdentifier_encode_xer;
3492
3493/*** <<< CTABLES [VisibleIdentifier] >>> ***/
3494
Lev Walkina7591b52014-10-12 18:37:35 -07003495static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003496 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3497 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3498 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
3499 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
3500 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
350127,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
3502 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
350354,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003504};
3505
Lev Walkine8318b82005-03-06 09:29:03 +00003506static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07003507 const int *table = permitted_alphabet_table_1;
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003508 /* The underlying type is VisibleString */
3509 const VisibleString_t *st = (const VisibleString_t *)sptr;
3510 const uint8_t *ch = st->buf;
3511 const uint8_t *end = ch + st->size;
3512
3513 for(; ch < end; ch++) {
3514 uint8_t cv = *ch;
3515 if(!table[cv]) return -1;
3516 }
3517 return 0;
3518}
3519
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003520
Lev Walkin154aa182004-09-26 13:12:56 +00003521/*** <<< CODE [VisibleIdentifier] >>> ***/
3522
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003523int
3524VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003525 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003526 const Identifier_t *st = (const Identifier_t *)sptr;
3527 size_t size;
3528
3529 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003530 ASN__CTFAIL(app_key, td, sptr,
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003531 "%s: value not given (%s:%d)",
3532 td->name, __FILE__, __LINE__);
3533 return -1;
3534 }
3535
3536 size = st->size;
3537
3538 if((size >= 1 && size <= 32)
Lev Walkine8318b82005-03-06 09:29:03 +00003539 && !check_permitted_alphabet_1(st)) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003540 /* Constraint check succeeded */
3541 return 0;
3542 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003543 ASN__CTFAIL(app_key, td, sptr,
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003544 "%s: constraint failed (%s:%d)",
3545 td->name, __FILE__, __LINE__);
3546 return -1;
3547 }
3548}
3549
3550/*
3551 * This type is implemented using Identifier,
3552 * so here we adjust the DEF accordingly.
3553 */
3554static void
Lev Walkine8318b82005-03-06 09:29:03 +00003555VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003556 td->free_struct = asn_DEF_Identifier.free_struct;
3557 td->print_struct = asn_DEF_Identifier.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003558 td->check_constraints = asn_DEF_Identifier.check_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003559 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
3560 td->der_encoder = asn_DEF_Identifier.der_encoder;
3561 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
3562 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003563 td->uper_decoder = asn_DEF_Identifier.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003564 td->uper_encoder = asn_DEF_Identifier.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003565 td->oer_decoder = asn_DEF_Identifier.oer_decoder;
3566 td->oer_encoder = asn_DEF_Identifier.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003567 if(!td->oer_constraints)
3568 td->oer_constraints = asn_DEF_Identifier.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003569 if(!td->per_constraints)
3570 td->per_constraints = asn_DEF_Identifier.per_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003571 td->elements = asn_DEF_Identifier.elements;
3572 td->elements_count = asn_DEF_Identifier.elements_count;
3573 td->specifics = asn_DEF_Identifier.specifics;
3574}
3575
3576void
3577VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
3578 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00003579 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003580 td->free_struct(td, struct_ptr, contents_only);
3581}
3582
3583int
3584VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3585 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003586 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003587 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3588}
3589
3590asn_dec_rval_t
3591VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00003592 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00003593 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003594 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3595}
3596
3597asn_enc_rval_t
3598VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
3599 void *structure, int tag_mode, ber_tlv_tag_t tag,
3600 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003601 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003602 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3603}
3604
3605asn_dec_rval_t
3606VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00003607 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00003608 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003609 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3610}
3611
3612asn_enc_rval_t
3613VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3614 int ilevel, enum xer_encoder_flags_e flags,
3615 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00003616 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003617 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3618}
3619
3620
3621/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
3622
Lev Walkina7591b52014-10-12 18:37:35 -07003623static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003624 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
3625};
3626asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
3627 "VisibleIdentifier",
3628 "VisibleIdentifier",
3629 VisibleIdentifier_free,
3630 VisibleIdentifier_print,
3631 VisibleIdentifier_constraint,
3632 VisibleIdentifier_decode_ber,
3633 VisibleIdentifier_encode_der,
3634 VisibleIdentifier_decode_xer,
3635 VisibleIdentifier_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07003636 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04003637 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003638 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00003639 asn_DEF_VisibleIdentifier_tags_1,
3640 sizeof(asn_DEF_VisibleIdentifier_tags_1)
3641 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
3642 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
3643 sizeof(asn_DEF_VisibleIdentifier_tags_1)
3644 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003645 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00003646 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003647 0, 0, /* No members */
3648 0 /* No specifics */
3649};
Lev Walkin154aa182004-09-26 13:12:56 +00003650
3651
Lev Walkin59b176e2005-11-26 11:25:14 +00003652/*** <<< INCLUDES [Sequence] >>> ***/
3653
Lev Walkin22b5ed42006-09-13 02:51:20 +00003654#include "Int1.h"
3655#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003656#include <BOOLEAN.h>
3657#include <ENUMERATED.h>
3658#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00003659#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003660#include <constr_SEQUENCE.h>
3661
3662/*** <<< DEPS [Sequence] >>> ***/
3663
3664typedef enum enum_c {
3665 enum_c_one = 1,
3666 enum_c_two = 2,
3667 /*
3668 * Enumeration is extensible
3669 */
3670 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00003671} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00003672
3673/*** <<< TYPE-DECLS [Sequence] >>> ***/
3674
3675typedef struct Sequence {
3676 Int1_t *int1_c /* DEFAULT 3 */;
3677 Int4_t int4;
3678 Int4_t int4_c;
Lev Walkin2a744a72013-03-27 01:56:23 -07003679 BOOLEAN_t *Bool /* DEFAULT 1 */;
Lev Walkin59b176e2005-11-26 11:25:14 +00003680 ENUMERATED_t enum_c;
3681 NULL_t *null /* OPTIONAL */;
3682 /*
3683 * This type is extensible,
3684 * possible extensions are below.
3685 */
3686 Int5_t *int5_c /* OPTIONAL */;
3687
3688 /* Context for parsing across buffer boundaries */
3689 asn_struct_ctx_t _asn_ctx;
3690} Sequence_t;
3691
3692/*** <<< FUNC-DECLS [Sequence] >>> ***/
3693
3694/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
3695extern asn_TYPE_descriptor_t asn_DEF_Sequence;
3696
3697/*** <<< CODE [Sequence] >>> ***/
3698
3699static int
3700enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003701 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003702 /* Replace with underlying type checker */
3703 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00003704 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00003705}
3706
3707/*
3708 * This type is implemented using ENUMERATED,
3709 * so here we adjust the DEF accordingly.
3710 */
3711static void
3712enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3713 td->free_struct = asn_DEF_ENUMERATED.free_struct;
3714 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003715 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003716 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
3717 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
3718 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
3719 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
3720 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003721 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003722 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
3723 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003724 if(!td->oer_constraints)
3725 td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003726 if(!td->per_constraints)
3727 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
3728 td->elements = asn_DEF_ENUMERATED.elements;
3729 td->elements_count = asn_DEF_ENUMERATED.elements_count;
3730 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
3731}
3732
3733static void
3734enum_c_6_free(asn_TYPE_descriptor_t *td,
3735 void *struct_ptr, int contents_only) {
3736 enum_c_6_inherit_TYPE_descriptor(td);
3737 td->free_struct(td, struct_ptr, contents_only);
3738}
3739
3740static int
3741enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3742 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3743 enum_c_6_inherit_TYPE_descriptor(td);
3744 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3745}
3746
3747static asn_dec_rval_t
3748enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3749 void **structure, const void *bufptr, size_t size, int tag_mode) {
3750 enum_c_6_inherit_TYPE_descriptor(td);
3751 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3752}
3753
3754static asn_enc_rval_t
3755enum_c_6_encode_der(asn_TYPE_descriptor_t *td,
3756 void *structure, int tag_mode, ber_tlv_tag_t tag,
3757 asn_app_consume_bytes_f *cb, void *app_key) {
3758 enum_c_6_inherit_TYPE_descriptor(td);
3759 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3760}
3761
3762static asn_dec_rval_t
3763enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3764 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3765 enum_c_6_inherit_TYPE_descriptor(td);
3766 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3767}
3768
3769static asn_enc_rval_t
3770enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3771 int ilevel, enum xer_encoder_flags_e flags,
3772 asn_app_consume_bytes_f *cb, void *app_key) {
3773 enum_c_6_inherit_TYPE_descriptor(td);
3774 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3775}
3776
3777static int
3778memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003779 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003780 const Int1_t *st = (const Int1_t *)sptr;
3781 long value;
3782
3783 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003784 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003785 "%s: value not given (%s:%d)",
3786 td->name, __FILE__, __LINE__);
3787 return -1;
3788 }
3789
3790 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003791 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003792 "%s: value too large (%s:%d)",
3793 td->name, __FILE__, __LINE__);
3794 return -1;
3795 }
3796
3797 if((value >= -2)) {
3798 /* Constraint check succeeded */
3799 return 0;
3800 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003801 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003802 "%s: constraint failed (%s:%d)",
3803 td->name, __FILE__, __LINE__);
3804 return -1;
3805 }
3806}
3807
3808static int
3809memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003810 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003811 const Int4_t *st = (const Int4_t *)sptr;
3812 long value;
3813
3814 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003815 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003816 "%s: value not given (%s:%d)",
3817 td->name, __FILE__, __LINE__);
3818 return -1;
3819 }
3820
3821 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003822 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003823 "%s: value too large (%s:%d)",
3824 td->name, __FILE__, __LINE__);
3825 return -1;
3826 }
3827
3828 if((value >= 5 && value <= 7)) {
3829 /* Constraint check succeeded */
3830 return 0;
3831 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003832 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003833 "%s: constraint failed (%s:%d)",
3834 td->name, __FILE__, __LINE__);
3835 return -1;
3836 }
3837}
3838
3839static int
3840memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003841 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003842 const Int5_t *st = (const Int5_t *)sptr;
3843 long value;
3844
3845 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003846 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003847 "%s: value not given (%s:%d)",
3848 td->name, __FILE__, __LINE__);
3849 return -1;
3850 }
3851
3852 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003853 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003854 "%s: value too large (%s:%d)",
3855 td->name, __FILE__, __LINE__);
3856 return -1;
3857 }
3858
3859 if((value == 5)) {
3860 /* Constraint check succeeded */
3861 return 0;
3862 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003863 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003864 "%s: constraint failed (%s:%d)",
3865 td->name, __FILE__, __LINE__);
3866 return -1;
3867 }
3868}
3869
3870
3871/*** <<< STAT-DEFS [Sequence] >>> ***/
3872
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003873static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003874 Int1_t *st = *sptr;
3875
3876 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003877 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00003878 st = (*sptr = CALLOC(1, sizeof(*st)));
3879 if(!st) return -1;
3880 }
3881
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003882 if(set_value) {
3883 /* Install default value 3 */
3884 return asn_long2INTEGER(st, 3);
3885 } else {
3886 /* Test default value 3 */
3887 long value;
3888 if(asn_INTEGER2long(st, &value))
3889 return -1;
3890 return (value == 3);
3891 }
Lev Walkin59b176e2005-11-26 11:25:14 +00003892}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003893static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003894 BOOLEAN_t *st = *sptr;
3895
3896 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003897 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00003898 st = (*sptr = CALLOC(1, sizeof(*st)));
3899 if(!st) return -1;
3900 }
3901
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003902 if(set_value) {
3903 /* Install default value 1 */
3904 *st = 1;
3905 return 0;
3906 } else {
3907 /* Test default value 1 */
3908 return (*st == 1);
3909 }
Lev Walkin59b176e2005-11-26 11:25:14 +00003910}
Lev Walkina7591b52014-10-12 18:37:35 -07003911static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003912 { 1, 3, "one" },
3913 { 2, 3, "two" },
3914 { 3, 5, "three" }
3915 /* This list is extensible */
3916};
Lev Walkina7591b52014-10-12 18:37:35 -07003917static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003918 0, /* one(1) */
3919 2, /* three(3) */
3920 1 /* two(2) */
3921 /* This list is extensible */
3922};
johvike70c4072017-05-09 11:06:12 +02003923static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003924 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
3925 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
3926 3, /* Number of elements in the maps */
3927 3, /* Extensions before this member */
Lev Walkin8bb57a22007-12-03 13:41:36 +00003928 1, /* Strict enumeration */
3929 0, /* Native long size */
3930 0
Lev Walkin59b176e2005-11-26 11:25:14 +00003931};
Lev Walkina7591b52014-10-12 18:37:35 -07003932static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003933 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
3934};
3935static /* Use -fall-defs-global to expose */
3936asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
3937 "enum-c",
3938 "enum-c",
3939 enum_c_6_free,
3940 enum_c_6_print,
3941 enum_c_6_constraint,
3942 enum_c_6_decode_ber,
3943 enum_c_6_encode_der,
3944 enum_c_6_decode_xer,
3945 enum_c_6_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07003946 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04003947 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003948 0, /* Use generic outmost tag fetcher */
3949 asn_DEF_enum_c_tags_6,
3950 sizeof(asn_DEF_enum_c_tags_6)
3951 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
3952 asn_DEF_enum_c_tags_6, /* Same as above */
3953 sizeof(asn_DEF_enum_c_tags_6)
3954 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003955 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00003956 0, /* No PER visible constraints */
3957 0, 0, /* Defined elsewhere */
3958 &asn_SPC_enum_c_specs_6 /* Additional specs */
3959};
3960
3961static asn_TYPE_member_t asn_MBR_Sequence_1[] = {
3962 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
3963 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
3964 .tag_mode = 0,
3965 .type = &asn_DEF_Int1,
3966 .memb_constraints = memb_int1_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04003967 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00003968 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3969 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
3970 .name = "int1-c"
3971 },
3972 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
3973 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
3974 .tag_mode = +1, /* EXPLICIT tag at current level */
3975 .type = &asn_DEF_Int4,
3976 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04003977 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00003978 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3979 .default_value = 0,
3980 .name = "int4"
3981 },
3982 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
3983 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
3984 .tag_mode = 0,
3985 .type = &asn_DEF_Int4,
3986 .memb_constraints = memb_int4_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04003987 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00003988 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3989 .default_value = 0,
3990 .name = "int4-c"
3991 },
Lev Walkin2a744a72013-03-27 01:56:23 -07003992 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +00003993 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
3994 .tag_mode = 0,
3995 .type = &asn_DEF_BOOLEAN,
3996 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04003997 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00003998 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
3999 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
4000 .name = "bool"
4001 },
4002 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
4003 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
4004 .tag_mode = 0,
4005 .type = &asn_DEF_enum_c_6,
4006 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04004007 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00004008 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
4009 .default_value = 0,
4010 .name = "enum-c"
4011 },
4012 { ATF_POINTER, 2, offsetof(struct Sequence, null),
4013 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
4014 .tag_mode = 0,
4015 .type = &asn_DEF_NULL,
4016 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04004017 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00004018 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
4019 .default_value = 0,
4020 .name = "null"
4021 },
4022 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
4023 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4024 .tag_mode = 0,
4025 .type = &asn_DEF_Int5,
4026 .memb_constraints = memb_int5_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04004027 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00004028 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
4029 .default_value = 0,
4030 .name = "int5-c"
4031 },
4032};
Lev Walkina7591b52014-10-12 18:37:35 -07004033static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004034 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4035};
Lev Walkina7591b52014-10-12 18:37:35 -07004036static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -07004037 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
4038 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
4039 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
4040 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
4041 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
4042 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
4043 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
Lev Walkin59b176e2005-11-26 11:25:14 +00004044};
4045static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
4046 sizeof(struct Sequence),
4047 offsetof(struct Sequence, _asn_ctx),
4048 asn_MAP_Sequence_tag2el_1,
4049 7, /* Count of tags in the map */
4050 0, 0, 0, /* Optional elements (not needed) */
4051 5, /* Start extensions */
4052 8 /* Stop extensions */
4053};
4054asn_TYPE_descriptor_t asn_DEF_Sequence = {
4055 "Sequence",
4056 "Sequence",
4057 SEQUENCE_free,
4058 SEQUENCE_print,
4059 SEQUENCE_constraint,
4060 SEQUENCE_decode_ber,
4061 SEQUENCE_encode_der,
4062 SEQUENCE_decode_xer,
4063 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07004064 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04004065 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004066 0, /* Use generic outmost tag fetcher */
4067 asn_DEF_Sequence_tags_1,
4068 sizeof(asn_DEF_Sequence_tags_1)
4069 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4070 asn_DEF_Sequence_tags_1, /* Same as above */
4071 sizeof(asn_DEF_Sequence_tags_1)
4072 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004073 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004074 0, /* No PER visible constraints */
4075 asn_MBR_Sequence_1,
4076 7, /* Elements count */
4077 &asn_SPC_Sequence_specs_1 /* Additional specs */
4078};
4079
4080
4081/*** <<< INCLUDES [SequenceOf] >>> ***/
4082
4083#include <asn_SEQUENCE_OF.h>
4084#include <constr_SEQUENCE_OF.h>
4085
4086/*** <<< FWD-DECLS [SequenceOf] >>> ***/
4087
4088struct Sequence;
4089
4090/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
4091
4092typedef struct SequenceOf {
4093 A_SEQUENCE_OF(struct Sequence) list;
4094
4095 /* Context for parsing across buffer boundaries */
4096 asn_struct_ctx_t _asn_ctx;
4097} SequenceOf_t;
4098
4099/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
4100
4101extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
4102
4103/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
4104
Lev Walkin22b5ed42006-09-13 02:51:20 +00004105#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004106
4107/*** <<< STAT-DEFS [SequenceOf] >>> ***/
4108
4109static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
4110 { ATF_POINTER, 0, 0,
4111 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
4112 .tag_mode = 0,
4113 .type = &asn_DEF_Sequence,
4114 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04004115 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00004116 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
4117 .default_value = 0,
4118 .name = ""
4119 },
4120};
Lev Walkina7591b52014-10-12 18:37:35 -07004121static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004122 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4123};
4124static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
4125 sizeof(struct SequenceOf),
4126 offsetof(struct SequenceOf, _asn_ctx),
4127 0, /* XER encoding is XMLDelimitedItemList */
4128};
4129asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
4130 "SequenceOf",
4131 "SequenceOf",
4132 SEQUENCE_OF_free,
4133 SEQUENCE_OF_print,
4134 SEQUENCE_OF_constraint,
4135 SEQUENCE_OF_decode_ber,
4136 SEQUENCE_OF_encode_der,
4137 SEQUENCE_OF_decode_xer,
4138 SEQUENCE_OF_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07004139 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04004140 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004141 0, /* Use generic outmost tag fetcher */
4142 asn_DEF_SequenceOf_tags_1,
4143 sizeof(asn_DEF_SequenceOf_tags_1)
4144 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4145 asn_DEF_SequenceOf_tags_1, /* Same as above */
4146 sizeof(asn_DEF_SequenceOf_tags_1)
4147 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004148 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004149 0, /* No PER visible constraints */
4150 asn_MBR_SequenceOf_1,
4151 1, /* Single element */
4152 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
4153};
4154
4155
4156/*** <<< INCLUDES [Enum0] >>> ***/
4157
4158#include <ENUMERATED.h>
4159
4160/*** <<< DEPS [Enum0] >>> ***/
4161
4162typedef enum Enum0 {
4163 Enum0_one = 0,
4164 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004165} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00004166
4167/*** <<< TYPE-DECLS [Enum0] >>> ***/
4168
4169typedef ENUMERATED_t Enum0_t;
4170
4171/*** <<< FUNC-DECLS [Enum0] >>> ***/
4172
4173extern asn_TYPE_descriptor_t asn_DEF_Enum0;
4174asn_struct_free_f Enum0_free;
4175asn_struct_print_f Enum0_print;
4176asn_constr_check_f Enum0_constraint;
4177ber_type_decoder_f Enum0_decode_ber;
4178der_type_encoder_f Enum0_encode_der;
4179xer_type_decoder_f Enum0_decode_xer;
4180xer_type_encoder_f Enum0_encode_xer;
4181
4182/*** <<< CODE [Enum0] >>> ***/
4183
4184int
4185Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004186 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004187 /* Replace with underlying type checker */
4188 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004189 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004190}
4191
4192/*
4193 * This type is implemented using ENUMERATED,
4194 * so here we adjust the DEF accordingly.
4195 */
4196static void
4197Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4198 td->free_struct = asn_DEF_ENUMERATED.free_struct;
4199 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004200 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004201 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
4202 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
4203 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
4204 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
4205 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004206 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004207 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
4208 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04004209 if(!td->oer_constraints)
4210 td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004211 if(!td->per_constraints)
4212 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
4213 td->elements = asn_DEF_ENUMERATED.elements;
4214 td->elements_count = asn_DEF_ENUMERATED.elements_count;
4215 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
4216}
4217
4218void
4219Enum0_free(asn_TYPE_descriptor_t *td,
4220 void *struct_ptr, int contents_only) {
4221 Enum0_1_inherit_TYPE_descriptor(td);
4222 td->free_struct(td, struct_ptr, contents_only);
4223}
4224
4225int
4226Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4227 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4228 Enum0_1_inherit_TYPE_descriptor(td);
4229 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4230}
4231
4232asn_dec_rval_t
4233Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4234 void **structure, const void *bufptr, size_t size, int tag_mode) {
4235 Enum0_1_inherit_TYPE_descriptor(td);
4236 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4237}
4238
4239asn_enc_rval_t
4240Enum0_encode_der(asn_TYPE_descriptor_t *td,
4241 void *structure, int tag_mode, ber_tlv_tag_t tag,
4242 asn_app_consume_bytes_f *cb, void *app_key) {
4243 Enum0_1_inherit_TYPE_descriptor(td);
4244 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4245}
4246
4247asn_dec_rval_t
4248Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4249 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4250 Enum0_1_inherit_TYPE_descriptor(td);
4251 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4252}
4253
4254asn_enc_rval_t
4255Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4256 int ilevel, enum xer_encoder_flags_e flags,
4257 asn_app_consume_bytes_f *cb, void *app_key) {
4258 Enum0_1_inherit_TYPE_descriptor(td);
4259 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4260}
4261
4262
4263/*** <<< STAT-DEFS [Enum0] >>> ***/
4264
Lev Walkina7591b52014-10-12 18:37:35 -07004265static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004266 { 0, 3, "one" },
4267 { 1, 3, "two" }
4268};
Lev Walkina7591b52014-10-12 18:37:35 -07004269static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004270 0, /* one(0) */
4271 1 /* two(1) */
4272};
johvike70c4072017-05-09 11:06:12 +02004273static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004274 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
4275 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
4276 2, /* Number of elements in the maps */
4277 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004278 1, /* Strict enumeration */
4279 0, /* Native long size */
4280 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004281};
Lev Walkina7591b52014-10-12 18:37:35 -07004282static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004283 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4284};
4285asn_TYPE_descriptor_t asn_DEF_Enum0 = {
4286 "Enum0",
4287 "Enum0",
4288 Enum0_free,
4289 Enum0_print,
4290 Enum0_constraint,
4291 Enum0_decode_ber,
4292 Enum0_encode_der,
4293 Enum0_decode_xer,
4294 Enum0_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07004295 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04004296 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004297 0, /* Use generic outmost tag fetcher */
4298 asn_DEF_Enum0_tags_1,
4299 sizeof(asn_DEF_Enum0_tags_1)
4300 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4301 asn_DEF_Enum0_tags_1, /* Same as above */
4302 sizeof(asn_DEF_Enum0_tags_1)
4303 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004304 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004305 0, /* No PER visible constraints */
4306 0, 0, /* Defined elsewhere */
4307 &asn_SPC_Enum0_specs_1 /* Additional specs */
4308};
4309
4310
4311/*** <<< INCLUDES [Enum1] >>> ***/
4312
4313#include <NativeEnumerated.h>
4314
4315/*** <<< DEPS [Enum1] >>> ***/
4316
4317typedef enum Enum1 {
4318 Enum1_one = 0,
4319 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004320} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00004321
4322/*** <<< TYPE-DECLS [Enum1] >>> ***/
4323
4324typedef long Enum1_t;
4325
4326/*** <<< FUNC-DECLS [Enum1] >>> ***/
4327
4328extern asn_TYPE_descriptor_t asn_DEF_Enum1;
4329asn_struct_free_f Enum1_free;
4330asn_struct_print_f Enum1_print;
4331asn_constr_check_f Enum1_constraint;
4332ber_type_decoder_f Enum1_decode_ber;
4333der_type_encoder_f Enum1_encode_der;
4334xer_type_decoder_f Enum1_decode_xer;
4335xer_type_encoder_f Enum1_encode_xer;
4336
4337/*** <<< CODE [Enum1] >>> ***/
4338
4339int
4340Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004341 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004342 long value;
4343
4344 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004345 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004346 "%s: value not given (%s:%d)",
4347 td->name, __FILE__, __LINE__);
4348 return -1;
4349 }
4350
4351 value = *(const long *)sptr;
4352
4353 if((value == 0)) {
4354 /* Constraint check succeeded */
4355 return 0;
4356 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004357 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004358 "%s: constraint failed (%s:%d)",
4359 td->name, __FILE__, __LINE__);
4360 return -1;
4361 }
4362}
4363
4364/*
4365 * This type is implemented using NativeEnumerated,
4366 * so here we adjust the DEF accordingly.
4367 */
4368static void
4369Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4370 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4371 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004372 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004373 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4374 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4375 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4376 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4377 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004378 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004379 td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder;
4380 td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04004381 if(!td->oer_constraints)
4382 td->oer_constraints = asn_DEF_NativeEnumerated.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004383 if(!td->per_constraints)
4384 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4385 td->elements = asn_DEF_NativeEnumerated.elements;
4386 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4387 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
4388}
4389
4390void
4391Enum1_free(asn_TYPE_descriptor_t *td,
4392 void *struct_ptr, int contents_only) {
4393 Enum1_1_inherit_TYPE_descriptor(td);
4394 td->free_struct(td, struct_ptr, contents_only);
4395}
4396
4397int
4398Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4399 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4400 Enum1_1_inherit_TYPE_descriptor(td);
4401 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4402}
4403
4404asn_dec_rval_t
4405Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4406 void **structure, const void *bufptr, size_t size, int tag_mode) {
4407 Enum1_1_inherit_TYPE_descriptor(td);
4408 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4409}
4410
4411asn_enc_rval_t
4412Enum1_encode_der(asn_TYPE_descriptor_t *td,
4413 void *structure, int tag_mode, ber_tlv_tag_t tag,
4414 asn_app_consume_bytes_f *cb, void *app_key) {
4415 Enum1_1_inherit_TYPE_descriptor(td);
4416 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4417}
4418
4419asn_dec_rval_t
4420Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4421 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4422 Enum1_1_inherit_TYPE_descriptor(td);
4423 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4424}
4425
4426asn_enc_rval_t
4427Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4428 int ilevel, enum xer_encoder_flags_e flags,
4429 asn_app_consume_bytes_f *cb, void *app_key) {
4430 Enum1_1_inherit_TYPE_descriptor(td);
4431 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4432}
4433
4434
4435/*** <<< STAT-DEFS [Enum1] >>> ***/
4436
Lev Walkina7591b52014-10-12 18:37:35 -07004437static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004438 { 0, 3, "one" },
4439 { 1, 3, "two" }
4440};
Lev Walkina7591b52014-10-12 18:37:35 -07004441static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004442 0, /* one(0) */
4443 1 /* two(1) */
4444};
johvike70c4072017-05-09 11:06:12 +02004445static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004446 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
4447 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
4448 2, /* Number of elements in the maps */
4449 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004450 1, /* Strict enumeration */
4451 0, /* Native long size */
4452 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004453};
Lev Walkina7591b52014-10-12 18:37:35 -07004454static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004455 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4456};
4457asn_TYPE_descriptor_t asn_DEF_Enum1 = {
4458 "Enum1",
4459 "Enum1",
4460 Enum1_free,
4461 Enum1_print,
4462 Enum1_constraint,
4463 Enum1_decode_ber,
4464 Enum1_encode_der,
4465 Enum1_decode_xer,
4466 Enum1_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07004467 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04004468 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004469 0, /* Use generic outmost tag fetcher */
4470 asn_DEF_Enum1_tags_1,
4471 sizeof(asn_DEF_Enum1_tags_1)
4472 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4473 asn_DEF_Enum1_tags_1, /* Same as above */
4474 sizeof(asn_DEF_Enum1_tags_1)
4475 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004476 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004477 0, /* No PER visible constraints */
4478 0, 0, /* Defined elsewhere */
4479 &asn_SPC_Enum1_specs_1 /* Additional specs */
4480};
4481
4482
Lev Walkin154aa182004-09-26 13:12:56 +00004483/*** <<< INCLUDES [Identifier] >>> ***/
4484
4485#include <VisibleString.h>
4486
4487/*** <<< TYPE-DECLS [Identifier] >>> ***/
4488
Lev Walkin154aa182004-09-26 13:12:56 +00004489typedef VisibleString_t Identifier_t;
4490
4491/*** <<< FUNC-DECLS [Identifier] >>> ***/
4492
Lev Walkindfae9752004-09-29 13:19:37 +00004493extern asn_TYPE_descriptor_t asn_DEF_Identifier;
Lev Walkin154aa182004-09-26 13:12:56 +00004494asn_struct_free_f Identifier_free;
4495asn_struct_print_f Identifier_print;
4496asn_constr_check_f Identifier_constraint;
4497ber_type_decoder_f Identifier_decode_ber;
4498der_type_encoder_f Identifier_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00004499xer_type_decoder_f Identifier_decode_xer;
Lev Walkin154aa182004-09-26 13:12:56 +00004500xer_type_encoder_f Identifier_encode_xer;
4501
4502/*** <<< CTABLES [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004503
Lev Walkina7591b52014-10-12 18:37:35 -07004504static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00004505 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4506 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4507 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
4508 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
4509 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
451027,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
4511 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
451254,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004513};
4514
Lev Walkine8318b82005-03-06 09:29:03 +00004515static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07004516 const int *table = permitted_alphabet_table_1;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004517 /* The underlying type is VisibleString */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00004518 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004519 const uint8_t *ch = st->buf;
4520 const uint8_t *end = ch + st->size;
4521
4522 for(; ch < end; ch++) {
4523 uint8_t cv = *ch;
4524 if(!table[cv]) return -1;
4525 }
4526 return 0;
4527}
4528
4529
Lev Walkin154aa182004-09-26 13:12:56 +00004530/*** <<< CODE [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004531
4532int
Lev Walkindfae9752004-09-29 13:19:37 +00004533Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004534 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00004535 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004536 size_t size;
4537
4538 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004539 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004540 "%s: value not given (%s:%d)",
4541 td->name, __FILE__, __LINE__);
4542 return -1;
4543 }
4544
4545 size = st->size;
4546
4547 if((size >= 1 && size <= 32)
Lev Walkine8318b82005-03-06 09:29:03 +00004548 && !check_permitted_alphabet_1(st)) {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004549 /* Constraint check succeeded */
4550 return 0;
4551 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004552 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004553 "%s: constraint failed (%s:%d)",
4554 td->name, __FILE__, __LINE__);
4555 return -1;
4556 }
4557}
4558
4559/*
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004560 * This type is implemented using VisibleString,
Lev Walkinc3808c12004-09-23 22:14:58 +00004561 * so here we adjust the DEF accordingly.
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004562 */
4563static void
Lev Walkine8318b82005-03-06 09:29:03 +00004564Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00004565 td->free_struct = asn_DEF_VisibleString.free_struct;
4566 td->print_struct = asn_DEF_VisibleString.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004567 td->check_constraints = asn_DEF_VisibleString.check_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00004568 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
4569 td->der_encoder = asn_DEF_VisibleString.der_encoder;
4570 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
4571 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004572 td->uper_decoder = asn_DEF_VisibleString.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004573 td->uper_encoder = asn_DEF_VisibleString.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004574 td->oer_decoder = asn_DEF_VisibleString.oer_decoder;
4575 td->oer_encoder = asn_DEF_VisibleString.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04004576 if(!td->oer_constraints)
4577 td->oer_constraints = asn_DEF_VisibleString.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004578 if(!td->per_constraints)
4579 td->per_constraints = asn_DEF_VisibleString.per_constraints;
Lev Walkindfae9752004-09-29 13:19:37 +00004580 td->elements = asn_DEF_VisibleString.elements;
4581 td->elements_count = asn_DEF_VisibleString.elements_count;
4582 td->specifics = asn_DEF_VisibleString.specifics;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004583}
4584
Lev Walkina9cc46e2004-09-22 16:06:28 +00004585void
Lev Walkindfae9752004-09-29 13:19:37 +00004586Identifier_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00004587 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +00004588 Identifier_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00004589 td->free_struct(td, struct_ptr, contents_only);
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004590}
4591
4592int
Lev Walkindfae9752004-09-29 13:19:37 +00004593Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004594 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00004595 Identifier_1_inherit_TYPE_descriptor(td);
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004596 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4597}
4598
Lev Walkindc06f6b2004-10-20 15:50:55 +00004599asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00004600Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00004601 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +00004602 Identifier_1_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00004603 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00004604}
4605
4606asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00004607Identifier_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00004608 void *structure, int tag_mode, ber_tlv_tag_t tag,
4609 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00004610 Identifier_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00004611 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4612}
4613
Lev Walkin0ebe8b32004-10-23 13:26:56 +00004614asn_dec_rval_t
4615Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +00004616 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +00004617 Identifier_1_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00004618 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4619}
4620
Lev Walkina9cc46e2004-09-22 16:06:28 +00004621asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00004622Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00004623 int ilevel, enum xer_encoder_flags_e flags,
4624 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +00004625 Identifier_1_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00004626 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004627}
4628
4629
4630/*** <<< STAT-DEFS [Identifier] >>> ***/
4631
Lev Walkina7591b52014-10-12 18:37:35 -07004632static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004633 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
4634};
Lev Walkindfae9752004-09-29 13:19:37 +00004635asn_TYPE_descriptor_t asn_DEF_Identifier = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004636 "Identifier",
Lev Walkindc06f6b2004-10-20 15:50:55 +00004637 "Identifier",
Lev Walkina9cc46e2004-09-22 16:06:28 +00004638 Identifier_free,
4639 Identifier_print,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004640 Identifier_constraint,
4641 Identifier_decode_ber,
4642 Identifier_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00004643 Identifier_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00004644 Identifier_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -07004645 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +04004646 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004647 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00004648 asn_DEF_Identifier_tags_1,
4649 sizeof(asn_DEF_Identifier_tags_1)
4650 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
4651 asn_DEF_Identifier_tags_1, /* Same as above */
4652 sizeof(asn_DEF_Identifier_tags_1)
4653 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004654 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004655 0, /* No PER visible constraints */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00004656 0, 0, /* No members */
4657 0 /* No specifics */
4658};
4659