blob: 3ac7a514c58b7e7bafc1885cfe7e49417788f084 [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 Walkin59b176e2005-11-26 11:25:14 +000050 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -070051 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
52 td->elements = asn_DEF_NativeInteger.elements;
53 td->elements_count = asn_DEF_NativeInteger.elements_count;
54 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin59b176e2005-11-26 11:25:14 +000055}
56
57void
58Int1_free(asn_TYPE_descriptor_t *td,
59 void *struct_ptr, int contents_only) {
60 Int1_1_inherit_TYPE_descriptor(td);
61 td->free_struct(td, struct_ptr, contents_only);
62}
63
64int
65Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
66 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
67 Int1_1_inherit_TYPE_descriptor(td);
68 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
69}
70
71asn_dec_rval_t
72Int1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
73 void **structure, const void *bufptr, size_t size, int tag_mode) {
74 Int1_1_inherit_TYPE_descriptor(td);
75 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
76}
77
78asn_enc_rval_t
79Int1_encode_der(asn_TYPE_descriptor_t *td,
80 void *structure, int tag_mode, ber_tlv_tag_t tag,
81 asn_app_consume_bytes_f *cb, void *app_key) {
82 Int1_1_inherit_TYPE_descriptor(td);
83 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
84}
85
86asn_dec_rval_t
87Int1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
88 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
89 Int1_1_inherit_TYPE_descriptor(td);
90 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
91}
92
93asn_enc_rval_t
94Int1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
95 int ilevel, enum xer_encoder_flags_e flags,
96 asn_app_consume_bytes_f *cb, void *app_key) {
97 Int1_1_inherit_TYPE_descriptor(td);
98 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
99}
100
101asn_dec_rval_t
102Int1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
103 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
104 Int1_1_inherit_TYPE_descriptor(td);
105 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
106}
107
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000108asn_enc_rval_t
109Int1_encode_uper(asn_TYPE_descriptor_t *td,
110 asn_per_constraints_t *constraints,
111 void *structure, asn_per_outp_t *per_out) {
112 Int1_1_inherit_TYPE_descriptor(td);
113 return td->uper_encoder(td, constraints, structure, per_out);
114}
115
Lev Walkin59b176e2005-11-26 11:25:14 +0000116
117/*** <<< STAT-DEFS [Int1] >>> ***/
118
Lev Walkina7591b52014-10-12 18:37:35 -0700119static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000120 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
121};
122asn_TYPE_descriptor_t asn_DEF_Int1 = {
123 "Int1",
124 "Int1",
125 Int1_free,
126 Int1_print,
127 Int1_constraint,
128 Int1_decode_ber,
129 Int1_encode_der,
130 Int1_decode_xer,
131 Int1_encode_xer,
132 Int1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000133 Int1_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -0700134 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000135 0, /* Use generic outmost tag fetcher */
136 asn_DEF_Int1_tags_1,
137 sizeof(asn_DEF_Int1_tags_1)
138 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
139 asn_DEF_Int1_tags_1, /* Same as above */
140 sizeof(asn_DEF_Int1_tags_1)
141 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
142 0, /* No PER visible constraints */
143 0, 0, /* No members */
144 0 /* No specifics */
145};
146
147
148/*** <<< INCLUDES [Int2] >>> ***/
149
Lev Walkin22b5ed42006-09-13 02:51:20 +0000150#include "Int1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000151
152/*** <<< TYPE-DECLS [Int2] >>> ***/
153
154typedef Int1_t Int2_t;
155
156/*** <<< FUNC-DECLS [Int2] >>> ***/
157
158extern asn_TYPE_descriptor_t asn_DEF_Int2;
159asn_struct_free_f Int2_free;
160asn_struct_print_f Int2_print;
161asn_constr_check_f Int2_constraint;
162ber_type_decoder_f Int2_decode_ber;
163der_type_encoder_f Int2_encode_der;
164xer_type_decoder_f Int2_decode_xer;
165xer_type_encoder_f Int2_encode_xer;
166per_type_decoder_f Int2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000167per_type_encoder_f Int2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000168
169/*** <<< CODE [Int2] >>> ***/
170
171int
172Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000173 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000174 long value;
175
176 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700177 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000178 "%s: value not given (%s:%d)",
179 td->name, __FILE__, __LINE__);
180 return -1;
181 }
182
Lev Walkin2a744a72013-03-27 01:56:23 -0700183 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000184
185 if((value >= 0)) {
186 /* Constraint check succeeded */
187 return 0;
188 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700189 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000190 "%s: constraint failed (%s:%d)",
191 td->name, __FILE__, __LINE__);
192 return -1;
193 }
194}
195
196/*
197 * This type is implemented using Int1,
198 * so here we adjust the DEF accordingly.
199 */
200static void
201Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
202 td->free_struct = asn_DEF_Int1.free_struct;
203 td->print_struct = asn_DEF_Int1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800204 td->check_constraints = asn_DEF_Int1.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000205 td->ber_decoder = asn_DEF_Int1.ber_decoder;
206 td->der_encoder = asn_DEF_Int1.der_encoder;
207 td->xer_decoder = asn_DEF_Int1.xer_decoder;
208 td->xer_encoder = asn_DEF_Int1.xer_encoder;
209 td->uper_decoder = asn_DEF_Int1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000210 td->uper_encoder = asn_DEF_Int1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700211 td->oer_decoder = asn_DEF_Int1.oer_decoder;
212 td->oer_encoder = asn_DEF_Int1.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000213 if(!td->per_constraints)
214 td->per_constraints = asn_DEF_Int1.per_constraints;
215 td->elements = asn_DEF_Int1.elements;
216 td->elements_count = asn_DEF_Int1.elements_count;
217 td->specifics = asn_DEF_Int1.specifics;
218}
219
220void
221Int2_free(asn_TYPE_descriptor_t *td,
222 void *struct_ptr, int contents_only) {
223 Int2_1_inherit_TYPE_descriptor(td);
224 td->free_struct(td, struct_ptr, contents_only);
225}
226
227int
228Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
229 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
230 Int2_1_inherit_TYPE_descriptor(td);
231 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
232}
233
234asn_dec_rval_t
235Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
236 void **structure, const void *bufptr, size_t size, int tag_mode) {
237 Int2_1_inherit_TYPE_descriptor(td);
238 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
239}
240
241asn_enc_rval_t
242Int2_encode_der(asn_TYPE_descriptor_t *td,
243 void *structure, int tag_mode, ber_tlv_tag_t tag,
244 asn_app_consume_bytes_f *cb, void *app_key) {
245 Int2_1_inherit_TYPE_descriptor(td);
246 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
247}
248
249asn_dec_rval_t
250Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
251 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
252 Int2_1_inherit_TYPE_descriptor(td);
253 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
254}
255
256asn_enc_rval_t
257Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
258 int ilevel, enum xer_encoder_flags_e flags,
259 asn_app_consume_bytes_f *cb, void *app_key) {
260 Int2_1_inherit_TYPE_descriptor(td);
261 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
262}
263
264asn_dec_rval_t
265Int2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
266 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
267 Int2_1_inherit_TYPE_descriptor(td);
268 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
269}
270
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000271asn_enc_rval_t
272Int2_encode_uper(asn_TYPE_descriptor_t *td,
273 asn_per_constraints_t *constraints,
274 void *structure, asn_per_outp_t *per_out) {
275 Int2_1_inherit_TYPE_descriptor(td);
276 return td->uper_encoder(td, constraints, structure, per_out);
277}
278
Lev Walkin59b176e2005-11-26 11:25:14 +0000279
Lev Walkin725883b2006-10-09 12:07:58 +0000280/*** <<< CTDEFS [Int2] >>> ***/
281
Lev Walkin2fce55d2013-03-28 05:00:39 -0700282static asn_per_constraints_t asn_PER_type_Int2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000283 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
284 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
285 0, 0 /* No PER value map */
286};
287
Lev Walkin59b176e2005-11-26 11:25:14 +0000288/*** <<< STAT-DEFS [Int2] >>> ***/
289
Lev Walkina7591b52014-10-12 18:37:35 -0700290static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000291 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
292};
Lev Walkin59b176e2005-11-26 11:25:14 +0000293asn_TYPE_descriptor_t asn_DEF_Int2 = {
294 "Int2",
295 "Int2",
296 Int2_free,
297 Int2_print,
298 Int2_constraint,
299 Int2_decode_ber,
300 Int2_encode_der,
301 Int2_decode_xer,
302 Int2_encode_xer,
303 Int2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000304 Int2_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -0700305 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000306 0, /* Use generic outmost tag fetcher */
307 asn_DEF_Int2_tags_1,
308 sizeof(asn_DEF_Int2_tags_1)
309 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
310 asn_DEF_Int2_tags_1, /* Same as above */
311 sizeof(asn_DEF_Int2_tags_1)
312 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000313 &asn_PER_type_Int2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000314 0, 0, /* No members */
315 0 /* No specifics */
316};
317
318
319/*** <<< INCLUDES [Int3] >>> ***/
320
Lev Walkin22b5ed42006-09-13 02:51:20 +0000321#include "Int2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000322
323/*** <<< TYPE-DECLS [Int3] >>> ***/
324
325typedef Int2_t Int3_t;
326
327/*** <<< FUNC-DECLS [Int3] >>> ***/
328
329extern asn_TYPE_descriptor_t asn_DEF_Int3;
330asn_struct_free_f Int3_free;
331asn_struct_print_f Int3_print;
332asn_constr_check_f Int3_constraint;
333ber_type_decoder_f Int3_decode_ber;
334der_type_encoder_f Int3_encode_der;
335xer_type_decoder_f Int3_decode_xer;
336xer_type_encoder_f Int3_encode_xer;
337per_type_decoder_f Int3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000338per_type_encoder_f Int3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000339
340/*** <<< CODE [Int3] >>> ***/
341
342int
343Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000344 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000345 long value;
346
347 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700348 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000349 "%s: value not given (%s:%d)",
350 td->name, __FILE__, __LINE__);
351 return -1;
352 }
353
Lev Walkin2a744a72013-03-27 01:56:23 -0700354 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000355
356 if((value >= 0 && value <= 10)) {
357 /* Constraint check succeeded */
358 return 0;
359 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700360 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000361 "%s: constraint failed (%s:%d)",
362 td->name, __FILE__, __LINE__);
363 return -1;
364 }
365}
366
367/*
368 * This type is implemented using Int2,
369 * so here we adjust the DEF accordingly.
370 */
371static void
372Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
373 td->free_struct = asn_DEF_Int2.free_struct;
374 td->print_struct = asn_DEF_Int2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800375 td->check_constraints = asn_DEF_Int2.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000376 td->ber_decoder = asn_DEF_Int2.ber_decoder;
377 td->der_encoder = asn_DEF_Int2.der_encoder;
378 td->xer_decoder = asn_DEF_Int2.xer_decoder;
379 td->xer_encoder = asn_DEF_Int2.xer_encoder;
380 td->uper_decoder = asn_DEF_Int2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000381 td->uper_encoder = asn_DEF_Int2.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700382 td->oer_decoder = asn_DEF_Int2.oer_decoder;
383 td->oer_encoder = asn_DEF_Int2.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000384 if(!td->per_constraints)
385 td->per_constraints = asn_DEF_Int2.per_constraints;
386 td->elements = asn_DEF_Int2.elements;
387 td->elements_count = asn_DEF_Int2.elements_count;
388 td->specifics = asn_DEF_Int2.specifics;
389}
390
391void
392Int3_free(asn_TYPE_descriptor_t *td,
393 void *struct_ptr, int contents_only) {
394 Int3_1_inherit_TYPE_descriptor(td);
395 td->free_struct(td, struct_ptr, contents_only);
396}
397
398int
399Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
400 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
401 Int3_1_inherit_TYPE_descriptor(td);
402 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
403}
404
405asn_dec_rval_t
406Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
407 void **structure, const void *bufptr, size_t size, int tag_mode) {
408 Int3_1_inherit_TYPE_descriptor(td);
409 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
410}
411
412asn_enc_rval_t
413Int3_encode_der(asn_TYPE_descriptor_t *td,
414 void *structure, int tag_mode, ber_tlv_tag_t tag,
415 asn_app_consume_bytes_f *cb, void *app_key) {
416 Int3_1_inherit_TYPE_descriptor(td);
417 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
418}
419
420asn_dec_rval_t
421Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
422 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
423 Int3_1_inherit_TYPE_descriptor(td);
424 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
425}
426
427asn_enc_rval_t
428Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
429 int ilevel, enum xer_encoder_flags_e flags,
430 asn_app_consume_bytes_f *cb, void *app_key) {
431 Int3_1_inherit_TYPE_descriptor(td);
432 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
433}
434
435asn_dec_rval_t
436Int3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
437 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
438 Int3_1_inherit_TYPE_descriptor(td);
439 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
440}
441
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000442asn_enc_rval_t
443Int3_encode_uper(asn_TYPE_descriptor_t *td,
444 asn_per_constraints_t *constraints,
445 void *structure, asn_per_outp_t *per_out) {
446 Int3_1_inherit_TYPE_descriptor(td);
447 return td->uper_encoder(td, constraints, structure, per_out);
448}
449
Lev Walkin59b176e2005-11-26 11:25:14 +0000450
Lev Walkin725883b2006-10-09 12:07:58 +0000451/*** <<< CTDEFS [Int3] >>> ***/
452
Lev Walkin2fce55d2013-03-28 05:00:39 -0700453static asn_per_constraints_t asn_PER_type_Int3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000454 { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
455 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
456 0, 0 /* No PER value map */
457};
458
Lev Walkin59b176e2005-11-26 11:25:14 +0000459/*** <<< STAT-DEFS [Int3] >>> ***/
460
Lev Walkina7591b52014-10-12 18:37:35 -0700461static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000462 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
463};
Lev Walkin59b176e2005-11-26 11:25:14 +0000464asn_TYPE_descriptor_t asn_DEF_Int3 = {
465 "Int3",
466 "Int3",
467 Int3_free,
468 Int3_print,
469 Int3_constraint,
470 Int3_decode_ber,
471 Int3_encode_der,
472 Int3_decode_xer,
473 Int3_encode_xer,
474 Int3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000475 Int3_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -0700476 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000477 0, /* Use generic outmost tag fetcher */
478 asn_DEF_Int3_tags_1,
479 sizeof(asn_DEF_Int3_tags_1)
480 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
481 asn_DEF_Int3_tags_1, /* Same as above */
482 sizeof(asn_DEF_Int3_tags_1)
483 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000484 &asn_PER_type_Int3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000485 0, 0, /* No members */
486 0 /* No specifics */
487};
488
489
490/*** <<< INCLUDES [Int4] >>> ***/
491
Lev Walkin22b5ed42006-09-13 02:51:20 +0000492#include "Int3.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000493
494/*** <<< TYPE-DECLS [Int4] >>> ***/
495
496typedef Int3_t Int4_t;
497
498/*** <<< FUNC-DECLS [Int4] >>> ***/
499
500extern asn_TYPE_descriptor_t asn_DEF_Int4;
501asn_struct_free_f Int4_free;
502asn_struct_print_f Int4_print;
503asn_constr_check_f Int4_constraint;
504ber_type_decoder_f Int4_decode_ber;
505der_type_encoder_f Int4_encode_der;
506xer_type_decoder_f Int4_decode_xer;
507xer_type_encoder_f Int4_encode_xer;
508per_type_decoder_f Int4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000509per_type_encoder_f Int4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000510
511/*** <<< CODE [Int4] >>> ***/
512
513int
514Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000515 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000516 long value;
517
518 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700519 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000520 "%s: value not given (%s:%d)",
521 td->name, __FILE__, __LINE__);
522 return -1;
523 }
524
Lev Walkin2a744a72013-03-27 01:56:23 -0700525 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000526
527 if((value >= 1 && value <= 10)) {
528 /* Constraint check succeeded */
529 return 0;
530 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700531 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000532 "%s: constraint failed (%s:%d)",
533 td->name, __FILE__, __LINE__);
534 return -1;
535 }
536}
537
538/*
539 * This type is implemented using Int3,
540 * so here we adjust the DEF accordingly.
541 */
542static void
543Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
544 td->free_struct = asn_DEF_Int3.free_struct;
545 td->print_struct = asn_DEF_Int3.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800546 td->check_constraints = asn_DEF_Int3.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000547 td->ber_decoder = asn_DEF_Int3.ber_decoder;
548 td->der_encoder = asn_DEF_Int3.der_encoder;
549 td->xer_decoder = asn_DEF_Int3.xer_decoder;
550 td->xer_encoder = asn_DEF_Int3.xer_encoder;
551 td->uper_decoder = asn_DEF_Int3.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000552 td->uper_encoder = asn_DEF_Int3.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700553 td->oer_decoder = asn_DEF_Int3.oer_decoder;
554 td->oer_encoder = asn_DEF_Int3.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000555 if(!td->per_constraints)
556 td->per_constraints = asn_DEF_Int3.per_constraints;
557 td->elements = asn_DEF_Int3.elements;
558 td->elements_count = asn_DEF_Int3.elements_count;
559 td->specifics = asn_DEF_Int3.specifics;
560}
561
562void
563Int4_free(asn_TYPE_descriptor_t *td,
564 void *struct_ptr, int contents_only) {
565 Int4_1_inherit_TYPE_descriptor(td);
566 td->free_struct(td, struct_ptr, contents_only);
567}
568
569int
570Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
571 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
572 Int4_1_inherit_TYPE_descriptor(td);
573 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
574}
575
576asn_dec_rval_t
577Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
578 void **structure, const void *bufptr, size_t size, int tag_mode) {
579 Int4_1_inherit_TYPE_descriptor(td);
580 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
581}
582
583asn_enc_rval_t
584Int4_encode_der(asn_TYPE_descriptor_t *td,
585 void *structure, int tag_mode, ber_tlv_tag_t tag,
586 asn_app_consume_bytes_f *cb, void *app_key) {
587 Int4_1_inherit_TYPE_descriptor(td);
588 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
589}
590
591asn_dec_rval_t
592Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
593 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
594 Int4_1_inherit_TYPE_descriptor(td);
595 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
596}
597
598asn_enc_rval_t
599Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
600 int ilevel, enum xer_encoder_flags_e flags,
601 asn_app_consume_bytes_f *cb, void *app_key) {
602 Int4_1_inherit_TYPE_descriptor(td);
603 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
604}
605
606asn_dec_rval_t
607Int4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
608 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
609 Int4_1_inherit_TYPE_descriptor(td);
610 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
611}
612
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000613asn_enc_rval_t
614Int4_encode_uper(asn_TYPE_descriptor_t *td,
615 asn_per_constraints_t *constraints,
616 void *structure, asn_per_outp_t *per_out) {
617 Int4_1_inherit_TYPE_descriptor(td);
618 return td->uper_encoder(td, constraints, structure, per_out);
619}
620
Lev Walkin59b176e2005-11-26 11:25:14 +0000621
Lev Walkin725883b2006-10-09 12:07:58 +0000622/*** <<< CTDEFS [Int4] >>> ***/
623
Lev Walkin2fce55d2013-03-28 05:00:39 -0700624static asn_per_constraints_t asn_PER_type_Int4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000625 { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
626 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
627 0, 0 /* No PER value map */
628};
629
Lev Walkin59b176e2005-11-26 11:25:14 +0000630/*** <<< STAT-DEFS [Int4] >>> ***/
631
Lev Walkina7591b52014-10-12 18:37:35 -0700632static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000633 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
634};
Lev Walkin59b176e2005-11-26 11:25:14 +0000635asn_TYPE_descriptor_t asn_DEF_Int4 = {
636 "Int4",
637 "Int4",
638 Int4_free,
639 Int4_print,
640 Int4_constraint,
641 Int4_decode_ber,
642 Int4_encode_der,
643 Int4_decode_xer,
644 Int4_encode_xer,
645 Int4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000646 Int4_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -0700647 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000648 0, /* Use generic outmost tag fetcher */
649 asn_DEF_Int4_tags_1,
650 sizeof(asn_DEF_Int4_tags_1)
651 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
652 asn_DEF_Int4_tags_1, /* Same as above */
653 sizeof(asn_DEF_Int4_tags_1)
654 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000655 &asn_PER_type_Int4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000656 0, 0, /* No members */
657 0 /* No specifics */
658};
659
660
661/*** <<< INCLUDES [Int5] >>> ***/
662
Lev Walkin22b5ed42006-09-13 02:51:20 +0000663#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000664
665/*** <<< TYPE-DECLS [Int5] >>> ***/
666
667typedef Int4_t Int5_t;
668
669/*** <<< FUNC-DECLS [Int5] >>> ***/
670
671extern asn_TYPE_descriptor_t asn_DEF_Int5;
672asn_struct_free_f Int5_free;
673asn_struct_print_f Int5_print;
674asn_constr_check_f Int5_constraint;
675ber_type_decoder_f Int5_decode_ber;
676der_type_encoder_f Int5_encode_der;
677xer_type_decoder_f Int5_decode_xer;
678xer_type_encoder_f Int5_encode_xer;
679per_type_decoder_f Int5_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000680per_type_encoder_f Int5_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000681
682/*** <<< CODE [Int5] >>> ***/
683
684int
685Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000686 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000687 long value;
688
689 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700690 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000691 "%s: value not given (%s:%d)",
692 td->name, __FILE__, __LINE__);
693 return -1;
694 }
695
Lev Walkin2a744a72013-03-27 01:56:23 -0700696 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000697
698 if((value == 5)) {
699 /* Constraint check succeeded */
700 return 0;
701 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700702 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000703 "%s: constraint failed (%s:%d)",
704 td->name, __FILE__, __LINE__);
705 return -1;
706 }
707}
708
709/*
710 * This type is implemented using Int4,
711 * so here we adjust the DEF accordingly.
712 */
713static void
714Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
715 td->free_struct = asn_DEF_Int4.free_struct;
716 td->print_struct = asn_DEF_Int4.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800717 td->check_constraints = asn_DEF_Int4.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000718 td->ber_decoder = asn_DEF_Int4.ber_decoder;
719 td->der_encoder = asn_DEF_Int4.der_encoder;
720 td->xer_decoder = asn_DEF_Int4.xer_decoder;
721 td->xer_encoder = asn_DEF_Int4.xer_encoder;
722 td->uper_decoder = asn_DEF_Int4.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000723 td->uper_encoder = asn_DEF_Int4.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700724 td->oer_decoder = asn_DEF_Int4.oer_decoder;
725 td->oer_encoder = asn_DEF_Int4.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000726 if(!td->per_constraints)
727 td->per_constraints = asn_DEF_Int4.per_constraints;
728 td->elements = asn_DEF_Int4.elements;
729 td->elements_count = asn_DEF_Int4.elements_count;
730 td->specifics = asn_DEF_Int4.specifics;
731}
732
733void
734Int5_free(asn_TYPE_descriptor_t *td,
735 void *struct_ptr, int contents_only) {
736 Int5_1_inherit_TYPE_descriptor(td);
737 td->free_struct(td, struct_ptr, contents_only);
738}
739
740int
741Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
742 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
743 Int5_1_inherit_TYPE_descriptor(td);
744 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
745}
746
747asn_dec_rval_t
748Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
749 void **structure, const void *bufptr, size_t size, int tag_mode) {
750 Int5_1_inherit_TYPE_descriptor(td);
751 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
752}
753
754asn_enc_rval_t
755Int5_encode_der(asn_TYPE_descriptor_t *td,
756 void *structure, int tag_mode, ber_tlv_tag_t tag,
757 asn_app_consume_bytes_f *cb, void *app_key) {
758 Int5_1_inherit_TYPE_descriptor(td);
759 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
760}
761
762asn_dec_rval_t
763Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
764 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
765 Int5_1_inherit_TYPE_descriptor(td);
766 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
767}
768
769asn_enc_rval_t
770Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
771 int ilevel, enum xer_encoder_flags_e flags,
772 asn_app_consume_bytes_f *cb, void *app_key) {
773 Int5_1_inherit_TYPE_descriptor(td);
774 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
775}
776
777asn_dec_rval_t
778Int5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
779 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
780 Int5_1_inherit_TYPE_descriptor(td);
781 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
782}
783
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000784asn_enc_rval_t
785Int5_encode_uper(asn_TYPE_descriptor_t *td,
786 asn_per_constraints_t *constraints,
787 void *structure, asn_per_outp_t *per_out) {
788 Int5_1_inherit_TYPE_descriptor(td);
789 return td->uper_encoder(td, constraints, structure, per_out);
790}
791
Lev Walkin59b176e2005-11-26 11:25:14 +0000792
Lev Walkin725883b2006-10-09 12:07:58 +0000793/*** <<< CTDEFS [Int5] >>> ***/
794
Lev Walkin2fce55d2013-03-28 05:00:39 -0700795static asn_per_constraints_t asn_PER_type_Int5_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000796 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
797 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
798 0, 0 /* No PER value map */
799};
800
Lev Walkin59b176e2005-11-26 11:25:14 +0000801/*** <<< STAT-DEFS [Int5] >>> ***/
802
Lev Walkina7591b52014-10-12 18:37:35 -0700803static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000804 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
805};
Lev Walkin59b176e2005-11-26 11:25:14 +0000806asn_TYPE_descriptor_t asn_DEF_Int5 = {
807 "Int5",
808 "Int5",
809 Int5_free,
810 Int5_print,
811 Int5_constraint,
812 Int5_decode_ber,
813 Int5_encode_der,
814 Int5_decode_xer,
815 Int5_encode_xer,
816 Int5_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000817 Int5_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -0700818 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000819 0, /* Use generic outmost tag fetcher */
820 asn_DEF_Int5_tags_1,
821 sizeof(asn_DEF_Int5_tags_1)
822 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
823 asn_DEF_Int5_tags_1, /* Same as above */
824 sizeof(asn_DEF_Int5_tags_1)
825 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000826 &asn_PER_type_Int5_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000827 0, 0, /* No members */
828 0 /* No specifics */
829};
830
831
832/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
833
Lev Walkin2a744a72013-03-27 01:56:23 -0700834#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +0000835
836/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
837
Lev Walkin2a744a72013-03-27 01:56:23 -0700838typedef long ExtensibleExtensions_t;
Lev Walkin59b176e2005-11-26 11:25:14 +0000839
840/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
841
842extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
843asn_struct_free_f ExtensibleExtensions_free;
844asn_struct_print_f ExtensibleExtensions_print;
845asn_constr_check_f ExtensibleExtensions_constraint;
846ber_type_decoder_f ExtensibleExtensions_decode_ber;
847der_type_encoder_f ExtensibleExtensions_encode_der;
848xer_type_decoder_f ExtensibleExtensions_decode_xer;
849xer_type_encoder_f ExtensibleExtensions_encode_xer;
850per_type_decoder_f ExtensibleExtensions_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000851per_type_encoder_f ExtensibleExtensions_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000852
853/*** <<< CODE [ExtensibleExtensions] >>> ***/
854
855int
856ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000857 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000858 long value;
859
860 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700861 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000862 "%s: value not given (%s:%d)",
863 td->name, __FILE__, __LINE__);
864 return -1;
865 }
866
Lev Walkin2a744a72013-03-27 01:56:23 -0700867 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000868
869 if((value >= 1 && value <= 256)) {
870 /* Constraint check succeeded */
871 return 0;
872 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700873 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000874 "%s: constraint failed (%s:%d)",
875 td->name, __FILE__, __LINE__);
876 return -1;
877 }
878}
879
880/*
Lev Walkin2a744a72013-03-27 01:56:23 -0700881 * This type is implemented using NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +0000882 * so here we adjust the DEF accordingly.
883 */
884static void
885ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -0700886 td->free_struct = asn_DEF_NativeInteger.free_struct;
887 td->print_struct = asn_DEF_NativeInteger.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800888 td->check_constraints = asn_DEF_NativeInteger.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -0700889 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
890 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
891 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
892 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
893 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
894 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700895 td->oer_decoder = asn_DEF_NativeInteger.oer_decoder;
896 td->oer_encoder = asn_DEF_NativeInteger.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000897 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -0700898 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
899 td->elements = asn_DEF_NativeInteger.elements;
900 td->elements_count = asn_DEF_NativeInteger.elements_count;
901 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin59b176e2005-11-26 11:25:14 +0000902}
903
904void
905ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
906 void *struct_ptr, int contents_only) {
907 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
908 td->free_struct(td, struct_ptr, contents_only);
909}
910
911int
912ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
913 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
914 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
915 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
916}
917
918asn_dec_rval_t
919ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
920 void **structure, const void *bufptr, size_t size, int tag_mode) {
921 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
922 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
923}
924
925asn_enc_rval_t
926ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
927 void *structure, int tag_mode, ber_tlv_tag_t tag,
928 asn_app_consume_bytes_f *cb, void *app_key) {
929 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
930 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
931}
932
933asn_dec_rval_t
934ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
935 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
936 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
937 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
938}
939
940asn_enc_rval_t
941ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
942 int ilevel, enum xer_encoder_flags_e flags,
943 asn_app_consume_bytes_f *cb, void *app_key) {
944 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
945 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
946}
947
948asn_dec_rval_t
949ExtensibleExtensions_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
950 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
951 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
952 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
953}
954
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000955asn_enc_rval_t
956ExtensibleExtensions_encode_uper(asn_TYPE_descriptor_t *td,
957 asn_per_constraints_t *constraints,
958 void *structure, asn_per_outp_t *per_out) {
959 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
960 return td->uper_encoder(td, constraints, structure, per_out);
961}
962
Lev Walkin59b176e2005-11-26 11:25:14 +0000963
Lev Walkin725883b2006-10-09 12:07:58 +0000964/*** <<< CTDEFS [ExtensibleExtensions] >>> ***/
965
Lev Walkin2fce55d2013-03-28 05:00:39 -0700966static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000967 { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
968 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
969 0, 0 /* No PER value map */
970};
971
Lev Walkin59b176e2005-11-26 11:25:14 +0000972/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
973
Lev Walkina7591b52014-10-12 18:37:35 -0700974static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000975 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
976};
Lev Walkin59b176e2005-11-26 11:25:14 +0000977asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
978 "ExtensibleExtensions",
979 "ExtensibleExtensions",
980 ExtensibleExtensions_free,
981 ExtensibleExtensions_print,
982 ExtensibleExtensions_constraint,
983 ExtensibleExtensions_decode_ber,
984 ExtensibleExtensions_encode_der,
985 ExtensibleExtensions_decode_xer,
986 ExtensibleExtensions_encode_xer,
987 ExtensibleExtensions_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000988 ExtensibleExtensions_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -0700989 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +0000990 0, /* Use generic outmost tag fetcher */
991 asn_DEF_ExtensibleExtensions_tags_1,
992 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
993 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
994 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
995 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
996 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000997 &asn_PER_type_ExtensibleExtensions_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000998 0, 0, /* No members */
999 0 /* No specifics */
1000};
1001
1002
1003/*** <<< INCLUDES [Str1] >>> ***/
1004
1005#include <IA5String.h>
1006
1007/*** <<< TYPE-DECLS [Str1] >>> ***/
1008
1009typedef IA5String_t Str1_t;
1010
1011/*** <<< FUNC-DECLS [Str1] >>> ***/
1012
1013extern asn_TYPE_descriptor_t asn_DEF_Str1;
1014asn_struct_free_f Str1_free;
1015asn_struct_print_f Str1_print;
1016asn_constr_check_f Str1_constraint;
1017ber_type_decoder_f Str1_decode_ber;
1018der_type_encoder_f Str1_encode_der;
1019xer_type_decoder_f Str1_decode_xer;
1020xer_type_encoder_f Str1_encode_xer;
1021per_type_decoder_f Str1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001022per_type_encoder_f Str1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001023
1024/*** <<< CODE [Str1] >>> ***/
1025
1026int
1027Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001028 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001029 /* Replace with underlying type checker */
1030 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00001031 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00001032}
1033
1034/*
1035 * This type is implemented using IA5String,
1036 * so here we adjust the DEF accordingly.
1037 */
1038static void
1039Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1040 td->free_struct = asn_DEF_IA5String.free_struct;
1041 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001042 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001043 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1044 td->der_encoder = asn_DEF_IA5String.der_encoder;
1045 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1046 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1047 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001048 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001049 td->oer_decoder = asn_DEF_IA5String.oer_decoder;
1050 td->oer_encoder = asn_DEF_IA5String.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001051 if(!td->per_constraints)
1052 td->per_constraints = asn_DEF_IA5String.per_constraints;
1053 td->elements = asn_DEF_IA5String.elements;
1054 td->elements_count = asn_DEF_IA5String.elements_count;
1055 td->specifics = asn_DEF_IA5String.specifics;
1056}
1057
1058void
1059Str1_free(asn_TYPE_descriptor_t *td,
1060 void *struct_ptr, int contents_only) {
1061 Str1_1_inherit_TYPE_descriptor(td);
1062 td->free_struct(td, struct_ptr, contents_only);
1063}
1064
1065int
1066Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1067 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1068 Str1_1_inherit_TYPE_descriptor(td);
1069 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1070}
1071
1072asn_dec_rval_t
1073Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1074 void **structure, const void *bufptr, size_t size, int tag_mode) {
1075 Str1_1_inherit_TYPE_descriptor(td);
1076 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1077}
1078
1079asn_enc_rval_t
1080Str1_encode_der(asn_TYPE_descriptor_t *td,
1081 void *structure, int tag_mode, ber_tlv_tag_t tag,
1082 asn_app_consume_bytes_f *cb, void *app_key) {
1083 Str1_1_inherit_TYPE_descriptor(td);
1084 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1085}
1086
1087asn_dec_rval_t
1088Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1089 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1090 Str1_1_inherit_TYPE_descriptor(td);
1091 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1092}
1093
1094asn_enc_rval_t
1095Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1096 int ilevel, enum xer_encoder_flags_e flags,
1097 asn_app_consume_bytes_f *cb, void *app_key) {
1098 Str1_1_inherit_TYPE_descriptor(td);
1099 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1100}
1101
1102asn_dec_rval_t
1103Str1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1104 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1105 Str1_1_inherit_TYPE_descriptor(td);
1106 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1107}
1108
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001109asn_enc_rval_t
1110Str1_encode_uper(asn_TYPE_descriptor_t *td,
1111 asn_per_constraints_t *constraints,
1112 void *structure, asn_per_outp_t *per_out) {
1113 Str1_1_inherit_TYPE_descriptor(td);
1114 return td->uper_encoder(td, constraints, structure, per_out);
1115}
1116
Lev Walkin59b176e2005-11-26 11:25:14 +00001117
1118/*** <<< STAT-DEFS [Str1] >>> ***/
1119
Lev Walkina7591b52014-10-12 18:37:35 -07001120static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001121 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1122};
1123asn_TYPE_descriptor_t asn_DEF_Str1 = {
1124 "Str1",
1125 "Str1",
1126 Str1_free,
1127 Str1_print,
1128 Str1_constraint,
1129 Str1_decode_ber,
1130 Str1_encode_der,
1131 Str1_decode_xer,
1132 Str1_encode_xer,
1133 Str1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001134 Str1_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07001135 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001136 0, /* Use generic outmost tag fetcher */
1137 asn_DEF_Str1_tags_1,
1138 sizeof(asn_DEF_Str1_tags_1)
1139 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1140 asn_DEF_Str1_tags_1, /* Same as above */
1141 sizeof(asn_DEF_Str1_tags_1)
1142 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1143 0, /* No PER visible constraints */
1144 0, 0, /* No members */
1145 0 /* No specifics */
1146};
1147
1148
1149/*** <<< INCLUDES [Str2] >>> ***/
1150
Lev Walkin22b5ed42006-09-13 02:51:20 +00001151#include "Str1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001152
1153/*** <<< TYPE-DECLS [Str2] >>> ***/
1154
1155typedef Str1_t Str2_t;
1156
1157/*** <<< FUNC-DECLS [Str2] >>> ***/
1158
1159extern asn_TYPE_descriptor_t asn_DEF_Str2;
1160asn_struct_free_f Str2_free;
1161asn_struct_print_f Str2_print;
1162asn_constr_check_f Str2_constraint;
1163ber_type_decoder_f Str2_decode_ber;
1164der_type_encoder_f Str2_encode_der;
1165xer_type_decoder_f Str2_decode_xer;
1166xer_type_encoder_f Str2_encode_xer;
1167per_type_decoder_f Str2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001168per_type_encoder_f Str2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001169
1170/*** <<< CTABLES [Str2] >>> ***/
1171
1172static int check_permitted_alphabet_1(const void *sptr) {
1173 /* The underlying type is IA5String */
1174 const IA5String_t *st = (const IA5String_t *)sptr;
1175 const uint8_t *ch = st->buf;
1176 const uint8_t *end = ch + st->size;
1177
1178 for(; ch < end; ch++) {
1179 uint8_t cv = *ch;
1180 if(!(cv <= 127)) return -1;
1181 }
1182 return 0;
1183}
1184
1185
1186/*** <<< CODE [Str2] >>> ***/
1187
1188int
1189Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001190 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001191 const Str1_t *st = (const Str1_t *)sptr;
1192 size_t size;
1193
1194 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001195 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001196 "%s: value not given (%s:%d)",
1197 td->name, __FILE__, __LINE__);
1198 return -1;
1199 }
1200
1201 size = st->size;
1202
1203 if(((size <= 20) || (size >= 25 && size <= 30))
1204 && !check_permitted_alphabet_1(st)) {
1205 /* Constraint check succeeded */
1206 return 0;
1207 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001208 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001209 "%s: constraint failed (%s:%d)",
1210 td->name, __FILE__, __LINE__);
1211 return -1;
1212 }
1213}
1214
1215/*
1216 * This type is implemented using Str1,
1217 * so here we adjust the DEF accordingly.
1218 */
1219static void
1220Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1221 td->free_struct = asn_DEF_Str1.free_struct;
1222 td->print_struct = asn_DEF_Str1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001223 td->check_constraints = asn_DEF_Str1.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001224 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1225 td->der_encoder = asn_DEF_Str1.der_encoder;
1226 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1227 td->xer_encoder = asn_DEF_Str1.xer_encoder;
1228 td->uper_decoder = asn_DEF_Str1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001229 td->uper_encoder = asn_DEF_Str1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001230 td->oer_decoder = asn_DEF_Str1.oer_decoder;
1231 td->oer_encoder = asn_DEF_Str1.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001232 if(!td->per_constraints)
1233 td->per_constraints = asn_DEF_Str1.per_constraints;
1234 td->elements = asn_DEF_Str1.elements;
1235 td->elements_count = asn_DEF_Str1.elements_count;
1236 td->specifics = asn_DEF_Str1.specifics;
1237}
1238
1239void
1240Str2_free(asn_TYPE_descriptor_t *td,
1241 void *struct_ptr, int contents_only) {
1242 Str2_1_inherit_TYPE_descriptor(td);
1243 td->free_struct(td, struct_ptr, contents_only);
1244}
1245
1246int
1247Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1248 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1249 Str2_1_inherit_TYPE_descriptor(td);
1250 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1251}
1252
1253asn_dec_rval_t
1254Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1255 void **structure, const void *bufptr, size_t size, int tag_mode) {
1256 Str2_1_inherit_TYPE_descriptor(td);
1257 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1258}
1259
1260asn_enc_rval_t
1261Str2_encode_der(asn_TYPE_descriptor_t *td,
1262 void *structure, int tag_mode, ber_tlv_tag_t tag,
1263 asn_app_consume_bytes_f *cb, void *app_key) {
1264 Str2_1_inherit_TYPE_descriptor(td);
1265 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1266}
1267
1268asn_dec_rval_t
1269Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1270 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1271 Str2_1_inherit_TYPE_descriptor(td);
1272 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1273}
1274
1275asn_enc_rval_t
1276Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1277 int ilevel, enum xer_encoder_flags_e flags,
1278 asn_app_consume_bytes_f *cb, void *app_key) {
1279 Str2_1_inherit_TYPE_descriptor(td);
1280 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1281}
1282
1283asn_dec_rval_t
1284Str2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1285 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1286 Str2_1_inherit_TYPE_descriptor(td);
1287 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1288}
1289
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001290asn_enc_rval_t
1291Str2_encode_uper(asn_TYPE_descriptor_t *td,
1292 asn_per_constraints_t *constraints,
1293 void *structure, asn_per_outp_t *per_out) {
1294 Str2_1_inherit_TYPE_descriptor(td);
1295 return td->uper_encoder(td, constraints, structure, per_out);
1296}
1297
Lev Walkin59b176e2005-11-26 11:25:14 +00001298
Lev Walkin725883b2006-10-09 12:07:58 +00001299/*** <<< CTDEFS [Str2] >>> ***/
1300
Lev Walkin2fce55d2013-03-28 05:00:39 -07001301static asn_per_constraints_t asn_PER_type_Str2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001302 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1303 { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */,
1304 0, 0 /* No PER character map necessary */
1305};
1306
Lev Walkin59b176e2005-11-26 11:25:14 +00001307/*** <<< STAT-DEFS [Str2] >>> ***/
1308
Lev Walkina7591b52014-10-12 18:37:35 -07001309static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001310 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1311};
Lev Walkin59b176e2005-11-26 11:25:14 +00001312asn_TYPE_descriptor_t asn_DEF_Str2 = {
1313 "Str2",
1314 "Str2",
1315 Str2_free,
1316 Str2_print,
1317 Str2_constraint,
1318 Str2_decode_ber,
1319 Str2_encode_der,
1320 Str2_decode_xer,
1321 Str2_encode_xer,
1322 Str2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001323 Str2_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07001324 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001325 0, /* Use generic outmost tag fetcher */
1326 asn_DEF_Str2_tags_1,
1327 sizeof(asn_DEF_Str2_tags_1)
1328 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1329 asn_DEF_Str2_tags_1, /* Same as above */
1330 sizeof(asn_DEF_Str2_tags_1)
1331 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001332 &asn_PER_type_Str2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001333 0, 0, /* No members */
1334 0 /* No specifics */
1335};
1336
1337
1338/*** <<< INCLUDES [Str3] >>> ***/
1339
Lev Walkin22b5ed42006-09-13 02:51:20 +00001340#include "Str2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001341
1342/*** <<< TYPE-DECLS [Str3] >>> ***/
1343
1344typedef Str2_t Str3_t;
1345
1346/*** <<< FUNC-DECLS [Str3] >>> ***/
1347
1348extern asn_TYPE_descriptor_t asn_DEF_Str3;
1349asn_struct_free_f Str3_free;
1350asn_struct_print_f Str3_print;
1351asn_constr_check_f Str3_constraint;
1352ber_type_decoder_f Str3_decode_ber;
1353der_type_encoder_f Str3_encode_der;
1354xer_type_decoder_f Str3_decode_xer;
1355xer_type_encoder_f Str3_encode_xer;
1356per_type_decoder_f Str3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001357per_type_encoder_f Str3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001358
1359/*** <<< CTABLES [Str3] >>> ***/
1360
Lev Walkina7591b52014-10-12 18:37:35 -07001361static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001362 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1363 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1364 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1365 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1366 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
1367 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1368 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin59b176e2005-11-26 11:25:14 +00001369};
Lev Walkina7591b52014-10-12 18:37:35 -07001370static const int permitted_alphabet_code2value_1[6] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000137165,66,67,100,101,102,};
1372
Lev Walkin59b176e2005-11-26 11:25:14 +00001373
1374static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07001375 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00001376 /* The underlying type is IA5String */
1377 const IA5String_t *st = (const IA5String_t *)sptr;
1378 const uint8_t *ch = st->buf;
1379 const uint8_t *end = ch + st->size;
1380
1381 for(; ch < end; ch++) {
1382 uint8_t cv = *ch;
1383 if(!table[cv]) return -1;
1384 }
1385 return 0;
1386}
1387
1388
1389/*** <<< CODE [Str3] >>> ***/
1390
1391int
1392Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001393 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001394 const Str2_t *st = (const Str2_t *)sptr;
1395 size_t size;
1396
1397 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001398 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001399 "%s: value not given (%s:%d)",
1400 td->name, __FILE__, __LINE__);
1401 return -1;
1402 }
1403
1404 size = st->size;
1405
1406 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
1407 && !check_permitted_alphabet_1(st)) {
1408 /* Constraint check succeeded */
1409 return 0;
1410 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001411 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001412 "%s: constraint failed (%s:%d)",
1413 td->name, __FILE__, __LINE__);
1414 return -1;
1415 }
1416}
1417
Lev Walkin725883b2006-10-09 12:07:58 +00001418static int asn_PER_MAP_Str3_1_v2c(unsigned int value) {
1419 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
1420 return -1;
1421 return permitted_alphabet_table_1[value] - 1;
1422}
1423static int asn_PER_MAP_Str3_1_c2v(unsigned int code) {
1424 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
1425 return -1;
1426 return permitted_alphabet_code2value_1[code];
1427}
Lev Walkin59b176e2005-11-26 11:25:14 +00001428/*
1429 * This type is implemented using Str2,
1430 * so here we adjust the DEF accordingly.
1431 */
1432static void
1433Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1434 td->free_struct = asn_DEF_Str2.free_struct;
1435 td->print_struct = asn_DEF_Str2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001436 td->check_constraints = asn_DEF_Str2.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001437 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1438 td->der_encoder = asn_DEF_Str2.der_encoder;
1439 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1440 td->xer_encoder = asn_DEF_Str2.xer_encoder;
1441 td->uper_decoder = asn_DEF_Str2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001442 td->uper_encoder = asn_DEF_Str2.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001443 td->oer_decoder = asn_DEF_Str2.oer_decoder;
1444 td->oer_encoder = asn_DEF_Str2.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001445 if(!td->per_constraints)
1446 td->per_constraints = asn_DEF_Str2.per_constraints;
1447 td->elements = asn_DEF_Str2.elements;
1448 td->elements_count = asn_DEF_Str2.elements_count;
1449 td->specifics = asn_DEF_Str2.specifics;
1450}
1451
1452void
1453Str3_free(asn_TYPE_descriptor_t *td,
1454 void *struct_ptr, int contents_only) {
1455 Str3_1_inherit_TYPE_descriptor(td);
1456 td->free_struct(td, struct_ptr, contents_only);
1457}
1458
1459int
1460Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1461 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1462 Str3_1_inherit_TYPE_descriptor(td);
1463 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1464}
1465
1466asn_dec_rval_t
1467Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1468 void **structure, const void *bufptr, size_t size, int tag_mode) {
1469 Str3_1_inherit_TYPE_descriptor(td);
1470 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1471}
1472
1473asn_enc_rval_t
1474Str3_encode_der(asn_TYPE_descriptor_t *td,
1475 void *structure, int tag_mode, ber_tlv_tag_t tag,
1476 asn_app_consume_bytes_f *cb, void *app_key) {
1477 Str3_1_inherit_TYPE_descriptor(td);
1478 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1479}
1480
1481asn_dec_rval_t
1482Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1483 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1484 Str3_1_inherit_TYPE_descriptor(td);
1485 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1486}
1487
1488asn_enc_rval_t
1489Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1490 int ilevel, enum xer_encoder_flags_e flags,
1491 asn_app_consume_bytes_f *cb, void *app_key) {
1492 Str3_1_inherit_TYPE_descriptor(td);
1493 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1494}
1495
1496asn_dec_rval_t
1497Str3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1498 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1499 Str3_1_inherit_TYPE_descriptor(td);
1500 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1501}
1502
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001503asn_enc_rval_t
1504Str3_encode_uper(asn_TYPE_descriptor_t *td,
1505 asn_per_constraints_t *constraints,
1506 void *structure, asn_per_outp_t *per_out) {
1507 Str3_1_inherit_TYPE_descriptor(td);
1508 return td->uper_encoder(td, constraints, structure, per_out);
1509}
1510
Lev Walkin59b176e2005-11-26 11:25:14 +00001511
Lev Walkin725883b2006-10-09 12:07:58 +00001512/*** <<< CTDEFS [Str3] >>> ***/
1513
Lev Walkin2fce55d2013-03-28 05:00:39 -07001514static asn_per_constraints_t asn_PER_type_Str3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001515 { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */,
1516 { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */,
1517 asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */
1518 asn_PER_MAP_Str3_1_c2v /* PER code to value map */
1519};
1520
Lev Walkin59b176e2005-11-26 11:25:14 +00001521/*** <<< STAT-DEFS [Str3] >>> ***/
1522
Lev Walkina7591b52014-10-12 18:37:35 -07001523static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001524 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1525};
Lev Walkin59b176e2005-11-26 11:25:14 +00001526asn_TYPE_descriptor_t asn_DEF_Str3 = {
1527 "Str3",
1528 "Str3",
1529 Str3_free,
1530 Str3_print,
1531 Str3_constraint,
1532 Str3_decode_ber,
1533 Str3_encode_der,
1534 Str3_decode_xer,
1535 Str3_encode_xer,
1536 Str3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001537 Str3_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07001538 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001539 0, /* Use generic outmost tag fetcher */
1540 asn_DEF_Str3_tags_1,
1541 sizeof(asn_DEF_Str3_tags_1)
1542 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1543 asn_DEF_Str3_tags_1, /* Same as above */
1544 sizeof(asn_DEF_Str3_tags_1)
1545 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001546 &asn_PER_type_Str3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001547 0, 0, /* No members */
1548 0 /* No specifics */
1549};
1550
1551
1552/*** <<< INCLUDES [Str4] >>> ***/
1553
1554#include <IA5String.h>
1555
1556/*** <<< TYPE-DECLS [Str4] >>> ***/
1557
1558typedef IA5String_t Str4_t;
1559
1560/*** <<< FUNC-DECLS [Str4] >>> ***/
1561
1562extern asn_TYPE_descriptor_t asn_DEF_Str4;
1563asn_struct_free_f Str4_free;
1564asn_struct_print_f Str4_print;
1565asn_constr_check_f Str4_constraint;
1566ber_type_decoder_f Str4_decode_ber;
1567der_type_encoder_f Str4_encode_der;
1568xer_type_decoder_f Str4_decode_xer;
1569xer_type_encoder_f Str4_encode_xer;
1570per_type_decoder_f Str4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001571per_type_encoder_f Str4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001572
1573/*** <<< CTABLES [Str4] >>> ***/
1574
1575static int check_permitted_alphabet_1(const void *sptr) {
1576 /* The underlying type is IA5String */
1577 const IA5String_t *st = (const IA5String_t *)sptr;
1578 const uint8_t *ch = st->buf;
1579 const uint8_t *end = ch + st->size;
1580
1581 for(; ch < end; ch++) {
1582 uint8_t cv = *ch;
1583 if(!(cv <= 127)) return -1;
1584 }
1585 return 0;
1586}
1587
1588
1589/*** <<< CODE [Str4] >>> ***/
1590
1591int
1592Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001593 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001594 const IA5String_t *st = (const IA5String_t *)sptr;
1595
1596 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001597 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001598 "%s: value not given (%s:%d)",
1599 td->name, __FILE__, __LINE__);
1600 return -1;
1601 }
1602
1603
1604 if(!check_permitted_alphabet_1(st)) {
1605 /* Constraint check succeeded */
1606 return 0;
1607 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001608 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001609 "%s: constraint failed (%s:%d)",
1610 td->name, __FILE__, __LINE__);
1611 return -1;
1612 }
1613}
1614
1615/*
1616 * This type is implemented using IA5String,
1617 * so here we adjust the DEF accordingly.
1618 */
1619static void
1620Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1621 td->free_struct = asn_DEF_IA5String.free_struct;
1622 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001623 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001624 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1625 td->der_encoder = asn_DEF_IA5String.der_encoder;
1626 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1627 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1628 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001629 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001630 td->oer_decoder = asn_DEF_IA5String.oer_decoder;
1631 td->oer_encoder = asn_DEF_IA5String.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001632 if(!td->per_constraints)
1633 td->per_constraints = asn_DEF_IA5String.per_constraints;
1634 td->elements = asn_DEF_IA5String.elements;
1635 td->elements_count = asn_DEF_IA5String.elements_count;
1636 td->specifics = asn_DEF_IA5String.specifics;
1637}
1638
1639void
1640Str4_free(asn_TYPE_descriptor_t *td,
1641 void *struct_ptr, int contents_only) {
1642 Str4_1_inherit_TYPE_descriptor(td);
1643 td->free_struct(td, struct_ptr, contents_only);
1644}
1645
1646int
1647Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1648 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1649 Str4_1_inherit_TYPE_descriptor(td);
1650 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1651}
1652
1653asn_dec_rval_t
1654Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1655 void **structure, const void *bufptr, size_t size, int tag_mode) {
1656 Str4_1_inherit_TYPE_descriptor(td);
1657 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1658}
1659
1660asn_enc_rval_t
1661Str4_encode_der(asn_TYPE_descriptor_t *td,
1662 void *structure, int tag_mode, ber_tlv_tag_t tag,
1663 asn_app_consume_bytes_f *cb, void *app_key) {
1664 Str4_1_inherit_TYPE_descriptor(td);
1665 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1666}
1667
1668asn_dec_rval_t
1669Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1670 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1671 Str4_1_inherit_TYPE_descriptor(td);
1672 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1673}
1674
1675asn_enc_rval_t
1676Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1677 int ilevel, enum xer_encoder_flags_e flags,
1678 asn_app_consume_bytes_f *cb, void *app_key) {
1679 Str4_1_inherit_TYPE_descriptor(td);
1680 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1681}
1682
1683asn_dec_rval_t
1684Str4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1685 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1686 Str4_1_inherit_TYPE_descriptor(td);
1687 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1688}
1689
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001690asn_enc_rval_t
1691Str4_encode_uper(asn_TYPE_descriptor_t *td,
1692 asn_per_constraints_t *constraints,
1693 void *structure, asn_per_outp_t *per_out) {
1694 Str4_1_inherit_TYPE_descriptor(td);
1695 return td->uper_encoder(td, constraints, structure, per_out);
1696}
1697
Lev Walkin59b176e2005-11-26 11:25:14 +00001698
Lev Walkin725883b2006-10-09 12:07:58 +00001699/*** <<< CTDEFS [Str4] >>> ***/
1700
Lev Walkin2fce55d2013-03-28 05:00:39 -07001701static asn_per_constraints_t asn_PER_type_Str4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001702 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1703 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1704 0, 0 /* No PER character map necessary */
1705};
1706
Lev Walkin59b176e2005-11-26 11:25:14 +00001707/*** <<< STAT-DEFS [Str4] >>> ***/
1708
Lev Walkina7591b52014-10-12 18:37:35 -07001709static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001710 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1711};
Lev Walkin59b176e2005-11-26 11:25:14 +00001712asn_TYPE_descriptor_t asn_DEF_Str4 = {
1713 "Str4",
1714 "Str4",
1715 Str4_free,
1716 Str4_print,
1717 Str4_constraint,
1718 Str4_decode_ber,
1719 Str4_encode_der,
1720 Str4_decode_xer,
1721 Str4_encode_xer,
1722 Str4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001723 Str4_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07001724 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001725 0, /* Use generic outmost tag fetcher */
1726 asn_DEF_Str4_tags_1,
1727 sizeof(asn_DEF_Str4_tags_1)
1728 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1729 asn_DEF_Str4_tags_1, /* Same as above */
1730 sizeof(asn_DEF_Str4_tags_1)
1731 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001732 &asn_PER_type_Str4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001733 0, 0, /* No members */
1734 0 /* No specifics */
1735};
1736
1737
1738/*** <<< INCLUDES [PER-Visible] >>> ***/
1739
1740#include <IA5String.h>
1741
1742/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1743
1744typedef IA5String_t PER_Visible_t;
1745
1746/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1747
1748extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
1749asn_struct_free_f PER_Visible_free;
1750asn_struct_print_f PER_Visible_print;
1751asn_constr_check_f PER_Visible_constraint;
1752ber_type_decoder_f PER_Visible_decode_ber;
1753der_type_encoder_f PER_Visible_encode_der;
1754xer_type_decoder_f PER_Visible_decode_xer;
1755xer_type_encoder_f PER_Visible_encode_xer;
1756per_type_decoder_f PER_Visible_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001757per_type_encoder_f PER_Visible_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001758
1759/*** <<< CTABLES [PER-Visible] >>> ***/
1760
1761static int check_permitted_alphabet_1(const void *sptr) {
1762 /* The underlying type is IA5String */
1763 const IA5String_t *st = (const IA5String_t *)sptr;
1764 const uint8_t *ch = st->buf;
1765 const uint8_t *end = ch + st->size;
1766
1767 for(; ch < end; ch++) {
1768 uint8_t cv = *ch;
1769 if(!(cv >= 65 && cv <= 70)) return -1;
1770 }
1771 return 0;
1772}
1773
1774
1775/*** <<< CODE [PER-Visible] >>> ***/
1776
1777int
1778PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001779 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001780 const IA5String_t *st = (const IA5String_t *)sptr;
1781
1782 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001783 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001784 "%s: value not given (%s:%d)",
1785 td->name, __FILE__, __LINE__);
1786 return -1;
1787 }
1788
1789
1790 if(!check_permitted_alphabet_1(st)) {
1791 /* Constraint check succeeded */
1792 return 0;
1793 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001794 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001795 "%s: constraint failed (%s:%d)",
1796 td->name, __FILE__, __LINE__);
1797 return -1;
1798 }
1799}
1800
1801/*
1802 * This type is implemented using IA5String,
1803 * so here we adjust the DEF accordingly.
1804 */
1805static void
1806PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1807 td->free_struct = asn_DEF_IA5String.free_struct;
1808 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001809 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001810 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1811 td->der_encoder = asn_DEF_IA5String.der_encoder;
1812 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1813 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1814 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001815 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07001816 td->oer_decoder = asn_DEF_IA5String.oer_decoder;
1817 td->oer_encoder = asn_DEF_IA5String.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001818 if(!td->per_constraints)
1819 td->per_constraints = asn_DEF_IA5String.per_constraints;
1820 td->elements = asn_DEF_IA5String.elements;
1821 td->elements_count = asn_DEF_IA5String.elements_count;
1822 td->specifics = asn_DEF_IA5String.specifics;
1823}
1824
1825void
1826PER_Visible_free(asn_TYPE_descriptor_t *td,
1827 void *struct_ptr, int contents_only) {
1828 PER_Visible_1_inherit_TYPE_descriptor(td);
1829 td->free_struct(td, struct_ptr, contents_only);
1830}
1831
1832int
1833PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1834 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1835 PER_Visible_1_inherit_TYPE_descriptor(td);
1836 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1837}
1838
1839asn_dec_rval_t
1840PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1841 void **structure, const void *bufptr, size_t size, int tag_mode) {
1842 PER_Visible_1_inherit_TYPE_descriptor(td);
1843 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1844}
1845
1846asn_enc_rval_t
1847PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
1848 void *structure, int tag_mode, ber_tlv_tag_t tag,
1849 asn_app_consume_bytes_f *cb, void *app_key) {
1850 PER_Visible_1_inherit_TYPE_descriptor(td);
1851 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1852}
1853
1854asn_dec_rval_t
1855PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1856 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1857 PER_Visible_1_inherit_TYPE_descriptor(td);
1858 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1859}
1860
1861asn_enc_rval_t
1862PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1863 int ilevel, enum xer_encoder_flags_e flags,
1864 asn_app_consume_bytes_f *cb, void *app_key) {
1865 PER_Visible_1_inherit_TYPE_descriptor(td);
1866 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1867}
1868
1869asn_dec_rval_t
1870PER_Visible_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1871 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1872 PER_Visible_1_inherit_TYPE_descriptor(td);
1873 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1874}
1875
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001876asn_enc_rval_t
1877PER_Visible_encode_uper(asn_TYPE_descriptor_t *td,
1878 asn_per_constraints_t *constraints,
1879 void *structure, asn_per_outp_t *per_out) {
1880 PER_Visible_1_inherit_TYPE_descriptor(td);
1881 return td->uper_encoder(td, constraints, structure, per_out);
1882}
1883
Lev Walkin59b176e2005-11-26 11:25:14 +00001884
Lev Walkin725883b2006-10-09 12:07:58 +00001885/*** <<< CTDEFS [PER-Visible] >>> ***/
1886
Lev Walkin2fce55d2013-03-28 05:00:39 -07001887static asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001888 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1889 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1890 0, 0 /* No PER character map necessary */
1891};
1892
Lev Walkin59b176e2005-11-26 11:25:14 +00001893/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1894
Lev Walkina7591b52014-10-12 18:37:35 -07001895static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001896 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1897};
Lev Walkin59b176e2005-11-26 11:25:14 +00001898asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1899 "PER-Visible",
1900 "PER-Visible",
1901 PER_Visible_free,
1902 PER_Visible_print,
1903 PER_Visible_constraint,
1904 PER_Visible_decode_ber,
1905 PER_Visible_encode_der,
1906 PER_Visible_decode_xer,
1907 PER_Visible_encode_xer,
1908 PER_Visible_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001909 PER_Visible_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07001910 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00001911 0, /* Use generic outmost tag fetcher */
1912 asn_DEF_PER_Visible_tags_1,
1913 sizeof(asn_DEF_PER_Visible_tags_1)
1914 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1915 asn_DEF_PER_Visible_tags_1, /* Same as above */
1916 sizeof(asn_DEF_PER_Visible_tags_1)
1917 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001918 &asn_PER_type_PER_Visible_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001919 0, 0, /* No members */
1920 0 /* No specifics */
1921};
1922
1923
1924/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1925
Lev Walkin22b5ed42006-09-13 02:51:20 +00001926#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001927
1928/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1929
1930typedef PER_Visible_t PER_Visible_2_t;
1931
1932/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1933
1934extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1935asn_struct_free_f PER_Visible_2_free;
1936asn_struct_print_f PER_Visible_2_print;
1937asn_constr_check_f PER_Visible_2_constraint;
1938ber_type_decoder_f PER_Visible_2_decode_ber;
1939der_type_encoder_f PER_Visible_2_encode_der;
1940xer_type_decoder_f PER_Visible_2_decode_xer;
1941xer_type_encoder_f PER_Visible_2_encode_xer;
1942per_type_decoder_f PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001943per_type_encoder_f PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001944
1945/*** <<< CTABLES [PER-Visible-2] >>> ***/
1946
1947static int check_permitted_alphabet_1(const void *sptr) {
1948 /* The underlying type is IA5String */
1949 const IA5String_t *st = (const IA5String_t *)sptr;
1950 const uint8_t *ch = st->buf;
1951 const uint8_t *end = ch + st->size;
1952
1953 for(; ch < end; ch++) {
1954 uint8_t cv = *ch;
1955 if(!(cv >= 69 && cv <= 70)) return -1;
1956 }
1957 return 0;
1958}
1959
1960
1961/*** <<< CODE [PER-Visible-2] >>> ***/
1962
1963int
1964PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001965 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001966 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1967
1968 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001969 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001970 "%s: value not given (%s:%d)",
1971 td->name, __FILE__, __LINE__);
1972 return -1;
1973 }
1974
1975
1976 if(!check_permitted_alphabet_1(st)) {
1977 /* Constraint check succeeded */
1978 return 0;
1979 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001980 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001981 "%s: constraint failed (%s:%d)",
1982 td->name, __FILE__, __LINE__);
1983 return -1;
1984 }
1985}
1986
1987/*
1988 * This type is implemented using PER_Visible,
1989 * so here we adjust the DEF accordingly.
1990 */
1991static void
1992PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1993 td->free_struct = asn_DEF_PER_Visible.free_struct;
1994 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001995 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001996 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1997 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1998 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1999 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2000 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002001 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002002 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2003 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002004 if(!td->per_constraints)
2005 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2006 td->elements = asn_DEF_PER_Visible.elements;
2007 td->elements_count = asn_DEF_PER_Visible.elements_count;
2008 td->specifics = asn_DEF_PER_Visible.specifics;
2009}
2010
2011void
2012PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2013 void *struct_ptr, int contents_only) {
2014 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2015 td->free_struct(td, struct_ptr, contents_only);
2016}
2017
2018int
2019PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2020 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2021 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2022 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2023}
2024
2025asn_dec_rval_t
2026PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2027 void **structure, const void *bufptr, size_t size, int tag_mode) {
2028 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2029 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2030}
2031
2032asn_enc_rval_t
2033PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2034 void *structure, int tag_mode, ber_tlv_tag_t tag,
2035 asn_app_consume_bytes_f *cb, void *app_key) {
2036 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2037 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2038}
2039
2040asn_dec_rval_t
2041PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2042 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2043 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2044 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2045}
2046
2047asn_enc_rval_t
2048PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2049 int ilevel, enum xer_encoder_flags_e flags,
2050 asn_app_consume_bytes_f *cb, void *app_key) {
2051 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2052 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2053}
2054
2055asn_dec_rval_t
2056PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2057 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2058 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2059 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2060}
2061
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002062asn_enc_rval_t
2063PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2064 asn_per_constraints_t *constraints,
2065 void *structure, asn_per_outp_t *per_out) {
2066 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2067 return td->uper_encoder(td, constraints, structure, per_out);
2068}
2069
Lev Walkin59b176e2005-11-26 11:25:14 +00002070
Lev Walkin725883b2006-10-09 12:07:58 +00002071/*** <<< CTDEFS [PER-Visible-2] >>> ***/
2072
Lev Walkin2fce55d2013-03-28 05:00:39 -07002073static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002074 { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */,
2075 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2076 0, 0 /* No PER character map necessary */
2077};
2078
Lev Walkin59b176e2005-11-26 11:25:14 +00002079/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
2080
Lev Walkina7591b52014-10-12 18:37:35 -07002081static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002082 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2083};
Lev Walkin59b176e2005-11-26 11:25:14 +00002084asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
2085 "PER-Visible-2",
2086 "PER-Visible-2",
2087 PER_Visible_2_free,
2088 PER_Visible_2_print,
2089 PER_Visible_2_constraint,
2090 PER_Visible_2_decode_ber,
2091 PER_Visible_2_encode_der,
2092 PER_Visible_2_decode_xer,
2093 PER_Visible_2_encode_xer,
2094 PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002095 PER_Visible_2_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07002096 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002097 0, /* Use generic outmost tag fetcher */
2098 asn_DEF_PER_Visible_2_tags_1,
2099 sizeof(asn_DEF_PER_Visible_2_tags_1)
2100 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
2101 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
2102 sizeof(asn_DEF_PER_Visible_2_tags_1)
2103 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002104 &asn_PER_type_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002105 0, 0, /* No members */
2106 0 /* No specifics */
2107};
2108
2109
2110/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
2111
Lev Walkin22b5ed42006-09-13 02:51:20 +00002112#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002113
2114/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
2115
2116typedef PER_Visible_t Not_PER_Visible_1_t;
2117
2118/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
2119
2120extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
2121asn_struct_free_f Not_PER_Visible_1_free;
2122asn_struct_print_f Not_PER_Visible_1_print;
2123asn_constr_check_f Not_PER_Visible_1_constraint;
2124ber_type_decoder_f Not_PER_Visible_1_decode_ber;
2125der_type_encoder_f Not_PER_Visible_1_encode_der;
2126xer_type_decoder_f Not_PER_Visible_1_decode_xer;
2127xer_type_encoder_f Not_PER_Visible_1_encode_xer;
2128per_type_decoder_f Not_PER_Visible_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002129per_type_encoder_f Not_PER_Visible_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002130
2131/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
2132
2133static int check_permitted_alphabet_1(const void *sptr) {
2134 /* The underlying type is IA5String */
2135 const IA5String_t *st = (const IA5String_t *)sptr;
2136 const uint8_t *ch = st->buf;
2137 const uint8_t *end = ch + st->size;
2138
2139 for(; ch < end; ch++) {
2140 uint8_t cv = *ch;
2141 if(!(cv >= 65 && cv <= 70)) return -1;
2142 }
2143 return 0;
2144}
2145
2146
2147/*** <<< CODE [Not-PER-Visible-1] >>> ***/
2148
2149int
2150Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002151 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002152 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2153
2154 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002155 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002156 "%s: value not given (%s:%d)",
2157 td->name, __FILE__, __LINE__);
2158 return -1;
2159 }
2160
2161
2162 if(!check_permitted_alphabet_1(st)) {
2163 /* Constraint check succeeded */
2164 return 0;
2165 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002166 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002167 "%s: constraint failed (%s:%d)",
2168 td->name, __FILE__, __LINE__);
2169 return -1;
2170 }
2171}
2172
2173/*
2174 * This type is implemented using PER_Visible,
2175 * so here we adjust the DEF accordingly.
2176 */
2177static void
2178Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2179 td->free_struct = asn_DEF_PER_Visible.free_struct;
2180 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002181 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002182 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2183 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2184 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2185 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2186 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002187 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002188 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2189 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002190 if(!td->per_constraints)
2191 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2192 td->elements = asn_DEF_PER_Visible.elements;
2193 td->elements_count = asn_DEF_PER_Visible.elements_count;
2194 td->specifics = asn_DEF_PER_Visible.specifics;
2195}
2196
2197void
2198Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
2199 void *struct_ptr, int contents_only) {
2200 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2201 td->free_struct(td, struct_ptr, contents_only);
2202}
2203
2204int
2205Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2206 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2207 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2208 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2209}
2210
2211asn_dec_rval_t
2212Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2213 void **structure, const void *bufptr, size_t size, int tag_mode) {
2214 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2215 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2216}
2217
2218asn_enc_rval_t
2219Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
2220 void *structure, int tag_mode, ber_tlv_tag_t tag,
2221 asn_app_consume_bytes_f *cb, void *app_key) {
2222 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2223 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2224}
2225
2226asn_dec_rval_t
2227Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2228 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2229 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2230 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2231}
2232
2233asn_enc_rval_t
2234Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2235 int ilevel, enum xer_encoder_flags_e flags,
2236 asn_app_consume_bytes_f *cb, void *app_key) {
2237 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2238 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2239}
2240
2241asn_dec_rval_t
2242Not_PER_Visible_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2243 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2244 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2245 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2246}
2247
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002248asn_enc_rval_t
2249Not_PER_Visible_1_encode_uper(asn_TYPE_descriptor_t *td,
2250 asn_per_constraints_t *constraints,
2251 void *structure, asn_per_outp_t *per_out) {
2252 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2253 return td->uper_encoder(td, constraints, structure, per_out);
2254}
2255
Lev Walkin59b176e2005-11-26 11:25:14 +00002256
Lev Walkin725883b2006-10-09 12:07:58 +00002257/*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/
2258
Lev Walkin2fce55d2013-03-28 05:00:39 -07002259static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002260 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
2261 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2262 0, 0 /* No PER character map necessary */
2263};
2264
Lev Walkin59b176e2005-11-26 11:25:14 +00002265/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
2266
Lev Walkina7591b52014-10-12 18:37:35 -07002267static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002268 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2269};
Lev Walkin59b176e2005-11-26 11:25:14 +00002270asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
2271 "Not-PER-Visible-1",
2272 "Not-PER-Visible-1",
2273 Not_PER_Visible_1_free,
2274 Not_PER_Visible_1_print,
2275 Not_PER_Visible_1_constraint,
2276 Not_PER_Visible_1_decode_ber,
2277 Not_PER_Visible_1_encode_der,
2278 Not_PER_Visible_1_decode_xer,
2279 Not_PER_Visible_1_encode_xer,
2280 Not_PER_Visible_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002281 Not_PER_Visible_1_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07002282 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002283 0, /* Use generic outmost tag fetcher */
2284 asn_DEF_Not_PER_Visible_1_tags_1,
2285 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2286 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2287 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
2288 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2289 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002290 &asn_PER_type_Not_PER_Visible_1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002291 0, 0, /* No members */
2292 0 /* No specifics */
2293};
2294
2295
2296/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
2297
Lev Walkin22b5ed42006-09-13 02:51:20 +00002298#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002299
2300/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
2301
2302typedef PER_Visible_t Not_PER_Visible_2_t;
2303
2304/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
2305
2306extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
2307asn_struct_free_f Not_PER_Visible_2_free;
2308asn_struct_print_f Not_PER_Visible_2_print;
2309asn_constr_check_f Not_PER_Visible_2_constraint;
2310ber_type_decoder_f Not_PER_Visible_2_decode_ber;
2311der_type_encoder_f Not_PER_Visible_2_encode_der;
2312xer_type_decoder_f Not_PER_Visible_2_decode_xer;
2313xer_type_encoder_f Not_PER_Visible_2_encode_xer;
2314per_type_decoder_f Not_PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002315per_type_encoder_f Not_PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002316
2317/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
2318
2319static int check_permitted_alphabet_1(const void *sptr) {
2320 /* The underlying type is IA5String */
2321 const IA5String_t *st = (const IA5String_t *)sptr;
2322 const uint8_t *ch = st->buf;
2323 const uint8_t *end = ch + st->size;
2324
2325 for(; ch < end; ch++) {
2326 uint8_t cv = *ch;
2327 if(!(cv >= 65 && cv <= 66)) return -1;
2328 }
2329 return 0;
2330}
2331
2332
2333/*** <<< CODE [Not-PER-Visible-2] >>> ***/
2334
2335int
2336Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002337 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002338 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2339
2340 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002341 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002342 "%s: value not given (%s:%d)",
2343 td->name, __FILE__, __LINE__);
2344 return -1;
2345 }
2346
2347
2348 if(!check_permitted_alphabet_1(st)) {
2349 /* Constraint check succeeded */
2350 return 0;
2351 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002352 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002353 "%s: constraint failed (%s:%d)",
2354 td->name, __FILE__, __LINE__);
2355 return -1;
2356 }
2357}
2358
2359/*
2360 * This type is implemented using PER_Visible,
2361 * so here we adjust the DEF accordingly.
2362 */
2363static void
2364Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2365 td->free_struct = asn_DEF_PER_Visible.free_struct;
2366 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002367 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002368 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2369 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2370 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2371 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2372 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002373 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002374 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2375 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002376 if(!td->per_constraints)
2377 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2378 td->elements = asn_DEF_PER_Visible.elements;
2379 td->elements_count = asn_DEF_PER_Visible.elements_count;
2380 td->specifics = asn_DEF_PER_Visible.specifics;
2381}
2382
2383void
2384Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2385 void *struct_ptr, int contents_only) {
2386 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2387 td->free_struct(td, struct_ptr, contents_only);
2388}
2389
2390int
2391Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2392 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2393 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2394 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2395}
2396
2397asn_dec_rval_t
2398Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2399 void **structure, const void *bufptr, size_t size, int tag_mode) {
2400 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2401 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2402}
2403
2404asn_enc_rval_t
2405Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2406 void *structure, int tag_mode, ber_tlv_tag_t tag,
2407 asn_app_consume_bytes_f *cb, void *app_key) {
2408 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2409 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2410}
2411
2412asn_dec_rval_t
2413Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2414 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2415 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2416 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2417}
2418
2419asn_enc_rval_t
2420Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2421 int ilevel, enum xer_encoder_flags_e flags,
2422 asn_app_consume_bytes_f *cb, void *app_key) {
2423 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2424 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2425}
2426
2427asn_dec_rval_t
2428Not_PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2429 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2430 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2431 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2432}
2433
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002434asn_enc_rval_t
2435Not_PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2436 asn_per_constraints_t *constraints,
2437 void *structure, asn_per_outp_t *per_out) {
2438 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2439 return td->uper_encoder(td, constraints, structure, per_out);
2440}
2441
Lev Walkin59b176e2005-11-26 11:25:14 +00002442
Lev Walkin725883b2006-10-09 12:07:58 +00002443/*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/
2444
Lev Walkin2fce55d2013-03-28 05:00:39 -07002445static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002446 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2447 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2448 0, 0 /* No PER character map necessary */
2449};
2450
Lev Walkin59b176e2005-11-26 11:25:14 +00002451/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
2452
Lev Walkina7591b52014-10-12 18:37:35 -07002453static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002454 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2455};
Lev Walkin59b176e2005-11-26 11:25:14 +00002456asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
2457 "Not-PER-Visible-2",
2458 "Not-PER-Visible-2",
2459 Not_PER_Visible_2_free,
2460 Not_PER_Visible_2_print,
2461 Not_PER_Visible_2_constraint,
2462 Not_PER_Visible_2_decode_ber,
2463 Not_PER_Visible_2_encode_der,
2464 Not_PER_Visible_2_decode_xer,
2465 Not_PER_Visible_2_encode_xer,
2466 Not_PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002467 Not_PER_Visible_2_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07002468 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002469 0, /* Use generic outmost tag fetcher */
2470 asn_DEF_Not_PER_Visible_2_tags_1,
2471 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2472 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2473 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
2474 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2475 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002476 &asn_PER_type_Not_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002477 0, 0, /* No members */
2478 0 /* No specifics */
2479};
2480
2481
2482/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2483
Lev Walkin22b5ed42006-09-13 02:51:20 +00002484#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002485
2486/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2487
2488typedef PER_Visible_t Not_PER_Visible_3_t;
2489
2490/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2491
2492extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
2493asn_struct_free_f Not_PER_Visible_3_free;
2494asn_struct_print_f Not_PER_Visible_3_print;
2495asn_constr_check_f Not_PER_Visible_3_constraint;
2496ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2497der_type_encoder_f Not_PER_Visible_3_encode_der;
2498xer_type_decoder_f Not_PER_Visible_3_decode_xer;
2499xer_type_encoder_f Not_PER_Visible_3_encode_xer;
2500per_type_decoder_f Not_PER_Visible_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002501per_type_encoder_f Not_PER_Visible_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002502
2503/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2504
2505static int check_permitted_alphabet_1(const void *sptr) {
2506 /* The underlying type is IA5String */
2507 const IA5String_t *st = (const IA5String_t *)sptr;
2508 const uint8_t *ch = st->buf;
2509 const uint8_t *end = ch + st->size;
2510
2511 for(; ch < end; ch++) {
2512 uint8_t cv = *ch;
2513 if(!(cv >= 65 && cv <= 66)) return -1;
2514 }
2515 return 0;
2516}
2517
2518
2519/*** <<< CODE [Not-PER-Visible-3] >>> ***/
2520
2521int
2522Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002523 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002524 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2525
2526 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002527 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002528 "%s: value not given (%s:%d)",
2529 td->name, __FILE__, __LINE__);
2530 return -1;
2531 }
2532
2533
2534 if(!check_permitted_alphabet_1(st)) {
2535 /* Constraint check succeeded */
2536 return 0;
2537 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002538 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002539 "%s: constraint failed (%s:%d)",
2540 td->name, __FILE__, __LINE__);
2541 return -1;
2542 }
2543}
2544
2545/*
2546 * This type is implemented using PER_Visible,
2547 * so here we adjust the DEF accordingly.
2548 */
2549static void
2550Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2551 td->free_struct = asn_DEF_PER_Visible.free_struct;
2552 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002553 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002554 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2555 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2556 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2557 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2558 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002559 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002560 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2561 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002562 if(!td->per_constraints)
2563 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2564 td->elements = asn_DEF_PER_Visible.elements;
2565 td->elements_count = asn_DEF_PER_Visible.elements_count;
2566 td->specifics = asn_DEF_PER_Visible.specifics;
2567}
2568
2569void
2570Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
2571 void *struct_ptr, int contents_only) {
2572 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2573 td->free_struct(td, struct_ptr, contents_only);
2574}
2575
2576int
2577Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2578 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2579 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2580 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2581}
2582
2583asn_dec_rval_t
2584Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2585 void **structure, const void *bufptr, size_t size, int tag_mode) {
2586 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2587 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2588}
2589
2590asn_enc_rval_t
2591Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
2592 void *structure, int tag_mode, ber_tlv_tag_t tag,
2593 asn_app_consume_bytes_f *cb, void *app_key) {
2594 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2595 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2596}
2597
2598asn_dec_rval_t
2599Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2600 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2601 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2602 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2603}
2604
2605asn_enc_rval_t
2606Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2607 int ilevel, enum xer_encoder_flags_e flags,
2608 asn_app_consume_bytes_f *cb, void *app_key) {
2609 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2610 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2611}
2612
2613asn_dec_rval_t
2614Not_PER_Visible_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2615 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2616 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2617 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2618}
2619
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002620asn_enc_rval_t
2621Not_PER_Visible_3_encode_uper(asn_TYPE_descriptor_t *td,
2622 asn_per_constraints_t *constraints,
2623 void *structure, asn_per_outp_t *per_out) {
2624 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2625 return td->uper_encoder(td, constraints, structure, per_out);
2626}
2627
Lev Walkin59b176e2005-11-26 11:25:14 +00002628
Lev Walkin725883b2006-10-09 12:07:58 +00002629/*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/
2630
Lev Walkin2fce55d2013-03-28 05:00:39 -07002631static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002632 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2633 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2634 0, 0 /* No PER character map necessary */
2635};
2636
Lev Walkin59b176e2005-11-26 11:25:14 +00002637/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2638
Lev Walkina7591b52014-10-12 18:37:35 -07002639static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002640 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2641};
Lev Walkin59b176e2005-11-26 11:25:14 +00002642asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
2643 "Not-PER-Visible-3",
2644 "Not-PER-Visible-3",
2645 Not_PER_Visible_3_free,
2646 Not_PER_Visible_3_print,
2647 Not_PER_Visible_3_constraint,
2648 Not_PER_Visible_3_decode_ber,
2649 Not_PER_Visible_3_encode_der,
2650 Not_PER_Visible_3_decode_xer,
2651 Not_PER_Visible_3_encode_xer,
2652 Not_PER_Visible_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002653 Not_PER_Visible_3_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07002654 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002655 0, /* Use generic outmost tag fetcher */
2656 asn_DEF_Not_PER_Visible_3_tags_1,
2657 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2658 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2659 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
2660 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2661 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002662 &asn_PER_type_Not_PER_Visible_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002663 0, 0, /* No members */
2664 0 /* No specifics */
2665};
2666
2667
2668/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2669
Lev Walkin22b5ed42006-09-13 02:51:20 +00002670#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002671
2672/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2673
2674typedef PER_Visible_t SIZE_but_not_FROM_t;
2675
2676/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2677
2678extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
2679asn_struct_free_f SIZE_but_not_FROM_free;
2680asn_struct_print_f SIZE_but_not_FROM_print;
2681asn_constr_check_f SIZE_but_not_FROM_constraint;
2682ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2683der_type_encoder_f SIZE_but_not_FROM_encode_der;
2684xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
2685xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
2686per_type_decoder_f SIZE_but_not_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002687per_type_encoder_f SIZE_but_not_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002688
2689/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2690
2691static int check_permitted_alphabet_1(const void *sptr) {
2692 /* The underlying type is IA5String */
2693 const IA5String_t *st = (const IA5String_t *)sptr;
2694 const uint8_t *ch = st->buf;
2695 const uint8_t *end = ch + st->size;
2696
2697 for(; ch < end; ch++) {
2698 uint8_t cv = *ch;
2699 if(!(cv >= 65 && cv <= 68)) return -1;
2700 }
2701 return 0;
2702}
2703
2704
2705/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2706
2707int
2708SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002709 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002710 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2711 size_t size;
2712
2713 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002714 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002715 "%s: value not given (%s:%d)",
2716 td->name, __FILE__, __LINE__);
2717 return -1;
2718 }
2719
2720 size = st->size;
2721
2722 if((size >= 1 && size <= 4)
2723 && !check_permitted_alphabet_1(st)) {
2724 /* Constraint check succeeded */
2725 return 0;
2726 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002727 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002728 "%s: constraint failed (%s:%d)",
2729 td->name, __FILE__, __LINE__);
2730 return -1;
2731 }
2732}
2733
2734/*
2735 * This type is implemented using PER_Visible,
2736 * so here we adjust the DEF accordingly.
2737 */
2738static void
2739SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2740 td->free_struct = asn_DEF_PER_Visible.free_struct;
2741 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002742 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002743 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2744 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2745 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2746 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2747 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002748 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002749 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2750 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002751 if(!td->per_constraints)
2752 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2753 td->elements = asn_DEF_PER_Visible.elements;
2754 td->elements_count = asn_DEF_PER_Visible.elements_count;
2755 td->specifics = asn_DEF_PER_Visible.specifics;
2756}
2757
2758void
2759SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
2760 void *struct_ptr, int contents_only) {
2761 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2762 td->free_struct(td, struct_ptr, contents_only);
2763}
2764
2765int
2766SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2767 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2768 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2769 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2770}
2771
2772asn_dec_rval_t
2773SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2774 void **structure, const void *bufptr, size_t size, int tag_mode) {
2775 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2776 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2777}
2778
2779asn_enc_rval_t
2780SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
2781 void *structure, int tag_mode, ber_tlv_tag_t tag,
2782 asn_app_consume_bytes_f *cb, void *app_key) {
2783 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2784 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2785}
2786
2787asn_dec_rval_t
2788SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2789 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2790 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2791 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2792}
2793
2794asn_enc_rval_t
2795SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2796 int ilevel, enum xer_encoder_flags_e flags,
2797 asn_app_consume_bytes_f *cb, void *app_key) {
2798 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2799 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2800}
2801
2802asn_dec_rval_t
2803SIZE_but_not_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2804 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2805 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2806 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2807}
2808
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002809asn_enc_rval_t
2810SIZE_but_not_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2811 asn_per_constraints_t *constraints,
2812 void *structure, asn_per_outp_t *per_out) {
2813 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2814 return td->uper_encoder(td, constraints, structure, per_out);
2815}
2816
Lev Walkin59b176e2005-11-26 11:25:14 +00002817
Lev Walkin725883b2006-10-09 12:07:58 +00002818/*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/
2819
Lev Walkin2fce55d2013-03-28 05:00:39 -07002820static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002821 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2822 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
2823 0, 0 /* No PER character map necessary */
2824};
2825
Lev Walkin59b176e2005-11-26 11:25:14 +00002826/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2827
Lev Walkina7591b52014-10-12 18:37:35 -07002828static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002829 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2830};
Lev Walkin59b176e2005-11-26 11:25:14 +00002831asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
2832 "SIZE-but-not-FROM",
2833 "SIZE-but-not-FROM",
2834 SIZE_but_not_FROM_free,
2835 SIZE_but_not_FROM_print,
2836 SIZE_but_not_FROM_constraint,
2837 SIZE_but_not_FROM_decode_ber,
2838 SIZE_but_not_FROM_encode_der,
2839 SIZE_but_not_FROM_decode_xer,
2840 SIZE_but_not_FROM_encode_xer,
2841 SIZE_but_not_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002842 SIZE_but_not_FROM_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07002843 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00002844 0, /* Use generic outmost tag fetcher */
2845 asn_DEF_SIZE_but_not_FROM_tags_1,
2846 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2847 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2848 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
2849 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2850 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002851 &asn_PER_type_SIZE_but_not_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002852 0, 0, /* No members */
2853 0 /* No specifics */
2854};
2855
2856
2857/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2858
Lev Walkin22b5ed42006-09-13 02:51:20 +00002859#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002860
2861/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2862
2863typedef PER_Visible_t SIZE_and_FROM_t;
2864
2865/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2866
2867extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
2868asn_struct_free_f SIZE_and_FROM_free;
2869asn_struct_print_f SIZE_and_FROM_print;
2870asn_constr_check_f SIZE_and_FROM_constraint;
2871ber_type_decoder_f SIZE_and_FROM_decode_ber;
2872der_type_encoder_f SIZE_and_FROM_encode_der;
2873xer_type_decoder_f SIZE_and_FROM_decode_xer;
2874xer_type_encoder_f SIZE_and_FROM_encode_xer;
2875per_type_decoder_f SIZE_and_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002876per_type_encoder_f SIZE_and_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002877
2878/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2879
2880static int check_permitted_alphabet_1(const void *sptr) {
2881 /* The underlying type is IA5String */
2882 const IA5String_t *st = (const IA5String_t *)sptr;
2883 const uint8_t *ch = st->buf;
2884 const uint8_t *end = ch + st->size;
2885
2886 for(; ch < end; ch++) {
2887 uint8_t cv = *ch;
2888 if(!(cv >= 65 && cv <= 68)) return -1;
2889 }
2890 return 0;
2891}
2892
2893
2894/*** <<< CODE [SIZE-and-FROM] >>> ***/
2895
2896int
2897SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002898 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002899 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2900 size_t size;
2901
2902 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002903 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002904 "%s: value not given (%s:%d)",
2905 td->name, __FILE__, __LINE__);
2906 return -1;
2907 }
2908
2909 size = st->size;
2910
2911 if((size >= 1 && size <= 4)
2912 && !check_permitted_alphabet_1(st)) {
2913 /* Constraint check succeeded */
2914 return 0;
2915 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002916 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002917 "%s: constraint failed (%s:%d)",
2918 td->name, __FILE__, __LINE__);
2919 return -1;
2920 }
2921}
2922
2923/*
2924 * This type is implemented using PER_Visible,
2925 * so here we adjust the DEF accordingly.
2926 */
2927static void
2928SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2929 td->free_struct = asn_DEF_PER_Visible.free_struct;
2930 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002931 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002932 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2933 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2934 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2935 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2936 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002937 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07002938 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
2939 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002940 if(!td->per_constraints)
2941 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2942 td->elements = asn_DEF_PER_Visible.elements;
2943 td->elements_count = asn_DEF_PER_Visible.elements_count;
2944 td->specifics = asn_DEF_PER_Visible.specifics;
2945}
2946
2947void
2948SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
2949 void *struct_ptr, int contents_only) {
2950 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2951 td->free_struct(td, struct_ptr, contents_only);
2952}
2953
2954int
2955SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2956 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2957 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2958 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2959}
2960
2961asn_dec_rval_t
2962SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2963 void **structure, const void *bufptr, size_t size, int tag_mode) {
2964 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2965 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2966}
2967
2968asn_enc_rval_t
2969SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
2970 void *structure, int tag_mode, ber_tlv_tag_t tag,
2971 asn_app_consume_bytes_f *cb, void *app_key) {
2972 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2973 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2974}
2975
2976asn_dec_rval_t
2977SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2978 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2979 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2980 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2981}
2982
2983asn_enc_rval_t
2984SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2985 int ilevel, enum xer_encoder_flags_e flags,
2986 asn_app_consume_bytes_f *cb, void *app_key) {
2987 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2988 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2989}
2990
2991asn_dec_rval_t
2992SIZE_and_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2993 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2994 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2995 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2996}
2997
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002998asn_enc_rval_t
2999SIZE_and_FROM_encode_uper(asn_TYPE_descriptor_t *td,
3000 asn_per_constraints_t *constraints,
3001 void *structure, asn_per_outp_t *per_out) {
3002 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
3003 return td->uper_encoder(td, constraints, structure, per_out);
3004}
3005
Lev Walkin59b176e2005-11-26 11:25:14 +00003006
Lev Walkin725883b2006-10-09 12:07:58 +00003007/*** <<< CTDEFS [SIZE-and-FROM] >>> ***/
3008
Lev Walkin2fce55d2013-03-28 05:00:39 -07003009static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003010 { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */,
3011 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
3012 0, 0 /* No PER character map necessary */
3013};
3014
Lev Walkin59b176e2005-11-26 11:25:14 +00003015/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
3016
Lev Walkina7591b52014-10-12 18:37:35 -07003017static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003018 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
3019};
Lev Walkin59b176e2005-11-26 11:25:14 +00003020asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
3021 "SIZE-and-FROM",
3022 "SIZE-and-FROM",
3023 SIZE_and_FROM_free,
3024 SIZE_and_FROM_print,
3025 SIZE_and_FROM_constraint,
3026 SIZE_and_FROM_decode_ber,
3027 SIZE_and_FROM_encode_der,
3028 SIZE_and_FROM_decode_xer,
3029 SIZE_and_FROM_encode_xer,
3030 SIZE_and_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003031 SIZE_and_FROM_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07003032 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003033 0, /* Use generic outmost tag fetcher */
3034 asn_DEF_SIZE_and_FROM_tags_1,
3035 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
3036 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
3037 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
3038 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
3039 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003040 &asn_PER_type_SIZE_and_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003041 0, 0, /* No members */
3042 0 /* No specifics */
3043};
3044
3045
3046/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
3047
Lev Walkin22b5ed42006-09-13 02:51:20 +00003048#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003049
3050/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
3051
3052typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
3053
3054/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
3055
3056extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
3057asn_struct_free_f Neither_SIZE_nor_FROM_free;
3058asn_struct_print_f Neither_SIZE_nor_FROM_print;
3059asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
3060ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
3061der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
3062xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
3063xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
3064per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003065per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003066
3067/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
3068
3069static int check_permitted_alphabet_1(const void *sptr) {
3070 /* The underlying type is IA5String */
3071 const IA5String_t *st = (const IA5String_t *)sptr;
3072 const uint8_t *ch = st->buf;
3073 const uint8_t *end = ch + st->size;
3074
3075 for(; ch < end; ch++) {
3076 uint8_t cv = *ch;
3077 if(!(cv >= 65 && cv <= 70)) return -1;
3078 }
3079 return 0;
3080}
3081
3082
3083/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
3084
3085int
3086Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003087 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003088 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
3089
3090 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003091 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003092 "%s: value not given (%s:%d)",
3093 td->name, __FILE__, __LINE__);
3094 return -1;
3095 }
3096
3097
3098 if(!check_permitted_alphabet_1(st)) {
3099 /* Constraint check succeeded */
3100 return 0;
3101 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003102 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003103 "%s: constraint failed (%s:%d)",
3104 td->name, __FILE__, __LINE__);
3105 return -1;
3106 }
3107}
3108
3109/*
3110 * This type is implemented using PER_Visible,
3111 * so here we adjust the DEF accordingly.
3112 */
3113static void
3114Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3115 td->free_struct = asn_DEF_PER_Visible.free_struct;
3116 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003117 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003118 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
3119 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
3120 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
3121 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
3122 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003123 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003124 td->oer_decoder = asn_DEF_PER_Visible.oer_decoder;
3125 td->oer_encoder = asn_DEF_PER_Visible.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003126 if(!td->per_constraints)
3127 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
3128 td->elements = asn_DEF_PER_Visible.elements;
3129 td->elements_count = asn_DEF_PER_Visible.elements_count;
3130 td->specifics = asn_DEF_PER_Visible.specifics;
3131}
3132
3133void
3134Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
3135 void *struct_ptr, int contents_only) {
3136 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3137 td->free_struct(td, struct_ptr, contents_only);
3138}
3139
3140int
3141Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3142 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3143 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3144 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3145}
3146
3147asn_dec_rval_t
3148Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3149 void **structure, const void *bufptr, size_t size, int tag_mode) {
3150 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3151 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3152}
3153
3154asn_enc_rval_t
3155Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
3156 void *structure, int tag_mode, ber_tlv_tag_t tag,
3157 asn_app_consume_bytes_f *cb, void *app_key) {
3158 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3159 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3160}
3161
3162asn_dec_rval_t
3163Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3164 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3165 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3166 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3167}
3168
3169asn_enc_rval_t
3170Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3171 int ilevel, enum xer_encoder_flags_e flags,
3172 asn_app_consume_bytes_f *cb, void *app_key) {
3173 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3174 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3175}
3176
3177asn_dec_rval_t
3178Neither_SIZE_nor_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3179 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3180 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3181 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3182}
3183
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003184asn_enc_rval_t
3185Neither_SIZE_nor_FROM_encode_uper(asn_TYPE_descriptor_t *td,
3186 asn_per_constraints_t *constraints,
3187 void *structure, asn_per_outp_t *per_out) {
3188 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3189 return td->uper_encoder(td, constraints, structure, per_out);
3190}
3191
Lev Walkin59b176e2005-11-26 11:25:14 +00003192
Lev Walkin725883b2006-10-09 12:07:58 +00003193/*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/
3194
Lev Walkin2fce55d2013-03-28 05:00:39 -07003195static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003196 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
3197 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
3198 0, 0 /* No PER character map necessary */
3199};
3200
Lev Walkin59b176e2005-11-26 11:25:14 +00003201/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
3202
Lev Walkina7591b52014-10-12 18:37:35 -07003203static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003204 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
3205};
Lev Walkin59b176e2005-11-26 11:25:14 +00003206asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
3207 "Neither-SIZE-nor-FROM",
3208 "Neither-SIZE-nor-FROM",
3209 Neither_SIZE_nor_FROM_free,
3210 Neither_SIZE_nor_FROM_print,
3211 Neither_SIZE_nor_FROM_constraint,
3212 Neither_SIZE_nor_FROM_decode_ber,
3213 Neither_SIZE_nor_FROM_encode_der,
3214 Neither_SIZE_nor_FROM_decode_xer,
3215 Neither_SIZE_nor_FROM_encode_xer,
3216 Neither_SIZE_nor_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003217 Neither_SIZE_nor_FROM_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07003218 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003219 0, /* Use generic outmost tag fetcher */
3220 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
3221 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3222 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
3223 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
3224 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3225 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003226 &asn_PER_type_Neither_SIZE_nor_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003227 0, 0, /* No members */
3228 0 /* No specifics */
3229};
3230
3231
3232/*** <<< INCLUDES [Utf8-4] >>> ***/
3233
3234#include <UTF8String.h>
3235
3236/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
3237
3238typedef UTF8String_t Utf8_4_t;
3239
3240/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
3241
3242extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
3243asn_struct_free_f Utf8_4_free;
3244asn_struct_print_f Utf8_4_print;
3245asn_constr_check_f Utf8_4_constraint;
3246ber_type_decoder_f Utf8_4_decode_ber;
3247der_type_encoder_f Utf8_4_encode_der;
3248xer_type_decoder_f Utf8_4_decode_xer;
3249xer_type_encoder_f Utf8_4_encode_xer;
3250per_type_decoder_f Utf8_4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003251per_type_encoder_f Utf8_4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003252
3253/*** <<< CTABLES [Utf8-4] >>> ***/
3254
3255static int check_permitted_alphabet_1(const void *sptr) {
3256 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
3257 return -1; /* Alphabet (sic!) test failed. */
3258
3259 return 0;
3260}
3261
3262
3263/*** <<< CODE [Utf8-4] >>> ***/
3264
3265int
3266Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003267 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003268 const UTF8String_t *st = (const UTF8String_t *)sptr;
3269
3270 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003271 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003272 "%s: value not given (%s:%d)",
3273 td->name, __FILE__, __LINE__);
3274 return -1;
3275 }
3276
3277
3278 if(!check_permitted_alphabet_1(st)) {
3279 /* Constraint check succeeded */
3280 return 0;
3281 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003282 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003283 "%s: constraint failed (%s:%d)",
3284 td->name, __FILE__, __LINE__);
3285 return -1;
3286 }
3287}
3288
3289/*
3290 * This type is implemented using UTF8String,
3291 * so here we adjust the DEF accordingly.
3292 */
3293static void
3294Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3295 td->free_struct = asn_DEF_UTF8String.free_struct;
3296 td->print_struct = asn_DEF_UTF8String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003297 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003298 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3299 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3300 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3301 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3302 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003303 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003304 td->oer_decoder = asn_DEF_UTF8String.oer_decoder;
3305 td->oer_encoder = asn_DEF_UTF8String.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003306 if(!td->per_constraints)
3307 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3308 td->elements = asn_DEF_UTF8String.elements;
3309 td->elements_count = asn_DEF_UTF8String.elements_count;
3310 td->specifics = asn_DEF_UTF8String.specifics;
3311}
3312
3313void
3314Utf8_4_free(asn_TYPE_descriptor_t *td,
3315 void *struct_ptr, int contents_only) {
3316 Utf8_4_1_inherit_TYPE_descriptor(td);
3317 td->free_struct(td, struct_ptr, contents_only);
3318}
3319
3320int
3321Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3322 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3323 Utf8_4_1_inherit_TYPE_descriptor(td);
3324 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3325}
3326
3327asn_dec_rval_t
3328Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3329 void **structure, const void *bufptr, size_t size, int tag_mode) {
3330 Utf8_4_1_inherit_TYPE_descriptor(td);
3331 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3332}
3333
3334asn_enc_rval_t
3335Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
3336 void *structure, int tag_mode, ber_tlv_tag_t tag,
3337 asn_app_consume_bytes_f *cb, void *app_key) {
3338 Utf8_4_1_inherit_TYPE_descriptor(td);
3339 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3340}
3341
3342asn_dec_rval_t
3343Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3344 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3345 Utf8_4_1_inherit_TYPE_descriptor(td);
3346 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3347}
3348
3349asn_enc_rval_t
3350Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3351 int ilevel, enum xer_encoder_flags_e flags,
3352 asn_app_consume_bytes_f *cb, void *app_key) {
3353 Utf8_4_1_inherit_TYPE_descriptor(td);
3354 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3355}
3356
3357asn_dec_rval_t
3358Utf8_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3359 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3360 Utf8_4_1_inherit_TYPE_descriptor(td);
3361 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3362}
3363
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003364asn_enc_rval_t
3365Utf8_4_encode_uper(asn_TYPE_descriptor_t *td,
3366 asn_per_constraints_t *constraints,
3367 void *structure, asn_per_outp_t *per_out) {
3368 Utf8_4_1_inherit_TYPE_descriptor(td);
3369 return td->uper_encoder(td, constraints, structure, per_out);
3370}
3371
Lev Walkin59b176e2005-11-26 11:25:14 +00003372
Lev Walkin725883b2006-10-09 12:07:58 +00003373/*** <<< CTDEFS [Utf8-4] >>> ***/
3374
Lev Walkin2fce55d2013-03-28 05:00:39 -07003375static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003376 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3377 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3378 0, 0 /* No PER value map */
3379};
3380
Lev Walkin59b176e2005-11-26 11:25:14 +00003381/*** <<< STAT-DEFS [Utf8-4] >>> ***/
3382
Lev Walkina7591b52014-10-12 18:37:35 -07003383static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003384 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3385};
Lev Walkin59b176e2005-11-26 11:25:14 +00003386asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
3387 "Utf8-4",
3388 "Utf8-4",
3389 Utf8_4_free,
3390 Utf8_4_print,
3391 Utf8_4_constraint,
3392 Utf8_4_decode_ber,
3393 Utf8_4_encode_der,
3394 Utf8_4_decode_xer,
3395 Utf8_4_encode_xer,
3396 Utf8_4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003397 Utf8_4_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07003398 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003399 0, /* Use generic outmost tag fetcher */
3400 asn_DEF_Utf8_4_tags_1,
3401 sizeof(asn_DEF_Utf8_4_tags_1)
3402 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
3403 asn_DEF_Utf8_4_tags_1, /* Same as above */
3404 sizeof(asn_DEF_Utf8_4_tags_1)
3405 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003406 &asn_PER_type_Utf8_4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003407 0, 0, /* No members */
3408 0 /* No specifics */
3409};
3410
3411
3412/*** <<< INCLUDES [Utf8-3] >>> ***/
3413
Lev Walkin22b5ed42006-09-13 02:51:20 +00003414#include "Utf8-2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003415
3416/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
3417
3418typedef Utf8_2_t Utf8_3_t;
3419
3420/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
3421
3422extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
3423asn_struct_free_f Utf8_3_free;
3424asn_struct_print_f Utf8_3_print;
3425asn_constr_check_f Utf8_3_constraint;
3426ber_type_decoder_f Utf8_3_decode_ber;
3427der_type_encoder_f Utf8_3_encode_der;
3428xer_type_decoder_f Utf8_3_decode_xer;
3429xer_type_encoder_f Utf8_3_encode_xer;
3430per_type_decoder_f Utf8_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003431per_type_encoder_f Utf8_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003432
3433/*** <<< CTABLES [Utf8-3] >>> ***/
3434
Lev Walkina7591b52014-10-12 18:37:35 -07003435static const int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003436 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3437 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3438 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3439 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3440 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
344116,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
3442 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
344342,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003444};
3445
3446static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07003447 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00003448 /* The underlying type is UTF8String */
3449 const UTF8String_t *st = (const UTF8String_t *)sptr;
3450 const uint8_t *ch = st->buf;
3451 const uint8_t *end = ch + st->size;
3452
3453 for(; ch < end; ch++) {
3454 uint8_t cv = *ch;
3455 if(cv >= 0x80) return -1;
3456 if(!table[cv]) return -1;
3457 }
3458 return 0;
3459}
3460
3461
3462/*** <<< CODE [Utf8-3] >>> ***/
3463
3464int
3465Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003466 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003467 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
3468 size_t size;
3469
3470 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003471 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003472 "%s: value not given (%s:%d)",
3473 td->name, __FILE__, __LINE__);
3474 return -1;
3475 }
3476
3477 size = UTF8String_length(st);
3478 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003479 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003480 "%s: UTF-8: broken encoding (%s:%d)",
3481 td->name, __FILE__, __LINE__);
3482 return -1;
3483 }
3484
3485 if((size >= 1 && size <= 2)
3486 && !check_permitted_alphabet_1(st)) {
3487 /* Constraint check succeeded */
3488 return 0;
3489 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003490 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003491 "%s: constraint failed (%s:%d)",
3492 td->name, __FILE__, __LINE__);
3493 return -1;
3494 }
3495}
3496
3497/*
3498 * This type is implemented using Utf8_2,
3499 * so here we adjust the DEF accordingly.
3500 */
3501static void
3502Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3503 td->free_struct = asn_DEF_Utf8_2.free_struct;
3504 td->print_struct = asn_DEF_Utf8_2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003505 td->check_constraints = asn_DEF_Utf8_2.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003506 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
3507 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
3508 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
3509 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
3510 td->uper_decoder = asn_DEF_Utf8_2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003511 td->uper_encoder = asn_DEF_Utf8_2.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003512 td->oer_decoder = asn_DEF_Utf8_2.oer_decoder;
3513 td->oer_encoder = asn_DEF_Utf8_2.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003514 if(!td->per_constraints)
3515 td->per_constraints = asn_DEF_Utf8_2.per_constraints;
3516 td->elements = asn_DEF_Utf8_2.elements;
3517 td->elements_count = asn_DEF_Utf8_2.elements_count;
3518 td->specifics = asn_DEF_Utf8_2.specifics;
3519}
3520
3521void
3522Utf8_3_free(asn_TYPE_descriptor_t *td,
3523 void *struct_ptr, int contents_only) {
3524 Utf8_3_1_inherit_TYPE_descriptor(td);
3525 td->free_struct(td, struct_ptr, contents_only);
3526}
3527
3528int
3529Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3530 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3531 Utf8_3_1_inherit_TYPE_descriptor(td);
3532 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3533}
3534
3535asn_dec_rval_t
3536Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3537 void **structure, const void *bufptr, size_t size, int tag_mode) {
3538 Utf8_3_1_inherit_TYPE_descriptor(td);
3539 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3540}
3541
3542asn_enc_rval_t
3543Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
3544 void *structure, int tag_mode, ber_tlv_tag_t tag,
3545 asn_app_consume_bytes_f *cb, void *app_key) {
3546 Utf8_3_1_inherit_TYPE_descriptor(td);
3547 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3548}
3549
3550asn_dec_rval_t
3551Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3552 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3553 Utf8_3_1_inherit_TYPE_descriptor(td);
3554 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3555}
3556
3557asn_enc_rval_t
3558Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3559 int ilevel, enum xer_encoder_flags_e flags,
3560 asn_app_consume_bytes_f *cb, void *app_key) {
3561 Utf8_3_1_inherit_TYPE_descriptor(td);
3562 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3563}
3564
3565asn_dec_rval_t
3566Utf8_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3567 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3568 Utf8_3_1_inherit_TYPE_descriptor(td);
3569 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3570}
3571
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003572asn_enc_rval_t
3573Utf8_3_encode_uper(asn_TYPE_descriptor_t *td,
3574 asn_per_constraints_t *constraints,
3575 void *structure, asn_per_outp_t *per_out) {
3576 Utf8_3_1_inherit_TYPE_descriptor(td);
3577 return td->uper_encoder(td, constraints, structure, per_out);
3578}
3579
Lev Walkin59b176e2005-11-26 11:25:14 +00003580
Lev Walkin725883b2006-10-09 12:07:58 +00003581/*** <<< CTDEFS [Utf8-3] >>> ***/
3582
Lev Walkin2fce55d2013-03-28 05:00:39 -07003583static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003584 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3585 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3586 0, 0 /* No PER value map */
3587};
3588
Lev Walkin59b176e2005-11-26 11:25:14 +00003589/*** <<< STAT-DEFS [Utf8-3] >>> ***/
3590
Lev Walkina7591b52014-10-12 18:37:35 -07003591static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003592 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3593};
Lev Walkin59b176e2005-11-26 11:25:14 +00003594asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
3595 "Utf8-3",
3596 "Utf8-3",
3597 Utf8_3_free,
3598 Utf8_3_print,
3599 Utf8_3_constraint,
3600 Utf8_3_decode_ber,
3601 Utf8_3_encode_der,
3602 Utf8_3_decode_xer,
3603 Utf8_3_encode_xer,
3604 Utf8_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003605 Utf8_3_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07003606 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003607 0, /* Use generic outmost tag fetcher */
3608 asn_DEF_Utf8_3_tags_1,
3609 sizeof(asn_DEF_Utf8_3_tags_1)
3610 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3611 asn_DEF_Utf8_3_tags_1, /* Same as above */
3612 sizeof(asn_DEF_Utf8_3_tags_1)
3613 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003614 &asn_PER_type_Utf8_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003615 0, 0, /* No members */
3616 0 /* No specifics */
3617};
3618
3619
3620/*** <<< INCLUDES [Utf8-2] >>> ***/
3621
Lev Walkin22b5ed42006-09-13 02:51:20 +00003622#include "Utf8-1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003623
3624/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
3625
3626typedef Utf8_1_t Utf8_2_t;
3627
3628/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
3629
3630extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
3631asn_struct_free_f Utf8_2_free;
3632asn_struct_print_f Utf8_2_print;
3633asn_constr_check_f Utf8_2_constraint;
3634ber_type_decoder_f Utf8_2_decode_ber;
3635der_type_encoder_f Utf8_2_encode_der;
3636xer_type_decoder_f Utf8_2_decode_xer;
3637xer_type_encoder_f Utf8_2_encode_xer;
3638per_type_decoder_f Utf8_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003639per_type_encoder_f Utf8_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003640
3641/*** <<< CODE [Utf8-2] >>> ***/
3642
3643int
3644Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003645 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003646 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
3647 size_t size;
3648
3649 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003650 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003651 "%s: value not given (%s:%d)",
3652 td->name, __FILE__, __LINE__);
3653 return -1;
3654 }
3655
3656 size = UTF8String_length(st);
3657 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003658 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003659 "%s: UTF-8: broken encoding (%s:%d)",
3660 td->name, __FILE__, __LINE__);
3661 return -1;
3662 }
3663
3664 if((size >= 1 && size <= 2)) {
3665 /* Constraint check succeeded */
3666 return 0;
3667 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003668 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003669 "%s: constraint failed (%s:%d)",
3670 td->name, __FILE__, __LINE__);
3671 return -1;
3672 }
3673}
3674
3675/*
3676 * This type is implemented using Utf8_1,
3677 * so here we adjust the DEF accordingly.
3678 */
3679static void
3680Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3681 td->free_struct = asn_DEF_Utf8_1.free_struct;
3682 td->print_struct = asn_DEF_Utf8_1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003683 td->check_constraints = asn_DEF_Utf8_1.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003684 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
3685 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
3686 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
3687 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
3688 td->uper_decoder = asn_DEF_Utf8_1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003689 td->uper_encoder = asn_DEF_Utf8_1.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003690 td->oer_decoder = asn_DEF_Utf8_1.oer_decoder;
3691 td->oer_encoder = asn_DEF_Utf8_1.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003692 if(!td->per_constraints)
3693 td->per_constraints = asn_DEF_Utf8_1.per_constraints;
3694 td->elements = asn_DEF_Utf8_1.elements;
3695 td->elements_count = asn_DEF_Utf8_1.elements_count;
3696 td->specifics = asn_DEF_Utf8_1.specifics;
3697}
3698
3699void
3700Utf8_2_free(asn_TYPE_descriptor_t *td,
3701 void *struct_ptr, int contents_only) {
3702 Utf8_2_1_inherit_TYPE_descriptor(td);
3703 td->free_struct(td, struct_ptr, contents_only);
3704}
3705
3706int
3707Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3708 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3709 Utf8_2_1_inherit_TYPE_descriptor(td);
3710 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3711}
3712
3713asn_dec_rval_t
3714Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3715 void **structure, const void *bufptr, size_t size, int tag_mode) {
3716 Utf8_2_1_inherit_TYPE_descriptor(td);
3717 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3718}
3719
3720asn_enc_rval_t
3721Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
3722 void *structure, int tag_mode, ber_tlv_tag_t tag,
3723 asn_app_consume_bytes_f *cb, void *app_key) {
3724 Utf8_2_1_inherit_TYPE_descriptor(td);
3725 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3726}
3727
3728asn_dec_rval_t
3729Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3730 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3731 Utf8_2_1_inherit_TYPE_descriptor(td);
3732 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3733}
3734
3735asn_enc_rval_t
3736Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3737 int ilevel, enum xer_encoder_flags_e flags,
3738 asn_app_consume_bytes_f *cb, void *app_key) {
3739 Utf8_2_1_inherit_TYPE_descriptor(td);
3740 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3741}
3742
3743asn_dec_rval_t
3744Utf8_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3745 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3746 Utf8_2_1_inherit_TYPE_descriptor(td);
3747 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3748}
3749
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003750asn_enc_rval_t
3751Utf8_2_encode_uper(asn_TYPE_descriptor_t *td,
3752 asn_per_constraints_t *constraints,
3753 void *structure, asn_per_outp_t *per_out) {
3754 Utf8_2_1_inherit_TYPE_descriptor(td);
3755 return td->uper_encoder(td, constraints, structure, per_out);
3756}
3757
Lev Walkin59b176e2005-11-26 11:25:14 +00003758
Lev Walkin725883b2006-10-09 12:07:58 +00003759/*** <<< CTDEFS [Utf8-2] >>> ***/
3760
Lev Walkin2fce55d2013-03-28 05:00:39 -07003761static asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003762 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3763 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3764 0, 0 /* No PER value map */
3765};
3766
Lev Walkin59b176e2005-11-26 11:25:14 +00003767/*** <<< STAT-DEFS [Utf8-2] >>> ***/
3768
Lev Walkina7591b52014-10-12 18:37:35 -07003769static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003770 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3771};
Lev Walkin59b176e2005-11-26 11:25:14 +00003772asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
3773 "Utf8-2",
3774 "Utf8-2",
3775 Utf8_2_free,
3776 Utf8_2_print,
3777 Utf8_2_constraint,
3778 Utf8_2_decode_ber,
3779 Utf8_2_encode_der,
3780 Utf8_2_decode_xer,
3781 Utf8_2_encode_xer,
3782 Utf8_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003783 Utf8_2_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07003784 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003785 0, /* Use generic outmost tag fetcher */
3786 asn_DEF_Utf8_2_tags_1,
3787 sizeof(asn_DEF_Utf8_2_tags_1)
3788 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3789 asn_DEF_Utf8_2_tags_1, /* Same as above */
3790 sizeof(asn_DEF_Utf8_2_tags_1)
3791 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003792 &asn_PER_type_Utf8_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003793 0, 0, /* No members */
3794 0 /* No specifics */
3795};
3796
3797
3798/*** <<< INCLUDES [Utf8-1] >>> ***/
3799
3800#include <UTF8String.h>
3801
3802/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3803
3804typedef UTF8String_t Utf8_1_t;
3805
3806/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3807
3808extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3809asn_struct_free_f Utf8_1_free;
3810asn_struct_print_f Utf8_1_print;
3811asn_constr_check_f Utf8_1_constraint;
3812ber_type_decoder_f Utf8_1_decode_ber;
3813der_type_encoder_f Utf8_1_encode_der;
3814xer_type_decoder_f Utf8_1_decode_xer;
3815xer_type_encoder_f Utf8_1_encode_xer;
3816per_type_decoder_f Utf8_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003817per_type_encoder_f Utf8_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003818
3819/*** <<< CODE [Utf8-1] >>> ***/
3820
3821int
3822Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003823 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003824 /* Replace with underlying type checker */
3825 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00003826 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00003827}
3828
3829/*
3830 * This type is implemented using UTF8String,
3831 * so here we adjust the DEF accordingly.
3832 */
3833static void
3834Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3835 td->free_struct = asn_DEF_UTF8String.free_struct;
3836 td->print_struct = asn_DEF_UTF8String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003837 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003838 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3839 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3840 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3841 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3842 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003843 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07003844 td->oer_decoder = asn_DEF_UTF8String.oer_decoder;
3845 td->oer_encoder = asn_DEF_UTF8String.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003846 if(!td->per_constraints)
3847 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3848 td->elements = asn_DEF_UTF8String.elements;
3849 td->elements_count = asn_DEF_UTF8String.elements_count;
3850 td->specifics = asn_DEF_UTF8String.specifics;
3851}
3852
3853void
3854Utf8_1_free(asn_TYPE_descriptor_t *td,
3855 void *struct_ptr, int contents_only) {
3856 Utf8_1_1_inherit_TYPE_descriptor(td);
3857 td->free_struct(td, struct_ptr, contents_only);
3858}
3859
3860int
3861Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3862 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3863 Utf8_1_1_inherit_TYPE_descriptor(td);
3864 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3865}
3866
3867asn_dec_rval_t
3868Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3869 void **structure, const void *bufptr, size_t size, int tag_mode) {
3870 Utf8_1_1_inherit_TYPE_descriptor(td);
3871 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3872}
3873
3874asn_enc_rval_t
3875Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3876 void *structure, int tag_mode, ber_tlv_tag_t tag,
3877 asn_app_consume_bytes_f *cb, void *app_key) {
3878 Utf8_1_1_inherit_TYPE_descriptor(td);
3879 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3880}
3881
3882asn_dec_rval_t
3883Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3884 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3885 Utf8_1_1_inherit_TYPE_descriptor(td);
3886 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3887}
3888
3889asn_enc_rval_t
3890Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3891 int ilevel, enum xer_encoder_flags_e flags,
3892 asn_app_consume_bytes_f *cb, void *app_key) {
3893 Utf8_1_1_inherit_TYPE_descriptor(td);
3894 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3895}
3896
3897asn_dec_rval_t
3898Utf8_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3899 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3900 Utf8_1_1_inherit_TYPE_descriptor(td);
3901 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3902}
3903
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003904asn_enc_rval_t
3905Utf8_1_encode_uper(asn_TYPE_descriptor_t *td,
3906 asn_per_constraints_t *constraints,
3907 void *structure, asn_per_outp_t *per_out) {
3908 Utf8_1_1_inherit_TYPE_descriptor(td);
3909 return td->uper_encoder(td, constraints, structure, per_out);
3910}
3911
Lev Walkin59b176e2005-11-26 11:25:14 +00003912
3913/*** <<< STAT-DEFS [Utf8-1] >>> ***/
3914
Lev Walkina7591b52014-10-12 18:37:35 -07003915static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003916 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3917};
3918asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3919 "Utf8-1",
3920 "Utf8-1",
3921 Utf8_1_free,
3922 Utf8_1_print,
3923 Utf8_1_constraint,
3924 Utf8_1_decode_ber,
3925 Utf8_1_encode_der,
3926 Utf8_1_decode_xer,
3927 Utf8_1_encode_xer,
3928 Utf8_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003929 Utf8_1_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07003930 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00003931 0, /* Use generic outmost tag fetcher */
3932 asn_DEF_Utf8_1_tags_1,
3933 sizeof(asn_DEF_Utf8_1_tags_1)
3934 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3935 asn_DEF_Utf8_1_tags_1, /* Same as above */
3936 sizeof(asn_DEF_Utf8_1_tags_1)
3937 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3938 0, /* No PER visible constraints */
3939 0, 0, /* No members */
3940 0 /* No specifics */
3941};
3942
3943
3944/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
3945
Lev Walkin22b5ed42006-09-13 02:51:20 +00003946#include "Identifier.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003947
3948/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
3949
3950typedef Identifier_t VisibleIdentifier_t;
3951
3952/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
3953
3954extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
3955asn_struct_free_f VisibleIdentifier_free;
3956asn_struct_print_f VisibleIdentifier_print;
3957asn_constr_check_f VisibleIdentifier_constraint;
3958ber_type_decoder_f VisibleIdentifier_decode_ber;
3959der_type_encoder_f VisibleIdentifier_encode_der;
3960xer_type_decoder_f VisibleIdentifier_decode_xer;
3961xer_type_encoder_f VisibleIdentifier_encode_xer;
3962per_type_decoder_f VisibleIdentifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003963per_type_encoder_f VisibleIdentifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003964
3965/*** <<< CTABLES [VisibleIdentifier] >>> ***/
3966
Lev Walkina7591b52014-10-12 18:37:35 -07003967static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003968 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3969 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3970 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
3971 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
3972 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
397327,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
3974 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
397554,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003976};
Lev Walkina7591b52014-10-12 18:37:35 -07003977static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000397836,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
397970,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
398086,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
3981107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
3982};
3983
Lev Walkin59b176e2005-11-26 11:25:14 +00003984
3985static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07003986 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00003987 /* The underlying type is VisibleString */
3988 const VisibleString_t *st = (const VisibleString_t *)sptr;
3989 const uint8_t *ch = st->buf;
3990 const uint8_t *end = ch + st->size;
3991
3992 for(; ch < end; ch++) {
3993 uint8_t cv = *ch;
3994 if(!table[cv]) return -1;
3995 }
3996 return 0;
3997}
3998
3999
4000/*** <<< CODE [VisibleIdentifier] >>> ***/
4001
4002int
4003VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004004 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004005 const Identifier_t *st = (const Identifier_t *)sptr;
4006 size_t size;
4007
4008 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004009 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004010 "%s: value not given (%s:%d)",
4011 td->name, __FILE__, __LINE__);
4012 return -1;
4013 }
4014
4015 size = st->size;
4016
4017 if((size >= 1 && size <= 32)
4018 && !check_permitted_alphabet_1(st)) {
4019 /* Constraint check succeeded */
4020 return 0;
4021 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004022 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004023 "%s: constraint failed (%s:%d)",
4024 td->name, __FILE__, __LINE__);
4025 return -1;
4026 }
4027}
4028
4029/*
4030 * This type is implemented using Identifier,
4031 * so here we adjust the DEF accordingly.
4032 */
4033static void
4034VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4035 td->free_struct = asn_DEF_Identifier.free_struct;
4036 td->print_struct = asn_DEF_Identifier.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004037 td->check_constraints = asn_DEF_Identifier.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004038 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
4039 td->der_encoder = asn_DEF_Identifier.der_encoder;
4040 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
4041 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
4042 td->uper_decoder = asn_DEF_Identifier.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004043 td->uper_encoder = asn_DEF_Identifier.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004044 td->oer_decoder = asn_DEF_Identifier.oer_decoder;
4045 td->oer_encoder = asn_DEF_Identifier.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004046 if(!td->per_constraints)
4047 td->per_constraints = asn_DEF_Identifier.per_constraints;
4048 td->elements = asn_DEF_Identifier.elements;
4049 td->elements_count = asn_DEF_Identifier.elements_count;
4050 td->specifics = asn_DEF_Identifier.specifics;
4051}
4052
4053void
4054VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
4055 void *struct_ptr, int contents_only) {
4056 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4057 td->free_struct(td, struct_ptr, contents_only);
4058}
4059
4060int
4061VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4062 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4063 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4064 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4065}
4066
4067asn_dec_rval_t
4068VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4069 void **structure, const void *bufptr, size_t size, int tag_mode) {
4070 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4071 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4072}
4073
4074asn_enc_rval_t
4075VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
4076 void *structure, int tag_mode, ber_tlv_tag_t tag,
4077 asn_app_consume_bytes_f *cb, void *app_key) {
4078 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4079 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4080}
4081
4082asn_dec_rval_t
4083VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4084 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4085 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4086 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4087}
4088
4089asn_enc_rval_t
4090VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4091 int ilevel, enum xer_encoder_flags_e flags,
4092 asn_app_consume_bytes_f *cb, void *app_key) {
4093 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4094 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4095}
4096
4097asn_dec_rval_t
4098VisibleIdentifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4099 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4100 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4101 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4102}
4103
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004104asn_enc_rval_t
4105VisibleIdentifier_encode_uper(asn_TYPE_descriptor_t *td,
4106 asn_per_constraints_t *constraints,
4107 void *structure, asn_per_outp_t *per_out) {
4108 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4109 return td->uper_encoder(td, constraints, structure, per_out);
4110}
4111
Lev Walkin59b176e2005-11-26 11:25:14 +00004112
4113/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
4114
Lev Walkina7591b52014-10-12 18:37:35 -07004115static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004116 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
4117};
4118asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
4119 "VisibleIdentifier",
4120 "VisibleIdentifier",
4121 VisibleIdentifier_free,
4122 VisibleIdentifier_print,
4123 VisibleIdentifier_constraint,
4124 VisibleIdentifier_decode_ber,
4125 VisibleIdentifier_encode_der,
4126 VisibleIdentifier_decode_xer,
4127 VisibleIdentifier_encode_xer,
4128 VisibleIdentifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004129 VisibleIdentifier_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07004130 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004131 0, /* Use generic outmost tag fetcher */
4132 asn_DEF_VisibleIdentifier_tags_1,
4133 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4134 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
4135 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
4136 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4137 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
4138 0, /* No PER visible constraints */
4139 0, 0, /* No members */
4140 0 /* No specifics */
4141};
4142
4143
4144/*** <<< INCLUDES [Sequence] >>> ***/
4145
Lev Walkin22b5ed42006-09-13 02:51:20 +00004146#include "Int1.h"
4147#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004148#include <BOOLEAN.h>
Lev Walkin2a744a72013-03-27 01:56:23 -07004149#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00004150#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00004151#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004152#include <constr_SEQUENCE.h>
4153
4154/*** <<< DEPS [Sequence] >>> ***/
4155
4156typedef enum enum_c {
4157 enum_c_one = 1,
4158 enum_c_two = 2,
4159 /*
4160 * Enumeration is extensible
4161 */
4162 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00004163} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00004164
4165/*** <<< TYPE-DECLS [Sequence] >>> ***/
4166
4167typedef struct Sequence {
4168 Int1_t *int1_c /* DEFAULT 3 */;
4169 Int4_t int4;
4170 Int4_t int4_c;
Lev Walkin2a744a72013-03-27 01:56:23 -07004171 BOOLEAN_t *Bool /* DEFAULT 1 */;
4172 long enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00004173 NULL_t *null /* OPTIONAL */;
4174 /*
4175 * This type is extensible,
4176 * possible extensions are below.
4177 */
4178 Int5_t *int5_c /* OPTIONAL */;
4179
4180 /* Context for parsing across buffer boundaries */
4181 asn_struct_ctx_t _asn_ctx;
4182} Sequence_t;
4183
4184/*** <<< FUNC-DECLS [Sequence] >>> ***/
4185
4186/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
4187extern asn_TYPE_descriptor_t asn_DEF_Sequence;
4188
4189/*** <<< CODE [Sequence] >>> ***/
4190
4191static int
4192enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004193 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004194 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -07004195 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004196 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004197}
4198
4199/*
Lev Walkin2a744a72013-03-27 01:56:23 -07004200 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00004201 * so here we adjust the DEF accordingly.
4202 */
4203static void
4204enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -07004205 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4206 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004207 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -07004208 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4209 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4210 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4211 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4212 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
4213 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004214 td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder;
4215 td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004216 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -07004217 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4218 td->elements = asn_DEF_NativeEnumerated.elements;
4219 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4220 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
Lev Walkin59b176e2005-11-26 11:25:14 +00004221}
4222
4223static void
4224enum_c_6_free(asn_TYPE_descriptor_t *td,
4225 void *struct_ptr, int contents_only) {
4226 enum_c_6_inherit_TYPE_descriptor(td);
4227 td->free_struct(td, struct_ptr, contents_only);
4228}
4229
4230static int
4231enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4232 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4233 enum_c_6_inherit_TYPE_descriptor(td);
4234 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4235}
4236
4237static asn_dec_rval_t
4238enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4239 void **structure, const void *bufptr, size_t size, int tag_mode) {
4240 enum_c_6_inherit_TYPE_descriptor(td);
4241 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4242}
4243
4244static asn_enc_rval_t
4245enum_c_6_encode_der(asn_TYPE_descriptor_t *td,
4246 void *structure, int tag_mode, ber_tlv_tag_t tag,
4247 asn_app_consume_bytes_f *cb, void *app_key) {
4248 enum_c_6_inherit_TYPE_descriptor(td);
4249 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4250}
4251
4252static asn_dec_rval_t
4253enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4254 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4255 enum_c_6_inherit_TYPE_descriptor(td);
4256 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4257}
4258
4259static asn_enc_rval_t
4260enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4261 int ilevel, enum xer_encoder_flags_e flags,
4262 asn_app_consume_bytes_f *cb, void *app_key) {
4263 enum_c_6_inherit_TYPE_descriptor(td);
4264 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4265}
4266
4267static asn_dec_rval_t
4268enum_c_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4269 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4270 enum_c_6_inherit_TYPE_descriptor(td);
4271 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4272}
4273
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004274static asn_enc_rval_t
4275enum_c_6_encode_uper(asn_TYPE_descriptor_t *td,
4276 asn_per_constraints_t *constraints,
4277 void *structure, asn_per_outp_t *per_out) {
4278 enum_c_6_inherit_TYPE_descriptor(td);
4279 return td->uper_encoder(td, constraints, structure, per_out);
4280}
4281
Lev Walkin59b176e2005-11-26 11:25:14 +00004282static int
4283memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004284 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004285 long value;
4286
4287 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004288 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004289 "%s: value not given (%s:%d)",
4290 td->name, __FILE__, __LINE__);
4291 return -1;
4292 }
4293
Lev Walkin2a744a72013-03-27 01:56:23 -07004294 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004295
4296 if((value >= -2)) {
4297 /* Constraint check succeeded */
4298 return 0;
4299 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004300 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004301 "%s: constraint failed (%s:%d)",
4302 td->name, __FILE__, __LINE__);
4303 return -1;
4304 }
4305}
4306
4307static int
4308memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004309 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004310 long value;
4311
4312 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004313 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004314 "%s: value not given (%s:%d)",
4315 td->name, __FILE__, __LINE__);
4316 return -1;
4317 }
4318
Lev Walkin2a744a72013-03-27 01:56:23 -07004319 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004320
4321 if((value >= 5 && value <= 7)) {
4322 /* Constraint check succeeded */
4323 return 0;
4324 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004325 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004326 "%s: constraint failed (%s:%d)",
4327 td->name, __FILE__, __LINE__);
4328 return -1;
4329 }
4330}
4331
4332static int
4333memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004334 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004335 long value;
4336
4337 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004338 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004339 "%s: value not given (%s:%d)",
4340 td->name, __FILE__, __LINE__);
4341 return -1;
4342 }
4343
Lev Walkin2a744a72013-03-27 01:56:23 -07004344 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004345
4346 if((value == 5)) {
4347 /* Constraint check succeeded */
4348 return 0;
4349 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004350 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004351 "%s: constraint failed (%s:%d)",
4352 td->name, __FILE__, __LINE__);
4353 return -1;
4354 }
4355}
4356
4357
Lev Walkin725883b2006-10-09 12:07:58 +00004358/*** <<< CTDEFS [Sequence] >>> ***/
4359
Lev Walkin2fce55d2013-03-28 05:00:39 -07004360static asn_per_constraints_t asn_PER_type_enum_c_constr_6 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004361 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
4362 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4363 0, 0 /* No PER value map */
4364};
Lev Walkin2fce55d2013-03-28 05:00:39 -07004365static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004366 { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
4367 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4368 0, 0 /* No PER value map */
4369};
Lev Walkin2fce55d2013-03-28 05:00:39 -07004370static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004371 { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
4372 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4373 0, 0 /* No PER value map */
4374};
Lev Walkin2fce55d2013-03-28 05:00:39 -07004375static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004376 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
4377 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4378 0, 0 /* No PER value map */
4379};
4380
Lev Walkin59b176e2005-11-26 11:25:14 +00004381/*** <<< STAT-DEFS [Sequence] >>> ***/
4382
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004383static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004384 Int1_t *st = *sptr;
4385
4386 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004387 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004388 st = (*sptr = CALLOC(1, sizeof(*st)));
4389 if(!st) return -1;
4390 }
4391
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004392 if(set_value) {
4393 /* Install default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07004394 *st = 3;
4395 return 0;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004396 } else {
4397 /* Test default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07004398 return (*st == 3);
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004399 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004400}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004401static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004402 BOOLEAN_t *st = *sptr;
4403
4404 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004405 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004406 st = (*sptr = CALLOC(1, sizeof(*st)));
4407 if(!st) return -1;
4408 }
4409
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004410 if(set_value) {
4411 /* Install default value 1 */
4412 *st = 1;
4413 return 0;
4414 } else {
4415 /* Test default value 1 */
4416 return (*st == 1);
4417 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004418}
Lev Walkina7591b52014-10-12 18:37:35 -07004419static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004420 { 1, 3, "one" },
4421 { 2, 3, "two" },
4422 { 3, 5, "three" }
4423 /* This list is extensible */
4424};
Lev Walkina7591b52014-10-12 18:37:35 -07004425static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004426 0, /* one(1) */
4427 2, /* three(3) */
4428 1 /* two(2) */
4429 /* This list is extensible */
4430};
johvike70c4072017-05-09 11:06:12 +02004431static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004432 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
4433 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
4434 3, /* Number of elements in the maps */
4435 3, /* Extensions before this member */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004436 1, /* Strict enumeration */
4437 0, /* Native long size */
4438 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004439};
Lev Walkina7591b52014-10-12 18:37:35 -07004440static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004441 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4442};
Lev Walkin59b176e2005-11-26 11:25:14 +00004443static /* Use -fall-defs-global to expose */
4444asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
4445 "enum-c",
4446 "enum-c",
4447 enum_c_6_free,
4448 enum_c_6_print,
4449 enum_c_6_constraint,
4450 enum_c_6_decode_ber,
4451 enum_c_6_encode_der,
4452 enum_c_6_decode_xer,
4453 enum_c_6_encode_xer,
4454 enum_c_6_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004455 enum_c_6_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07004456 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004457 0, /* Use generic outmost tag fetcher */
4458 asn_DEF_enum_c_tags_6,
4459 sizeof(asn_DEF_enum_c_tags_6)
4460 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
4461 asn_DEF_enum_c_tags_6, /* Same as above */
4462 sizeof(asn_DEF_enum_c_tags_6)
4463 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004464 &asn_PER_type_enum_c_constr_6,
Lev Walkin59b176e2005-11-26 11:25:14 +00004465 0, 0, /* Defined elsewhere */
4466 &asn_SPC_enum_c_specs_6 /* Additional specs */
4467};
4468
Lev Walkin59b176e2005-11-26 11:25:14 +00004469static asn_TYPE_member_t asn_MBR_Sequence_1[] = {
4470 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
4471 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4472 .tag_mode = 0,
4473 .type = &asn_DEF_Int1,
4474 .memb_constraints = memb_int1_c_constraint_1,
Lev Walkin4b5dae32006-10-09 12:27:44 +00004475 .per_constraints = &asn_PER_memb_int1_c_constr_2,
Lev Walkin59b176e2005-11-26 11:25:14 +00004476 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
4477 .name = "int1-c"
4478 },
4479 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
4480 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
4481 .tag_mode = +1, /* EXPLICIT tag at current level */
4482 .type = &asn_DEF_Int4,
4483 .memb_constraints = 0, /* Defer constraints checking to the member type */
4484 .per_constraints = 0, /* No PER visible constraints */
4485 .default_value = 0,
4486 .name = "int4"
4487 },
4488 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
4489 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4490 .tag_mode = 0,
4491 .type = &asn_DEF_Int4,
4492 .memb_constraints = memb_int4_c_constraint_1,
Lev Walkin4b5dae32006-10-09 12:27:44 +00004493 .per_constraints = &asn_PER_memb_int4_c_constr_4,
Lev Walkin59b176e2005-11-26 11:25:14 +00004494 .default_value = 0,
4495 .name = "int4-c"
4496 },
Lev Walkin2a744a72013-03-27 01:56:23 -07004497 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +00004498 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
4499 .tag_mode = 0,
4500 .type = &asn_DEF_BOOLEAN,
4501 .memb_constraints = 0, /* Defer constraints checking to the member type */
4502 .per_constraints = 0, /* No PER visible constraints */
4503 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
4504 .name = "bool"
4505 },
4506 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
4507 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
4508 .tag_mode = 0,
4509 .type = &asn_DEF_enum_c_6,
4510 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin07aaa342006-10-09 12:52:15 +00004511 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004512 .default_value = 0,
4513 .name = "enum-c"
4514 },
4515 { ATF_POINTER, 2, offsetof(struct Sequence, null),
4516 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
4517 .tag_mode = 0,
4518 .type = &asn_DEF_NULL,
4519 .memb_constraints = 0, /* Defer constraints checking to the member type */
4520 .per_constraints = 0, /* No PER visible constraints */
4521 .default_value = 0,
4522 .name = "null"
4523 },
4524 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
4525 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4526 .tag_mode = 0,
4527 .type = &asn_DEF_Int5,
4528 .memb_constraints = memb_int5_c_constraint_1,
Lev Walkin4b5dae32006-10-09 12:27:44 +00004529 .per_constraints = &asn_PER_memb_int5_c_constr_13,
Lev Walkin59b176e2005-11-26 11:25:14 +00004530 .default_value = 0,
4531 .name = "int5-c"
4532 },
4533};
Lev Walkina7591b52014-10-12 18:37:35 -07004534static const int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
4535static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004536 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4537};
Lev Walkina7591b52014-10-12 18:37:35 -07004538static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -07004539 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
4540 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
4541 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
4542 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
4543 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
4544 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
4545 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
Lev Walkin59b176e2005-11-26 11:25:14 +00004546};
4547static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
4548 sizeof(struct Sequence),
4549 offsetof(struct Sequence, _asn_ctx),
4550 asn_MAP_Sequence_tag2el_1,
4551 7, /* Count of tags in the map */
4552 asn_MAP_Sequence_oms_1, /* Optional members */
4553 3, 1, /* Root/Additions */
4554 5, /* Start extensions */
4555 8 /* Stop extensions */
4556};
4557asn_TYPE_descriptor_t asn_DEF_Sequence = {
4558 "Sequence",
4559 "Sequence",
4560 SEQUENCE_free,
4561 SEQUENCE_print,
4562 SEQUENCE_constraint,
4563 SEQUENCE_decode_ber,
4564 SEQUENCE_encode_der,
4565 SEQUENCE_decode_xer,
4566 SEQUENCE_encode_xer,
4567 SEQUENCE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004568 SEQUENCE_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07004569 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004570 0, /* Use generic outmost tag fetcher */
4571 asn_DEF_Sequence_tags_1,
4572 sizeof(asn_DEF_Sequence_tags_1)
4573 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4574 asn_DEF_Sequence_tags_1, /* Same as above */
4575 sizeof(asn_DEF_Sequence_tags_1)
4576 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4577 0, /* No PER visible constraints */
4578 asn_MBR_Sequence_1,
4579 7, /* Elements count */
4580 &asn_SPC_Sequence_specs_1 /* Additional specs */
4581};
4582
4583
4584/*** <<< INCLUDES [SequenceOf] >>> ***/
4585
4586#include <asn_SEQUENCE_OF.h>
4587#include <constr_SEQUENCE_OF.h>
4588
4589/*** <<< FWD-DECLS [SequenceOf] >>> ***/
4590
4591struct Sequence;
4592
4593/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
4594
4595typedef struct SequenceOf {
4596 A_SEQUENCE_OF(struct Sequence) list;
4597
4598 /* Context for parsing across buffer boundaries */
4599 asn_struct_ctx_t _asn_ctx;
4600} SequenceOf_t;
4601
4602/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
4603
4604extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
4605
4606/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
4607
Lev Walkin22b5ed42006-09-13 02:51:20 +00004608#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004609
Lev Walkin725883b2006-10-09 12:07:58 +00004610/*** <<< CTDEFS [SequenceOf] >>> ***/
4611
Lev Walkin2fce55d2013-03-28 05:00:39 -07004612static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004613 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4614 { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */,
4615 0, 0 /* No PER value map */
4616};
4617
Lev Walkin59b176e2005-11-26 11:25:14 +00004618/*** <<< STAT-DEFS [SequenceOf] >>> ***/
4619
4620static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
4621 { ATF_POINTER, 0, 0,
4622 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
4623 .tag_mode = 0,
4624 .type = &asn_DEF_Sequence,
4625 .memb_constraints = 0, /* Defer constraints checking to the member type */
4626 .per_constraints = 0, /* No PER visible constraints */
4627 .default_value = 0,
4628 .name = ""
4629 },
4630};
Lev Walkina7591b52014-10-12 18:37:35 -07004631static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004632 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4633};
4634static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
4635 sizeof(struct SequenceOf),
4636 offsetof(struct SequenceOf, _asn_ctx),
4637 0, /* XER encoding is XMLDelimitedItemList */
4638};
Lev Walkin59b176e2005-11-26 11:25:14 +00004639asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
4640 "SequenceOf",
4641 "SequenceOf",
4642 SEQUENCE_OF_free,
4643 SEQUENCE_OF_print,
4644 SEQUENCE_OF_constraint,
4645 SEQUENCE_OF_decode_ber,
4646 SEQUENCE_OF_encode_der,
4647 SEQUENCE_OF_decode_xer,
4648 SEQUENCE_OF_encode_xer,
4649 SEQUENCE_OF_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004650 SEQUENCE_OF_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07004651 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004652 0, /* Use generic outmost tag fetcher */
4653 asn_DEF_SequenceOf_tags_1,
4654 sizeof(asn_DEF_SequenceOf_tags_1)
4655 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4656 asn_DEF_SequenceOf_tags_1, /* Same as above */
4657 sizeof(asn_DEF_SequenceOf_tags_1)
4658 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004659 &asn_PER_type_SequenceOf_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004660 asn_MBR_SequenceOf_1,
4661 1, /* Single element */
4662 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
4663};
4664
4665
4666/*** <<< INCLUDES [Enum0] >>> ***/
4667
Lev Walkin2a744a72013-03-27 01:56:23 -07004668#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00004669
4670/*** <<< DEPS [Enum0] >>> ***/
4671
4672typedef enum Enum0 {
4673 Enum0_one = 0,
4674 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004675} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00004676
4677/*** <<< TYPE-DECLS [Enum0] >>> ***/
4678
Lev Walkin2a744a72013-03-27 01:56:23 -07004679typedef long Enum0_t;
Lev Walkin59b176e2005-11-26 11:25:14 +00004680
4681/*** <<< FUNC-DECLS [Enum0] >>> ***/
4682
4683extern asn_TYPE_descriptor_t asn_DEF_Enum0;
4684asn_struct_free_f Enum0_free;
4685asn_struct_print_f Enum0_print;
4686asn_constr_check_f Enum0_constraint;
4687ber_type_decoder_f Enum0_decode_ber;
4688der_type_encoder_f Enum0_encode_der;
4689xer_type_decoder_f Enum0_decode_xer;
4690xer_type_encoder_f Enum0_encode_xer;
4691per_type_decoder_f Enum0_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004692per_type_encoder_f Enum0_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004693
4694/*** <<< CODE [Enum0] >>> ***/
4695
4696int
4697Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004698 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004699 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -07004700 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004701 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004702}
4703
4704/*
Lev Walkin2a744a72013-03-27 01:56:23 -07004705 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00004706 * so here we adjust the DEF accordingly.
4707 */
4708static void
4709Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -07004710 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4711 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004712 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -07004713 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4714 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4715 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4716 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4717 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
4718 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004719 td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder;
4720 td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004721 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -07004722 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4723 td->elements = asn_DEF_NativeEnumerated.elements;
4724 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4725 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
Lev Walkin59b176e2005-11-26 11:25:14 +00004726}
4727
4728void
4729Enum0_free(asn_TYPE_descriptor_t *td,
4730 void *struct_ptr, int contents_only) {
4731 Enum0_1_inherit_TYPE_descriptor(td);
4732 td->free_struct(td, struct_ptr, contents_only);
4733}
4734
4735int
4736Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4737 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4738 Enum0_1_inherit_TYPE_descriptor(td);
4739 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4740}
4741
4742asn_dec_rval_t
4743Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4744 void **structure, const void *bufptr, size_t size, int tag_mode) {
4745 Enum0_1_inherit_TYPE_descriptor(td);
4746 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4747}
4748
4749asn_enc_rval_t
4750Enum0_encode_der(asn_TYPE_descriptor_t *td,
4751 void *structure, int tag_mode, ber_tlv_tag_t tag,
4752 asn_app_consume_bytes_f *cb, void *app_key) {
4753 Enum0_1_inherit_TYPE_descriptor(td);
4754 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4755}
4756
4757asn_dec_rval_t
4758Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4759 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4760 Enum0_1_inherit_TYPE_descriptor(td);
4761 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4762}
4763
4764asn_enc_rval_t
4765Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4766 int ilevel, enum xer_encoder_flags_e flags,
4767 asn_app_consume_bytes_f *cb, void *app_key) {
4768 Enum0_1_inherit_TYPE_descriptor(td);
4769 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4770}
4771
4772asn_dec_rval_t
4773Enum0_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4774 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4775 Enum0_1_inherit_TYPE_descriptor(td);
4776 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4777}
4778
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004779asn_enc_rval_t
4780Enum0_encode_uper(asn_TYPE_descriptor_t *td,
4781 asn_per_constraints_t *constraints,
4782 void *structure, asn_per_outp_t *per_out) {
4783 Enum0_1_inherit_TYPE_descriptor(td);
4784 return td->uper_encoder(td, constraints, structure, per_out);
4785}
4786
Lev Walkin59b176e2005-11-26 11:25:14 +00004787
Lev Walkin725883b2006-10-09 12:07:58 +00004788/*** <<< CTDEFS [Enum0] >>> ***/
4789
Lev Walkin2fce55d2013-03-28 05:00:39 -07004790static asn_per_constraints_t asn_PER_type_Enum0_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004791 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4792 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4793 0, 0 /* No PER value map */
4794};
4795
Lev Walkin59b176e2005-11-26 11:25:14 +00004796/*** <<< STAT-DEFS [Enum0] >>> ***/
4797
Lev Walkina7591b52014-10-12 18:37:35 -07004798static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004799 { 0, 3, "one" },
4800 { 1, 3, "two" }
4801};
Lev Walkina7591b52014-10-12 18:37:35 -07004802static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004803 0, /* one(0) */
4804 1 /* two(1) */
4805};
johvike70c4072017-05-09 11:06:12 +02004806static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004807 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
4808 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
4809 2, /* Number of elements in the maps */
4810 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004811 1, /* Strict enumeration */
4812 0, /* Native long size */
4813 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004814};
Lev Walkina7591b52014-10-12 18:37:35 -07004815static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004816 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4817};
Lev Walkin59b176e2005-11-26 11:25:14 +00004818asn_TYPE_descriptor_t asn_DEF_Enum0 = {
4819 "Enum0",
4820 "Enum0",
4821 Enum0_free,
4822 Enum0_print,
4823 Enum0_constraint,
4824 Enum0_decode_ber,
4825 Enum0_encode_der,
4826 Enum0_decode_xer,
4827 Enum0_encode_xer,
4828 Enum0_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004829 Enum0_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07004830 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00004831 0, /* Use generic outmost tag fetcher */
4832 asn_DEF_Enum0_tags_1,
4833 sizeof(asn_DEF_Enum0_tags_1)
4834 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4835 asn_DEF_Enum0_tags_1, /* Same as above */
4836 sizeof(asn_DEF_Enum0_tags_1)
4837 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004838 &asn_PER_type_Enum0_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004839 0, 0, /* Defined elsewhere */
4840 &asn_SPC_Enum0_specs_1 /* Additional specs */
4841};
4842
4843
4844/*** <<< INCLUDES [Enum1] >>> ***/
4845
4846#include <NativeEnumerated.h>
4847
4848/*** <<< DEPS [Enum1] >>> ***/
4849
4850typedef enum Enum1 {
4851 Enum1_one = 0,
4852 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004853} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00004854
4855/*** <<< TYPE-DECLS [Enum1] >>> ***/
4856
4857typedef long Enum1_t;
4858
4859/*** <<< FUNC-DECLS [Enum1] >>> ***/
4860
4861extern asn_TYPE_descriptor_t asn_DEF_Enum1;
4862asn_struct_free_f Enum1_free;
4863asn_struct_print_f Enum1_print;
4864asn_constr_check_f Enum1_constraint;
4865ber_type_decoder_f Enum1_decode_ber;
4866der_type_encoder_f Enum1_encode_der;
4867xer_type_decoder_f Enum1_decode_xer;
4868xer_type_encoder_f Enum1_encode_xer;
4869per_type_decoder_f Enum1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004870per_type_encoder_f Enum1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004871
4872/*** <<< CODE [Enum1] >>> ***/
4873
4874int
4875Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004876 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004877 long value;
4878
4879 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004880 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004881 "%s: value not given (%s:%d)",
4882 td->name, __FILE__, __LINE__);
4883 return -1;
4884 }
4885
4886 value = *(const long *)sptr;
4887
4888 if((value == 0)) {
4889 /* Constraint check succeeded */
4890 return 0;
4891 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004892 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004893 "%s: constraint failed (%s:%d)",
4894 td->name, __FILE__, __LINE__);
4895 return -1;
4896 }
4897}
4898
4899/*
4900 * This type is implemented using NativeEnumerated,
4901 * so here we adjust the DEF accordingly.
4902 */
4903static void
4904Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4905 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4906 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004907 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004908 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4909 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4910 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4911 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4912 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004913 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07004914 td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder;
4915 td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004916 if(!td->per_constraints)
4917 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4918 td->elements = asn_DEF_NativeEnumerated.elements;
4919 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4920 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
4921}
4922
4923void
4924Enum1_free(asn_TYPE_descriptor_t *td,
4925 void *struct_ptr, int contents_only) {
4926 Enum1_1_inherit_TYPE_descriptor(td);
4927 td->free_struct(td, struct_ptr, contents_only);
4928}
4929
4930int
4931Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4932 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4933 Enum1_1_inherit_TYPE_descriptor(td);
4934 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4935}
4936
4937asn_dec_rval_t
4938Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4939 void **structure, const void *bufptr, size_t size, int tag_mode) {
4940 Enum1_1_inherit_TYPE_descriptor(td);
4941 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4942}
4943
4944asn_enc_rval_t
4945Enum1_encode_der(asn_TYPE_descriptor_t *td,
4946 void *structure, int tag_mode, ber_tlv_tag_t tag,
4947 asn_app_consume_bytes_f *cb, void *app_key) {
4948 Enum1_1_inherit_TYPE_descriptor(td);
4949 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4950}
4951
4952asn_dec_rval_t
4953Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4954 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4955 Enum1_1_inherit_TYPE_descriptor(td);
4956 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4957}
4958
4959asn_enc_rval_t
4960Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4961 int ilevel, enum xer_encoder_flags_e flags,
4962 asn_app_consume_bytes_f *cb, void *app_key) {
4963 Enum1_1_inherit_TYPE_descriptor(td);
4964 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4965}
4966
4967asn_dec_rval_t
4968Enum1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4969 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4970 Enum1_1_inherit_TYPE_descriptor(td);
4971 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4972}
4973
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004974asn_enc_rval_t
4975Enum1_encode_uper(asn_TYPE_descriptor_t *td,
4976 asn_per_constraints_t *constraints,
4977 void *structure, asn_per_outp_t *per_out) {
4978 Enum1_1_inherit_TYPE_descriptor(td);
4979 return td->uper_encoder(td, constraints, structure, per_out);
4980}
4981
Lev Walkin59b176e2005-11-26 11:25:14 +00004982
Lev Walkin725883b2006-10-09 12:07:58 +00004983/*** <<< CTDEFS [Enum1] >>> ***/
4984
Lev Walkin2fce55d2013-03-28 05:00:39 -07004985static asn_per_constraints_t asn_PER_type_Enum1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004986 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4987 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4988 0, 0 /* No PER value map */
4989};
4990
Lev Walkin59b176e2005-11-26 11:25:14 +00004991/*** <<< STAT-DEFS [Enum1] >>> ***/
4992
Lev Walkina7591b52014-10-12 18:37:35 -07004993static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004994 { 0, 3, "one" },
4995 { 1, 3, "two" }
4996};
Lev Walkina7591b52014-10-12 18:37:35 -07004997static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004998 0, /* one(0) */
4999 1 /* two(1) */
5000};
johvike70c4072017-05-09 11:06:12 +02005001static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00005002 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
5003 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
5004 2, /* Number of elements in the maps */
5005 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00005006 1, /* Strict enumeration */
5007 0, /* Native long size */
5008 0
Lev Walkin59b176e2005-11-26 11:25:14 +00005009};
Lev Walkina7591b52014-10-12 18:37:35 -07005010static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00005011 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
5012};
Lev Walkin59b176e2005-11-26 11:25:14 +00005013asn_TYPE_descriptor_t asn_DEF_Enum1 = {
5014 "Enum1",
5015 "Enum1",
5016 Enum1_free,
5017 Enum1_print,
5018 Enum1_constraint,
5019 Enum1_decode_ber,
5020 Enum1_encode_der,
5021 Enum1_decode_xer,
5022 Enum1_encode_xer,
5023 Enum1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005024 Enum1_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07005025 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00005026 0, /* Use generic outmost tag fetcher */
5027 asn_DEF_Enum1_tags_1,
5028 sizeof(asn_DEF_Enum1_tags_1)
5029 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
5030 asn_DEF_Enum1_tags_1, /* Same as above */
5031 sizeof(asn_DEF_Enum1_tags_1)
5032 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00005033 &asn_PER_type_Enum1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00005034 0, 0, /* Defined elsewhere */
5035 &asn_SPC_Enum1_specs_1 /* Additional specs */
5036};
5037
5038
5039/*** <<< INCLUDES [Identifier] >>> ***/
5040
5041#include <VisibleString.h>
5042
5043/*** <<< TYPE-DECLS [Identifier] >>> ***/
5044
5045typedef VisibleString_t Identifier_t;
5046
5047/*** <<< FUNC-DECLS [Identifier] >>> ***/
5048
5049extern asn_TYPE_descriptor_t asn_DEF_Identifier;
5050asn_struct_free_f Identifier_free;
5051asn_struct_print_f Identifier_print;
5052asn_constr_check_f Identifier_constraint;
5053ber_type_decoder_f Identifier_decode_ber;
5054der_type_encoder_f Identifier_encode_der;
5055xer_type_decoder_f Identifier_decode_xer;
5056xer_type_encoder_f Identifier_encode_xer;
5057per_type_decoder_f Identifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005058per_type_encoder_f Identifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00005059
5060/*** <<< CTABLES [Identifier] >>> ***/
5061
Lev Walkina7591b52014-10-12 18:37:35 -07005062static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00005063 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
5064 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
5065 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
5066 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
5067 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
506827,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
5069 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
507054,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00005071};
Lev Walkina7591b52014-10-12 18:37:35 -07005072static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000507336,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
507470,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
507586,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
5076107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
5077};
5078
Lev Walkin59b176e2005-11-26 11:25:14 +00005079
5080static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07005081 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00005082 /* The underlying type is VisibleString */
5083 const VisibleString_t *st = (const VisibleString_t *)sptr;
5084 const uint8_t *ch = st->buf;
5085 const uint8_t *end = ch + st->size;
5086
5087 for(; ch < end; ch++) {
5088 uint8_t cv = *ch;
5089 if(!table[cv]) return -1;
5090 }
5091 return 0;
5092}
5093
5094
5095/*** <<< CODE [Identifier] >>> ***/
5096
5097int
5098Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00005099 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00005100 const VisibleString_t *st = (const VisibleString_t *)sptr;
5101 size_t size;
5102
5103 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07005104 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00005105 "%s: value not given (%s:%d)",
5106 td->name, __FILE__, __LINE__);
5107 return -1;
5108 }
5109
5110 size = st->size;
5111
5112 if((size >= 1 && size <= 32)
5113 && !check_permitted_alphabet_1(st)) {
5114 /* Constraint check succeeded */
5115 return 0;
5116 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07005117 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00005118 "%s: constraint failed (%s:%d)",
5119 td->name, __FILE__, __LINE__);
5120 return -1;
5121 }
5122}
5123
Lev Walkin725883b2006-10-09 12:07:58 +00005124static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) {
5125 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
5126 return -1;
5127 return permitted_alphabet_table_1[value] - 1;
5128}
5129static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) {
5130 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
5131 return -1;
5132 return permitted_alphabet_code2value_1[code];
5133}
Lev Walkin59b176e2005-11-26 11:25:14 +00005134/*
5135 * This type is implemented using VisibleString,
5136 * so here we adjust the DEF accordingly.
5137 */
5138static void
5139Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
5140 td->free_struct = asn_DEF_VisibleString.free_struct;
5141 td->print_struct = asn_DEF_VisibleString.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08005142 td->check_constraints = asn_DEF_VisibleString.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00005143 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
5144 td->der_encoder = asn_DEF_VisibleString.der_encoder;
5145 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
5146 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
5147 td->uper_decoder = asn_DEF_VisibleString.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005148 td->uper_encoder = asn_DEF_VisibleString.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -07005149 td->oer_decoder = asn_DEF_VisibleString.oer_decoder;
5150 td->oer_encoder = asn_DEF_VisibleString.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00005151 if(!td->per_constraints)
5152 td->per_constraints = asn_DEF_VisibleString.per_constraints;
5153 td->elements = asn_DEF_VisibleString.elements;
5154 td->elements_count = asn_DEF_VisibleString.elements_count;
5155 td->specifics = asn_DEF_VisibleString.specifics;
5156}
5157
5158void
5159Identifier_free(asn_TYPE_descriptor_t *td,
5160 void *struct_ptr, int contents_only) {
5161 Identifier_1_inherit_TYPE_descriptor(td);
5162 td->free_struct(td, struct_ptr, contents_only);
5163}
5164
5165int
5166Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
5167 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
5168 Identifier_1_inherit_TYPE_descriptor(td);
5169 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
5170}
5171
5172asn_dec_rval_t
5173Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5174 void **structure, const void *bufptr, size_t size, int tag_mode) {
5175 Identifier_1_inherit_TYPE_descriptor(td);
5176 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
5177}
5178
5179asn_enc_rval_t
5180Identifier_encode_der(asn_TYPE_descriptor_t *td,
5181 void *structure, int tag_mode, ber_tlv_tag_t tag,
5182 asn_app_consume_bytes_f *cb, void *app_key) {
5183 Identifier_1_inherit_TYPE_descriptor(td);
5184 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
5185}
5186
5187asn_dec_rval_t
5188Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5189 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
5190 Identifier_1_inherit_TYPE_descriptor(td);
5191 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
5192}
5193
5194asn_enc_rval_t
5195Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
5196 int ilevel, enum xer_encoder_flags_e flags,
5197 asn_app_consume_bytes_f *cb, void *app_key) {
5198 Identifier_1_inherit_TYPE_descriptor(td);
5199 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
5200}
5201
5202asn_dec_rval_t
5203Identifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5204 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
5205 Identifier_1_inherit_TYPE_descriptor(td);
5206 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
5207}
5208
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005209asn_enc_rval_t
5210Identifier_encode_uper(asn_TYPE_descriptor_t *td,
5211 asn_per_constraints_t *constraints,
5212 void *structure, asn_per_outp_t *per_out) {
5213 Identifier_1_inherit_TYPE_descriptor(td);
5214 return td->uper_encoder(td, constraints, structure, per_out);
5215}
5216
Lev Walkin59b176e2005-11-26 11:25:14 +00005217
Lev Walkin725883b2006-10-09 12:07:58 +00005218/*** <<< CTDEFS [Identifier] >>> ***/
5219
Lev Walkin2fce55d2013-03-28 05:00:39 -07005220static asn_per_constraints_t asn_PER_type_Identifier_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00005221 { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */,
5222 { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
5223 asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */
5224 asn_PER_MAP_Identifier_1_c2v /* PER code to value map */
5225};
5226
Lev Walkin59b176e2005-11-26 11:25:14 +00005227/*** <<< STAT-DEFS [Identifier] >>> ***/
5228
Lev Walkina7591b52014-10-12 18:37:35 -07005229static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00005230 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
5231};
Lev Walkin59b176e2005-11-26 11:25:14 +00005232asn_TYPE_descriptor_t asn_DEF_Identifier = {
5233 "Identifier",
5234 "Identifier",
5235 Identifier_free,
5236 Identifier_print,
5237 Identifier_constraint,
5238 Identifier_decode_ber,
5239 Identifier_encode_der,
5240 Identifier_decode_xer,
5241 Identifier_encode_xer,
5242 Identifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005243 Identifier_encode_uper,
Lev Walkinba68c912017-07-06 07:52:39 -07005244 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin59b176e2005-11-26 11:25:14 +00005245 0, /* Use generic outmost tag fetcher */
5246 asn_DEF_Identifier_tags_1,
5247 sizeof(asn_DEF_Identifier_tags_1)
5248 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
5249 asn_DEF_Identifier_tags_1, /* Same as above */
5250 sizeof(asn_DEF_Identifier_tags_1)
5251 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00005252 &asn_PER_type_Identifier_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00005253 0, 0, /* No members */
5254 0 /* No specifics */
5255};
5256