blob: 15d438d70f32723805bdbf29cdc6a7e86b1008ec [file] [log] [blame]
Lev Walkin59b176e2005-11-26 11:25:14 +00001
2/*** <<< INCLUDES [Int1] >>> ***/
3
Lev Walkin2a744a72013-03-27 01:56:23 -07004#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00005
6/*** <<< TYPE-DECLS [Int1] >>> ***/
7
Lev Walkin2a744a72013-03-27 01:56:23 -07008typedef long Int1_t;
Lev Walkin59b176e2005-11-26 11:25:14 +00009
10/*** <<< FUNC-DECLS [Int1] >>> ***/
11
12extern asn_TYPE_descriptor_t asn_DEF_Int1;
13asn_struct_free_f Int1_free;
14asn_struct_print_f Int1_print;
15asn_constr_check_f Int1_constraint;
16ber_type_decoder_f Int1_decode_ber;
17der_type_encoder_f Int1_encode_der;
18xer_type_decoder_f Int1_decode_xer;
19xer_type_encoder_f Int1_encode_xer;
20per_type_decoder_f Int1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000021per_type_encoder_f Int1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +000022
23/*** <<< CODE [Int1] >>> ***/
24
25int
26Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000027 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +000028 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -070029 td->check_constraints = asn_DEF_NativeInteger.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +000030 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +000031}
32
33/*
Lev Walkin2a744a72013-03-27 01:56:23 -070034 * This type is implemented using NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +000035 * so here we adjust the DEF accordingly.
36 */
37static void
38Int1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -070039 td->free_struct = asn_DEF_NativeInteger.free_struct;
40 td->print_struct = asn_DEF_NativeInteger.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -080041 td->check_constraints = asn_DEF_NativeInteger.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -070042 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
43 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
44 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
45 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
46 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
47 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -070048 td->oer_decoder = asn_DEF_NativeInteger.oer_decoder;
49 td->oer_encoder = asn_DEF_NativeInteger.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +040050 if(!td->oer_constraints)
51 td->oer_constraints = asn_DEF_NativeInteger.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +000052 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -070053 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
54 td->elements = asn_DEF_NativeInteger.elements;
55 td->elements_count = asn_DEF_NativeInteger.elements_count;
56 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin59b176e2005-11-26 11:25:14 +000057}
58
59void
60Int1_free(asn_TYPE_descriptor_t *td,
61 void *struct_ptr, int contents_only) {
62 Int1_1_inherit_TYPE_descriptor(td);
63 td->free_struct(td, struct_ptr, contents_only);
64}
65
66int
67Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
68 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
69 Int1_1_inherit_TYPE_descriptor(td);
70 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
71}
72
73asn_dec_rval_t
74Int1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
75 void **structure, const void *bufptr, size_t size, int tag_mode) {
76 Int1_1_inherit_TYPE_descriptor(td);
77 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
78}
79
80asn_enc_rval_t
81Int1_encode_der(asn_TYPE_descriptor_t *td,
82 void *structure, int tag_mode, ber_tlv_tag_t tag,
83 asn_app_consume_bytes_f *cb, void *app_key) {
84 Int1_1_inherit_TYPE_descriptor(td);
85 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
86}
87
88asn_dec_rval_t
89Int1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
90 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
91 Int1_1_inherit_TYPE_descriptor(td);
92 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
93}
94
95asn_enc_rval_t
96Int1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
97 int ilevel, enum xer_encoder_flags_e flags,
98 asn_app_consume_bytes_f *cb, void *app_key) {
99 Int1_1_inherit_TYPE_descriptor(td);
100 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
101}
102
103asn_dec_rval_t
104Int1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
105 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
106 Int1_1_inherit_TYPE_descriptor(td);
107 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
108}
109
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000110asn_enc_rval_t
111Int1_encode_uper(asn_TYPE_descriptor_t *td,
112 asn_per_constraints_t *constraints,
113 void *structure, asn_per_outp_t *per_out) {
114 Int1_1_inherit_TYPE_descriptor(td);
115 return td->uper_encoder(td, constraints, structure, per_out);
116}
117
Lev Walkin59b176e2005-11-26 11:25:14 +0000118
119/*** <<< STAT-DEFS [Int1] >>> ***/
120
Lev Walkina7591b52014-10-12 18:37:35 -0700121static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000122 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
123};
124asn_TYPE_descriptor_t asn_DEF_Int1 = {
125 "Int1",
126 "Int1",
127 Int1_free,
128 Int1_print,
129 Int1_constraint,
130 Int1_decode_ber,
131 Int1_encode_der,
132 Int1_decode_xer,
133 Int1_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400134 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000135 Int1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000136 Int1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000137 0, /* Use generic outmost tag fetcher */
138 asn_DEF_Int1_tags_1,
139 sizeof(asn_DEF_Int1_tags_1)
140 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
141 asn_DEF_Int1_tags_1, /* Same as above */
142 sizeof(asn_DEF_Int1_tags_1)
143 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400144 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000145 0, /* No PER visible constraints */
146 0, 0, /* No members */
147 0 /* No specifics */
148};
149
150
151/*** <<< INCLUDES [Int2] >>> ***/
152
Lev Walkin22b5ed42006-09-13 02:51:20 +0000153#include "Int1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000154
155/*** <<< TYPE-DECLS [Int2] >>> ***/
156
157typedef Int1_t Int2_t;
158
159/*** <<< FUNC-DECLS [Int2] >>> ***/
160
161extern asn_TYPE_descriptor_t asn_DEF_Int2;
162asn_struct_free_f Int2_free;
163asn_struct_print_f Int2_print;
164asn_constr_check_f Int2_constraint;
165ber_type_decoder_f Int2_decode_ber;
166der_type_encoder_f Int2_encode_der;
167xer_type_decoder_f Int2_decode_xer;
168xer_type_encoder_f Int2_encode_xer;
169per_type_decoder_f Int2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000170per_type_encoder_f Int2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000171
172/*** <<< CODE [Int2] >>> ***/
173
174int
175Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000176 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000177 long value;
178
179 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700180 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000181 "%s: value not given (%s:%d)",
182 td->name, __FILE__, __LINE__);
183 return -1;
184 }
185
Lev Walkin2a744a72013-03-27 01:56:23 -0700186 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000187
188 if((value >= 0)) {
189 /* Constraint check succeeded */
190 return 0;
191 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700192 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000193 "%s: constraint failed (%s:%d)",
194 td->name, __FILE__, __LINE__);
195 return -1;
196 }
197}
198
199/*
200 * This type is implemented using Int1,
201 * so here we adjust the DEF accordingly.
202 */
203static void
204Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
205 td->free_struct = asn_DEF_Int1.free_struct;
206 td->print_struct = asn_DEF_Int1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800207 td->check_constraints = asn_DEF_Int1.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000208 td->ber_decoder = asn_DEF_Int1.ber_decoder;
209 td->der_encoder = asn_DEF_Int1.der_encoder;
210 td->xer_decoder = asn_DEF_Int1.xer_decoder;
211 td->xer_encoder = asn_DEF_Int1.xer_encoder;
212 td->uper_decoder = asn_DEF_Int1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000213 td->uper_encoder = asn_DEF_Int1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700214 td->oer_decoder = asn_DEF_Int1.oer_decoder;
215 td->oer_encoder = asn_DEF_Int1.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400216 if(!td->oer_constraints)
217 td->oer_constraints = asn_DEF_Int1.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000218 if(!td->per_constraints)
219 td->per_constraints = asn_DEF_Int1.per_constraints;
220 td->elements = asn_DEF_Int1.elements;
221 td->elements_count = asn_DEF_Int1.elements_count;
222 td->specifics = asn_DEF_Int1.specifics;
223}
224
225void
226Int2_free(asn_TYPE_descriptor_t *td,
227 void *struct_ptr, int contents_only) {
228 Int2_1_inherit_TYPE_descriptor(td);
229 td->free_struct(td, struct_ptr, contents_only);
230}
231
232int
233Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
234 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
235 Int2_1_inherit_TYPE_descriptor(td);
236 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
237}
238
239asn_dec_rval_t
240Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
241 void **structure, const void *bufptr, size_t size, int tag_mode) {
242 Int2_1_inherit_TYPE_descriptor(td);
243 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
244}
245
246asn_enc_rval_t
247Int2_encode_der(asn_TYPE_descriptor_t *td,
248 void *structure, int tag_mode, ber_tlv_tag_t tag,
249 asn_app_consume_bytes_f *cb, void *app_key) {
250 Int2_1_inherit_TYPE_descriptor(td);
251 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
252}
253
254asn_dec_rval_t
255Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
256 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
257 Int2_1_inherit_TYPE_descriptor(td);
258 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
259}
260
261asn_enc_rval_t
262Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
263 int ilevel, enum xer_encoder_flags_e flags,
264 asn_app_consume_bytes_f *cb, void *app_key) {
265 Int2_1_inherit_TYPE_descriptor(td);
266 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
267}
268
269asn_dec_rval_t
270Int2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
271 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
272 Int2_1_inherit_TYPE_descriptor(td);
273 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
274}
275
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000276asn_enc_rval_t
277Int2_encode_uper(asn_TYPE_descriptor_t *td,
278 asn_per_constraints_t *constraints,
279 void *structure, asn_per_outp_t *per_out) {
280 Int2_1_inherit_TYPE_descriptor(td);
281 return td->uper_encoder(td, constraints, structure, per_out);
282}
283
Lev Walkin59b176e2005-11-26 11:25:14 +0000284
Lev Walkin725883b2006-10-09 12:07:58 +0000285/*** <<< CTDEFS [Int2] >>> ***/
286
Lev Walkin2fce55d2013-03-28 05:00:39 -0700287static asn_per_constraints_t asn_PER_type_Int2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000288 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
289 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
290 0, 0 /* No PER value map */
291};
292
Lev Walkin59b176e2005-11-26 11:25:14 +0000293/*** <<< STAT-DEFS [Int2] >>> ***/
294
Lev Walkina7591b52014-10-12 18:37:35 -0700295static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000296 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
297};
Lev Walkin59b176e2005-11-26 11:25:14 +0000298asn_TYPE_descriptor_t asn_DEF_Int2 = {
299 "Int2",
300 "Int2",
301 Int2_free,
302 Int2_print,
303 Int2_constraint,
304 Int2_decode_ber,
305 Int2_encode_der,
306 Int2_decode_xer,
307 Int2_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400308 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000309 Int2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000310 Int2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000311 0, /* Use generic outmost tag fetcher */
312 asn_DEF_Int2_tags_1,
313 sizeof(asn_DEF_Int2_tags_1)
314 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
315 asn_DEF_Int2_tags_1, /* Same as above */
316 sizeof(asn_DEF_Int2_tags_1)
317 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400318 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000319 &asn_PER_type_Int2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000320 0, 0, /* No members */
321 0 /* No specifics */
322};
323
324
325/*** <<< INCLUDES [Int3] >>> ***/
326
Lev Walkin22b5ed42006-09-13 02:51:20 +0000327#include "Int2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000328
329/*** <<< TYPE-DECLS [Int3] >>> ***/
330
331typedef Int2_t Int3_t;
332
333/*** <<< FUNC-DECLS [Int3] >>> ***/
334
335extern asn_TYPE_descriptor_t asn_DEF_Int3;
336asn_struct_free_f Int3_free;
337asn_struct_print_f Int3_print;
338asn_constr_check_f Int3_constraint;
339ber_type_decoder_f Int3_decode_ber;
340der_type_encoder_f Int3_encode_der;
341xer_type_decoder_f Int3_decode_xer;
342xer_type_encoder_f Int3_encode_xer;
343per_type_decoder_f Int3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000344per_type_encoder_f Int3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000345
346/*** <<< CODE [Int3] >>> ***/
347
348int
349Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000350 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000351 long value;
352
353 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700354 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000355 "%s: value not given (%s:%d)",
356 td->name, __FILE__, __LINE__);
357 return -1;
358 }
359
Lev Walkin2a744a72013-03-27 01:56:23 -0700360 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000361
362 if((value >= 0 && value <= 10)) {
363 /* Constraint check succeeded */
364 return 0;
365 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700366 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000367 "%s: constraint failed (%s:%d)",
368 td->name, __FILE__, __LINE__);
369 return -1;
370 }
371}
372
373/*
374 * This type is implemented using Int2,
375 * so here we adjust the DEF accordingly.
376 */
377static void
378Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
379 td->free_struct = asn_DEF_Int2.free_struct;
380 td->print_struct = asn_DEF_Int2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800381 td->check_constraints = asn_DEF_Int2.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000382 td->ber_decoder = asn_DEF_Int2.ber_decoder;
383 td->der_encoder = asn_DEF_Int2.der_encoder;
384 td->xer_decoder = asn_DEF_Int2.xer_decoder;
385 td->xer_encoder = asn_DEF_Int2.xer_encoder;
386 td->uper_decoder = asn_DEF_Int2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000387 td->uper_encoder = asn_DEF_Int2.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700388 td->oer_decoder = asn_DEF_Int2.oer_decoder;
389 td->oer_encoder = asn_DEF_Int2.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400390 if(!td->oer_constraints)
391 td->oer_constraints = asn_DEF_Int2.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000392 if(!td->per_constraints)
393 td->per_constraints = asn_DEF_Int2.per_constraints;
394 td->elements = asn_DEF_Int2.elements;
395 td->elements_count = asn_DEF_Int2.elements_count;
396 td->specifics = asn_DEF_Int2.specifics;
397}
398
399void
400Int3_free(asn_TYPE_descriptor_t *td,
401 void *struct_ptr, int contents_only) {
402 Int3_1_inherit_TYPE_descriptor(td);
403 td->free_struct(td, struct_ptr, contents_only);
404}
405
406int
407Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
408 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
409 Int3_1_inherit_TYPE_descriptor(td);
410 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
411}
412
413asn_dec_rval_t
414Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
415 void **structure, const void *bufptr, size_t size, int tag_mode) {
416 Int3_1_inherit_TYPE_descriptor(td);
417 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
418}
419
420asn_enc_rval_t
421Int3_encode_der(asn_TYPE_descriptor_t *td,
422 void *structure, int tag_mode, ber_tlv_tag_t tag,
423 asn_app_consume_bytes_f *cb, void *app_key) {
424 Int3_1_inherit_TYPE_descriptor(td);
425 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
426}
427
428asn_dec_rval_t
429Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
430 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
431 Int3_1_inherit_TYPE_descriptor(td);
432 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
433}
434
435asn_enc_rval_t
436Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
437 int ilevel, enum xer_encoder_flags_e flags,
438 asn_app_consume_bytes_f *cb, void *app_key) {
439 Int3_1_inherit_TYPE_descriptor(td);
440 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
441}
442
443asn_dec_rval_t
444Int3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
445 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
446 Int3_1_inherit_TYPE_descriptor(td);
447 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
448}
449
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000450asn_enc_rval_t
451Int3_encode_uper(asn_TYPE_descriptor_t *td,
452 asn_per_constraints_t *constraints,
453 void *structure, asn_per_outp_t *per_out) {
454 Int3_1_inherit_TYPE_descriptor(td);
455 return td->uper_encoder(td, constraints, structure, per_out);
456}
457
Lev Walkin59b176e2005-11-26 11:25:14 +0000458
Lev Walkin725883b2006-10-09 12:07:58 +0000459/*** <<< CTDEFS [Int3] >>> ***/
460
Lev Walkin2fce55d2013-03-28 05:00:39 -0700461static asn_per_constraints_t asn_PER_type_Int3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000462 { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
463 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
464 0, 0 /* No PER value map */
465};
466
Lev Walkin59b176e2005-11-26 11:25:14 +0000467/*** <<< STAT-DEFS [Int3] >>> ***/
468
Lev Walkina7591b52014-10-12 18:37:35 -0700469static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000470 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
471};
Lev Walkin59b176e2005-11-26 11:25:14 +0000472asn_TYPE_descriptor_t asn_DEF_Int3 = {
473 "Int3",
474 "Int3",
475 Int3_free,
476 Int3_print,
477 Int3_constraint,
478 Int3_decode_ber,
479 Int3_encode_der,
480 Int3_decode_xer,
481 Int3_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400482 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000483 Int3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000484 Int3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000485 0, /* Use generic outmost tag fetcher */
486 asn_DEF_Int3_tags_1,
487 sizeof(asn_DEF_Int3_tags_1)
488 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
489 asn_DEF_Int3_tags_1, /* Same as above */
490 sizeof(asn_DEF_Int3_tags_1)
491 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400492 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000493 &asn_PER_type_Int3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000494 0, 0, /* No members */
495 0 /* No specifics */
496};
497
498
499/*** <<< INCLUDES [Int4] >>> ***/
500
Lev Walkin22b5ed42006-09-13 02:51:20 +0000501#include "Int3.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000502
503/*** <<< TYPE-DECLS [Int4] >>> ***/
504
505typedef Int3_t Int4_t;
506
507/*** <<< FUNC-DECLS [Int4] >>> ***/
508
509extern asn_TYPE_descriptor_t asn_DEF_Int4;
510asn_struct_free_f Int4_free;
511asn_struct_print_f Int4_print;
512asn_constr_check_f Int4_constraint;
513ber_type_decoder_f Int4_decode_ber;
514der_type_encoder_f Int4_encode_der;
515xer_type_decoder_f Int4_decode_xer;
516xer_type_encoder_f Int4_encode_xer;
517per_type_decoder_f Int4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000518per_type_encoder_f Int4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000519
520/*** <<< CODE [Int4] >>> ***/
521
522int
523Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000524 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000525 long value;
526
527 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700528 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000529 "%s: value not given (%s:%d)",
530 td->name, __FILE__, __LINE__);
531 return -1;
532 }
533
Lev Walkin2a744a72013-03-27 01:56:23 -0700534 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000535
536 if((value >= 1 && value <= 10)) {
537 /* Constraint check succeeded */
538 return 0;
539 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700540 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000541 "%s: constraint failed (%s:%d)",
542 td->name, __FILE__, __LINE__);
543 return -1;
544 }
545}
546
547/*
548 * This type is implemented using Int3,
549 * so here we adjust the DEF accordingly.
550 */
551static void
552Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
553 td->free_struct = asn_DEF_Int3.free_struct;
554 td->print_struct = asn_DEF_Int3.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800555 td->check_constraints = asn_DEF_Int3.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000556 td->ber_decoder = asn_DEF_Int3.ber_decoder;
557 td->der_encoder = asn_DEF_Int3.der_encoder;
558 td->xer_decoder = asn_DEF_Int3.xer_decoder;
559 td->xer_encoder = asn_DEF_Int3.xer_encoder;
560 td->uper_decoder = asn_DEF_Int3.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000561 td->uper_encoder = asn_DEF_Int3.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700562 td->oer_decoder = asn_DEF_Int3.oer_decoder;
563 td->oer_encoder = asn_DEF_Int3.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400564 if(!td->oer_constraints)
565 td->oer_constraints = asn_DEF_Int3.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000566 if(!td->per_constraints)
567 td->per_constraints = asn_DEF_Int3.per_constraints;
568 td->elements = asn_DEF_Int3.elements;
569 td->elements_count = asn_DEF_Int3.elements_count;
570 td->specifics = asn_DEF_Int3.specifics;
571}
572
573void
574Int4_free(asn_TYPE_descriptor_t *td,
575 void *struct_ptr, int contents_only) {
576 Int4_1_inherit_TYPE_descriptor(td);
577 td->free_struct(td, struct_ptr, contents_only);
578}
579
580int
581Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
582 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
583 Int4_1_inherit_TYPE_descriptor(td);
584 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
585}
586
587asn_dec_rval_t
588Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
589 void **structure, const void *bufptr, size_t size, int tag_mode) {
590 Int4_1_inherit_TYPE_descriptor(td);
591 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
592}
593
594asn_enc_rval_t
595Int4_encode_der(asn_TYPE_descriptor_t *td,
596 void *structure, int tag_mode, ber_tlv_tag_t tag,
597 asn_app_consume_bytes_f *cb, void *app_key) {
598 Int4_1_inherit_TYPE_descriptor(td);
599 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
600}
601
602asn_dec_rval_t
603Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
604 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
605 Int4_1_inherit_TYPE_descriptor(td);
606 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
607}
608
609asn_enc_rval_t
610Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
611 int ilevel, enum xer_encoder_flags_e flags,
612 asn_app_consume_bytes_f *cb, void *app_key) {
613 Int4_1_inherit_TYPE_descriptor(td);
614 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
615}
616
617asn_dec_rval_t
618Int4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
619 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
620 Int4_1_inherit_TYPE_descriptor(td);
621 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
622}
623
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000624asn_enc_rval_t
625Int4_encode_uper(asn_TYPE_descriptor_t *td,
626 asn_per_constraints_t *constraints,
627 void *structure, asn_per_outp_t *per_out) {
628 Int4_1_inherit_TYPE_descriptor(td);
629 return td->uper_encoder(td, constraints, structure, per_out);
630}
631
Lev Walkin59b176e2005-11-26 11:25:14 +0000632
Lev Walkin725883b2006-10-09 12:07:58 +0000633/*** <<< CTDEFS [Int4] >>> ***/
634
Lev Walkin2fce55d2013-03-28 05:00:39 -0700635static asn_per_constraints_t asn_PER_type_Int4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000636 { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
637 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
638 0, 0 /* No PER value map */
639};
640
Lev Walkin59b176e2005-11-26 11:25:14 +0000641/*** <<< STAT-DEFS [Int4] >>> ***/
642
Lev Walkina7591b52014-10-12 18:37:35 -0700643static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000644 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
645};
Lev Walkin59b176e2005-11-26 11:25:14 +0000646asn_TYPE_descriptor_t asn_DEF_Int4 = {
647 "Int4",
648 "Int4",
649 Int4_free,
650 Int4_print,
651 Int4_constraint,
652 Int4_decode_ber,
653 Int4_encode_der,
654 Int4_decode_xer,
655 Int4_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400656 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000657 Int4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000658 Int4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000659 0, /* Use generic outmost tag fetcher */
660 asn_DEF_Int4_tags_1,
661 sizeof(asn_DEF_Int4_tags_1)
662 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
663 asn_DEF_Int4_tags_1, /* Same as above */
664 sizeof(asn_DEF_Int4_tags_1)
665 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400666 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000667 &asn_PER_type_Int4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000668 0, 0, /* No members */
669 0 /* No specifics */
670};
671
672
673/*** <<< INCLUDES [Int5] >>> ***/
674
Lev Walkin22b5ed42006-09-13 02:51:20 +0000675#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000676
677/*** <<< TYPE-DECLS [Int5] >>> ***/
678
679typedef Int4_t Int5_t;
680
681/*** <<< FUNC-DECLS [Int5] >>> ***/
682
683extern asn_TYPE_descriptor_t asn_DEF_Int5;
684asn_struct_free_f Int5_free;
685asn_struct_print_f Int5_print;
686asn_constr_check_f Int5_constraint;
687ber_type_decoder_f Int5_decode_ber;
688der_type_encoder_f Int5_encode_der;
689xer_type_decoder_f Int5_decode_xer;
690xer_type_encoder_f Int5_encode_xer;
691per_type_decoder_f Int5_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000692per_type_encoder_f Int5_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000693
694/*** <<< CODE [Int5] >>> ***/
695
696int
697Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000698 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000699 long value;
700
701 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700702 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000703 "%s: value not given (%s:%d)",
704 td->name, __FILE__, __LINE__);
705 return -1;
706 }
707
Lev Walkin2a744a72013-03-27 01:56:23 -0700708 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000709
710 if((value == 5)) {
711 /* Constraint check succeeded */
712 return 0;
713 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700714 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000715 "%s: constraint failed (%s:%d)",
716 td->name, __FILE__, __LINE__);
717 return -1;
718 }
719}
720
721/*
722 * This type is implemented using Int4,
723 * so here we adjust the DEF accordingly.
724 */
725static void
726Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
727 td->free_struct = asn_DEF_Int4.free_struct;
728 td->print_struct = asn_DEF_Int4.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800729 td->check_constraints = asn_DEF_Int4.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000730 td->ber_decoder = asn_DEF_Int4.ber_decoder;
731 td->der_encoder = asn_DEF_Int4.der_encoder;
732 td->xer_decoder = asn_DEF_Int4.xer_decoder;
733 td->xer_encoder = asn_DEF_Int4.xer_encoder;
734 td->uper_decoder = asn_DEF_Int4.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000735 td->uper_encoder = asn_DEF_Int4.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700736 td->oer_decoder = asn_DEF_Int4.oer_decoder;
737 td->oer_encoder = asn_DEF_Int4.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400738 if(!td->oer_constraints)
739 td->oer_constraints = asn_DEF_Int4.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000740 if(!td->per_constraints)
741 td->per_constraints = asn_DEF_Int4.per_constraints;
742 td->elements = asn_DEF_Int4.elements;
743 td->elements_count = asn_DEF_Int4.elements_count;
744 td->specifics = asn_DEF_Int4.specifics;
745}
746
747void
748Int5_free(asn_TYPE_descriptor_t *td,
749 void *struct_ptr, int contents_only) {
750 Int5_1_inherit_TYPE_descriptor(td);
751 td->free_struct(td, struct_ptr, contents_only);
752}
753
754int
755Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
756 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
757 Int5_1_inherit_TYPE_descriptor(td);
758 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
759}
760
761asn_dec_rval_t
762Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
763 void **structure, const void *bufptr, size_t size, int tag_mode) {
764 Int5_1_inherit_TYPE_descriptor(td);
765 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
766}
767
768asn_enc_rval_t
769Int5_encode_der(asn_TYPE_descriptor_t *td,
770 void *structure, int tag_mode, ber_tlv_tag_t tag,
771 asn_app_consume_bytes_f *cb, void *app_key) {
772 Int5_1_inherit_TYPE_descriptor(td);
773 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
774}
775
776asn_dec_rval_t
777Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
778 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
779 Int5_1_inherit_TYPE_descriptor(td);
780 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
781}
782
783asn_enc_rval_t
784Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
785 int ilevel, enum xer_encoder_flags_e flags,
786 asn_app_consume_bytes_f *cb, void *app_key) {
787 Int5_1_inherit_TYPE_descriptor(td);
788 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
789}
790
791asn_dec_rval_t
792Int5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
793 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
794 Int5_1_inherit_TYPE_descriptor(td);
795 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
796}
797
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000798asn_enc_rval_t
799Int5_encode_uper(asn_TYPE_descriptor_t *td,
800 asn_per_constraints_t *constraints,
801 void *structure, asn_per_outp_t *per_out) {
802 Int5_1_inherit_TYPE_descriptor(td);
803 return td->uper_encoder(td, constraints, structure, per_out);
804}
805
Lev Walkin59b176e2005-11-26 11:25:14 +0000806
Lev Walkin725883b2006-10-09 12:07:58 +0000807/*** <<< CTDEFS [Int5] >>> ***/
808
Lev Walkin2fce55d2013-03-28 05:00:39 -0700809static asn_per_constraints_t asn_PER_type_Int5_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000810 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
811 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
812 0, 0 /* No PER value map */
813};
814
Lev Walkin59b176e2005-11-26 11:25:14 +0000815/*** <<< STAT-DEFS [Int5] >>> ***/
816
Lev Walkina7591b52014-10-12 18:37:35 -0700817static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000818 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
819};
Lev Walkin59b176e2005-11-26 11:25:14 +0000820asn_TYPE_descriptor_t asn_DEF_Int5 = {
821 "Int5",
822 "Int5",
823 Int5_free,
824 Int5_print,
825 Int5_constraint,
826 Int5_decode_ber,
827 Int5_encode_der,
828 Int5_decode_xer,
829 Int5_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400830 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000831 Int5_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000832 Int5_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000833 0, /* Use generic outmost tag fetcher */
834 asn_DEF_Int5_tags_1,
835 sizeof(asn_DEF_Int5_tags_1)
836 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
837 asn_DEF_Int5_tags_1, /* Same as above */
838 sizeof(asn_DEF_Int5_tags_1)
839 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400840 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000841 &asn_PER_type_Int5_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000842 0, 0, /* No members */
843 0 /* No specifics */
844};
845
846
847/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
848
Lev Walkin2a744a72013-03-27 01:56:23 -0700849#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +0000850
851/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
852
Lev Walkin2a744a72013-03-27 01:56:23 -0700853typedef long ExtensibleExtensions_t;
Lev Walkin59b176e2005-11-26 11:25:14 +0000854
855/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
856
857extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
858asn_struct_free_f ExtensibleExtensions_free;
859asn_struct_print_f ExtensibleExtensions_print;
860asn_constr_check_f ExtensibleExtensions_constraint;
861ber_type_decoder_f ExtensibleExtensions_decode_ber;
862der_type_encoder_f ExtensibleExtensions_encode_der;
863xer_type_decoder_f ExtensibleExtensions_decode_xer;
864xer_type_encoder_f ExtensibleExtensions_encode_xer;
865per_type_decoder_f ExtensibleExtensions_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000866per_type_encoder_f ExtensibleExtensions_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000867
868/*** <<< CODE [ExtensibleExtensions] >>> ***/
869
870int
871ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000872 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000873 long value;
874
875 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700876 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000877 "%s: value not given (%s:%d)",
878 td->name, __FILE__, __LINE__);
879 return -1;
880 }
881
Lev Walkin2a744a72013-03-27 01:56:23 -0700882 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000883
884 if((value >= 1 && value <= 256)) {
885 /* Constraint check succeeded */
886 return 0;
887 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700888 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000889 "%s: constraint failed (%s:%d)",
890 td->name, __FILE__, __LINE__);
891 return -1;
892 }
893}
894
895/*
Lev Walkin2a744a72013-03-27 01:56:23 -0700896 * This type is implemented using NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +0000897 * so here we adjust the DEF accordingly.
898 */
899static void
900ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -0700901 td->free_struct = asn_DEF_NativeInteger.free_struct;
902 td->print_struct = asn_DEF_NativeInteger.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800903 td->check_constraints = asn_DEF_NativeInteger.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -0700904 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
905 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
906 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
907 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
908 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
909 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700910 td->oer_decoder = asn_DEF_NativeInteger.oer_decoder;
911 td->oer_encoder = asn_DEF_NativeInteger.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400912 if(!td->oer_constraints)
913 td->oer_constraints = asn_DEF_NativeInteger.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000914 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -0700915 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
916 td->elements = asn_DEF_NativeInteger.elements;
917 td->elements_count = asn_DEF_NativeInteger.elements_count;
918 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin59b176e2005-11-26 11:25:14 +0000919}
920
921void
922ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
923 void *struct_ptr, int contents_only) {
924 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
925 td->free_struct(td, struct_ptr, contents_only);
926}
927
928int
929ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
930 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
931 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
932 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
933}
934
935asn_dec_rval_t
936ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
937 void **structure, const void *bufptr, size_t size, int tag_mode) {
938 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
939 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
940}
941
942asn_enc_rval_t
943ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
944 void *structure, int tag_mode, ber_tlv_tag_t tag,
945 asn_app_consume_bytes_f *cb, void *app_key) {
946 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
947 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
948}
949
950asn_dec_rval_t
951ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
952 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
953 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
954 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
955}
956
957asn_enc_rval_t
958ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
959 int ilevel, enum xer_encoder_flags_e flags,
960 asn_app_consume_bytes_f *cb, void *app_key) {
961 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
962 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
963}
964
965asn_dec_rval_t
966ExtensibleExtensions_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
967 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
968 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
969 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
970}
971
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000972asn_enc_rval_t
973ExtensibleExtensions_encode_uper(asn_TYPE_descriptor_t *td,
974 asn_per_constraints_t *constraints,
975 void *structure, asn_per_outp_t *per_out) {
976 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
977 return td->uper_encoder(td, constraints, structure, per_out);
978}
979
Lev Walkin59b176e2005-11-26 11:25:14 +0000980
Lev Walkin725883b2006-10-09 12:07:58 +0000981/*** <<< CTDEFS [ExtensibleExtensions] >>> ***/
982
Lev Walkin2fce55d2013-03-28 05:00:39 -0700983static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000984 { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
985 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
986 0, 0 /* No PER value map */
987};
988
Lev Walkin59b176e2005-11-26 11:25:14 +0000989/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
990
Lev Walkina7591b52014-10-12 18:37:35 -0700991static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000992 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
993};
Lev Walkin59b176e2005-11-26 11:25:14 +0000994asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
995 "ExtensibleExtensions",
996 "ExtensibleExtensions",
997 ExtensibleExtensions_free,
998 ExtensibleExtensions_print,
999 ExtensibleExtensions_constraint,
1000 ExtensibleExtensions_decode_ber,
1001 ExtensibleExtensions_encode_der,
1002 ExtensibleExtensions_decode_xer,
1003 ExtensibleExtensions_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001004 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001005 ExtensibleExtensions_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001006 ExtensibleExtensions_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001007 0, /* Use generic outmost tag fetcher */
1008 asn_DEF_ExtensibleExtensions_tags_1,
1009 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
1010 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
1011 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
1012 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
1013 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001014 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001015 &asn_PER_type_ExtensibleExtensions_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001016 0, 0, /* No members */
1017 0 /* No specifics */
1018};
1019
1020
1021/*** <<< INCLUDES [Str1] >>> ***/
1022
1023#include <IA5String.h>
1024
1025/*** <<< TYPE-DECLS [Str1] >>> ***/
1026
1027typedef IA5String_t Str1_t;
1028
1029/*** <<< FUNC-DECLS [Str1] >>> ***/
1030
1031extern asn_TYPE_descriptor_t asn_DEF_Str1;
1032asn_struct_free_f Str1_free;
1033asn_struct_print_f Str1_print;
1034asn_constr_check_f Str1_constraint;
1035ber_type_decoder_f Str1_decode_ber;
1036der_type_encoder_f Str1_encode_der;
1037xer_type_decoder_f Str1_decode_xer;
1038xer_type_encoder_f Str1_encode_xer;
1039per_type_decoder_f Str1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001040per_type_encoder_f Str1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001041
1042/*** <<< CODE [Str1] >>> ***/
1043
1044int
1045Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001046 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001047 /* Replace with underlying type checker */
1048 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00001049 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00001050}
1051
1052/*
1053 * This type is implemented using IA5String,
1054 * so here we adjust the DEF accordingly.
1055 */
1056static void
1057Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1058 td->free_struct = asn_DEF_IA5String.free_struct;
1059 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001060 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001061 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1062 td->der_encoder = asn_DEF_IA5String.der_encoder;
1063 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1064 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1065 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001066 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001067 td->oer_decoder = asn_DEF_IA5String.oer_decoder;
1068 td->oer_encoder = asn_DEF_IA5String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001069 if(!td->oer_constraints)
1070 td->oer_constraints = asn_DEF_IA5String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001071 if(!td->per_constraints)
1072 td->per_constraints = asn_DEF_IA5String.per_constraints;
1073 td->elements = asn_DEF_IA5String.elements;
1074 td->elements_count = asn_DEF_IA5String.elements_count;
1075 td->specifics = asn_DEF_IA5String.specifics;
1076}
1077
1078void
1079Str1_free(asn_TYPE_descriptor_t *td,
1080 void *struct_ptr, int contents_only) {
1081 Str1_1_inherit_TYPE_descriptor(td);
1082 td->free_struct(td, struct_ptr, contents_only);
1083}
1084
1085int
1086Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1087 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1088 Str1_1_inherit_TYPE_descriptor(td);
1089 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1090}
1091
1092asn_dec_rval_t
1093Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1094 void **structure, const void *bufptr, size_t size, int tag_mode) {
1095 Str1_1_inherit_TYPE_descriptor(td);
1096 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1097}
1098
1099asn_enc_rval_t
1100Str1_encode_der(asn_TYPE_descriptor_t *td,
1101 void *structure, int tag_mode, ber_tlv_tag_t tag,
1102 asn_app_consume_bytes_f *cb, void *app_key) {
1103 Str1_1_inherit_TYPE_descriptor(td);
1104 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1105}
1106
1107asn_dec_rval_t
1108Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1109 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1110 Str1_1_inherit_TYPE_descriptor(td);
1111 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1112}
1113
1114asn_enc_rval_t
1115Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1116 int ilevel, enum xer_encoder_flags_e flags,
1117 asn_app_consume_bytes_f *cb, void *app_key) {
1118 Str1_1_inherit_TYPE_descriptor(td);
1119 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1120}
1121
1122asn_dec_rval_t
1123Str1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1124 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1125 Str1_1_inherit_TYPE_descriptor(td);
1126 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1127}
1128
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001129asn_enc_rval_t
1130Str1_encode_uper(asn_TYPE_descriptor_t *td,
1131 asn_per_constraints_t *constraints,
1132 void *structure, asn_per_outp_t *per_out) {
1133 Str1_1_inherit_TYPE_descriptor(td);
1134 return td->uper_encoder(td, constraints, structure, per_out);
1135}
1136
Lev Walkin59b176e2005-11-26 11:25:14 +00001137
1138/*** <<< STAT-DEFS [Str1] >>> ***/
1139
Lev Walkina7591b52014-10-12 18:37:35 -07001140static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001141 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1142};
1143asn_TYPE_descriptor_t asn_DEF_Str1 = {
1144 "Str1",
1145 "Str1",
1146 Str1_free,
1147 Str1_print,
1148 Str1_constraint,
1149 Str1_decode_ber,
1150 Str1_encode_der,
1151 Str1_decode_xer,
1152 Str1_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001153 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001154 Str1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001155 Str1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001156 0, /* Use generic outmost tag fetcher */
1157 asn_DEF_Str1_tags_1,
1158 sizeof(asn_DEF_Str1_tags_1)
1159 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1160 asn_DEF_Str1_tags_1, /* Same as above */
1161 sizeof(asn_DEF_Str1_tags_1)
1162 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001163 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00001164 0, /* No PER visible constraints */
1165 0, 0, /* No members */
1166 0 /* No specifics */
1167};
1168
1169
1170/*** <<< INCLUDES [Str2] >>> ***/
1171
Lev Walkin22b5ed42006-09-13 02:51:20 +00001172#include "Str1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001173
1174/*** <<< TYPE-DECLS [Str2] >>> ***/
1175
1176typedef Str1_t Str2_t;
1177
1178/*** <<< FUNC-DECLS [Str2] >>> ***/
1179
1180extern asn_TYPE_descriptor_t asn_DEF_Str2;
1181asn_struct_free_f Str2_free;
1182asn_struct_print_f Str2_print;
1183asn_constr_check_f Str2_constraint;
1184ber_type_decoder_f Str2_decode_ber;
1185der_type_encoder_f Str2_encode_der;
1186xer_type_decoder_f Str2_decode_xer;
1187xer_type_encoder_f Str2_encode_xer;
1188per_type_decoder_f Str2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001189per_type_encoder_f Str2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001190
1191/*** <<< CTABLES [Str2] >>> ***/
1192
1193static int check_permitted_alphabet_1(const void *sptr) {
1194 /* The underlying type is IA5String */
1195 const IA5String_t *st = (const IA5String_t *)sptr;
1196 const uint8_t *ch = st->buf;
1197 const uint8_t *end = ch + st->size;
1198
1199 for(; ch < end; ch++) {
1200 uint8_t cv = *ch;
1201 if(!(cv <= 127)) return -1;
1202 }
1203 return 0;
1204}
1205
1206
1207/*** <<< CODE [Str2] >>> ***/
1208
1209int
1210Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001211 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001212 const Str1_t *st = (const Str1_t *)sptr;
1213 size_t size;
1214
1215 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001216 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001217 "%s: value not given (%s:%d)",
1218 td->name, __FILE__, __LINE__);
1219 return -1;
1220 }
1221
1222 size = st->size;
1223
1224 if(((size <= 20) || (size >= 25 && size <= 30))
1225 && !check_permitted_alphabet_1(st)) {
1226 /* Constraint check succeeded */
1227 return 0;
1228 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001229 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001230 "%s: constraint failed (%s:%d)",
1231 td->name, __FILE__, __LINE__);
1232 return -1;
1233 }
1234}
1235
1236/*
1237 * This type is implemented using Str1,
1238 * so here we adjust the DEF accordingly.
1239 */
1240static void
1241Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1242 td->free_struct = asn_DEF_Str1.free_struct;
1243 td->print_struct = asn_DEF_Str1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001244 td->check_constraints = asn_DEF_Str1.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001245 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1246 td->der_encoder = asn_DEF_Str1.der_encoder;
1247 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1248 td->xer_encoder = asn_DEF_Str1.xer_encoder;
1249 td->uper_decoder = asn_DEF_Str1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001250 td->uper_encoder = asn_DEF_Str1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001251 td->oer_decoder = asn_DEF_Str1.oer_decoder;
1252 td->oer_encoder = asn_DEF_Str1.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001253 if(!td->oer_constraints)
1254 td->oer_constraints = asn_DEF_Str1.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001255 if(!td->per_constraints)
1256 td->per_constraints = asn_DEF_Str1.per_constraints;
1257 td->elements = asn_DEF_Str1.elements;
1258 td->elements_count = asn_DEF_Str1.elements_count;
1259 td->specifics = asn_DEF_Str1.specifics;
1260}
1261
1262void
1263Str2_free(asn_TYPE_descriptor_t *td,
1264 void *struct_ptr, int contents_only) {
1265 Str2_1_inherit_TYPE_descriptor(td);
1266 td->free_struct(td, struct_ptr, contents_only);
1267}
1268
1269int
1270Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1271 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1272 Str2_1_inherit_TYPE_descriptor(td);
1273 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1274}
1275
1276asn_dec_rval_t
1277Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1278 void **structure, const void *bufptr, size_t size, int tag_mode) {
1279 Str2_1_inherit_TYPE_descriptor(td);
1280 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1281}
1282
1283asn_enc_rval_t
1284Str2_encode_der(asn_TYPE_descriptor_t *td,
1285 void *structure, int tag_mode, ber_tlv_tag_t tag,
1286 asn_app_consume_bytes_f *cb, void *app_key) {
1287 Str2_1_inherit_TYPE_descriptor(td);
1288 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1289}
1290
1291asn_dec_rval_t
1292Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1293 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1294 Str2_1_inherit_TYPE_descriptor(td);
1295 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1296}
1297
1298asn_enc_rval_t
1299Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1300 int ilevel, enum xer_encoder_flags_e flags,
1301 asn_app_consume_bytes_f *cb, void *app_key) {
1302 Str2_1_inherit_TYPE_descriptor(td);
1303 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1304}
1305
1306asn_dec_rval_t
1307Str2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1308 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1309 Str2_1_inherit_TYPE_descriptor(td);
1310 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1311}
1312
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001313asn_enc_rval_t
1314Str2_encode_uper(asn_TYPE_descriptor_t *td,
1315 asn_per_constraints_t *constraints,
1316 void *structure, asn_per_outp_t *per_out) {
1317 Str2_1_inherit_TYPE_descriptor(td);
1318 return td->uper_encoder(td, constraints, structure, per_out);
1319}
1320
Lev Walkin59b176e2005-11-26 11:25:14 +00001321
Lev Walkin725883b2006-10-09 12:07:58 +00001322/*** <<< CTDEFS [Str2] >>> ***/
1323
Lev Walkin2fce55d2013-03-28 05:00:39 -07001324static asn_per_constraints_t asn_PER_type_Str2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001325 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1326 { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */,
1327 0, 0 /* No PER character map necessary */
1328};
1329
Lev Walkin59b176e2005-11-26 11:25:14 +00001330/*** <<< STAT-DEFS [Str2] >>> ***/
1331
Lev Walkina7591b52014-10-12 18:37:35 -07001332static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001333 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1334};
Lev Walkin59b176e2005-11-26 11:25:14 +00001335asn_TYPE_descriptor_t asn_DEF_Str2 = {
1336 "Str2",
1337 "Str2",
1338 Str2_free,
1339 Str2_print,
1340 Str2_constraint,
1341 Str2_decode_ber,
1342 Str2_encode_der,
1343 Str2_decode_xer,
1344 Str2_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001345 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001346 Str2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001347 Str2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001348 0, /* Use generic outmost tag fetcher */
1349 asn_DEF_Str2_tags_1,
1350 sizeof(asn_DEF_Str2_tags_1)
1351 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1352 asn_DEF_Str2_tags_1, /* Same as above */
1353 sizeof(asn_DEF_Str2_tags_1)
1354 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001355 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001356 &asn_PER_type_Str2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001357 0, 0, /* No members */
1358 0 /* No specifics */
1359};
1360
1361
1362/*** <<< INCLUDES [Str3] >>> ***/
1363
Lev Walkin22b5ed42006-09-13 02:51:20 +00001364#include "Str2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001365
1366/*** <<< TYPE-DECLS [Str3] >>> ***/
1367
1368typedef Str2_t Str3_t;
1369
1370/*** <<< FUNC-DECLS [Str3] >>> ***/
1371
1372extern asn_TYPE_descriptor_t asn_DEF_Str3;
1373asn_struct_free_f Str3_free;
1374asn_struct_print_f Str3_print;
1375asn_constr_check_f Str3_constraint;
1376ber_type_decoder_f Str3_decode_ber;
1377der_type_encoder_f Str3_encode_der;
1378xer_type_decoder_f Str3_decode_xer;
1379xer_type_encoder_f Str3_encode_xer;
1380per_type_decoder_f Str3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001381per_type_encoder_f Str3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001382
1383/*** <<< CTABLES [Str3] >>> ***/
1384
Lev Walkina7591b52014-10-12 18:37:35 -07001385static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1387 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1388 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1389 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1390 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
1391 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1392 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin59b176e2005-11-26 11:25:14 +00001393};
Lev Walkina7591b52014-10-12 18:37:35 -07001394static const int permitted_alphabet_code2value_1[6] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000139565,66,67,100,101,102,};
1396
Lev Walkin59b176e2005-11-26 11:25:14 +00001397
1398static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07001399 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00001400 /* The underlying type is IA5String */
1401 const IA5String_t *st = (const IA5String_t *)sptr;
1402 const uint8_t *ch = st->buf;
1403 const uint8_t *end = ch + st->size;
1404
1405 for(; ch < end; ch++) {
1406 uint8_t cv = *ch;
1407 if(!table[cv]) return -1;
1408 }
1409 return 0;
1410}
1411
1412
1413/*** <<< CODE [Str3] >>> ***/
1414
1415int
1416Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001417 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001418 const Str2_t *st = (const Str2_t *)sptr;
1419 size_t size;
1420
1421 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001422 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001423 "%s: value not given (%s:%d)",
1424 td->name, __FILE__, __LINE__);
1425 return -1;
1426 }
1427
1428 size = st->size;
1429
1430 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
1431 && !check_permitted_alphabet_1(st)) {
1432 /* Constraint check succeeded */
1433 return 0;
1434 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001435 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001436 "%s: constraint failed (%s:%d)",
1437 td->name, __FILE__, __LINE__);
1438 return -1;
1439 }
1440}
1441
Lev Walkin725883b2006-10-09 12:07:58 +00001442static int asn_PER_MAP_Str3_1_v2c(unsigned int value) {
1443 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
1444 return -1;
1445 return permitted_alphabet_table_1[value] - 1;
1446}
1447static int asn_PER_MAP_Str3_1_c2v(unsigned int code) {
1448 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
1449 return -1;
1450 return permitted_alphabet_code2value_1[code];
1451}
Lev Walkin59b176e2005-11-26 11:25:14 +00001452/*
1453 * This type is implemented using Str2,
1454 * so here we adjust the DEF accordingly.
1455 */
1456static void
1457Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1458 td->free_struct = asn_DEF_Str2.free_struct;
1459 td->print_struct = asn_DEF_Str2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001460 td->check_constraints = asn_DEF_Str2.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001461 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1462 td->der_encoder = asn_DEF_Str2.der_encoder;
1463 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1464 td->xer_encoder = asn_DEF_Str2.xer_encoder;
1465 td->uper_decoder = asn_DEF_Str2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001466 td->uper_encoder = asn_DEF_Str2.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001467 td->oer_decoder = asn_DEF_Str2.oer_decoder;
1468 td->oer_encoder = asn_DEF_Str2.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001469 if(!td->oer_constraints)
1470 td->oer_constraints = asn_DEF_Str2.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001471 if(!td->per_constraints)
1472 td->per_constraints = asn_DEF_Str2.per_constraints;
1473 td->elements = asn_DEF_Str2.elements;
1474 td->elements_count = asn_DEF_Str2.elements_count;
1475 td->specifics = asn_DEF_Str2.specifics;
1476}
1477
1478void
1479Str3_free(asn_TYPE_descriptor_t *td,
1480 void *struct_ptr, int contents_only) {
1481 Str3_1_inherit_TYPE_descriptor(td);
1482 td->free_struct(td, struct_ptr, contents_only);
1483}
1484
1485int
1486Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1487 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1488 Str3_1_inherit_TYPE_descriptor(td);
1489 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1490}
1491
1492asn_dec_rval_t
1493Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1494 void **structure, const void *bufptr, size_t size, int tag_mode) {
1495 Str3_1_inherit_TYPE_descriptor(td);
1496 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1497}
1498
1499asn_enc_rval_t
1500Str3_encode_der(asn_TYPE_descriptor_t *td,
1501 void *structure, int tag_mode, ber_tlv_tag_t tag,
1502 asn_app_consume_bytes_f *cb, void *app_key) {
1503 Str3_1_inherit_TYPE_descriptor(td);
1504 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1505}
1506
1507asn_dec_rval_t
1508Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1509 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1510 Str3_1_inherit_TYPE_descriptor(td);
1511 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1512}
1513
1514asn_enc_rval_t
1515Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1516 int ilevel, enum xer_encoder_flags_e flags,
1517 asn_app_consume_bytes_f *cb, void *app_key) {
1518 Str3_1_inherit_TYPE_descriptor(td);
1519 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1520}
1521
1522asn_dec_rval_t
1523Str3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1524 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1525 Str3_1_inherit_TYPE_descriptor(td);
1526 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1527}
1528
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001529asn_enc_rval_t
1530Str3_encode_uper(asn_TYPE_descriptor_t *td,
1531 asn_per_constraints_t *constraints,
1532 void *structure, asn_per_outp_t *per_out) {
1533 Str3_1_inherit_TYPE_descriptor(td);
1534 return td->uper_encoder(td, constraints, structure, per_out);
1535}
1536
Lev Walkin59b176e2005-11-26 11:25:14 +00001537
Lev Walkin725883b2006-10-09 12:07:58 +00001538/*** <<< CTDEFS [Str3] >>> ***/
1539
Lev Walkin2fce55d2013-03-28 05:00:39 -07001540static asn_per_constraints_t asn_PER_type_Str3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001541 { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */,
1542 { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */,
1543 asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */
1544 asn_PER_MAP_Str3_1_c2v /* PER code to value map */
1545};
1546
Lev Walkin59b176e2005-11-26 11:25:14 +00001547/*** <<< STAT-DEFS [Str3] >>> ***/
1548
Lev Walkina7591b52014-10-12 18:37:35 -07001549static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001550 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1551};
Lev Walkin59b176e2005-11-26 11:25:14 +00001552asn_TYPE_descriptor_t asn_DEF_Str3 = {
1553 "Str3",
1554 "Str3",
1555 Str3_free,
1556 Str3_print,
1557 Str3_constraint,
1558 Str3_decode_ber,
1559 Str3_encode_der,
1560 Str3_decode_xer,
1561 Str3_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001562 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001563 Str3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001564 Str3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001565 0, /* Use generic outmost tag fetcher */
1566 asn_DEF_Str3_tags_1,
1567 sizeof(asn_DEF_Str3_tags_1)
1568 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1569 asn_DEF_Str3_tags_1, /* Same as above */
1570 sizeof(asn_DEF_Str3_tags_1)
1571 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001572 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001573 &asn_PER_type_Str3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001574 0, 0, /* No members */
1575 0 /* No specifics */
1576};
1577
1578
1579/*** <<< INCLUDES [Str4] >>> ***/
1580
1581#include <IA5String.h>
1582
1583/*** <<< TYPE-DECLS [Str4] >>> ***/
1584
1585typedef IA5String_t Str4_t;
1586
1587/*** <<< FUNC-DECLS [Str4] >>> ***/
1588
1589extern asn_TYPE_descriptor_t asn_DEF_Str4;
1590asn_struct_free_f Str4_free;
1591asn_struct_print_f Str4_print;
1592asn_constr_check_f Str4_constraint;
1593ber_type_decoder_f Str4_decode_ber;
1594der_type_encoder_f Str4_encode_der;
1595xer_type_decoder_f Str4_decode_xer;
1596xer_type_encoder_f Str4_encode_xer;
1597per_type_decoder_f Str4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001598per_type_encoder_f Str4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001599
1600/*** <<< CTABLES [Str4] >>> ***/
1601
1602static int check_permitted_alphabet_1(const void *sptr) {
1603 /* The underlying type is IA5String */
1604 const IA5String_t *st = (const IA5String_t *)sptr;
1605 const uint8_t *ch = st->buf;
1606 const uint8_t *end = ch + st->size;
1607
1608 for(; ch < end; ch++) {
1609 uint8_t cv = *ch;
1610 if(!(cv <= 127)) return -1;
1611 }
1612 return 0;
1613}
1614
1615
1616/*** <<< CODE [Str4] >>> ***/
1617
1618int
1619Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001620 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001621 const IA5String_t *st = (const IA5String_t *)sptr;
1622
1623 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001624 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001625 "%s: value not given (%s:%d)",
1626 td->name, __FILE__, __LINE__);
1627 return -1;
1628 }
1629
1630
1631 if(!check_permitted_alphabet_1(st)) {
1632 /* Constraint check succeeded */
1633 return 0;
1634 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001635 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001636 "%s: constraint failed (%s:%d)",
1637 td->name, __FILE__, __LINE__);
1638 return -1;
1639 }
1640}
1641
1642/*
1643 * This type is implemented using IA5String,
1644 * so here we adjust the DEF accordingly.
1645 */
1646static void
1647Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1648 td->free_struct = asn_DEF_IA5String.free_struct;
1649 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001650 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001651 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1652 td->der_encoder = asn_DEF_IA5String.der_encoder;
1653 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1654 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1655 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001656 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001657 td->oer_decoder = asn_DEF_IA5String.oer_decoder;
1658 td->oer_encoder = asn_DEF_IA5String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001659 if(!td->oer_constraints)
1660 td->oer_constraints = asn_DEF_IA5String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001661 if(!td->per_constraints)
1662 td->per_constraints = asn_DEF_IA5String.per_constraints;
1663 td->elements = asn_DEF_IA5String.elements;
1664 td->elements_count = asn_DEF_IA5String.elements_count;
1665 td->specifics = asn_DEF_IA5String.specifics;
1666}
1667
1668void
1669Str4_free(asn_TYPE_descriptor_t *td,
1670 void *struct_ptr, int contents_only) {
1671 Str4_1_inherit_TYPE_descriptor(td);
1672 td->free_struct(td, struct_ptr, contents_only);
1673}
1674
1675int
1676Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1677 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1678 Str4_1_inherit_TYPE_descriptor(td);
1679 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1680}
1681
1682asn_dec_rval_t
1683Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1684 void **structure, const void *bufptr, size_t size, int tag_mode) {
1685 Str4_1_inherit_TYPE_descriptor(td);
1686 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1687}
1688
1689asn_enc_rval_t
1690Str4_encode_der(asn_TYPE_descriptor_t *td,
1691 void *structure, int tag_mode, ber_tlv_tag_t tag,
1692 asn_app_consume_bytes_f *cb, void *app_key) {
1693 Str4_1_inherit_TYPE_descriptor(td);
1694 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1695}
1696
1697asn_dec_rval_t
1698Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1699 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1700 Str4_1_inherit_TYPE_descriptor(td);
1701 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1702}
1703
1704asn_enc_rval_t
1705Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1706 int ilevel, enum xer_encoder_flags_e flags,
1707 asn_app_consume_bytes_f *cb, void *app_key) {
1708 Str4_1_inherit_TYPE_descriptor(td);
1709 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1710}
1711
1712asn_dec_rval_t
1713Str4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1714 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1715 Str4_1_inherit_TYPE_descriptor(td);
1716 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1717}
1718
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001719asn_enc_rval_t
1720Str4_encode_uper(asn_TYPE_descriptor_t *td,
1721 asn_per_constraints_t *constraints,
1722 void *structure, asn_per_outp_t *per_out) {
1723 Str4_1_inherit_TYPE_descriptor(td);
1724 return td->uper_encoder(td, constraints, structure, per_out);
1725}
1726
Lev Walkin59b176e2005-11-26 11:25:14 +00001727
Lev Walkin725883b2006-10-09 12:07:58 +00001728/*** <<< CTDEFS [Str4] >>> ***/
1729
Lev Walkin2fce55d2013-03-28 05:00:39 -07001730static asn_per_constraints_t asn_PER_type_Str4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001731 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1732 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1733 0, 0 /* No PER character map necessary */
1734};
1735
Lev Walkin59b176e2005-11-26 11:25:14 +00001736/*** <<< STAT-DEFS [Str4] >>> ***/
1737
Lev Walkina7591b52014-10-12 18:37:35 -07001738static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001739 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1740};
Lev Walkin59b176e2005-11-26 11:25:14 +00001741asn_TYPE_descriptor_t asn_DEF_Str4 = {
1742 "Str4",
1743 "Str4",
1744 Str4_free,
1745 Str4_print,
1746 Str4_constraint,
1747 Str4_decode_ber,
1748 Str4_encode_der,
1749 Str4_decode_xer,
1750 Str4_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001751 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001752 Str4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001753 Str4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001754 0, /* Use generic outmost tag fetcher */
1755 asn_DEF_Str4_tags_1,
1756 sizeof(asn_DEF_Str4_tags_1)
1757 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1758 asn_DEF_Str4_tags_1, /* Same as above */
1759 sizeof(asn_DEF_Str4_tags_1)
1760 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001761 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001762 &asn_PER_type_Str4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001763 0, 0, /* No members */
1764 0 /* No specifics */
1765};
1766
1767
1768/*** <<< INCLUDES [PER-Visible] >>> ***/
1769
1770#include <IA5String.h>
1771
1772/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1773
1774typedef IA5String_t PER_Visible_t;
1775
1776/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1777
1778extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
1779asn_struct_free_f PER_Visible_free;
1780asn_struct_print_f PER_Visible_print;
1781asn_constr_check_f PER_Visible_constraint;
1782ber_type_decoder_f PER_Visible_decode_ber;
1783der_type_encoder_f PER_Visible_encode_der;
1784xer_type_decoder_f PER_Visible_decode_xer;
1785xer_type_encoder_f PER_Visible_encode_xer;
1786per_type_decoder_f PER_Visible_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001787per_type_encoder_f PER_Visible_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001788
1789/*** <<< CTABLES [PER-Visible] >>> ***/
1790
1791static int check_permitted_alphabet_1(const void *sptr) {
1792 /* The underlying type is IA5String */
1793 const IA5String_t *st = (const IA5String_t *)sptr;
1794 const uint8_t *ch = st->buf;
1795 const uint8_t *end = ch + st->size;
1796
1797 for(; ch < end; ch++) {
1798 uint8_t cv = *ch;
1799 if(!(cv >= 65 && cv <= 70)) return -1;
1800 }
1801 return 0;
1802}
1803
1804
1805/*** <<< CODE [PER-Visible] >>> ***/
1806
1807int
1808PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001809 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001810 const IA5String_t *st = (const IA5String_t *)sptr;
1811
1812 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001813 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001814 "%s: value not given (%s:%d)",
1815 td->name, __FILE__, __LINE__);
1816 return -1;
1817 }
1818
1819
1820 if(!check_permitted_alphabet_1(st)) {
1821 /* Constraint check succeeded */
1822 return 0;
1823 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001824 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001825 "%s: constraint failed (%s:%d)",
1826 td->name, __FILE__, __LINE__);
1827 return -1;
1828 }
1829}
1830
1831/*
1832 * This type is implemented using IA5String,
1833 * so here we adjust the DEF accordingly.
1834 */
1835static void
1836PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1837 td->free_struct = asn_DEF_IA5String.free_struct;
1838 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001839 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001840 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1841 td->der_encoder = asn_DEF_IA5String.der_encoder;
1842 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1843 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1844 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001845 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001846 td->oer_decoder = asn_DEF_IA5String.oer_decoder;
1847 td->oer_encoder = asn_DEF_IA5String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04001848 if(!td->oer_constraints)
1849 td->oer_constraints = asn_DEF_IA5String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001850 if(!td->per_constraints)
1851 td->per_constraints = asn_DEF_IA5String.per_constraints;
1852 td->elements = asn_DEF_IA5String.elements;
1853 td->elements_count = asn_DEF_IA5String.elements_count;
1854 td->specifics = asn_DEF_IA5String.specifics;
1855}
1856
1857void
1858PER_Visible_free(asn_TYPE_descriptor_t *td,
1859 void *struct_ptr, int contents_only) {
1860 PER_Visible_1_inherit_TYPE_descriptor(td);
1861 td->free_struct(td, struct_ptr, contents_only);
1862}
1863
1864int
1865PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1866 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1867 PER_Visible_1_inherit_TYPE_descriptor(td);
1868 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1869}
1870
1871asn_dec_rval_t
1872PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1873 void **structure, const void *bufptr, size_t size, int tag_mode) {
1874 PER_Visible_1_inherit_TYPE_descriptor(td);
1875 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1876}
1877
1878asn_enc_rval_t
1879PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
1880 void *structure, int tag_mode, ber_tlv_tag_t tag,
1881 asn_app_consume_bytes_f *cb, void *app_key) {
1882 PER_Visible_1_inherit_TYPE_descriptor(td);
1883 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1884}
1885
1886asn_dec_rval_t
1887PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1888 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1889 PER_Visible_1_inherit_TYPE_descriptor(td);
1890 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1891}
1892
1893asn_enc_rval_t
1894PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1895 int ilevel, enum xer_encoder_flags_e flags,
1896 asn_app_consume_bytes_f *cb, void *app_key) {
1897 PER_Visible_1_inherit_TYPE_descriptor(td);
1898 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1899}
1900
1901asn_dec_rval_t
1902PER_Visible_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1903 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1904 PER_Visible_1_inherit_TYPE_descriptor(td);
1905 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1906}
1907
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001908asn_enc_rval_t
1909PER_Visible_encode_uper(asn_TYPE_descriptor_t *td,
1910 asn_per_constraints_t *constraints,
1911 void *structure, asn_per_outp_t *per_out) {
1912 PER_Visible_1_inherit_TYPE_descriptor(td);
1913 return td->uper_encoder(td, constraints, structure, per_out);
1914}
1915
Lev Walkin59b176e2005-11-26 11:25:14 +00001916
Lev Walkin725883b2006-10-09 12:07:58 +00001917/*** <<< CTDEFS [PER-Visible] >>> ***/
1918
Lev Walkin2fce55d2013-03-28 05:00:39 -07001919static asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001920 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1921 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1922 0, 0 /* No PER character map necessary */
1923};
1924
Lev Walkin59b176e2005-11-26 11:25:14 +00001925/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1926
Lev Walkina7591b52014-10-12 18:37:35 -07001927static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001928 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1929};
Lev Walkin59b176e2005-11-26 11:25:14 +00001930asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1931 "PER-Visible",
1932 "PER-Visible",
1933 PER_Visible_free,
1934 PER_Visible_print,
1935 PER_Visible_constraint,
1936 PER_Visible_decode_ber,
1937 PER_Visible_encode_der,
1938 PER_Visible_decode_xer,
1939 PER_Visible_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04001940 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001941 PER_Visible_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001942 PER_Visible_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001943 0, /* Use generic outmost tag fetcher */
1944 asn_DEF_PER_Visible_tags_1,
1945 sizeof(asn_DEF_PER_Visible_tags_1)
1946 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1947 asn_DEF_PER_Visible_tags_1, /* Same as above */
1948 sizeof(asn_DEF_PER_Visible_tags_1)
1949 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04001950 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001951 &asn_PER_type_PER_Visible_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001952 0, 0, /* No members */
1953 0 /* No specifics */
1954};
1955
1956
1957/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1958
Lev Walkin22b5ed42006-09-13 02:51:20 +00001959#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001960
1961/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1962
1963typedef PER_Visible_t PER_Visible_2_t;
1964
1965/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1966
1967extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1968asn_struct_free_f PER_Visible_2_free;
1969asn_struct_print_f PER_Visible_2_print;
1970asn_constr_check_f PER_Visible_2_constraint;
1971ber_type_decoder_f PER_Visible_2_decode_ber;
1972der_type_encoder_f PER_Visible_2_encode_der;
1973xer_type_decoder_f PER_Visible_2_decode_xer;
1974xer_type_encoder_f PER_Visible_2_encode_xer;
1975per_type_decoder_f PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001976per_type_encoder_f PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001977
1978/*** <<< CTABLES [PER-Visible-2] >>> ***/
1979
1980static int check_permitted_alphabet_1(const void *sptr) {
1981 /* The underlying type is IA5String */
1982 const IA5String_t *st = (const IA5String_t *)sptr;
1983 const uint8_t *ch = st->buf;
1984 const uint8_t *end = ch + st->size;
1985
1986 for(; ch < end; ch++) {
1987 uint8_t cv = *ch;
1988 if(!(cv >= 69 && cv <= 70)) return -1;
1989 }
1990 return 0;
1991}
1992
1993
1994/*** <<< CODE [PER-Visible-2] >>> ***/
1995
1996int
1997PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001998 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001999 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2000
2001 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002002 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002003 "%s: value not given (%s:%d)",
2004 td->name, __FILE__, __LINE__);
2005 return -1;
2006 }
2007
2008
2009 if(!check_permitted_alphabet_1(st)) {
2010 /* Constraint check succeeded */
2011 return 0;
2012 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002013 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002014 "%s: constraint failed (%s:%d)",
2015 td->name, __FILE__, __LINE__);
2016 return -1;
2017 }
2018}
2019
2020/*
2021 * This type is implemented using PER_Visible,
2022 * so here we adjust the DEF accordingly.
2023 */
2024static void
2025PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2026 td->free_struct = asn_DEF_PER_Visible.free_struct;
2027 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002028 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002029 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2030 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2031 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2032 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2033 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002034 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002035 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2036 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002037 if(!td->oer_constraints)
2038 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002039 if(!td->per_constraints)
2040 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2041 td->elements = asn_DEF_PER_Visible.elements;
2042 td->elements_count = asn_DEF_PER_Visible.elements_count;
2043 td->specifics = asn_DEF_PER_Visible.specifics;
2044}
2045
2046void
2047PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2048 void *struct_ptr, int contents_only) {
2049 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2050 td->free_struct(td, struct_ptr, contents_only);
2051}
2052
2053int
2054PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2055 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2056 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2057 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2058}
2059
2060asn_dec_rval_t
2061PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2062 void **structure, const void *bufptr, size_t size, int tag_mode) {
2063 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2064 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2065}
2066
2067asn_enc_rval_t
2068PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2069 void *structure, int tag_mode, ber_tlv_tag_t tag,
2070 asn_app_consume_bytes_f *cb, void *app_key) {
2071 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2072 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2073}
2074
2075asn_dec_rval_t
2076PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2077 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2078 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2079 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2080}
2081
2082asn_enc_rval_t
2083PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2084 int ilevel, enum xer_encoder_flags_e flags,
2085 asn_app_consume_bytes_f *cb, void *app_key) {
2086 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2087 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2088}
2089
2090asn_dec_rval_t
2091PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2092 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2093 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2094 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2095}
2096
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002097asn_enc_rval_t
2098PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2099 asn_per_constraints_t *constraints,
2100 void *structure, asn_per_outp_t *per_out) {
2101 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2102 return td->uper_encoder(td, constraints, structure, per_out);
2103}
2104
Lev Walkin59b176e2005-11-26 11:25:14 +00002105
Lev Walkin725883b2006-10-09 12:07:58 +00002106/*** <<< CTDEFS [PER-Visible-2] >>> ***/
2107
Lev Walkin2fce55d2013-03-28 05:00:39 -07002108static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002109 { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */,
2110 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2111 0, 0 /* No PER character map necessary */
2112};
2113
Lev Walkin59b176e2005-11-26 11:25:14 +00002114/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
2115
Lev Walkina7591b52014-10-12 18:37:35 -07002116static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002117 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2118};
Lev Walkin59b176e2005-11-26 11:25:14 +00002119asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
2120 "PER-Visible-2",
2121 "PER-Visible-2",
2122 PER_Visible_2_free,
2123 PER_Visible_2_print,
2124 PER_Visible_2_constraint,
2125 PER_Visible_2_decode_ber,
2126 PER_Visible_2_encode_der,
2127 PER_Visible_2_decode_xer,
2128 PER_Visible_2_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002129 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002130 PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002131 PER_Visible_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002132 0, /* Use generic outmost tag fetcher */
2133 asn_DEF_PER_Visible_2_tags_1,
2134 sizeof(asn_DEF_PER_Visible_2_tags_1)
2135 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
2136 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
2137 sizeof(asn_DEF_PER_Visible_2_tags_1)
2138 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002139 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002140 &asn_PER_type_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002141 0, 0, /* No members */
2142 0 /* No specifics */
2143};
2144
2145
2146/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
2147
Lev Walkin22b5ed42006-09-13 02:51:20 +00002148#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002149
2150/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
2151
2152typedef PER_Visible_t Not_PER_Visible_1_t;
2153
2154/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
2155
2156extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
2157asn_struct_free_f Not_PER_Visible_1_free;
2158asn_struct_print_f Not_PER_Visible_1_print;
2159asn_constr_check_f Not_PER_Visible_1_constraint;
2160ber_type_decoder_f Not_PER_Visible_1_decode_ber;
2161der_type_encoder_f Not_PER_Visible_1_encode_der;
2162xer_type_decoder_f Not_PER_Visible_1_decode_xer;
2163xer_type_encoder_f Not_PER_Visible_1_encode_xer;
2164per_type_decoder_f Not_PER_Visible_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002165per_type_encoder_f Not_PER_Visible_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002166
2167/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
2168
2169static int check_permitted_alphabet_1(const void *sptr) {
2170 /* The underlying type is IA5String */
2171 const IA5String_t *st = (const IA5String_t *)sptr;
2172 const uint8_t *ch = st->buf;
2173 const uint8_t *end = ch + st->size;
2174
2175 for(; ch < end; ch++) {
2176 uint8_t cv = *ch;
2177 if(!(cv >= 65 && cv <= 70)) return -1;
2178 }
2179 return 0;
2180}
2181
2182
2183/*** <<< CODE [Not-PER-Visible-1] >>> ***/
2184
2185int
2186Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002187 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002188 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2189
2190 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002191 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002192 "%s: value not given (%s:%d)",
2193 td->name, __FILE__, __LINE__);
2194 return -1;
2195 }
2196
2197
2198 if(!check_permitted_alphabet_1(st)) {
2199 /* Constraint check succeeded */
2200 return 0;
2201 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002202 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002203 "%s: constraint failed (%s:%d)",
2204 td->name, __FILE__, __LINE__);
2205 return -1;
2206 }
2207}
2208
2209/*
2210 * This type is implemented using PER_Visible,
2211 * so here we adjust the DEF accordingly.
2212 */
2213static void
2214Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2215 td->free_struct = asn_DEF_PER_Visible.free_struct;
2216 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002217 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002218 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2219 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2220 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2221 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2222 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002223 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002224 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2225 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002226 if(!td->oer_constraints)
2227 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002228 if(!td->per_constraints)
2229 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2230 td->elements = asn_DEF_PER_Visible.elements;
2231 td->elements_count = asn_DEF_PER_Visible.elements_count;
2232 td->specifics = asn_DEF_PER_Visible.specifics;
2233}
2234
2235void
2236Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
2237 void *struct_ptr, int contents_only) {
2238 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2239 td->free_struct(td, struct_ptr, contents_only);
2240}
2241
2242int
2243Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2244 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2245 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2246 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2247}
2248
2249asn_dec_rval_t
2250Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2251 void **structure, const void *bufptr, size_t size, int tag_mode) {
2252 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2253 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2254}
2255
2256asn_enc_rval_t
2257Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
2258 void *structure, int tag_mode, ber_tlv_tag_t tag,
2259 asn_app_consume_bytes_f *cb, void *app_key) {
2260 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2261 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2262}
2263
2264asn_dec_rval_t
2265Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2266 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2267 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2268 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2269}
2270
2271asn_enc_rval_t
2272Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2273 int ilevel, enum xer_encoder_flags_e flags,
2274 asn_app_consume_bytes_f *cb, void *app_key) {
2275 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2276 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2277}
2278
2279asn_dec_rval_t
2280Not_PER_Visible_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2281 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2282 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2283 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2284}
2285
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002286asn_enc_rval_t
2287Not_PER_Visible_1_encode_uper(asn_TYPE_descriptor_t *td,
2288 asn_per_constraints_t *constraints,
2289 void *structure, asn_per_outp_t *per_out) {
2290 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2291 return td->uper_encoder(td, constraints, structure, per_out);
2292}
2293
Lev Walkin59b176e2005-11-26 11:25:14 +00002294
Lev Walkin725883b2006-10-09 12:07:58 +00002295/*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/
2296
Lev Walkin2fce55d2013-03-28 05:00:39 -07002297static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002298 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
2299 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2300 0, 0 /* No PER character map necessary */
2301};
2302
Lev Walkin59b176e2005-11-26 11:25:14 +00002303/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
2304
Lev Walkina7591b52014-10-12 18:37:35 -07002305static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002306 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2307};
Lev Walkin59b176e2005-11-26 11:25:14 +00002308asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
2309 "Not-PER-Visible-1",
2310 "Not-PER-Visible-1",
2311 Not_PER_Visible_1_free,
2312 Not_PER_Visible_1_print,
2313 Not_PER_Visible_1_constraint,
2314 Not_PER_Visible_1_decode_ber,
2315 Not_PER_Visible_1_encode_der,
2316 Not_PER_Visible_1_decode_xer,
2317 Not_PER_Visible_1_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002318 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002319 Not_PER_Visible_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002320 Not_PER_Visible_1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002321 0, /* Use generic outmost tag fetcher */
2322 asn_DEF_Not_PER_Visible_1_tags_1,
2323 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2324 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2325 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
2326 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2327 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002328 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002329 &asn_PER_type_Not_PER_Visible_1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002330 0, 0, /* No members */
2331 0 /* No specifics */
2332};
2333
2334
2335/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
2336
Lev Walkin22b5ed42006-09-13 02:51:20 +00002337#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002338
2339/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
2340
2341typedef PER_Visible_t Not_PER_Visible_2_t;
2342
2343/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
2344
2345extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
2346asn_struct_free_f Not_PER_Visible_2_free;
2347asn_struct_print_f Not_PER_Visible_2_print;
2348asn_constr_check_f Not_PER_Visible_2_constraint;
2349ber_type_decoder_f Not_PER_Visible_2_decode_ber;
2350der_type_encoder_f Not_PER_Visible_2_encode_der;
2351xer_type_decoder_f Not_PER_Visible_2_decode_xer;
2352xer_type_encoder_f Not_PER_Visible_2_encode_xer;
2353per_type_decoder_f Not_PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002354per_type_encoder_f Not_PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002355
2356/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
2357
2358static int check_permitted_alphabet_1(const void *sptr) {
2359 /* The underlying type is IA5String */
2360 const IA5String_t *st = (const IA5String_t *)sptr;
2361 const uint8_t *ch = st->buf;
2362 const uint8_t *end = ch + st->size;
2363
2364 for(; ch < end; ch++) {
2365 uint8_t cv = *ch;
2366 if(!(cv >= 65 && cv <= 66)) return -1;
2367 }
2368 return 0;
2369}
2370
2371
2372/*** <<< CODE [Not-PER-Visible-2] >>> ***/
2373
2374int
2375Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002376 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002377 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2378
2379 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002380 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002381 "%s: value not given (%s:%d)",
2382 td->name, __FILE__, __LINE__);
2383 return -1;
2384 }
2385
2386
2387 if(!check_permitted_alphabet_1(st)) {
2388 /* Constraint check succeeded */
2389 return 0;
2390 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002391 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002392 "%s: constraint failed (%s:%d)",
2393 td->name, __FILE__, __LINE__);
2394 return -1;
2395 }
2396}
2397
2398/*
2399 * This type is implemented using PER_Visible,
2400 * so here we adjust the DEF accordingly.
2401 */
2402static void
2403Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2404 td->free_struct = asn_DEF_PER_Visible.free_struct;
2405 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002406 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002407 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2408 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2409 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2410 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2411 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002412 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002413 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2414 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002415 if(!td->oer_constraints)
2416 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002417 if(!td->per_constraints)
2418 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2419 td->elements = asn_DEF_PER_Visible.elements;
2420 td->elements_count = asn_DEF_PER_Visible.elements_count;
2421 td->specifics = asn_DEF_PER_Visible.specifics;
2422}
2423
2424void
2425Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2426 void *struct_ptr, int contents_only) {
2427 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2428 td->free_struct(td, struct_ptr, contents_only);
2429}
2430
2431int
2432Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2433 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2434 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2435 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2436}
2437
2438asn_dec_rval_t
2439Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2440 void **structure, const void *bufptr, size_t size, int tag_mode) {
2441 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2442 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2443}
2444
2445asn_enc_rval_t
2446Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2447 void *structure, int tag_mode, ber_tlv_tag_t tag,
2448 asn_app_consume_bytes_f *cb, void *app_key) {
2449 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2450 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2451}
2452
2453asn_dec_rval_t
2454Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2455 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2456 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2457 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2458}
2459
2460asn_enc_rval_t
2461Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2462 int ilevel, enum xer_encoder_flags_e flags,
2463 asn_app_consume_bytes_f *cb, void *app_key) {
2464 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2465 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2466}
2467
2468asn_dec_rval_t
2469Not_PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2470 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2471 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2472 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2473}
2474
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002475asn_enc_rval_t
2476Not_PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2477 asn_per_constraints_t *constraints,
2478 void *structure, asn_per_outp_t *per_out) {
2479 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2480 return td->uper_encoder(td, constraints, structure, per_out);
2481}
2482
Lev Walkin59b176e2005-11-26 11:25:14 +00002483
Lev Walkin725883b2006-10-09 12:07:58 +00002484/*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/
2485
Lev Walkin2fce55d2013-03-28 05:00:39 -07002486static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002487 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2488 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2489 0, 0 /* No PER character map necessary */
2490};
2491
Lev Walkin59b176e2005-11-26 11:25:14 +00002492/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
2493
Lev Walkina7591b52014-10-12 18:37:35 -07002494static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002495 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2496};
Lev Walkin59b176e2005-11-26 11:25:14 +00002497asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
2498 "Not-PER-Visible-2",
2499 "Not-PER-Visible-2",
2500 Not_PER_Visible_2_free,
2501 Not_PER_Visible_2_print,
2502 Not_PER_Visible_2_constraint,
2503 Not_PER_Visible_2_decode_ber,
2504 Not_PER_Visible_2_encode_der,
2505 Not_PER_Visible_2_decode_xer,
2506 Not_PER_Visible_2_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002507 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002508 Not_PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002509 Not_PER_Visible_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002510 0, /* Use generic outmost tag fetcher */
2511 asn_DEF_Not_PER_Visible_2_tags_1,
2512 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2513 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2514 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
2515 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2516 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002517 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002518 &asn_PER_type_Not_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002519 0, 0, /* No members */
2520 0 /* No specifics */
2521};
2522
2523
2524/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2525
Lev Walkin22b5ed42006-09-13 02:51:20 +00002526#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002527
2528/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2529
2530typedef PER_Visible_t Not_PER_Visible_3_t;
2531
2532/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2533
2534extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
2535asn_struct_free_f Not_PER_Visible_3_free;
2536asn_struct_print_f Not_PER_Visible_3_print;
2537asn_constr_check_f Not_PER_Visible_3_constraint;
2538ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2539der_type_encoder_f Not_PER_Visible_3_encode_der;
2540xer_type_decoder_f Not_PER_Visible_3_decode_xer;
2541xer_type_encoder_f Not_PER_Visible_3_encode_xer;
2542per_type_decoder_f Not_PER_Visible_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002543per_type_encoder_f Not_PER_Visible_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002544
2545/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2546
2547static int check_permitted_alphabet_1(const void *sptr) {
2548 /* The underlying type is IA5String */
2549 const IA5String_t *st = (const IA5String_t *)sptr;
2550 const uint8_t *ch = st->buf;
2551 const uint8_t *end = ch + st->size;
2552
2553 for(; ch < end; ch++) {
2554 uint8_t cv = *ch;
2555 if(!(cv >= 65 && cv <= 66)) return -1;
2556 }
2557 return 0;
2558}
2559
2560
2561/*** <<< CODE [Not-PER-Visible-3] >>> ***/
2562
2563int
2564Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002565 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002566 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2567
2568 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002569 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002570 "%s: value not given (%s:%d)",
2571 td->name, __FILE__, __LINE__);
2572 return -1;
2573 }
2574
2575
2576 if(!check_permitted_alphabet_1(st)) {
2577 /* Constraint check succeeded */
2578 return 0;
2579 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002580 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002581 "%s: constraint failed (%s:%d)",
2582 td->name, __FILE__, __LINE__);
2583 return -1;
2584 }
2585}
2586
2587/*
2588 * This type is implemented using PER_Visible,
2589 * so here we adjust the DEF accordingly.
2590 */
2591static void
2592Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2593 td->free_struct = asn_DEF_PER_Visible.free_struct;
2594 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002595 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002596 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2597 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2598 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2599 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2600 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002601 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002602 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2603 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002604 if(!td->oer_constraints)
2605 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002606 if(!td->per_constraints)
2607 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2608 td->elements = asn_DEF_PER_Visible.elements;
2609 td->elements_count = asn_DEF_PER_Visible.elements_count;
2610 td->specifics = asn_DEF_PER_Visible.specifics;
2611}
2612
2613void
2614Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
2615 void *struct_ptr, int contents_only) {
2616 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2617 td->free_struct(td, struct_ptr, contents_only);
2618}
2619
2620int
2621Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2622 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2623 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2624 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2625}
2626
2627asn_dec_rval_t
2628Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2629 void **structure, const void *bufptr, size_t size, int tag_mode) {
2630 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2631 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2632}
2633
2634asn_enc_rval_t
2635Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
2636 void *structure, int tag_mode, ber_tlv_tag_t tag,
2637 asn_app_consume_bytes_f *cb, void *app_key) {
2638 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2639 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2640}
2641
2642asn_dec_rval_t
2643Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2644 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2645 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2646 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2647}
2648
2649asn_enc_rval_t
2650Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2651 int ilevel, enum xer_encoder_flags_e flags,
2652 asn_app_consume_bytes_f *cb, void *app_key) {
2653 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2654 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2655}
2656
2657asn_dec_rval_t
2658Not_PER_Visible_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2659 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2660 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2661 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2662}
2663
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002664asn_enc_rval_t
2665Not_PER_Visible_3_encode_uper(asn_TYPE_descriptor_t *td,
2666 asn_per_constraints_t *constraints,
2667 void *structure, asn_per_outp_t *per_out) {
2668 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2669 return td->uper_encoder(td, constraints, structure, per_out);
2670}
2671
Lev Walkin59b176e2005-11-26 11:25:14 +00002672
Lev Walkin725883b2006-10-09 12:07:58 +00002673/*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/
2674
Lev Walkin2fce55d2013-03-28 05:00:39 -07002675static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002676 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2677 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2678 0, 0 /* No PER character map necessary */
2679};
2680
Lev Walkin59b176e2005-11-26 11:25:14 +00002681/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2682
Lev Walkina7591b52014-10-12 18:37:35 -07002683static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002684 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2685};
Lev Walkin59b176e2005-11-26 11:25:14 +00002686asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
2687 "Not-PER-Visible-3",
2688 "Not-PER-Visible-3",
2689 Not_PER_Visible_3_free,
2690 Not_PER_Visible_3_print,
2691 Not_PER_Visible_3_constraint,
2692 Not_PER_Visible_3_decode_ber,
2693 Not_PER_Visible_3_encode_der,
2694 Not_PER_Visible_3_decode_xer,
2695 Not_PER_Visible_3_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002696 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002697 Not_PER_Visible_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002698 Not_PER_Visible_3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002699 0, /* Use generic outmost tag fetcher */
2700 asn_DEF_Not_PER_Visible_3_tags_1,
2701 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2702 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2703 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
2704 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2705 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002706 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002707 &asn_PER_type_Not_PER_Visible_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002708 0, 0, /* No members */
2709 0 /* No specifics */
2710};
2711
2712
2713/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2714
Lev Walkin22b5ed42006-09-13 02:51:20 +00002715#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002716
2717/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2718
2719typedef PER_Visible_t SIZE_but_not_FROM_t;
2720
2721/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2722
2723extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
2724asn_struct_free_f SIZE_but_not_FROM_free;
2725asn_struct_print_f SIZE_but_not_FROM_print;
2726asn_constr_check_f SIZE_but_not_FROM_constraint;
2727ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2728der_type_encoder_f SIZE_but_not_FROM_encode_der;
2729xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
2730xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
2731per_type_decoder_f SIZE_but_not_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002732per_type_encoder_f SIZE_but_not_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002733
2734/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2735
2736static int check_permitted_alphabet_1(const void *sptr) {
2737 /* The underlying type is IA5String */
2738 const IA5String_t *st = (const IA5String_t *)sptr;
2739 const uint8_t *ch = st->buf;
2740 const uint8_t *end = ch + st->size;
2741
2742 for(; ch < end; ch++) {
2743 uint8_t cv = *ch;
2744 if(!(cv >= 65 && cv <= 68)) return -1;
2745 }
2746 return 0;
2747}
2748
2749
2750/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2751
2752int
2753SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002754 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002755 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2756 size_t size;
2757
2758 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002759 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002760 "%s: value not given (%s:%d)",
2761 td->name, __FILE__, __LINE__);
2762 return -1;
2763 }
2764
2765 size = st->size;
2766
2767 if((size >= 1 && size <= 4)
2768 && !check_permitted_alphabet_1(st)) {
2769 /* Constraint check succeeded */
2770 return 0;
2771 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002772 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002773 "%s: constraint failed (%s:%d)",
2774 td->name, __FILE__, __LINE__);
2775 return -1;
2776 }
2777}
2778
2779/*
2780 * This type is implemented using PER_Visible,
2781 * so here we adjust the DEF accordingly.
2782 */
2783static void
2784SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2785 td->free_struct = asn_DEF_PER_Visible.free_struct;
2786 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002787 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002788 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2789 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2790 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2791 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2792 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002793 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002794 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2795 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002796 if(!td->oer_constraints)
2797 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002798 if(!td->per_constraints)
2799 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2800 td->elements = asn_DEF_PER_Visible.elements;
2801 td->elements_count = asn_DEF_PER_Visible.elements_count;
2802 td->specifics = asn_DEF_PER_Visible.specifics;
2803}
2804
2805void
2806SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
2807 void *struct_ptr, int contents_only) {
2808 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2809 td->free_struct(td, struct_ptr, contents_only);
2810}
2811
2812int
2813SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2814 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2815 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2816 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2817}
2818
2819asn_dec_rval_t
2820SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2821 void **structure, const void *bufptr, size_t size, int tag_mode) {
2822 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2823 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2824}
2825
2826asn_enc_rval_t
2827SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
2828 void *structure, int tag_mode, ber_tlv_tag_t tag,
2829 asn_app_consume_bytes_f *cb, void *app_key) {
2830 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2831 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2832}
2833
2834asn_dec_rval_t
2835SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2836 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2837 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2838 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2839}
2840
2841asn_enc_rval_t
2842SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2843 int ilevel, enum xer_encoder_flags_e flags,
2844 asn_app_consume_bytes_f *cb, void *app_key) {
2845 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2846 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2847}
2848
2849asn_dec_rval_t
2850SIZE_but_not_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2851 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2852 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2853 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2854}
2855
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002856asn_enc_rval_t
2857SIZE_but_not_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2858 asn_per_constraints_t *constraints,
2859 void *structure, asn_per_outp_t *per_out) {
2860 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2861 return td->uper_encoder(td, constraints, structure, per_out);
2862}
2863
Lev Walkin59b176e2005-11-26 11:25:14 +00002864
Lev Walkin725883b2006-10-09 12:07:58 +00002865/*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/
2866
Lev Walkin2fce55d2013-03-28 05:00:39 -07002867static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002868 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2869 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
2870 0, 0 /* No PER character map necessary */
2871};
2872
Lev Walkin59b176e2005-11-26 11:25:14 +00002873/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2874
Lev Walkina7591b52014-10-12 18:37:35 -07002875static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002876 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2877};
Lev Walkin59b176e2005-11-26 11:25:14 +00002878asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
2879 "SIZE-but-not-FROM",
2880 "SIZE-but-not-FROM",
2881 SIZE_but_not_FROM_free,
2882 SIZE_but_not_FROM_print,
2883 SIZE_but_not_FROM_constraint,
2884 SIZE_but_not_FROM_decode_ber,
2885 SIZE_but_not_FROM_encode_der,
2886 SIZE_but_not_FROM_decode_xer,
2887 SIZE_but_not_FROM_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04002888 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002889 SIZE_but_not_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002890 SIZE_but_not_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002891 0, /* Use generic outmost tag fetcher */
2892 asn_DEF_SIZE_but_not_FROM_tags_1,
2893 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2894 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2895 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
2896 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2897 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04002898 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002899 &asn_PER_type_SIZE_but_not_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002900 0, 0, /* No members */
2901 0 /* No specifics */
2902};
2903
2904
2905/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2906
Lev Walkin22b5ed42006-09-13 02:51:20 +00002907#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002908
2909/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2910
2911typedef PER_Visible_t SIZE_and_FROM_t;
2912
2913/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2914
2915extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
2916asn_struct_free_f SIZE_and_FROM_free;
2917asn_struct_print_f SIZE_and_FROM_print;
2918asn_constr_check_f SIZE_and_FROM_constraint;
2919ber_type_decoder_f SIZE_and_FROM_decode_ber;
2920der_type_encoder_f SIZE_and_FROM_encode_der;
2921xer_type_decoder_f SIZE_and_FROM_decode_xer;
2922xer_type_encoder_f SIZE_and_FROM_encode_xer;
2923per_type_decoder_f SIZE_and_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002924per_type_encoder_f SIZE_and_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002925
2926/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2927
2928static int check_permitted_alphabet_1(const void *sptr) {
2929 /* The underlying type is IA5String */
2930 const IA5String_t *st = (const IA5String_t *)sptr;
2931 const uint8_t *ch = st->buf;
2932 const uint8_t *end = ch + st->size;
2933
2934 for(; ch < end; ch++) {
2935 uint8_t cv = *ch;
2936 if(!(cv >= 65 && cv <= 68)) return -1;
2937 }
2938 return 0;
2939}
2940
2941
2942/*** <<< CODE [SIZE-and-FROM] >>> ***/
2943
2944int
2945SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002946 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002947 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2948 size_t size;
2949
2950 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002951 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002952 "%s: value not given (%s:%d)",
2953 td->name, __FILE__, __LINE__);
2954 return -1;
2955 }
2956
2957 size = st->size;
2958
2959 if((size >= 1 && size <= 4)
2960 && !check_permitted_alphabet_1(st)) {
2961 /* Constraint check succeeded */
2962 return 0;
2963 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002964 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002965 "%s: constraint failed (%s:%d)",
2966 td->name, __FILE__, __LINE__);
2967 return -1;
2968 }
2969}
2970
2971/*
2972 * This type is implemented using PER_Visible,
2973 * so here we adjust the DEF accordingly.
2974 */
2975static void
2976SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2977 td->free_struct = asn_DEF_PER_Visible.free_struct;
2978 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002979 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002980 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2981 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2982 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2983 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2984 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002985 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002986 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2987 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04002988 if(!td->oer_constraints)
2989 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002990 if(!td->per_constraints)
2991 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2992 td->elements = asn_DEF_PER_Visible.elements;
2993 td->elements_count = asn_DEF_PER_Visible.elements_count;
2994 td->specifics = asn_DEF_PER_Visible.specifics;
2995}
2996
2997void
2998SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
2999 void *struct_ptr, int contents_only) {
3000 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
3001 td->free_struct(td, struct_ptr, contents_only);
3002}
3003
3004int
3005SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3006 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3007 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
3008 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3009}
3010
3011asn_dec_rval_t
3012SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3013 void **structure, const void *bufptr, size_t size, int tag_mode) {
3014 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
3015 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3016}
3017
3018asn_enc_rval_t
3019SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
3020 void *structure, int tag_mode, ber_tlv_tag_t tag,
3021 asn_app_consume_bytes_f *cb, void *app_key) {
3022 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
3023 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3024}
3025
3026asn_dec_rval_t
3027SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3028 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3029 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
3030 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3031}
3032
3033asn_enc_rval_t
3034SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3035 int ilevel, enum xer_encoder_flags_e flags,
3036 asn_app_consume_bytes_f *cb, void *app_key) {
3037 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
3038 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3039}
3040
3041asn_dec_rval_t
3042SIZE_and_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3043 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3044 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
3045 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3046}
3047
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003048asn_enc_rval_t
3049SIZE_and_FROM_encode_uper(asn_TYPE_descriptor_t *td,
3050 asn_per_constraints_t *constraints,
3051 void *structure, asn_per_outp_t *per_out) {
3052 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
3053 return td->uper_encoder(td, constraints, structure, per_out);
3054}
3055
Lev Walkin59b176e2005-11-26 11:25:14 +00003056
Lev Walkin725883b2006-10-09 12:07:58 +00003057/*** <<< CTDEFS [SIZE-and-FROM] >>> ***/
3058
Lev Walkin2fce55d2013-03-28 05:00:39 -07003059static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003060 { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */,
3061 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
3062 0, 0 /* No PER character map necessary */
3063};
3064
Lev Walkin59b176e2005-11-26 11:25:14 +00003065/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
3066
Lev Walkina7591b52014-10-12 18:37:35 -07003067static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003068 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
3069};
Lev Walkin59b176e2005-11-26 11:25:14 +00003070asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
3071 "SIZE-and-FROM",
3072 "SIZE-and-FROM",
3073 SIZE_and_FROM_free,
3074 SIZE_and_FROM_print,
3075 SIZE_and_FROM_constraint,
3076 SIZE_and_FROM_decode_ber,
3077 SIZE_and_FROM_encode_der,
3078 SIZE_and_FROM_decode_xer,
3079 SIZE_and_FROM_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04003080 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003081 SIZE_and_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003082 SIZE_and_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003083 0, /* Use generic outmost tag fetcher */
3084 asn_DEF_SIZE_and_FROM_tags_1,
3085 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
3086 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
3087 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
3088 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
3089 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003090 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003091 &asn_PER_type_SIZE_and_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003092 0, 0, /* No members */
3093 0 /* No specifics */
3094};
3095
3096
3097/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
3098
Lev Walkin22b5ed42006-09-13 02:51:20 +00003099#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003100
3101/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
3102
3103typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
3104
3105/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
3106
3107extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
3108asn_struct_free_f Neither_SIZE_nor_FROM_free;
3109asn_struct_print_f Neither_SIZE_nor_FROM_print;
3110asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
3111ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
3112der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
3113xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
3114xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
3115per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003116per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003117
3118/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
3119
3120static int check_permitted_alphabet_1(const void *sptr) {
3121 /* The underlying type is IA5String */
3122 const IA5String_t *st = (const IA5String_t *)sptr;
3123 const uint8_t *ch = st->buf;
3124 const uint8_t *end = ch + st->size;
3125
3126 for(; ch < end; ch++) {
3127 uint8_t cv = *ch;
3128 if(!(cv >= 65 && cv <= 70)) return -1;
3129 }
3130 return 0;
3131}
3132
3133
3134/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
3135
3136int
3137Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003138 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003139 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
3140
3141 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003142 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003143 "%s: value not given (%s:%d)",
3144 td->name, __FILE__, __LINE__);
3145 return -1;
3146 }
3147
3148
3149 if(!check_permitted_alphabet_1(st)) {
3150 /* Constraint check succeeded */
3151 return 0;
3152 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003153 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003154 "%s: constraint failed (%s:%d)",
3155 td->name, __FILE__, __LINE__);
3156 return -1;
3157 }
3158}
3159
3160/*
3161 * This type is implemented using PER_Visible,
3162 * so here we adjust the DEF accordingly.
3163 */
3164static void
3165Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3166 td->free_struct = asn_DEF_PER_Visible.free_struct;
3167 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003168 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003169 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
3170 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
3171 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
3172 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
3173 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003174 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003175 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
3176 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003177 if(!td->oer_constraints)
3178 td->oer_constraints = asn_DEF_PER_Visible.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003179 if(!td->per_constraints)
3180 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
3181 td->elements = asn_DEF_PER_Visible.elements;
3182 td->elements_count = asn_DEF_PER_Visible.elements_count;
3183 td->specifics = asn_DEF_PER_Visible.specifics;
3184}
3185
3186void
3187Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
3188 void *struct_ptr, int contents_only) {
3189 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3190 td->free_struct(td, struct_ptr, contents_only);
3191}
3192
3193int
3194Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3195 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3196 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3197 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3198}
3199
3200asn_dec_rval_t
3201Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3202 void **structure, const void *bufptr, size_t size, int tag_mode) {
3203 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3204 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3205}
3206
3207asn_enc_rval_t
3208Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
3209 void *structure, int tag_mode, ber_tlv_tag_t tag,
3210 asn_app_consume_bytes_f *cb, void *app_key) {
3211 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3212 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3213}
3214
3215asn_dec_rval_t
3216Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3217 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3218 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3219 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3220}
3221
3222asn_enc_rval_t
3223Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3224 int ilevel, enum xer_encoder_flags_e flags,
3225 asn_app_consume_bytes_f *cb, void *app_key) {
3226 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3227 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3228}
3229
3230asn_dec_rval_t
3231Neither_SIZE_nor_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3232 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3233 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3234 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3235}
3236
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003237asn_enc_rval_t
3238Neither_SIZE_nor_FROM_encode_uper(asn_TYPE_descriptor_t *td,
3239 asn_per_constraints_t *constraints,
3240 void *structure, asn_per_outp_t *per_out) {
3241 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3242 return td->uper_encoder(td, constraints, structure, per_out);
3243}
3244
Lev Walkin59b176e2005-11-26 11:25:14 +00003245
Lev Walkin725883b2006-10-09 12:07:58 +00003246/*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/
3247
Lev Walkin2fce55d2013-03-28 05:00:39 -07003248static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003249 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
3250 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
3251 0, 0 /* No PER character map necessary */
3252};
3253
Lev Walkin59b176e2005-11-26 11:25:14 +00003254/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
3255
Lev Walkina7591b52014-10-12 18:37:35 -07003256static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003257 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
3258};
Lev Walkin59b176e2005-11-26 11:25:14 +00003259asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
3260 "Neither-SIZE-nor-FROM",
3261 "Neither-SIZE-nor-FROM",
3262 Neither_SIZE_nor_FROM_free,
3263 Neither_SIZE_nor_FROM_print,
3264 Neither_SIZE_nor_FROM_constraint,
3265 Neither_SIZE_nor_FROM_decode_ber,
3266 Neither_SIZE_nor_FROM_encode_der,
3267 Neither_SIZE_nor_FROM_decode_xer,
3268 Neither_SIZE_nor_FROM_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04003269 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003270 Neither_SIZE_nor_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003271 Neither_SIZE_nor_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003272 0, /* Use generic outmost tag fetcher */
3273 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
3274 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3275 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
3276 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
3277 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3278 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003279 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003280 &asn_PER_type_Neither_SIZE_nor_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003281 0, 0, /* No members */
3282 0 /* No specifics */
3283};
3284
3285
3286/*** <<< INCLUDES [Utf8-4] >>> ***/
3287
3288#include <UTF8String.h>
3289
3290/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
3291
3292typedef UTF8String_t Utf8_4_t;
3293
3294/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
3295
3296extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
3297asn_struct_free_f Utf8_4_free;
3298asn_struct_print_f Utf8_4_print;
3299asn_constr_check_f Utf8_4_constraint;
3300ber_type_decoder_f Utf8_4_decode_ber;
3301der_type_encoder_f Utf8_4_encode_der;
3302xer_type_decoder_f Utf8_4_decode_xer;
3303xer_type_encoder_f Utf8_4_encode_xer;
3304per_type_decoder_f Utf8_4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003305per_type_encoder_f Utf8_4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003306
3307/*** <<< CTABLES [Utf8-4] >>> ***/
3308
3309static int check_permitted_alphabet_1(const void *sptr) {
3310 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
3311 return -1; /* Alphabet (sic!) test failed. */
3312
3313 return 0;
3314}
3315
3316
3317/*** <<< CODE [Utf8-4] >>> ***/
3318
3319int
3320Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003321 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003322 const UTF8String_t *st = (const UTF8String_t *)sptr;
3323
3324 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003325 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003326 "%s: value not given (%s:%d)",
3327 td->name, __FILE__, __LINE__);
3328 return -1;
3329 }
3330
3331
3332 if(!check_permitted_alphabet_1(st)) {
3333 /* Constraint check succeeded */
3334 return 0;
3335 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003336 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003337 "%s: constraint failed (%s:%d)",
3338 td->name, __FILE__, __LINE__);
3339 return -1;
3340 }
3341}
3342
3343/*
3344 * This type is implemented using UTF8String,
3345 * so here we adjust the DEF accordingly.
3346 */
3347static void
3348Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3349 td->free_struct = asn_DEF_UTF8String.free_struct;
3350 td->print_struct = asn_DEF_UTF8String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003351 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003352 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3353 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3354 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3355 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3356 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003357 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003358 td->oer_decoder = asn_DEF_UTF8String.oer_decoder;
3359 td->oer_encoder = asn_DEF_UTF8String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003360 if(!td->oer_constraints)
3361 td->oer_constraints = asn_DEF_UTF8String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003362 if(!td->per_constraints)
3363 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3364 td->elements = asn_DEF_UTF8String.elements;
3365 td->elements_count = asn_DEF_UTF8String.elements_count;
3366 td->specifics = asn_DEF_UTF8String.specifics;
3367}
3368
3369void
3370Utf8_4_free(asn_TYPE_descriptor_t *td,
3371 void *struct_ptr, int contents_only) {
3372 Utf8_4_1_inherit_TYPE_descriptor(td);
3373 td->free_struct(td, struct_ptr, contents_only);
3374}
3375
3376int
3377Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3378 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3379 Utf8_4_1_inherit_TYPE_descriptor(td);
3380 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3381}
3382
3383asn_dec_rval_t
3384Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3385 void **structure, const void *bufptr, size_t size, int tag_mode) {
3386 Utf8_4_1_inherit_TYPE_descriptor(td);
3387 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3388}
3389
3390asn_enc_rval_t
3391Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
3392 void *structure, int tag_mode, ber_tlv_tag_t tag,
3393 asn_app_consume_bytes_f *cb, void *app_key) {
3394 Utf8_4_1_inherit_TYPE_descriptor(td);
3395 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3396}
3397
3398asn_dec_rval_t
3399Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3400 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3401 Utf8_4_1_inherit_TYPE_descriptor(td);
3402 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3403}
3404
3405asn_enc_rval_t
3406Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3407 int ilevel, enum xer_encoder_flags_e flags,
3408 asn_app_consume_bytes_f *cb, void *app_key) {
3409 Utf8_4_1_inherit_TYPE_descriptor(td);
3410 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3411}
3412
3413asn_dec_rval_t
3414Utf8_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3415 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3416 Utf8_4_1_inherit_TYPE_descriptor(td);
3417 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3418}
3419
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003420asn_enc_rval_t
3421Utf8_4_encode_uper(asn_TYPE_descriptor_t *td,
3422 asn_per_constraints_t *constraints,
3423 void *structure, asn_per_outp_t *per_out) {
3424 Utf8_4_1_inherit_TYPE_descriptor(td);
3425 return td->uper_encoder(td, constraints, structure, per_out);
3426}
3427
Lev Walkin59b176e2005-11-26 11:25:14 +00003428
Lev Walkin725883b2006-10-09 12:07:58 +00003429/*** <<< CTDEFS [Utf8-4] >>> ***/
3430
Lev Walkin2fce55d2013-03-28 05:00:39 -07003431static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003432 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3433 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3434 0, 0 /* No PER value map */
3435};
3436
Lev Walkin59b176e2005-11-26 11:25:14 +00003437/*** <<< STAT-DEFS [Utf8-4] >>> ***/
3438
Lev Walkina7591b52014-10-12 18:37:35 -07003439static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003440 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3441};
Lev Walkin59b176e2005-11-26 11:25:14 +00003442asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
3443 "Utf8-4",
3444 "Utf8-4",
3445 Utf8_4_free,
3446 Utf8_4_print,
3447 Utf8_4_constraint,
3448 Utf8_4_decode_ber,
3449 Utf8_4_encode_der,
3450 Utf8_4_decode_xer,
3451 Utf8_4_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04003452 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003453 Utf8_4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003454 Utf8_4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003455 0, /* Use generic outmost tag fetcher */
3456 asn_DEF_Utf8_4_tags_1,
3457 sizeof(asn_DEF_Utf8_4_tags_1)
3458 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
3459 asn_DEF_Utf8_4_tags_1, /* Same as above */
3460 sizeof(asn_DEF_Utf8_4_tags_1)
3461 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003462 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003463 &asn_PER_type_Utf8_4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003464 0, 0, /* No members */
3465 0 /* No specifics */
3466};
3467
3468
3469/*** <<< INCLUDES [Utf8-3] >>> ***/
3470
Lev Walkin22b5ed42006-09-13 02:51:20 +00003471#include "Utf8-2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003472
3473/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
3474
3475typedef Utf8_2_t Utf8_3_t;
3476
3477/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
3478
3479extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
3480asn_struct_free_f Utf8_3_free;
3481asn_struct_print_f Utf8_3_print;
3482asn_constr_check_f Utf8_3_constraint;
3483ber_type_decoder_f Utf8_3_decode_ber;
3484der_type_encoder_f Utf8_3_encode_der;
3485xer_type_decoder_f Utf8_3_decode_xer;
3486xer_type_encoder_f Utf8_3_encode_xer;
3487per_type_decoder_f Utf8_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003488per_type_encoder_f Utf8_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003489
3490/*** <<< CTABLES [Utf8-3] >>> ***/
3491
Lev Walkina7591b52014-10-12 18:37:35 -07003492static const int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003493 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3495 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3496 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3497 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
349816,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
3499 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
350042,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003501};
3502
3503static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07003504 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00003505 /* The underlying type is UTF8String */
3506 const UTF8String_t *st = (const UTF8String_t *)sptr;
3507 const uint8_t *ch = st->buf;
3508 const uint8_t *end = ch + st->size;
3509
3510 for(; ch < end; ch++) {
3511 uint8_t cv = *ch;
3512 if(cv >= 0x80) return -1;
3513 if(!table[cv]) return -1;
3514 }
3515 return 0;
3516}
3517
3518
3519/*** <<< CODE [Utf8-3] >>> ***/
3520
3521int
3522Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003523 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003524 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
3525 size_t size;
3526
3527 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003528 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003529 "%s: value not given (%s:%d)",
3530 td->name, __FILE__, __LINE__);
3531 return -1;
3532 }
3533
3534 size = UTF8String_length(st);
3535 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003536 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003537 "%s: UTF-8: broken encoding (%s:%d)",
3538 td->name, __FILE__, __LINE__);
3539 return -1;
3540 }
3541
3542 if((size >= 1 && size <= 2)
3543 && !check_permitted_alphabet_1(st)) {
3544 /* Constraint check succeeded */
3545 return 0;
3546 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003547 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003548 "%s: constraint failed (%s:%d)",
3549 td->name, __FILE__, __LINE__);
3550 return -1;
3551 }
3552}
3553
3554/*
3555 * This type is implemented using Utf8_2,
3556 * so here we adjust the DEF accordingly.
3557 */
3558static void
3559Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3560 td->free_struct = asn_DEF_Utf8_2.free_struct;
3561 td->print_struct = asn_DEF_Utf8_2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003562 td->check_constraints = asn_DEF_Utf8_2.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003563 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
3564 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
3565 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
3566 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
3567 td->uper_decoder = asn_DEF_Utf8_2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003568 td->uper_encoder = asn_DEF_Utf8_2.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003569 td->oer_decoder = asn_DEF_Utf8_2.oer_decoder;
3570 td->oer_encoder = asn_DEF_Utf8_2.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003571 if(!td->oer_constraints)
3572 td->oer_constraints = asn_DEF_Utf8_2.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003573 if(!td->per_constraints)
3574 td->per_constraints = asn_DEF_Utf8_2.per_constraints;
3575 td->elements = asn_DEF_Utf8_2.elements;
3576 td->elements_count = asn_DEF_Utf8_2.elements_count;
3577 td->specifics = asn_DEF_Utf8_2.specifics;
3578}
3579
3580void
3581Utf8_3_free(asn_TYPE_descriptor_t *td,
3582 void *struct_ptr, int contents_only) {
3583 Utf8_3_1_inherit_TYPE_descriptor(td);
3584 td->free_struct(td, struct_ptr, contents_only);
3585}
3586
3587int
3588Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3589 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3590 Utf8_3_1_inherit_TYPE_descriptor(td);
3591 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3592}
3593
3594asn_dec_rval_t
3595Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3596 void **structure, const void *bufptr, size_t size, int tag_mode) {
3597 Utf8_3_1_inherit_TYPE_descriptor(td);
3598 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3599}
3600
3601asn_enc_rval_t
3602Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
3603 void *structure, int tag_mode, ber_tlv_tag_t tag,
3604 asn_app_consume_bytes_f *cb, void *app_key) {
3605 Utf8_3_1_inherit_TYPE_descriptor(td);
3606 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3607}
3608
3609asn_dec_rval_t
3610Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3611 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3612 Utf8_3_1_inherit_TYPE_descriptor(td);
3613 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3614}
3615
3616asn_enc_rval_t
3617Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3618 int ilevel, enum xer_encoder_flags_e flags,
3619 asn_app_consume_bytes_f *cb, void *app_key) {
3620 Utf8_3_1_inherit_TYPE_descriptor(td);
3621 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3622}
3623
3624asn_dec_rval_t
3625Utf8_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3626 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3627 Utf8_3_1_inherit_TYPE_descriptor(td);
3628 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3629}
3630
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003631asn_enc_rval_t
3632Utf8_3_encode_uper(asn_TYPE_descriptor_t *td,
3633 asn_per_constraints_t *constraints,
3634 void *structure, asn_per_outp_t *per_out) {
3635 Utf8_3_1_inherit_TYPE_descriptor(td);
3636 return td->uper_encoder(td, constraints, structure, per_out);
3637}
3638
Lev Walkin59b176e2005-11-26 11:25:14 +00003639
Lev Walkin725883b2006-10-09 12:07:58 +00003640/*** <<< CTDEFS [Utf8-3] >>> ***/
3641
Lev Walkin2fce55d2013-03-28 05:00:39 -07003642static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003643 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3644 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3645 0, 0 /* No PER value map */
3646};
3647
Lev Walkin59b176e2005-11-26 11:25:14 +00003648/*** <<< STAT-DEFS [Utf8-3] >>> ***/
3649
Lev Walkina7591b52014-10-12 18:37:35 -07003650static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003651 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3652};
Lev Walkin59b176e2005-11-26 11:25:14 +00003653asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
3654 "Utf8-3",
3655 "Utf8-3",
3656 Utf8_3_free,
3657 Utf8_3_print,
3658 Utf8_3_constraint,
3659 Utf8_3_decode_ber,
3660 Utf8_3_encode_der,
3661 Utf8_3_decode_xer,
3662 Utf8_3_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04003663 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003664 Utf8_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003665 Utf8_3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003666 0, /* Use generic outmost tag fetcher */
3667 asn_DEF_Utf8_3_tags_1,
3668 sizeof(asn_DEF_Utf8_3_tags_1)
3669 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3670 asn_DEF_Utf8_3_tags_1, /* Same as above */
3671 sizeof(asn_DEF_Utf8_3_tags_1)
3672 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003673 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003674 &asn_PER_type_Utf8_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003675 0, 0, /* No members */
3676 0 /* No specifics */
3677};
3678
3679
3680/*** <<< INCLUDES [Utf8-2] >>> ***/
3681
Lev Walkin22b5ed42006-09-13 02:51:20 +00003682#include "Utf8-1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003683
3684/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
3685
3686typedef Utf8_1_t Utf8_2_t;
3687
3688/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
3689
3690extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
3691asn_struct_free_f Utf8_2_free;
3692asn_struct_print_f Utf8_2_print;
3693asn_constr_check_f Utf8_2_constraint;
3694ber_type_decoder_f Utf8_2_decode_ber;
3695der_type_encoder_f Utf8_2_encode_der;
3696xer_type_decoder_f Utf8_2_decode_xer;
3697xer_type_encoder_f Utf8_2_encode_xer;
3698per_type_decoder_f Utf8_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003699per_type_encoder_f Utf8_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003700
3701/*** <<< CODE [Utf8-2] >>> ***/
3702
3703int
3704Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003705 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003706 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
3707 size_t size;
3708
3709 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003710 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003711 "%s: value not given (%s:%d)",
3712 td->name, __FILE__, __LINE__);
3713 return -1;
3714 }
3715
3716 size = UTF8String_length(st);
3717 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003718 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003719 "%s: UTF-8: broken encoding (%s:%d)",
3720 td->name, __FILE__, __LINE__);
3721 return -1;
3722 }
3723
3724 if((size >= 1 && size <= 2)) {
3725 /* Constraint check succeeded */
3726 return 0;
3727 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003728 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003729 "%s: constraint failed (%s:%d)",
3730 td->name, __FILE__, __LINE__);
3731 return -1;
3732 }
3733}
3734
3735/*
3736 * This type is implemented using Utf8_1,
3737 * so here we adjust the DEF accordingly.
3738 */
3739static void
3740Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3741 td->free_struct = asn_DEF_Utf8_1.free_struct;
3742 td->print_struct = asn_DEF_Utf8_1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003743 td->check_constraints = asn_DEF_Utf8_1.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003744 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
3745 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
3746 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
3747 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
3748 td->uper_decoder = asn_DEF_Utf8_1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003749 td->uper_encoder = asn_DEF_Utf8_1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003750 td->oer_decoder = asn_DEF_Utf8_1.oer_decoder;
3751 td->oer_encoder = asn_DEF_Utf8_1.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003752 if(!td->oer_constraints)
3753 td->oer_constraints = asn_DEF_Utf8_1.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003754 if(!td->per_constraints)
3755 td->per_constraints = asn_DEF_Utf8_1.per_constraints;
3756 td->elements = asn_DEF_Utf8_1.elements;
3757 td->elements_count = asn_DEF_Utf8_1.elements_count;
3758 td->specifics = asn_DEF_Utf8_1.specifics;
3759}
3760
3761void
3762Utf8_2_free(asn_TYPE_descriptor_t *td,
3763 void *struct_ptr, int contents_only) {
3764 Utf8_2_1_inherit_TYPE_descriptor(td);
3765 td->free_struct(td, struct_ptr, contents_only);
3766}
3767
3768int
3769Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3770 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3771 Utf8_2_1_inherit_TYPE_descriptor(td);
3772 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3773}
3774
3775asn_dec_rval_t
3776Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3777 void **structure, const void *bufptr, size_t size, int tag_mode) {
3778 Utf8_2_1_inherit_TYPE_descriptor(td);
3779 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3780}
3781
3782asn_enc_rval_t
3783Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
3784 void *structure, int tag_mode, ber_tlv_tag_t tag,
3785 asn_app_consume_bytes_f *cb, void *app_key) {
3786 Utf8_2_1_inherit_TYPE_descriptor(td);
3787 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3788}
3789
3790asn_dec_rval_t
3791Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3792 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3793 Utf8_2_1_inherit_TYPE_descriptor(td);
3794 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3795}
3796
3797asn_enc_rval_t
3798Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3799 int ilevel, enum xer_encoder_flags_e flags,
3800 asn_app_consume_bytes_f *cb, void *app_key) {
3801 Utf8_2_1_inherit_TYPE_descriptor(td);
3802 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3803}
3804
3805asn_dec_rval_t
3806Utf8_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3807 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3808 Utf8_2_1_inherit_TYPE_descriptor(td);
3809 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3810}
3811
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003812asn_enc_rval_t
3813Utf8_2_encode_uper(asn_TYPE_descriptor_t *td,
3814 asn_per_constraints_t *constraints,
3815 void *structure, asn_per_outp_t *per_out) {
3816 Utf8_2_1_inherit_TYPE_descriptor(td);
3817 return td->uper_encoder(td, constraints, structure, per_out);
3818}
3819
Lev Walkin59b176e2005-11-26 11:25:14 +00003820
Lev Walkin725883b2006-10-09 12:07:58 +00003821/*** <<< CTDEFS [Utf8-2] >>> ***/
3822
Lev Walkin2fce55d2013-03-28 05:00:39 -07003823static asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003824 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3825 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3826 0, 0 /* No PER value map */
3827};
3828
Lev Walkin59b176e2005-11-26 11:25:14 +00003829/*** <<< STAT-DEFS [Utf8-2] >>> ***/
3830
Lev Walkina7591b52014-10-12 18:37:35 -07003831static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003832 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3833};
Lev Walkin59b176e2005-11-26 11:25:14 +00003834asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
3835 "Utf8-2",
3836 "Utf8-2",
3837 Utf8_2_free,
3838 Utf8_2_print,
3839 Utf8_2_constraint,
3840 Utf8_2_decode_ber,
3841 Utf8_2_encode_der,
3842 Utf8_2_decode_xer,
3843 Utf8_2_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04003844 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003845 Utf8_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003846 Utf8_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003847 0, /* Use generic outmost tag fetcher */
3848 asn_DEF_Utf8_2_tags_1,
3849 sizeof(asn_DEF_Utf8_2_tags_1)
3850 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3851 asn_DEF_Utf8_2_tags_1, /* Same as above */
3852 sizeof(asn_DEF_Utf8_2_tags_1)
3853 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04003854 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003855 &asn_PER_type_Utf8_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003856 0, 0, /* No members */
3857 0 /* No specifics */
3858};
3859
3860
3861/*** <<< INCLUDES [Utf8-1] >>> ***/
3862
3863#include <UTF8String.h>
3864
3865/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3866
3867typedef UTF8String_t Utf8_1_t;
3868
3869/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3870
3871extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3872asn_struct_free_f Utf8_1_free;
3873asn_struct_print_f Utf8_1_print;
3874asn_constr_check_f Utf8_1_constraint;
3875ber_type_decoder_f Utf8_1_decode_ber;
3876der_type_encoder_f Utf8_1_encode_der;
3877xer_type_decoder_f Utf8_1_decode_xer;
3878xer_type_encoder_f Utf8_1_encode_xer;
3879per_type_decoder_f Utf8_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003880per_type_encoder_f Utf8_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003881
3882/*** <<< CODE [Utf8-1] >>> ***/
3883
3884int
3885Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003886 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003887 /* Replace with underlying type checker */
3888 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00003889 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00003890}
3891
3892/*
3893 * This type is implemented using UTF8String,
3894 * so here we adjust the DEF accordingly.
3895 */
3896static void
3897Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3898 td->free_struct = asn_DEF_UTF8String.free_struct;
3899 td->print_struct = asn_DEF_UTF8String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003900 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003901 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3902 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3903 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3904 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3905 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003906 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003907 td->oer_decoder = asn_DEF_UTF8String.oer_decoder;
3908 td->oer_encoder = asn_DEF_UTF8String.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04003909 if(!td->oer_constraints)
3910 td->oer_constraints = asn_DEF_UTF8String.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003911 if(!td->per_constraints)
3912 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3913 td->elements = asn_DEF_UTF8String.elements;
3914 td->elements_count = asn_DEF_UTF8String.elements_count;
3915 td->specifics = asn_DEF_UTF8String.specifics;
3916}
3917
3918void
3919Utf8_1_free(asn_TYPE_descriptor_t *td,
3920 void *struct_ptr, int contents_only) {
3921 Utf8_1_1_inherit_TYPE_descriptor(td);
3922 td->free_struct(td, struct_ptr, contents_only);
3923}
3924
3925int
3926Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3927 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3928 Utf8_1_1_inherit_TYPE_descriptor(td);
3929 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3930}
3931
3932asn_dec_rval_t
3933Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3934 void **structure, const void *bufptr, size_t size, int tag_mode) {
3935 Utf8_1_1_inherit_TYPE_descriptor(td);
3936 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3937}
3938
3939asn_enc_rval_t
3940Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3941 void *structure, int tag_mode, ber_tlv_tag_t tag,
3942 asn_app_consume_bytes_f *cb, void *app_key) {
3943 Utf8_1_1_inherit_TYPE_descriptor(td);
3944 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3945}
3946
3947asn_dec_rval_t
3948Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3949 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3950 Utf8_1_1_inherit_TYPE_descriptor(td);
3951 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3952}
3953
3954asn_enc_rval_t
3955Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3956 int ilevel, enum xer_encoder_flags_e flags,
3957 asn_app_consume_bytes_f *cb, void *app_key) {
3958 Utf8_1_1_inherit_TYPE_descriptor(td);
3959 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3960}
3961
3962asn_dec_rval_t
3963Utf8_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3964 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3965 Utf8_1_1_inherit_TYPE_descriptor(td);
3966 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3967}
3968
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003969asn_enc_rval_t
3970Utf8_1_encode_uper(asn_TYPE_descriptor_t *td,
3971 asn_per_constraints_t *constraints,
3972 void *structure, asn_per_outp_t *per_out) {
3973 Utf8_1_1_inherit_TYPE_descriptor(td);
3974 return td->uper_encoder(td, constraints, structure, per_out);
3975}
3976
Lev Walkin59b176e2005-11-26 11:25:14 +00003977
3978/*** <<< STAT-DEFS [Utf8-1] >>> ***/
3979
Lev Walkina7591b52014-10-12 18:37:35 -07003980static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003981 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3982};
3983asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3984 "Utf8-1",
3985 "Utf8-1",
3986 Utf8_1_free,
3987 Utf8_1_print,
3988 Utf8_1_constraint,
3989 Utf8_1_decode_ber,
3990 Utf8_1_encode_der,
3991 Utf8_1_decode_xer,
3992 Utf8_1_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04003993 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003994 Utf8_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003995 Utf8_1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003996 0, /* Use generic outmost tag fetcher */
3997 asn_DEF_Utf8_1_tags_1,
3998 sizeof(asn_DEF_Utf8_1_tags_1)
3999 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
4000 asn_DEF_Utf8_1_tags_1, /* Same as above */
4001 sizeof(asn_DEF_Utf8_1_tags_1)
4002 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004003 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004004 0, /* No PER visible constraints */
4005 0, 0, /* No members */
4006 0 /* No specifics */
4007};
4008
4009
4010/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
4011
Lev Walkin22b5ed42006-09-13 02:51:20 +00004012#include "Identifier.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004013
4014/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
4015
4016typedef Identifier_t VisibleIdentifier_t;
4017
4018/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
4019
4020extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
4021asn_struct_free_f VisibleIdentifier_free;
4022asn_struct_print_f VisibleIdentifier_print;
4023asn_constr_check_f VisibleIdentifier_constraint;
4024ber_type_decoder_f VisibleIdentifier_decode_ber;
4025der_type_encoder_f VisibleIdentifier_encode_der;
4026xer_type_decoder_f VisibleIdentifier_decode_xer;
4027xer_type_encoder_f VisibleIdentifier_encode_xer;
4028per_type_decoder_f VisibleIdentifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004029per_type_encoder_f VisibleIdentifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004030
4031/*** <<< CTABLES [VisibleIdentifier] >>> ***/
4032
Lev Walkina7591b52014-10-12 18:37:35 -07004033static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00004034 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4035 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4036 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
4037 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
4038 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
403927,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
4040 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
404154,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00004042};
Lev Walkina7591b52014-10-12 18:37:35 -07004043static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000404436,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
404570,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
404686,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
4047107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
4048};
4049
Lev Walkin59b176e2005-11-26 11:25:14 +00004050
4051static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07004052 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00004053 /* The underlying type is VisibleString */
4054 const VisibleString_t *st = (const VisibleString_t *)sptr;
4055 const uint8_t *ch = st->buf;
4056 const uint8_t *end = ch + st->size;
4057
4058 for(; ch < end; ch++) {
4059 uint8_t cv = *ch;
4060 if(!table[cv]) return -1;
4061 }
4062 return 0;
4063}
4064
4065
4066/*** <<< CODE [VisibleIdentifier] >>> ***/
4067
4068int
4069VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004070 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004071 const Identifier_t *st = (const Identifier_t *)sptr;
4072 size_t size;
4073
4074 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004075 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004076 "%s: value not given (%s:%d)",
4077 td->name, __FILE__, __LINE__);
4078 return -1;
4079 }
4080
4081 size = st->size;
4082
4083 if((size >= 1 && size <= 32)
4084 && !check_permitted_alphabet_1(st)) {
4085 /* Constraint check succeeded */
4086 return 0;
4087 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004088 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004089 "%s: constraint failed (%s:%d)",
4090 td->name, __FILE__, __LINE__);
4091 return -1;
4092 }
4093}
4094
4095/*
4096 * This type is implemented using Identifier,
4097 * so here we adjust the DEF accordingly.
4098 */
4099static void
4100VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4101 td->free_struct = asn_DEF_Identifier.free_struct;
4102 td->print_struct = asn_DEF_Identifier.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004103 td->check_constraints = asn_DEF_Identifier.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004104 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
4105 td->der_encoder = asn_DEF_Identifier.der_encoder;
4106 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
4107 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
4108 td->uper_decoder = asn_DEF_Identifier.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004109 td->uper_encoder = asn_DEF_Identifier.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004110 td->oer_decoder = asn_DEF_Identifier.oer_decoder;
4111 td->oer_encoder = asn_DEF_Identifier.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04004112 if(!td->oer_constraints)
4113 td->oer_constraints = asn_DEF_Identifier.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004114 if(!td->per_constraints)
4115 td->per_constraints = asn_DEF_Identifier.per_constraints;
4116 td->elements = asn_DEF_Identifier.elements;
4117 td->elements_count = asn_DEF_Identifier.elements_count;
4118 td->specifics = asn_DEF_Identifier.specifics;
4119}
4120
4121void
4122VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
4123 void *struct_ptr, int contents_only) {
4124 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4125 td->free_struct(td, struct_ptr, contents_only);
4126}
4127
4128int
4129VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4130 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4131 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4132 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4133}
4134
4135asn_dec_rval_t
4136VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4137 void **structure, const void *bufptr, size_t size, int tag_mode) {
4138 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4139 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4140}
4141
4142asn_enc_rval_t
4143VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
4144 void *structure, int tag_mode, ber_tlv_tag_t tag,
4145 asn_app_consume_bytes_f *cb, void *app_key) {
4146 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4147 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4148}
4149
4150asn_dec_rval_t
4151VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4152 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4153 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4154 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4155}
4156
4157asn_enc_rval_t
4158VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4159 int ilevel, enum xer_encoder_flags_e flags,
4160 asn_app_consume_bytes_f *cb, void *app_key) {
4161 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4162 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4163}
4164
4165asn_dec_rval_t
4166VisibleIdentifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4167 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4168 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4169 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4170}
4171
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004172asn_enc_rval_t
4173VisibleIdentifier_encode_uper(asn_TYPE_descriptor_t *td,
4174 asn_per_constraints_t *constraints,
4175 void *structure, asn_per_outp_t *per_out) {
4176 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4177 return td->uper_encoder(td, constraints, structure, per_out);
4178}
4179
Lev Walkin59b176e2005-11-26 11:25:14 +00004180
4181/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
4182
Lev Walkina7591b52014-10-12 18:37:35 -07004183static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004184 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
4185};
4186asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
4187 "VisibleIdentifier",
4188 "VisibleIdentifier",
4189 VisibleIdentifier_free,
4190 VisibleIdentifier_print,
4191 VisibleIdentifier_constraint,
4192 VisibleIdentifier_decode_ber,
4193 VisibleIdentifier_encode_der,
4194 VisibleIdentifier_decode_xer,
4195 VisibleIdentifier_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04004196 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004197 VisibleIdentifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004198 VisibleIdentifier_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004199 0, /* Use generic outmost tag fetcher */
4200 asn_DEF_VisibleIdentifier_tags_1,
4201 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4202 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
4203 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
4204 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4205 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004206 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004207 0, /* No PER visible constraints */
4208 0, 0, /* No members */
4209 0 /* No specifics */
4210};
4211
4212
4213/*** <<< INCLUDES [Sequence] >>> ***/
4214
Lev Walkin22b5ed42006-09-13 02:51:20 +00004215#include "Int1.h"
4216#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004217#include <BOOLEAN.h>
Lev Walkin2a744a72013-03-27 01:56:23 -07004218#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00004219#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00004220#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004221#include <constr_SEQUENCE.h>
4222
4223/*** <<< DEPS [Sequence] >>> ***/
4224
4225typedef enum enum_c {
4226 enum_c_one = 1,
4227 enum_c_two = 2,
4228 /*
4229 * Enumeration is extensible
4230 */
4231 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00004232} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00004233
4234/*** <<< TYPE-DECLS [Sequence] >>> ***/
4235
4236typedef struct Sequence {
4237 Int1_t *int1_c /* DEFAULT 3 */;
4238 Int4_t int4;
4239 Int4_t int4_c;
Lev Walkin2a744a72013-03-27 01:56:23 -07004240 BOOLEAN_t *Bool /* DEFAULT 1 */;
4241 long enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00004242 NULL_t *null /* OPTIONAL */;
4243 /*
4244 * This type is extensible,
4245 * possible extensions are below.
4246 */
4247 Int5_t *int5_c /* OPTIONAL */;
4248
4249 /* Context for parsing across buffer boundaries */
4250 asn_struct_ctx_t _asn_ctx;
4251} Sequence_t;
4252
4253/*** <<< FUNC-DECLS [Sequence] >>> ***/
4254
4255/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
4256extern asn_TYPE_descriptor_t asn_DEF_Sequence;
4257
4258/*** <<< CODE [Sequence] >>> ***/
4259
4260static int
4261enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004262 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004263 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -07004264 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004265 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004266}
4267
4268/*
Lev Walkin2a744a72013-03-27 01:56:23 -07004269 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00004270 * so here we adjust the DEF accordingly.
4271 */
4272static void
4273enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -07004274 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4275 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004276 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -07004277 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4278 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4279 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4280 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4281 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
4282 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004283 td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder;
4284 td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04004285 if(!td->oer_constraints)
4286 td->oer_constraints = asn_DEF_NativeEnumerated.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004287 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -07004288 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4289 td->elements = asn_DEF_NativeEnumerated.elements;
4290 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4291 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
Lev Walkin59b176e2005-11-26 11:25:14 +00004292}
4293
4294static void
4295enum_c_6_free(asn_TYPE_descriptor_t *td,
4296 void *struct_ptr, int contents_only) {
4297 enum_c_6_inherit_TYPE_descriptor(td);
4298 td->free_struct(td, struct_ptr, contents_only);
4299}
4300
4301static int
4302enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4303 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4304 enum_c_6_inherit_TYPE_descriptor(td);
4305 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4306}
4307
4308static asn_dec_rval_t
4309enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4310 void **structure, const void *bufptr, size_t size, int tag_mode) {
4311 enum_c_6_inherit_TYPE_descriptor(td);
4312 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4313}
4314
4315static asn_enc_rval_t
4316enum_c_6_encode_der(asn_TYPE_descriptor_t *td,
4317 void *structure, int tag_mode, ber_tlv_tag_t tag,
4318 asn_app_consume_bytes_f *cb, void *app_key) {
4319 enum_c_6_inherit_TYPE_descriptor(td);
4320 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4321}
4322
4323static asn_dec_rval_t
4324enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4325 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4326 enum_c_6_inherit_TYPE_descriptor(td);
4327 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4328}
4329
4330static asn_enc_rval_t
4331enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4332 int ilevel, enum xer_encoder_flags_e flags,
4333 asn_app_consume_bytes_f *cb, void *app_key) {
4334 enum_c_6_inherit_TYPE_descriptor(td);
4335 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4336}
4337
4338static asn_dec_rval_t
4339enum_c_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4340 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4341 enum_c_6_inherit_TYPE_descriptor(td);
4342 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4343}
4344
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004345static asn_enc_rval_t
4346enum_c_6_encode_uper(asn_TYPE_descriptor_t *td,
4347 asn_per_constraints_t *constraints,
4348 void *structure, asn_per_outp_t *per_out) {
4349 enum_c_6_inherit_TYPE_descriptor(td);
4350 return td->uper_encoder(td, constraints, structure, per_out);
4351}
4352
Lev Walkin59b176e2005-11-26 11:25:14 +00004353static int
4354memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004355 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004356 long value;
4357
4358 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004359 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004360 "%s: value not given (%s:%d)",
4361 td->name, __FILE__, __LINE__);
4362 return -1;
4363 }
4364
Lev Walkin2a744a72013-03-27 01:56:23 -07004365 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004366
4367 if((value >= -2)) {
4368 /* Constraint check succeeded */
4369 return 0;
4370 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004371 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004372 "%s: constraint failed (%s:%d)",
4373 td->name, __FILE__, __LINE__);
4374 return -1;
4375 }
4376}
4377
4378static int
4379memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004380 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004381 long value;
4382
4383 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004384 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004385 "%s: value not given (%s:%d)",
4386 td->name, __FILE__, __LINE__);
4387 return -1;
4388 }
4389
Lev Walkin2a744a72013-03-27 01:56:23 -07004390 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004391
4392 if((value >= 5 && value <= 7)) {
4393 /* Constraint check succeeded */
4394 return 0;
4395 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004396 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004397 "%s: constraint failed (%s:%d)",
4398 td->name, __FILE__, __LINE__);
4399 return -1;
4400 }
4401}
4402
4403static int
4404memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004405 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004406 long value;
4407
4408 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004409 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004410 "%s: value not given (%s:%d)",
4411 td->name, __FILE__, __LINE__);
4412 return -1;
4413 }
4414
Lev Walkin2a744a72013-03-27 01:56:23 -07004415 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004416
4417 if((value == 5)) {
4418 /* Constraint check succeeded */
4419 return 0;
4420 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004421 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004422 "%s: constraint failed (%s:%d)",
4423 td->name, __FILE__, __LINE__);
4424 return -1;
4425 }
4426}
4427
4428
Lev Walkin725883b2006-10-09 12:07:58 +00004429/*** <<< CTDEFS [Sequence] >>> ***/
4430
Lev Walkin2fce55d2013-03-28 05:00:39 -07004431static asn_per_constraints_t asn_PER_type_enum_c_constr_6 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004432 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
4433 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4434 0, 0 /* No PER value map */
4435};
Lev Walkin2fce55d2013-03-28 05:00:39 -07004436static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004437 { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
4438 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4439 0, 0 /* No PER value map */
4440};
Lev Walkin2fce55d2013-03-28 05:00:39 -07004441static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004442 { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
4443 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4444 0, 0 /* No PER value map */
4445};
Lev Walkin2fce55d2013-03-28 05:00:39 -07004446static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004447 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
4448 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4449 0, 0 /* No PER value map */
4450};
4451
Lev Walkin59b176e2005-11-26 11:25:14 +00004452/*** <<< STAT-DEFS [Sequence] >>> ***/
4453
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004454static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004455 Int1_t *st = *sptr;
4456
4457 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004458 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004459 st = (*sptr = CALLOC(1, sizeof(*st)));
4460 if(!st) return -1;
4461 }
4462
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004463 if(set_value) {
4464 /* Install default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07004465 *st = 3;
4466 return 0;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004467 } else {
4468 /* Test default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07004469 return (*st == 3);
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004470 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004471}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004472static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004473 BOOLEAN_t *st = *sptr;
4474
4475 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004476 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004477 st = (*sptr = CALLOC(1, sizeof(*st)));
4478 if(!st) return -1;
4479 }
4480
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004481 if(set_value) {
4482 /* Install default value 1 */
4483 *st = 1;
4484 return 0;
4485 } else {
4486 /* Test default value 1 */
4487 return (*st == 1);
4488 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004489}
Lev Walkina7591b52014-10-12 18:37:35 -07004490static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004491 { 1, 3, "one" },
4492 { 2, 3, "two" },
4493 { 3, 5, "three" }
4494 /* This list is extensible */
4495};
Lev Walkina7591b52014-10-12 18:37:35 -07004496static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004497 0, /* one(1) */
4498 2, /* three(3) */
4499 1 /* two(2) */
4500 /* This list is extensible */
4501};
johvike70c4072017-05-09 11:06:12 +02004502static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004503 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
4504 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
4505 3, /* Number of elements in the maps */
4506 3, /* Extensions before this member */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004507 1, /* Strict enumeration */
4508 0, /* Native long size */
4509 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004510};
Lev Walkina7591b52014-10-12 18:37:35 -07004511static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004512 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4513};
Lev Walkin59b176e2005-11-26 11:25:14 +00004514static /* Use -fall-defs-global to expose */
4515asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
4516 "enum-c",
4517 "enum-c",
4518 enum_c_6_free,
4519 enum_c_6_print,
4520 enum_c_6_constraint,
4521 enum_c_6_decode_ber,
4522 enum_c_6_encode_der,
4523 enum_c_6_decode_xer,
4524 enum_c_6_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04004525 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004526 enum_c_6_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004527 enum_c_6_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004528 0, /* Use generic outmost tag fetcher */
4529 asn_DEF_enum_c_tags_6,
4530 sizeof(asn_DEF_enum_c_tags_6)
4531 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
4532 asn_DEF_enum_c_tags_6, /* Same as above */
4533 sizeof(asn_DEF_enum_c_tags_6)
4534 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004535 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004536 &asn_PER_type_enum_c_constr_6,
Lev Walkin59b176e2005-11-26 11:25:14 +00004537 0, 0, /* Defined elsewhere */
4538 &asn_SPC_enum_c_specs_6 /* Additional specs */
4539};
4540
Lev Walkin59b176e2005-11-26 11:25:14 +00004541static asn_TYPE_member_t asn_MBR_Sequence_1[] = {
4542 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
4543 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4544 .tag_mode = 0,
4545 .type = &asn_DEF_Int1,
4546 .memb_constraints = memb_int1_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04004547 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004548 .per_constraints = &asn_PER_memb_int1_c_constr_2,
Lev Walkin59b176e2005-11-26 11:25:14 +00004549 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
4550 .name = "int1-c"
4551 },
4552 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
4553 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
4554 .tag_mode = +1, /* EXPLICIT tag at current level */
4555 .type = &asn_DEF_Int4,
4556 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04004557 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00004558 .per_constraints = 0, /* No PER visible constraints */
4559 .default_value = 0,
4560 .name = "int4"
4561 },
4562 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
4563 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4564 .tag_mode = 0,
4565 .type = &asn_DEF_Int4,
4566 .memb_constraints = memb_int4_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04004567 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004568 .per_constraints = &asn_PER_memb_int4_c_constr_4,
Lev Walkin59b176e2005-11-26 11:25:14 +00004569 .default_value = 0,
4570 .name = "int4-c"
4571 },
Lev Walkin2a744a72013-03-27 01:56:23 -07004572 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +00004573 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
4574 .tag_mode = 0,
4575 .type = &asn_DEF_BOOLEAN,
4576 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04004577 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00004578 .per_constraints = 0, /* No PER visible constraints */
4579 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
4580 .name = "bool"
4581 },
4582 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
4583 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
4584 .tag_mode = 0,
4585 .type = &asn_DEF_enum_c_6,
4586 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04004587 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin07aaa342006-10-09 12:52:15 +00004588 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004589 .default_value = 0,
4590 .name = "enum-c"
4591 },
4592 { ATF_POINTER, 2, offsetof(struct Sequence, null),
4593 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
4594 .tag_mode = 0,
4595 .type = &asn_DEF_NULL,
4596 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04004597 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00004598 .per_constraints = 0, /* No PER visible constraints */
4599 .default_value = 0,
4600 .name = "null"
4601 },
4602 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
4603 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4604 .tag_mode = 0,
4605 .type = &asn_DEF_Int5,
4606 .memb_constraints = memb_int5_c_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +04004607 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004608 .per_constraints = &asn_PER_memb_int5_c_constr_13,
Lev Walkin59b176e2005-11-26 11:25:14 +00004609 .default_value = 0,
4610 .name = "int5-c"
4611 },
4612};
Lev Walkina7591b52014-10-12 18:37:35 -07004613static const int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
4614static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004615 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4616};
Lev Walkina7591b52014-10-12 18:37:35 -07004617static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -07004618 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
4619 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
4620 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
4621 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
4622 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
4623 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
4624 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
Lev Walkin59b176e2005-11-26 11:25:14 +00004625};
4626static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
4627 sizeof(struct Sequence),
4628 offsetof(struct Sequence, _asn_ctx),
4629 asn_MAP_Sequence_tag2el_1,
4630 7, /* Count of tags in the map */
4631 asn_MAP_Sequence_oms_1, /* Optional members */
4632 3, 1, /* Root/Additions */
4633 5, /* Start extensions */
4634 8 /* Stop extensions */
4635};
4636asn_TYPE_descriptor_t asn_DEF_Sequence = {
4637 "Sequence",
4638 "Sequence",
4639 SEQUENCE_free,
4640 SEQUENCE_print,
4641 SEQUENCE_constraint,
4642 SEQUENCE_decode_ber,
4643 SEQUENCE_encode_der,
4644 SEQUENCE_decode_xer,
4645 SEQUENCE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04004646 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004647 SEQUENCE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004648 SEQUENCE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004649 0, /* Use generic outmost tag fetcher */
4650 asn_DEF_Sequence_tags_1,
4651 sizeof(asn_DEF_Sequence_tags_1)
4652 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4653 asn_DEF_Sequence_tags_1, /* Same as above */
4654 sizeof(asn_DEF_Sequence_tags_1)
4655 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004656 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004657 0, /* No PER visible constraints */
4658 asn_MBR_Sequence_1,
4659 7, /* Elements count */
4660 &asn_SPC_Sequence_specs_1 /* Additional specs */
4661};
4662
4663
4664/*** <<< INCLUDES [SequenceOf] >>> ***/
4665
4666#include <asn_SEQUENCE_OF.h>
4667#include <constr_SEQUENCE_OF.h>
4668
4669/*** <<< FWD-DECLS [SequenceOf] >>> ***/
4670
4671struct Sequence;
4672
4673/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
4674
4675typedef struct SequenceOf {
4676 A_SEQUENCE_OF(struct Sequence) list;
4677
4678 /* Context for parsing across buffer boundaries */
4679 asn_struct_ctx_t _asn_ctx;
4680} SequenceOf_t;
4681
4682/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
4683
4684extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
4685
4686/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
4687
Lev Walkin22b5ed42006-09-13 02:51:20 +00004688#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004689
Lev Walkin725883b2006-10-09 12:07:58 +00004690/*** <<< CTDEFS [SequenceOf] >>> ***/
4691
Lev Walkin2fce55d2013-03-28 05:00:39 -07004692static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004693 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4694 { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */,
4695 0, 0 /* No PER value map */
4696};
4697
Lev Walkin59b176e2005-11-26 11:25:14 +00004698/*** <<< STAT-DEFS [SequenceOf] >>> ***/
4699
4700static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
4701 { ATF_POINTER, 0, 0,
4702 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
4703 .tag_mode = 0,
4704 .type = &asn_DEF_Sequence,
4705 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +04004706 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +00004707 .per_constraints = 0, /* No PER visible constraints */
4708 .default_value = 0,
4709 .name = ""
4710 },
4711};
Lev Walkina7591b52014-10-12 18:37:35 -07004712static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004713 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4714};
4715static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
4716 sizeof(struct SequenceOf),
4717 offsetof(struct SequenceOf, _asn_ctx),
4718 0, /* XER encoding is XMLDelimitedItemList */
4719};
Lev Walkin59b176e2005-11-26 11:25:14 +00004720asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
4721 "SequenceOf",
4722 "SequenceOf",
4723 SEQUENCE_OF_free,
4724 SEQUENCE_OF_print,
4725 SEQUENCE_OF_constraint,
4726 SEQUENCE_OF_decode_ber,
4727 SEQUENCE_OF_encode_der,
4728 SEQUENCE_OF_decode_xer,
4729 SEQUENCE_OF_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04004730 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004731 SEQUENCE_OF_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004732 SEQUENCE_OF_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004733 0, /* Use generic outmost tag fetcher */
4734 asn_DEF_SequenceOf_tags_1,
4735 sizeof(asn_DEF_SequenceOf_tags_1)
4736 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4737 asn_DEF_SequenceOf_tags_1, /* Same as above */
4738 sizeof(asn_DEF_SequenceOf_tags_1)
4739 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004740 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004741 &asn_PER_type_SequenceOf_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004742 asn_MBR_SequenceOf_1,
4743 1, /* Single element */
4744 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
4745};
4746
4747
4748/*** <<< INCLUDES [Enum0] >>> ***/
4749
Lev Walkin2a744a72013-03-27 01:56:23 -07004750#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00004751
4752/*** <<< DEPS [Enum0] >>> ***/
4753
4754typedef enum Enum0 {
4755 Enum0_one = 0,
4756 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004757} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00004758
4759/*** <<< TYPE-DECLS [Enum0] >>> ***/
4760
Lev Walkin2a744a72013-03-27 01:56:23 -07004761typedef long Enum0_t;
Lev Walkin59b176e2005-11-26 11:25:14 +00004762
4763/*** <<< FUNC-DECLS [Enum0] >>> ***/
4764
4765extern asn_TYPE_descriptor_t asn_DEF_Enum0;
4766asn_struct_free_f Enum0_free;
4767asn_struct_print_f Enum0_print;
4768asn_constr_check_f Enum0_constraint;
4769ber_type_decoder_f Enum0_decode_ber;
4770der_type_encoder_f Enum0_encode_der;
4771xer_type_decoder_f Enum0_decode_xer;
4772xer_type_encoder_f Enum0_encode_xer;
4773per_type_decoder_f Enum0_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004774per_type_encoder_f Enum0_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004775
4776/*** <<< CODE [Enum0] >>> ***/
4777
4778int
4779Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004780 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004781 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -07004782 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004783 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004784}
4785
4786/*
Lev Walkin2a744a72013-03-27 01:56:23 -07004787 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00004788 * so here we adjust the DEF accordingly.
4789 */
4790static void
4791Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -07004792 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4793 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004794 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -07004795 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4796 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4797 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4798 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4799 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
4800 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004801 td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder;
4802 td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04004803 if(!td->oer_constraints)
4804 td->oer_constraints = asn_DEF_NativeEnumerated.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004805 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -07004806 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4807 td->elements = asn_DEF_NativeEnumerated.elements;
4808 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4809 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
Lev Walkin59b176e2005-11-26 11:25:14 +00004810}
4811
4812void
4813Enum0_free(asn_TYPE_descriptor_t *td,
4814 void *struct_ptr, int contents_only) {
4815 Enum0_1_inherit_TYPE_descriptor(td);
4816 td->free_struct(td, struct_ptr, contents_only);
4817}
4818
4819int
4820Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4821 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4822 Enum0_1_inherit_TYPE_descriptor(td);
4823 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4824}
4825
4826asn_dec_rval_t
4827Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4828 void **structure, const void *bufptr, size_t size, int tag_mode) {
4829 Enum0_1_inherit_TYPE_descriptor(td);
4830 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4831}
4832
4833asn_enc_rval_t
4834Enum0_encode_der(asn_TYPE_descriptor_t *td,
4835 void *structure, int tag_mode, ber_tlv_tag_t tag,
4836 asn_app_consume_bytes_f *cb, void *app_key) {
4837 Enum0_1_inherit_TYPE_descriptor(td);
4838 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4839}
4840
4841asn_dec_rval_t
4842Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4843 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4844 Enum0_1_inherit_TYPE_descriptor(td);
4845 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4846}
4847
4848asn_enc_rval_t
4849Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4850 int ilevel, enum xer_encoder_flags_e flags,
4851 asn_app_consume_bytes_f *cb, void *app_key) {
4852 Enum0_1_inherit_TYPE_descriptor(td);
4853 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4854}
4855
4856asn_dec_rval_t
4857Enum0_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4858 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4859 Enum0_1_inherit_TYPE_descriptor(td);
4860 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4861}
4862
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004863asn_enc_rval_t
4864Enum0_encode_uper(asn_TYPE_descriptor_t *td,
4865 asn_per_constraints_t *constraints,
4866 void *structure, asn_per_outp_t *per_out) {
4867 Enum0_1_inherit_TYPE_descriptor(td);
4868 return td->uper_encoder(td, constraints, structure, per_out);
4869}
4870
Lev Walkin59b176e2005-11-26 11:25:14 +00004871
Lev Walkin725883b2006-10-09 12:07:58 +00004872/*** <<< CTDEFS [Enum0] >>> ***/
4873
Lev Walkin2fce55d2013-03-28 05:00:39 -07004874static asn_per_constraints_t asn_PER_type_Enum0_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004875 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4876 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4877 0, 0 /* No PER value map */
4878};
4879
Lev Walkin59b176e2005-11-26 11:25:14 +00004880/*** <<< STAT-DEFS [Enum0] >>> ***/
4881
Lev Walkina7591b52014-10-12 18:37:35 -07004882static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004883 { 0, 3, "one" },
4884 { 1, 3, "two" }
4885};
Lev Walkina7591b52014-10-12 18:37:35 -07004886static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004887 0, /* one(0) */
4888 1 /* two(1) */
4889};
johvike70c4072017-05-09 11:06:12 +02004890static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004891 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
4892 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
4893 2, /* Number of elements in the maps */
4894 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004895 1, /* Strict enumeration */
4896 0, /* Native long size */
4897 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004898};
Lev Walkina7591b52014-10-12 18:37:35 -07004899static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004900 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4901};
Lev Walkin59b176e2005-11-26 11:25:14 +00004902asn_TYPE_descriptor_t asn_DEF_Enum0 = {
4903 "Enum0",
4904 "Enum0",
4905 Enum0_free,
4906 Enum0_print,
4907 Enum0_constraint,
4908 Enum0_decode_ber,
4909 Enum0_encode_der,
4910 Enum0_decode_xer,
4911 Enum0_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04004912 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004913 Enum0_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004914 Enum0_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004915 0, /* Use generic outmost tag fetcher */
4916 asn_DEF_Enum0_tags_1,
4917 sizeof(asn_DEF_Enum0_tags_1)
4918 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4919 asn_DEF_Enum0_tags_1, /* Same as above */
4920 sizeof(asn_DEF_Enum0_tags_1)
4921 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04004922 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004923 &asn_PER_type_Enum0_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004924 0, 0, /* Defined elsewhere */
4925 &asn_SPC_Enum0_specs_1 /* Additional specs */
4926};
4927
4928
4929/*** <<< INCLUDES [Enum1] >>> ***/
4930
4931#include <NativeEnumerated.h>
4932
4933/*** <<< DEPS [Enum1] >>> ***/
4934
4935typedef enum Enum1 {
4936 Enum1_one = 0,
4937 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004938} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00004939
4940/*** <<< TYPE-DECLS [Enum1] >>> ***/
4941
4942typedef long Enum1_t;
4943
4944/*** <<< FUNC-DECLS [Enum1] >>> ***/
4945
4946extern asn_TYPE_descriptor_t asn_DEF_Enum1;
4947asn_struct_free_f Enum1_free;
4948asn_struct_print_f Enum1_print;
4949asn_constr_check_f Enum1_constraint;
4950ber_type_decoder_f Enum1_decode_ber;
4951der_type_encoder_f Enum1_encode_der;
4952xer_type_decoder_f Enum1_decode_xer;
4953xer_type_encoder_f Enum1_encode_xer;
4954per_type_decoder_f Enum1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004955per_type_encoder_f Enum1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004956
4957/*** <<< CODE [Enum1] >>> ***/
4958
4959int
4960Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004961 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004962 long value;
4963
4964 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004965 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004966 "%s: value not given (%s:%d)",
4967 td->name, __FILE__, __LINE__);
4968 return -1;
4969 }
4970
4971 value = *(const long *)sptr;
4972
4973 if((value == 0)) {
4974 /* Constraint check succeeded */
4975 return 0;
4976 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004977 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004978 "%s: constraint failed (%s:%d)",
4979 td->name, __FILE__, __LINE__);
4980 return -1;
4981 }
4982}
4983
4984/*
4985 * This type is implemented using NativeEnumerated,
4986 * so here we adjust the DEF accordingly.
4987 */
4988static void
4989Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4990 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4991 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004992 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004993 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4994 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4995 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4996 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4997 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004998 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004999 td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder;
5000 td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04005001 if(!td->oer_constraints)
5002 td->oer_constraints = asn_DEF_NativeEnumerated.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00005003 if(!td->per_constraints)
5004 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
5005 td->elements = asn_DEF_NativeEnumerated.elements;
5006 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
5007 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
5008}
5009
5010void
5011Enum1_free(asn_TYPE_descriptor_t *td,
5012 void *struct_ptr, int contents_only) {
5013 Enum1_1_inherit_TYPE_descriptor(td);
5014 td->free_struct(td, struct_ptr, contents_only);
5015}
5016
5017int
5018Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
5019 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
5020 Enum1_1_inherit_TYPE_descriptor(td);
5021 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
5022}
5023
5024asn_dec_rval_t
5025Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5026 void **structure, const void *bufptr, size_t size, int tag_mode) {
5027 Enum1_1_inherit_TYPE_descriptor(td);
5028 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
5029}
5030
5031asn_enc_rval_t
5032Enum1_encode_der(asn_TYPE_descriptor_t *td,
5033 void *structure, int tag_mode, ber_tlv_tag_t tag,
5034 asn_app_consume_bytes_f *cb, void *app_key) {
5035 Enum1_1_inherit_TYPE_descriptor(td);
5036 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
5037}
5038
5039asn_dec_rval_t
5040Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5041 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
5042 Enum1_1_inherit_TYPE_descriptor(td);
5043 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
5044}
5045
5046asn_enc_rval_t
5047Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
5048 int ilevel, enum xer_encoder_flags_e flags,
5049 asn_app_consume_bytes_f *cb, void *app_key) {
5050 Enum1_1_inherit_TYPE_descriptor(td);
5051 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
5052}
5053
5054asn_dec_rval_t
5055Enum1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5056 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
5057 Enum1_1_inherit_TYPE_descriptor(td);
5058 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
5059}
5060
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005061asn_enc_rval_t
5062Enum1_encode_uper(asn_TYPE_descriptor_t *td,
5063 asn_per_constraints_t *constraints,
5064 void *structure, asn_per_outp_t *per_out) {
5065 Enum1_1_inherit_TYPE_descriptor(td);
5066 return td->uper_encoder(td, constraints, structure, per_out);
5067}
5068
Lev Walkin59b176e2005-11-26 11:25:14 +00005069
Lev Walkin725883b2006-10-09 12:07:58 +00005070/*** <<< CTDEFS [Enum1] >>> ***/
5071
Lev Walkin2fce55d2013-03-28 05:00:39 -07005072static asn_per_constraints_t asn_PER_type_Enum1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00005073 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
5074 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
5075 0, 0 /* No PER value map */
5076};
5077
Lev Walkin59b176e2005-11-26 11:25:14 +00005078/*** <<< STAT-DEFS [Enum1] >>> ***/
5079
Lev Walkina7591b52014-10-12 18:37:35 -07005080static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00005081 { 0, 3, "one" },
5082 { 1, 3, "two" }
5083};
Lev Walkina7591b52014-10-12 18:37:35 -07005084static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00005085 0, /* one(0) */
5086 1 /* two(1) */
5087};
johvike70c4072017-05-09 11:06:12 +02005088static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00005089 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
5090 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
5091 2, /* Number of elements in the maps */
5092 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00005093 1, /* Strict enumeration */
5094 0, /* Native long size */
5095 0
Lev Walkin59b176e2005-11-26 11:25:14 +00005096};
Lev Walkina7591b52014-10-12 18:37:35 -07005097static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00005098 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
5099};
Lev Walkin59b176e2005-11-26 11:25:14 +00005100asn_TYPE_descriptor_t asn_DEF_Enum1 = {
5101 "Enum1",
5102 "Enum1",
5103 Enum1_free,
5104 Enum1_print,
5105 Enum1_constraint,
5106 Enum1_decode_ber,
5107 Enum1_encode_der,
5108 Enum1_decode_xer,
5109 Enum1_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04005110 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00005111 Enum1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005112 Enum1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00005113 0, /* Use generic outmost tag fetcher */
5114 asn_DEF_Enum1_tags_1,
5115 sizeof(asn_DEF_Enum1_tags_1)
5116 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
5117 asn_DEF_Enum1_tags_1, /* Same as above */
5118 sizeof(asn_DEF_Enum1_tags_1)
5119 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04005120 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00005121 &asn_PER_type_Enum1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00005122 0, 0, /* Defined elsewhere */
5123 &asn_SPC_Enum1_specs_1 /* Additional specs */
5124};
5125
5126
5127/*** <<< INCLUDES [Identifier] >>> ***/
5128
5129#include <VisibleString.h>
5130
5131/*** <<< TYPE-DECLS [Identifier] >>> ***/
5132
5133typedef VisibleString_t Identifier_t;
5134
5135/*** <<< FUNC-DECLS [Identifier] >>> ***/
5136
5137extern asn_TYPE_descriptor_t asn_DEF_Identifier;
5138asn_struct_free_f Identifier_free;
5139asn_struct_print_f Identifier_print;
5140asn_constr_check_f Identifier_constraint;
5141ber_type_decoder_f Identifier_decode_ber;
5142der_type_encoder_f Identifier_encode_der;
5143xer_type_decoder_f Identifier_decode_xer;
5144xer_type_encoder_f Identifier_encode_xer;
5145per_type_decoder_f Identifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005146per_type_encoder_f Identifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00005147
5148/*** <<< CTABLES [Identifier] >>> ***/
5149
Lev Walkina7591b52014-10-12 18:37:35 -07005150static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00005151 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
5152 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
5153 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
5154 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
5155 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
515627,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
5157 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
515854,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00005159};
Lev Walkina7591b52014-10-12 18:37:35 -07005160static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000516136,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
516270,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
516386,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
5164107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
5165};
5166
Lev Walkin59b176e2005-11-26 11:25:14 +00005167
5168static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07005169 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00005170 /* The underlying type is VisibleString */
5171 const VisibleString_t *st = (const VisibleString_t *)sptr;
5172 const uint8_t *ch = st->buf;
5173 const uint8_t *end = ch + st->size;
5174
5175 for(; ch < end; ch++) {
5176 uint8_t cv = *ch;
5177 if(!table[cv]) return -1;
5178 }
5179 return 0;
5180}
5181
5182
5183/*** <<< CODE [Identifier] >>> ***/
5184
5185int
5186Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00005187 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00005188 const VisibleString_t *st = (const VisibleString_t *)sptr;
5189 size_t size;
5190
5191 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07005192 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00005193 "%s: value not given (%s:%d)",
5194 td->name, __FILE__, __LINE__);
5195 return -1;
5196 }
5197
5198 size = st->size;
5199
5200 if((size >= 1 && size <= 32)
5201 && !check_permitted_alphabet_1(st)) {
5202 /* Constraint check succeeded */
5203 return 0;
5204 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07005205 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00005206 "%s: constraint failed (%s:%d)",
5207 td->name, __FILE__, __LINE__);
5208 return -1;
5209 }
5210}
5211
Lev Walkin725883b2006-10-09 12:07:58 +00005212static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) {
5213 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
5214 return -1;
5215 return permitted_alphabet_table_1[value] - 1;
5216}
5217static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) {
5218 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
5219 return -1;
5220 return permitted_alphabet_code2value_1[code];
5221}
Lev Walkin59b176e2005-11-26 11:25:14 +00005222/*
5223 * This type is implemented using VisibleString,
5224 * so here we adjust the DEF accordingly.
5225 */
5226static void
5227Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
5228 td->free_struct = asn_DEF_VisibleString.free_struct;
5229 td->print_struct = asn_DEF_VisibleString.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08005230 td->check_constraints = asn_DEF_VisibleString.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00005231 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
5232 td->der_encoder = asn_DEF_VisibleString.der_encoder;
5233 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
5234 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
5235 td->uper_decoder = asn_DEF_VisibleString.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005236 td->uper_encoder = asn_DEF_VisibleString.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07005237 td->oer_decoder = asn_DEF_VisibleString.oer_decoder;
5238 td->oer_encoder = asn_DEF_VisibleString.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +04005239 if(!td->oer_constraints)
5240 td->oer_constraints = asn_DEF_VisibleString.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00005241 if(!td->per_constraints)
5242 td->per_constraints = asn_DEF_VisibleString.per_constraints;
5243 td->elements = asn_DEF_VisibleString.elements;
5244 td->elements_count = asn_DEF_VisibleString.elements_count;
5245 td->specifics = asn_DEF_VisibleString.specifics;
5246}
5247
5248void
5249Identifier_free(asn_TYPE_descriptor_t *td,
5250 void *struct_ptr, int contents_only) {
5251 Identifier_1_inherit_TYPE_descriptor(td);
5252 td->free_struct(td, struct_ptr, contents_only);
5253}
5254
5255int
5256Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
5257 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
5258 Identifier_1_inherit_TYPE_descriptor(td);
5259 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
5260}
5261
5262asn_dec_rval_t
5263Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5264 void **structure, const void *bufptr, size_t size, int tag_mode) {
5265 Identifier_1_inherit_TYPE_descriptor(td);
5266 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
5267}
5268
5269asn_enc_rval_t
5270Identifier_encode_der(asn_TYPE_descriptor_t *td,
5271 void *structure, int tag_mode, ber_tlv_tag_t tag,
5272 asn_app_consume_bytes_f *cb, void *app_key) {
5273 Identifier_1_inherit_TYPE_descriptor(td);
5274 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
5275}
5276
5277asn_dec_rval_t
5278Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5279 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
5280 Identifier_1_inherit_TYPE_descriptor(td);
5281 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
5282}
5283
5284asn_enc_rval_t
5285Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
5286 int ilevel, enum xer_encoder_flags_e flags,
5287 asn_app_consume_bytes_f *cb, void *app_key) {
5288 Identifier_1_inherit_TYPE_descriptor(td);
5289 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
5290}
5291
5292asn_dec_rval_t
5293Identifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5294 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
5295 Identifier_1_inherit_TYPE_descriptor(td);
5296 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
5297}
5298
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005299asn_enc_rval_t
5300Identifier_encode_uper(asn_TYPE_descriptor_t *td,
5301 asn_per_constraints_t *constraints,
5302 void *structure, asn_per_outp_t *per_out) {
5303 Identifier_1_inherit_TYPE_descriptor(td);
5304 return td->uper_encoder(td, constraints, structure, per_out);
5305}
5306
Lev Walkin59b176e2005-11-26 11:25:14 +00005307
Lev Walkin725883b2006-10-09 12:07:58 +00005308/*** <<< CTDEFS [Identifier] >>> ***/
5309
Lev Walkin2fce55d2013-03-28 05:00:39 -07005310static asn_per_constraints_t asn_PER_type_Identifier_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00005311 { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */,
5312 { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
5313 asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */
5314 asn_PER_MAP_Identifier_1_c2v /* PER code to value map */
5315};
5316
Lev Walkin59b176e2005-11-26 11:25:14 +00005317/*** <<< STAT-DEFS [Identifier] >>> ***/
5318
Lev Walkina7591b52014-10-12 18:37:35 -07005319static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00005320 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
5321};
Lev Walkin59b176e2005-11-26 11:25:14 +00005322asn_TYPE_descriptor_t asn_DEF_Identifier = {
5323 "Identifier",
5324 "Identifier",
5325 Identifier_free,
5326 Identifier_print,
5327 Identifier_constraint,
5328 Identifier_decode_ber,
5329 Identifier_encode_der,
5330 Identifier_decode_xer,
5331 Identifier_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +04005332 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00005333 Identifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005334 Identifier_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00005335 0, /* Use generic outmost tag fetcher */
5336 asn_DEF_Identifier_tags_1,
5337 sizeof(asn_DEF_Identifier_tags_1)
5338 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
5339 asn_DEF_Identifier_tags_1, /* Same as above */
5340 sizeof(asn_DEF_Identifier_tags_1)
5341 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +04005342 0, /* No OER visible constraints */
Lev Walkin4b5dae32006-10-09 12:27:44 +00005343 &asn_PER_type_Identifier_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00005344 0, 0, /* No members */
5345 0 /* No specifics */
5346};
5347