blob: 96a4c75074792050d29cc270dadffa4726dd987f [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 Walkin59b176e2005-11-26 11:25:14 +000048 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -070049 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
50 td->elements = asn_DEF_NativeInteger.elements;
51 td->elements_count = asn_DEF_NativeInteger.elements_count;
52 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin59b176e2005-11-26 11:25:14 +000053}
54
55void
56Int1_free(asn_TYPE_descriptor_t *td,
57 void *struct_ptr, int contents_only) {
58 Int1_1_inherit_TYPE_descriptor(td);
59 td->free_struct(td, struct_ptr, contents_only);
60}
61
62int
63Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
64 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
65 Int1_1_inherit_TYPE_descriptor(td);
66 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
67}
68
69asn_dec_rval_t
70Int1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
71 void **structure, const void *bufptr, size_t size, int tag_mode) {
72 Int1_1_inherit_TYPE_descriptor(td);
73 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
74}
75
76asn_enc_rval_t
77Int1_encode_der(asn_TYPE_descriptor_t *td,
78 void *structure, int tag_mode, ber_tlv_tag_t tag,
79 asn_app_consume_bytes_f *cb, void *app_key) {
80 Int1_1_inherit_TYPE_descriptor(td);
81 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
82}
83
84asn_dec_rval_t
85Int1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
86 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
87 Int1_1_inherit_TYPE_descriptor(td);
88 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
89}
90
91asn_enc_rval_t
92Int1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
93 int ilevel, enum xer_encoder_flags_e flags,
94 asn_app_consume_bytes_f *cb, void *app_key) {
95 Int1_1_inherit_TYPE_descriptor(td);
96 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
97}
98
99asn_dec_rval_t
100Int1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
101 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
102 Int1_1_inherit_TYPE_descriptor(td);
103 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
104}
105
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000106asn_enc_rval_t
107Int1_encode_uper(asn_TYPE_descriptor_t *td,
108 asn_per_constraints_t *constraints,
109 void *structure, asn_per_outp_t *per_out) {
110 Int1_1_inherit_TYPE_descriptor(td);
111 return td->uper_encoder(td, constraints, structure, per_out);
112}
113
Lev Walkin59b176e2005-11-26 11:25:14 +0000114
115/*** <<< STAT-DEFS [Int1] >>> ***/
116
Lev Walkina7591b52014-10-12 18:37:35 -0700117static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000118 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
119};
120asn_TYPE_descriptor_t asn_DEF_Int1 = {
121 "Int1",
122 "Int1",
123 Int1_free,
124 Int1_print,
125 Int1_constraint,
126 Int1_decode_ber,
127 Int1_encode_der,
128 Int1_decode_xer,
129 Int1_encode_xer,
130 Int1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000131 Int1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000132 0, /* Use generic outmost tag fetcher */
133 asn_DEF_Int1_tags_1,
134 sizeof(asn_DEF_Int1_tags_1)
135 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
136 asn_DEF_Int1_tags_1, /* Same as above */
137 sizeof(asn_DEF_Int1_tags_1)
138 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
139 0, /* No PER visible constraints */
140 0, 0, /* No members */
141 0 /* No specifics */
142};
143
144
145/*** <<< INCLUDES [Int2] >>> ***/
146
Lev Walkin22b5ed42006-09-13 02:51:20 +0000147#include "Int1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000148
149/*** <<< TYPE-DECLS [Int2] >>> ***/
150
151typedef Int1_t Int2_t;
152
153/*** <<< FUNC-DECLS [Int2] >>> ***/
154
155extern asn_TYPE_descriptor_t asn_DEF_Int2;
156asn_struct_free_f Int2_free;
157asn_struct_print_f Int2_print;
158asn_constr_check_f Int2_constraint;
159ber_type_decoder_f Int2_decode_ber;
160der_type_encoder_f Int2_encode_der;
161xer_type_decoder_f Int2_decode_xer;
162xer_type_encoder_f Int2_encode_xer;
163per_type_decoder_f Int2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000164per_type_encoder_f Int2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000165
166/*** <<< CODE [Int2] >>> ***/
167
168int
169Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000170 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000171 long value;
172
173 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700174 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000175 "%s: value not given (%s:%d)",
176 td->name, __FILE__, __LINE__);
177 return -1;
178 }
179
Lev Walkin2a744a72013-03-27 01:56:23 -0700180 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000181
182 if((value >= 0)) {
183 /* Constraint check succeeded */
184 return 0;
185 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700186 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000187 "%s: constraint failed (%s:%d)",
188 td->name, __FILE__, __LINE__);
189 return -1;
190 }
191}
192
193/*
194 * This type is implemented using Int1,
195 * so here we adjust the DEF accordingly.
196 */
197static void
198Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
199 td->free_struct = asn_DEF_Int1.free_struct;
200 td->print_struct = asn_DEF_Int1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800201 td->check_constraints = asn_DEF_Int1.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000202 td->ber_decoder = asn_DEF_Int1.ber_decoder;
203 td->der_encoder = asn_DEF_Int1.der_encoder;
204 td->xer_decoder = asn_DEF_Int1.xer_decoder;
205 td->xer_encoder = asn_DEF_Int1.xer_encoder;
206 td->uper_decoder = asn_DEF_Int1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000207 td->uper_encoder = asn_DEF_Int1.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000208 if(!td->per_constraints)
209 td->per_constraints = asn_DEF_Int1.per_constraints;
210 td->elements = asn_DEF_Int1.elements;
211 td->elements_count = asn_DEF_Int1.elements_count;
212 td->specifics = asn_DEF_Int1.specifics;
213}
214
215void
216Int2_free(asn_TYPE_descriptor_t *td,
217 void *struct_ptr, int contents_only) {
218 Int2_1_inherit_TYPE_descriptor(td);
219 td->free_struct(td, struct_ptr, contents_only);
220}
221
222int
223Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
224 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
225 Int2_1_inherit_TYPE_descriptor(td);
226 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
227}
228
229asn_dec_rval_t
230Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
231 void **structure, const void *bufptr, size_t size, int tag_mode) {
232 Int2_1_inherit_TYPE_descriptor(td);
233 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
234}
235
236asn_enc_rval_t
237Int2_encode_der(asn_TYPE_descriptor_t *td,
238 void *structure, int tag_mode, ber_tlv_tag_t tag,
239 asn_app_consume_bytes_f *cb, void *app_key) {
240 Int2_1_inherit_TYPE_descriptor(td);
241 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
242}
243
244asn_dec_rval_t
245Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
246 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
247 Int2_1_inherit_TYPE_descriptor(td);
248 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
249}
250
251asn_enc_rval_t
252Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
253 int ilevel, enum xer_encoder_flags_e flags,
254 asn_app_consume_bytes_f *cb, void *app_key) {
255 Int2_1_inherit_TYPE_descriptor(td);
256 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
257}
258
259asn_dec_rval_t
260Int2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
261 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
262 Int2_1_inherit_TYPE_descriptor(td);
263 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
264}
265
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000266asn_enc_rval_t
267Int2_encode_uper(asn_TYPE_descriptor_t *td,
268 asn_per_constraints_t *constraints,
269 void *structure, asn_per_outp_t *per_out) {
270 Int2_1_inherit_TYPE_descriptor(td);
271 return td->uper_encoder(td, constraints, structure, per_out);
272}
273
Lev Walkin59b176e2005-11-26 11:25:14 +0000274
Lev Walkin725883b2006-10-09 12:07:58 +0000275/*** <<< CTDEFS [Int2] >>> ***/
276
Lev Walkin2fce55d2013-03-28 05:00:39 -0700277static asn_per_constraints_t asn_PER_type_Int2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000278 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
279 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
280 0, 0 /* No PER value map */
281};
282
Lev Walkin59b176e2005-11-26 11:25:14 +0000283/*** <<< STAT-DEFS [Int2] >>> ***/
284
Lev Walkina7591b52014-10-12 18:37:35 -0700285static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000286 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
287};
Lev Walkin59b176e2005-11-26 11:25:14 +0000288asn_TYPE_descriptor_t asn_DEF_Int2 = {
289 "Int2",
290 "Int2",
291 Int2_free,
292 Int2_print,
293 Int2_constraint,
294 Int2_decode_ber,
295 Int2_encode_der,
296 Int2_decode_xer,
297 Int2_encode_xer,
298 Int2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000299 Int2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000300 0, /* Use generic outmost tag fetcher */
301 asn_DEF_Int2_tags_1,
302 sizeof(asn_DEF_Int2_tags_1)
303 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
304 asn_DEF_Int2_tags_1, /* Same as above */
305 sizeof(asn_DEF_Int2_tags_1)
306 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000307 &asn_PER_type_Int2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000308 0, 0, /* No members */
309 0 /* No specifics */
310};
311
312
313/*** <<< INCLUDES [Int3] >>> ***/
314
Lev Walkin22b5ed42006-09-13 02:51:20 +0000315#include "Int2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000316
317/*** <<< TYPE-DECLS [Int3] >>> ***/
318
319typedef Int2_t Int3_t;
320
321/*** <<< FUNC-DECLS [Int3] >>> ***/
322
323extern asn_TYPE_descriptor_t asn_DEF_Int3;
324asn_struct_free_f Int3_free;
325asn_struct_print_f Int3_print;
326asn_constr_check_f Int3_constraint;
327ber_type_decoder_f Int3_decode_ber;
328der_type_encoder_f Int3_encode_der;
329xer_type_decoder_f Int3_decode_xer;
330xer_type_encoder_f Int3_encode_xer;
331per_type_decoder_f Int3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000332per_type_encoder_f Int3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000333
334/*** <<< CODE [Int3] >>> ***/
335
336int
337Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000338 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000339 long value;
340
341 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700342 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000343 "%s: value not given (%s:%d)",
344 td->name, __FILE__, __LINE__);
345 return -1;
346 }
347
Lev Walkin2a744a72013-03-27 01:56:23 -0700348 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000349
350 if((value >= 0 && value <= 10)) {
351 /* Constraint check succeeded */
352 return 0;
353 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700354 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000355 "%s: constraint failed (%s:%d)",
356 td->name, __FILE__, __LINE__);
357 return -1;
358 }
359}
360
361/*
362 * This type is implemented using Int2,
363 * so here we adjust the DEF accordingly.
364 */
365static void
366Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
367 td->free_struct = asn_DEF_Int2.free_struct;
368 td->print_struct = asn_DEF_Int2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800369 td->check_constraints = asn_DEF_Int2.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000370 td->ber_decoder = asn_DEF_Int2.ber_decoder;
371 td->der_encoder = asn_DEF_Int2.der_encoder;
372 td->xer_decoder = asn_DEF_Int2.xer_decoder;
373 td->xer_encoder = asn_DEF_Int2.xer_encoder;
374 td->uper_decoder = asn_DEF_Int2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000375 td->uper_encoder = asn_DEF_Int2.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000376 if(!td->per_constraints)
377 td->per_constraints = asn_DEF_Int2.per_constraints;
378 td->elements = asn_DEF_Int2.elements;
379 td->elements_count = asn_DEF_Int2.elements_count;
380 td->specifics = asn_DEF_Int2.specifics;
381}
382
383void
384Int3_free(asn_TYPE_descriptor_t *td,
385 void *struct_ptr, int contents_only) {
386 Int3_1_inherit_TYPE_descriptor(td);
387 td->free_struct(td, struct_ptr, contents_only);
388}
389
390int
391Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
392 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
393 Int3_1_inherit_TYPE_descriptor(td);
394 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
395}
396
397asn_dec_rval_t
398Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
399 void **structure, const void *bufptr, size_t size, int tag_mode) {
400 Int3_1_inherit_TYPE_descriptor(td);
401 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
402}
403
404asn_enc_rval_t
405Int3_encode_der(asn_TYPE_descriptor_t *td,
406 void *structure, int tag_mode, ber_tlv_tag_t tag,
407 asn_app_consume_bytes_f *cb, void *app_key) {
408 Int3_1_inherit_TYPE_descriptor(td);
409 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
410}
411
412asn_dec_rval_t
413Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
414 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
415 Int3_1_inherit_TYPE_descriptor(td);
416 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
417}
418
419asn_enc_rval_t
420Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
421 int ilevel, enum xer_encoder_flags_e flags,
422 asn_app_consume_bytes_f *cb, void *app_key) {
423 Int3_1_inherit_TYPE_descriptor(td);
424 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
425}
426
427asn_dec_rval_t
428Int3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
429 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
430 Int3_1_inherit_TYPE_descriptor(td);
431 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
432}
433
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000434asn_enc_rval_t
435Int3_encode_uper(asn_TYPE_descriptor_t *td,
436 asn_per_constraints_t *constraints,
437 void *structure, asn_per_outp_t *per_out) {
438 Int3_1_inherit_TYPE_descriptor(td);
439 return td->uper_encoder(td, constraints, structure, per_out);
440}
441
Lev Walkin59b176e2005-11-26 11:25:14 +0000442
Lev Walkin725883b2006-10-09 12:07:58 +0000443/*** <<< CTDEFS [Int3] >>> ***/
444
Lev Walkin2fce55d2013-03-28 05:00:39 -0700445static asn_per_constraints_t asn_PER_type_Int3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000446 { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
447 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
448 0, 0 /* No PER value map */
449};
450
Lev Walkin59b176e2005-11-26 11:25:14 +0000451/*** <<< STAT-DEFS [Int3] >>> ***/
452
Lev Walkina7591b52014-10-12 18:37:35 -0700453static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000454 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
455};
Lev Walkin59b176e2005-11-26 11:25:14 +0000456asn_TYPE_descriptor_t asn_DEF_Int3 = {
457 "Int3",
458 "Int3",
459 Int3_free,
460 Int3_print,
461 Int3_constraint,
462 Int3_decode_ber,
463 Int3_encode_der,
464 Int3_decode_xer,
465 Int3_encode_xer,
466 Int3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000467 Int3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000468 0, /* Use generic outmost tag fetcher */
469 asn_DEF_Int3_tags_1,
470 sizeof(asn_DEF_Int3_tags_1)
471 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
472 asn_DEF_Int3_tags_1, /* Same as above */
473 sizeof(asn_DEF_Int3_tags_1)
474 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000475 &asn_PER_type_Int3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000476 0, 0, /* No members */
477 0 /* No specifics */
478};
479
480
481/*** <<< INCLUDES [Int4] >>> ***/
482
Lev Walkin22b5ed42006-09-13 02:51:20 +0000483#include "Int3.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000484
485/*** <<< TYPE-DECLS [Int4] >>> ***/
486
487typedef Int3_t Int4_t;
488
489/*** <<< FUNC-DECLS [Int4] >>> ***/
490
491extern asn_TYPE_descriptor_t asn_DEF_Int4;
492asn_struct_free_f Int4_free;
493asn_struct_print_f Int4_print;
494asn_constr_check_f Int4_constraint;
495ber_type_decoder_f Int4_decode_ber;
496der_type_encoder_f Int4_encode_der;
497xer_type_decoder_f Int4_decode_xer;
498xer_type_encoder_f Int4_encode_xer;
499per_type_decoder_f Int4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000500per_type_encoder_f Int4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000501
502/*** <<< CODE [Int4] >>> ***/
503
504int
505Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000506 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000507 long value;
508
509 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700510 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000511 "%s: value not given (%s:%d)",
512 td->name, __FILE__, __LINE__);
513 return -1;
514 }
515
Lev Walkin2a744a72013-03-27 01:56:23 -0700516 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000517
518 if((value >= 1 && value <= 10)) {
519 /* Constraint check succeeded */
520 return 0;
521 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700522 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000523 "%s: constraint failed (%s:%d)",
524 td->name, __FILE__, __LINE__);
525 return -1;
526 }
527}
528
529/*
530 * This type is implemented using Int3,
531 * so here we adjust the DEF accordingly.
532 */
533static void
534Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
535 td->free_struct = asn_DEF_Int3.free_struct;
536 td->print_struct = asn_DEF_Int3.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800537 td->check_constraints = asn_DEF_Int3.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000538 td->ber_decoder = asn_DEF_Int3.ber_decoder;
539 td->der_encoder = asn_DEF_Int3.der_encoder;
540 td->xer_decoder = asn_DEF_Int3.xer_decoder;
541 td->xer_encoder = asn_DEF_Int3.xer_encoder;
542 td->uper_decoder = asn_DEF_Int3.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000543 td->uper_encoder = asn_DEF_Int3.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000544 if(!td->per_constraints)
545 td->per_constraints = asn_DEF_Int3.per_constraints;
546 td->elements = asn_DEF_Int3.elements;
547 td->elements_count = asn_DEF_Int3.elements_count;
548 td->specifics = asn_DEF_Int3.specifics;
549}
550
551void
552Int4_free(asn_TYPE_descriptor_t *td,
553 void *struct_ptr, int contents_only) {
554 Int4_1_inherit_TYPE_descriptor(td);
555 td->free_struct(td, struct_ptr, contents_only);
556}
557
558int
559Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
560 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
561 Int4_1_inherit_TYPE_descriptor(td);
562 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
563}
564
565asn_dec_rval_t
566Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
567 void **structure, const void *bufptr, size_t size, int tag_mode) {
568 Int4_1_inherit_TYPE_descriptor(td);
569 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
570}
571
572asn_enc_rval_t
573Int4_encode_der(asn_TYPE_descriptor_t *td,
574 void *structure, int tag_mode, ber_tlv_tag_t tag,
575 asn_app_consume_bytes_f *cb, void *app_key) {
576 Int4_1_inherit_TYPE_descriptor(td);
577 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
578}
579
580asn_dec_rval_t
581Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
582 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
583 Int4_1_inherit_TYPE_descriptor(td);
584 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
585}
586
587asn_enc_rval_t
588Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
589 int ilevel, enum xer_encoder_flags_e flags,
590 asn_app_consume_bytes_f *cb, void *app_key) {
591 Int4_1_inherit_TYPE_descriptor(td);
592 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
593}
594
595asn_dec_rval_t
596Int4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
597 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
598 Int4_1_inherit_TYPE_descriptor(td);
599 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
600}
601
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000602asn_enc_rval_t
603Int4_encode_uper(asn_TYPE_descriptor_t *td,
604 asn_per_constraints_t *constraints,
605 void *structure, asn_per_outp_t *per_out) {
606 Int4_1_inherit_TYPE_descriptor(td);
607 return td->uper_encoder(td, constraints, structure, per_out);
608}
609
Lev Walkin59b176e2005-11-26 11:25:14 +0000610
Lev Walkin725883b2006-10-09 12:07:58 +0000611/*** <<< CTDEFS [Int4] >>> ***/
612
Lev Walkin2fce55d2013-03-28 05:00:39 -0700613static asn_per_constraints_t asn_PER_type_Int4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000614 { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
615 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
616 0, 0 /* No PER value map */
617};
618
Lev Walkin59b176e2005-11-26 11:25:14 +0000619/*** <<< STAT-DEFS [Int4] >>> ***/
620
Lev Walkina7591b52014-10-12 18:37:35 -0700621static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000622 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
623};
Lev Walkin59b176e2005-11-26 11:25:14 +0000624asn_TYPE_descriptor_t asn_DEF_Int4 = {
625 "Int4",
626 "Int4",
627 Int4_free,
628 Int4_print,
629 Int4_constraint,
630 Int4_decode_ber,
631 Int4_encode_der,
632 Int4_decode_xer,
633 Int4_encode_xer,
634 Int4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000635 Int4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000636 0, /* Use generic outmost tag fetcher */
637 asn_DEF_Int4_tags_1,
638 sizeof(asn_DEF_Int4_tags_1)
639 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
640 asn_DEF_Int4_tags_1, /* Same as above */
641 sizeof(asn_DEF_Int4_tags_1)
642 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000643 &asn_PER_type_Int4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000644 0, 0, /* No members */
645 0 /* No specifics */
646};
647
648
649/*** <<< INCLUDES [Int5] >>> ***/
650
Lev Walkin22b5ed42006-09-13 02:51:20 +0000651#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000652
653/*** <<< TYPE-DECLS [Int5] >>> ***/
654
655typedef Int4_t Int5_t;
656
657/*** <<< FUNC-DECLS [Int5] >>> ***/
658
659extern asn_TYPE_descriptor_t asn_DEF_Int5;
660asn_struct_free_f Int5_free;
661asn_struct_print_f Int5_print;
662asn_constr_check_f Int5_constraint;
663ber_type_decoder_f Int5_decode_ber;
664der_type_encoder_f Int5_encode_der;
665xer_type_decoder_f Int5_decode_xer;
666xer_type_encoder_f Int5_encode_xer;
667per_type_decoder_f Int5_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000668per_type_encoder_f Int5_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000669
670/*** <<< CODE [Int5] >>> ***/
671
672int
673Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000674 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000675 long value;
676
677 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700678 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000679 "%s: value not given (%s:%d)",
680 td->name, __FILE__, __LINE__);
681 return -1;
682 }
683
Lev Walkin2a744a72013-03-27 01:56:23 -0700684 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000685
686 if((value == 5)) {
687 /* Constraint check succeeded */
688 return 0;
689 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700690 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000691 "%s: constraint failed (%s:%d)",
692 td->name, __FILE__, __LINE__);
693 return -1;
694 }
695}
696
697/*
698 * This type is implemented using Int4,
699 * so here we adjust the DEF accordingly.
700 */
701static void
702Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
703 td->free_struct = asn_DEF_Int4.free_struct;
704 td->print_struct = asn_DEF_Int4.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800705 td->check_constraints = asn_DEF_Int4.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000706 td->ber_decoder = asn_DEF_Int4.ber_decoder;
707 td->der_encoder = asn_DEF_Int4.der_encoder;
708 td->xer_decoder = asn_DEF_Int4.xer_decoder;
709 td->xer_encoder = asn_DEF_Int4.xer_encoder;
710 td->uper_decoder = asn_DEF_Int4.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000711 td->uper_encoder = asn_DEF_Int4.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000712 if(!td->per_constraints)
713 td->per_constraints = asn_DEF_Int4.per_constraints;
714 td->elements = asn_DEF_Int4.elements;
715 td->elements_count = asn_DEF_Int4.elements_count;
716 td->specifics = asn_DEF_Int4.specifics;
717}
718
719void
720Int5_free(asn_TYPE_descriptor_t *td,
721 void *struct_ptr, int contents_only) {
722 Int5_1_inherit_TYPE_descriptor(td);
723 td->free_struct(td, struct_ptr, contents_only);
724}
725
726int
727Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
728 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
729 Int5_1_inherit_TYPE_descriptor(td);
730 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
731}
732
733asn_dec_rval_t
734Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
735 void **structure, const void *bufptr, size_t size, int tag_mode) {
736 Int5_1_inherit_TYPE_descriptor(td);
737 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
738}
739
740asn_enc_rval_t
741Int5_encode_der(asn_TYPE_descriptor_t *td,
742 void *structure, int tag_mode, ber_tlv_tag_t tag,
743 asn_app_consume_bytes_f *cb, void *app_key) {
744 Int5_1_inherit_TYPE_descriptor(td);
745 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
746}
747
748asn_dec_rval_t
749Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
750 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
751 Int5_1_inherit_TYPE_descriptor(td);
752 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
753}
754
755asn_enc_rval_t
756Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
757 int ilevel, enum xer_encoder_flags_e flags,
758 asn_app_consume_bytes_f *cb, void *app_key) {
759 Int5_1_inherit_TYPE_descriptor(td);
760 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
761}
762
763asn_dec_rval_t
764Int5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
765 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
766 Int5_1_inherit_TYPE_descriptor(td);
767 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
768}
769
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000770asn_enc_rval_t
771Int5_encode_uper(asn_TYPE_descriptor_t *td,
772 asn_per_constraints_t *constraints,
773 void *structure, asn_per_outp_t *per_out) {
774 Int5_1_inherit_TYPE_descriptor(td);
775 return td->uper_encoder(td, constraints, structure, per_out);
776}
777
Lev Walkin59b176e2005-11-26 11:25:14 +0000778
Lev Walkin725883b2006-10-09 12:07:58 +0000779/*** <<< CTDEFS [Int5] >>> ***/
780
Lev Walkin2fce55d2013-03-28 05:00:39 -0700781static asn_per_constraints_t asn_PER_type_Int5_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000782 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
783 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
784 0, 0 /* No PER value map */
785};
786
Lev Walkin59b176e2005-11-26 11:25:14 +0000787/*** <<< STAT-DEFS [Int5] >>> ***/
788
Lev Walkina7591b52014-10-12 18:37:35 -0700789static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000790 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
791};
Lev Walkin59b176e2005-11-26 11:25:14 +0000792asn_TYPE_descriptor_t asn_DEF_Int5 = {
793 "Int5",
794 "Int5",
795 Int5_free,
796 Int5_print,
797 Int5_constraint,
798 Int5_decode_ber,
799 Int5_encode_der,
800 Int5_decode_xer,
801 Int5_encode_xer,
802 Int5_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000803 Int5_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000804 0, /* Use generic outmost tag fetcher */
805 asn_DEF_Int5_tags_1,
806 sizeof(asn_DEF_Int5_tags_1)
807 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
808 asn_DEF_Int5_tags_1, /* Same as above */
809 sizeof(asn_DEF_Int5_tags_1)
810 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000811 &asn_PER_type_Int5_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000812 0, 0, /* No members */
813 0 /* No specifics */
814};
815
816
817/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
818
Lev Walkin2a744a72013-03-27 01:56:23 -0700819#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +0000820
821/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
822
Lev Walkin2a744a72013-03-27 01:56:23 -0700823typedef long ExtensibleExtensions_t;
Lev Walkin59b176e2005-11-26 11:25:14 +0000824
825/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
826
827extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
828asn_struct_free_f ExtensibleExtensions_free;
829asn_struct_print_f ExtensibleExtensions_print;
830asn_constr_check_f ExtensibleExtensions_constraint;
831ber_type_decoder_f ExtensibleExtensions_decode_ber;
832der_type_encoder_f ExtensibleExtensions_encode_der;
833xer_type_decoder_f ExtensibleExtensions_decode_xer;
834xer_type_encoder_f ExtensibleExtensions_encode_xer;
835per_type_decoder_f ExtensibleExtensions_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000836per_type_encoder_f ExtensibleExtensions_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000837
838/*** <<< CODE [ExtensibleExtensions] >>> ***/
839
840int
841ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000842 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000843 long value;
844
845 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700846 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000847 "%s: value not given (%s:%d)",
848 td->name, __FILE__, __LINE__);
849 return -1;
850 }
851
Lev Walkin2a744a72013-03-27 01:56:23 -0700852 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000853
854 if((value >= 1 && value <= 256)) {
855 /* Constraint check succeeded */
856 return 0;
857 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700858 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000859 "%s: constraint failed (%s:%d)",
860 td->name, __FILE__, __LINE__);
861 return -1;
862 }
863}
864
865/*
Lev Walkin2a744a72013-03-27 01:56:23 -0700866 * This type is implemented using NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +0000867 * so here we adjust the DEF accordingly.
868 */
869static void
870ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -0700871 td->free_struct = asn_DEF_NativeInteger.free_struct;
872 td->print_struct = asn_DEF_NativeInteger.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800873 td->check_constraints = asn_DEF_NativeInteger.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -0700874 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
875 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
876 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
877 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
878 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
879 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000880 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -0700881 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
882 td->elements = asn_DEF_NativeInteger.elements;
883 td->elements_count = asn_DEF_NativeInteger.elements_count;
884 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin59b176e2005-11-26 11:25:14 +0000885}
886
887void
888ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
889 void *struct_ptr, int contents_only) {
890 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
891 td->free_struct(td, struct_ptr, contents_only);
892}
893
894int
895ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
896 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
897 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
898 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
899}
900
901asn_dec_rval_t
902ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
903 void **structure, const void *bufptr, size_t size, int tag_mode) {
904 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
905 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
906}
907
908asn_enc_rval_t
909ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
910 void *structure, int tag_mode, ber_tlv_tag_t tag,
911 asn_app_consume_bytes_f *cb, void *app_key) {
912 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
913 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
914}
915
916asn_dec_rval_t
917ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
918 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
919 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
920 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
921}
922
923asn_enc_rval_t
924ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
925 int ilevel, enum xer_encoder_flags_e flags,
926 asn_app_consume_bytes_f *cb, void *app_key) {
927 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
928 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
929}
930
931asn_dec_rval_t
932ExtensibleExtensions_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
933 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
934 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
935 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
936}
937
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000938asn_enc_rval_t
939ExtensibleExtensions_encode_uper(asn_TYPE_descriptor_t *td,
940 asn_per_constraints_t *constraints,
941 void *structure, asn_per_outp_t *per_out) {
942 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
943 return td->uper_encoder(td, constraints, structure, per_out);
944}
945
Lev Walkin59b176e2005-11-26 11:25:14 +0000946
Lev Walkin725883b2006-10-09 12:07:58 +0000947/*** <<< CTDEFS [ExtensibleExtensions] >>> ***/
948
Lev Walkin2fce55d2013-03-28 05:00:39 -0700949static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +0000950 { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
951 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
952 0, 0 /* No PER value map */
953};
954
Lev Walkin59b176e2005-11-26 11:25:14 +0000955/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
956
Lev Walkina7591b52014-10-12 18:37:35 -0700957static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000958 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
959};
Lev Walkin59b176e2005-11-26 11:25:14 +0000960asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
961 "ExtensibleExtensions",
962 "ExtensibleExtensions",
963 ExtensibleExtensions_free,
964 ExtensibleExtensions_print,
965 ExtensibleExtensions_constraint,
966 ExtensibleExtensions_decode_ber,
967 ExtensibleExtensions_encode_der,
968 ExtensibleExtensions_decode_xer,
969 ExtensibleExtensions_encode_xer,
970 ExtensibleExtensions_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000971 ExtensibleExtensions_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000972 0, /* Use generic outmost tag fetcher */
973 asn_DEF_ExtensibleExtensions_tags_1,
974 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
975 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
976 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
977 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
978 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000979 &asn_PER_type_ExtensibleExtensions_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000980 0, 0, /* No members */
981 0 /* No specifics */
982};
983
984
985/*** <<< INCLUDES [Str1] >>> ***/
986
987#include <IA5String.h>
988
989/*** <<< TYPE-DECLS [Str1] >>> ***/
990
991typedef IA5String_t Str1_t;
992
993/*** <<< FUNC-DECLS [Str1] >>> ***/
994
995extern asn_TYPE_descriptor_t asn_DEF_Str1;
996asn_struct_free_f Str1_free;
997asn_struct_print_f Str1_print;
998asn_constr_check_f Str1_constraint;
999ber_type_decoder_f Str1_decode_ber;
1000der_type_encoder_f Str1_encode_der;
1001xer_type_decoder_f Str1_decode_xer;
1002xer_type_encoder_f Str1_encode_xer;
1003per_type_decoder_f Str1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001004per_type_encoder_f Str1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001005
1006/*** <<< CODE [Str1] >>> ***/
1007
1008int
1009Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001010 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001011 /* Replace with underlying type checker */
1012 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00001013 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00001014}
1015
1016/*
1017 * This type is implemented using IA5String,
1018 * so here we adjust the DEF accordingly.
1019 */
1020static void
1021Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1022 td->free_struct = asn_DEF_IA5String.free_struct;
1023 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001024 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001025 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1026 td->der_encoder = asn_DEF_IA5String.der_encoder;
1027 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1028 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1029 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001030 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001031 if(!td->per_constraints)
1032 td->per_constraints = asn_DEF_IA5String.per_constraints;
1033 td->elements = asn_DEF_IA5String.elements;
1034 td->elements_count = asn_DEF_IA5String.elements_count;
1035 td->specifics = asn_DEF_IA5String.specifics;
1036}
1037
1038void
1039Str1_free(asn_TYPE_descriptor_t *td,
1040 void *struct_ptr, int contents_only) {
1041 Str1_1_inherit_TYPE_descriptor(td);
1042 td->free_struct(td, struct_ptr, contents_only);
1043}
1044
1045int
1046Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1047 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1048 Str1_1_inherit_TYPE_descriptor(td);
1049 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1050}
1051
1052asn_dec_rval_t
1053Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1054 void **structure, const void *bufptr, size_t size, int tag_mode) {
1055 Str1_1_inherit_TYPE_descriptor(td);
1056 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1057}
1058
1059asn_enc_rval_t
1060Str1_encode_der(asn_TYPE_descriptor_t *td,
1061 void *structure, int tag_mode, ber_tlv_tag_t tag,
1062 asn_app_consume_bytes_f *cb, void *app_key) {
1063 Str1_1_inherit_TYPE_descriptor(td);
1064 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1065}
1066
1067asn_dec_rval_t
1068Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1069 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1070 Str1_1_inherit_TYPE_descriptor(td);
1071 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1072}
1073
1074asn_enc_rval_t
1075Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1076 int ilevel, enum xer_encoder_flags_e flags,
1077 asn_app_consume_bytes_f *cb, void *app_key) {
1078 Str1_1_inherit_TYPE_descriptor(td);
1079 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1080}
1081
1082asn_dec_rval_t
1083Str1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1084 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1085 Str1_1_inherit_TYPE_descriptor(td);
1086 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1087}
1088
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001089asn_enc_rval_t
1090Str1_encode_uper(asn_TYPE_descriptor_t *td,
1091 asn_per_constraints_t *constraints,
1092 void *structure, asn_per_outp_t *per_out) {
1093 Str1_1_inherit_TYPE_descriptor(td);
1094 return td->uper_encoder(td, constraints, structure, per_out);
1095}
1096
Lev Walkin59b176e2005-11-26 11:25:14 +00001097
1098/*** <<< STAT-DEFS [Str1] >>> ***/
1099
Lev Walkina7591b52014-10-12 18:37:35 -07001100static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001101 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1102};
1103asn_TYPE_descriptor_t asn_DEF_Str1 = {
1104 "Str1",
1105 "Str1",
1106 Str1_free,
1107 Str1_print,
1108 Str1_constraint,
1109 Str1_decode_ber,
1110 Str1_encode_der,
1111 Str1_decode_xer,
1112 Str1_encode_xer,
1113 Str1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001114 Str1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001115 0, /* Use generic outmost tag fetcher */
1116 asn_DEF_Str1_tags_1,
1117 sizeof(asn_DEF_Str1_tags_1)
1118 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1119 asn_DEF_Str1_tags_1, /* Same as above */
1120 sizeof(asn_DEF_Str1_tags_1)
1121 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1122 0, /* No PER visible constraints */
1123 0, 0, /* No members */
1124 0 /* No specifics */
1125};
1126
1127
1128/*** <<< INCLUDES [Str2] >>> ***/
1129
Lev Walkin22b5ed42006-09-13 02:51:20 +00001130#include "Str1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001131
1132/*** <<< TYPE-DECLS [Str2] >>> ***/
1133
1134typedef Str1_t Str2_t;
1135
1136/*** <<< FUNC-DECLS [Str2] >>> ***/
1137
1138extern asn_TYPE_descriptor_t asn_DEF_Str2;
1139asn_struct_free_f Str2_free;
1140asn_struct_print_f Str2_print;
1141asn_constr_check_f Str2_constraint;
1142ber_type_decoder_f Str2_decode_ber;
1143der_type_encoder_f Str2_encode_der;
1144xer_type_decoder_f Str2_decode_xer;
1145xer_type_encoder_f Str2_encode_xer;
1146per_type_decoder_f Str2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001147per_type_encoder_f Str2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001148
1149/*** <<< CTABLES [Str2] >>> ***/
1150
1151static int check_permitted_alphabet_1(const void *sptr) {
1152 /* The underlying type is IA5String */
1153 const IA5String_t *st = (const IA5String_t *)sptr;
1154 const uint8_t *ch = st->buf;
1155 const uint8_t *end = ch + st->size;
1156
1157 for(; ch < end; ch++) {
1158 uint8_t cv = *ch;
1159 if(!(cv <= 127)) return -1;
1160 }
1161 return 0;
1162}
1163
1164
1165/*** <<< CODE [Str2] >>> ***/
1166
1167int
1168Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001169 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001170 const Str1_t *st = (const Str1_t *)sptr;
1171 size_t size;
1172
1173 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001174 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001175 "%s: value not given (%s:%d)",
1176 td->name, __FILE__, __LINE__);
1177 return -1;
1178 }
1179
1180 size = st->size;
1181
1182 if(((size <= 20) || (size >= 25 && size <= 30))
1183 && !check_permitted_alphabet_1(st)) {
1184 /* Constraint check succeeded */
1185 return 0;
1186 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001187 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001188 "%s: constraint failed (%s:%d)",
1189 td->name, __FILE__, __LINE__);
1190 return -1;
1191 }
1192}
1193
1194/*
1195 * This type is implemented using Str1,
1196 * so here we adjust the DEF accordingly.
1197 */
1198static void
1199Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1200 td->free_struct = asn_DEF_Str1.free_struct;
1201 td->print_struct = asn_DEF_Str1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001202 td->check_constraints = asn_DEF_Str1.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001203 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1204 td->der_encoder = asn_DEF_Str1.der_encoder;
1205 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1206 td->xer_encoder = asn_DEF_Str1.xer_encoder;
1207 td->uper_decoder = asn_DEF_Str1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001208 td->uper_encoder = asn_DEF_Str1.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001209 if(!td->per_constraints)
1210 td->per_constraints = asn_DEF_Str1.per_constraints;
1211 td->elements = asn_DEF_Str1.elements;
1212 td->elements_count = asn_DEF_Str1.elements_count;
1213 td->specifics = asn_DEF_Str1.specifics;
1214}
1215
1216void
1217Str2_free(asn_TYPE_descriptor_t *td,
1218 void *struct_ptr, int contents_only) {
1219 Str2_1_inherit_TYPE_descriptor(td);
1220 td->free_struct(td, struct_ptr, contents_only);
1221}
1222
1223int
1224Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1225 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1226 Str2_1_inherit_TYPE_descriptor(td);
1227 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1228}
1229
1230asn_dec_rval_t
1231Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1232 void **structure, const void *bufptr, size_t size, int tag_mode) {
1233 Str2_1_inherit_TYPE_descriptor(td);
1234 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1235}
1236
1237asn_enc_rval_t
1238Str2_encode_der(asn_TYPE_descriptor_t *td,
1239 void *structure, int tag_mode, ber_tlv_tag_t tag,
1240 asn_app_consume_bytes_f *cb, void *app_key) {
1241 Str2_1_inherit_TYPE_descriptor(td);
1242 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1243}
1244
1245asn_dec_rval_t
1246Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1247 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1248 Str2_1_inherit_TYPE_descriptor(td);
1249 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1250}
1251
1252asn_enc_rval_t
1253Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1254 int ilevel, enum xer_encoder_flags_e flags,
1255 asn_app_consume_bytes_f *cb, void *app_key) {
1256 Str2_1_inherit_TYPE_descriptor(td);
1257 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1258}
1259
1260asn_dec_rval_t
1261Str2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1262 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1263 Str2_1_inherit_TYPE_descriptor(td);
1264 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1265}
1266
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001267asn_enc_rval_t
1268Str2_encode_uper(asn_TYPE_descriptor_t *td,
1269 asn_per_constraints_t *constraints,
1270 void *structure, asn_per_outp_t *per_out) {
1271 Str2_1_inherit_TYPE_descriptor(td);
1272 return td->uper_encoder(td, constraints, structure, per_out);
1273}
1274
Lev Walkin59b176e2005-11-26 11:25:14 +00001275
Lev Walkin725883b2006-10-09 12:07:58 +00001276/*** <<< CTDEFS [Str2] >>> ***/
1277
Lev Walkin2fce55d2013-03-28 05:00:39 -07001278static asn_per_constraints_t asn_PER_type_Str2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001279 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1280 { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */,
1281 0, 0 /* No PER character map necessary */
1282};
1283
Lev Walkin59b176e2005-11-26 11:25:14 +00001284/*** <<< STAT-DEFS [Str2] >>> ***/
1285
Lev Walkina7591b52014-10-12 18:37:35 -07001286static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001287 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1288};
Lev Walkin59b176e2005-11-26 11:25:14 +00001289asn_TYPE_descriptor_t asn_DEF_Str2 = {
1290 "Str2",
1291 "Str2",
1292 Str2_free,
1293 Str2_print,
1294 Str2_constraint,
1295 Str2_decode_ber,
1296 Str2_encode_der,
1297 Str2_decode_xer,
1298 Str2_encode_xer,
1299 Str2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001300 Str2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001301 0, /* Use generic outmost tag fetcher */
1302 asn_DEF_Str2_tags_1,
1303 sizeof(asn_DEF_Str2_tags_1)
1304 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1305 asn_DEF_Str2_tags_1, /* Same as above */
1306 sizeof(asn_DEF_Str2_tags_1)
1307 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001308 &asn_PER_type_Str2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001309 0, 0, /* No members */
1310 0 /* No specifics */
1311};
1312
1313
1314/*** <<< INCLUDES [Str3] >>> ***/
1315
Lev Walkin22b5ed42006-09-13 02:51:20 +00001316#include "Str2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001317
1318/*** <<< TYPE-DECLS [Str3] >>> ***/
1319
1320typedef Str2_t Str3_t;
1321
1322/*** <<< FUNC-DECLS [Str3] >>> ***/
1323
1324extern asn_TYPE_descriptor_t asn_DEF_Str3;
1325asn_struct_free_f Str3_free;
1326asn_struct_print_f Str3_print;
1327asn_constr_check_f Str3_constraint;
1328ber_type_decoder_f Str3_decode_ber;
1329der_type_encoder_f Str3_encode_der;
1330xer_type_decoder_f Str3_decode_xer;
1331xer_type_encoder_f Str3_encode_xer;
1332per_type_decoder_f Str3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001333per_type_encoder_f Str3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001334
1335/*** <<< CTABLES [Str3] >>> ***/
1336
Lev Walkina7591b52014-10-12 18:37:35 -07001337static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1339 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1341 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1342 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
1343 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1344 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin59b176e2005-11-26 11:25:14 +00001345};
Lev Walkina7591b52014-10-12 18:37:35 -07001346static const int permitted_alphabet_code2value_1[6] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000134765,66,67,100,101,102,};
1348
Lev Walkin59b176e2005-11-26 11:25:14 +00001349
1350static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07001351 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00001352 /* The underlying type is IA5String */
1353 const IA5String_t *st = (const IA5String_t *)sptr;
1354 const uint8_t *ch = st->buf;
1355 const uint8_t *end = ch + st->size;
1356
1357 for(; ch < end; ch++) {
1358 uint8_t cv = *ch;
1359 if(!table[cv]) return -1;
1360 }
1361 return 0;
1362}
1363
1364
1365/*** <<< CODE [Str3] >>> ***/
1366
1367int
1368Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001369 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001370 const Str2_t *st = (const Str2_t *)sptr;
1371 size_t size;
1372
1373 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001374 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001375 "%s: value not given (%s:%d)",
1376 td->name, __FILE__, __LINE__);
1377 return -1;
1378 }
1379
1380 size = st->size;
1381
1382 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
1383 && !check_permitted_alphabet_1(st)) {
1384 /* Constraint check succeeded */
1385 return 0;
1386 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001387 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001388 "%s: constraint failed (%s:%d)",
1389 td->name, __FILE__, __LINE__);
1390 return -1;
1391 }
1392}
1393
Lev Walkin725883b2006-10-09 12:07:58 +00001394static int asn_PER_MAP_Str3_1_v2c(unsigned int value) {
1395 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
1396 return -1;
1397 return permitted_alphabet_table_1[value] - 1;
1398}
1399static int asn_PER_MAP_Str3_1_c2v(unsigned int code) {
1400 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
1401 return -1;
1402 return permitted_alphabet_code2value_1[code];
1403}
Lev Walkin59b176e2005-11-26 11:25:14 +00001404/*
1405 * This type is implemented using Str2,
1406 * so here we adjust the DEF accordingly.
1407 */
1408static void
1409Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1410 td->free_struct = asn_DEF_Str2.free_struct;
1411 td->print_struct = asn_DEF_Str2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001412 td->check_constraints = asn_DEF_Str2.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001413 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1414 td->der_encoder = asn_DEF_Str2.der_encoder;
1415 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1416 td->xer_encoder = asn_DEF_Str2.xer_encoder;
1417 td->uper_decoder = asn_DEF_Str2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001418 td->uper_encoder = asn_DEF_Str2.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001419 if(!td->per_constraints)
1420 td->per_constraints = asn_DEF_Str2.per_constraints;
1421 td->elements = asn_DEF_Str2.elements;
1422 td->elements_count = asn_DEF_Str2.elements_count;
1423 td->specifics = asn_DEF_Str2.specifics;
1424}
1425
1426void
1427Str3_free(asn_TYPE_descriptor_t *td,
1428 void *struct_ptr, int contents_only) {
1429 Str3_1_inherit_TYPE_descriptor(td);
1430 td->free_struct(td, struct_ptr, contents_only);
1431}
1432
1433int
1434Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1435 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1436 Str3_1_inherit_TYPE_descriptor(td);
1437 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1438}
1439
1440asn_dec_rval_t
1441Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1442 void **structure, const void *bufptr, size_t size, int tag_mode) {
1443 Str3_1_inherit_TYPE_descriptor(td);
1444 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1445}
1446
1447asn_enc_rval_t
1448Str3_encode_der(asn_TYPE_descriptor_t *td,
1449 void *structure, int tag_mode, ber_tlv_tag_t tag,
1450 asn_app_consume_bytes_f *cb, void *app_key) {
1451 Str3_1_inherit_TYPE_descriptor(td);
1452 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1453}
1454
1455asn_dec_rval_t
1456Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1457 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1458 Str3_1_inherit_TYPE_descriptor(td);
1459 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1460}
1461
1462asn_enc_rval_t
1463Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1464 int ilevel, enum xer_encoder_flags_e flags,
1465 asn_app_consume_bytes_f *cb, void *app_key) {
1466 Str3_1_inherit_TYPE_descriptor(td);
1467 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1468}
1469
1470asn_dec_rval_t
1471Str3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1472 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1473 Str3_1_inherit_TYPE_descriptor(td);
1474 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1475}
1476
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001477asn_enc_rval_t
1478Str3_encode_uper(asn_TYPE_descriptor_t *td,
1479 asn_per_constraints_t *constraints,
1480 void *structure, asn_per_outp_t *per_out) {
1481 Str3_1_inherit_TYPE_descriptor(td);
1482 return td->uper_encoder(td, constraints, structure, per_out);
1483}
1484
Lev Walkin59b176e2005-11-26 11:25:14 +00001485
Lev Walkin725883b2006-10-09 12:07:58 +00001486/*** <<< CTDEFS [Str3] >>> ***/
1487
Lev Walkin2fce55d2013-03-28 05:00:39 -07001488static asn_per_constraints_t asn_PER_type_Str3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001489 { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */,
1490 { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */,
1491 asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */
1492 asn_PER_MAP_Str3_1_c2v /* PER code to value map */
1493};
1494
Lev Walkin59b176e2005-11-26 11:25:14 +00001495/*** <<< STAT-DEFS [Str3] >>> ***/
1496
Lev Walkina7591b52014-10-12 18:37:35 -07001497static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001498 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1499};
Lev Walkin59b176e2005-11-26 11:25:14 +00001500asn_TYPE_descriptor_t asn_DEF_Str3 = {
1501 "Str3",
1502 "Str3",
1503 Str3_free,
1504 Str3_print,
1505 Str3_constraint,
1506 Str3_decode_ber,
1507 Str3_encode_der,
1508 Str3_decode_xer,
1509 Str3_encode_xer,
1510 Str3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001511 Str3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001512 0, /* Use generic outmost tag fetcher */
1513 asn_DEF_Str3_tags_1,
1514 sizeof(asn_DEF_Str3_tags_1)
1515 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1516 asn_DEF_Str3_tags_1, /* Same as above */
1517 sizeof(asn_DEF_Str3_tags_1)
1518 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001519 &asn_PER_type_Str3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001520 0, 0, /* No members */
1521 0 /* No specifics */
1522};
1523
1524
1525/*** <<< INCLUDES [Str4] >>> ***/
1526
1527#include <IA5String.h>
1528
1529/*** <<< TYPE-DECLS [Str4] >>> ***/
1530
1531typedef IA5String_t Str4_t;
1532
1533/*** <<< FUNC-DECLS [Str4] >>> ***/
1534
1535extern asn_TYPE_descriptor_t asn_DEF_Str4;
1536asn_struct_free_f Str4_free;
1537asn_struct_print_f Str4_print;
1538asn_constr_check_f Str4_constraint;
1539ber_type_decoder_f Str4_decode_ber;
1540der_type_encoder_f Str4_encode_der;
1541xer_type_decoder_f Str4_decode_xer;
1542xer_type_encoder_f Str4_encode_xer;
1543per_type_decoder_f Str4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001544per_type_encoder_f Str4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001545
1546/*** <<< CTABLES [Str4] >>> ***/
1547
1548static int check_permitted_alphabet_1(const void *sptr) {
1549 /* The underlying type is IA5String */
1550 const IA5String_t *st = (const IA5String_t *)sptr;
1551 const uint8_t *ch = st->buf;
1552 const uint8_t *end = ch + st->size;
1553
1554 for(; ch < end; ch++) {
1555 uint8_t cv = *ch;
1556 if(!(cv <= 127)) return -1;
1557 }
1558 return 0;
1559}
1560
1561
1562/*** <<< CODE [Str4] >>> ***/
1563
1564int
1565Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001566 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001567 const IA5String_t *st = (const IA5String_t *)sptr;
1568
1569 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001570 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001571 "%s: value not given (%s:%d)",
1572 td->name, __FILE__, __LINE__);
1573 return -1;
1574 }
1575
1576
1577 if(!check_permitted_alphabet_1(st)) {
1578 /* Constraint check succeeded */
1579 return 0;
1580 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001581 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001582 "%s: constraint failed (%s:%d)",
1583 td->name, __FILE__, __LINE__);
1584 return -1;
1585 }
1586}
1587
1588/*
1589 * This type is implemented using IA5String,
1590 * so here we adjust the DEF accordingly.
1591 */
1592static void
1593Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1594 td->free_struct = asn_DEF_IA5String.free_struct;
1595 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001596 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001597 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1598 td->der_encoder = asn_DEF_IA5String.der_encoder;
1599 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1600 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1601 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001602 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001603 if(!td->per_constraints)
1604 td->per_constraints = asn_DEF_IA5String.per_constraints;
1605 td->elements = asn_DEF_IA5String.elements;
1606 td->elements_count = asn_DEF_IA5String.elements_count;
1607 td->specifics = asn_DEF_IA5String.specifics;
1608}
1609
1610void
1611Str4_free(asn_TYPE_descriptor_t *td,
1612 void *struct_ptr, int contents_only) {
1613 Str4_1_inherit_TYPE_descriptor(td);
1614 td->free_struct(td, struct_ptr, contents_only);
1615}
1616
1617int
1618Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1619 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1620 Str4_1_inherit_TYPE_descriptor(td);
1621 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1622}
1623
1624asn_dec_rval_t
1625Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1626 void **structure, const void *bufptr, size_t size, int tag_mode) {
1627 Str4_1_inherit_TYPE_descriptor(td);
1628 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1629}
1630
1631asn_enc_rval_t
1632Str4_encode_der(asn_TYPE_descriptor_t *td,
1633 void *structure, int tag_mode, ber_tlv_tag_t tag,
1634 asn_app_consume_bytes_f *cb, void *app_key) {
1635 Str4_1_inherit_TYPE_descriptor(td);
1636 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1637}
1638
1639asn_dec_rval_t
1640Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1641 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1642 Str4_1_inherit_TYPE_descriptor(td);
1643 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1644}
1645
1646asn_enc_rval_t
1647Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1648 int ilevel, enum xer_encoder_flags_e flags,
1649 asn_app_consume_bytes_f *cb, void *app_key) {
1650 Str4_1_inherit_TYPE_descriptor(td);
1651 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1652}
1653
1654asn_dec_rval_t
1655Str4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1656 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1657 Str4_1_inherit_TYPE_descriptor(td);
1658 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1659}
1660
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001661asn_enc_rval_t
1662Str4_encode_uper(asn_TYPE_descriptor_t *td,
1663 asn_per_constraints_t *constraints,
1664 void *structure, asn_per_outp_t *per_out) {
1665 Str4_1_inherit_TYPE_descriptor(td);
1666 return td->uper_encoder(td, constraints, structure, per_out);
1667}
1668
Lev Walkin59b176e2005-11-26 11:25:14 +00001669
Lev Walkin725883b2006-10-09 12:07:58 +00001670/*** <<< CTDEFS [Str4] >>> ***/
1671
Lev Walkin2fce55d2013-03-28 05:00:39 -07001672static asn_per_constraints_t asn_PER_type_Str4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001673 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1674 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1675 0, 0 /* No PER character map necessary */
1676};
1677
Lev Walkin59b176e2005-11-26 11:25:14 +00001678/*** <<< STAT-DEFS [Str4] >>> ***/
1679
Lev Walkina7591b52014-10-12 18:37:35 -07001680static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001681 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1682};
Lev Walkin59b176e2005-11-26 11:25:14 +00001683asn_TYPE_descriptor_t asn_DEF_Str4 = {
1684 "Str4",
1685 "Str4",
1686 Str4_free,
1687 Str4_print,
1688 Str4_constraint,
1689 Str4_decode_ber,
1690 Str4_encode_der,
1691 Str4_decode_xer,
1692 Str4_encode_xer,
1693 Str4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001694 Str4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001695 0, /* Use generic outmost tag fetcher */
1696 asn_DEF_Str4_tags_1,
1697 sizeof(asn_DEF_Str4_tags_1)
1698 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1699 asn_DEF_Str4_tags_1, /* Same as above */
1700 sizeof(asn_DEF_Str4_tags_1)
1701 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001702 &asn_PER_type_Str4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001703 0, 0, /* No members */
1704 0 /* No specifics */
1705};
1706
1707
1708/*** <<< INCLUDES [PER-Visible] >>> ***/
1709
1710#include <IA5String.h>
1711
1712/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1713
1714typedef IA5String_t PER_Visible_t;
1715
1716/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1717
1718extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
1719asn_struct_free_f PER_Visible_free;
1720asn_struct_print_f PER_Visible_print;
1721asn_constr_check_f PER_Visible_constraint;
1722ber_type_decoder_f PER_Visible_decode_ber;
1723der_type_encoder_f PER_Visible_encode_der;
1724xer_type_decoder_f PER_Visible_decode_xer;
1725xer_type_encoder_f PER_Visible_encode_xer;
1726per_type_decoder_f PER_Visible_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001727per_type_encoder_f PER_Visible_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001728
1729/*** <<< CTABLES [PER-Visible] >>> ***/
1730
1731static int check_permitted_alphabet_1(const void *sptr) {
1732 /* The underlying type is IA5String */
1733 const IA5String_t *st = (const IA5String_t *)sptr;
1734 const uint8_t *ch = st->buf;
1735 const uint8_t *end = ch + st->size;
1736
1737 for(; ch < end; ch++) {
1738 uint8_t cv = *ch;
1739 if(!(cv >= 65 && cv <= 70)) return -1;
1740 }
1741 return 0;
1742}
1743
1744
1745/*** <<< CODE [PER-Visible] >>> ***/
1746
1747int
1748PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001749 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001750 const IA5String_t *st = (const IA5String_t *)sptr;
1751
1752 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001753 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001754 "%s: value not given (%s:%d)",
1755 td->name, __FILE__, __LINE__);
1756 return -1;
1757 }
1758
1759
1760 if(!check_permitted_alphabet_1(st)) {
1761 /* Constraint check succeeded */
1762 return 0;
1763 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001764 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001765 "%s: constraint failed (%s:%d)",
1766 td->name, __FILE__, __LINE__);
1767 return -1;
1768 }
1769}
1770
1771/*
1772 * This type is implemented using IA5String,
1773 * so here we adjust the DEF accordingly.
1774 */
1775static void
1776PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1777 td->free_struct = asn_DEF_IA5String.free_struct;
1778 td->print_struct = asn_DEF_IA5String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001779 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001780 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1781 td->der_encoder = asn_DEF_IA5String.der_encoder;
1782 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1783 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1784 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001785 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001786 if(!td->per_constraints)
1787 td->per_constraints = asn_DEF_IA5String.per_constraints;
1788 td->elements = asn_DEF_IA5String.elements;
1789 td->elements_count = asn_DEF_IA5String.elements_count;
1790 td->specifics = asn_DEF_IA5String.specifics;
1791}
1792
1793void
1794PER_Visible_free(asn_TYPE_descriptor_t *td,
1795 void *struct_ptr, int contents_only) {
1796 PER_Visible_1_inherit_TYPE_descriptor(td);
1797 td->free_struct(td, struct_ptr, contents_only);
1798}
1799
1800int
1801PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1802 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1803 PER_Visible_1_inherit_TYPE_descriptor(td);
1804 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1805}
1806
1807asn_dec_rval_t
1808PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1809 void **structure, const void *bufptr, size_t size, int tag_mode) {
1810 PER_Visible_1_inherit_TYPE_descriptor(td);
1811 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1812}
1813
1814asn_enc_rval_t
1815PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
1816 void *structure, int tag_mode, ber_tlv_tag_t tag,
1817 asn_app_consume_bytes_f *cb, void *app_key) {
1818 PER_Visible_1_inherit_TYPE_descriptor(td);
1819 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1820}
1821
1822asn_dec_rval_t
1823PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1824 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1825 PER_Visible_1_inherit_TYPE_descriptor(td);
1826 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1827}
1828
1829asn_enc_rval_t
1830PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1831 int ilevel, enum xer_encoder_flags_e flags,
1832 asn_app_consume_bytes_f *cb, void *app_key) {
1833 PER_Visible_1_inherit_TYPE_descriptor(td);
1834 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1835}
1836
1837asn_dec_rval_t
1838PER_Visible_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1839 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1840 PER_Visible_1_inherit_TYPE_descriptor(td);
1841 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1842}
1843
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001844asn_enc_rval_t
1845PER_Visible_encode_uper(asn_TYPE_descriptor_t *td,
1846 asn_per_constraints_t *constraints,
1847 void *structure, asn_per_outp_t *per_out) {
1848 PER_Visible_1_inherit_TYPE_descriptor(td);
1849 return td->uper_encoder(td, constraints, structure, per_out);
1850}
1851
Lev Walkin59b176e2005-11-26 11:25:14 +00001852
Lev Walkin725883b2006-10-09 12:07:58 +00001853/*** <<< CTDEFS [PER-Visible] >>> ***/
1854
Lev Walkin2fce55d2013-03-28 05:00:39 -07001855static asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00001856 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1857 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1858 0, 0 /* No PER character map necessary */
1859};
1860
Lev Walkin59b176e2005-11-26 11:25:14 +00001861/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1862
Lev Walkina7591b52014-10-12 18:37:35 -07001863static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00001864 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1865};
Lev Walkin59b176e2005-11-26 11:25:14 +00001866asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1867 "PER-Visible",
1868 "PER-Visible",
1869 PER_Visible_free,
1870 PER_Visible_print,
1871 PER_Visible_constraint,
1872 PER_Visible_decode_ber,
1873 PER_Visible_encode_der,
1874 PER_Visible_decode_xer,
1875 PER_Visible_encode_xer,
1876 PER_Visible_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001877 PER_Visible_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001878 0, /* Use generic outmost tag fetcher */
1879 asn_DEF_PER_Visible_tags_1,
1880 sizeof(asn_DEF_PER_Visible_tags_1)
1881 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1882 asn_DEF_PER_Visible_tags_1, /* Same as above */
1883 sizeof(asn_DEF_PER_Visible_tags_1)
1884 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001885 &asn_PER_type_PER_Visible_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001886 0, 0, /* No members */
1887 0 /* No specifics */
1888};
1889
1890
1891/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1892
Lev Walkin22b5ed42006-09-13 02:51:20 +00001893#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001894
1895/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1896
1897typedef PER_Visible_t PER_Visible_2_t;
1898
1899/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1900
1901extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1902asn_struct_free_f PER_Visible_2_free;
1903asn_struct_print_f PER_Visible_2_print;
1904asn_constr_check_f PER_Visible_2_constraint;
1905ber_type_decoder_f PER_Visible_2_decode_ber;
1906der_type_encoder_f PER_Visible_2_encode_der;
1907xer_type_decoder_f PER_Visible_2_decode_xer;
1908xer_type_encoder_f PER_Visible_2_encode_xer;
1909per_type_decoder_f PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001910per_type_encoder_f PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001911
1912/*** <<< CTABLES [PER-Visible-2] >>> ***/
1913
1914static int check_permitted_alphabet_1(const void *sptr) {
1915 /* The underlying type is IA5String */
1916 const IA5String_t *st = (const IA5String_t *)sptr;
1917 const uint8_t *ch = st->buf;
1918 const uint8_t *end = ch + st->size;
1919
1920 for(; ch < end; ch++) {
1921 uint8_t cv = *ch;
1922 if(!(cv >= 69 && cv <= 70)) return -1;
1923 }
1924 return 0;
1925}
1926
1927
1928/*** <<< CODE [PER-Visible-2] >>> ***/
1929
1930int
1931PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001932 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001933 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1934
1935 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001936 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001937 "%s: value not given (%s:%d)",
1938 td->name, __FILE__, __LINE__);
1939 return -1;
1940 }
1941
1942
1943 if(!check_permitted_alphabet_1(st)) {
1944 /* Constraint check succeeded */
1945 return 0;
1946 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07001947 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001948 "%s: constraint failed (%s:%d)",
1949 td->name, __FILE__, __LINE__);
1950 return -1;
1951 }
1952}
1953
1954/*
1955 * This type is implemented using PER_Visible,
1956 * so here we adjust the DEF accordingly.
1957 */
1958static void
1959PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1960 td->free_struct = asn_DEF_PER_Visible.free_struct;
1961 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08001962 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00001963 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1964 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1965 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1966 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1967 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001968 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001969 if(!td->per_constraints)
1970 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
1971 td->elements = asn_DEF_PER_Visible.elements;
1972 td->elements_count = asn_DEF_PER_Visible.elements_count;
1973 td->specifics = asn_DEF_PER_Visible.specifics;
1974}
1975
1976void
1977PER_Visible_2_free(asn_TYPE_descriptor_t *td,
1978 void *struct_ptr, int contents_only) {
1979 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1980 td->free_struct(td, struct_ptr, contents_only);
1981}
1982
1983int
1984PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1985 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1986 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1987 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1988}
1989
1990asn_dec_rval_t
1991PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1992 void **structure, const void *bufptr, size_t size, int tag_mode) {
1993 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1994 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1995}
1996
1997asn_enc_rval_t
1998PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
1999 void *structure, int tag_mode, ber_tlv_tag_t tag,
2000 asn_app_consume_bytes_f *cb, void *app_key) {
2001 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2002 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2003}
2004
2005asn_dec_rval_t
2006PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2007 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2008 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2009 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2010}
2011
2012asn_enc_rval_t
2013PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2014 int ilevel, enum xer_encoder_flags_e flags,
2015 asn_app_consume_bytes_f *cb, void *app_key) {
2016 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2017 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2018}
2019
2020asn_dec_rval_t
2021PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2022 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2023 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2024 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2025}
2026
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002027asn_enc_rval_t
2028PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2029 asn_per_constraints_t *constraints,
2030 void *structure, asn_per_outp_t *per_out) {
2031 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2032 return td->uper_encoder(td, constraints, structure, per_out);
2033}
2034
Lev Walkin59b176e2005-11-26 11:25:14 +00002035
Lev Walkin725883b2006-10-09 12:07:58 +00002036/*** <<< CTDEFS [PER-Visible-2] >>> ***/
2037
Lev Walkin2fce55d2013-03-28 05:00:39 -07002038static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002039 { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */,
2040 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2041 0, 0 /* No PER character map necessary */
2042};
2043
Lev Walkin59b176e2005-11-26 11:25:14 +00002044/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
2045
Lev Walkina7591b52014-10-12 18:37:35 -07002046static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002047 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2048};
Lev Walkin59b176e2005-11-26 11:25:14 +00002049asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
2050 "PER-Visible-2",
2051 "PER-Visible-2",
2052 PER_Visible_2_free,
2053 PER_Visible_2_print,
2054 PER_Visible_2_constraint,
2055 PER_Visible_2_decode_ber,
2056 PER_Visible_2_encode_der,
2057 PER_Visible_2_decode_xer,
2058 PER_Visible_2_encode_xer,
2059 PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002060 PER_Visible_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002061 0, /* Use generic outmost tag fetcher */
2062 asn_DEF_PER_Visible_2_tags_1,
2063 sizeof(asn_DEF_PER_Visible_2_tags_1)
2064 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
2065 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
2066 sizeof(asn_DEF_PER_Visible_2_tags_1)
2067 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002068 &asn_PER_type_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002069 0, 0, /* No members */
2070 0 /* No specifics */
2071};
2072
2073
2074/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
2075
Lev Walkin22b5ed42006-09-13 02:51:20 +00002076#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002077
2078/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
2079
2080typedef PER_Visible_t Not_PER_Visible_1_t;
2081
2082/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
2083
2084extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
2085asn_struct_free_f Not_PER_Visible_1_free;
2086asn_struct_print_f Not_PER_Visible_1_print;
2087asn_constr_check_f Not_PER_Visible_1_constraint;
2088ber_type_decoder_f Not_PER_Visible_1_decode_ber;
2089der_type_encoder_f Not_PER_Visible_1_encode_der;
2090xer_type_decoder_f Not_PER_Visible_1_decode_xer;
2091xer_type_encoder_f Not_PER_Visible_1_encode_xer;
2092per_type_decoder_f Not_PER_Visible_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002093per_type_encoder_f Not_PER_Visible_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002094
2095/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
2096
2097static int check_permitted_alphabet_1(const void *sptr) {
2098 /* The underlying type is IA5String */
2099 const IA5String_t *st = (const IA5String_t *)sptr;
2100 const uint8_t *ch = st->buf;
2101 const uint8_t *end = ch + st->size;
2102
2103 for(; ch < end; ch++) {
2104 uint8_t cv = *ch;
2105 if(!(cv >= 65 && cv <= 70)) return -1;
2106 }
2107 return 0;
2108}
2109
2110
2111/*** <<< CODE [Not-PER-Visible-1] >>> ***/
2112
2113int
2114Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002115 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002116 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2117
2118 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002119 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002120 "%s: value not given (%s:%d)",
2121 td->name, __FILE__, __LINE__);
2122 return -1;
2123 }
2124
2125
2126 if(!check_permitted_alphabet_1(st)) {
2127 /* Constraint check succeeded */
2128 return 0;
2129 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002130 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002131 "%s: constraint failed (%s:%d)",
2132 td->name, __FILE__, __LINE__);
2133 return -1;
2134 }
2135}
2136
2137/*
2138 * This type is implemented using PER_Visible,
2139 * so here we adjust the DEF accordingly.
2140 */
2141static void
2142Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2143 td->free_struct = asn_DEF_PER_Visible.free_struct;
2144 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002145 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002146 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2147 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2148 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2149 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2150 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002151 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002152 if(!td->per_constraints)
2153 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2154 td->elements = asn_DEF_PER_Visible.elements;
2155 td->elements_count = asn_DEF_PER_Visible.elements_count;
2156 td->specifics = asn_DEF_PER_Visible.specifics;
2157}
2158
2159void
2160Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
2161 void *struct_ptr, int contents_only) {
2162 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2163 td->free_struct(td, struct_ptr, contents_only);
2164}
2165
2166int
2167Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2168 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2169 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2170 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2171}
2172
2173asn_dec_rval_t
2174Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2175 void **structure, const void *bufptr, size_t size, int tag_mode) {
2176 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2177 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2178}
2179
2180asn_enc_rval_t
2181Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
2182 void *structure, int tag_mode, ber_tlv_tag_t tag,
2183 asn_app_consume_bytes_f *cb, void *app_key) {
2184 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2185 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2186}
2187
2188asn_dec_rval_t
2189Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2190 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2191 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2192 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2193}
2194
2195asn_enc_rval_t
2196Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2197 int ilevel, enum xer_encoder_flags_e flags,
2198 asn_app_consume_bytes_f *cb, void *app_key) {
2199 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2200 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2201}
2202
2203asn_dec_rval_t
2204Not_PER_Visible_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2205 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2206 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2207 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2208}
2209
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002210asn_enc_rval_t
2211Not_PER_Visible_1_encode_uper(asn_TYPE_descriptor_t *td,
2212 asn_per_constraints_t *constraints,
2213 void *structure, asn_per_outp_t *per_out) {
2214 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2215 return td->uper_encoder(td, constraints, structure, per_out);
2216}
2217
Lev Walkin59b176e2005-11-26 11:25:14 +00002218
Lev Walkin725883b2006-10-09 12:07:58 +00002219/*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/
2220
Lev Walkin2fce55d2013-03-28 05:00:39 -07002221static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002222 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
2223 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2224 0, 0 /* No PER character map necessary */
2225};
2226
Lev Walkin59b176e2005-11-26 11:25:14 +00002227/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
2228
Lev Walkina7591b52014-10-12 18:37:35 -07002229static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002230 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2231};
Lev Walkin59b176e2005-11-26 11:25:14 +00002232asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
2233 "Not-PER-Visible-1",
2234 "Not-PER-Visible-1",
2235 Not_PER_Visible_1_free,
2236 Not_PER_Visible_1_print,
2237 Not_PER_Visible_1_constraint,
2238 Not_PER_Visible_1_decode_ber,
2239 Not_PER_Visible_1_encode_der,
2240 Not_PER_Visible_1_decode_xer,
2241 Not_PER_Visible_1_encode_xer,
2242 Not_PER_Visible_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002243 Not_PER_Visible_1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002244 0, /* Use generic outmost tag fetcher */
2245 asn_DEF_Not_PER_Visible_1_tags_1,
2246 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2247 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2248 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
2249 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2250 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002251 &asn_PER_type_Not_PER_Visible_1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002252 0, 0, /* No members */
2253 0 /* No specifics */
2254};
2255
2256
2257/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
2258
Lev Walkin22b5ed42006-09-13 02:51:20 +00002259#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002260
2261/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
2262
2263typedef PER_Visible_t Not_PER_Visible_2_t;
2264
2265/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
2266
2267extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
2268asn_struct_free_f Not_PER_Visible_2_free;
2269asn_struct_print_f Not_PER_Visible_2_print;
2270asn_constr_check_f Not_PER_Visible_2_constraint;
2271ber_type_decoder_f Not_PER_Visible_2_decode_ber;
2272der_type_encoder_f Not_PER_Visible_2_encode_der;
2273xer_type_decoder_f Not_PER_Visible_2_decode_xer;
2274xer_type_encoder_f Not_PER_Visible_2_encode_xer;
2275per_type_decoder_f Not_PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002276per_type_encoder_f Not_PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002277
2278/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
2279
2280static int check_permitted_alphabet_1(const void *sptr) {
2281 /* The underlying type is IA5String */
2282 const IA5String_t *st = (const IA5String_t *)sptr;
2283 const uint8_t *ch = st->buf;
2284 const uint8_t *end = ch + st->size;
2285
2286 for(; ch < end; ch++) {
2287 uint8_t cv = *ch;
2288 if(!(cv >= 65 && cv <= 66)) return -1;
2289 }
2290 return 0;
2291}
2292
2293
2294/*** <<< CODE [Not-PER-Visible-2] >>> ***/
2295
2296int
2297Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002298 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002299 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2300
2301 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002302 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002303 "%s: value not given (%s:%d)",
2304 td->name, __FILE__, __LINE__);
2305 return -1;
2306 }
2307
2308
2309 if(!check_permitted_alphabet_1(st)) {
2310 /* Constraint check succeeded */
2311 return 0;
2312 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002313 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002314 "%s: constraint failed (%s:%d)",
2315 td->name, __FILE__, __LINE__);
2316 return -1;
2317 }
2318}
2319
2320/*
2321 * This type is implemented using PER_Visible,
2322 * so here we adjust the DEF accordingly.
2323 */
2324static void
2325Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2326 td->free_struct = asn_DEF_PER_Visible.free_struct;
2327 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002328 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002329 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2330 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2331 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2332 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2333 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002334 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002335 if(!td->per_constraints)
2336 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2337 td->elements = asn_DEF_PER_Visible.elements;
2338 td->elements_count = asn_DEF_PER_Visible.elements_count;
2339 td->specifics = asn_DEF_PER_Visible.specifics;
2340}
2341
2342void
2343Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2344 void *struct_ptr, int contents_only) {
2345 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2346 td->free_struct(td, struct_ptr, contents_only);
2347}
2348
2349int
2350Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2351 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2352 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2353 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2354}
2355
2356asn_dec_rval_t
2357Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2358 void **structure, const void *bufptr, size_t size, int tag_mode) {
2359 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2360 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2361}
2362
2363asn_enc_rval_t
2364Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2365 void *structure, int tag_mode, ber_tlv_tag_t tag,
2366 asn_app_consume_bytes_f *cb, void *app_key) {
2367 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2368 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2369}
2370
2371asn_dec_rval_t
2372Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2373 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2374 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2375 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2376}
2377
2378asn_enc_rval_t
2379Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2380 int ilevel, enum xer_encoder_flags_e flags,
2381 asn_app_consume_bytes_f *cb, void *app_key) {
2382 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2383 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2384}
2385
2386asn_dec_rval_t
2387Not_PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2388 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2389 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2390 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2391}
2392
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002393asn_enc_rval_t
2394Not_PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2395 asn_per_constraints_t *constraints,
2396 void *structure, asn_per_outp_t *per_out) {
2397 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2398 return td->uper_encoder(td, constraints, structure, per_out);
2399}
2400
Lev Walkin59b176e2005-11-26 11:25:14 +00002401
Lev Walkin725883b2006-10-09 12:07:58 +00002402/*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/
2403
Lev Walkin2fce55d2013-03-28 05:00:39 -07002404static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002405 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2406 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2407 0, 0 /* No PER character map necessary */
2408};
2409
Lev Walkin59b176e2005-11-26 11:25:14 +00002410/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
2411
Lev Walkina7591b52014-10-12 18:37:35 -07002412static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002413 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2414};
Lev Walkin59b176e2005-11-26 11:25:14 +00002415asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
2416 "Not-PER-Visible-2",
2417 "Not-PER-Visible-2",
2418 Not_PER_Visible_2_free,
2419 Not_PER_Visible_2_print,
2420 Not_PER_Visible_2_constraint,
2421 Not_PER_Visible_2_decode_ber,
2422 Not_PER_Visible_2_encode_der,
2423 Not_PER_Visible_2_decode_xer,
2424 Not_PER_Visible_2_encode_xer,
2425 Not_PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002426 Not_PER_Visible_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002427 0, /* Use generic outmost tag fetcher */
2428 asn_DEF_Not_PER_Visible_2_tags_1,
2429 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2430 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2431 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
2432 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2433 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002434 &asn_PER_type_Not_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002435 0, 0, /* No members */
2436 0 /* No specifics */
2437};
2438
2439
2440/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2441
Lev Walkin22b5ed42006-09-13 02:51:20 +00002442#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002443
2444/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2445
2446typedef PER_Visible_t Not_PER_Visible_3_t;
2447
2448/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2449
2450extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
2451asn_struct_free_f Not_PER_Visible_3_free;
2452asn_struct_print_f Not_PER_Visible_3_print;
2453asn_constr_check_f Not_PER_Visible_3_constraint;
2454ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2455der_type_encoder_f Not_PER_Visible_3_encode_der;
2456xer_type_decoder_f Not_PER_Visible_3_decode_xer;
2457xer_type_encoder_f Not_PER_Visible_3_encode_xer;
2458per_type_decoder_f Not_PER_Visible_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002459per_type_encoder_f Not_PER_Visible_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002460
2461/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2462
2463static int check_permitted_alphabet_1(const void *sptr) {
2464 /* The underlying type is IA5String */
2465 const IA5String_t *st = (const IA5String_t *)sptr;
2466 const uint8_t *ch = st->buf;
2467 const uint8_t *end = ch + st->size;
2468
2469 for(; ch < end; ch++) {
2470 uint8_t cv = *ch;
2471 if(!(cv >= 65 && cv <= 66)) return -1;
2472 }
2473 return 0;
2474}
2475
2476
2477/*** <<< CODE [Not-PER-Visible-3] >>> ***/
2478
2479int
2480Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002481 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002482 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2483
2484 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002485 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002486 "%s: value not given (%s:%d)",
2487 td->name, __FILE__, __LINE__);
2488 return -1;
2489 }
2490
2491
2492 if(!check_permitted_alphabet_1(st)) {
2493 /* Constraint check succeeded */
2494 return 0;
2495 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002496 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002497 "%s: constraint failed (%s:%d)",
2498 td->name, __FILE__, __LINE__);
2499 return -1;
2500 }
2501}
2502
2503/*
2504 * This type is implemented using PER_Visible,
2505 * so here we adjust the DEF accordingly.
2506 */
2507static void
2508Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2509 td->free_struct = asn_DEF_PER_Visible.free_struct;
2510 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002511 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002512 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2513 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2514 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2515 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2516 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002517 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002518 if(!td->per_constraints)
2519 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2520 td->elements = asn_DEF_PER_Visible.elements;
2521 td->elements_count = asn_DEF_PER_Visible.elements_count;
2522 td->specifics = asn_DEF_PER_Visible.specifics;
2523}
2524
2525void
2526Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
2527 void *struct_ptr, int contents_only) {
2528 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2529 td->free_struct(td, struct_ptr, contents_only);
2530}
2531
2532int
2533Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2534 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2535 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2536 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2537}
2538
2539asn_dec_rval_t
2540Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2541 void **structure, const void *bufptr, size_t size, int tag_mode) {
2542 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2543 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2544}
2545
2546asn_enc_rval_t
2547Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
2548 void *structure, int tag_mode, ber_tlv_tag_t tag,
2549 asn_app_consume_bytes_f *cb, void *app_key) {
2550 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2551 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2552}
2553
2554asn_dec_rval_t
2555Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2556 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2557 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2558 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2559}
2560
2561asn_enc_rval_t
2562Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2563 int ilevel, enum xer_encoder_flags_e flags,
2564 asn_app_consume_bytes_f *cb, void *app_key) {
2565 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2566 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2567}
2568
2569asn_dec_rval_t
2570Not_PER_Visible_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2571 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2572 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2573 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2574}
2575
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002576asn_enc_rval_t
2577Not_PER_Visible_3_encode_uper(asn_TYPE_descriptor_t *td,
2578 asn_per_constraints_t *constraints,
2579 void *structure, asn_per_outp_t *per_out) {
2580 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2581 return td->uper_encoder(td, constraints, structure, per_out);
2582}
2583
Lev Walkin59b176e2005-11-26 11:25:14 +00002584
Lev Walkin725883b2006-10-09 12:07:58 +00002585/*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/
2586
Lev Walkin2fce55d2013-03-28 05:00:39 -07002587static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002588 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2589 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2590 0, 0 /* No PER character map necessary */
2591};
2592
Lev Walkin59b176e2005-11-26 11:25:14 +00002593/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2594
Lev Walkina7591b52014-10-12 18:37:35 -07002595static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002596 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2597};
Lev Walkin59b176e2005-11-26 11:25:14 +00002598asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
2599 "Not-PER-Visible-3",
2600 "Not-PER-Visible-3",
2601 Not_PER_Visible_3_free,
2602 Not_PER_Visible_3_print,
2603 Not_PER_Visible_3_constraint,
2604 Not_PER_Visible_3_decode_ber,
2605 Not_PER_Visible_3_encode_der,
2606 Not_PER_Visible_3_decode_xer,
2607 Not_PER_Visible_3_encode_xer,
2608 Not_PER_Visible_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002609 Not_PER_Visible_3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002610 0, /* Use generic outmost tag fetcher */
2611 asn_DEF_Not_PER_Visible_3_tags_1,
2612 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2613 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2614 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
2615 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2616 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002617 &asn_PER_type_Not_PER_Visible_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002618 0, 0, /* No members */
2619 0 /* No specifics */
2620};
2621
2622
2623/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2624
Lev Walkin22b5ed42006-09-13 02:51:20 +00002625#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002626
2627/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2628
2629typedef PER_Visible_t SIZE_but_not_FROM_t;
2630
2631/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2632
2633extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
2634asn_struct_free_f SIZE_but_not_FROM_free;
2635asn_struct_print_f SIZE_but_not_FROM_print;
2636asn_constr_check_f SIZE_but_not_FROM_constraint;
2637ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2638der_type_encoder_f SIZE_but_not_FROM_encode_der;
2639xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
2640xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
2641per_type_decoder_f SIZE_but_not_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002642per_type_encoder_f SIZE_but_not_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002643
2644/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2645
2646static int check_permitted_alphabet_1(const void *sptr) {
2647 /* The underlying type is IA5String */
2648 const IA5String_t *st = (const IA5String_t *)sptr;
2649 const uint8_t *ch = st->buf;
2650 const uint8_t *end = ch + st->size;
2651
2652 for(; ch < end; ch++) {
2653 uint8_t cv = *ch;
2654 if(!(cv >= 65 && cv <= 68)) return -1;
2655 }
2656 return 0;
2657}
2658
2659
2660/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2661
2662int
2663SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002664 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002665 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2666 size_t size;
2667
2668 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002669 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002670 "%s: value not given (%s:%d)",
2671 td->name, __FILE__, __LINE__);
2672 return -1;
2673 }
2674
2675 size = st->size;
2676
2677 if((size >= 1 && size <= 4)
2678 && !check_permitted_alphabet_1(st)) {
2679 /* Constraint check succeeded */
2680 return 0;
2681 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002682 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002683 "%s: constraint failed (%s:%d)",
2684 td->name, __FILE__, __LINE__);
2685 return -1;
2686 }
2687}
2688
2689/*
2690 * This type is implemented using PER_Visible,
2691 * so here we adjust the DEF accordingly.
2692 */
2693static void
2694SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2695 td->free_struct = asn_DEF_PER_Visible.free_struct;
2696 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002697 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002698 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2699 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2700 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2701 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2702 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002703 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002704 if(!td->per_constraints)
2705 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2706 td->elements = asn_DEF_PER_Visible.elements;
2707 td->elements_count = asn_DEF_PER_Visible.elements_count;
2708 td->specifics = asn_DEF_PER_Visible.specifics;
2709}
2710
2711void
2712SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
2713 void *struct_ptr, int contents_only) {
2714 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2715 td->free_struct(td, struct_ptr, contents_only);
2716}
2717
2718int
2719SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2720 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2721 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2722 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2723}
2724
2725asn_dec_rval_t
2726SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2727 void **structure, const void *bufptr, size_t size, int tag_mode) {
2728 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2729 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2730}
2731
2732asn_enc_rval_t
2733SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
2734 void *structure, int tag_mode, ber_tlv_tag_t tag,
2735 asn_app_consume_bytes_f *cb, void *app_key) {
2736 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2737 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2738}
2739
2740asn_dec_rval_t
2741SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2742 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2743 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2744 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2745}
2746
2747asn_enc_rval_t
2748SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2749 int ilevel, enum xer_encoder_flags_e flags,
2750 asn_app_consume_bytes_f *cb, void *app_key) {
2751 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2752 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2753}
2754
2755asn_dec_rval_t
2756SIZE_but_not_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2757 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2758 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2759 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2760}
2761
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002762asn_enc_rval_t
2763SIZE_but_not_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2764 asn_per_constraints_t *constraints,
2765 void *structure, asn_per_outp_t *per_out) {
2766 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2767 return td->uper_encoder(td, constraints, structure, per_out);
2768}
2769
Lev Walkin59b176e2005-11-26 11:25:14 +00002770
Lev Walkin725883b2006-10-09 12:07:58 +00002771/*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/
2772
Lev Walkin2fce55d2013-03-28 05:00:39 -07002773static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002774 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2775 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
2776 0, 0 /* No PER character map necessary */
2777};
2778
Lev Walkin59b176e2005-11-26 11:25:14 +00002779/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2780
Lev Walkina7591b52014-10-12 18:37:35 -07002781static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002782 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2783};
Lev Walkin59b176e2005-11-26 11:25:14 +00002784asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
2785 "SIZE-but-not-FROM",
2786 "SIZE-but-not-FROM",
2787 SIZE_but_not_FROM_free,
2788 SIZE_but_not_FROM_print,
2789 SIZE_but_not_FROM_constraint,
2790 SIZE_but_not_FROM_decode_ber,
2791 SIZE_but_not_FROM_encode_der,
2792 SIZE_but_not_FROM_decode_xer,
2793 SIZE_but_not_FROM_encode_xer,
2794 SIZE_but_not_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002795 SIZE_but_not_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002796 0, /* Use generic outmost tag fetcher */
2797 asn_DEF_SIZE_but_not_FROM_tags_1,
2798 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2799 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2800 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
2801 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2802 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002803 &asn_PER_type_SIZE_but_not_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002804 0, 0, /* No members */
2805 0 /* No specifics */
2806};
2807
2808
2809/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2810
Lev Walkin22b5ed42006-09-13 02:51:20 +00002811#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002812
2813/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2814
2815typedef PER_Visible_t SIZE_and_FROM_t;
2816
2817/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2818
2819extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
2820asn_struct_free_f SIZE_and_FROM_free;
2821asn_struct_print_f SIZE_and_FROM_print;
2822asn_constr_check_f SIZE_and_FROM_constraint;
2823ber_type_decoder_f SIZE_and_FROM_decode_ber;
2824der_type_encoder_f SIZE_and_FROM_encode_der;
2825xer_type_decoder_f SIZE_and_FROM_decode_xer;
2826xer_type_encoder_f SIZE_and_FROM_encode_xer;
2827per_type_decoder_f SIZE_and_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002828per_type_encoder_f SIZE_and_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002829
2830/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2831
2832static int check_permitted_alphabet_1(const void *sptr) {
2833 /* The underlying type is IA5String */
2834 const IA5String_t *st = (const IA5String_t *)sptr;
2835 const uint8_t *ch = st->buf;
2836 const uint8_t *end = ch + st->size;
2837
2838 for(; ch < end; ch++) {
2839 uint8_t cv = *ch;
2840 if(!(cv >= 65 && cv <= 68)) return -1;
2841 }
2842 return 0;
2843}
2844
2845
2846/*** <<< CODE [SIZE-and-FROM] >>> ***/
2847
2848int
2849SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002850 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002851 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2852 size_t size;
2853
2854 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002855 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002856 "%s: value not given (%s:%d)",
2857 td->name, __FILE__, __LINE__);
2858 return -1;
2859 }
2860
2861 size = st->size;
2862
2863 if((size >= 1 && size <= 4)
2864 && !check_permitted_alphabet_1(st)) {
2865 /* Constraint check succeeded */
2866 return 0;
2867 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07002868 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002869 "%s: constraint failed (%s:%d)",
2870 td->name, __FILE__, __LINE__);
2871 return -1;
2872 }
2873}
2874
2875/*
2876 * This type is implemented using PER_Visible,
2877 * so here we adjust the DEF accordingly.
2878 */
2879static void
2880SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2881 td->free_struct = asn_DEF_PER_Visible.free_struct;
2882 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08002883 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00002884 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2885 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2886 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2887 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2888 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002889 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002890 if(!td->per_constraints)
2891 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2892 td->elements = asn_DEF_PER_Visible.elements;
2893 td->elements_count = asn_DEF_PER_Visible.elements_count;
2894 td->specifics = asn_DEF_PER_Visible.specifics;
2895}
2896
2897void
2898SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
2899 void *struct_ptr, int contents_only) {
2900 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2901 td->free_struct(td, struct_ptr, contents_only);
2902}
2903
2904int
2905SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2906 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2907 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2908 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2909}
2910
2911asn_dec_rval_t
2912SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2913 void **structure, const void *bufptr, size_t size, int tag_mode) {
2914 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2915 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2916}
2917
2918asn_enc_rval_t
2919SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
2920 void *structure, int tag_mode, ber_tlv_tag_t tag,
2921 asn_app_consume_bytes_f *cb, void *app_key) {
2922 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2923 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2924}
2925
2926asn_dec_rval_t
2927SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2928 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2929 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2930 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2931}
2932
2933asn_enc_rval_t
2934SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2935 int ilevel, enum xer_encoder_flags_e flags,
2936 asn_app_consume_bytes_f *cb, void *app_key) {
2937 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2938 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2939}
2940
2941asn_dec_rval_t
2942SIZE_and_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2943 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2944 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2945 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2946}
2947
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002948asn_enc_rval_t
2949SIZE_and_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2950 asn_per_constraints_t *constraints,
2951 void *structure, asn_per_outp_t *per_out) {
2952 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2953 return td->uper_encoder(td, constraints, structure, per_out);
2954}
2955
Lev Walkin59b176e2005-11-26 11:25:14 +00002956
Lev Walkin725883b2006-10-09 12:07:58 +00002957/*** <<< CTDEFS [SIZE-and-FROM] >>> ***/
2958
Lev Walkin2fce55d2013-03-28 05:00:39 -07002959static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00002960 { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */,
2961 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
2962 0, 0 /* No PER character map necessary */
2963};
2964
Lev Walkin59b176e2005-11-26 11:25:14 +00002965/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
2966
Lev Walkina7591b52014-10-12 18:37:35 -07002967static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00002968 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2969};
Lev Walkin59b176e2005-11-26 11:25:14 +00002970asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
2971 "SIZE-and-FROM",
2972 "SIZE-and-FROM",
2973 SIZE_and_FROM_free,
2974 SIZE_and_FROM_print,
2975 SIZE_and_FROM_constraint,
2976 SIZE_and_FROM_decode_ber,
2977 SIZE_and_FROM_encode_der,
2978 SIZE_and_FROM_decode_xer,
2979 SIZE_and_FROM_encode_xer,
2980 SIZE_and_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002981 SIZE_and_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002982 0, /* Use generic outmost tag fetcher */
2983 asn_DEF_SIZE_and_FROM_tags_1,
2984 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2985 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2986 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
2987 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2988 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002989 &asn_PER_type_SIZE_and_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002990 0, 0, /* No members */
2991 0 /* No specifics */
2992};
2993
2994
2995/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
2996
Lev Walkin22b5ed42006-09-13 02:51:20 +00002997#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002998
2999/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
3000
3001typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
3002
3003/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
3004
3005extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
3006asn_struct_free_f Neither_SIZE_nor_FROM_free;
3007asn_struct_print_f Neither_SIZE_nor_FROM_print;
3008asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
3009ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
3010der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
3011xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
3012xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
3013per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003014per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003015
3016/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
3017
3018static int check_permitted_alphabet_1(const void *sptr) {
3019 /* The underlying type is IA5String */
3020 const IA5String_t *st = (const IA5String_t *)sptr;
3021 const uint8_t *ch = st->buf;
3022 const uint8_t *end = ch + st->size;
3023
3024 for(; ch < end; ch++) {
3025 uint8_t cv = *ch;
3026 if(!(cv >= 65 && cv <= 70)) return -1;
3027 }
3028 return 0;
3029}
3030
3031
3032/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
3033
3034int
3035Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003036 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003037 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
3038
3039 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003040 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003041 "%s: value not given (%s:%d)",
3042 td->name, __FILE__, __LINE__);
3043 return -1;
3044 }
3045
3046
3047 if(!check_permitted_alphabet_1(st)) {
3048 /* Constraint check succeeded */
3049 return 0;
3050 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003051 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003052 "%s: constraint failed (%s:%d)",
3053 td->name, __FILE__, __LINE__);
3054 return -1;
3055 }
3056}
3057
3058/*
3059 * This type is implemented using PER_Visible,
3060 * so here we adjust the DEF accordingly.
3061 */
3062static void
3063Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3064 td->free_struct = asn_DEF_PER_Visible.free_struct;
3065 td->print_struct = asn_DEF_PER_Visible.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003066 td->check_constraints = asn_DEF_PER_Visible.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003067 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
3068 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
3069 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
3070 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
3071 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003072 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003073 if(!td->per_constraints)
3074 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
3075 td->elements = asn_DEF_PER_Visible.elements;
3076 td->elements_count = asn_DEF_PER_Visible.elements_count;
3077 td->specifics = asn_DEF_PER_Visible.specifics;
3078}
3079
3080void
3081Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
3082 void *struct_ptr, int contents_only) {
3083 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3084 td->free_struct(td, struct_ptr, contents_only);
3085}
3086
3087int
3088Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3089 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3090 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3091 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3092}
3093
3094asn_dec_rval_t
3095Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3096 void **structure, const void *bufptr, size_t size, int tag_mode) {
3097 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3098 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3099}
3100
3101asn_enc_rval_t
3102Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
3103 void *structure, int tag_mode, ber_tlv_tag_t tag,
3104 asn_app_consume_bytes_f *cb, void *app_key) {
3105 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3106 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3107}
3108
3109asn_dec_rval_t
3110Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3111 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3112 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3113 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3114}
3115
3116asn_enc_rval_t
3117Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3118 int ilevel, enum xer_encoder_flags_e flags,
3119 asn_app_consume_bytes_f *cb, void *app_key) {
3120 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3121 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3122}
3123
3124asn_dec_rval_t
3125Neither_SIZE_nor_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3126 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3127 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3128 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3129}
3130
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003131asn_enc_rval_t
3132Neither_SIZE_nor_FROM_encode_uper(asn_TYPE_descriptor_t *td,
3133 asn_per_constraints_t *constraints,
3134 void *structure, asn_per_outp_t *per_out) {
3135 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3136 return td->uper_encoder(td, constraints, structure, per_out);
3137}
3138
Lev Walkin59b176e2005-11-26 11:25:14 +00003139
Lev Walkin725883b2006-10-09 12:07:58 +00003140/*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/
3141
Lev Walkin2fce55d2013-03-28 05:00:39 -07003142static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003143 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
3144 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
3145 0, 0 /* No PER character map necessary */
3146};
3147
Lev Walkin59b176e2005-11-26 11:25:14 +00003148/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
3149
Lev Walkina7591b52014-10-12 18:37:35 -07003150static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003151 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
3152};
Lev Walkin59b176e2005-11-26 11:25:14 +00003153asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
3154 "Neither-SIZE-nor-FROM",
3155 "Neither-SIZE-nor-FROM",
3156 Neither_SIZE_nor_FROM_free,
3157 Neither_SIZE_nor_FROM_print,
3158 Neither_SIZE_nor_FROM_constraint,
3159 Neither_SIZE_nor_FROM_decode_ber,
3160 Neither_SIZE_nor_FROM_encode_der,
3161 Neither_SIZE_nor_FROM_decode_xer,
3162 Neither_SIZE_nor_FROM_encode_xer,
3163 Neither_SIZE_nor_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003164 Neither_SIZE_nor_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003165 0, /* Use generic outmost tag fetcher */
3166 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
3167 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3168 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
3169 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
3170 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3171 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003172 &asn_PER_type_Neither_SIZE_nor_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003173 0, 0, /* No members */
3174 0 /* No specifics */
3175};
3176
3177
3178/*** <<< INCLUDES [Utf8-4] >>> ***/
3179
3180#include <UTF8String.h>
3181
3182/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
3183
3184typedef UTF8String_t Utf8_4_t;
3185
3186/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
3187
3188extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
3189asn_struct_free_f Utf8_4_free;
3190asn_struct_print_f Utf8_4_print;
3191asn_constr_check_f Utf8_4_constraint;
3192ber_type_decoder_f Utf8_4_decode_ber;
3193der_type_encoder_f Utf8_4_encode_der;
3194xer_type_decoder_f Utf8_4_decode_xer;
3195xer_type_encoder_f Utf8_4_encode_xer;
3196per_type_decoder_f Utf8_4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003197per_type_encoder_f Utf8_4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003198
3199/*** <<< CTABLES [Utf8-4] >>> ***/
3200
3201static int check_permitted_alphabet_1(const void *sptr) {
3202 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
3203 return -1; /* Alphabet (sic!) test failed. */
3204
3205 return 0;
3206}
3207
3208
3209/*** <<< CODE [Utf8-4] >>> ***/
3210
3211int
3212Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003213 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003214 const UTF8String_t *st = (const UTF8String_t *)sptr;
3215
3216 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003217 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003218 "%s: value not given (%s:%d)",
3219 td->name, __FILE__, __LINE__);
3220 return -1;
3221 }
3222
3223
3224 if(!check_permitted_alphabet_1(st)) {
3225 /* Constraint check succeeded */
3226 return 0;
3227 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003228 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003229 "%s: constraint failed (%s:%d)",
3230 td->name, __FILE__, __LINE__);
3231 return -1;
3232 }
3233}
3234
3235/*
3236 * This type is implemented using UTF8String,
3237 * so here we adjust the DEF accordingly.
3238 */
3239static void
3240Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3241 td->free_struct = asn_DEF_UTF8String.free_struct;
3242 td->print_struct = asn_DEF_UTF8String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003243 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003244 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3245 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3246 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3247 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3248 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003249 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003250 if(!td->per_constraints)
3251 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3252 td->elements = asn_DEF_UTF8String.elements;
3253 td->elements_count = asn_DEF_UTF8String.elements_count;
3254 td->specifics = asn_DEF_UTF8String.specifics;
3255}
3256
3257void
3258Utf8_4_free(asn_TYPE_descriptor_t *td,
3259 void *struct_ptr, int contents_only) {
3260 Utf8_4_1_inherit_TYPE_descriptor(td);
3261 td->free_struct(td, struct_ptr, contents_only);
3262}
3263
3264int
3265Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3266 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3267 Utf8_4_1_inherit_TYPE_descriptor(td);
3268 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3269}
3270
3271asn_dec_rval_t
3272Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3273 void **structure, const void *bufptr, size_t size, int tag_mode) {
3274 Utf8_4_1_inherit_TYPE_descriptor(td);
3275 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3276}
3277
3278asn_enc_rval_t
3279Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
3280 void *structure, int tag_mode, ber_tlv_tag_t tag,
3281 asn_app_consume_bytes_f *cb, void *app_key) {
3282 Utf8_4_1_inherit_TYPE_descriptor(td);
3283 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3284}
3285
3286asn_dec_rval_t
3287Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3288 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3289 Utf8_4_1_inherit_TYPE_descriptor(td);
3290 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3291}
3292
3293asn_enc_rval_t
3294Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3295 int ilevel, enum xer_encoder_flags_e flags,
3296 asn_app_consume_bytes_f *cb, void *app_key) {
3297 Utf8_4_1_inherit_TYPE_descriptor(td);
3298 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3299}
3300
3301asn_dec_rval_t
3302Utf8_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3303 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3304 Utf8_4_1_inherit_TYPE_descriptor(td);
3305 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3306}
3307
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003308asn_enc_rval_t
3309Utf8_4_encode_uper(asn_TYPE_descriptor_t *td,
3310 asn_per_constraints_t *constraints,
3311 void *structure, asn_per_outp_t *per_out) {
3312 Utf8_4_1_inherit_TYPE_descriptor(td);
3313 return td->uper_encoder(td, constraints, structure, per_out);
3314}
3315
Lev Walkin59b176e2005-11-26 11:25:14 +00003316
Lev Walkin725883b2006-10-09 12:07:58 +00003317/*** <<< CTDEFS [Utf8-4] >>> ***/
3318
Lev Walkin2fce55d2013-03-28 05:00:39 -07003319static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003320 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3321 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3322 0, 0 /* No PER value map */
3323};
3324
Lev Walkin59b176e2005-11-26 11:25:14 +00003325/*** <<< STAT-DEFS [Utf8-4] >>> ***/
3326
Lev Walkina7591b52014-10-12 18:37:35 -07003327static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003328 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3329};
Lev Walkin59b176e2005-11-26 11:25:14 +00003330asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
3331 "Utf8-4",
3332 "Utf8-4",
3333 Utf8_4_free,
3334 Utf8_4_print,
3335 Utf8_4_constraint,
3336 Utf8_4_decode_ber,
3337 Utf8_4_encode_der,
3338 Utf8_4_decode_xer,
3339 Utf8_4_encode_xer,
3340 Utf8_4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003341 Utf8_4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003342 0, /* Use generic outmost tag fetcher */
3343 asn_DEF_Utf8_4_tags_1,
3344 sizeof(asn_DEF_Utf8_4_tags_1)
3345 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
3346 asn_DEF_Utf8_4_tags_1, /* Same as above */
3347 sizeof(asn_DEF_Utf8_4_tags_1)
3348 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003349 &asn_PER_type_Utf8_4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003350 0, 0, /* No members */
3351 0 /* No specifics */
3352};
3353
3354
3355/*** <<< INCLUDES [Utf8-3] >>> ***/
3356
Lev Walkin22b5ed42006-09-13 02:51:20 +00003357#include "Utf8-2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003358
3359/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
3360
3361typedef Utf8_2_t Utf8_3_t;
3362
3363/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
3364
3365extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
3366asn_struct_free_f Utf8_3_free;
3367asn_struct_print_f Utf8_3_print;
3368asn_constr_check_f Utf8_3_constraint;
3369ber_type_decoder_f Utf8_3_decode_ber;
3370der_type_encoder_f Utf8_3_encode_der;
3371xer_type_decoder_f Utf8_3_decode_xer;
3372xer_type_encoder_f Utf8_3_encode_xer;
3373per_type_decoder_f Utf8_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003374per_type_encoder_f Utf8_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003375
3376/*** <<< CTABLES [Utf8-3] >>> ***/
3377
Lev Walkina7591b52014-10-12 18:37:35 -07003378static const int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003379 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3380 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3381 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3382 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3383 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
338416,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
3385 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
338642,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003387};
3388
3389static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07003390 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00003391 /* The underlying type is UTF8String */
3392 const UTF8String_t *st = (const UTF8String_t *)sptr;
3393 const uint8_t *ch = st->buf;
3394 const uint8_t *end = ch + st->size;
3395
3396 for(; ch < end; ch++) {
3397 uint8_t cv = *ch;
3398 if(cv >= 0x80) return -1;
3399 if(!table[cv]) return -1;
3400 }
3401 return 0;
3402}
3403
3404
3405/*** <<< CODE [Utf8-3] >>> ***/
3406
3407int
3408Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003409 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003410 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
3411 size_t size;
3412
3413 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003414 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003415 "%s: value not given (%s:%d)",
3416 td->name, __FILE__, __LINE__);
3417 return -1;
3418 }
3419
3420 size = UTF8String_length(st);
3421 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003422 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003423 "%s: UTF-8: broken encoding (%s:%d)",
3424 td->name, __FILE__, __LINE__);
3425 return -1;
3426 }
3427
3428 if((size >= 1 && size <= 2)
3429 && !check_permitted_alphabet_1(st)) {
3430 /* Constraint check succeeded */
3431 return 0;
3432 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003433 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003434 "%s: constraint failed (%s:%d)",
3435 td->name, __FILE__, __LINE__);
3436 return -1;
3437 }
3438}
3439
3440/*
3441 * This type is implemented using Utf8_2,
3442 * so here we adjust the DEF accordingly.
3443 */
3444static void
3445Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3446 td->free_struct = asn_DEF_Utf8_2.free_struct;
3447 td->print_struct = asn_DEF_Utf8_2.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003448 td->check_constraints = asn_DEF_Utf8_2.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003449 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
3450 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
3451 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
3452 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
3453 td->uper_decoder = asn_DEF_Utf8_2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003454 td->uper_encoder = asn_DEF_Utf8_2.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003455 if(!td->per_constraints)
3456 td->per_constraints = asn_DEF_Utf8_2.per_constraints;
3457 td->elements = asn_DEF_Utf8_2.elements;
3458 td->elements_count = asn_DEF_Utf8_2.elements_count;
3459 td->specifics = asn_DEF_Utf8_2.specifics;
3460}
3461
3462void
3463Utf8_3_free(asn_TYPE_descriptor_t *td,
3464 void *struct_ptr, int contents_only) {
3465 Utf8_3_1_inherit_TYPE_descriptor(td);
3466 td->free_struct(td, struct_ptr, contents_only);
3467}
3468
3469int
3470Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3471 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3472 Utf8_3_1_inherit_TYPE_descriptor(td);
3473 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3474}
3475
3476asn_dec_rval_t
3477Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3478 void **structure, const void *bufptr, size_t size, int tag_mode) {
3479 Utf8_3_1_inherit_TYPE_descriptor(td);
3480 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3481}
3482
3483asn_enc_rval_t
3484Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
3485 void *structure, int tag_mode, ber_tlv_tag_t tag,
3486 asn_app_consume_bytes_f *cb, void *app_key) {
3487 Utf8_3_1_inherit_TYPE_descriptor(td);
3488 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3489}
3490
3491asn_dec_rval_t
3492Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3493 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3494 Utf8_3_1_inherit_TYPE_descriptor(td);
3495 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3496}
3497
3498asn_enc_rval_t
3499Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3500 int ilevel, enum xer_encoder_flags_e flags,
3501 asn_app_consume_bytes_f *cb, void *app_key) {
3502 Utf8_3_1_inherit_TYPE_descriptor(td);
3503 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3504}
3505
3506asn_dec_rval_t
3507Utf8_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3508 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3509 Utf8_3_1_inherit_TYPE_descriptor(td);
3510 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3511}
3512
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003513asn_enc_rval_t
3514Utf8_3_encode_uper(asn_TYPE_descriptor_t *td,
3515 asn_per_constraints_t *constraints,
3516 void *structure, asn_per_outp_t *per_out) {
3517 Utf8_3_1_inherit_TYPE_descriptor(td);
3518 return td->uper_encoder(td, constraints, structure, per_out);
3519}
3520
Lev Walkin59b176e2005-11-26 11:25:14 +00003521
Lev Walkin725883b2006-10-09 12:07:58 +00003522/*** <<< CTDEFS [Utf8-3] >>> ***/
3523
Lev Walkin2fce55d2013-03-28 05:00:39 -07003524static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003525 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3526 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3527 0, 0 /* No PER value map */
3528};
3529
Lev Walkin59b176e2005-11-26 11:25:14 +00003530/*** <<< STAT-DEFS [Utf8-3] >>> ***/
3531
Lev Walkina7591b52014-10-12 18:37:35 -07003532static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003533 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3534};
Lev Walkin59b176e2005-11-26 11:25:14 +00003535asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
3536 "Utf8-3",
3537 "Utf8-3",
3538 Utf8_3_free,
3539 Utf8_3_print,
3540 Utf8_3_constraint,
3541 Utf8_3_decode_ber,
3542 Utf8_3_encode_der,
3543 Utf8_3_decode_xer,
3544 Utf8_3_encode_xer,
3545 Utf8_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003546 Utf8_3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003547 0, /* Use generic outmost tag fetcher */
3548 asn_DEF_Utf8_3_tags_1,
3549 sizeof(asn_DEF_Utf8_3_tags_1)
3550 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3551 asn_DEF_Utf8_3_tags_1, /* Same as above */
3552 sizeof(asn_DEF_Utf8_3_tags_1)
3553 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003554 &asn_PER_type_Utf8_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003555 0, 0, /* No members */
3556 0 /* No specifics */
3557};
3558
3559
3560/*** <<< INCLUDES [Utf8-2] >>> ***/
3561
Lev Walkin22b5ed42006-09-13 02:51:20 +00003562#include "Utf8-1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003563
3564/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
3565
3566typedef Utf8_1_t Utf8_2_t;
3567
3568/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
3569
3570extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
3571asn_struct_free_f Utf8_2_free;
3572asn_struct_print_f Utf8_2_print;
3573asn_constr_check_f Utf8_2_constraint;
3574ber_type_decoder_f Utf8_2_decode_ber;
3575der_type_encoder_f Utf8_2_encode_der;
3576xer_type_decoder_f Utf8_2_decode_xer;
3577xer_type_encoder_f Utf8_2_encode_xer;
3578per_type_decoder_f Utf8_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003579per_type_encoder_f Utf8_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003580
3581/*** <<< CODE [Utf8-2] >>> ***/
3582
3583int
3584Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003585 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003586 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
3587 size_t size;
3588
3589 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003590 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003591 "%s: value not given (%s:%d)",
3592 td->name, __FILE__, __LINE__);
3593 return -1;
3594 }
3595
3596 size = UTF8String_length(st);
3597 if((ssize_t)size < 0) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003598 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003599 "%s: UTF-8: broken encoding (%s:%d)",
3600 td->name, __FILE__, __LINE__);
3601 return -1;
3602 }
3603
3604 if((size >= 1 && size <= 2)) {
3605 /* Constraint check succeeded */
3606 return 0;
3607 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003608 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003609 "%s: constraint failed (%s:%d)",
3610 td->name, __FILE__, __LINE__);
3611 return -1;
3612 }
3613}
3614
3615/*
3616 * This type is implemented using Utf8_1,
3617 * so here we adjust the DEF accordingly.
3618 */
3619static void
3620Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3621 td->free_struct = asn_DEF_Utf8_1.free_struct;
3622 td->print_struct = asn_DEF_Utf8_1.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003623 td->check_constraints = asn_DEF_Utf8_1.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003624 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
3625 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
3626 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
3627 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
3628 td->uper_decoder = asn_DEF_Utf8_1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003629 td->uper_encoder = asn_DEF_Utf8_1.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003630 if(!td->per_constraints)
3631 td->per_constraints = asn_DEF_Utf8_1.per_constraints;
3632 td->elements = asn_DEF_Utf8_1.elements;
3633 td->elements_count = asn_DEF_Utf8_1.elements_count;
3634 td->specifics = asn_DEF_Utf8_1.specifics;
3635}
3636
3637void
3638Utf8_2_free(asn_TYPE_descriptor_t *td,
3639 void *struct_ptr, int contents_only) {
3640 Utf8_2_1_inherit_TYPE_descriptor(td);
3641 td->free_struct(td, struct_ptr, contents_only);
3642}
3643
3644int
3645Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3646 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3647 Utf8_2_1_inherit_TYPE_descriptor(td);
3648 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3649}
3650
3651asn_dec_rval_t
3652Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3653 void **structure, const void *bufptr, size_t size, int tag_mode) {
3654 Utf8_2_1_inherit_TYPE_descriptor(td);
3655 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3656}
3657
3658asn_enc_rval_t
3659Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
3660 void *structure, int tag_mode, ber_tlv_tag_t tag,
3661 asn_app_consume_bytes_f *cb, void *app_key) {
3662 Utf8_2_1_inherit_TYPE_descriptor(td);
3663 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3664}
3665
3666asn_dec_rval_t
3667Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3668 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3669 Utf8_2_1_inherit_TYPE_descriptor(td);
3670 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3671}
3672
3673asn_enc_rval_t
3674Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3675 int ilevel, enum xer_encoder_flags_e flags,
3676 asn_app_consume_bytes_f *cb, void *app_key) {
3677 Utf8_2_1_inherit_TYPE_descriptor(td);
3678 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3679}
3680
3681asn_dec_rval_t
3682Utf8_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3683 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3684 Utf8_2_1_inherit_TYPE_descriptor(td);
3685 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3686}
3687
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003688asn_enc_rval_t
3689Utf8_2_encode_uper(asn_TYPE_descriptor_t *td,
3690 asn_per_constraints_t *constraints,
3691 void *structure, asn_per_outp_t *per_out) {
3692 Utf8_2_1_inherit_TYPE_descriptor(td);
3693 return td->uper_encoder(td, constraints, structure, per_out);
3694}
3695
Lev Walkin59b176e2005-11-26 11:25:14 +00003696
Lev Walkin725883b2006-10-09 12:07:58 +00003697/*** <<< CTDEFS [Utf8-2] >>> ***/
3698
Lev Walkin2fce55d2013-03-28 05:00:39 -07003699static asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00003700 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3701 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3702 0, 0 /* No PER value map */
3703};
3704
Lev Walkin59b176e2005-11-26 11:25:14 +00003705/*** <<< STAT-DEFS [Utf8-2] >>> ***/
3706
Lev Walkina7591b52014-10-12 18:37:35 -07003707static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003708 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3709};
Lev Walkin59b176e2005-11-26 11:25:14 +00003710asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
3711 "Utf8-2",
3712 "Utf8-2",
3713 Utf8_2_free,
3714 Utf8_2_print,
3715 Utf8_2_constraint,
3716 Utf8_2_decode_ber,
3717 Utf8_2_encode_der,
3718 Utf8_2_decode_xer,
3719 Utf8_2_encode_xer,
3720 Utf8_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003721 Utf8_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003722 0, /* Use generic outmost tag fetcher */
3723 asn_DEF_Utf8_2_tags_1,
3724 sizeof(asn_DEF_Utf8_2_tags_1)
3725 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3726 asn_DEF_Utf8_2_tags_1, /* Same as above */
3727 sizeof(asn_DEF_Utf8_2_tags_1)
3728 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003729 &asn_PER_type_Utf8_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003730 0, 0, /* No members */
3731 0 /* No specifics */
3732};
3733
3734
3735/*** <<< INCLUDES [Utf8-1] >>> ***/
3736
3737#include <UTF8String.h>
3738
3739/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3740
3741typedef UTF8String_t Utf8_1_t;
3742
3743/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3744
3745extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3746asn_struct_free_f Utf8_1_free;
3747asn_struct_print_f Utf8_1_print;
3748asn_constr_check_f Utf8_1_constraint;
3749ber_type_decoder_f Utf8_1_decode_ber;
3750der_type_encoder_f Utf8_1_encode_der;
3751xer_type_decoder_f Utf8_1_decode_xer;
3752xer_type_encoder_f Utf8_1_encode_xer;
3753per_type_decoder_f Utf8_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003754per_type_encoder_f Utf8_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003755
3756/*** <<< CODE [Utf8-1] >>> ***/
3757
3758int
3759Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003760 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003761 /* Replace with underlying type checker */
3762 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00003763 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00003764}
3765
3766/*
3767 * This type is implemented using UTF8String,
3768 * so here we adjust the DEF accordingly.
3769 */
3770static void
3771Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3772 td->free_struct = asn_DEF_UTF8String.free_struct;
3773 td->print_struct = asn_DEF_UTF8String.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003774 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003775 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3776 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3777 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3778 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3779 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003780 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003781 if(!td->per_constraints)
3782 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3783 td->elements = asn_DEF_UTF8String.elements;
3784 td->elements_count = asn_DEF_UTF8String.elements_count;
3785 td->specifics = asn_DEF_UTF8String.specifics;
3786}
3787
3788void
3789Utf8_1_free(asn_TYPE_descriptor_t *td,
3790 void *struct_ptr, int contents_only) {
3791 Utf8_1_1_inherit_TYPE_descriptor(td);
3792 td->free_struct(td, struct_ptr, contents_only);
3793}
3794
3795int
3796Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3797 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3798 Utf8_1_1_inherit_TYPE_descriptor(td);
3799 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3800}
3801
3802asn_dec_rval_t
3803Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3804 void **structure, const void *bufptr, size_t size, int tag_mode) {
3805 Utf8_1_1_inherit_TYPE_descriptor(td);
3806 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3807}
3808
3809asn_enc_rval_t
3810Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3811 void *structure, int tag_mode, ber_tlv_tag_t tag,
3812 asn_app_consume_bytes_f *cb, void *app_key) {
3813 Utf8_1_1_inherit_TYPE_descriptor(td);
3814 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3815}
3816
3817asn_dec_rval_t
3818Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3819 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3820 Utf8_1_1_inherit_TYPE_descriptor(td);
3821 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3822}
3823
3824asn_enc_rval_t
3825Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3826 int ilevel, enum xer_encoder_flags_e flags,
3827 asn_app_consume_bytes_f *cb, void *app_key) {
3828 Utf8_1_1_inherit_TYPE_descriptor(td);
3829 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3830}
3831
3832asn_dec_rval_t
3833Utf8_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3834 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3835 Utf8_1_1_inherit_TYPE_descriptor(td);
3836 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3837}
3838
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003839asn_enc_rval_t
3840Utf8_1_encode_uper(asn_TYPE_descriptor_t *td,
3841 asn_per_constraints_t *constraints,
3842 void *structure, asn_per_outp_t *per_out) {
3843 Utf8_1_1_inherit_TYPE_descriptor(td);
3844 return td->uper_encoder(td, constraints, structure, per_out);
3845}
3846
Lev Walkin59b176e2005-11-26 11:25:14 +00003847
3848/*** <<< STAT-DEFS [Utf8-1] >>> ***/
3849
Lev Walkina7591b52014-10-12 18:37:35 -07003850static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00003851 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3852};
3853asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3854 "Utf8-1",
3855 "Utf8-1",
3856 Utf8_1_free,
3857 Utf8_1_print,
3858 Utf8_1_constraint,
3859 Utf8_1_decode_ber,
3860 Utf8_1_encode_der,
3861 Utf8_1_decode_xer,
3862 Utf8_1_encode_xer,
3863 Utf8_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003864 Utf8_1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003865 0, /* Use generic outmost tag fetcher */
3866 asn_DEF_Utf8_1_tags_1,
3867 sizeof(asn_DEF_Utf8_1_tags_1)
3868 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3869 asn_DEF_Utf8_1_tags_1, /* Same as above */
3870 sizeof(asn_DEF_Utf8_1_tags_1)
3871 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3872 0, /* No PER visible constraints */
3873 0, 0, /* No members */
3874 0 /* No specifics */
3875};
3876
3877
3878/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
3879
Lev Walkin22b5ed42006-09-13 02:51:20 +00003880#include "Identifier.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003881
3882/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
3883
3884typedef Identifier_t VisibleIdentifier_t;
3885
3886/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
3887
3888extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
3889asn_struct_free_f VisibleIdentifier_free;
3890asn_struct_print_f VisibleIdentifier_print;
3891asn_constr_check_f VisibleIdentifier_constraint;
3892ber_type_decoder_f VisibleIdentifier_decode_ber;
3893der_type_encoder_f VisibleIdentifier_encode_der;
3894xer_type_decoder_f VisibleIdentifier_decode_xer;
3895xer_type_encoder_f VisibleIdentifier_encode_xer;
3896per_type_decoder_f VisibleIdentifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003897per_type_encoder_f VisibleIdentifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003898
3899/*** <<< CTABLES [VisibleIdentifier] >>> ***/
3900
Lev Walkina7591b52014-10-12 18:37:35 -07003901static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003902 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3903 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3904 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
3905 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
3906 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
390727,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
3908 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
390954,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003910};
Lev Walkina7591b52014-10-12 18:37:35 -07003911static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000391236,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
391370,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
391486,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
3915107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
3916};
3917
Lev Walkin59b176e2005-11-26 11:25:14 +00003918
3919static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07003920 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00003921 /* The underlying type is VisibleString */
3922 const VisibleString_t *st = (const VisibleString_t *)sptr;
3923 const uint8_t *ch = st->buf;
3924 const uint8_t *end = ch + st->size;
3925
3926 for(; ch < end; ch++) {
3927 uint8_t cv = *ch;
3928 if(!table[cv]) return -1;
3929 }
3930 return 0;
3931}
3932
3933
3934/*** <<< CODE [VisibleIdentifier] >>> ***/
3935
3936int
3937VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003938 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003939 const Identifier_t *st = (const Identifier_t *)sptr;
3940 size_t size;
3941
3942 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003943 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003944 "%s: value not given (%s:%d)",
3945 td->name, __FILE__, __LINE__);
3946 return -1;
3947 }
3948
3949 size = st->size;
3950
3951 if((size >= 1 && size <= 32)
3952 && !check_permitted_alphabet_1(st)) {
3953 /* Constraint check succeeded */
3954 return 0;
3955 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07003956 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003957 "%s: constraint failed (%s:%d)",
3958 td->name, __FILE__, __LINE__);
3959 return -1;
3960 }
3961}
3962
3963/*
3964 * This type is implemented using Identifier,
3965 * so here we adjust the DEF accordingly.
3966 */
3967static void
3968VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3969 td->free_struct = asn_DEF_Identifier.free_struct;
3970 td->print_struct = asn_DEF_Identifier.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08003971 td->check_constraints = asn_DEF_Identifier.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00003972 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
3973 td->der_encoder = asn_DEF_Identifier.der_encoder;
3974 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
3975 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
3976 td->uper_decoder = asn_DEF_Identifier.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003977 td->uper_encoder = asn_DEF_Identifier.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003978 if(!td->per_constraints)
3979 td->per_constraints = asn_DEF_Identifier.per_constraints;
3980 td->elements = asn_DEF_Identifier.elements;
3981 td->elements_count = asn_DEF_Identifier.elements_count;
3982 td->specifics = asn_DEF_Identifier.specifics;
3983}
3984
3985void
3986VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
3987 void *struct_ptr, int contents_only) {
3988 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3989 td->free_struct(td, struct_ptr, contents_only);
3990}
3991
3992int
3993VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3994 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3995 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3996 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3997}
3998
3999asn_dec_rval_t
4000VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4001 void **structure, const void *bufptr, size_t size, int tag_mode) {
4002 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4003 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4004}
4005
4006asn_enc_rval_t
4007VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
4008 void *structure, int tag_mode, ber_tlv_tag_t tag,
4009 asn_app_consume_bytes_f *cb, void *app_key) {
4010 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4011 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4012}
4013
4014asn_dec_rval_t
4015VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4016 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4017 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4018 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4019}
4020
4021asn_enc_rval_t
4022VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4023 int ilevel, enum xer_encoder_flags_e flags,
4024 asn_app_consume_bytes_f *cb, void *app_key) {
4025 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4026 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4027}
4028
4029asn_dec_rval_t
4030VisibleIdentifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4031 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4032 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4033 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4034}
4035
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004036asn_enc_rval_t
4037VisibleIdentifier_encode_uper(asn_TYPE_descriptor_t *td,
4038 asn_per_constraints_t *constraints,
4039 void *structure, asn_per_outp_t *per_out) {
4040 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4041 return td->uper_encoder(td, constraints, structure, per_out);
4042}
4043
Lev Walkin59b176e2005-11-26 11:25:14 +00004044
4045/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
4046
Lev Walkina7591b52014-10-12 18:37:35 -07004047static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004048 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
4049};
4050asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
4051 "VisibleIdentifier",
4052 "VisibleIdentifier",
4053 VisibleIdentifier_free,
4054 VisibleIdentifier_print,
4055 VisibleIdentifier_constraint,
4056 VisibleIdentifier_decode_ber,
4057 VisibleIdentifier_encode_der,
4058 VisibleIdentifier_decode_xer,
4059 VisibleIdentifier_encode_xer,
4060 VisibleIdentifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004061 VisibleIdentifier_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004062 0, /* Use generic outmost tag fetcher */
4063 asn_DEF_VisibleIdentifier_tags_1,
4064 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4065 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
4066 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
4067 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4068 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
4069 0, /* No PER visible constraints */
4070 0, 0, /* No members */
4071 0 /* No specifics */
4072};
4073
4074
4075/*** <<< INCLUDES [Sequence] >>> ***/
4076
Lev Walkin22b5ed42006-09-13 02:51:20 +00004077#include "Int1.h"
4078#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004079#include <BOOLEAN.h>
Lev Walkin2a744a72013-03-27 01:56:23 -07004080#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00004081#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00004082#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004083#include <constr_SEQUENCE.h>
4084
4085/*** <<< DEPS [Sequence] >>> ***/
4086
4087typedef enum enum_c {
4088 enum_c_one = 1,
4089 enum_c_two = 2,
4090 /*
4091 * Enumeration is extensible
4092 */
4093 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00004094} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00004095
4096/*** <<< TYPE-DECLS [Sequence] >>> ***/
4097
4098typedef struct Sequence {
4099 Int1_t *int1_c /* DEFAULT 3 */;
4100 Int4_t int4;
4101 Int4_t int4_c;
Lev Walkin2a744a72013-03-27 01:56:23 -07004102 BOOLEAN_t *Bool /* DEFAULT 1 */;
4103 long enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00004104 NULL_t *null /* OPTIONAL */;
4105 /*
4106 * This type is extensible,
4107 * possible extensions are below.
4108 */
4109 Int5_t *int5_c /* OPTIONAL */;
4110
4111 /* Context for parsing across buffer boundaries */
4112 asn_struct_ctx_t _asn_ctx;
4113} Sequence_t;
4114
4115/*** <<< FUNC-DECLS [Sequence] >>> ***/
4116
4117/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
4118extern asn_TYPE_descriptor_t asn_DEF_Sequence;
4119
4120/*** <<< CODE [Sequence] >>> ***/
4121
4122static int
4123enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004124 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004125 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -07004126 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004127 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004128}
4129
4130/*
Lev Walkin2a744a72013-03-27 01:56:23 -07004131 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00004132 * so here we adjust the DEF accordingly.
4133 */
4134static void
4135enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -07004136 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4137 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004138 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -07004139 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4140 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4141 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4142 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4143 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
4144 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004145 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -07004146 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4147 td->elements = asn_DEF_NativeEnumerated.elements;
4148 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4149 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
Lev Walkin59b176e2005-11-26 11:25:14 +00004150}
4151
4152static void
4153enum_c_6_free(asn_TYPE_descriptor_t *td,
4154 void *struct_ptr, int contents_only) {
4155 enum_c_6_inherit_TYPE_descriptor(td);
4156 td->free_struct(td, struct_ptr, contents_only);
4157}
4158
4159static int
4160enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4161 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4162 enum_c_6_inherit_TYPE_descriptor(td);
4163 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4164}
4165
4166static asn_dec_rval_t
4167enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4168 void **structure, const void *bufptr, size_t size, int tag_mode) {
4169 enum_c_6_inherit_TYPE_descriptor(td);
4170 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4171}
4172
4173static asn_enc_rval_t
4174enum_c_6_encode_der(asn_TYPE_descriptor_t *td,
4175 void *structure, int tag_mode, ber_tlv_tag_t tag,
4176 asn_app_consume_bytes_f *cb, void *app_key) {
4177 enum_c_6_inherit_TYPE_descriptor(td);
4178 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4179}
4180
4181static asn_dec_rval_t
4182enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4183 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4184 enum_c_6_inherit_TYPE_descriptor(td);
4185 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4186}
4187
4188static asn_enc_rval_t
4189enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4190 int ilevel, enum xer_encoder_flags_e flags,
4191 asn_app_consume_bytes_f *cb, void *app_key) {
4192 enum_c_6_inherit_TYPE_descriptor(td);
4193 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4194}
4195
4196static asn_dec_rval_t
4197enum_c_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4198 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4199 enum_c_6_inherit_TYPE_descriptor(td);
4200 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4201}
4202
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004203static asn_enc_rval_t
4204enum_c_6_encode_uper(asn_TYPE_descriptor_t *td,
4205 asn_per_constraints_t *constraints,
4206 void *structure, asn_per_outp_t *per_out) {
4207 enum_c_6_inherit_TYPE_descriptor(td);
4208 return td->uper_encoder(td, constraints, structure, per_out);
4209}
4210
Lev Walkin59b176e2005-11-26 11:25:14 +00004211static int
4212memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004213 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004214 long value;
4215
4216 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004217 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004218 "%s: value not given (%s:%d)",
4219 td->name, __FILE__, __LINE__);
4220 return -1;
4221 }
4222
Lev Walkin2a744a72013-03-27 01:56:23 -07004223 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004224
4225 if((value >= -2)) {
4226 /* Constraint check succeeded */
4227 return 0;
4228 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004229 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004230 "%s: constraint failed (%s:%d)",
4231 td->name, __FILE__, __LINE__);
4232 return -1;
4233 }
4234}
4235
4236static int
4237memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004238 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004239 long value;
4240
4241 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004242 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004243 "%s: value not given (%s:%d)",
4244 td->name, __FILE__, __LINE__);
4245 return -1;
4246 }
4247
Lev Walkin2a744a72013-03-27 01:56:23 -07004248 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004249
4250 if((value >= 5 && value <= 7)) {
4251 /* Constraint check succeeded */
4252 return 0;
4253 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004254 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004255 "%s: constraint failed (%s:%d)",
4256 td->name, __FILE__, __LINE__);
4257 return -1;
4258 }
4259}
4260
4261static int
4262memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004263 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004264 long value;
4265
4266 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004267 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004268 "%s: value not given (%s:%d)",
4269 td->name, __FILE__, __LINE__);
4270 return -1;
4271 }
4272
Lev Walkin2a744a72013-03-27 01:56:23 -07004273 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004274
4275 if((value == 5)) {
4276 /* Constraint check succeeded */
4277 return 0;
4278 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004279 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004280 "%s: constraint failed (%s:%d)",
4281 td->name, __FILE__, __LINE__);
4282 return -1;
4283 }
4284}
4285
4286
Lev Walkin725883b2006-10-09 12:07:58 +00004287/*** <<< CTDEFS [Sequence] >>> ***/
4288
Lev Walkin2fce55d2013-03-28 05:00:39 -07004289static asn_per_constraints_t asn_PER_type_enum_c_constr_6 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004290 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
4291 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4292 0, 0 /* No PER value map */
4293};
Lev Walkin2fce55d2013-03-28 05:00:39 -07004294static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004295 { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
4296 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4297 0, 0 /* No PER value map */
4298};
Lev Walkin2fce55d2013-03-28 05:00:39 -07004299static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004300 { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
4301 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4302 0, 0 /* No PER value map */
4303};
Lev Walkin2fce55d2013-03-28 05:00:39 -07004304static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004305 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
4306 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4307 0, 0 /* No PER value map */
4308};
4309
Lev Walkin59b176e2005-11-26 11:25:14 +00004310/*** <<< STAT-DEFS [Sequence] >>> ***/
4311
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004312static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004313 Int1_t *st = *sptr;
4314
4315 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004316 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004317 st = (*sptr = CALLOC(1, sizeof(*st)));
4318 if(!st) return -1;
4319 }
4320
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004321 if(set_value) {
4322 /* Install default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07004323 *st = 3;
4324 return 0;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004325 } else {
4326 /* Test default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07004327 return (*st == 3);
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004328 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004329}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004330static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004331 BOOLEAN_t *st = *sptr;
4332
4333 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004334 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004335 st = (*sptr = CALLOC(1, sizeof(*st)));
4336 if(!st) return -1;
4337 }
4338
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004339 if(set_value) {
4340 /* Install default value 1 */
4341 *st = 1;
4342 return 0;
4343 } else {
4344 /* Test default value 1 */
4345 return (*st == 1);
4346 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004347}
Lev Walkina7591b52014-10-12 18:37:35 -07004348static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004349 { 1, 3, "one" },
4350 { 2, 3, "two" },
4351 { 3, 5, "three" }
4352 /* This list is extensible */
4353};
Lev Walkina7591b52014-10-12 18:37:35 -07004354static const unsigned int asn_MAP_enum_c_enum2value_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004355 0, /* one(1) */
4356 2, /* three(3) */
4357 1 /* two(2) */
4358 /* This list is extensible */
4359};
Lev Walkina7591b52014-10-12 18:37:35 -07004360static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004361 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
4362 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
4363 3, /* Number of elements in the maps */
4364 3, /* Extensions before this member */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004365 1, /* Strict enumeration */
4366 0, /* Native long size */
4367 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004368};
Lev Walkina7591b52014-10-12 18:37:35 -07004369static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004370 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4371};
Lev Walkin59b176e2005-11-26 11:25:14 +00004372static /* Use -fall-defs-global to expose */
4373asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
4374 "enum-c",
4375 "enum-c",
4376 enum_c_6_free,
4377 enum_c_6_print,
4378 enum_c_6_constraint,
4379 enum_c_6_decode_ber,
4380 enum_c_6_encode_der,
4381 enum_c_6_decode_xer,
4382 enum_c_6_encode_xer,
4383 enum_c_6_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004384 enum_c_6_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004385 0, /* Use generic outmost tag fetcher */
4386 asn_DEF_enum_c_tags_6,
4387 sizeof(asn_DEF_enum_c_tags_6)
4388 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
4389 asn_DEF_enum_c_tags_6, /* Same as above */
4390 sizeof(asn_DEF_enum_c_tags_6)
4391 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004392 &asn_PER_type_enum_c_constr_6,
Lev Walkin59b176e2005-11-26 11:25:14 +00004393 0, 0, /* Defined elsewhere */
4394 &asn_SPC_enum_c_specs_6 /* Additional specs */
4395};
4396
Lev Walkin59b176e2005-11-26 11:25:14 +00004397static asn_TYPE_member_t asn_MBR_Sequence_1[] = {
4398 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
4399 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4400 .tag_mode = 0,
4401 .type = &asn_DEF_Int1,
4402 .memb_constraints = memb_int1_c_constraint_1,
Lev Walkin4b5dae32006-10-09 12:27:44 +00004403 .per_constraints = &asn_PER_memb_int1_c_constr_2,
Lev Walkin59b176e2005-11-26 11:25:14 +00004404 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
4405 .name = "int1-c"
4406 },
4407 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
4408 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
4409 .tag_mode = +1, /* EXPLICIT tag at current level */
4410 .type = &asn_DEF_Int4,
4411 .memb_constraints = 0, /* Defer constraints checking to the member type */
4412 .per_constraints = 0, /* No PER visible constraints */
4413 .default_value = 0,
4414 .name = "int4"
4415 },
4416 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
4417 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4418 .tag_mode = 0,
4419 .type = &asn_DEF_Int4,
4420 .memb_constraints = memb_int4_c_constraint_1,
Lev Walkin4b5dae32006-10-09 12:27:44 +00004421 .per_constraints = &asn_PER_memb_int4_c_constr_4,
Lev Walkin59b176e2005-11-26 11:25:14 +00004422 .default_value = 0,
4423 .name = "int4-c"
4424 },
Lev Walkin2a744a72013-03-27 01:56:23 -07004425 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +00004426 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
4427 .tag_mode = 0,
4428 .type = &asn_DEF_BOOLEAN,
4429 .memb_constraints = 0, /* Defer constraints checking to the member type */
4430 .per_constraints = 0, /* No PER visible constraints */
4431 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
4432 .name = "bool"
4433 },
4434 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
4435 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
4436 .tag_mode = 0,
4437 .type = &asn_DEF_enum_c_6,
4438 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin07aaa342006-10-09 12:52:15 +00004439 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004440 .default_value = 0,
4441 .name = "enum-c"
4442 },
4443 { ATF_POINTER, 2, offsetof(struct Sequence, null),
4444 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
4445 .tag_mode = 0,
4446 .type = &asn_DEF_NULL,
4447 .memb_constraints = 0, /* Defer constraints checking to the member type */
4448 .per_constraints = 0, /* No PER visible constraints */
4449 .default_value = 0,
4450 .name = "null"
4451 },
4452 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
4453 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4454 .tag_mode = 0,
4455 .type = &asn_DEF_Int5,
4456 .memb_constraints = memb_int5_c_constraint_1,
Lev Walkin4b5dae32006-10-09 12:27:44 +00004457 .per_constraints = &asn_PER_memb_int5_c_constr_13,
Lev Walkin59b176e2005-11-26 11:25:14 +00004458 .default_value = 0,
4459 .name = "int5-c"
4460 },
4461};
Lev Walkina7591b52014-10-12 18:37:35 -07004462static const int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
4463static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004464 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4465};
Lev Walkina7591b52014-10-12 18:37:35 -07004466static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -07004467 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */
4468 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */
4469 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */
4470 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */
4471 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */
4472 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */
4473 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */
Lev Walkin59b176e2005-11-26 11:25:14 +00004474};
4475static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
4476 sizeof(struct Sequence),
4477 offsetof(struct Sequence, _asn_ctx),
4478 asn_MAP_Sequence_tag2el_1,
4479 7, /* Count of tags in the map */
4480 asn_MAP_Sequence_oms_1, /* Optional members */
4481 3, 1, /* Root/Additions */
4482 5, /* Start extensions */
4483 8 /* Stop extensions */
4484};
4485asn_TYPE_descriptor_t asn_DEF_Sequence = {
4486 "Sequence",
4487 "Sequence",
4488 SEQUENCE_free,
4489 SEQUENCE_print,
4490 SEQUENCE_constraint,
4491 SEQUENCE_decode_ber,
4492 SEQUENCE_encode_der,
4493 SEQUENCE_decode_xer,
4494 SEQUENCE_encode_xer,
4495 SEQUENCE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004496 SEQUENCE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004497 0, /* Use generic outmost tag fetcher */
4498 asn_DEF_Sequence_tags_1,
4499 sizeof(asn_DEF_Sequence_tags_1)
4500 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4501 asn_DEF_Sequence_tags_1, /* Same as above */
4502 sizeof(asn_DEF_Sequence_tags_1)
4503 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4504 0, /* No PER visible constraints */
4505 asn_MBR_Sequence_1,
4506 7, /* Elements count */
4507 &asn_SPC_Sequence_specs_1 /* Additional specs */
4508};
4509
4510
4511/*** <<< INCLUDES [SequenceOf] >>> ***/
4512
4513#include <asn_SEQUENCE_OF.h>
4514#include <constr_SEQUENCE_OF.h>
4515
4516/*** <<< FWD-DECLS [SequenceOf] >>> ***/
4517
4518struct Sequence;
4519
4520/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
4521
4522typedef struct SequenceOf {
4523 A_SEQUENCE_OF(struct Sequence) list;
4524
4525 /* Context for parsing across buffer boundaries */
4526 asn_struct_ctx_t _asn_ctx;
4527} SequenceOf_t;
4528
4529/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
4530
4531extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
4532
4533/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
4534
Lev Walkin22b5ed42006-09-13 02:51:20 +00004535#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004536
Lev Walkin725883b2006-10-09 12:07:58 +00004537/*** <<< CTDEFS [SequenceOf] >>> ***/
4538
Lev Walkin2fce55d2013-03-28 05:00:39 -07004539static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004540 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4541 { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */,
4542 0, 0 /* No PER value map */
4543};
4544
Lev Walkin59b176e2005-11-26 11:25:14 +00004545/*** <<< STAT-DEFS [SequenceOf] >>> ***/
4546
4547static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
4548 { ATF_POINTER, 0, 0,
4549 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
4550 .tag_mode = 0,
4551 .type = &asn_DEF_Sequence,
4552 .memb_constraints = 0, /* Defer constraints checking to the member type */
4553 .per_constraints = 0, /* No PER visible constraints */
4554 .default_value = 0,
4555 .name = ""
4556 },
4557};
Lev Walkina7591b52014-10-12 18:37:35 -07004558static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004559 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4560};
4561static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
4562 sizeof(struct SequenceOf),
4563 offsetof(struct SequenceOf, _asn_ctx),
4564 0, /* XER encoding is XMLDelimitedItemList */
4565};
Lev Walkin59b176e2005-11-26 11:25:14 +00004566asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
4567 "SequenceOf",
4568 "SequenceOf",
4569 SEQUENCE_OF_free,
4570 SEQUENCE_OF_print,
4571 SEQUENCE_OF_constraint,
4572 SEQUENCE_OF_decode_ber,
4573 SEQUENCE_OF_encode_der,
4574 SEQUENCE_OF_decode_xer,
4575 SEQUENCE_OF_encode_xer,
4576 SEQUENCE_OF_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004577 SEQUENCE_OF_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004578 0, /* Use generic outmost tag fetcher */
4579 asn_DEF_SequenceOf_tags_1,
4580 sizeof(asn_DEF_SequenceOf_tags_1)
4581 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4582 asn_DEF_SequenceOf_tags_1, /* Same as above */
4583 sizeof(asn_DEF_SequenceOf_tags_1)
4584 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004585 &asn_PER_type_SequenceOf_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004586 asn_MBR_SequenceOf_1,
4587 1, /* Single element */
4588 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
4589};
4590
4591
4592/*** <<< INCLUDES [Enum0] >>> ***/
4593
Lev Walkin2a744a72013-03-27 01:56:23 -07004594#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00004595
4596/*** <<< DEPS [Enum0] >>> ***/
4597
4598typedef enum Enum0 {
4599 Enum0_one = 0,
4600 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004601} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00004602
4603/*** <<< TYPE-DECLS [Enum0] >>> ***/
4604
Lev Walkin2a744a72013-03-27 01:56:23 -07004605typedef long Enum0_t;
Lev Walkin59b176e2005-11-26 11:25:14 +00004606
4607/*** <<< FUNC-DECLS [Enum0] >>> ***/
4608
4609extern asn_TYPE_descriptor_t asn_DEF_Enum0;
4610asn_struct_free_f Enum0_free;
4611asn_struct_print_f Enum0_print;
4612asn_constr_check_f Enum0_constraint;
4613ber_type_decoder_f Enum0_decode_ber;
4614der_type_encoder_f Enum0_encode_der;
4615xer_type_decoder_f Enum0_decode_xer;
4616xer_type_encoder_f Enum0_encode_xer;
4617per_type_decoder_f Enum0_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004618per_type_encoder_f Enum0_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004619
4620/*** <<< CODE [Enum0] >>> ***/
4621
4622int
4623Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004624 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004625 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -07004626 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004627 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004628}
4629
4630/*
Lev Walkin2a744a72013-03-27 01:56:23 -07004631 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00004632 * so here we adjust the DEF accordingly.
4633 */
4634static void
4635Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -07004636 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4637 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004638 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin2a744a72013-03-27 01:56:23 -07004639 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4640 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4641 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4642 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4643 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
4644 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004645 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -07004646 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4647 td->elements = asn_DEF_NativeEnumerated.elements;
4648 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4649 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
Lev Walkin59b176e2005-11-26 11:25:14 +00004650}
4651
4652void
4653Enum0_free(asn_TYPE_descriptor_t *td,
4654 void *struct_ptr, int contents_only) {
4655 Enum0_1_inherit_TYPE_descriptor(td);
4656 td->free_struct(td, struct_ptr, contents_only);
4657}
4658
4659int
4660Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4661 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4662 Enum0_1_inherit_TYPE_descriptor(td);
4663 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4664}
4665
4666asn_dec_rval_t
4667Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4668 void **structure, const void *bufptr, size_t size, int tag_mode) {
4669 Enum0_1_inherit_TYPE_descriptor(td);
4670 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4671}
4672
4673asn_enc_rval_t
4674Enum0_encode_der(asn_TYPE_descriptor_t *td,
4675 void *structure, int tag_mode, ber_tlv_tag_t tag,
4676 asn_app_consume_bytes_f *cb, void *app_key) {
4677 Enum0_1_inherit_TYPE_descriptor(td);
4678 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4679}
4680
4681asn_dec_rval_t
4682Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4683 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4684 Enum0_1_inherit_TYPE_descriptor(td);
4685 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4686}
4687
4688asn_enc_rval_t
4689Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4690 int ilevel, enum xer_encoder_flags_e flags,
4691 asn_app_consume_bytes_f *cb, void *app_key) {
4692 Enum0_1_inherit_TYPE_descriptor(td);
4693 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4694}
4695
4696asn_dec_rval_t
4697Enum0_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4698 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4699 Enum0_1_inherit_TYPE_descriptor(td);
4700 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4701}
4702
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004703asn_enc_rval_t
4704Enum0_encode_uper(asn_TYPE_descriptor_t *td,
4705 asn_per_constraints_t *constraints,
4706 void *structure, asn_per_outp_t *per_out) {
4707 Enum0_1_inherit_TYPE_descriptor(td);
4708 return td->uper_encoder(td, constraints, structure, per_out);
4709}
4710
Lev Walkin59b176e2005-11-26 11:25:14 +00004711
Lev Walkin725883b2006-10-09 12:07:58 +00004712/*** <<< CTDEFS [Enum0] >>> ***/
4713
Lev Walkin2fce55d2013-03-28 05:00:39 -07004714static asn_per_constraints_t asn_PER_type_Enum0_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004715 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4716 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4717 0, 0 /* No PER value map */
4718};
4719
Lev Walkin59b176e2005-11-26 11:25:14 +00004720/*** <<< STAT-DEFS [Enum0] >>> ***/
4721
Lev Walkina7591b52014-10-12 18:37:35 -07004722static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004723 { 0, 3, "one" },
4724 { 1, 3, "two" }
4725};
Lev Walkina7591b52014-10-12 18:37:35 -07004726static const unsigned int asn_MAP_Enum0_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004727 0, /* one(0) */
4728 1 /* two(1) */
4729};
Lev Walkina7591b52014-10-12 18:37:35 -07004730static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004731 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
4732 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
4733 2, /* Number of elements in the maps */
4734 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004735 1, /* Strict enumeration */
4736 0, /* Native long size */
4737 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004738};
Lev Walkina7591b52014-10-12 18:37:35 -07004739static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004740 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4741};
Lev Walkin59b176e2005-11-26 11:25:14 +00004742asn_TYPE_descriptor_t asn_DEF_Enum0 = {
4743 "Enum0",
4744 "Enum0",
4745 Enum0_free,
4746 Enum0_print,
4747 Enum0_constraint,
4748 Enum0_decode_ber,
4749 Enum0_encode_der,
4750 Enum0_decode_xer,
4751 Enum0_encode_xer,
4752 Enum0_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004753 Enum0_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004754 0, /* Use generic outmost tag fetcher */
4755 asn_DEF_Enum0_tags_1,
4756 sizeof(asn_DEF_Enum0_tags_1)
4757 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4758 asn_DEF_Enum0_tags_1, /* Same as above */
4759 sizeof(asn_DEF_Enum0_tags_1)
4760 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004761 &asn_PER_type_Enum0_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004762 0, 0, /* Defined elsewhere */
4763 &asn_SPC_Enum0_specs_1 /* Additional specs */
4764};
4765
4766
4767/*** <<< INCLUDES [Enum1] >>> ***/
4768
4769#include <NativeEnumerated.h>
4770
4771/*** <<< DEPS [Enum1] >>> ***/
4772
4773typedef enum Enum1 {
4774 Enum1_one = 0,
4775 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004776} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00004777
4778/*** <<< TYPE-DECLS [Enum1] >>> ***/
4779
4780typedef long Enum1_t;
4781
4782/*** <<< FUNC-DECLS [Enum1] >>> ***/
4783
4784extern asn_TYPE_descriptor_t asn_DEF_Enum1;
4785asn_struct_free_f Enum1_free;
4786asn_struct_print_f Enum1_print;
4787asn_constr_check_f Enum1_constraint;
4788ber_type_decoder_f Enum1_decode_ber;
4789der_type_encoder_f Enum1_encode_der;
4790xer_type_decoder_f Enum1_decode_xer;
4791xer_type_encoder_f Enum1_encode_xer;
4792per_type_decoder_f Enum1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004793per_type_encoder_f Enum1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004794
4795/*** <<< CODE [Enum1] >>> ***/
4796
4797int
4798Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004799 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004800 long value;
4801
4802 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004803 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004804 "%s: value not given (%s:%d)",
4805 td->name, __FILE__, __LINE__);
4806 return -1;
4807 }
4808
4809 value = *(const long *)sptr;
4810
4811 if((value == 0)) {
4812 /* Constraint check succeeded */
4813 return 0;
4814 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07004815 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004816 "%s: constraint failed (%s:%d)",
4817 td->name, __FILE__, __LINE__);
4818 return -1;
4819 }
4820}
4821
4822/*
4823 * This type is implemented using NativeEnumerated,
4824 * so here we adjust the DEF accordingly.
4825 */
4826static void
4827Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4828 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4829 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08004830 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00004831 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4832 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4833 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4834 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4835 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004836 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004837 if(!td->per_constraints)
4838 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4839 td->elements = asn_DEF_NativeEnumerated.elements;
4840 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4841 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
4842}
4843
4844void
4845Enum1_free(asn_TYPE_descriptor_t *td,
4846 void *struct_ptr, int contents_only) {
4847 Enum1_1_inherit_TYPE_descriptor(td);
4848 td->free_struct(td, struct_ptr, contents_only);
4849}
4850
4851int
4852Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4853 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4854 Enum1_1_inherit_TYPE_descriptor(td);
4855 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4856}
4857
4858asn_dec_rval_t
4859Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4860 void **structure, const void *bufptr, size_t size, int tag_mode) {
4861 Enum1_1_inherit_TYPE_descriptor(td);
4862 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4863}
4864
4865asn_enc_rval_t
4866Enum1_encode_der(asn_TYPE_descriptor_t *td,
4867 void *structure, int tag_mode, ber_tlv_tag_t tag,
4868 asn_app_consume_bytes_f *cb, void *app_key) {
4869 Enum1_1_inherit_TYPE_descriptor(td);
4870 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4871}
4872
4873asn_dec_rval_t
4874Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4875 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4876 Enum1_1_inherit_TYPE_descriptor(td);
4877 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4878}
4879
4880asn_enc_rval_t
4881Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4882 int ilevel, enum xer_encoder_flags_e flags,
4883 asn_app_consume_bytes_f *cb, void *app_key) {
4884 Enum1_1_inherit_TYPE_descriptor(td);
4885 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4886}
4887
4888asn_dec_rval_t
4889Enum1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4890 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4891 Enum1_1_inherit_TYPE_descriptor(td);
4892 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4893}
4894
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004895asn_enc_rval_t
4896Enum1_encode_uper(asn_TYPE_descriptor_t *td,
4897 asn_per_constraints_t *constraints,
4898 void *structure, asn_per_outp_t *per_out) {
4899 Enum1_1_inherit_TYPE_descriptor(td);
4900 return td->uper_encoder(td, constraints, structure, per_out);
4901}
4902
Lev Walkin59b176e2005-11-26 11:25:14 +00004903
Lev Walkin725883b2006-10-09 12:07:58 +00004904/*** <<< CTDEFS [Enum1] >>> ***/
4905
Lev Walkin2fce55d2013-03-28 05:00:39 -07004906static asn_per_constraints_t asn_PER_type_Enum1_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00004907 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4908 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4909 0, 0 /* No PER value map */
4910};
4911
Lev Walkin59b176e2005-11-26 11:25:14 +00004912/*** <<< STAT-DEFS [Enum1] >>> ***/
4913
Lev Walkina7591b52014-10-12 18:37:35 -07004914static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004915 { 0, 3, "one" },
4916 { 1, 3, "two" }
4917};
Lev Walkina7591b52014-10-12 18:37:35 -07004918static const unsigned int asn_MAP_Enum1_enum2value_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004919 0, /* one(0) */
4920 1 /* two(1) */
4921};
Lev Walkina7591b52014-10-12 18:37:35 -07004922static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004923 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
4924 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
4925 2, /* Number of elements in the maps */
4926 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004927 1, /* Strict enumeration */
4928 0, /* Native long size */
4929 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004930};
Lev Walkina7591b52014-10-12 18:37:35 -07004931static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00004932 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4933};
Lev Walkin59b176e2005-11-26 11:25:14 +00004934asn_TYPE_descriptor_t asn_DEF_Enum1 = {
4935 "Enum1",
4936 "Enum1",
4937 Enum1_free,
4938 Enum1_print,
4939 Enum1_constraint,
4940 Enum1_decode_ber,
4941 Enum1_encode_der,
4942 Enum1_decode_xer,
4943 Enum1_encode_xer,
4944 Enum1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004945 Enum1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004946 0, /* Use generic outmost tag fetcher */
4947 asn_DEF_Enum1_tags_1,
4948 sizeof(asn_DEF_Enum1_tags_1)
4949 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4950 asn_DEF_Enum1_tags_1, /* Same as above */
4951 sizeof(asn_DEF_Enum1_tags_1)
4952 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004953 &asn_PER_type_Enum1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004954 0, 0, /* Defined elsewhere */
4955 &asn_SPC_Enum1_specs_1 /* Additional specs */
4956};
4957
4958
4959/*** <<< INCLUDES [Identifier] >>> ***/
4960
4961#include <VisibleString.h>
4962
4963/*** <<< TYPE-DECLS [Identifier] >>> ***/
4964
4965typedef VisibleString_t Identifier_t;
4966
4967/*** <<< FUNC-DECLS [Identifier] >>> ***/
4968
4969extern asn_TYPE_descriptor_t asn_DEF_Identifier;
4970asn_struct_free_f Identifier_free;
4971asn_struct_print_f Identifier_print;
4972asn_constr_check_f Identifier_constraint;
4973ber_type_decoder_f Identifier_decode_ber;
4974der_type_encoder_f Identifier_encode_der;
4975xer_type_decoder_f Identifier_decode_xer;
4976xer_type_encoder_f Identifier_encode_xer;
4977per_type_decoder_f Identifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004978per_type_encoder_f Identifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004979
4980/*** <<< CTABLES [Identifier] >>> ***/
4981
Lev Walkina7591b52014-10-12 18:37:35 -07004982static const int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00004983 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4984 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4985 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
4986 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
4987 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
498827,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
4989 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
499054,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00004991};
Lev Walkina7591b52014-10-12 18:37:35 -07004992static const int permitted_alphabet_code2value_1[64] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +0000499336,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
499470,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
499586,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
4996107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
4997};
4998
Lev Walkin59b176e2005-11-26 11:25:14 +00004999
5000static int check_permitted_alphabet_1(const void *sptr) {
Lev Walkina7591b52014-10-12 18:37:35 -07005001 const int *table = permitted_alphabet_table_1;
Lev Walkin59b176e2005-11-26 11:25:14 +00005002 /* The underlying type is VisibleString */
5003 const VisibleString_t *st = (const VisibleString_t *)sptr;
5004 const uint8_t *ch = st->buf;
5005 const uint8_t *end = ch + st->size;
5006
5007 for(; ch < end; ch++) {
5008 uint8_t cv = *ch;
5009 if(!table[cv]) return -1;
5010 }
5011 return 0;
5012}
5013
5014
5015/*** <<< CODE [Identifier] >>> ***/
5016
5017int
5018Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00005019 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00005020 const VisibleString_t *st = (const VisibleString_t *)sptr;
5021 size_t size;
5022
5023 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -07005024 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00005025 "%s: value not given (%s:%d)",
5026 td->name, __FILE__, __LINE__);
5027 return -1;
5028 }
5029
5030 size = st->size;
5031
5032 if((size >= 1 && size <= 32)
5033 && !check_permitted_alphabet_1(st)) {
5034 /* Constraint check succeeded */
5035 return 0;
5036 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -07005037 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00005038 "%s: constraint failed (%s:%d)",
5039 td->name, __FILE__, __LINE__);
5040 return -1;
5041 }
5042}
5043
Lev Walkin725883b2006-10-09 12:07:58 +00005044static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) {
5045 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
5046 return -1;
5047 return permitted_alphabet_table_1[value] - 1;
5048}
5049static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) {
5050 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
5051 return -1;
5052 return permitted_alphabet_code2value_1[code];
5053}
Lev Walkin59b176e2005-11-26 11:25:14 +00005054/*
5055 * This type is implemented using VisibleString,
5056 * so here we adjust the DEF accordingly.
5057 */
5058static void
5059Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
5060 td->free_struct = asn_DEF_VisibleString.free_struct;
5061 td->print_struct = asn_DEF_VisibleString.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -08005062 td->check_constraints = asn_DEF_VisibleString.check_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +00005063 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
5064 td->der_encoder = asn_DEF_VisibleString.der_encoder;
5065 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
5066 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
5067 td->uper_decoder = asn_DEF_VisibleString.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005068 td->uper_encoder = asn_DEF_VisibleString.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00005069 if(!td->per_constraints)
5070 td->per_constraints = asn_DEF_VisibleString.per_constraints;
5071 td->elements = asn_DEF_VisibleString.elements;
5072 td->elements_count = asn_DEF_VisibleString.elements_count;
5073 td->specifics = asn_DEF_VisibleString.specifics;
5074}
5075
5076void
5077Identifier_free(asn_TYPE_descriptor_t *td,
5078 void *struct_ptr, int contents_only) {
5079 Identifier_1_inherit_TYPE_descriptor(td);
5080 td->free_struct(td, struct_ptr, contents_only);
5081}
5082
5083int
5084Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
5085 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
5086 Identifier_1_inherit_TYPE_descriptor(td);
5087 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
5088}
5089
5090asn_dec_rval_t
5091Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5092 void **structure, const void *bufptr, size_t size, int tag_mode) {
5093 Identifier_1_inherit_TYPE_descriptor(td);
5094 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
5095}
5096
5097asn_enc_rval_t
5098Identifier_encode_der(asn_TYPE_descriptor_t *td,
5099 void *structure, int tag_mode, ber_tlv_tag_t tag,
5100 asn_app_consume_bytes_f *cb, void *app_key) {
5101 Identifier_1_inherit_TYPE_descriptor(td);
5102 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
5103}
5104
5105asn_dec_rval_t
5106Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5107 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
5108 Identifier_1_inherit_TYPE_descriptor(td);
5109 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
5110}
5111
5112asn_enc_rval_t
5113Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
5114 int ilevel, enum xer_encoder_flags_e flags,
5115 asn_app_consume_bytes_f *cb, void *app_key) {
5116 Identifier_1_inherit_TYPE_descriptor(td);
5117 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
5118}
5119
5120asn_dec_rval_t
5121Identifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5122 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
5123 Identifier_1_inherit_TYPE_descriptor(td);
5124 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
5125}
5126
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005127asn_enc_rval_t
5128Identifier_encode_uper(asn_TYPE_descriptor_t *td,
5129 asn_per_constraints_t *constraints,
5130 void *structure, asn_per_outp_t *per_out) {
5131 Identifier_1_inherit_TYPE_descriptor(td);
5132 return td->uper_encoder(td, constraints, structure, per_out);
5133}
5134
Lev Walkin59b176e2005-11-26 11:25:14 +00005135
Lev Walkin725883b2006-10-09 12:07:58 +00005136/*** <<< CTDEFS [Identifier] >>> ***/
5137
Lev Walkin2fce55d2013-03-28 05:00:39 -07005138static asn_per_constraints_t asn_PER_type_Identifier_constr_1 GCC_NOTUSED = {
Lev Walkin725883b2006-10-09 12:07:58 +00005139 { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */,
5140 { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
5141 asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */
5142 asn_PER_MAP_Identifier_1_c2v /* PER code to value map */
5143};
5144
Lev Walkin59b176e2005-11-26 11:25:14 +00005145/*** <<< STAT-DEFS [Identifier] >>> ***/
5146
Lev Walkina7591b52014-10-12 18:37:35 -07005147static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
Lev Walkin59b176e2005-11-26 11:25:14 +00005148 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
5149};
Lev Walkin59b176e2005-11-26 11:25:14 +00005150asn_TYPE_descriptor_t asn_DEF_Identifier = {
5151 "Identifier",
5152 "Identifier",
5153 Identifier_free,
5154 Identifier_print,
5155 Identifier_constraint,
5156 Identifier_decode_ber,
5157 Identifier_encode_der,
5158 Identifier_decode_xer,
5159 Identifier_encode_xer,
5160 Identifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005161 Identifier_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00005162 0, /* Use generic outmost tag fetcher */
5163 asn_DEF_Identifier_tags_1,
5164 sizeof(asn_DEF_Identifier_tags_1)
5165 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
5166 asn_DEF_Identifier_tags_1, /* Same as above */
5167 sizeof(asn_DEF_Identifier_tags_1)
5168 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00005169 &asn_PER_type_Identifier_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00005170 0, 0, /* No members */
5171 0 /* No specifics */
5172};
5173