blob: 53adbebe76035f8ad391b0356661108c79275633 [file] [log] [blame]
vlm337167e2005-11-26 11:25:14 +00001
2/*** <<< INCLUDES [Int1] >>> ***/
3
4#include <INTEGER.h>
5
6/*** <<< TYPE-DECLS [Int1] >>> ***/
7
8typedef INTEGER_t Int1_t;
9
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;
vlmb1b193e2006-08-18 01:46:46 +000021per_type_encoder_f Int1_encode_uper;
vlm337167e2005-11-26 11:25:14 +000022
23/*** <<< CODE [Int1] >>> ***/
24
25int
26Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +000027 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +000028 /* Replace with underlying type checker */
29 td->check_constraints = asn_DEF_INTEGER.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +000030 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm337167e2005-11-26 11:25:14 +000031}
32
33/*
34 * This type is implemented using INTEGER,
35 * so here we adjust the DEF accordingly.
36 */
37static void
38Int1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
39 td->free_struct = asn_DEF_INTEGER.free_struct;
40 td->print_struct = asn_DEF_INTEGER.print_struct;
41 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
42 td->der_encoder = asn_DEF_INTEGER.der_encoder;
43 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
44 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
45 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +000046 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
vlm337167e2005-11-26 11:25:14 +000047 if(!td->per_constraints)
48 td->per_constraints = asn_DEF_INTEGER.per_constraints;
49 td->elements = asn_DEF_INTEGER.elements;
50 td->elements_count = asn_DEF_INTEGER.elements_count;
51 td->specifics = asn_DEF_INTEGER.specifics;
52}
53
54void
55Int1_free(asn_TYPE_descriptor_t *td,
56 void *struct_ptr, int contents_only) {
57 Int1_1_inherit_TYPE_descriptor(td);
58 td->free_struct(td, struct_ptr, contents_only);
59}
60
61int
62Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
63 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
64 Int1_1_inherit_TYPE_descriptor(td);
65 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
66}
67
68asn_dec_rval_t
69Int1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
70 void **structure, const void *bufptr, size_t size, int tag_mode) {
71 Int1_1_inherit_TYPE_descriptor(td);
72 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
73}
74
75asn_enc_rval_t
76Int1_encode_der(asn_TYPE_descriptor_t *td,
77 void *structure, int tag_mode, ber_tlv_tag_t tag,
78 asn_app_consume_bytes_f *cb, void *app_key) {
79 Int1_1_inherit_TYPE_descriptor(td);
80 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
81}
82
83asn_dec_rval_t
84Int1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
85 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
86 Int1_1_inherit_TYPE_descriptor(td);
87 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
88}
89
90asn_enc_rval_t
91Int1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
92 int ilevel, enum xer_encoder_flags_e flags,
93 asn_app_consume_bytes_f *cb, void *app_key) {
94 Int1_1_inherit_TYPE_descriptor(td);
95 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
96}
97
98asn_dec_rval_t
99Int1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
100 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
101 Int1_1_inherit_TYPE_descriptor(td);
102 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
103}
104
vlmb1b193e2006-08-18 01:46:46 +0000105asn_enc_rval_t
106Int1_encode_uper(asn_TYPE_descriptor_t *td,
107 asn_per_constraints_t *constraints,
108 void *structure, asn_per_outp_t *per_out) {
109 Int1_1_inherit_TYPE_descriptor(td);
110 return td->uper_encoder(td, constraints, structure, per_out);
111}
112
vlm337167e2005-11-26 11:25:14 +0000113
114/*** <<< STAT-DEFS [Int1] >>> ***/
115
116static ber_tlv_tag_t asn_DEF_Int1_tags_1[] = {
117 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
118};
119asn_TYPE_descriptor_t asn_DEF_Int1 = {
120 "Int1",
121 "Int1",
122 Int1_free,
123 Int1_print,
124 Int1_constraint,
125 Int1_decode_ber,
126 Int1_encode_der,
127 Int1_decode_xer,
128 Int1_encode_xer,
129 Int1_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000130 Int1_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000131 0, /* Use generic outmost tag fetcher */
132 asn_DEF_Int1_tags_1,
133 sizeof(asn_DEF_Int1_tags_1)
134 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
135 asn_DEF_Int1_tags_1, /* Same as above */
136 sizeof(asn_DEF_Int1_tags_1)
137 /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */
138 0, /* No PER visible constraints */
139 0, 0, /* No members */
140 0 /* No specifics */
141};
142
143
144/*** <<< INCLUDES [Int2] >>> ***/
145
146#include <Int1.h>
147
148/*** <<< TYPE-DECLS [Int2] >>> ***/
149
150typedef Int1_t Int2_t;
151
152/*** <<< FUNC-DECLS [Int2] >>> ***/
153
154extern asn_TYPE_descriptor_t asn_DEF_Int2;
155asn_struct_free_f Int2_free;
156asn_struct_print_f Int2_print;
157asn_constr_check_f Int2_constraint;
158ber_type_decoder_f Int2_decode_ber;
159der_type_encoder_f Int2_encode_der;
160xer_type_decoder_f Int2_decode_xer;
161xer_type_encoder_f Int2_encode_xer;
162per_type_decoder_f Int2_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +0000163per_type_encoder_f Int2_encode_uper;
vlm337167e2005-11-26 11:25:14 +0000164
165/*** <<< CODE [Int2] >>> ***/
166
167int
168Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000169 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +0000170 const Int1_t *st = (const Int1_t *)sptr;
171 long value;
172
173 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +0000174 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000175 "%s: value not given (%s:%d)",
176 td->name, __FILE__, __LINE__);
177 return -1;
178 }
179
180 /* Check if the sign bit is present */
181 value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
182
183 if((value >= 0)) {
184 /* Constraint check succeeded */
185 return 0;
186 } else {
vlmd4ae41c2006-07-13 13:28:32 +0000187 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000188 "%s: constraint failed (%s:%d)",
189 td->name, __FILE__, __LINE__);
190 return -1;
191 }
192}
193
194/*
195 * This type is implemented using Int1,
196 * so here we adjust the DEF accordingly.
197 */
198static void
199Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
200 td->free_struct = asn_DEF_Int1.free_struct;
201 td->print_struct = asn_DEF_Int1.print_struct;
202 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;
vlmb1b193e2006-08-18 01:46:46 +0000207 td->uper_encoder = asn_DEF_Int1.uper_encoder;
vlm337167e2005-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
vlmb1b193e2006-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
vlm337167e2005-11-26 11:25:14 +0000274
275/*** <<< STAT-DEFS [Int2] >>> ***/
276
277static ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
278 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
279};
280static asn_per_constraints_t asn_PER_Int2_constr_1 = {
281 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
282 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
283};
284asn_TYPE_descriptor_t asn_DEF_Int2 = {
285 "Int2",
286 "Int2",
287 Int2_free,
288 Int2_print,
289 Int2_constraint,
290 Int2_decode_ber,
291 Int2_encode_der,
292 Int2_decode_xer,
293 Int2_encode_xer,
294 Int2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000295 Int2_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000296 0, /* Use generic outmost tag fetcher */
297 asn_DEF_Int2_tags_1,
298 sizeof(asn_DEF_Int2_tags_1)
299 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
300 asn_DEF_Int2_tags_1, /* Same as above */
301 sizeof(asn_DEF_Int2_tags_1)
302 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
303 &asn_PER_Int2_constr_1,
304 0, 0, /* No members */
305 0 /* No specifics */
306};
307
308
309/*** <<< INCLUDES [Int3] >>> ***/
310
311#include <Int2.h>
312
313/*** <<< TYPE-DECLS [Int3] >>> ***/
314
315typedef Int2_t Int3_t;
316
317/*** <<< FUNC-DECLS [Int3] >>> ***/
318
319extern asn_TYPE_descriptor_t asn_DEF_Int3;
320asn_struct_free_f Int3_free;
321asn_struct_print_f Int3_print;
322asn_constr_check_f Int3_constraint;
323ber_type_decoder_f Int3_decode_ber;
324der_type_encoder_f Int3_encode_der;
325xer_type_decoder_f Int3_decode_xer;
326xer_type_encoder_f Int3_encode_xer;
327per_type_decoder_f Int3_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +0000328per_type_encoder_f Int3_encode_uper;
vlm337167e2005-11-26 11:25:14 +0000329
330/*** <<< CODE [Int3] >>> ***/
331
332int
333Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000334 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +0000335 const Int2_t *st = (const Int2_t *)sptr;
336 long value;
337
338 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +0000339 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000340 "%s: value not given (%s:%d)",
341 td->name, __FILE__, __LINE__);
342 return -1;
343 }
344
345 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +0000346 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000347 "%s: value too large (%s:%d)",
348 td->name, __FILE__, __LINE__);
349 return -1;
350 }
351
352 if((value >= 0 && value <= 10)) {
353 /* Constraint check succeeded */
354 return 0;
355 } else {
vlmd4ae41c2006-07-13 13:28:32 +0000356 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000357 "%s: constraint failed (%s:%d)",
358 td->name, __FILE__, __LINE__);
359 return -1;
360 }
361}
362
363/*
364 * This type is implemented using Int2,
365 * so here we adjust the DEF accordingly.
366 */
367static void
368Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
369 td->free_struct = asn_DEF_Int2.free_struct;
370 td->print_struct = asn_DEF_Int2.print_struct;
371 td->ber_decoder = asn_DEF_Int2.ber_decoder;
372 td->der_encoder = asn_DEF_Int2.der_encoder;
373 td->xer_decoder = asn_DEF_Int2.xer_decoder;
374 td->xer_encoder = asn_DEF_Int2.xer_encoder;
375 td->uper_decoder = asn_DEF_Int2.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +0000376 td->uper_encoder = asn_DEF_Int2.uper_encoder;
vlm337167e2005-11-26 11:25:14 +0000377 if(!td->per_constraints)
378 td->per_constraints = asn_DEF_Int2.per_constraints;
379 td->elements = asn_DEF_Int2.elements;
380 td->elements_count = asn_DEF_Int2.elements_count;
381 td->specifics = asn_DEF_Int2.specifics;
382}
383
384void
385Int3_free(asn_TYPE_descriptor_t *td,
386 void *struct_ptr, int contents_only) {
387 Int3_1_inherit_TYPE_descriptor(td);
388 td->free_struct(td, struct_ptr, contents_only);
389}
390
391int
392Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
393 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
394 Int3_1_inherit_TYPE_descriptor(td);
395 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
396}
397
398asn_dec_rval_t
399Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
400 void **structure, const void *bufptr, size_t size, int tag_mode) {
401 Int3_1_inherit_TYPE_descriptor(td);
402 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
403}
404
405asn_enc_rval_t
406Int3_encode_der(asn_TYPE_descriptor_t *td,
407 void *structure, int tag_mode, ber_tlv_tag_t tag,
408 asn_app_consume_bytes_f *cb, void *app_key) {
409 Int3_1_inherit_TYPE_descriptor(td);
410 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
411}
412
413asn_dec_rval_t
414Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
415 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
416 Int3_1_inherit_TYPE_descriptor(td);
417 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
418}
419
420asn_enc_rval_t
421Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
422 int ilevel, enum xer_encoder_flags_e flags,
423 asn_app_consume_bytes_f *cb, void *app_key) {
424 Int3_1_inherit_TYPE_descriptor(td);
425 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
426}
427
428asn_dec_rval_t
429Int3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
430 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
431 Int3_1_inherit_TYPE_descriptor(td);
432 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
433}
434
vlmb1b193e2006-08-18 01:46:46 +0000435asn_enc_rval_t
436Int3_encode_uper(asn_TYPE_descriptor_t *td,
437 asn_per_constraints_t *constraints,
438 void *structure, asn_per_outp_t *per_out) {
439 Int3_1_inherit_TYPE_descriptor(td);
440 return td->uper_encoder(td, constraints, structure, per_out);
441}
442
vlm337167e2005-11-26 11:25:14 +0000443
444/*** <<< STAT-DEFS [Int3] >>> ***/
445
446static ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
447 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
448};
449static asn_per_constraints_t asn_PER_Int3_constr_1 = {
450 { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
451 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
452};
453asn_TYPE_descriptor_t asn_DEF_Int3 = {
454 "Int3",
455 "Int3",
456 Int3_free,
457 Int3_print,
458 Int3_constraint,
459 Int3_decode_ber,
460 Int3_encode_der,
461 Int3_decode_xer,
462 Int3_encode_xer,
463 Int3_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000464 Int3_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000465 0, /* Use generic outmost tag fetcher */
466 asn_DEF_Int3_tags_1,
467 sizeof(asn_DEF_Int3_tags_1)
468 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
469 asn_DEF_Int3_tags_1, /* Same as above */
470 sizeof(asn_DEF_Int3_tags_1)
471 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
472 &asn_PER_Int3_constr_1,
473 0, 0, /* No members */
474 0 /* No specifics */
475};
476
477
478/*** <<< INCLUDES [Int4] >>> ***/
479
480#include <Int3.h>
481
482/*** <<< TYPE-DECLS [Int4] >>> ***/
483
484typedef Int3_t Int4_t;
485
486/*** <<< FUNC-DECLS [Int4] >>> ***/
487
488extern asn_TYPE_descriptor_t asn_DEF_Int4;
489asn_struct_free_f Int4_free;
490asn_struct_print_f Int4_print;
491asn_constr_check_f Int4_constraint;
492ber_type_decoder_f Int4_decode_ber;
493der_type_encoder_f Int4_encode_der;
494xer_type_decoder_f Int4_decode_xer;
495xer_type_encoder_f Int4_encode_xer;
496per_type_decoder_f Int4_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +0000497per_type_encoder_f Int4_encode_uper;
vlm337167e2005-11-26 11:25:14 +0000498
499/*** <<< CODE [Int4] >>> ***/
500
501int
502Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000503 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +0000504 const Int3_t *st = (const Int3_t *)sptr;
505 long value;
506
507 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +0000508 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000509 "%s: value not given (%s:%d)",
510 td->name, __FILE__, __LINE__);
511 return -1;
512 }
513
514 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +0000515 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000516 "%s: value too large (%s:%d)",
517 td->name, __FILE__, __LINE__);
518 return -1;
519 }
520
521 if((value >= 1 && value <= 10)) {
522 /* Constraint check succeeded */
523 return 0;
524 } else {
vlmd4ae41c2006-07-13 13:28:32 +0000525 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000526 "%s: constraint failed (%s:%d)",
527 td->name, __FILE__, __LINE__);
528 return -1;
529 }
530}
531
532/*
533 * This type is implemented using Int3,
534 * so here we adjust the DEF accordingly.
535 */
536static void
537Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
538 td->free_struct = asn_DEF_Int3.free_struct;
539 td->print_struct = asn_DEF_Int3.print_struct;
540 td->ber_decoder = asn_DEF_Int3.ber_decoder;
541 td->der_encoder = asn_DEF_Int3.der_encoder;
542 td->xer_decoder = asn_DEF_Int3.xer_decoder;
543 td->xer_encoder = asn_DEF_Int3.xer_encoder;
544 td->uper_decoder = asn_DEF_Int3.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +0000545 td->uper_encoder = asn_DEF_Int3.uper_encoder;
vlm337167e2005-11-26 11:25:14 +0000546 if(!td->per_constraints)
547 td->per_constraints = asn_DEF_Int3.per_constraints;
548 td->elements = asn_DEF_Int3.elements;
549 td->elements_count = asn_DEF_Int3.elements_count;
550 td->specifics = asn_DEF_Int3.specifics;
551}
552
553void
554Int4_free(asn_TYPE_descriptor_t *td,
555 void *struct_ptr, int contents_only) {
556 Int4_1_inherit_TYPE_descriptor(td);
557 td->free_struct(td, struct_ptr, contents_only);
558}
559
560int
561Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
562 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
563 Int4_1_inherit_TYPE_descriptor(td);
564 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
565}
566
567asn_dec_rval_t
568Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
569 void **structure, const void *bufptr, size_t size, int tag_mode) {
570 Int4_1_inherit_TYPE_descriptor(td);
571 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
572}
573
574asn_enc_rval_t
575Int4_encode_der(asn_TYPE_descriptor_t *td,
576 void *structure, int tag_mode, ber_tlv_tag_t tag,
577 asn_app_consume_bytes_f *cb, void *app_key) {
578 Int4_1_inherit_TYPE_descriptor(td);
579 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
580}
581
582asn_dec_rval_t
583Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
584 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
585 Int4_1_inherit_TYPE_descriptor(td);
586 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
587}
588
589asn_enc_rval_t
590Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
591 int ilevel, enum xer_encoder_flags_e flags,
592 asn_app_consume_bytes_f *cb, void *app_key) {
593 Int4_1_inherit_TYPE_descriptor(td);
594 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
595}
596
597asn_dec_rval_t
598Int4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
599 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
600 Int4_1_inherit_TYPE_descriptor(td);
601 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
602}
603
vlmb1b193e2006-08-18 01:46:46 +0000604asn_enc_rval_t
605Int4_encode_uper(asn_TYPE_descriptor_t *td,
606 asn_per_constraints_t *constraints,
607 void *structure, asn_per_outp_t *per_out) {
608 Int4_1_inherit_TYPE_descriptor(td);
609 return td->uper_encoder(td, constraints, structure, per_out);
610}
611
vlm337167e2005-11-26 11:25:14 +0000612
613/*** <<< STAT-DEFS [Int4] >>> ***/
614
615static ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
616 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
617};
618static asn_per_constraints_t asn_PER_Int4_constr_1 = {
619 { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
620 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
621};
622asn_TYPE_descriptor_t asn_DEF_Int4 = {
623 "Int4",
624 "Int4",
625 Int4_free,
626 Int4_print,
627 Int4_constraint,
628 Int4_decode_ber,
629 Int4_encode_der,
630 Int4_decode_xer,
631 Int4_encode_xer,
632 Int4_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000633 Int4_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000634 0, /* Use generic outmost tag fetcher */
635 asn_DEF_Int4_tags_1,
636 sizeof(asn_DEF_Int4_tags_1)
637 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
638 asn_DEF_Int4_tags_1, /* Same as above */
639 sizeof(asn_DEF_Int4_tags_1)
640 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
641 &asn_PER_Int4_constr_1,
642 0, 0, /* No members */
643 0 /* No specifics */
644};
645
646
647/*** <<< INCLUDES [Int5] >>> ***/
648
649#include <Int4.h>
650
651/*** <<< TYPE-DECLS [Int5] >>> ***/
652
653typedef Int4_t Int5_t;
654
655/*** <<< FUNC-DECLS [Int5] >>> ***/
656
657extern asn_TYPE_descriptor_t asn_DEF_Int5;
658asn_struct_free_f Int5_free;
659asn_struct_print_f Int5_print;
660asn_constr_check_f Int5_constraint;
661ber_type_decoder_f Int5_decode_ber;
662der_type_encoder_f Int5_encode_der;
663xer_type_decoder_f Int5_decode_xer;
664xer_type_encoder_f Int5_encode_xer;
665per_type_decoder_f Int5_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +0000666per_type_encoder_f Int5_encode_uper;
vlm337167e2005-11-26 11:25:14 +0000667
668/*** <<< CODE [Int5] >>> ***/
669
670int
671Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000672 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +0000673 const Int4_t *st = (const Int4_t *)sptr;
674 long value;
675
676 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +0000677 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000678 "%s: value not given (%s:%d)",
679 td->name, __FILE__, __LINE__);
680 return -1;
681 }
682
683 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +0000684 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000685 "%s: value too large (%s:%d)",
686 td->name, __FILE__, __LINE__);
687 return -1;
688 }
689
690 if((value == 5)) {
691 /* Constraint check succeeded */
692 return 0;
693 } else {
vlmd4ae41c2006-07-13 13:28:32 +0000694 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000695 "%s: constraint failed (%s:%d)",
696 td->name, __FILE__, __LINE__);
697 return -1;
698 }
699}
700
701/*
702 * This type is implemented using Int4,
703 * so here we adjust the DEF accordingly.
704 */
705static void
706Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
707 td->free_struct = asn_DEF_Int4.free_struct;
708 td->print_struct = asn_DEF_Int4.print_struct;
709 td->ber_decoder = asn_DEF_Int4.ber_decoder;
710 td->der_encoder = asn_DEF_Int4.der_encoder;
711 td->xer_decoder = asn_DEF_Int4.xer_decoder;
712 td->xer_encoder = asn_DEF_Int4.xer_encoder;
713 td->uper_decoder = asn_DEF_Int4.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +0000714 td->uper_encoder = asn_DEF_Int4.uper_encoder;
vlm337167e2005-11-26 11:25:14 +0000715 if(!td->per_constraints)
716 td->per_constraints = asn_DEF_Int4.per_constraints;
717 td->elements = asn_DEF_Int4.elements;
718 td->elements_count = asn_DEF_Int4.elements_count;
719 td->specifics = asn_DEF_Int4.specifics;
720}
721
722void
723Int5_free(asn_TYPE_descriptor_t *td,
724 void *struct_ptr, int contents_only) {
725 Int5_1_inherit_TYPE_descriptor(td);
726 td->free_struct(td, struct_ptr, contents_only);
727}
728
729int
730Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
731 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
732 Int5_1_inherit_TYPE_descriptor(td);
733 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
734}
735
736asn_dec_rval_t
737Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
738 void **structure, const void *bufptr, size_t size, int tag_mode) {
739 Int5_1_inherit_TYPE_descriptor(td);
740 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
741}
742
743asn_enc_rval_t
744Int5_encode_der(asn_TYPE_descriptor_t *td,
745 void *structure, int tag_mode, ber_tlv_tag_t tag,
746 asn_app_consume_bytes_f *cb, void *app_key) {
747 Int5_1_inherit_TYPE_descriptor(td);
748 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
749}
750
751asn_dec_rval_t
752Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
753 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
754 Int5_1_inherit_TYPE_descriptor(td);
755 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
756}
757
758asn_enc_rval_t
759Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
760 int ilevel, enum xer_encoder_flags_e flags,
761 asn_app_consume_bytes_f *cb, void *app_key) {
762 Int5_1_inherit_TYPE_descriptor(td);
763 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
764}
765
766asn_dec_rval_t
767Int5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
768 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
769 Int5_1_inherit_TYPE_descriptor(td);
770 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
771}
772
vlmb1b193e2006-08-18 01:46:46 +0000773asn_enc_rval_t
774Int5_encode_uper(asn_TYPE_descriptor_t *td,
775 asn_per_constraints_t *constraints,
776 void *structure, asn_per_outp_t *per_out) {
777 Int5_1_inherit_TYPE_descriptor(td);
778 return td->uper_encoder(td, constraints, structure, per_out);
779}
780
vlm337167e2005-11-26 11:25:14 +0000781
782/*** <<< STAT-DEFS [Int5] >>> ***/
783
784static ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
785 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
786};
787static asn_per_constraints_t asn_PER_Int5_constr_1 = {
788 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
789 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
790};
791asn_TYPE_descriptor_t asn_DEF_Int5 = {
792 "Int5",
793 "Int5",
794 Int5_free,
795 Int5_print,
796 Int5_constraint,
797 Int5_decode_ber,
798 Int5_encode_der,
799 Int5_decode_xer,
800 Int5_encode_xer,
801 Int5_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000802 Int5_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000803 0, /* Use generic outmost tag fetcher */
804 asn_DEF_Int5_tags_1,
805 sizeof(asn_DEF_Int5_tags_1)
806 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
807 asn_DEF_Int5_tags_1, /* Same as above */
808 sizeof(asn_DEF_Int5_tags_1)
809 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
810 &asn_PER_Int5_constr_1,
811 0, 0, /* No members */
812 0 /* No specifics */
813};
814
815
816/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
817
818#include <INTEGER.h>
819
820/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
821
822typedef INTEGER_t ExtensibleExtensions_t;
823
824/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
825
826extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
827asn_struct_free_f ExtensibleExtensions_free;
828asn_struct_print_f ExtensibleExtensions_print;
829asn_constr_check_f ExtensibleExtensions_constraint;
830ber_type_decoder_f ExtensibleExtensions_decode_ber;
831der_type_encoder_f ExtensibleExtensions_encode_der;
832xer_type_decoder_f ExtensibleExtensions_decode_xer;
833xer_type_encoder_f ExtensibleExtensions_encode_xer;
834per_type_decoder_f ExtensibleExtensions_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +0000835per_type_encoder_f ExtensibleExtensions_encode_uper;
vlm337167e2005-11-26 11:25:14 +0000836
837/*** <<< CODE [ExtensibleExtensions] >>> ***/
838
839int
840ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000841 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +0000842 const INTEGER_t *st = (const INTEGER_t *)sptr;
843 long value;
844
845 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +0000846 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000847 "%s: value not given (%s:%d)",
848 td->name, __FILE__, __LINE__);
849 return -1;
850 }
851
852 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +0000853 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000854 "%s: value too large (%s:%d)",
855 td->name, __FILE__, __LINE__);
856 return -1;
857 }
858
859 if((value >= 1 && value <= 256)) {
860 /* Constraint check succeeded */
861 return 0;
862 } else {
vlmd4ae41c2006-07-13 13:28:32 +0000863 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000864 "%s: constraint failed (%s:%d)",
865 td->name, __FILE__, __LINE__);
866 return -1;
867 }
868}
869
870/*
871 * This type is implemented using INTEGER,
872 * so here we adjust the DEF accordingly.
873 */
874static void
875ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
876 td->free_struct = asn_DEF_INTEGER.free_struct;
877 td->print_struct = asn_DEF_INTEGER.print_struct;
878 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
879 td->der_encoder = asn_DEF_INTEGER.der_encoder;
880 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
881 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
882 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +0000883 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
vlm337167e2005-11-26 11:25:14 +0000884 if(!td->per_constraints)
885 td->per_constraints = asn_DEF_INTEGER.per_constraints;
886 td->elements = asn_DEF_INTEGER.elements;
887 td->elements_count = asn_DEF_INTEGER.elements_count;
888 td->specifics = asn_DEF_INTEGER.specifics;
889}
890
891void
892ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
893 void *struct_ptr, int contents_only) {
894 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
895 td->free_struct(td, struct_ptr, contents_only);
896}
897
898int
899ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
900 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
901 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
902 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
903}
904
905asn_dec_rval_t
906ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
907 void **structure, const void *bufptr, size_t size, int tag_mode) {
908 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
909 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
910}
911
912asn_enc_rval_t
913ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
914 void *structure, int tag_mode, ber_tlv_tag_t tag,
915 asn_app_consume_bytes_f *cb, void *app_key) {
916 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
917 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
918}
919
920asn_dec_rval_t
921ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
922 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
923 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
924 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
925}
926
927asn_enc_rval_t
928ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
929 int ilevel, enum xer_encoder_flags_e flags,
930 asn_app_consume_bytes_f *cb, void *app_key) {
931 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
932 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
933}
934
935asn_dec_rval_t
936ExtensibleExtensions_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
937 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
938 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
939 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
940}
941
vlmb1b193e2006-08-18 01:46:46 +0000942asn_enc_rval_t
943ExtensibleExtensions_encode_uper(asn_TYPE_descriptor_t *td,
944 asn_per_constraints_t *constraints,
945 void *structure, asn_per_outp_t *per_out) {
946 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
947 return td->uper_encoder(td, constraints, structure, per_out);
948}
949
vlm337167e2005-11-26 11:25:14 +0000950
951/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
952
953static ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
954 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
955};
956static asn_per_constraints_t asn_PER_ExtensibleExtensions_constr_1 = {
957 { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
958 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
959};
960asn_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,
vlmb1b193e2006-08-18 01:46:46 +0000971 ExtensibleExtensions_encode_uper,
vlm337167e2005-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 */
979 &asn_PER_ExtensibleExtensions_constr_1,
980 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;
vlmb1b193e2006-08-18 01:46:46 +00001004per_type_encoder_f Str1_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001005
1006/*** <<< CODE [Str1] >>> ***/
1007
1008int
1009Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001010 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001011 /* Replace with underlying type checker */
1012 td->check_constraints = asn_DEF_IA5String.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +00001013 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm337167e2005-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;
1024 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1025 td->der_encoder = asn_DEF_IA5String.der_encoder;
1026 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1027 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1028 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001029 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001030 if(!td->per_constraints)
1031 td->per_constraints = asn_DEF_IA5String.per_constraints;
1032 td->elements = asn_DEF_IA5String.elements;
1033 td->elements_count = asn_DEF_IA5String.elements_count;
1034 td->specifics = asn_DEF_IA5String.specifics;
1035}
1036
1037void
1038Str1_free(asn_TYPE_descriptor_t *td,
1039 void *struct_ptr, int contents_only) {
1040 Str1_1_inherit_TYPE_descriptor(td);
1041 td->free_struct(td, struct_ptr, contents_only);
1042}
1043
1044int
1045Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1046 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1047 Str1_1_inherit_TYPE_descriptor(td);
1048 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1049}
1050
1051asn_dec_rval_t
1052Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1053 void **structure, const void *bufptr, size_t size, int tag_mode) {
1054 Str1_1_inherit_TYPE_descriptor(td);
1055 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1056}
1057
1058asn_enc_rval_t
1059Str1_encode_der(asn_TYPE_descriptor_t *td,
1060 void *structure, int tag_mode, ber_tlv_tag_t tag,
1061 asn_app_consume_bytes_f *cb, void *app_key) {
1062 Str1_1_inherit_TYPE_descriptor(td);
1063 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1064}
1065
1066asn_dec_rval_t
1067Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1068 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1069 Str1_1_inherit_TYPE_descriptor(td);
1070 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1071}
1072
1073asn_enc_rval_t
1074Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1075 int ilevel, enum xer_encoder_flags_e flags,
1076 asn_app_consume_bytes_f *cb, void *app_key) {
1077 Str1_1_inherit_TYPE_descriptor(td);
1078 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1079}
1080
1081asn_dec_rval_t
1082Str1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1083 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1084 Str1_1_inherit_TYPE_descriptor(td);
1085 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1086}
1087
vlmb1b193e2006-08-18 01:46:46 +00001088asn_enc_rval_t
1089Str1_encode_uper(asn_TYPE_descriptor_t *td,
1090 asn_per_constraints_t *constraints,
1091 void *structure, asn_per_outp_t *per_out) {
1092 Str1_1_inherit_TYPE_descriptor(td);
1093 return td->uper_encoder(td, constraints, structure, per_out);
1094}
1095
vlm337167e2005-11-26 11:25:14 +00001096
1097/*** <<< STAT-DEFS [Str1] >>> ***/
1098
1099static ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
1100 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1101};
1102asn_TYPE_descriptor_t asn_DEF_Str1 = {
1103 "Str1",
1104 "Str1",
1105 Str1_free,
1106 Str1_print,
1107 Str1_constraint,
1108 Str1_decode_ber,
1109 Str1_encode_der,
1110 Str1_decode_xer,
1111 Str1_encode_xer,
1112 Str1_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001113 Str1_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001114 0, /* Use generic outmost tag fetcher */
1115 asn_DEF_Str1_tags_1,
1116 sizeof(asn_DEF_Str1_tags_1)
1117 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1118 asn_DEF_Str1_tags_1, /* Same as above */
1119 sizeof(asn_DEF_Str1_tags_1)
1120 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1121 0, /* No PER visible constraints */
1122 0, 0, /* No members */
1123 0 /* No specifics */
1124};
1125
1126
1127/*** <<< INCLUDES [Str2] >>> ***/
1128
1129#include <Str1.h>
1130
1131/*** <<< TYPE-DECLS [Str2] >>> ***/
1132
1133typedef Str1_t Str2_t;
1134
1135/*** <<< FUNC-DECLS [Str2] >>> ***/
1136
1137extern asn_TYPE_descriptor_t asn_DEF_Str2;
1138asn_struct_free_f Str2_free;
1139asn_struct_print_f Str2_print;
1140asn_constr_check_f Str2_constraint;
1141ber_type_decoder_f Str2_decode_ber;
1142der_type_encoder_f Str2_encode_der;
1143xer_type_decoder_f Str2_decode_xer;
1144xer_type_encoder_f Str2_encode_xer;
1145per_type_decoder_f Str2_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001146per_type_encoder_f Str2_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001147
1148/*** <<< CTABLES [Str2] >>> ***/
1149
1150static int check_permitted_alphabet_1(const void *sptr) {
1151 /* The underlying type is IA5String */
1152 const IA5String_t *st = (const IA5String_t *)sptr;
1153 const uint8_t *ch = st->buf;
1154 const uint8_t *end = ch + st->size;
1155
1156 for(; ch < end; ch++) {
1157 uint8_t cv = *ch;
1158 if(!(cv <= 127)) return -1;
1159 }
1160 return 0;
1161}
1162
1163
1164/*** <<< CODE [Str2] >>> ***/
1165
1166int
1167Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001168 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001169 const Str1_t *st = (const Str1_t *)sptr;
1170 size_t size;
1171
1172 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001173 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001174 "%s: value not given (%s:%d)",
1175 td->name, __FILE__, __LINE__);
1176 return -1;
1177 }
1178
1179 size = st->size;
1180
1181 if(((size <= 20) || (size >= 25 && size <= 30))
1182 && !check_permitted_alphabet_1(st)) {
1183 /* Constraint check succeeded */
1184 return 0;
1185 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001186 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001187 "%s: constraint failed (%s:%d)",
1188 td->name, __FILE__, __LINE__);
1189 return -1;
1190 }
1191}
1192
1193/*
1194 * This type is implemented using Str1,
1195 * so here we adjust the DEF accordingly.
1196 */
1197static void
1198Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1199 td->free_struct = asn_DEF_Str1.free_struct;
1200 td->print_struct = asn_DEF_Str1.print_struct;
1201 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1202 td->der_encoder = asn_DEF_Str1.der_encoder;
1203 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1204 td->xer_encoder = asn_DEF_Str1.xer_encoder;
1205 td->uper_decoder = asn_DEF_Str1.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001206 td->uper_encoder = asn_DEF_Str1.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001207 if(!td->per_constraints)
1208 td->per_constraints = asn_DEF_Str1.per_constraints;
1209 td->elements = asn_DEF_Str1.elements;
1210 td->elements_count = asn_DEF_Str1.elements_count;
1211 td->specifics = asn_DEF_Str1.specifics;
1212}
1213
1214void
1215Str2_free(asn_TYPE_descriptor_t *td,
1216 void *struct_ptr, int contents_only) {
1217 Str2_1_inherit_TYPE_descriptor(td);
1218 td->free_struct(td, struct_ptr, contents_only);
1219}
1220
1221int
1222Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1223 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1224 Str2_1_inherit_TYPE_descriptor(td);
1225 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1226}
1227
1228asn_dec_rval_t
1229Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1230 void **structure, const void *bufptr, size_t size, int tag_mode) {
1231 Str2_1_inherit_TYPE_descriptor(td);
1232 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1233}
1234
1235asn_enc_rval_t
1236Str2_encode_der(asn_TYPE_descriptor_t *td,
1237 void *structure, int tag_mode, ber_tlv_tag_t tag,
1238 asn_app_consume_bytes_f *cb, void *app_key) {
1239 Str2_1_inherit_TYPE_descriptor(td);
1240 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1241}
1242
1243asn_dec_rval_t
1244Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1245 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1246 Str2_1_inherit_TYPE_descriptor(td);
1247 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1248}
1249
1250asn_enc_rval_t
1251Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1252 int ilevel, enum xer_encoder_flags_e flags,
1253 asn_app_consume_bytes_f *cb, void *app_key) {
1254 Str2_1_inherit_TYPE_descriptor(td);
1255 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1256}
1257
1258asn_dec_rval_t
1259Str2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1260 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1261 Str2_1_inherit_TYPE_descriptor(td);
1262 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1263}
1264
vlmb1b193e2006-08-18 01:46:46 +00001265asn_enc_rval_t
1266Str2_encode_uper(asn_TYPE_descriptor_t *td,
1267 asn_per_constraints_t *constraints,
1268 void *structure, asn_per_outp_t *per_out) {
1269 Str2_1_inherit_TYPE_descriptor(td);
1270 return td->uper_encoder(td, constraints, structure, per_out);
1271}
1272
vlm337167e2005-11-26 11:25:14 +00001273
1274/*** <<< STAT-DEFS [Str2] >>> ***/
1275
1276static ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
1277 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1278};
1279static asn_per_constraints_t asn_PER_Str2_constr_1 = {
1280 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1281 { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */
1282};
1283asn_TYPE_descriptor_t asn_DEF_Str2 = {
1284 "Str2",
1285 "Str2",
1286 Str2_free,
1287 Str2_print,
1288 Str2_constraint,
1289 Str2_decode_ber,
1290 Str2_encode_der,
1291 Str2_decode_xer,
1292 Str2_encode_xer,
1293 Str2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001294 Str2_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001295 0, /* Use generic outmost tag fetcher */
1296 asn_DEF_Str2_tags_1,
1297 sizeof(asn_DEF_Str2_tags_1)
1298 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1299 asn_DEF_Str2_tags_1, /* Same as above */
1300 sizeof(asn_DEF_Str2_tags_1)
1301 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1302 &asn_PER_Str2_constr_1,
1303 0, 0, /* No members */
1304 0 /* No specifics */
1305};
1306
1307
1308/*** <<< INCLUDES [Str3] >>> ***/
1309
1310#include <Str2.h>
1311
1312/*** <<< TYPE-DECLS [Str3] >>> ***/
1313
1314typedef Str2_t Str3_t;
1315
1316/*** <<< FUNC-DECLS [Str3] >>> ***/
1317
1318extern asn_TYPE_descriptor_t asn_DEF_Str3;
1319asn_struct_free_f Str3_free;
1320asn_struct_print_f Str3_print;
1321asn_constr_check_f Str3_constraint;
1322ber_type_decoder_f Str3_decode_ber;
1323der_type_encoder_f Str3_encode_der;
1324xer_type_decoder_f Str3_decode_xer;
1325xer_type_encoder_f Str3_encode_xer;
1326per_type_decoder_f Str3_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001327per_type_encoder_f Str3_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001328
1329/*** <<< CTABLES [Str3] >>> ***/
1330
1331static int permitted_alphabet_table_1[256] = {
13320,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
13330,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
13340,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
13350,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
13360,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, /* ABC */
13370,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
13380,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, /* def */
1339};
1340
1341static int check_permitted_alphabet_1(const void *sptr) {
1342 int *table = permitted_alphabet_table_1;
1343 /* The underlying type is IA5String */
1344 const IA5String_t *st = (const IA5String_t *)sptr;
1345 const uint8_t *ch = st->buf;
1346 const uint8_t *end = ch + st->size;
1347
1348 for(; ch < end; ch++) {
1349 uint8_t cv = *ch;
1350 if(!table[cv]) return -1;
1351 }
1352 return 0;
1353}
1354
1355
1356/*** <<< CODE [Str3] >>> ***/
1357
1358int
1359Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001360 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001361 const Str2_t *st = (const Str2_t *)sptr;
1362 size_t size;
1363
1364 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001365 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001366 "%s: value not given (%s:%d)",
1367 td->name, __FILE__, __LINE__);
1368 return -1;
1369 }
1370
1371 size = st->size;
1372
1373 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
1374 && !check_permitted_alphabet_1(st)) {
1375 /* Constraint check succeeded */
1376 return 0;
1377 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001378 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001379 "%s: constraint failed (%s:%d)",
1380 td->name, __FILE__, __LINE__);
1381 return -1;
1382 }
1383}
1384
1385/*
1386 * This type is implemented using Str2,
1387 * so here we adjust the DEF accordingly.
1388 */
1389static void
1390Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1391 td->free_struct = asn_DEF_Str2.free_struct;
1392 td->print_struct = asn_DEF_Str2.print_struct;
1393 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1394 td->der_encoder = asn_DEF_Str2.der_encoder;
1395 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1396 td->xer_encoder = asn_DEF_Str2.xer_encoder;
1397 td->uper_decoder = asn_DEF_Str2.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001398 td->uper_encoder = asn_DEF_Str2.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001399 if(!td->per_constraints)
1400 td->per_constraints = asn_DEF_Str2.per_constraints;
1401 td->elements = asn_DEF_Str2.elements;
1402 td->elements_count = asn_DEF_Str2.elements_count;
1403 td->specifics = asn_DEF_Str2.specifics;
1404}
1405
1406void
1407Str3_free(asn_TYPE_descriptor_t *td,
1408 void *struct_ptr, int contents_only) {
1409 Str3_1_inherit_TYPE_descriptor(td);
1410 td->free_struct(td, struct_ptr, contents_only);
1411}
1412
1413int
1414Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1415 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1416 Str3_1_inherit_TYPE_descriptor(td);
1417 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1418}
1419
1420asn_dec_rval_t
1421Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1422 void **structure, const void *bufptr, size_t size, int tag_mode) {
1423 Str3_1_inherit_TYPE_descriptor(td);
1424 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1425}
1426
1427asn_enc_rval_t
1428Str3_encode_der(asn_TYPE_descriptor_t *td,
1429 void *structure, int tag_mode, ber_tlv_tag_t tag,
1430 asn_app_consume_bytes_f *cb, void *app_key) {
1431 Str3_1_inherit_TYPE_descriptor(td);
1432 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1433}
1434
1435asn_dec_rval_t
1436Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1437 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1438 Str3_1_inherit_TYPE_descriptor(td);
1439 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1440}
1441
1442asn_enc_rval_t
1443Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1444 int ilevel, enum xer_encoder_flags_e flags,
1445 asn_app_consume_bytes_f *cb, void *app_key) {
1446 Str3_1_inherit_TYPE_descriptor(td);
1447 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1448}
1449
1450asn_dec_rval_t
1451Str3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1452 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1453 Str3_1_inherit_TYPE_descriptor(td);
1454 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1455}
1456
vlmb1b193e2006-08-18 01:46:46 +00001457asn_enc_rval_t
1458Str3_encode_uper(asn_TYPE_descriptor_t *td,
1459 asn_per_constraints_t *constraints,
1460 void *structure, asn_per_outp_t *per_out) {
1461 Str3_1_inherit_TYPE_descriptor(td);
1462 return td->uper_encoder(td, constraints, structure, per_out);
1463}
1464
vlm337167e2005-11-26 11:25:14 +00001465
1466/*** <<< STAT-DEFS [Str3] >>> ***/
1467
1468static ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
1469 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1470};
1471static asn_per_constraints_t asn_PER_Str3_constr_1 = {
1472 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1473 { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */
1474};
1475asn_TYPE_descriptor_t asn_DEF_Str3 = {
1476 "Str3",
1477 "Str3",
1478 Str3_free,
1479 Str3_print,
1480 Str3_constraint,
1481 Str3_decode_ber,
1482 Str3_encode_der,
1483 Str3_decode_xer,
1484 Str3_encode_xer,
1485 Str3_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001486 Str3_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001487 0, /* Use generic outmost tag fetcher */
1488 asn_DEF_Str3_tags_1,
1489 sizeof(asn_DEF_Str3_tags_1)
1490 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1491 asn_DEF_Str3_tags_1, /* Same as above */
1492 sizeof(asn_DEF_Str3_tags_1)
1493 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1494 &asn_PER_Str3_constr_1,
1495 0, 0, /* No members */
1496 0 /* No specifics */
1497};
1498
1499
1500/*** <<< INCLUDES [Str4] >>> ***/
1501
1502#include <IA5String.h>
1503
1504/*** <<< TYPE-DECLS [Str4] >>> ***/
1505
1506typedef IA5String_t Str4_t;
1507
1508/*** <<< FUNC-DECLS [Str4] >>> ***/
1509
1510extern asn_TYPE_descriptor_t asn_DEF_Str4;
1511asn_struct_free_f Str4_free;
1512asn_struct_print_f Str4_print;
1513asn_constr_check_f Str4_constraint;
1514ber_type_decoder_f Str4_decode_ber;
1515der_type_encoder_f Str4_encode_der;
1516xer_type_decoder_f Str4_decode_xer;
1517xer_type_encoder_f Str4_encode_xer;
1518per_type_decoder_f Str4_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001519per_type_encoder_f Str4_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001520
1521/*** <<< CTABLES [Str4] >>> ***/
1522
1523static int check_permitted_alphabet_1(const void *sptr) {
1524 /* The underlying type is IA5String */
1525 const IA5String_t *st = (const IA5String_t *)sptr;
1526 const uint8_t *ch = st->buf;
1527 const uint8_t *end = ch + st->size;
1528
1529 for(; ch < end; ch++) {
1530 uint8_t cv = *ch;
1531 if(!(cv <= 127)) return -1;
1532 }
1533 return 0;
1534}
1535
1536
1537/*** <<< CODE [Str4] >>> ***/
1538
1539int
1540Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001541 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001542 const IA5String_t *st = (const IA5String_t *)sptr;
1543
1544 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001545 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001546 "%s: value not given (%s:%d)",
1547 td->name, __FILE__, __LINE__);
1548 return -1;
1549 }
1550
1551
1552 if(!check_permitted_alphabet_1(st)) {
1553 /* Constraint check succeeded */
1554 return 0;
1555 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001556 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001557 "%s: constraint failed (%s:%d)",
1558 td->name, __FILE__, __LINE__);
1559 return -1;
1560 }
1561}
1562
1563/*
1564 * This type is implemented using IA5String,
1565 * so here we adjust the DEF accordingly.
1566 */
1567static void
1568Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1569 td->free_struct = asn_DEF_IA5String.free_struct;
1570 td->print_struct = asn_DEF_IA5String.print_struct;
1571 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1572 td->der_encoder = asn_DEF_IA5String.der_encoder;
1573 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1574 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1575 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001576 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001577 if(!td->per_constraints)
1578 td->per_constraints = asn_DEF_IA5String.per_constraints;
1579 td->elements = asn_DEF_IA5String.elements;
1580 td->elements_count = asn_DEF_IA5String.elements_count;
1581 td->specifics = asn_DEF_IA5String.specifics;
1582}
1583
1584void
1585Str4_free(asn_TYPE_descriptor_t *td,
1586 void *struct_ptr, int contents_only) {
1587 Str4_1_inherit_TYPE_descriptor(td);
1588 td->free_struct(td, struct_ptr, contents_only);
1589}
1590
1591int
1592Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1593 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1594 Str4_1_inherit_TYPE_descriptor(td);
1595 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1596}
1597
1598asn_dec_rval_t
1599Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1600 void **structure, const void *bufptr, size_t size, int tag_mode) {
1601 Str4_1_inherit_TYPE_descriptor(td);
1602 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1603}
1604
1605asn_enc_rval_t
1606Str4_encode_der(asn_TYPE_descriptor_t *td,
1607 void *structure, int tag_mode, ber_tlv_tag_t tag,
1608 asn_app_consume_bytes_f *cb, void *app_key) {
1609 Str4_1_inherit_TYPE_descriptor(td);
1610 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1611}
1612
1613asn_dec_rval_t
1614Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1615 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1616 Str4_1_inherit_TYPE_descriptor(td);
1617 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1618}
1619
1620asn_enc_rval_t
1621Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1622 int ilevel, enum xer_encoder_flags_e flags,
1623 asn_app_consume_bytes_f *cb, void *app_key) {
1624 Str4_1_inherit_TYPE_descriptor(td);
1625 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1626}
1627
1628asn_dec_rval_t
1629Str4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1630 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1631 Str4_1_inherit_TYPE_descriptor(td);
1632 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1633}
1634
vlmb1b193e2006-08-18 01:46:46 +00001635asn_enc_rval_t
1636Str4_encode_uper(asn_TYPE_descriptor_t *td,
1637 asn_per_constraints_t *constraints,
1638 void *structure, asn_per_outp_t *per_out) {
1639 Str4_1_inherit_TYPE_descriptor(td);
1640 return td->uper_encoder(td, constraints, structure, per_out);
1641}
1642
vlm337167e2005-11-26 11:25:14 +00001643
1644/*** <<< STAT-DEFS [Str4] >>> ***/
1645
1646static ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
1647 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1648};
1649static asn_per_constraints_t asn_PER_Str4_constr_1 = {
1650 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1651 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
1652};
1653asn_TYPE_descriptor_t asn_DEF_Str4 = {
1654 "Str4",
1655 "Str4",
1656 Str4_free,
1657 Str4_print,
1658 Str4_constraint,
1659 Str4_decode_ber,
1660 Str4_encode_der,
1661 Str4_decode_xer,
1662 Str4_encode_xer,
1663 Str4_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001664 Str4_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001665 0, /* Use generic outmost tag fetcher */
1666 asn_DEF_Str4_tags_1,
1667 sizeof(asn_DEF_Str4_tags_1)
1668 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1669 asn_DEF_Str4_tags_1, /* Same as above */
1670 sizeof(asn_DEF_Str4_tags_1)
1671 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1672 &asn_PER_Str4_constr_1,
1673 0, 0, /* No members */
1674 0 /* No specifics */
1675};
1676
1677
1678/*** <<< INCLUDES [PER-Visible] >>> ***/
1679
1680#include <IA5String.h>
1681
1682/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1683
1684typedef IA5String_t PER_Visible_t;
1685
1686/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1687
1688extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
1689asn_struct_free_f PER_Visible_free;
1690asn_struct_print_f PER_Visible_print;
1691asn_constr_check_f PER_Visible_constraint;
1692ber_type_decoder_f PER_Visible_decode_ber;
1693der_type_encoder_f PER_Visible_encode_der;
1694xer_type_decoder_f PER_Visible_decode_xer;
1695xer_type_encoder_f PER_Visible_encode_xer;
1696per_type_decoder_f PER_Visible_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001697per_type_encoder_f PER_Visible_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001698
1699/*** <<< CTABLES [PER-Visible] >>> ***/
1700
1701static int check_permitted_alphabet_1(const void *sptr) {
1702 /* The underlying type is IA5String */
1703 const IA5String_t *st = (const IA5String_t *)sptr;
1704 const uint8_t *ch = st->buf;
1705 const uint8_t *end = ch + st->size;
1706
1707 for(; ch < end; ch++) {
1708 uint8_t cv = *ch;
1709 if(!(cv >= 65 && cv <= 70)) return -1;
1710 }
1711 return 0;
1712}
1713
1714
1715/*** <<< CODE [PER-Visible] >>> ***/
1716
1717int
1718PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001719 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001720 const IA5String_t *st = (const IA5String_t *)sptr;
1721
1722 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001723 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001724 "%s: value not given (%s:%d)",
1725 td->name, __FILE__, __LINE__);
1726 return -1;
1727 }
1728
1729
1730 if(!check_permitted_alphabet_1(st)) {
1731 /* Constraint check succeeded */
1732 return 0;
1733 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001734 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001735 "%s: constraint failed (%s:%d)",
1736 td->name, __FILE__, __LINE__);
1737 return -1;
1738 }
1739}
1740
1741/*
1742 * This type is implemented using IA5String,
1743 * so here we adjust the DEF accordingly.
1744 */
1745static void
1746PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1747 td->free_struct = asn_DEF_IA5String.free_struct;
1748 td->print_struct = asn_DEF_IA5String.print_struct;
1749 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1750 td->der_encoder = asn_DEF_IA5String.der_encoder;
1751 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1752 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1753 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001754 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001755 if(!td->per_constraints)
1756 td->per_constraints = asn_DEF_IA5String.per_constraints;
1757 td->elements = asn_DEF_IA5String.elements;
1758 td->elements_count = asn_DEF_IA5String.elements_count;
1759 td->specifics = asn_DEF_IA5String.specifics;
1760}
1761
1762void
1763PER_Visible_free(asn_TYPE_descriptor_t *td,
1764 void *struct_ptr, int contents_only) {
1765 PER_Visible_1_inherit_TYPE_descriptor(td);
1766 td->free_struct(td, struct_ptr, contents_only);
1767}
1768
1769int
1770PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1771 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1772 PER_Visible_1_inherit_TYPE_descriptor(td);
1773 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1774}
1775
1776asn_dec_rval_t
1777PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1778 void **structure, const void *bufptr, size_t size, int tag_mode) {
1779 PER_Visible_1_inherit_TYPE_descriptor(td);
1780 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1781}
1782
1783asn_enc_rval_t
1784PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
1785 void *structure, int tag_mode, ber_tlv_tag_t tag,
1786 asn_app_consume_bytes_f *cb, void *app_key) {
1787 PER_Visible_1_inherit_TYPE_descriptor(td);
1788 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1789}
1790
1791asn_dec_rval_t
1792PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1793 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1794 PER_Visible_1_inherit_TYPE_descriptor(td);
1795 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1796}
1797
1798asn_enc_rval_t
1799PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1800 int ilevel, enum xer_encoder_flags_e flags,
1801 asn_app_consume_bytes_f *cb, void *app_key) {
1802 PER_Visible_1_inherit_TYPE_descriptor(td);
1803 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1804}
1805
1806asn_dec_rval_t
1807PER_Visible_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1808 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1809 PER_Visible_1_inherit_TYPE_descriptor(td);
1810 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1811}
1812
vlmb1b193e2006-08-18 01:46:46 +00001813asn_enc_rval_t
1814PER_Visible_encode_uper(asn_TYPE_descriptor_t *td,
1815 asn_per_constraints_t *constraints,
1816 void *structure, asn_per_outp_t *per_out) {
1817 PER_Visible_1_inherit_TYPE_descriptor(td);
1818 return td->uper_encoder(td, constraints, structure, per_out);
1819}
1820
vlm337167e2005-11-26 11:25:14 +00001821
1822/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1823
1824static ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
1825 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1826};
1827static asn_per_constraints_t asn_PER_PER_Visible_constr_1 = {
1828 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
1829 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
1830};
1831asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1832 "PER-Visible",
1833 "PER-Visible",
1834 PER_Visible_free,
1835 PER_Visible_print,
1836 PER_Visible_constraint,
1837 PER_Visible_decode_ber,
1838 PER_Visible_encode_der,
1839 PER_Visible_decode_xer,
1840 PER_Visible_encode_xer,
1841 PER_Visible_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001842 PER_Visible_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001843 0, /* Use generic outmost tag fetcher */
1844 asn_DEF_PER_Visible_tags_1,
1845 sizeof(asn_DEF_PER_Visible_tags_1)
1846 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1847 asn_DEF_PER_Visible_tags_1, /* Same as above */
1848 sizeof(asn_DEF_PER_Visible_tags_1)
1849 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1850 &asn_PER_PER_Visible_constr_1,
1851 0, 0, /* No members */
1852 0 /* No specifics */
1853};
1854
1855
1856/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1857
1858#include <PER-Visible.h>
1859
1860/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1861
1862typedef PER_Visible_t PER_Visible_2_t;
1863
1864/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1865
1866extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1867asn_struct_free_f PER_Visible_2_free;
1868asn_struct_print_f PER_Visible_2_print;
1869asn_constr_check_f PER_Visible_2_constraint;
1870ber_type_decoder_f PER_Visible_2_decode_ber;
1871der_type_encoder_f PER_Visible_2_encode_der;
1872xer_type_decoder_f PER_Visible_2_decode_xer;
1873xer_type_encoder_f PER_Visible_2_encode_xer;
1874per_type_decoder_f PER_Visible_2_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001875per_type_encoder_f PER_Visible_2_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001876
1877/*** <<< CTABLES [PER-Visible-2] >>> ***/
1878
1879static int check_permitted_alphabet_1(const void *sptr) {
1880 /* The underlying type is IA5String */
1881 const IA5String_t *st = (const IA5String_t *)sptr;
1882 const uint8_t *ch = st->buf;
1883 const uint8_t *end = ch + st->size;
1884
1885 for(; ch < end; ch++) {
1886 uint8_t cv = *ch;
1887 if(!(cv >= 69 && cv <= 70)) return -1;
1888 }
1889 return 0;
1890}
1891
1892
1893/*** <<< CODE [PER-Visible-2] >>> ***/
1894
1895int
1896PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001897 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001898 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1899
1900 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001901 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001902 "%s: value not given (%s:%d)",
1903 td->name, __FILE__, __LINE__);
1904 return -1;
1905 }
1906
1907
1908 if(!check_permitted_alphabet_1(st)) {
1909 /* Constraint check succeeded */
1910 return 0;
1911 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001912 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001913 "%s: constraint failed (%s:%d)",
1914 td->name, __FILE__, __LINE__);
1915 return -1;
1916 }
1917}
1918
1919/*
1920 * This type is implemented using PER_Visible,
1921 * so here we adjust the DEF accordingly.
1922 */
1923static void
1924PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1925 td->free_struct = asn_DEF_PER_Visible.free_struct;
1926 td->print_struct = asn_DEF_PER_Visible.print_struct;
1927 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1928 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1929 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1930 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1931 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001932 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001933 if(!td->per_constraints)
1934 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
1935 td->elements = asn_DEF_PER_Visible.elements;
1936 td->elements_count = asn_DEF_PER_Visible.elements_count;
1937 td->specifics = asn_DEF_PER_Visible.specifics;
1938}
1939
1940void
1941PER_Visible_2_free(asn_TYPE_descriptor_t *td,
1942 void *struct_ptr, int contents_only) {
1943 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1944 td->free_struct(td, struct_ptr, contents_only);
1945}
1946
1947int
1948PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1949 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1950 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1951 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1952}
1953
1954asn_dec_rval_t
1955PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1956 void **structure, const void *bufptr, size_t size, int tag_mode) {
1957 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1958 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1959}
1960
1961asn_enc_rval_t
1962PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
1963 void *structure, int tag_mode, ber_tlv_tag_t tag,
1964 asn_app_consume_bytes_f *cb, void *app_key) {
1965 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1966 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1967}
1968
1969asn_dec_rval_t
1970PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1971 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1972 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1973 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1974}
1975
1976asn_enc_rval_t
1977PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1978 int ilevel, enum xer_encoder_flags_e flags,
1979 asn_app_consume_bytes_f *cb, void *app_key) {
1980 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1981 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1982}
1983
1984asn_dec_rval_t
1985PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1986 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1987 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1988 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1989}
1990
vlmb1b193e2006-08-18 01:46:46 +00001991asn_enc_rval_t
1992PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
1993 asn_per_constraints_t *constraints,
1994 void *structure, asn_per_outp_t *per_out) {
1995 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1996 return td->uper_encoder(td, constraints, structure, per_out);
1997}
1998
vlm337167e2005-11-26 11:25:14 +00001999
2000/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
2001
2002static ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
2003 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2004};
2005static asn_per_constraints_t asn_PER_PER_Visible_2_constr_1 = {
2006 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2007 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
2008};
2009asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
2010 "PER-Visible-2",
2011 "PER-Visible-2",
2012 PER_Visible_2_free,
2013 PER_Visible_2_print,
2014 PER_Visible_2_constraint,
2015 PER_Visible_2_decode_ber,
2016 PER_Visible_2_encode_der,
2017 PER_Visible_2_decode_xer,
2018 PER_Visible_2_encode_xer,
2019 PER_Visible_2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002020 PER_Visible_2_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002021 0, /* Use generic outmost tag fetcher */
2022 asn_DEF_PER_Visible_2_tags_1,
2023 sizeof(asn_DEF_PER_Visible_2_tags_1)
2024 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
2025 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
2026 sizeof(asn_DEF_PER_Visible_2_tags_1)
2027 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
2028 &asn_PER_PER_Visible_2_constr_1,
2029 0, 0, /* No members */
2030 0 /* No specifics */
2031};
2032
2033
2034/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
2035
2036#include <PER-Visible.h>
2037
2038/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
2039
2040typedef PER_Visible_t Not_PER_Visible_1_t;
2041
2042/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
2043
2044extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
2045asn_struct_free_f Not_PER_Visible_1_free;
2046asn_struct_print_f Not_PER_Visible_1_print;
2047asn_constr_check_f Not_PER_Visible_1_constraint;
2048ber_type_decoder_f Not_PER_Visible_1_decode_ber;
2049der_type_encoder_f Not_PER_Visible_1_encode_der;
2050xer_type_decoder_f Not_PER_Visible_1_decode_xer;
2051xer_type_encoder_f Not_PER_Visible_1_encode_xer;
2052per_type_decoder_f Not_PER_Visible_1_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002053per_type_encoder_f Not_PER_Visible_1_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002054
2055/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
2056
2057static int check_permitted_alphabet_1(const void *sptr) {
2058 /* The underlying type is IA5String */
2059 const IA5String_t *st = (const IA5String_t *)sptr;
2060 const uint8_t *ch = st->buf;
2061 const uint8_t *end = ch + st->size;
2062
2063 for(; ch < end; ch++) {
2064 uint8_t cv = *ch;
2065 if(!(cv >= 65 && cv <= 70)) return -1;
2066 }
2067 return 0;
2068}
2069
2070
2071/*** <<< CODE [Not-PER-Visible-1] >>> ***/
2072
2073int
2074Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002075 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002076 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2077
2078 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002079 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002080 "%s: value not given (%s:%d)",
2081 td->name, __FILE__, __LINE__);
2082 return -1;
2083 }
2084
2085
2086 if(!check_permitted_alphabet_1(st)) {
2087 /* Constraint check succeeded */
2088 return 0;
2089 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002090 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002091 "%s: constraint failed (%s:%d)",
2092 td->name, __FILE__, __LINE__);
2093 return -1;
2094 }
2095}
2096
2097/*
2098 * This type is implemented using PER_Visible,
2099 * so here we adjust the DEF accordingly.
2100 */
2101static void
2102Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2103 td->free_struct = asn_DEF_PER_Visible.free_struct;
2104 td->print_struct = asn_DEF_PER_Visible.print_struct;
2105 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2106 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2107 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2108 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2109 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002110 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002111 if(!td->per_constraints)
2112 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2113 td->elements = asn_DEF_PER_Visible.elements;
2114 td->elements_count = asn_DEF_PER_Visible.elements_count;
2115 td->specifics = asn_DEF_PER_Visible.specifics;
2116}
2117
2118void
2119Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
2120 void *struct_ptr, int contents_only) {
2121 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2122 td->free_struct(td, struct_ptr, contents_only);
2123}
2124
2125int
2126Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2127 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2128 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2129 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2130}
2131
2132asn_dec_rval_t
2133Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2134 void **structure, const void *bufptr, size_t size, int tag_mode) {
2135 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2136 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2137}
2138
2139asn_enc_rval_t
2140Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
2141 void *structure, int tag_mode, ber_tlv_tag_t tag,
2142 asn_app_consume_bytes_f *cb, void *app_key) {
2143 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2144 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2145}
2146
2147asn_dec_rval_t
2148Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2149 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2150 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2151 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2152}
2153
2154asn_enc_rval_t
2155Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2156 int ilevel, enum xer_encoder_flags_e flags,
2157 asn_app_consume_bytes_f *cb, void *app_key) {
2158 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2159 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2160}
2161
2162asn_dec_rval_t
2163Not_PER_Visible_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2164 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2165 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2166 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2167}
2168
vlmb1b193e2006-08-18 01:46:46 +00002169asn_enc_rval_t
2170Not_PER_Visible_1_encode_uper(asn_TYPE_descriptor_t *td,
2171 asn_per_constraints_t *constraints,
2172 void *structure, asn_per_outp_t *per_out) {
2173 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2174 return td->uper_encoder(td, constraints, structure, per_out);
2175}
2176
vlm337167e2005-11-26 11:25:14 +00002177
2178/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
2179
2180static ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
2181 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2182};
2183static asn_per_constraints_t asn_PER_Not_PER_Visible_1_constr_1 = {
2184 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2185 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
2186};
2187asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
2188 "Not-PER-Visible-1",
2189 "Not-PER-Visible-1",
2190 Not_PER_Visible_1_free,
2191 Not_PER_Visible_1_print,
2192 Not_PER_Visible_1_constraint,
2193 Not_PER_Visible_1_decode_ber,
2194 Not_PER_Visible_1_encode_der,
2195 Not_PER_Visible_1_decode_xer,
2196 Not_PER_Visible_1_encode_xer,
2197 Not_PER_Visible_1_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002198 Not_PER_Visible_1_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002199 0, /* Use generic outmost tag fetcher */
2200 asn_DEF_Not_PER_Visible_1_tags_1,
2201 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2202 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2203 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
2204 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2205 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2206 &asn_PER_Not_PER_Visible_1_constr_1,
2207 0, 0, /* No members */
2208 0 /* No specifics */
2209};
2210
2211
2212/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
2213
2214#include <PER-Visible.h>
2215
2216/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
2217
2218typedef PER_Visible_t Not_PER_Visible_2_t;
2219
2220/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
2221
2222extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
2223asn_struct_free_f Not_PER_Visible_2_free;
2224asn_struct_print_f Not_PER_Visible_2_print;
2225asn_constr_check_f Not_PER_Visible_2_constraint;
2226ber_type_decoder_f Not_PER_Visible_2_decode_ber;
2227der_type_encoder_f Not_PER_Visible_2_encode_der;
2228xer_type_decoder_f Not_PER_Visible_2_decode_xer;
2229xer_type_encoder_f Not_PER_Visible_2_encode_xer;
2230per_type_decoder_f Not_PER_Visible_2_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002231per_type_encoder_f Not_PER_Visible_2_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002232
2233/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
2234
2235static int check_permitted_alphabet_1(const void *sptr) {
2236 /* The underlying type is IA5String */
2237 const IA5String_t *st = (const IA5String_t *)sptr;
2238 const uint8_t *ch = st->buf;
2239 const uint8_t *end = ch + st->size;
2240
2241 for(; ch < end; ch++) {
2242 uint8_t cv = *ch;
2243 if(!(cv >= 65 && cv <= 66)) return -1;
2244 }
2245 return 0;
2246}
2247
2248
2249/*** <<< CODE [Not-PER-Visible-2] >>> ***/
2250
2251int
2252Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002253 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002254 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2255
2256 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002257 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002258 "%s: value not given (%s:%d)",
2259 td->name, __FILE__, __LINE__);
2260 return -1;
2261 }
2262
2263
2264 if(!check_permitted_alphabet_1(st)) {
2265 /* Constraint check succeeded */
2266 return 0;
2267 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002268 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002269 "%s: constraint failed (%s:%d)",
2270 td->name, __FILE__, __LINE__);
2271 return -1;
2272 }
2273}
2274
2275/*
2276 * This type is implemented using PER_Visible,
2277 * so here we adjust the DEF accordingly.
2278 */
2279static void
2280Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2281 td->free_struct = asn_DEF_PER_Visible.free_struct;
2282 td->print_struct = asn_DEF_PER_Visible.print_struct;
2283 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2284 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2285 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2286 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2287 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002288 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002289 if(!td->per_constraints)
2290 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2291 td->elements = asn_DEF_PER_Visible.elements;
2292 td->elements_count = asn_DEF_PER_Visible.elements_count;
2293 td->specifics = asn_DEF_PER_Visible.specifics;
2294}
2295
2296void
2297Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2298 void *struct_ptr, int contents_only) {
2299 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2300 td->free_struct(td, struct_ptr, contents_only);
2301}
2302
2303int
2304Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2305 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2306 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2307 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2308}
2309
2310asn_dec_rval_t
2311Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2312 void **structure, const void *bufptr, size_t size, int tag_mode) {
2313 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2314 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2315}
2316
2317asn_enc_rval_t
2318Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2319 void *structure, int tag_mode, ber_tlv_tag_t tag,
2320 asn_app_consume_bytes_f *cb, void *app_key) {
2321 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2322 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2323}
2324
2325asn_dec_rval_t
2326Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2327 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2328 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2329 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2330}
2331
2332asn_enc_rval_t
2333Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2334 int ilevel, enum xer_encoder_flags_e flags,
2335 asn_app_consume_bytes_f *cb, void *app_key) {
2336 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2337 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2338}
2339
2340asn_dec_rval_t
2341Not_PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2342 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2343 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2344 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2345}
2346
vlmb1b193e2006-08-18 01:46:46 +00002347asn_enc_rval_t
2348Not_PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2349 asn_per_constraints_t *constraints,
2350 void *structure, asn_per_outp_t *per_out) {
2351 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2352 return td->uper_encoder(td, constraints, structure, per_out);
2353}
2354
vlm337167e2005-11-26 11:25:14 +00002355
2356/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
2357
2358static ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
2359 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2360};
2361static asn_per_constraints_t asn_PER_Not_PER_Visible_2_constr_1 = {
2362 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2363 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
2364};
2365asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
2366 "Not-PER-Visible-2",
2367 "Not-PER-Visible-2",
2368 Not_PER_Visible_2_free,
2369 Not_PER_Visible_2_print,
2370 Not_PER_Visible_2_constraint,
2371 Not_PER_Visible_2_decode_ber,
2372 Not_PER_Visible_2_encode_der,
2373 Not_PER_Visible_2_decode_xer,
2374 Not_PER_Visible_2_encode_xer,
2375 Not_PER_Visible_2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002376 Not_PER_Visible_2_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002377 0, /* Use generic outmost tag fetcher */
2378 asn_DEF_Not_PER_Visible_2_tags_1,
2379 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2380 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2381 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
2382 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2383 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2384 &asn_PER_Not_PER_Visible_2_constr_1,
2385 0, 0, /* No members */
2386 0 /* No specifics */
2387};
2388
2389
2390/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2391
2392#include <PER-Visible.h>
2393
2394/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2395
2396typedef PER_Visible_t Not_PER_Visible_3_t;
2397
2398/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2399
2400extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
2401asn_struct_free_f Not_PER_Visible_3_free;
2402asn_struct_print_f Not_PER_Visible_3_print;
2403asn_constr_check_f Not_PER_Visible_3_constraint;
2404ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2405der_type_encoder_f Not_PER_Visible_3_encode_der;
2406xer_type_decoder_f Not_PER_Visible_3_decode_xer;
2407xer_type_encoder_f Not_PER_Visible_3_encode_xer;
2408per_type_decoder_f Not_PER_Visible_3_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002409per_type_encoder_f Not_PER_Visible_3_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002410
2411/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2412
2413static int check_permitted_alphabet_1(const void *sptr) {
2414 /* The underlying type is IA5String */
2415 const IA5String_t *st = (const IA5String_t *)sptr;
2416 const uint8_t *ch = st->buf;
2417 const uint8_t *end = ch + st->size;
2418
2419 for(; ch < end; ch++) {
2420 uint8_t cv = *ch;
2421 if(!(cv >= 65 && cv <= 66)) return -1;
2422 }
2423 return 0;
2424}
2425
2426
2427/*** <<< CODE [Not-PER-Visible-3] >>> ***/
2428
2429int
2430Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002431 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002432 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2433
2434 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002435 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002436 "%s: value not given (%s:%d)",
2437 td->name, __FILE__, __LINE__);
2438 return -1;
2439 }
2440
2441
2442 if(!check_permitted_alphabet_1(st)) {
2443 /* Constraint check succeeded */
2444 return 0;
2445 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002446 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002447 "%s: constraint failed (%s:%d)",
2448 td->name, __FILE__, __LINE__);
2449 return -1;
2450 }
2451}
2452
2453/*
2454 * This type is implemented using PER_Visible,
2455 * so here we adjust the DEF accordingly.
2456 */
2457static void
2458Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2459 td->free_struct = asn_DEF_PER_Visible.free_struct;
2460 td->print_struct = asn_DEF_PER_Visible.print_struct;
2461 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2462 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2463 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2464 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2465 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002466 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002467 if(!td->per_constraints)
2468 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2469 td->elements = asn_DEF_PER_Visible.elements;
2470 td->elements_count = asn_DEF_PER_Visible.elements_count;
2471 td->specifics = asn_DEF_PER_Visible.specifics;
2472}
2473
2474void
2475Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
2476 void *struct_ptr, int contents_only) {
2477 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2478 td->free_struct(td, struct_ptr, contents_only);
2479}
2480
2481int
2482Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2483 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2484 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2485 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2486}
2487
2488asn_dec_rval_t
2489Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2490 void **structure, const void *bufptr, size_t size, int tag_mode) {
2491 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2492 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2493}
2494
2495asn_enc_rval_t
2496Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
2497 void *structure, int tag_mode, ber_tlv_tag_t tag,
2498 asn_app_consume_bytes_f *cb, void *app_key) {
2499 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2500 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2501}
2502
2503asn_dec_rval_t
2504Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2505 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2506 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2507 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2508}
2509
2510asn_enc_rval_t
2511Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2512 int ilevel, enum xer_encoder_flags_e flags,
2513 asn_app_consume_bytes_f *cb, void *app_key) {
2514 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2515 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2516}
2517
2518asn_dec_rval_t
2519Not_PER_Visible_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2520 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2521 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2522 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2523}
2524
vlmb1b193e2006-08-18 01:46:46 +00002525asn_enc_rval_t
2526Not_PER_Visible_3_encode_uper(asn_TYPE_descriptor_t *td,
2527 asn_per_constraints_t *constraints,
2528 void *structure, asn_per_outp_t *per_out) {
2529 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2530 return td->uper_encoder(td, constraints, structure, per_out);
2531}
2532
vlm337167e2005-11-26 11:25:14 +00002533
2534/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2535
2536static ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
2537 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2538};
2539static asn_per_constraints_t asn_PER_Not_PER_Visible_3_constr_1 = {
2540 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2541 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
2542};
2543asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
2544 "Not-PER-Visible-3",
2545 "Not-PER-Visible-3",
2546 Not_PER_Visible_3_free,
2547 Not_PER_Visible_3_print,
2548 Not_PER_Visible_3_constraint,
2549 Not_PER_Visible_3_decode_ber,
2550 Not_PER_Visible_3_encode_der,
2551 Not_PER_Visible_3_decode_xer,
2552 Not_PER_Visible_3_encode_xer,
2553 Not_PER_Visible_3_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002554 Not_PER_Visible_3_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002555 0, /* Use generic outmost tag fetcher */
2556 asn_DEF_Not_PER_Visible_3_tags_1,
2557 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2558 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2559 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
2560 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2561 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2562 &asn_PER_Not_PER_Visible_3_constr_1,
2563 0, 0, /* No members */
2564 0 /* No specifics */
2565};
2566
2567
2568/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2569
2570#include <PER-Visible.h>
2571
2572/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2573
2574typedef PER_Visible_t SIZE_but_not_FROM_t;
2575
2576/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2577
2578extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
2579asn_struct_free_f SIZE_but_not_FROM_free;
2580asn_struct_print_f SIZE_but_not_FROM_print;
2581asn_constr_check_f SIZE_but_not_FROM_constraint;
2582ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2583der_type_encoder_f SIZE_but_not_FROM_encode_der;
2584xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
2585xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
2586per_type_decoder_f SIZE_but_not_FROM_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002587per_type_encoder_f SIZE_but_not_FROM_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002588
2589/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2590
2591static int check_permitted_alphabet_1(const void *sptr) {
2592 /* The underlying type is IA5String */
2593 const IA5String_t *st = (const IA5String_t *)sptr;
2594 const uint8_t *ch = st->buf;
2595 const uint8_t *end = ch + st->size;
2596
2597 for(; ch < end; ch++) {
2598 uint8_t cv = *ch;
2599 if(!(cv >= 65 && cv <= 68)) return -1;
2600 }
2601 return 0;
2602}
2603
2604
2605/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2606
2607int
2608SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002609 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002610 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2611 size_t size;
2612
2613 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002614 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002615 "%s: value not given (%s:%d)",
2616 td->name, __FILE__, __LINE__);
2617 return -1;
2618 }
2619
2620 size = st->size;
2621
2622 if((size >= 1 && size <= 4)
2623 && !check_permitted_alphabet_1(st)) {
2624 /* Constraint check succeeded */
2625 return 0;
2626 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002627 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002628 "%s: constraint failed (%s:%d)",
2629 td->name, __FILE__, __LINE__);
2630 return -1;
2631 }
2632}
2633
2634/*
2635 * This type is implemented using PER_Visible,
2636 * so here we adjust the DEF accordingly.
2637 */
2638static void
2639SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2640 td->free_struct = asn_DEF_PER_Visible.free_struct;
2641 td->print_struct = asn_DEF_PER_Visible.print_struct;
2642 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2643 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2644 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2645 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2646 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002647 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002648 if(!td->per_constraints)
2649 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2650 td->elements = asn_DEF_PER_Visible.elements;
2651 td->elements_count = asn_DEF_PER_Visible.elements_count;
2652 td->specifics = asn_DEF_PER_Visible.specifics;
2653}
2654
2655void
2656SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
2657 void *struct_ptr, int contents_only) {
2658 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2659 td->free_struct(td, struct_ptr, contents_only);
2660}
2661
2662int
2663SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2664 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2665 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2666 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2667}
2668
2669asn_dec_rval_t
2670SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2671 void **structure, const void *bufptr, size_t size, int tag_mode) {
2672 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2673 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2674}
2675
2676asn_enc_rval_t
2677SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
2678 void *structure, int tag_mode, ber_tlv_tag_t tag,
2679 asn_app_consume_bytes_f *cb, void *app_key) {
2680 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2681 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2682}
2683
2684asn_dec_rval_t
2685SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2686 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2687 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2688 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2689}
2690
2691asn_enc_rval_t
2692SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2693 int ilevel, enum xer_encoder_flags_e flags,
2694 asn_app_consume_bytes_f *cb, void *app_key) {
2695 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2696 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2697}
2698
2699asn_dec_rval_t
2700SIZE_but_not_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2701 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2702 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2703 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2704}
2705
vlmb1b193e2006-08-18 01:46:46 +00002706asn_enc_rval_t
2707SIZE_but_not_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2708 asn_per_constraints_t *constraints,
2709 void *structure, asn_per_outp_t *per_out) {
2710 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2711 return td->uper_encoder(td, constraints, structure, per_out);
2712}
2713
vlm337167e2005-11-26 11:25:14 +00002714
2715/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2716
2717static ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
2718 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2719};
2720static asn_per_constraints_t asn_PER_SIZE_but_not_FROM_constr_1 = {
2721 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2722 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */
2723};
2724asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
2725 "SIZE-but-not-FROM",
2726 "SIZE-but-not-FROM",
2727 SIZE_but_not_FROM_free,
2728 SIZE_but_not_FROM_print,
2729 SIZE_but_not_FROM_constraint,
2730 SIZE_but_not_FROM_decode_ber,
2731 SIZE_but_not_FROM_encode_der,
2732 SIZE_but_not_FROM_decode_xer,
2733 SIZE_but_not_FROM_encode_xer,
2734 SIZE_but_not_FROM_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002735 SIZE_but_not_FROM_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002736 0, /* Use generic outmost tag fetcher */
2737 asn_DEF_SIZE_but_not_FROM_tags_1,
2738 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2739 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2740 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
2741 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2742 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2743 &asn_PER_SIZE_but_not_FROM_constr_1,
2744 0, 0, /* No members */
2745 0 /* No specifics */
2746};
2747
2748
2749/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2750
2751#include <PER-Visible.h>
2752
2753/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2754
2755typedef PER_Visible_t SIZE_and_FROM_t;
2756
2757/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2758
2759extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
2760asn_struct_free_f SIZE_and_FROM_free;
2761asn_struct_print_f SIZE_and_FROM_print;
2762asn_constr_check_f SIZE_and_FROM_constraint;
2763ber_type_decoder_f SIZE_and_FROM_decode_ber;
2764der_type_encoder_f SIZE_and_FROM_encode_der;
2765xer_type_decoder_f SIZE_and_FROM_decode_xer;
2766xer_type_encoder_f SIZE_and_FROM_encode_xer;
2767per_type_decoder_f SIZE_and_FROM_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002768per_type_encoder_f SIZE_and_FROM_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002769
2770/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2771
2772static int check_permitted_alphabet_1(const void *sptr) {
2773 /* The underlying type is IA5String */
2774 const IA5String_t *st = (const IA5String_t *)sptr;
2775 const uint8_t *ch = st->buf;
2776 const uint8_t *end = ch + st->size;
2777
2778 for(; ch < end; ch++) {
2779 uint8_t cv = *ch;
2780 if(!(cv >= 65 && cv <= 68)) return -1;
2781 }
2782 return 0;
2783}
2784
2785
2786/*** <<< CODE [SIZE-and-FROM] >>> ***/
2787
2788int
2789SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002790 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002791 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2792 size_t size;
2793
2794 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002795 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002796 "%s: value not given (%s:%d)",
2797 td->name, __FILE__, __LINE__);
2798 return -1;
2799 }
2800
2801 size = st->size;
2802
2803 if((size >= 1 && size <= 4)
2804 && !check_permitted_alphabet_1(st)) {
2805 /* Constraint check succeeded */
2806 return 0;
2807 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002808 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002809 "%s: constraint failed (%s:%d)",
2810 td->name, __FILE__, __LINE__);
2811 return -1;
2812 }
2813}
2814
2815/*
2816 * This type is implemented using PER_Visible,
2817 * so here we adjust the DEF accordingly.
2818 */
2819static void
2820SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2821 td->free_struct = asn_DEF_PER_Visible.free_struct;
2822 td->print_struct = asn_DEF_PER_Visible.print_struct;
2823 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2824 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2825 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2826 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2827 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002828 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002829 if(!td->per_constraints)
2830 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2831 td->elements = asn_DEF_PER_Visible.elements;
2832 td->elements_count = asn_DEF_PER_Visible.elements_count;
2833 td->specifics = asn_DEF_PER_Visible.specifics;
2834}
2835
2836void
2837SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
2838 void *struct_ptr, int contents_only) {
2839 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2840 td->free_struct(td, struct_ptr, contents_only);
2841}
2842
2843int
2844SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2845 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2846 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2847 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2848}
2849
2850asn_dec_rval_t
2851SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2852 void **structure, const void *bufptr, size_t size, int tag_mode) {
2853 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2854 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2855}
2856
2857asn_enc_rval_t
2858SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
2859 void *structure, int tag_mode, ber_tlv_tag_t tag,
2860 asn_app_consume_bytes_f *cb, void *app_key) {
2861 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2862 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2863}
2864
2865asn_dec_rval_t
2866SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2867 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2868 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2869 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2870}
2871
2872asn_enc_rval_t
2873SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2874 int ilevel, enum xer_encoder_flags_e flags,
2875 asn_app_consume_bytes_f *cb, void *app_key) {
2876 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2877 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2878}
2879
2880asn_dec_rval_t
2881SIZE_and_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2882 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2883 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2884 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2885}
2886
vlmb1b193e2006-08-18 01:46:46 +00002887asn_enc_rval_t
2888SIZE_and_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2889 asn_per_constraints_t *constraints,
2890 void *structure, asn_per_outp_t *per_out) {
2891 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2892 return td->uper_encoder(td, constraints, structure, per_out);
2893}
2894
vlm337167e2005-11-26 11:25:14 +00002895
2896/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
2897
2898static ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
2899 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2900};
2901static asn_per_constraints_t asn_PER_SIZE_and_FROM_constr_1 = {
2902 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2903 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */
2904};
2905asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
2906 "SIZE-and-FROM",
2907 "SIZE-and-FROM",
2908 SIZE_and_FROM_free,
2909 SIZE_and_FROM_print,
2910 SIZE_and_FROM_constraint,
2911 SIZE_and_FROM_decode_ber,
2912 SIZE_and_FROM_encode_der,
2913 SIZE_and_FROM_decode_xer,
2914 SIZE_and_FROM_encode_xer,
2915 SIZE_and_FROM_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002916 SIZE_and_FROM_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002917 0, /* Use generic outmost tag fetcher */
2918 asn_DEF_SIZE_and_FROM_tags_1,
2919 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2920 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2921 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
2922 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2923 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2924 &asn_PER_SIZE_and_FROM_constr_1,
2925 0, 0, /* No members */
2926 0 /* No specifics */
2927};
2928
2929
2930/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
2931
2932#include <PER-Visible.h>
2933
2934/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2935
2936typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
2937
2938/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2939
2940extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
2941asn_struct_free_f Neither_SIZE_nor_FROM_free;
2942asn_struct_print_f Neither_SIZE_nor_FROM_print;
2943asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
2944ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
2945der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
2946xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
2947xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
2948per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002949per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002950
2951/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
2952
2953static int check_permitted_alphabet_1(const void *sptr) {
2954 /* The underlying type is IA5String */
2955 const IA5String_t *st = (const IA5String_t *)sptr;
2956 const uint8_t *ch = st->buf;
2957 const uint8_t *end = ch + st->size;
2958
2959 for(; ch < end; ch++) {
2960 uint8_t cv = *ch;
2961 if(!(cv >= 65 && cv <= 70)) return -1;
2962 }
2963 return 0;
2964}
2965
2966
2967/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
2968
2969int
2970Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002971 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002972 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2973
2974 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002975 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002976 "%s: value not given (%s:%d)",
2977 td->name, __FILE__, __LINE__);
2978 return -1;
2979 }
2980
2981
2982 if(!check_permitted_alphabet_1(st)) {
2983 /* Constraint check succeeded */
2984 return 0;
2985 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002986 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002987 "%s: constraint failed (%s:%d)",
2988 td->name, __FILE__, __LINE__);
2989 return -1;
2990 }
2991}
2992
2993/*
2994 * This type is implemented using PER_Visible,
2995 * so here we adjust the DEF accordingly.
2996 */
2997static void
2998Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2999 td->free_struct = asn_DEF_PER_Visible.free_struct;
3000 td->print_struct = asn_DEF_PER_Visible.print_struct;
3001 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
3002 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
3003 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
3004 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
3005 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003006 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003007 if(!td->per_constraints)
3008 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
3009 td->elements = asn_DEF_PER_Visible.elements;
3010 td->elements_count = asn_DEF_PER_Visible.elements_count;
3011 td->specifics = asn_DEF_PER_Visible.specifics;
3012}
3013
3014void
3015Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
3016 void *struct_ptr, int contents_only) {
3017 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3018 td->free_struct(td, struct_ptr, contents_only);
3019}
3020
3021int
3022Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3023 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3024 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3025 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3026}
3027
3028asn_dec_rval_t
3029Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3030 void **structure, const void *bufptr, size_t size, int tag_mode) {
3031 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3032 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3033}
3034
3035asn_enc_rval_t
3036Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
3037 void *structure, int tag_mode, ber_tlv_tag_t tag,
3038 asn_app_consume_bytes_f *cb, void *app_key) {
3039 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3040 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3041}
3042
3043asn_dec_rval_t
3044Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3045 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3046 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3047 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3048}
3049
3050asn_enc_rval_t
3051Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3052 int ilevel, enum xer_encoder_flags_e flags,
3053 asn_app_consume_bytes_f *cb, void *app_key) {
3054 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3055 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3056}
3057
3058asn_dec_rval_t
3059Neither_SIZE_nor_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3060 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3061 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3062 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3063}
3064
vlmb1b193e2006-08-18 01:46:46 +00003065asn_enc_rval_t
3066Neither_SIZE_nor_FROM_encode_uper(asn_TYPE_descriptor_t *td,
3067 asn_per_constraints_t *constraints,
3068 void *structure, asn_per_outp_t *per_out) {
3069 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3070 return td->uper_encoder(td, constraints, structure, per_out);
3071}
3072
vlm337167e2005-11-26 11:25:14 +00003073
3074/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
3075
3076static ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
3077 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
3078};
3079static asn_per_constraints_t asn_PER_Neither_SIZE_nor_FROM_constr_1 = {
3080 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3081 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
3082};
3083asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
3084 "Neither-SIZE-nor-FROM",
3085 "Neither-SIZE-nor-FROM",
3086 Neither_SIZE_nor_FROM_free,
3087 Neither_SIZE_nor_FROM_print,
3088 Neither_SIZE_nor_FROM_constraint,
3089 Neither_SIZE_nor_FROM_decode_ber,
3090 Neither_SIZE_nor_FROM_encode_der,
3091 Neither_SIZE_nor_FROM_decode_xer,
3092 Neither_SIZE_nor_FROM_encode_xer,
3093 Neither_SIZE_nor_FROM_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003094 Neither_SIZE_nor_FROM_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003095 0, /* Use generic outmost tag fetcher */
3096 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
3097 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3098 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
3099 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
3100 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3101 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
3102 &asn_PER_Neither_SIZE_nor_FROM_constr_1,
3103 0, 0, /* No members */
3104 0 /* No specifics */
3105};
3106
3107
3108/*** <<< INCLUDES [Utf8-4] >>> ***/
3109
3110#include <UTF8String.h>
3111
3112/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
3113
3114typedef UTF8String_t Utf8_4_t;
3115
3116/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
3117
3118extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
3119asn_struct_free_f Utf8_4_free;
3120asn_struct_print_f Utf8_4_print;
3121asn_constr_check_f Utf8_4_constraint;
3122ber_type_decoder_f Utf8_4_decode_ber;
3123der_type_encoder_f Utf8_4_encode_der;
3124xer_type_decoder_f Utf8_4_decode_xer;
3125xer_type_encoder_f Utf8_4_encode_xer;
3126per_type_decoder_f Utf8_4_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003127per_type_encoder_f Utf8_4_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003128
3129/*** <<< CTABLES [Utf8-4] >>> ***/
3130
3131static int check_permitted_alphabet_1(const void *sptr) {
3132 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
3133 return -1; /* Alphabet (sic!) test failed. */
3134
3135 return 0;
3136}
3137
3138
3139/*** <<< CODE [Utf8-4] >>> ***/
3140
3141int
3142Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003143 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003144 const UTF8String_t *st = (const UTF8String_t *)sptr;
3145
3146 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00003147 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003148 "%s: value not given (%s:%d)",
3149 td->name, __FILE__, __LINE__);
3150 return -1;
3151 }
3152
3153
3154 if(!check_permitted_alphabet_1(st)) {
3155 /* Constraint check succeeded */
3156 return 0;
3157 } else {
vlmd4ae41c2006-07-13 13:28:32 +00003158 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003159 "%s: constraint failed (%s:%d)",
3160 td->name, __FILE__, __LINE__);
3161 return -1;
3162 }
3163}
3164
3165/*
3166 * This type is implemented using UTF8String,
3167 * so here we adjust the DEF accordingly.
3168 */
3169static void
3170Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3171 td->free_struct = asn_DEF_UTF8String.free_struct;
3172 td->print_struct = asn_DEF_UTF8String.print_struct;
3173 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3174 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3175 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3176 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3177 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003178 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003179 if(!td->per_constraints)
3180 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3181 td->elements = asn_DEF_UTF8String.elements;
3182 td->elements_count = asn_DEF_UTF8String.elements_count;
3183 td->specifics = asn_DEF_UTF8String.specifics;
3184}
3185
3186void
3187Utf8_4_free(asn_TYPE_descriptor_t *td,
3188 void *struct_ptr, int contents_only) {
3189 Utf8_4_1_inherit_TYPE_descriptor(td);
3190 td->free_struct(td, struct_ptr, contents_only);
3191}
3192
3193int
3194Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3195 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3196 Utf8_4_1_inherit_TYPE_descriptor(td);
3197 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3198}
3199
3200asn_dec_rval_t
3201Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3202 void **structure, const void *bufptr, size_t size, int tag_mode) {
3203 Utf8_4_1_inherit_TYPE_descriptor(td);
3204 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3205}
3206
3207asn_enc_rval_t
3208Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
3209 void *structure, int tag_mode, ber_tlv_tag_t tag,
3210 asn_app_consume_bytes_f *cb, void *app_key) {
3211 Utf8_4_1_inherit_TYPE_descriptor(td);
3212 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3213}
3214
3215asn_dec_rval_t
3216Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3217 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3218 Utf8_4_1_inherit_TYPE_descriptor(td);
3219 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3220}
3221
3222asn_enc_rval_t
3223Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3224 int ilevel, enum xer_encoder_flags_e flags,
3225 asn_app_consume_bytes_f *cb, void *app_key) {
3226 Utf8_4_1_inherit_TYPE_descriptor(td);
3227 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3228}
3229
3230asn_dec_rval_t
3231Utf8_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3232 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3233 Utf8_4_1_inherit_TYPE_descriptor(td);
3234 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3235}
3236
vlmb1b193e2006-08-18 01:46:46 +00003237asn_enc_rval_t
3238Utf8_4_encode_uper(asn_TYPE_descriptor_t *td,
3239 asn_per_constraints_t *constraints,
3240 void *structure, asn_per_outp_t *per_out) {
3241 Utf8_4_1_inherit_TYPE_descriptor(td);
3242 return td->uper_encoder(td, constraints, structure, per_out);
3243}
3244
vlm337167e2005-11-26 11:25:14 +00003245
3246/*** <<< STAT-DEFS [Utf8-4] >>> ***/
3247
3248static ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
3249 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3250};
3251static asn_per_constraints_t asn_PER_Utf8_4_constr_1 = {
3252 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3253 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
3254};
3255asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
3256 "Utf8-4",
3257 "Utf8-4",
3258 Utf8_4_free,
3259 Utf8_4_print,
3260 Utf8_4_constraint,
3261 Utf8_4_decode_ber,
3262 Utf8_4_encode_der,
3263 Utf8_4_decode_xer,
3264 Utf8_4_encode_xer,
3265 Utf8_4_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003266 Utf8_4_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003267 0, /* Use generic outmost tag fetcher */
3268 asn_DEF_Utf8_4_tags_1,
3269 sizeof(asn_DEF_Utf8_4_tags_1)
3270 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
3271 asn_DEF_Utf8_4_tags_1, /* Same as above */
3272 sizeof(asn_DEF_Utf8_4_tags_1)
3273 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
3274 &asn_PER_Utf8_4_constr_1,
3275 0, 0, /* No members */
3276 0 /* No specifics */
3277};
3278
3279
3280/*** <<< INCLUDES [Utf8-3] >>> ***/
3281
3282#include <Utf8-2.h>
3283
3284/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
3285
3286typedef Utf8_2_t Utf8_3_t;
3287
3288/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
3289
3290extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
3291asn_struct_free_f Utf8_3_free;
3292asn_struct_print_f Utf8_3_print;
3293asn_constr_check_f Utf8_3_constraint;
3294ber_type_decoder_f Utf8_3_decode_ber;
3295der_type_encoder_f Utf8_3_encode_der;
3296xer_type_decoder_f Utf8_3_decode_xer;
3297xer_type_encoder_f Utf8_3_encode_xer;
3298per_type_decoder_f Utf8_3_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003299per_type_encoder_f Utf8_3_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003300
3301/*** <<< CTABLES [Utf8-3] >>> ***/
3302
3303static int permitted_alphabet_table_1[128] = {
33040,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
33050,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
33060,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
33070,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
33080,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ABCDEFGHIJKLMNO */
33091,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* PQRSTUVWXYZ */
33100,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* abcdefghijklmno */
33111,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz */
3312};
3313
3314static int check_permitted_alphabet_1(const void *sptr) {
3315 int *table = permitted_alphabet_table_1;
3316 /* The underlying type is UTF8String */
3317 const UTF8String_t *st = (const UTF8String_t *)sptr;
3318 const uint8_t *ch = st->buf;
3319 const uint8_t *end = ch + st->size;
3320
3321 for(; ch < end; ch++) {
3322 uint8_t cv = *ch;
3323 if(cv >= 0x80) return -1;
3324 if(!table[cv]) return -1;
3325 }
3326 return 0;
3327}
3328
3329
3330/*** <<< CODE [Utf8-3] >>> ***/
3331
3332int
3333Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003334 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003335 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
3336 size_t size;
3337
3338 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00003339 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003340 "%s: value not given (%s:%d)",
3341 td->name, __FILE__, __LINE__);
3342 return -1;
3343 }
3344
3345 size = UTF8String_length(st);
3346 if((ssize_t)size < 0) {
vlmd4ae41c2006-07-13 13:28:32 +00003347 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003348 "%s: UTF-8: broken encoding (%s:%d)",
3349 td->name, __FILE__, __LINE__);
3350 return -1;
3351 }
3352
3353 if((size >= 1 && size <= 2)
3354 && !check_permitted_alphabet_1(st)) {
3355 /* Constraint check succeeded */
3356 return 0;
3357 } else {
vlmd4ae41c2006-07-13 13:28:32 +00003358 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003359 "%s: constraint failed (%s:%d)",
3360 td->name, __FILE__, __LINE__);
3361 return -1;
3362 }
3363}
3364
3365/*
3366 * This type is implemented using Utf8_2,
3367 * so here we adjust the DEF accordingly.
3368 */
3369static void
3370Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3371 td->free_struct = asn_DEF_Utf8_2.free_struct;
3372 td->print_struct = asn_DEF_Utf8_2.print_struct;
3373 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
3374 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
3375 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
3376 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
3377 td->uper_decoder = asn_DEF_Utf8_2.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003378 td->uper_encoder = asn_DEF_Utf8_2.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003379 if(!td->per_constraints)
3380 td->per_constraints = asn_DEF_Utf8_2.per_constraints;
3381 td->elements = asn_DEF_Utf8_2.elements;
3382 td->elements_count = asn_DEF_Utf8_2.elements_count;
3383 td->specifics = asn_DEF_Utf8_2.specifics;
3384}
3385
3386void
3387Utf8_3_free(asn_TYPE_descriptor_t *td,
3388 void *struct_ptr, int contents_only) {
3389 Utf8_3_1_inherit_TYPE_descriptor(td);
3390 td->free_struct(td, struct_ptr, contents_only);
3391}
3392
3393int
3394Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3395 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3396 Utf8_3_1_inherit_TYPE_descriptor(td);
3397 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3398}
3399
3400asn_dec_rval_t
3401Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3402 void **structure, const void *bufptr, size_t size, int tag_mode) {
3403 Utf8_3_1_inherit_TYPE_descriptor(td);
3404 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3405}
3406
3407asn_enc_rval_t
3408Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
3409 void *structure, int tag_mode, ber_tlv_tag_t tag,
3410 asn_app_consume_bytes_f *cb, void *app_key) {
3411 Utf8_3_1_inherit_TYPE_descriptor(td);
3412 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3413}
3414
3415asn_dec_rval_t
3416Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3417 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3418 Utf8_3_1_inherit_TYPE_descriptor(td);
3419 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3420}
3421
3422asn_enc_rval_t
3423Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3424 int ilevel, enum xer_encoder_flags_e flags,
3425 asn_app_consume_bytes_f *cb, void *app_key) {
3426 Utf8_3_1_inherit_TYPE_descriptor(td);
3427 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3428}
3429
3430asn_dec_rval_t
3431Utf8_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3432 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3433 Utf8_3_1_inherit_TYPE_descriptor(td);
3434 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3435}
3436
vlmb1b193e2006-08-18 01:46:46 +00003437asn_enc_rval_t
3438Utf8_3_encode_uper(asn_TYPE_descriptor_t *td,
3439 asn_per_constraints_t *constraints,
3440 void *structure, asn_per_outp_t *per_out) {
3441 Utf8_3_1_inherit_TYPE_descriptor(td);
3442 return td->uper_encoder(td, constraints, structure, per_out);
3443}
3444
vlm337167e2005-11-26 11:25:14 +00003445
3446/*** <<< STAT-DEFS [Utf8-3] >>> ***/
3447
3448static ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
3449 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3450};
3451static asn_per_constraints_t asn_PER_Utf8_3_constr_1 = {
3452 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3453 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
3454};
3455asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
3456 "Utf8-3",
3457 "Utf8-3",
3458 Utf8_3_free,
3459 Utf8_3_print,
3460 Utf8_3_constraint,
3461 Utf8_3_decode_ber,
3462 Utf8_3_encode_der,
3463 Utf8_3_decode_xer,
3464 Utf8_3_encode_xer,
3465 Utf8_3_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003466 Utf8_3_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003467 0, /* Use generic outmost tag fetcher */
3468 asn_DEF_Utf8_3_tags_1,
3469 sizeof(asn_DEF_Utf8_3_tags_1)
3470 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3471 asn_DEF_Utf8_3_tags_1, /* Same as above */
3472 sizeof(asn_DEF_Utf8_3_tags_1)
3473 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3474 &asn_PER_Utf8_3_constr_1,
3475 0, 0, /* No members */
3476 0 /* No specifics */
3477};
3478
3479
3480/*** <<< INCLUDES [Utf8-2] >>> ***/
3481
3482#include <Utf8-1.h>
3483
3484/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
3485
3486typedef Utf8_1_t Utf8_2_t;
3487
3488/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
3489
3490extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
3491asn_struct_free_f Utf8_2_free;
3492asn_struct_print_f Utf8_2_print;
3493asn_constr_check_f Utf8_2_constraint;
3494ber_type_decoder_f Utf8_2_decode_ber;
3495der_type_encoder_f Utf8_2_encode_der;
3496xer_type_decoder_f Utf8_2_decode_xer;
3497xer_type_encoder_f Utf8_2_encode_xer;
3498per_type_decoder_f Utf8_2_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003499per_type_encoder_f Utf8_2_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003500
3501/*** <<< CODE [Utf8-2] >>> ***/
3502
3503int
3504Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003505 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003506 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
3507 size_t size;
3508
3509 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00003510 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003511 "%s: value not given (%s:%d)",
3512 td->name, __FILE__, __LINE__);
3513 return -1;
3514 }
3515
3516 size = UTF8String_length(st);
3517 if((ssize_t)size < 0) {
vlmd4ae41c2006-07-13 13:28:32 +00003518 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003519 "%s: UTF-8: broken encoding (%s:%d)",
3520 td->name, __FILE__, __LINE__);
3521 return -1;
3522 }
3523
3524 if((size >= 1 && size <= 2)) {
3525 /* Constraint check succeeded */
3526 return 0;
3527 } else {
vlmd4ae41c2006-07-13 13:28:32 +00003528 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003529 "%s: constraint failed (%s:%d)",
3530 td->name, __FILE__, __LINE__);
3531 return -1;
3532 }
3533}
3534
3535/*
3536 * This type is implemented using Utf8_1,
3537 * so here we adjust the DEF accordingly.
3538 */
3539static void
3540Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3541 td->free_struct = asn_DEF_Utf8_1.free_struct;
3542 td->print_struct = asn_DEF_Utf8_1.print_struct;
3543 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
3544 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
3545 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
3546 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
3547 td->uper_decoder = asn_DEF_Utf8_1.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003548 td->uper_encoder = asn_DEF_Utf8_1.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003549 if(!td->per_constraints)
3550 td->per_constraints = asn_DEF_Utf8_1.per_constraints;
3551 td->elements = asn_DEF_Utf8_1.elements;
3552 td->elements_count = asn_DEF_Utf8_1.elements_count;
3553 td->specifics = asn_DEF_Utf8_1.specifics;
3554}
3555
3556void
3557Utf8_2_free(asn_TYPE_descriptor_t *td,
3558 void *struct_ptr, int contents_only) {
3559 Utf8_2_1_inherit_TYPE_descriptor(td);
3560 td->free_struct(td, struct_ptr, contents_only);
3561}
3562
3563int
3564Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3565 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3566 Utf8_2_1_inherit_TYPE_descriptor(td);
3567 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3568}
3569
3570asn_dec_rval_t
3571Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3572 void **structure, const void *bufptr, size_t size, int tag_mode) {
3573 Utf8_2_1_inherit_TYPE_descriptor(td);
3574 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3575}
3576
3577asn_enc_rval_t
3578Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
3579 void *structure, int tag_mode, ber_tlv_tag_t tag,
3580 asn_app_consume_bytes_f *cb, void *app_key) {
3581 Utf8_2_1_inherit_TYPE_descriptor(td);
3582 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3583}
3584
3585asn_dec_rval_t
3586Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3587 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3588 Utf8_2_1_inherit_TYPE_descriptor(td);
3589 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3590}
3591
3592asn_enc_rval_t
3593Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3594 int ilevel, enum xer_encoder_flags_e flags,
3595 asn_app_consume_bytes_f *cb, void *app_key) {
3596 Utf8_2_1_inherit_TYPE_descriptor(td);
3597 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3598}
3599
3600asn_dec_rval_t
3601Utf8_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3602 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3603 Utf8_2_1_inherit_TYPE_descriptor(td);
3604 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3605}
3606
vlmb1b193e2006-08-18 01:46:46 +00003607asn_enc_rval_t
3608Utf8_2_encode_uper(asn_TYPE_descriptor_t *td,
3609 asn_per_constraints_t *constraints,
3610 void *structure, asn_per_outp_t *per_out) {
3611 Utf8_2_1_inherit_TYPE_descriptor(td);
3612 return td->uper_encoder(td, constraints, structure, per_out);
3613}
3614
vlm337167e2005-11-26 11:25:14 +00003615
3616/*** <<< STAT-DEFS [Utf8-2] >>> ***/
3617
3618static ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
3619 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3620};
3621static asn_per_constraints_t asn_PER_Utf8_2_constr_1 = {
3622 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3623 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
3624};
3625asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
3626 "Utf8-2",
3627 "Utf8-2",
3628 Utf8_2_free,
3629 Utf8_2_print,
3630 Utf8_2_constraint,
3631 Utf8_2_decode_ber,
3632 Utf8_2_encode_der,
3633 Utf8_2_decode_xer,
3634 Utf8_2_encode_xer,
3635 Utf8_2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003636 Utf8_2_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003637 0, /* Use generic outmost tag fetcher */
3638 asn_DEF_Utf8_2_tags_1,
3639 sizeof(asn_DEF_Utf8_2_tags_1)
3640 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3641 asn_DEF_Utf8_2_tags_1, /* Same as above */
3642 sizeof(asn_DEF_Utf8_2_tags_1)
3643 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3644 &asn_PER_Utf8_2_constr_1,
3645 0, 0, /* No members */
3646 0 /* No specifics */
3647};
3648
3649
3650/*** <<< INCLUDES [Utf8-1] >>> ***/
3651
3652#include <UTF8String.h>
3653
3654/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3655
3656typedef UTF8String_t Utf8_1_t;
3657
3658/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3659
3660extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3661asn_struct_free_f Utf8_1_free;
3662asn_struct_print_f Utf8_1_print;
3663asn_constr_check_f Utf8_1_constraint;
3664ber_type_decoder_f Utf8_1_decode_ber;
3665der_type_encoder_f Utf8_1_encode_der;
3666xer_type_decoder_f Utf8_1_decode_xer;
3667xer_type_encoder_f Utf8_1_encode_xer;
3668per_type_decoder_f Utf8_1_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003669per_type_encoder_f Utf8_1_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003670
3671/*** <<< CODE [Utf8-1] >>> ***/
3672
3673int
3674Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003675 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003676 /* Replace with underlying type checker */
3677 td->check_constraints = asn_DEF_UTF8String.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +00003678 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm337167e2005-11-26 11:25:14 +00003679}
3680
3681/*
3682 * This type is implemented using UTF8String,
3683 * so here we adjust the DEF accordingly.
3684 */
3685static void
3686Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3687 td->free_struct = asn_DEF_UTF8String.free_struct;
3688 td->print_struct = asn_DEF_UTF8String.print_struct;
3689 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3690 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3691 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3692 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3693 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003694 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003695 if(!td->per_constraints)
3696 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3697 td->elements = asn_DEF_UTF8String.elements;
3698 td->elements_count = asn_DEF_UTF8String.elements_count;
3699 td->specifics = asn_DEF_UTF8String.specifics;
3700}
3701
3702void
3703Utf8_1_free(asn_TYPE_descriptor_t *td,
3704 void *struct_ptr, int contents_only) {
3705 Utf8_1_1_inherit_TYPE_descriptor(td);
3706 td->free_struct(td, struct_ptr, contents_only);
3707}
3708
3709int
3710Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3711 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3712 Utf8_1_1_inherit_TYPE_descriptor(td);
3713 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3714}
3715
3716asn_dec_rval_t
3717Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3718 void **structure, const void *bufptr, size_t size, int tag_mode) {
3719 Utf8_1_1_inherit_TYPE_descriptor(td);
3720 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3721}
3722
3723asn_enc_rval_t
3724Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3725 void *structure, int tag_mode, ber_tlv_tag_t tag,
3726 asn_app_consume_bytes_f *cb, void *app_key) {
3727 Utf8_1_1_inherit_TYPE_descriptor(td);
3728 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3729}
3730
3731asn_dec_rval_t
3732Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3733 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3734 Utf8_1_1_inherit_TYPE_descriptor(td);
3735 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3736}
3737
3738asn_enc_rval_t
3739Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3740 int ilevel, enum xer_encoder_flags_e flags,
3741 asn_app_consume_bytes_f *cb, void *app_key) {
3742 Utf8_1_1_inherit_TYPE_descriptor(td);
3743 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3744}
3745
3746asn_dec_rval_t
3747Utf8_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3748 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3749 Utf8_1_1_inherit_TYPE_descriptor(td);
3750 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3751}
3752
vlmb1b193e2006-08-18 01:46:46 +00003753asn_enc_rval_t
3754Utf8_1_encode_uper(asn_TYPE_descriptor_t *td,
3755 asn_per_constraints_t *constraints,
3756 void *structure, asn_per_outp_t *per_out) {
3757 Utf8_1_1_inherit_TYPE_descriptor(td);
3758 return td->uper_encoder(td, constraints, structure, per_out);
3759}
3760
vlm337167e2005-11-26 11:25:14 +00003761
3762/*** <<< STAT-DEFS [Utf8-1] >>> ***/
3763
3764static ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
3765 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3766};
3767asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3768 "Utf8-1",
3769 "Utf8-1",
3770 Utf8_1_free,
3771 Utf8_1_print,
3772 Utf8_1_constraint,
3773 Utf8_1_decode_ber,
3774 Utf8_1_encode_der,
3775 Utf8_1_decode_xer,
3776 Utf8_1_encode_xer,
3777 Utf8_1_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003778 Utf8_1_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003779 0, /* Use generic outmost tag fetcher */
3780 asn_DEF_Utf8_1_tags_1,
3781 sizeof(asn_DEF_Utf8_1_tags_1)
3782 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3783 asn_DEF_Utf8_1_tags_1, /* Same as above */
3784 sizeof(asn_DEF_Utf8_1_tags_1)
3785 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3786 0, /* No PER visible constraints */
3787 0, 0, /* No members */
3788 0 /* No specifics */
3789};
3790
3791
3792/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
3793
3794#include <Identifier.h>
3795
3796/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
3797
3798typedef Identifier_t VisibleIdentifier_t;
3799
3800/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
3801
3802extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
3803asn_struct_free_f VisibleIdentifier_free;
3804asn_struct_print_f VisibleIdentifier_print;
3805asn_constr_check_f VisibleIdentifier_constraint;
3806ber_type_decoder_f VisibleIdentifier_decode_ber;
3807der_type_encoder_f VisibleIdentifier_encode_der;
3808xer_type_decoder_f VisibleIdentifier_decode_xer;
3809xer_type_encoder_f VisibleIdentifier_encode_xer;
3810per_type_decoder_f VisibleIdentifier_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003811per_type_encoder_f VisibleIdentifier_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003812
3813/*** <<< CTABLES [VisibleIdentifier] >>> ***/
3814
3815static int permitted_alphabet_table_1[256] = {
38160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
38170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
38180,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, /* $ */
38191,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, /* 0123456789 */
38200,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ABCDEFGHIJKLMNO */
38211,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, /* PQRSTUVWXYZ _ */
38220,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* abcdefghijklmno */
38231,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz */
3824};
3825
3826static int check_permitted_alphabet_1(const void *sptr) {
3827 int *table = permitted_alphabet_table_1;
3828 /* The underlying type is VisibleString */
3829 const VisibleString_t *st = (const VisibleString_t *)sptr;
3830 const uint8_t *ch = st->buf;
3831 const uint8_t *end = ch + st->size;
3832
3833 for(; ch < end; ch++) {
3834 uint8_t cv = *ch;
3835 if(!table[cv]) return -1;
3836 }
3837 return 0;
3838}
3839
3840
3841/*** <<< CODE [VisibleIdentifier] >>> ***/
3842
3843int
3844VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003845 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003846 const Identifier_t *st = (const Identifier_t *)sptr;
3847 size_t size;
3848
3849 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00003850 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003851 "%s: value not given (%s:%d)",
3852 td->name, __FILE__, __LINE__);
3853 return -1;
3854 }
3855
3856 size = st->size;
3857
3858 if((size >= 1 && size <= 32)
3859 && !check_permitted_alphabet_1(st)) {
3860 /* Constraint check succeeded */
3861 return 0;
3862 } else {
vlmd4ae41c2006-07-13 13:28:32 +00003863 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003864 "%s: constraint failed (%s:%d)",
3865 td->name, __FILE__, __LINE__);
3866 return -1;
3867 }
3868}
3869
3870/*
3871 * This type is implemented using Identifier,
3872 * so here we adjust the DEF accordingly.
3873 */
3874static void
3875VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3876 td->free_struct = asn_DEF_Identifier.free_struct;
3877 td->print_struct = asn_DEF_Identifier.print_struct;
3878 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
3879 td->der_encoder = asn_DEF_Identifier.der_encoder;
3880 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
3881 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
3882 td->uper_decoder = asn_DEF_Identifier.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003883 td->uper_encoder = asn_DEF_Identifier.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003884 if(!td->per_constraints)
3885 td->per_constraints = asn_DEF_Identifier.per_constraints;
3886 td->elements = asn_DEF_Identifier.elements;
3887 td->elements_count = asn_DEF_Identifier.elements_count;
3888 td->specifics = asn_DEF_Identifier.specifics;
3889}
3890
3891void
3892VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
3893 void *struct_ptr, int contents_only) {
3894 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3895 td->free_struct(td, struct_ptr, contents_only);
3896}
3897
3898int
3899VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3900 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3901 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3902 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3903}
3904
3905asn_dec_rval_t
3906VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3907 void **structure, const void *bufptr, size_t size, int tag_mode) {
3908 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3909 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3910}
3911
3912asn_enc_rval_t
3913VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
3914 void *structure, int tag_mode, ber_tlv_tag_t tag,
3915 asn_app_consume_bytes_f *cb, void *app_key) {
3916 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3917 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3918}
3919
3920asn_dec_rval_t
3921VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3922 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3923 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3924 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3925}
3926
3927asn_enc_rval_t
3928VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3929 int ilevel, enum xer_encoder_flags_e flags,
3930 asn_app_consume_bytes_f *cb, void *app_key) {
3931 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3932 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3933}
3934
3935asn_dec_rval_t
3936VisibleIdentifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3937 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3938 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3939 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3940}
3941
vlmb1b193e2006-08-18 01:46:46 +00003942asn_enc_rval_t
3943VisibleIdentifier_encode_uper(asn_TYPE_descriptor_t *td,
3944 asn_per_constraints_t *constraints,
3945 void *structure, asn_per_outp_t *per_out) {
3946 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3947 return td->uper_encoder(td, constraints, structure, per_out);
3948}
3949
vlm337167e2005-11-26 11:25:14 +00003950
3951/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
3952
3953static ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
3954 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
3955};
3956asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
3957 "VisibleIdentifier",
3958 "VisibleIdentifier",
3959 VisibleIdentifier_free,
3960 VisibleIdentifier_print,
3961 VisibleIdentifier_constraint,
3962 VisibleIdentifier_decode_ber,
3963 VisibleIdentifier_encode_der,
3964 VisibleIdentifier_decode_xer,
3965 VisibleIdentifier_encode_xer,
3966 VisibleIdentifier_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003967 VisibleIdentifier_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003968 0, /* Use generic outmost tag fetcher */
3969 asn_DEF_VisibleIdentifier_tags_1,
3970 sizeof(asn_DEF_VisibleIdentifier_tags_1)
3971 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
3972 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
3973 sizeof(asn_DEF_VisibleIdentifier_tags_1)
3974 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
3975 0, /* No PER visible constraints */
3976 0, 0, /* No members */
3977 0 /* No specifics */
3978};
3979
3980
3981/*** <<< INCLUDES [Sequence] >>> ***/
3982
3983#include <Int1.h>
3984#include <Int4.h>
3985#include <BOOLEAN.h>
3986#include <ENUMERATED.h>
3987#include <NULL.h>
3988#include <Int5.h>
3989#include <constr_SEQUENCE.h>
3990
3991/*** <<< DEPS [Sequence] >>> ***/
3992
3993typedef enum enum_c {
3994 enum_c_one = 1,
3995 enum_c_two = 2,
3996 /*
3997 * Enumeration is extensible
3998 */
3999 enum_c_three = 3
vlm7c8aa5e2006-03-21 07:25:18 +00004000} e_enum_c;
vlm337167e2005-11-26 11:25:14 +00004001
4002/*** <<< TYPE-DECLS [Sequence] >>> ***/
4003
4004typedef struct Sequence {
4005 Int1_t *int1_c /* DEFAULT 3 */;
4006 Int4_t int4;
4007 Int4_t int4_c;
4008 BOOLEAN_t *bool /* DEFAULT 1 */;
4009 ENUMERATED_t enum_c;
4010 NULL_t *null /* OPTIONAL */;
4011 /*
4012 * This type is extensible,
4013 * possible extensions are below.
4014 */
4015 Int5_t *int5_c /* OPTIONAL */;
4016
4017 /* Context for parsing across buffer boundaries */
4018 asn_struct_ctx_t _asn_ctx;
4019} Sequence_t;
4020
4021/*** <<< FUNC-DECLS [Sequence] >>> ***/
4022
4023/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
4024extern asn_TYPE_descriptor_t asn_DEF_Sequence;
4025
4026/*** <<< CODE [Sequence] >>> ***/
4027
4028static int
4029enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004030 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004031 /* Replace with underlying type checker */
4032 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +00004033 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm337167e2005-11-26 11:25:14 +00004034}
4035
4036/*
4037 * This type is implemented using ENUMERATED,
4038 * so here we adjust the DEF accordingly.
4039 */
4040static void
4041enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4042 td->free_struct = asn_DEF_ENUMERATED.free_struct;
4043 td->print_struct = asn_DEF_ENUMERATED.print_struct;
4044 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
4045 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
4046 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
4047 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
4048 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00004049 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00004050 if(!td->per_constraints)
4051 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
4052 td->elements = asn_DEF_ENUMERATED.elements;
4053 td->elements_count = asn_DEF_ENUMERATED.elements_count;
4054 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
4055}
4056
4057static void
4058enum_c_6_free(asn_TYPE_descriptor_t *td,
4059 void *struct_ptr, int contents_only) {
4060 enum_c_6_inherit_TYPE_descriptor(td);
4061 td->free_struct(td, struct_ptr, contents_only);
4062}
4063
4064static int
4065enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4066 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4067 enum_c_6_inherit_TYPE_descriptor(td);
4068 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4069}
4070
4071static asn_dec_rval_t
4072enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4073 void **structure, const void *bufptr, size_t size, int tag_mode) {
4074 enum_c_6_inherit_TYPE_descriptor(td);
4075 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4076}
4077
4078static asn_enc_rval_t
4079enum_c_6_encode_der(asn_TYPE_descriptor_t *td,
4080 void *structure, int tag_mode, ber_tlv_tag_t tag,
4081 asn_app_consume_bytes_f *cb, void *app_key) {
4082 enum_c_6_inherit_TYPE_descriptor(td);
4083 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4084}
4085
4086static asn_dec_rval_t
4087enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4088 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4089 enum_c_6_inherit_TYPE_descriptor(td);
4090 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4091}
4092
4093static asn_enc_rval_t
4094enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4095 int ilevel, enum xer_encoder_flags_e flags,
4096 asn_app_consume_bytes_f *cb, void *app_key) {
4097 enum_c_6_inherit_TYPE_descriptor(td);
4098 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4099}
4100
4101static asn_dec_rval_t
4102enum_c_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4103 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4104 enum_c_6_inherit_TYPE_descriptor(td);
4105 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4106}
4107
vlmb1b193e2006-08-18 01:46:46 +00004108static asn_enc_rval_t
4109enum_c_6_encode_uper(asn_TYPE_descriptor_t *td,
4110 asn_per_constraints_t *constraints,
4111 void *structure, asn_per_outp_t *per_out) {
4112 enum_c_6_inherit_TYPE_descriptor(td);
4113 return td->uper_encoder(td, constraints, structure, per_out);
4114}
4115
vlm337167e2005-11-26 11:25:14 +00004116static int
4117memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004118 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004119 const Int1_t *st = (const Int1_t *)sptr;
4120 long value;
4121
4122 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00004123 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004124 "%s: value not given (%s:%d)",
4125 td->name, __FILE__, __LINE__);
4126 return -1;
4127 }
4128
4129 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +00004130 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004131 "%s: value too large (%s:%d)",
4132 td->name, __FILE__, __LINE__);
4133 return -1;
4134 }
4135
4136 if((value >= -2)) {
4137 /* Constraint check succeeded */
4138 return 0;
4139 } else {
vlmd4ae41c2006-07-13 13:28:32 +00004140 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004141 "%s: constraint failed (%s:%d)",
4142 td->name, __FILE__, __LINE__);
4143 return -1;
4144 }
4145}
4146
4147static int
4148memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004149 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004150 const Int4_t *st = (const Int4_t *)sptr;
4151 long value;
4152
4153 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00004154 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004155 "%s: value not given (%s:%d)",
4156 td->name, __FILE__, __LINE__);
4157 return -1;
4158 }
4159
4160 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +00004161 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004162 "%s: value too large (%s:%d)",
4163 td->name, __FILE__, __LINE__);
4164 return -1;
4165 }
4166
4167 if((value >= 5 && value <= 7)) {
4168 /* Constraint check succeeded */
4169 return 0;
4170 } else {
vlmd4ae41c2006-07-13 13:28:32 +00004171 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004172 "%s: constraint failed (%s:%d)",
4173 td->name, __FILE__, __LINE__);
4174 return -1;
4175 }
4176}
4177
4178static int
4179memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004180 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004181 const Int5_t *st = (const Int5_t *)sptr;
4182 long value;
4183
4184 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00004185 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004186 "%s: value not given (%s:%d)",
4187 td->name, __FILE__, __LINE__);
4188 return -1;
4189 }
4190
4191 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +00004192 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004193 "%s: value too large (%s:%d)",
4194 td->name, __FILE__, __LINE__);
4195 return -1;
4196 }
4197
4198 if((value == 5)) {
4199 /* Constraint check succeeded */
4200 return 0;
4201 } else {
vlmd4ae41c2006-07-13 13:28:32 +00004202 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004203 "%s: constraint failed (%s:%d)",
4204 td->name, __FILE__, __LINE__);
4205 return -1;
4206 }
4207}
4208
4209
4210/*** <<< STAT-DEFS [Sequence] >>> ***/
4211
vlmb1b193e2006-08-18 01:46:46 +00004212static int asn_DFL_2_set_3(int set_value, void **sptr) {
vlm337167e2005-11-26 11:25:14 +00004213 Int1_t *st = *sptr;
4214
4215 if(!st) {
vlmb1b193e2006-08-18 01:46:46 +00004216 if(!set_value) return -1; /* Not a default value */
vlm337167e2005-11-26 11:25:14 +00004217 st = (*sptr = CALLOC(1, sizeof(*st)));
4218 if(!st) return -1;
4219 }
4220
vlmb1b193e2006-08-18 01:46:46 +00004221 if(set_value) {
4222 /* Install default value 3 */
4223 return asn_long2INTEGER(st, 3);
4224 } else {
4225 /* Test default value 3 */
4226 long value;
4227 if(asn_INTEGER2long(st, &value))
4228 return -1;
4229 return (value == 3);
4230 }
vlm337167e2005-11-26 11:25:14 +00004231}
vlmb1b193e2006-08-18 01:46:46 +00004232static int asn_DFL_5_set_1(int set_value, void **sptr) {
vlm337167e2005-11-26 11:25:14 +00004233 BOOLEAN_t *st = *sptr;
4234
4235 if(!st) {
vlmb1b193e2006-08-18 01:46:46 +00004236 if(!set_value) return -1; /* Not a default value */
vlm337167e2005-11-26 11:25:14 +00004237 st = (*sptr = CALLOC(1, sizeof(*st)));
4238 if(!st) return -1;
4239 }
4240
vlmb1b193e2006-08-18 01:46:46 +00004241 if(set_value) {
4242 /* Install default value 1 */
4243 *st = 1;
4244 return 0;
4245 } else {
4246 /* Test default value 1 */
4247 return (*st == 1);
4248 }
vlm337167e2005-11-26 11:25:14 +00004249}
4250static asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
4251 { 1, 3, "one" },
4252 { 2, 3, "two" },
4253 { 3, 5, "three" }
4254 /* This list is extensible */
4255};
4256static unsigned int asn_MAP_enum_c_enum2value_6[] = {
4257 0, /* one(1) */
4258 2, /* three(3) */
4259 1 /* two(2) */
4260 /* This list is extensible */
4261};
4262static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
4263 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
4264 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
4265 3, /* Number of elements in the maps */
4266 3, /* Extensions before this member */
4267 1 /* Strict enumeration */
4268};
4269static ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
4270 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4271};
4272static asn_per_constraints_t asn_PER_enum_c_constr_6 = {
4273 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
4274 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4275};
4276static /* Use -fall-defs-global to expose */
4277asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
4278 "enum-c",
4279 "enum-c",
4280 enum_c_6_free,
4281 enum_c_6_print,
4282 enum_c_6_constraint,
4283 enum_c_6_decode_ber,
4284 enum_c_6_encode_der,
4285 enum_c_6_decode_xer,
4286 enum_c_6_encode_xer,
4287 enum_c_6_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004288 enum_c_6_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004289 0, /* Use generic outmost tag fetcher */
4290 asn_DEF_enum_c_tags_6,
4291 sizeof(asn_DEF_enum_c_tags_6)
4292 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
4293 asn_DEF_enum_c_tags_6, /* Same as above */
4294 sizeof(asn_DEF_enum_c_tags_6)
4295 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
4296 &asn_PER_enum_c_constr_6,
4297 0, 0, /* Defined elsewhere */
4298 &asn_SPC_enum_c_specs_6 /* Additional specs */
4299};
4300
4301static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 = {
4302 { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
4303 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4304};
4305static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 = {
4306 { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
4307 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4308};
4309static asn_per_constraints_t asn_PER_memb_enum_c_constr_6 = {
4310 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
4311 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4312};
4313static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 = {
4314 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
4315 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4316};
4317static asn_TYPE_member_t asn_MBR_Sequence_1[] = {
4318 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
4319 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4320 .tag_mode = 0,
4321 .type = &asn_DEF_Int1,
4322 .memb_constraints = memb_int1_c_constraint_1,
4323 .per_constraints = &asn_PER_memb_int1_c_constr_2,
4324 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
4325 .name = "int1-c"
4326 },
4327 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
4328 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
4329 .tag_mode = +1, /* EXPLICIT tag at current level */
4330 .type = &asn_DEF_Int4,
4331 .memb_constraints = 0, /* Defer constraints checking to the member type */
4332 .per_constraints = 0, /* No PER visible constraints */
4333 .default_value = 0,
4334 .name = "int4"
4335 },
4336 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
4337 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4338 .tag_mode = 0,
4339 .type = &asn_DEF_Int4,
4340 .memb_constraints = memb_int4_c_constraint_1,
4341 .per_constraints = &asn_PER_memb_int4_c_constr_4,
4342 .default_value = 0,
4343 .name = "int4-c"
4344 },
4345 { ATF_POINTER, 1, offsetof(struct Sequence, bool),
4346 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
4347 .tag_mode = 0,
4348 .type = &asn_DEF_BOOLEAN,
4349 .memb_constraints = 0, /* Defer constraints checking to the member type */
4350 .per_constraints = 0, /* No PER visible constraints */
4351 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
4352 .name = "bool"
4353 },
4354 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
4355 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
4356 .tag_mode = 0,
4357 .type = &asn_DEF_enum_c_6,
4358 .memb_constraints = 0, /* Defer constraints checking to the member type */
4359 .per_constraints = &asn_PER_memb_enum_c_constr_6,
4360 .default_value = 0,
4361 .name = "enum-c"
4362 },
4363 { ATF_POINTER, 2, offsetof(struct Sequence, null),
4364 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
4365 .tag_mode = 0,
4366 .type = &asn_DEF_NULL,
4367 .memb_constraints = 0, /* Defer constraints checking to the member type */
4368 .per_constraints = 0, /* No PER visible constraints */
4369 .default_value = 0,
4370 .name = "null"
4371 },
4372 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
4373 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4374 .tag_mode = 0,
4375 .type = &asn_DEF_Int5,
4376 .memb_constraints = memb_int5_c_constraint_1,
4377 .per_constraints = &asn_PER_memb_int5_c_constr_13,
4378 .default_value = 0,
4379 .name = "int5-c"
4380 },
4381};
4382static int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
4383static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
4384 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4385};
4386static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
4387 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool at 59 */
4388 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c at 56 */
4389 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c at 58 */
4390 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c at 62 */
4391 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null at 64 */
4392 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c at 60 */
4393 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 at 57 */
4394};
4395static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
4396 sizeof(struct Sequence),
4397 offsetof(struct Sequence, _asn_ctx),
4398 asn_MAP_Sequence_tag2el_1,
4399 7, /* Count of tags in the map */
4400 asn_MAP_Sequence_oms_1, /* Optional members */
4401 3, 1, /* Root/Additions */
4402 5, /* Start extensions */
4403 8 /* Stop extensions */
4404};
4405asn_TYPE_descriptor_t asn_DEF_Sequence = {
4406 "Sequence",
4407 "Sequence",
4408 SEQUENCE_free,
4409 SEQUENCE_print,
4410 SEQUENCE_constraint,
4411 SEQUENCE_decode_ber,
4412 SEQUENCE_encode_der,
4413 SEQUENCE_decode_xer,
4414 SEQUENCE_encode_xer,
4415 SEQUENCE_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004416 SEQUENCE_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004417 0, /* Use generic outmost tag fetcher */
4418 asn_DEF_Sequence_tags_1,
4419 sizeof(asn_DEF_Sequence_tags_1)
4420 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4421 asn_DEF_Sequence_tags_1, /* Same as above */
4422 sizeof(asn_DEF_Sequence_tags_1)
4423 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4424 0, /* No PER visible constraints */
4425 asn_MBR_Sequence_1,
4426 7, /* Elements count */
4427 &asn_SPC_Sequence_specs_1 /* Additional specs */
4428};
4429
4430
4431/*** <<< INCLUDES [SequenceOf] >>> ***/
4432
4433#include <asn_SEQUENCE_OF.h>
4434#include <constr_SEQUENCE_OF.h>
4435
4436/*** <<< FWD-DECLS [SequenceOf] >>> ***/
4437
4438struct Sequence;
4439
4440/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
4441
4442typedef struct SequenceOf {
4443 A_SEQUENCE_OF(struct Sequence) list;
4444
4445 /* Context for parsing across buffer boundaries */
4446 asn_struct_ctx_t _asn_ctx;
4447} SequenceOf_t;
4448
4449/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
4450
4451extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
4452
4453/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
4454
4455#include <Sequence.h>
4456
4457/*** <<< STAT-DEFS [SequenceOf] >>> ***/
4458
4459static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
4460 { ATF_POINTER, 0, 0,
4461 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
4462 .tag_mode = 0,
4463 .type = &asn_DEF_Sequence,
4464 .memb_constraints = 0, /* Defer constraints checking to the member type */
4465 .per_constraints = 0, /* No PER visible constraints */
4466 .default_value = 0,
4467 .name = ""
4468 },
4469};
4470static ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
4471 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4472};
4473static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
4474 sizeof(struct SequenceOf),
4475 offsetof(struct SequenceOf, _asn_ctx),
4476 0, /* XER encoding is XMLDelimitedItemList */
4477};
4478static asn_per_constraints_t asn_PER_SequenceOf_constr_1 = {
4479 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4480 { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */
4481};
4482asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
4483 "SequenceOf",
4484 "SequenceOf",
4485 SEQUENCE_OF_free,
4486 SEQUENCE_OF_print,
4487 SEQUENCE_OF_constraint,
4488 SEQUENCE_OF_decode_ber,
4489 SEQUENCE_OF_encode_der,
4490 SEQUENCE_OF_decode_xer,
4491 SEQUENCE_OF_encode_xer,
4492 SEQUENCE_OF_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004493 SEQUENCE_OF_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004494 0, /* Use generic outmost tag fetcher */
4495 asn_DEF_SequenceOf_tags_1,
4496 sizeof(asn_DEF_SequenceOf_tags_1)
4497 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4498 asn_DEF_SequenceOf_tags_1, /* Same as above */
4499 sizeof(asn_DEF_SequenceOf_tags_1)
4500 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4501 &asn_PER_SequenceOf_constr_1,
4502 asn_MBR_SequenceOf_1,
4503 1, /* Single element */
4504 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
4505};
4506
4507
4508/*** <<< INCLUDES [Enum0] >>> ***/
4509
4510#include <ENUMERATED.h>
4511
4512/*** <<< DEPS [Enum0] >>> ***/
4513
4514typedef enum Enum0 {
4515 Enum0_one = 0,
4516 Enum0_two = 1
vlm7c8aa5e2006-03-21 07:25:18 +00004517} e_Enum0;
vlm337167e2005-11-26 11:25:14 +00004518
4519/*** <<< TYPE-DECLS [Enum0] >>> ***/
4520
4521typedef ENUMERATED_t Enum0_t;
4522
4523/*** <<< FUNC-DECLS [Enum0] >>> ***/
4524
4525extern asn_TYPE_descriptor_t asn_DEF_Enum0;
4526asn_struct_free_f Enum0_free;
4527asn_struct_print_f Enum0_print;
4528asn_constr_check_f Enum0_constraint;
4529ber_type_decoder_f Enum0_decode_ber;
4530der_type_encoder_f Enum0_encode_der;
4531xer_type_decoder_f Enum0_decode_xer;
4532xer_type_encoder_f Enum0_encode_xer;
4533per_type_decoder_f Enum0_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00004534per_type_encoder_f Enum0_encode_uper;
vlm337167e2005-11-26 11:25:14 +00004535
4536/*** <<< CODE [Enum0] >>> ***/
4537
4538int
4539Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004540 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004541 /* Replace with underlying type checker */
4542 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +00004543 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm337167e2005-11-26 11:25:14 +00004544}
4545
4546/*
4547 * This type is implemented using ENUMERATED,
4548 * so here we adjust the DEF accordingly.
4549 */
4550static void
4551Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4552 td->free_struct = asn_DEF_ENUMERATED.free_struct;
4553 td->print_struct = asn_DEF_ENUMERATED.print_struct;
4554 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
4555 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
4556 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
4557 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
4558 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00004559 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00004560 if(!td->per_constraints)
4561 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
4562 td->elements = asn_DEF_ENUMERATED.elements;
4563 td->elements_count = asn_DEF_ENUMERATED.elements_count;
4564 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
4565}
4566
4567void
4568Enum0_free(asn_TYPE_descriptor_t *td,
4569 void *struct_ptr, int contents_only) {
4570 Enum0_1_inherit_TYPE_descriptor(td);
4571 td->free_struct(td, struct_ptr, contents_only);
4572}
4573
4574int
4575Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4576 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4577 Enum0_1_inherit_TYPE_descriptor(td);
4578 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4579}
4580
4581asn_dec_rval_t
4582Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4583 void **structure, const void *bufptr, size_t size, int tag_mode) {
4584 Enum0_1_inherit_TYPE_descriptor(td);
4585 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4586}
4587
4588asn_enc_rval_t
4589Enum0_encode_der(asn_TYPE_descriptor_t *td,
4590 void *structure, int tag_mode, ber_tlv_tag_t tag,
4591 asn_app_consume_bytes_f *cb, void *app_key) {
4592 Enum0_1_inherit_TYPE_descriptor(td);
4593 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4594}
4595
4596asn_dec_rval_t
4597Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4598 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4599 Enum0_1_inherit_TYPE_descriptor(td);
4600 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4601}
4602
4603asn_enc_rval_t
4604Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4605 int ilevel, enum xer_encoder_flags_e flags,
4606 asn_app_consume_bytes_f *cb, void *app_key) {
4607 Enum0_1_inherit_TYPE_descriptor(td);
4608 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4609}
4610
4611asn_dec_rval_t
4612Enum0_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4613 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4614 Enum0_1_inherit_TYPE_descriptor(td);
4615 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4616}
4617
vlmb1b193e2006-08-18 01:46:46 +00004618asn_enc_rval_t
4619Enum0_encode_uper(asn_TYPE_descriptor_t *td,
4620 asn_per_constraints_t *constraints,
4621 void *structure, asn_per_outp_t *per_out) {
4622 Enum0_1_inherit_TYPE_descriptor(td);
4623 return td->uper_encoder(td, constraints, structure, per_out);
4624}
4625
vlm337167e2005-11-26 11:25:14 +00004626
4627/*** <<< STAT-DEFS [Enum0] >>> ***/
4628
4629static asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
4630 { 0, 3, "one" },
4631 { 1, 3, "two" }
4632};
4633static unsigned int asn_MAP_Enum0_enum2value_1[] = {
4634 0, /* one(0) */
4635 1 /* two(1) */
4636};
4637static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
4638 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
4639 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
4640 2, /* Number of elements in the maps */
4641 0, /* Enumeration is not extensible */
4642 1 /* Strict enumeration */
4643};
4644static ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
4645 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4646};
4647static asn_per_constraints_t asn_PER_Enum0_constr_1 = {
4648 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4649 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4650};
4651asn_TYPE_descriptor_t asn_DEF_Enum0 = {
4652 "Enum0",
4653 "Enum0",
4654 Enum0_free,
4655 Enum0_print,
4656 Enum0_constraint,
4657 Enum0_decode_ber,
4658 Enum0_encode_der,
4659 Enum0_decode_xer,
4660 Enum0_encode_xer,
4661 Enum0_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004662 Enum0_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004663 0, /* Use generic outmost tag fetcher */
4664 asn_DEF_Enum0_tags_1,
4665 sizeof(asn_DEF_Enum0_tags_1)
4666 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4667 asn_DEF_Enum0_tags_1, /* Same as above */
4668 sizeof(asn_DEF_Enum0_tags_1)
4669 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4670 &asn_PER_Enum0_constr_1,
4671 0, 0, /* Defined elsewhere */
4672 &asn_SPC_Enum0_specs_1 /* Additional specs */
4673};
4674
4675
4676/*** <<< INCLUDES [Enum1] >>> ***/
4677
4678#include <NativeEnumerated.h>
4679
4680/*** <<< DEPS [Enum1] >>> ***/
4681
4682typedef enum Enum1 {
4683 Enum1_one = 0,
4684 Enum1_two = 1
vlm7c8aa5e2006-03-21 07:25:18 +00004685} e_Enum1;
vlm337167e2005-11-26 11:25:14 +00004686
4687/*** <<< TYPE-DECLS [Enum1] >>> ***/
4688
4689typedef long Enum1_t;
4690
4691/*** <<< FUNC-DECLS [Enum1] >>> ***/
4692
4693extern asn_TYPE_descriptor_t asn_DEF_Enum1;
4694asn_struct_free_f Enum1_free;
4695asn_struct_print_f Enum1_print;
4696asn_constr_check_f Enum1_constraint;
4697ber_type_decoder_f Enum1_decode_ber;
4698der_type_encoder_f Enum1_encode_der;
4699xer_type_decoder_f Enum1_decode_xer;
4700xer_type_encoder_f Enum1_encode_xer;
4701per_type_decoder_f Enum1_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00004702per_type_encoder_f Enum1_encode_uper;
vlm337167e2005-11-26 11:25:14 +00004703
4704/*** <<< CODE [Enum1] >>> ***/
4705
4706int
4707Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004708 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004709 long value;
4710
4711 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00004712 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004713 "%s: value not given (%s:%d)",
4714 td->name, __FILE__, __LINE__);
4715 return -1;
4716 }
4717
4718 value = *(const long *)sptr;
4719
4720 if((value == 0)) {
4721 /* Constraint check succeeded */
4722 return 0;
4723 } else {
vlmd4ae41c2006-07-13 13:28:32 +00004724 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004725 "%s: constraint failed (%s:%d)",
4726 td->name, __FILE__, __LINE__);
4727 return -1;
4728 }
4729}
4730
4731/*
4732 * This type is implemented using NativeEnumerated,
4733 * so here we adjust the DEF accordingly.
4734 */
4735static void
4736Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4737 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4738 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
4739 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4740 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4741 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4742 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4743 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00004744 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00004745 if(!td->per_constraints)
4746 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4747 td->elements = asn_DEF_NativeEnumerated.elements;
4748 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4749 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
4750}
4751
4752void
4753Enum1_free(asn_TYPE_descriptor_t *td,
4754 void *struct_ptr, int contents_only) {
4755 Enum1_1_inherit_TYPE_descriptor(td);
4756 td->free_struct(td, struct_ptr, contents_only);
4757}
4758
4759int
4760Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4761 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4762 Enum1_1_inherit_TYPE_descriptor(td);
4763 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4764}
4765
4766asn_dec_rval_t
4767Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4768 void **structure, const void *bufptr, size_t size, int tag_mode) {
4769 Enum1_1_inherit_TYPE_descriptor(td);
4770 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4771}
4772
4773asn_enc_rval_t
4774Enum1_encode_der(asn_TYPE_descriptor_t *td,
4775 void *structure, int tag_mode, ber_tlv_tag_t tag,
4776 asn_app_consume_bytes_f *cb, void *app_key) {
4777 Enum1_1_inherit_TYPE_descriptor(td);
4778 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4779}
4780
4781asn_dec_rval_t
4782Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4783 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4784 Enum1_1_inherit_TYPE_descriptor(td);
4785 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4786}
4787
4788asn_enc_rval_t
4789Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4790 int ilevel, enum xer_encoder_flags_e flags,
4791 asn_app_consume_bytes_f *cb, void *app_key) {
4792 Enum1_1_inherit_TYPE_descriptor(td);
4793 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4794}
4795
4796asn_dec_rval_t
4797Enum1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4798 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4799 Enum1_1_inherit_TYPE_descriptor(td);
4800 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4801}
4802
vlmb1b193e2006-08-18 01:46:46 +00004803asn_enc_rval_t
4804Enum1_encode_uper(asn_TYPE_descriptor_t *td,
4805 asn_per_constraints_t *constraints,
4806 void *structure, asn_per_outp_t *per_out) {
4807 Enum1_1_inherit_TYPE_descriptor(td);
4808 return td->uper_encoder(td, constraints, structure, per_out);
4809}
4810
vlm337167e2005-11-26 11:25:14 +00004811
4812/*** <<< STAT-DEFS [Enum1] >>> ***/
4813
4814static asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
4815 { 0, 3, "one" },
4816 { 1, 3, "two" }
4817};
4818static unsigned int asn_MAP_Enum1_enum2value_1[] = {
4819 0, /* one(0) */
4820 1 /* two(1) */
4821};
4822static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
4823 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
4824 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
4825 2, /* Number of elements in the maps */
4826 0, /* Enumeration is not extensible */
4827 1 /* Strict enumeration */
4828};
4829static ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
4830 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4831};
4832static asn_per_constraints_t asn_PER_Enum1_constr_1 = {
4833 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4834 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4835};
4836asn_TYPE_descriptor_t asn_DEF_Enum1 = {
4837 "Enum1",
4838 "Enum1",
4839 Enum1_free,
4840 Enum1_print,
4841 Enum1_constraint,
4842 Enum1_decode_ber,
4843 Enum1_encode_der,
4844 Enum1_decode_xer,
4845 Enum1_encode_xer,
4846 Enum1_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004847 Enum1_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004848 0, /* Use generic outmost tag fetcher */
4849 asn_DEF_Enum1_tags_1,
4850 sizeof(asn_DEF_Enum1_tags_1)
4851 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4852 asn_DEF_Enum1_tags_1, /* Same as above */
4853 sizeof(asn_DEF_Enum1_tags_1)
4854 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4855 &asn_PER_Enum1_constr_1,
4856 0, 0, /* Defined elsewhere */
4857 &asn_SPC_Enum1_specs_1 /* Additional specs */
4858};
4859
4860
4861/*** <<< INCLUDES [Identifier] >>> ***/
4862
4863#include <VisibleString.h>
4864
4865/*** <<< TYPE-DECLS [Identifier] >>> ***/
4866
4867typedef VisibleString_t Identifier_t;
4868
4869/*** <<< FUNC-DECLS [Identifier] >>> ***/
4870
4871extern asn_TYPE_descriptor_t asn_DEF_Identifier;
4872asn_struct_free_f Identifier_free;
4873asn_struct_print_f Identifier_print;
4874asn_constr_check_f Identifier_constraint;
4875ber_type_decoder_f Identifier_decode_ber;
4876der_type_encoder_f Identifier_encode_der;
4877xer_type_decoder_f Identifier_decode_xer;
4878xer_type_encoder_f Identifier_encode_xer;
4879per_type_decoder_f Identifier_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00004880per_type_encoder_f Identifier_encode_uper;
vlm337167e2005-11-26 11:25:14 +00004881
4882/*** <<< CTABLES [Identifier] >>> ***/
4883
4884static int permitted_alphabet_table_1[256] = {
48850,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
48860,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
48870,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, /* $ */
48881,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, /* 0123456789 */
48890,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ABCDEFGHIJKLMNO */
48901,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, /* PQRSTUVWXYZ _ */
48910,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* abcdefghijklmno */
48921,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz */
4893};
4894
4895static int check_permitted_alphabet_1(const void *sptr) {
4896 int *table = permitted_alphabet_table_1;
4897 /* The underlying type is VisibleString */
4898 const VisibleString_t *st = (const VisibleString_t *)sptr;
4899 const uint8_t *ch = st->buf;
4900 const uint8_t *end = ch + st->size;
4901
4902 for(; ch < end; ch++) {
4903 uint8_t cv = *ch;
4904 if(!table[cv]) return -1;
4905 }
4906 return 0;
4907}
4908
4909
4910/*** <<< CODE [Identifier] >>> ***/
4911
4912int
4913Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004914 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004915 const VisibleString_t *st = (const VisibleString_t *)sptr;
4916 size_t size;
4917
4918 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00004919 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004920 "%s: value not given (%s:%d)",
4921 td->name, __FILE__, __LINE__);
4922 return -1;
4923 }
4924
4925 size = st->size;
4926
4927 if((size >= 1 && size <= 32)
4928 && !check_permitted_alphabet_1(st)) {
4929 /* Constraint check succeeded */
4930 return 0;
4931 } else {
vlmd4ae41c2006-07-13 13:28:32 +00004932 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004933 "%s: constraint failed (%s:%d)",
4934 td->name, __FILE__, __LINE__);
4935 return -1;
4936 }
4937}
4938
4939/*
4940 * This type is implemented using VisibleString,
4941 * so here we adjust the DEF accordingly.
4942 */
4943static void
4944Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4945 td->free_struct = asn_DEF_VisibleString.free_struct;
4946 td->print_struct = asn_DEF_VisibleString.print_struct;
4947 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
4948 td->der_encoder = asn_DEF_VisibleString.der_encoder;
4949 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
4950 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
4951 td->uper_decoder = asn_DEF_VisibleString.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00004952 td->uper_encoder = asn_DEF_VisibleString.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00004953 if(!td->per_constraints)
4954 td->per_constraints = asn_DEF_VisibleString.per_constraints;
4955 td->elements = asn_DEF_VisibleString.elements;
4956 td->elements_count = asn_DEF_VisibleString.elements_count;
4957 td->specifics = asn_DEF_VisibleString.specifics;
4958}
4959
4960void
4961Identifier_free(asn_TYPE_descriptor_t *td,
4962 void *struct_ptr, int contents_only) {
4963 Identifier_1_inherit_TYPE_descriptor(td);
4964 td->free_struct(td, struct_ptr, contents_only);
4965}
4966
4967int
4968Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4969 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4970 Identifier_1_inherit_TYPE_descriptor(td);
4971 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4972}
4973
4974asn_dec_rval_t
4975Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4976 void **structure, const void *bufptr, size_t size, int tag_mode) {
4977 Identifier_1_inherit_TYPE_descriptor(td);
4978 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4979}
4980
4981asn_enc_rval_t
4982Identifier_encode_der(asn_TYPE_descriptor_t *td,
4983 void *structure, int tag_mode, ber_tlv_tag_t tag,
4984 asn_app_consume_bytes_f *cb, void *app_key) {
4985 Identifier_1_inherit_TYPE_descriptor(td);
4986 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4987}
4988
4989asn_dec_rval_t
4990Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4991 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4992 Identifier_1_inherit_TYPE_descriptor(td);
4993 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4994}
4995
4996asn_enc_rval_t
4997Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4998 int ilevel, enum xer_encoder_flags_e flags,
4999 asn_app_consume_bytes_f *cb, void *app_key) {
5000 Identifier_1_inherit_TYPE_descriptor(td);
5001 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
5002}
5003
5004asn_dec_rval_t
5005Identifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5006 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
5007 Identifier_1_inherit_TYPE_descriptor(td);
5008 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
5009}
5010
vlmb1b193e2006-08-18 01:46:46 +00005011asn_enc_rval_t
5012Identifier_encode_uper(asn_TYPE_descriptor_t *td,
5013 asn_per_constraints_t *constraints,
5014 void *structure, asn_per_outp_t *per_out) {
5015 Identifier_1_inherit_TYPE_descriptor(td);
5016 return td->uper_encoder(td, constraints, structure, per_out);
5017}
5018
vlm337167e2005-11-26 11:25:14 +00005019
5020/*** <<< STAT-DEFS [Identifier] >>> ***/
5021
5022static ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
5023 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
5024};
5025static asn_per_constraints_t asn_PER_Identifier_constr_1 = {
5026 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
5027 { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */
5028};
5029asn_TYPE_descriptor_t asn_DEF_Identifier = {
5030 "Identifier",
5031 "Identifier",
5032 Identifier_free,
5033 Identifier_print,
5034 Identifier_constraint,
5035 Identifier_decode_ber,
5036 Identifier_encode_der,
5037 Identifier_decode_xer,
5038 Identifier_encode_xer,
5039 Identifier_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00005040 Identifier_encode_uper,
vlm337167e2005-11-26 11:25:14 +00005041 0, /* Use generic outmost tag fetcher */
5042 asn_DEF_Identifier_tags_1,
5043 sizeof(asn_DEF_Identifier_tags_1)
5044 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
5045 asn_DEF_Identifier_tags_1, /* Same as above */
5046 sizeof(asn_DEF_Identifier_tags_1)
5047 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
5048 &asn_PER_Identifier_constr_1,
5049 0, 0, /* No members */
5050 0 /* No specifics */
5051};
5052