blob: 4a95914273774288b72025e85294f6eaa61eef07 [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
vlmea226772006-09-13 02:51:20 +0000146#include "Int1.h"
vlm337167e2005-11-26 11:25:14 +0000147
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
vlm86380d32006-10-09 12:07:58 +0000275/*** <<< CTDEFS [Int2] >>> ***/
276
vlma0da1a32006-10-09 12:27:44 +0000277static asn_per_constraints_t asn_PER_type_Int2_constr_1 = {
vlm86380d32006-10-09 12:07:58 +0000278 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
279 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
280 0, 0 /* No PER value map */
281};
282
vlm337167e2005-11-26 11:25:14 +0000283/*** <<< STAT-DEFS [Int2] >>> ***/
284
285static ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
286 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
287};
vlm337167e2005-11-26 11:25:14 +0000288asn_TYPE_descriptor_t asn_DEF_Int2 = {
289 "Int2",
290 "Int2",
291 Int2_free,
292 Int2_print,
293 Int2_constraint,
294 Int2_decode_ber,
295 Int2_encode_der,
296 Int2_decode_xer,
297 Int2_encode_xer,
298 Int2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000299 Int2_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000300 0, /* Use generic outmost tag fetcher */
301 asn_DEF_Int2_tags_1,
302 sizeof(asn_DEF_Int2_tags_1)
303 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
304 asn_DEF_Int2_tags_1, /* Same as above */
305 sizeof(asn_DEF_Int2_tags_1)
306 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +0000307 &asn_PER_type_Int2_constr_1,
vlm337167e2005-11-26 11:25:14 +0000308 0, 0, /* No members */
309 0 /* No specifics */
310};
311
312
313/*** <<< INCLUDES [Int3] >>> ***/
314
vlmea226772006-09-13 02:51:20 +0000315#include "Int2.h"
vlm337167e2005-11-26 11:25:14 +0000316
317/*** <<< TYPE-DECLS [Int3] >>> ***/
318
319typedef Int2_t Int3_t;
320
321/*** <<< FUNC-DECLS [Int3] >>> ***/
322
323extern asn_TYPE_descriptor_t asn_DEF_Int3;
324asn_struct_free_f Int3_free;
325asn_struct_print_f Int3_print;
326asn_constr_check_f Int3_constraint;
327ber_type_decoder_f Int3_decode_ber;
328der_type_encoder_f Int3_encode_der;
329xer_type_decoder_f Int3_decode_xer;
330xer_type_encoder_f Int3_encode_xer;
331per_type_decoder_f Int3_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +0000332per_type_encoder_f Int3_encode_uper;
vlm337167e2005-11-26 11:25:14 +0000333
334/*** <<< CODE [Int3] >>> ***/
335
336int
337Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000338 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +0000339 const Int2_t *st = (const Int2_t *)sptr;
340 long value;
341
342 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +0000343 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000344 "%s: value not given (%s:%d)",
345 td->name, __FILE__, __LINE__);
346 return -1;
347 }
348
349 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +0000350 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000351 "%s: value too large (%s:%d)",
352 td->name, __FILE__, __LINE__);
353 return -1;
354 }
355
356 if((value >= 0 && value <= 10)) {
357 /* Constraint check succeeded */
358 return 0;
359 } else {
vlmd4ae41c2006-07-13 13:28:32 +0000360 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000361 "%s: constraint failed (%s:%d)",
362 td->name, __FILE__, __LINE__);
363 return -1;
364 }
365}
366
367/*
368 * This type is implemented using Int2,
369 * so here we adjust the DEF accordingly.
370 */
371static void
372Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
373 td->free_struct = asn_DEF_Int2.free_struct;
374 td->print_struct = asn_DEF_Int2.print_struct;
375 td->ber_decoder = asn_DEF_Int2.ber_decoder;
376 td->der_encoder = asn_DEF_Int2.der_encoder;
377 td->xer_decoder = asn_DEF_Int2.xer_decoder;
378 td->xer_encoder = asn_DEF_Int2.xer_encoder;
379 td->uper_decoder = asn_DEF_Int2.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +0000380 td->uper_encoder = asn_DEF_Int2.uper_encoder;
vlm337167e2005-11-26 11:25:14 +0000381 if(!td->per_constraints)
382 td->per_constraints = asn_DEF_Int2.per_constraints;
383 td->elements = asn_DEF_Int2.elements;
384 td->elements_count = asn_DEF_Int2.elements_count;
385 td->specifics = asn_DEF_Int2.specifics;
386}
387
388void
389Int3_free(asn_TYPE_descriptor_t *td,
390 void *struct_ptr, int contents_only) {
391 Int3_1_inherit_TYPE_descriptor(td);
392 td->free_struct(td, struct_ptr, contents_only);
393}
394
395int
396Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
397 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
398 Int3_1_inherit_TYPE_descriptor(td);
399 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
400}
401
402asn_dec_rval_t
403Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
404 void **structure, const void *bufptr, size_t size, int tag_mode) {
405 Int3_1_inherit_TYPE_descriptor(td);
406 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
407}
408
409asn_enc_rval_t
410Int3_encode_der(asn_TYPE_descriptor_t *td,
411 void *structure, int tag_mode, ber_tlv_tag_t tag,
412 asn_app_consume_bytes_f *cb, void *app_key) {
413 Int3_1_inherit_TYPE_descriptor(td);
414 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
415}
416
417asn_dec_rval_t
418Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
419 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
420 Int3_1_inherit_TYPE_descriptor(td);
421 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
422}
423
424asn_enc_rval_t
425Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
426 int ilevel, enum xer_encoder_flags_e flags,
427 asn_app_consume_bytes_f *cb, void *app_key) {
428 Int3_1_inherit_TYPE_descriptor(td);
429 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
430}
431
432asn_dec_rval_t
433Int3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
434 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
435 Int3_1_inherit_TYPE_descriptor(td);
436 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
437}
438
vlmb1b193e2006-08-18 01:46:46 +0000439asn_enc_rval_t
440Int3_encode_uper(asn_TYPE_descriptor_t *td,
441 asn_per_constraints_t *constraints,
442 void *structure, asn_per_outp_t *per_out) {
443 Int3_1_inherit_TYPE_descriptor(td);
444 return td->uper_encoder(td, constraints, structure, per_out);
445}
446
vlm337167e2005-11-26 11:25:14 +0000447
vlm86380d32006-10-09 12:07:58 +0000448/*** <<< CTDEFS [Int3] >>> ***/
449
vlma0da1a32006-10-09 12:27:44 +0000450static asn_per_constraints_t asn_PER_type_Int3_constr_1 = {
vlm86380d32006-10-09 12:07:58 +0000451 { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
452 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
453 0, 0 /* No PER value map */
454};
455
vlm337167e2005-11-26 11:25:14 +0000456/*** <<< STAT-DEFS [Int3] >>> ***/
457
458static ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
459 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
460};
vlm337167e2005-11-26 11:25:14 +0000461asn_TYPE_descriptor_t asn_DEF_Int3 = {
462 "Int3",
463 "Int3",
464 Int3_free,
465 Int3_print,
466 Int3_constraint,
467 Int3_decode_ber,
468 Int3_encode_der,
469 Int3_decode_xer,
470 Int3_encode_xer,
471 Int3_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000472 Int3_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000473 0, /* Use generic outmost tag fetcher */
474 asn_DEF_Int3_tags_1,
475 sizeof(asn_DEF_Int3_tags_1)
476 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
477 asn_DEF_Int3_tags_1, /* Same as above */
478 sizeof(asn_DEF_Int3_tags_1)
479 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +0000480 &asn_PER_type_Int3_constr_1,
vlm337167e2005-11-26 11:25:14 +0000481 0, 0, /* No members */
482 0 /* No specifics */
483};
484
485
486/*** <<< INCLUDES [Int4] >>> ***/
487
vlmea226772006-09-13 02:51:20 +0000488#include "Int3.h"
vlm337167e2005-11-26 11:25:14 +0000489
490/*** <<< TYPE-DECLS [Int4] >>> ***/
491
492typedef Int3_t Int4_t;
493
494/*** <<< FUNC-DECLS [Int4] >>> ***/
495
496extern asn_TYPE_descriptor_t asn_DEF_Int4;
497asn_struct_free_f Int4_free;
498asn_struct_print_f Int4_print;
499asn_constr_check_f Int4_constraint;
500ber_type_decoder_f Int4_decode_ber;
501der_type_encoder_f Int4_encode_der;
502xer_type_decoder_f Int4_decode_xer;
503xer_type_encoder_f Int4_encode_xer;
504per_type_decoder_f Int4_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +0000505per_type_encoder_f Int4_encode_uper;
vlm337167e2005-11-26 11:25:14 +0000506
507/*** <<< CODE [Int4] >>> ***/
508
509int
510Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000511 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +0000512 const Int3_t *st = (const Int3_t *)sptr;
513 long value;
514
515 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +0000516 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000517 "%s: value not given (%s:%d)",
518 td->name, __FILE__, __LINE__);
519 return -1;
520 }
521
522 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +0000523 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000524 "%s: value too large (%s:%d)",
525 td->name, __FILE__, __LINE__);
526 return -1;
527 }
528
529 if((value >= 1 && value <= 10)) {
530 /* Constraint check succeeded */
531 return 0;
532 } else {
vlmd4ae41c2006-07-13 13:28:32 +0000533 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000534 "%s: constraint failed (%s:%d)",
535 td->name, __FILE__, __LINE__);
536 return -1;
537 }
538}
539
540/*
541 * This type is implemented using Int3,
542 * so here we adjust the DEF accordingly.
543 */
544static void
545Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
546 td->free_struct = asn_DEF_Int3.free_struct;
547 td->print_struct = asn_DEF_Int3.print_struct;
548 td->ber_decoder = asn_DEF_Int3.ber_decoder;
549 td->der_encoder = asn_DEF_Int3.der_encoder;
550 td->xer_decoder = asn_DEF_Int3.xer_decoder;
551 td->xer_encoder = asn_DEF_Int3.xer_encoder;
552 td->uper_decoder = asn_DEF_Int3.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +0000553 td->uper_encoder = asn_DEF_Int3.uper_encoder;
vlm337167e2005-11-26 11:25:14 +0000554 if(!td->per_constraints)
555 td->per_constraints = asn_DEF_Int3.per_constraints;
556 td->elements = asn_DEF_Int3.elements;
557 td->elements_count = asn_DEF_Int3.elements_count;
558 td->specifics = asn_DEF_Int3.specifics;
559}
560
561void
562Int4_free(asn_TYPE_descriptor_t *td,
563 void *struct_ptr, int contents_only) {
564 Int4_1_inherit_TYPE_descriptor(td);
565 td->free_struct(td, struct_ptr, contents_only);
566}
567
568int
569Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
570 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
571 Int4_1_inherit_TYPE_descriptor(td);
572 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
573}
574
575asn_dec_rval_t
576Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
577 void **structure, const void *bufptr, size_t size, int tag_mode) {
578 Int4_1_inherit_TYPE_descriptor(td);
579 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
580}
581
582asn_enc_rval_t
583Int4_encode_der(asn_TYPE_descriptor_t *td,
584 void *structure, int tag_mode, ber_tlv_tag_t tag,
585 asn_app_consume_bytes_f *cb, void *app_key) {
586 Int4_1_inherit_TYPE_descriptor(td);
587 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
588}
589
590asn_dec_rval_t
591Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
592 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
593 Int4_1_inherit_TYPE_descriptor(td);
594 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
595}
596
597asn_enc_rval_t
598Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
599 int ilevel, enum xer_encoder_flags_e flags,
600 asn_app_consume_bytes_f *cb, void *app_key) {
601 Int4_1_inherit_TYPE_descriptor(td);
602 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
603}
604
605asn_dec_rval_t
606Int4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
607 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
608 Int4_1_inherit_TYPE_descriptor(td);
609 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
610}
611
vlmb1b193e2006-08-18 01:46:46 +0000612asn_enc_rval_t
613Int4_encode_uper(asn_TYPE_descriptor_t *td,
614 asn_per_constraints_t *constraints,
615 void *structure, asn_per_outp_t *per_out) {
616 Int4_1_inherit_TYPE_descriptor(td);
617 return td->uper_encoder(td, constraints, structure, per_out);
618}
619
vlm337167e2005-11-26 11:25:14 +0000620
vlm86380d32006-10-09 12:07:58 +0000621/*** <<< CTDEFS [Int4] >>> ***/
622
vlma0da1a32006-10-09 12:27:44 +0000623static asn_per_constraints_t asn_PER_type_Int4_constr_1 = {
vlm86380d32006-10-09 12:07:58 +0000624 { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
625 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
626 0, 0 /* No PER value map */
627};
628
vlm337167e2005-11-26 11:25:14 +0000629/*** <<< STAT-DEFS [Int4] >>> ***/
630
631static ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
632 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
633};
vlm337167e2005-11-26 11:25:14 +0000634asn_TYPE_descriptor_t asn_DEF_Int4 = {
635 "Int4",
636 "Int4",
637 Int4_free,
638 Int4_print,
639 Int4_constraint,
640 Int4_decode_ber,
641 Int4_encode_der,
642 Int4_decode_xer,
643 Int4_encode_xer,
644 Int4_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000645 Int4_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000646 0, /* Use generic outmost tag fetcher */
647 asn_DEF_Int4_tags_1,
648 sizeof(asn_DEF_Int4_tags_1)
649 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
650 asn_DEF_Int4_tags_1, /* Same as above */
651 sizeof(asn_DEF_Int4_tags_1)
652 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +0000653 &asn_PER_type_Int4_constr_1,
vlm337167e2005-11-26 11:25:14 +0000654 0, 0, /* No members */
655 0 /* No specifics */
656};
657
658
659/*** <<< INCLUDES [Int5] >>> ***/
660
vlmea226772006-09-13 02:51:20 +0000661#include "Int4.h"
vlm337167e2005-11-26 11:25:14 +0000662
663/*** <<< TYPE-DECLS [Int5] >>> ***/
664
665typedef Int4_t Int5_t;
666
667/*** <<< FUNC-DECLS [Int5] >>> ***/
668
669extern asn_TYPE_descriptor_t asn_DEF_Int5;
670asn_struct_free_f Int5_free;
671asn_struct_print_f Int5_print;
672asn_constr_check_f Int5_constraint;
673ber_type_decoder_f Int5_decode_ber;
674der_type_encoder_f Int5_encode_der;
675xer_type_decoder_f Int5_decode_xer;
676xer_type_encoder_f Int5_encode_xer;
677per_type_decoder_f Int5_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +0000678per_type_encoder_f Int5_encode_uper;
vlm337167e2005-11-26 11:25:14 +0000679
680/*** <<< CODE [Int5] >>> ***/
681
682int
683Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000684 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +0000685 const Int4_t *st = (const Int4_t *)sptr;
686 long value;
687
688 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +0000689 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000690 "%s: value not given (%s:%d)",
691 td->name, __FILE__, __LINE__);
692 return -1;
693 }
694
695 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +0000696 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000697 "%s: value too large (%s:%d)",
698 td->name, __FILE__, __LINE__);
699 return -1;
700 }
701
702 if((value == 5)) {
703 /* Constraint check succeeded */
704 return 0;
705 } else {
vlmd4ae41c2006-07-13 13:28:32 +0000706 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000707 "%s: constraint failed (%s:%d)",
708 td->name, __FILE__, __LINE__);
709 return -1;
710 }
711}
712
713/*
714 * This type is implemented using Int4,
715 * so here we adjust the DEF accordingly.
716 */
717static void
718Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
719 td->free_struct = asn_DEF_Int4.free_struct;
720 td->print_struct = asn_DEF_Int4.print_struct;
721 td->ber_decoder = asn_DEF_Int4.ber_decoder;
722 td->der_encoder = asn_DEF_Int4.der_encoder;
723 td->xer_decoder = asn_DEF_Int4.xer_decoder;
724 td->xer_encoder = asn_DEF_Int4.xer_encoder;
725 td->uper_decoder = asn_DEF_Int4.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +0000726 td->uper_encoder = asn_DEF_Int4.uper_encoder;
vlm337167e2005-11-26 11:25:14 +0000727 if(!td->per_constraints)
728 td->per_constraints = asn_DEF_Int4.per_constraints;
729 td->elements = asn_DEF_Int4.elements;
730 td->elements_count = asn_DEF_Int4.elements_count;
731 td->specifics = asn_DEF_Int4.specifics;
732}
733
734void
735Int5_free(asn_TYPE_descriptor_t *td,
736 void *struct_ptr, int contents_only) {
737 Int5_1_inherit_TYPE_descriptor(td);
738 td->free_struct(td, struct_ptr, contents_only);
739}
740
741int
742Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
743 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
744 Int5_1_inherit_TYPE_descriptor(td);
745 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
746}
747
748asn_dec_rval_t
749Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
750 void **structure, const void *bufptr, size_t size, int tag_mode) {
751 Int5_1_inherit_TYPE_descriptor(td);
752 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
753}
754
755asn_enc_rval_t
756Int5_encode_der(asn_TYPE_descriptor_t *td,
757 void *structure, int tag_mode, ber_tlv_tag_t tag,
758 asn_app_consume_bytes_f *cb, void *app_key) {
759 Int5_1_inherit_TYPE_descriptor(td);
760 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
761}
762
763asn_dec_rval_t
764Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
765 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
766 Int5_1_inherit_TYPE_descriptor(td);
767 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
768}
769
770asn_enc_rval_t
771Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
772 int ilevel, enum xer_encoder_flags_e flags,
773 asn_app_consume_bytes_f *cb, void *app_key) {
774 Int5_1_inherit_TYPE_descriptor(td);
775 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
776}
777
778asn_dec_rval_t
779Int5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
780 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
781 Int5_1_inherit_TYPE_descriptor(td);
782 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
783}
784
vlmb1b193e2006-08-18 01:46:46 +0000785asn_enc_rval_t
786Int5_encode_uper(asn_TYPE_descriptor_t *td,
787 asn_per_constraints_t *constraints,
788 void *structure, asn_per_outp_t *per_out) {
789 Int5_1_inherit_TYPE_descriptor(td);
790 return td->uper_encoder(td, constraints, structure, per_out);
791}
792
vlm337167e2005-11-26 11:25:14 +0000793
vlm86380d32006-10-09 12:07:58 +0000794/*** <<< CTDEFS [Int5] >>> ***/
795
vlma0da1a32006-10-09 12:27:44 +0000796static asn_per_constraints_t asn_PER_type_Int5_constr_1 = {
vlm86380d32006-10-09 12:07:58 +0000797 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
798 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
799 0, 0 /* No PER value map */
800};
801
vlm337167e2005-11-26 11:25:14 +0000802/*** <<< STAT-DEFS [Int5] >>> ***/
803
804static ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
805 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
806};
vlm337167e2005-11-26 11:25:14 +0000807asn_TYPE_descriptor_t asn_DEF_Int5 = {
808 "Int5",
809 "Int5",
810 Int5_free,
811 Int5_print,
812 Int5_constraint,
813 Int5_decode_ber,
814 Int5_encode_der,
815 Int5_decode_xer,
816 Int5_encode_xer,
817 Int5_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000818 Int5_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000819 0, /* Use generic outmost tag fetcher */
820 asn_DEF_Int5_tags_1,
821 sizeof(asn_DEF_Int5_tags_1)
822 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
823 asn_DEF_Int5_tags_1, /* Same as above */
824 sizeof(asn_DEF_Int5_tags_1)
825 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +0000826 &asn_PER_type_Int5_constr_1,
vlm337167e2005-11-26 11:25:14 +0000827 0, 0, /* No members */
828 0 /* No specifics */
829};
830
831
832/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
833
834#include <INTEGER.h>
835
836/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
837
838typedef INTEGER_t ExtensibleExtensions_t;
839
840/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
841
842extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
843asn_struct_free_f ExtensibleExtensions_free;
844asn_struct_print_f ExtensibleExtensions_print;
845asn_constr_check_f ExtensibleExtensions_constraint;
846ber_type_decoder_f ExtensibleExtensions_decode_ber;
847der_type_encoder_f ExtensibleExtensions_encode_der;
848xer_type_decoder_f ExtensibleExtensions_decode_xer;
849xer_type_encoder_f ExtensibleExtensions_encode_xer;
850per_type_decoder_f ExtensibleExtensions_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +0000851per_type_encoder_f ExtensibleExtensions_encode_uper;
vlm337167e2005-11-26 11:25:14 +0000852
853/*** <<< CODE [ExtensibleExtensions] >>> ***/
854
855int
856ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000857 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +0000858 const INTEGER_t *st = (const INTEGER_t *)sptr;
859 long value;
860
861 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +0000862 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000863 "%s: value not given (%s:%d)",
864 td->name, __FILE__, __LINE__);
865 return -1;
866 }
867
868 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +0000869 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000870 "%s: value too large (%s:%d)",
871 td->name, __FILE__, __LINE__);
872 return -1;
873 }
874
875 if((value >= 1 && value <= 256)) {
876 /* Constraint check succeeded */
877 return 0;
878 } else {
vlmd4ae41c2006-07-13 13:28:32 +0000879 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +0000880 "%s: constraint failed (%s:%d)",
881 td->name, __FILE__, __LINE__);
882 return -1;
883 }
884}
885
886/*
887 * This type is implemented using INTEGER,
888 * so here we adjust the DEF accordingly.
889 */
890static void
891ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
892 td->free_struct = asn_DEF_INTEGER.free_struct;
893 td->print_struct = asn_DEF_INTEGER.print_struct;
894 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
895 td->der_encoder = asn_DEF_INTEGER.der_encoder;
896 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
897 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
898 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +0000899 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
vlm337167e2005-11-26 11:25:14 +0000900 if(!td->per_constraints)
901 td->per_constraints = asn_DEF_INTEGER.per_constraints;
902 td->elements = asn_DEF_INTEGER.elements;
903 td->elements_count = asn_DEF_INTEGER.elements_count;
904 td->specifics = asn_DEF_INTEGER.specifics;
905}
906
907void
908ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
909 void *struct_ptr, int contents_only) {
910 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
911 td->free_struct(td, struct_ptr, contents_only);
912}
913
914int
915ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
916 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
917 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
918 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
919}
920
921asn_dec_rval_t
922ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
923 void **structure, const void *bufptr, size_t size, int tag_mode) {
924 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
925 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
926}
927
928asn_enc_rval_t
929ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
930 void *structure, int tag_mode, ber_tlv_tag_t tag,
931 asn_app_consume_bytes_f *cb, void *app_key) {
932 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
933 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
934}
935
936asn_dec_rval_t
937ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
938 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
939 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
940 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
941}
942
943asn_enc_rval_t
944ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
945 int ilevel, enum xer_encoder_flags_e flags,
946 asn_app_consume_bytes_f *cb, void *app_key) {
947 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
948 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
949}
950
951asn_dec_rval_t
952ExtensibleExtensions_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
953 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
954 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
955 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
956}
957
vlmb1b193e2006-08-18 01:46:46 +0000958asn_enc_rval_t
959ExtensibleExtensions_encode_uper(asn_TYPE_descriptor_t *td,
960 asn_per_constraints_t *constraints,
961 void *structure, asn_per_outp_t *per_out) {
962 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
963 return td->uper_encoder(td, constraints, structure, per_out);
964}
965
vlm337167e2005-11-26 11:25:14 +0000966
vlm86380d32006-10-09 12:07:58 +0000967/*** <<< CTDEFS [ExtensibleExtensions] >>> ***/
968
vlma0da1a32006-10-09 12:27:44 +0000969static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 = {
vlm86380d32006-10-09 12:07:58 +0000970 { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
971 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
972 0, 0 /* No PER value map */
973};
974
vlm337167e2005-11-26 11:25:14 +0000975/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
976
977static ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
978 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
979};
vlm337167e2005-11-26 11:25:14 +0000980asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
981 "ExtensibleExtensions",
982 "ExtensibleExtensions",
983 ExtensibleExtensions_free,
984 ExtensibleExtensions_print,
985 ExtensibleExtensions_constraint,
986 ExtensibleExtensions_decode_ber,
987 ExtensibleExtensions_encode_der,
988 ExtensibleExtensions_decode_xer,
989 ExtensibleExtensions_encode_xer,
990 ExtensibleExtensions_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +0000991 ExtensibleExtensions_encode_uper,
vlm337167e2005-11-26 11:25:14 +0000992 0, /* Use generic outmost tag fetcher */
993 asn_DEF_ExtensibleExtensions_tags_1,
994 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
995 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
996 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
997 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
998 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +0000999 &asn_PER_type_ExtensibleExtensions_constr_1,
vlm337167e2005-11-26 11:25:14 +00001000 0, 0, /* No members */
1001 0 /* No specifics */
1002};
1003
1004
1005/*** <<< INCLUDES [Str1] >>> ***/
1006
1007#include <IA5String.h>
1008
1009/*** <<< TYPE-DECLS [Str1] >>> ***/
1010
1011typedef IA5String_t Str1_t;
1012
1013/*** <<< FUNC-DECLS [Str1] >>> ***/
1014
1015extern asn_TYPE_descriptor_t asn_DEF_Str1;
1016asn_struct_free_f Str1_free;
1017asn_struct_print_f Str1_print;
1018asn_constr_check_f Str1_constraint;
1019ber_type_decoder_f Str1_decode_ber;
1020der_type_encoder_f Str1_encode_der;
1021xer_type_decoder_f Str1_decode_xer;
1022xer_type_encoder_f Str1_encode_xer;
1023per_type_decoder_f Str1_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001024per_type_encoder_f Str1_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001025
1026/*** <<< CODE [Str1] >>> ***/
1027
1028int
1029Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001030 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001031 /* Replace with underlying type checker */
1032 td->check_constraints = asn_DEF_IA5String.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +00001033 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm337167e2005-11-26 11:25:14 +00001034}
1035
1036/*
1037 * This type is implemented using IA5String,
1038 * so here we adjust the DEF accordingly.
1039 */
1040static void
1041Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1042 td->free_struct = asn_DEF_IA5String.free_struct;
1043 td->print_struct = asn_DEF_IA5String.print_struct;
1044 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1045 td->der_encoder = asn_DEF_IA5String.der_encoder;
1046 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1047 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1048 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001049 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001050 if(!td->per_constraints)
1051 td->per_constraints = asn_DEF_IA5String.per_constraints;
1052 td->elements = asn_DEF_IA5String.elements;
1053 td->elements_count = asn_DEF_IA5String.elements_count;
1054 td->specifics = asn_DEF_IA5String.specifics;
1055}
1056
1057void
1058Str1_free(asn_TYPE_descriptor_t *td,
1059 void *struct_ptr, int contents_only) {
1060 Str1_1_inherit_TYPE_descriptor(td);
1061 td->free_struct(td, struct_ptr, contents_only);
1062}
1063
1064int
1065Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1066 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1067 Str1_1_inherit_TYPE_descriptor(td);
1068 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1069}
1070
1071asn_dec_rval_t
1072Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1073 void **structure, const void *bufptr, size_t size, int tag_mode) {
1074 Str1_1_inherit_TYPE_descriptor(td);
1075 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1076}
1077
1078asn_enc_rval_t
1079Str1_encode_der(asn_TYPE_descriptor_t *td,
1080 void *structure, int tag_mode, ber_tlv_tag_t tag,
1081 asn_app_consume_bytes_f *cb, void *app_key) {
1082 Str1_1_inherit_TYPE_descriptor(td);
1083 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1084}
1085
1086asn_dec_rval_t
1087Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1088 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1089 Str1_1_inherit_TYPE_descriptor(td);
1090 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1091}
1092
1093asn_enc_rval_t
1094Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1095 int ilevel, enum xer_encoder_flags_e flags,
1096 asn_app_consume_bytes_f *cb, void *app_key) {
1097 Str1_1_inherit_TYPE_descriptor(td);
1098 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1099}
1100
1101asn_dec_rval_t
1102Str1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1103 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1104 Str1_1_inherit_TYPE_descriptor(td);
1105 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1106}
1107
vlmb1b193e2006-08-18 01:46:46 +00001108asn_enc_rval_t
1109Str1_encode_uper(asn_TYPE_descriptor_t *td,
1110 asn_per_constraints_t *constraints,
1111 void *structure, asn_per_outp_t *per_out) {
1112 Str1_1_inherit_TYPE_descriptor(td);
1113 return td->uper_encoder(td, constraints, structure, per_out);
1114}
1115
vlm337167e2005-11-26 11:25:14 +00001116
1117/*** <<< STAT-DEFS [Str1] >>> ***/
1118
1119static ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
1120 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1121};
1122asn_TYPE_descriptor_t asn_DEF_Str1 = {
1123 "Str1",
1124 "Str1",
1125 Str1_free,
1126 Str1_print,
1127 Str1_constraint,
1128 Str1_decode_ber,
1129 Str1_encode_der,
1130 Str1_decode_xer,
1131 Str1_encode_xer,
1132 Str1_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001133 Str1_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001134 0, /* Use generic outmost tag fetcher */
1135 asn_DEF_Str1_tags_1,
1136 sizeof(asn_DEF_Str1_tags_1)
1137 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1138 asn_DEF_Str1_tags_1, /* Same as above */
1139 sizeof(asn_DEF_Str1_tags_1)
1140 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1141 0, /* No PER visible constraints */
1142 0, 0, /* No members */
1143 0 /* No specifics */
1144};
1145
1146
1147/*** <<< INCLUDES [Str2] >>> ***/
1148
vlmea226772006-09-13 02:51:20 +00001149#include "Str1.h"
vlm337167e2005-11-26 11:25:14 +00001150
1151/*** <<< TYPE-DECLS [Str2] >>> ***/
1152
1153typedef Str1_t Str2_t;
1154
1155/*** <<< FUNC-DECLS [Str2] >>> ***/
1156
1157extern asn_TYPE_descriptor_t asn_DEF_Str2;
1158asn_struct_free_f Str2_free;
1159asn_struct_print_f Str2_print;
1160asn_constr_check_f Str2_constraint;
1161ber_type_decoder_f Str2_decode_ber;
1162der_type_encoder_f Str2_encode_der;
1163xer_type_decoder_f Str2_decode_xer;
1164xer_type_encoder_f Str2_encode_xer;
1165per_type_decoder_f Str2_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001166per_type_encoder_f Str2_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001167
1168/*** <<< CTABLES [Str2] >>> ***/
1169
1170static int check_permitted_alphabet_1(const void *sptr) {
1171 /* The underlying type is IA5String */
1172 const IA5String_t *st = (const IA5String_t *)sptr;
1173 const uint8_t *ch = st->buf;
1174 const uint8_t *end = ch + st->size;
1175
1176 for(; ch < end; ch++) {
1177 uint8_t cv = *ch;
1178 if(!(cv <= 127)) return -1;
1179 }
1180 return 0;
1181}
1182
1183
1184/*** <<< CODE [Str2] >>> ***/
1185
1186int
1187Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001188 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001189 const Str1_t *st = (const Str1_t *)sptr;
1190 size_t size;
1191
1192 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001193 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001194 "%s: value not given (%s:%d)",
1195 td->name, __FILE__, __LINE__);
1196 return -1;
1197 }
1198
1199 size = st->size;
1200
1201 if(((size <= 20) || (size >= 25 && size <= 30))
1202 && !check_permitted_alphabet_1(st)) {
1203 /* Constraint check succeeded */
1204 return 0;
1205 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001206 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001207 "%s: constraint failed (%s:%d)",
1208 td->name, __FILE__, __LINE__);
1209 return -1;
1210 }
1211}
1212
1213/*
1214 * This type is implemented using Str1,
1215 * so here we adjust the DEF accordingly.
1216 */
1217static void
1218Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1219 td->free_struct = asn_DEF_Str1.free_struct;
1220 td->print_struct = asn_DEF_Str1.print_struct;
1221 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1222 td->der_encoder = asn_DEF_Str1.der_encoder;
1223 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1224 td->xer_encoder = asn_DEF_Str1.xer_encoder;
1225 td->uper_decoder = asn_DEF_Str1.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001226 td->uper_encoder = asn_DEF_Str1.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001227 if(!td->per_constraints)
1228 td->per_constraints = asn_DEF_Str1.per_constraints;
1229 td->elements = asn_DEF_Str1.elements;
1230 td->elements_count = asn_DEF_Str1.elements_count;
1231 td->specifics = asn_DEF_Str1.specifics;
1232}
1233
1234void
1235Str2_free(asn_TYPE_descriptor_t *td,
1236 void *struct_ptr, int contents_only) {
1237 Str2_1_inherit_TYPE_descriptor(td);
1238 td->free_struct(td, struct_ptr, contents_only);
1239}
1240
1241int
1242Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1243 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1244 Str2_1_inherit_TYPE_descriptor(td);
1245 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1246}
1247
1248asn_dec_rval_t
1249Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1250 void **structure, const void *bufptr, size_t size, int tag_mode) {
1251 Str2_1_inherit_TYPE_descriptor(td);
1252 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1253}
1254
1255asn_enc_rval_t
1256Str2_encode_der(asn_TYPE_descriptor_t *td,
1257 void *structure, int tag_mode, ber_tlv_tag_t tag,
1258 asn_app_consume_bytes_f *cb, void *app_key) {
1259 Str2_1_inherit_TYPE_descriptor(td);
1260 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1261}
1262
1263asn_dec_rval_t
1264Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1265 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1266 Str2_1_inherit_TYPE_descriptor(td);
1267 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1268}
1269
1270asn_enc_rval_t
1271Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1272 int ilevel, enum xer_encoder_flags_e flags,
1273 asn_app_consume_bytes_f *cb, void *app_key) {
1274 Str2_1_inherit_TYPE_descriptor(td);
1275 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1276}
1277
1278asn_dec_rval_t
1279Str2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1280 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1281 Str2_1_inherit_TYPE_descriptor(td);
1282 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1283}
1284
vlmb1b193e2006-08-18 01:46:46 +00001285asn_enc_rval_t
1286Str2_encode_uper(asn_TYPE_descriptor_t *td,
1287 asn_per_constraints_t *constraints,
1288 void *structure, asn_per_outp_t *per_out) {
1289 Str2_1_inherit_TYPE_descriptor(td);
1290 return td->uper_encoder(td, constraints, structure, per_out);
1291}
1292
vlm337167e2005-11-26 11:25:14 +00001293
vlm86380d32006-10-09 12:07:58 +00001294/*** <<< CTDEFS [Str2] >>> ***/
1295
vlma0da1a32006-10-09 12:27:44 +00001296static asn_per_constraints_t asn_PER_type_Str2_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00001297 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1298 { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */,
1299 0, 0 /* No PER character map necessary */
1300};
1301
vlm337167e2005-11-26 11:25:14 +00001302/*** <<< STAT-DEFS [Str2] >>> ***/
1303
1304static ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
1305 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1306};
vlm337167e2005-11-26 11:25:14 +00001307asn_TYPE_descriptor_t asn_DEF_Str2 = {
1308 "Str2",
1309 "Str2",
1310 Str2_free,
1311 Str2_print,
1312 Str2_constraint,
1313 Str2_decode_ber,
1314 Str2_encode_der,
1315 Str2_decode_xer,
1316 Str2_encode_xer,
1317 Str2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001318 Str2_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001319 0, /* Use generic outmost tag fetcher */
1320 asn_DEF_Str2_tags_1,
1321 sizeof(asn_DEF_Str2_tags_1)
1322 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1323 asn_DEF_Str2_tags_1, /* Same as above */
1324 sizeof(asn_DEF_Str2_tags_1)
1325 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00001326 &asn_PER_type_Str2_constr_1,
vlm337167e2005-11-26 11:25:14 +00001327 0, 0, /* No members */
1328 0 /* No specifics */
1329};
1330
1331
1332/*** <<< INCLUDES [Str3] >>> ***/
1333
vlmea226772006-09-13 02:51:20 +00001334#include "Str2.h"
vlm337167e2005-11-26 11:25:14 +00001335
1336/*** <<< TYPE-DECLS [Str3] >>> ***/
1337
1338typedef Str2_t Str3_t;
1339
1340/*** <<< FUNC-DECLS [Str3] >>> ***/
1341
1342extern asn_TYPE_descriptor_t asn_DEF_Str3;
1343asn_struct_free_f Str3_free;
1344asn_struct_print_f Str3_print;
1345asn_constr_check_f Str3_constraint;
1346ber_type_decoder_f Str3_decode_ber;
1347der_type_encoder_f Str3_encode_der;
1348xer_type_decoder_f Str3_decode_xer;
1349xer_type_encoder_f Str3_encode_xer;
1350per_type_decoder_f Str3_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001351per_type_encoder_f Str3_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001352
1353/*** <<< CTABLES [Str3] >>> ***/
1354
1355static int permitted_alphabet_table_1[256] = {
vlm4baece12006-09-21 01:52:07 +00001356 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1357 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1359 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1360 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
1361 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1362 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
vlm337167e2005-11-26 11:25:14 +00001363};
vlm4baece12006-09-21 01:52:07 +00001364static int permitted_alphabet_code2value_1[6] = {
136565,66,67,100,101,102,};
1366
vlm337167e2005-11-26 11:25:14 +00001367
1368static int check_permitted_alphabet_1(const void *sptr) {
1369 int *table = permitted_alphabet_table_1;
1370 /* The underlying type is IA5String */
1371 const IA5String_t *st = (const IA5String_t *)sptr;
1372 const uint8_t *ch = st->buf;
1373 const uint8_t *end = ch + st->size;
1374
1375 for(; ch < end; ch++) {
1376 uint8_t cv = *ch;
1377 if(!table[cv]) return -1;
1378 }
1379 return 0;
1380}
1381
1382
1383/*** <<< CODE [Str3] >>> ***/
1384
1385int
1386Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001387 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001388 const Str2_t *st = (const Str2_t *)sptr;
1389 size_t size;
1390
1391 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001392 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001393 "%s: value not given (%s:%d)",
1394 td->name, __FILE__, __LINE__);
1395 return -1;
1396 }
1397
1398 size = st->size;
1399
1400 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
1401 && !check_permitted_alphabet_1(st)) {
1402 /* Constraint check succeeded */
1403 return 0;
1404 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001405 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001406 "%s: constraint failed (%s:%d)",
1407 td->name, __FILE__, __LINE__);
1408 return -1;
1409 }
1410}
1411
vlm86380d32006-10-09 12:07:58 +00001412static int asn_PER_MAP_Str3_1_v2c(unsigned int value) {
1413 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
1414 return -1;
1415 return permitted_alphabet_table_1[value] - 1;
1416}
1417static int asn_PER_MAP_Str3_1_c2v(unsigned int code) {
1418 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
1419 return -1;
1420 return permitted_alphabet_code2value_1[code];
1421}
vlm337167e2005-11-26 11:25:14 +00001422/*
1423 * This type is implemented using Str2,
1424 * so here we adjust the DEF accordingly.
1425 */
1426static void
1427Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1428 td->free_struct = asn_DEF_Str2.free_struct;
1429 td->print_struct = asn_DEF_Str2.print_struct;
1430 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1431 td->der_encoder = asn_DEF_Str2.der_encoder;
1432 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1433 td->xer_encoder = asn_DEF_Str2.xer_encoder;
1434 td->uper_decoder = asn_DEF_Str2.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001435 td->uper_encoder = asn_DEF_Str2.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001436 if(!td->per_constraints)
1437 td->per_constraints = asn_DEF_Str2.per_constraints;
1438 td->elements = asn_DEF_Str2.elements;
1439 td->elements_count = asn_DEF_Str2.elements_count;
1440 td->specifics = asn_DEF_Str2.specifics;
1441}
1442
1443void
1444Str3_free(asn_TYPE_descriptor_t *td,
1445 void *struct_ptr, int contents_only) {
1446 Str3_1_inherit_TYPE_descriptor(td);
1447 td->free_struct(td, struct_ptr, contents_only);
1448}
1449
1450int
1451Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1452 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1453 Str3_1_inherit_TYPE_descriptor(td);
1454 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1455}
1456
1457asn_dec_rval_t
1458Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1459 void **structure, const void *bufptr, size_t size, int tag_mode) {
1460 Str3_1_inherit_TYPE_descriptor(td);
1461 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1462}
1463
1464asn_enc_rval_t
1465Str3_encode_der(asn_TYPE_descriptor_t *td,
1466 void *structure, int tag_mode, ber_tlv_tag_t tag,
1467 asn_app_consume_bytes_f *cb, void *app_key) {
1468 Str3_1_inherit_TYPE_descriptor(td);
1469 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1470}
1471
1472asn_dec_rval_t
1473Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1474 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1475 Str3_1_inherit_TYPE_descriptor(td);
1476 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1477}
1478
1479asn_enc_rval_t
1480Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1481 int ilevel, enum xer_encoder_flags_e flags,
1482 asn_app_consume_bytes_f *cb, void *app_key) {
1483 Str3_1_inherit_TYPE_descriptor(td);
1484 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1485}
1486
1487asn_dec_rval_t
1488Str3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1489 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1490 Str3_1_inherit_TYPE_descriptor(td);
1491 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1492}
1493
vlmb1b193e2006-08-18 01:46:46 +00001494asn_enc_rval_t
1495Str3_encode_uper(asn_TYPE_descriptor_t *td,
1496 asn_per_constraints_t *constraints,
1497 void *structure, asn_per_outp_t *per_out) {
1498 Str3_1_inherit_TYPE_descriptor(td);
1499 return td->uper_encoder(td, constraints, structure, per_out);
1500}
1501
vlm337167e2005-11-26 11:25:14 +00001502
vlm86380d32006-10-09 12:07:58 +00001503/*** <<< CTDEFS [Str3] >>> ***/
1504
vlma0da1a32006-10-09 12:27:44 +00001505static asn_per_constraints_t asn_PER_type_Str3_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00001506 { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */,
1507 { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */,
1508 asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */
1509 asn_PER_MAP_Str3_1_c2v /* PER code to value map */
1510};
1511
vlm337167e2005-11-26 11:25:14 +00001512/*** <<< STAT-DEFS [Str3] >>> ***/
1513
1514static ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
1515 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1516};
vlm337167e2005-11-26 11:25:14 +00001517asn_TYPE_descriptor_t asn_DEF_Str3 = {
1518 "Str3",
1519 "Str3",
1520 Str3_free,
1521 Str3_print,
1522 Str3_constraint,
1523 Str3_decode_ber,
1524 Str3_encode_der,
1525 Str3_decode_xer,
1526 Str3_encode_xer,
1527 Str3_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001528 Str3_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001529 0, /* Use generic outmost tag fetcher */
1530 asn_DEF_Str3_tags_1,
1531 sizeof(asn_DEF_Str3_tags_1)
1532 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1533 asn_DEF_Str3_tags_1, /* Same as above */
1534 sizeof(asn_DEF_Str3_tags_1)
1535 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00001536 &asn_PER_type_Str3_constr_1,
vlm337167e2005-11-26 11:25:14 +00001537 0, 0, /* No members */
1538 0 /* No specifics */
1539};
1540
1541
1542/*** <<< INCLUDES [Str4] >>> ***/
1543
1544#include <IA5String.h>
1545
1546/*** <<< TYPE-DECLS [Str4] >>> ***/
1547
1548typedef IA5String_t Str4_t;
1549
1550/*** <<< FUNC-DECLS [Str4] >>> ***/
1551
1552extern asn_TYPE_descriptor_t asn_DEF_Str4;
1553asn_struct_free_f Str4_free;
1554asn_struct_print_f Str4_print;
1555asn_constr_check_f Str4_constraint;
1556ber_type_decoder_f Str4_decode_ber;
1557der_type_encoder_f Str4_encode_der;
1558xer_type_decoder_f Str4_decode_xer;
1559xer_type_encoder_f Str4_encode_xer;
1560per_type_decoder_f Str4_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001561per_type_encoder_f Str4_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001562
1563/*** <<< CTABLES [Str4] >>> ***/
1564
1565static int check_permitted_alphabet_1(const void *sptr) {
1566 /* The underlying type is IA5String */
1567 const IA5String_t *st = (const IA5String_t *)sptr;
1568 const uint8_t *ch = st->buf;
1569 const uint8_t *end = ch + st->size;
1570
1571 for(; ch < end; ch++) {
1572 uint8_t cv = *ch;
1573 if(!(cv <= 127)) return -1;
1574 }
1575 return 0;
1576}
1577
1578
1579/*** <<< CODE [Str4] >>> ***/
1580
1581int
1582Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001583 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001584 const IA5String_t *st = (const IA5String_t *)sptr;
1585
1586 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001587 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001588 "%s: value not given (%s:%d)",
1589 td->name, __FILE__, __LINE__);
1590 return -1;
1591 }
1592
1593
1594 if(!check_permitted_alphabet_1(st)) {
1595 /* Constraint check succeeded */
1596 return 0;
1597 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001598 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001599 "%s: constraint failed (%s:%d)",
1600 td->name, __FILE__, __LINE__);
1601 return -1;
1602 }
1603}
1604
1605/*
1606 * This type is implemented using IA5String,
1607 * so here we adjust the DEF accordingly.
1608 */
1609static void
1610Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1611 td->free_struct = asn_DEF_IA5String.free_struct;
1612 td->print_struct = asn_DEF_IA5String.print_struct;
1613 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1614 td->der_encoder = asn_DEF_IA5String.der_encoder;
1615 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1616 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1617 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001618 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001619 if(!td->per_constraints)
1620 td->per_constraints = asn_DEF_IA5String.per_constraints;
1621 td->elements = asn_DEF_IA5String.elements;
1622 td->elements_count = asn_DEF_IA5String.elements_count;
1623 td->specifics = asn_DEF_IA5String.specifics;
1624}
1625
1626void
1627Str4_free(asn_TYPE_descriptor_t *td,
1628 void *struct_ptr, int contents_only) {
1629 Str4_1_inherit_TYPE_descriptor(td);
1630 td->free_struct(td, struct_ptr, contents_only);
1631}
1632
1633int
1634Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1635 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1636 Str4_1_inherit_TYPE_descriptor(td);
1637 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1638}
1639
1640asn_dec_rval_t
1641Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1642 void **structure, const void *bufptr, size_t size, int tag_mode) {
1643 Str4_1_inherit_TYPE_descriptor(td);
1644 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1645}
1646
1647asn_enc_rval_t
1648Str4_encode_der(asn_TYPE_descriptor_t *td,
1649 void *structure, int tag_mode, ber_tlv_tag_t tag,
1650 asn_app_consume_bytes_f *cb, void *app_key) {
1651 Str4_1_inherit_TYPE_descriptor(td);
1652 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1653}
1654
1655asn_dec_rval_t
1656Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1657 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1658 Str4_1_inherit_TYPE_descriptor(td);
1659 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1660}
1661
1662asn_enc_rval_t
1663Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1664 int ilevel, enum xer_encoder_flags_e flags,
1665 asn_app_consume_bytes_f *cb, void *app_key) {
1666 Str4_1_inherit_TYPE_descriptor(td);
1667 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1668}
1669
1670asn_dec_rval_t
1671Str4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1672 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1673 Str4_1_inherit_TYPE_descriptor(td);
1674 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1675}
1676
vlmb1b193e2006-08-18 01:46:46 +00001677asn_enc_rval_t
1678Str4_encode_uper(asn_TYPE_descriptor_t *td,
1679 asn_per_constraints_t *constraints,
1680 void *structure, asn_per_outp_t *per_out) {
1681 Str4_1_inherit_TYPE_descriptor(td);
1682 return td->uper_encoder(td, constraints, structure, per_out);
1683}
1684
vlm337167e2005-11-26 11:25:14 +00001685
vlm86380d32006-10-09 12:07:58 +00001686/*** <<< CTDEFS [Str4] >>> ***/
1687
vlma0da1a32006-10-09 12:27:44 +00001688static asn_per_constraints_t asn_PER_type_Str4_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00001689 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1690 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1691 0, 0 /* No PER character map necessary */
1692};
1693
vlm337167e2005-11-26 11:25:14 +00001694/*** <<< STAT-DEFS [Str4] >>> ***/
1695
1696static ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
1697 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1698};
vlm337167e2005-11-26 11:25:14 +00001699asn_TYPE_descriptor_t asn_DEF_Str4 = {
1700 "Str4",
1701 "Str4",
1702 Str4_free,
1703 Str4_print,
1704 Str4_constraint,
1705 Str4_decode_ber,
1706 Str4_encode_der,
1707 Str4_decode_xer,
1708 Str4_encode_xer,
1709 Str4_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001710 Str4_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001711 0, /* Use generic outmost tag fetcher */
1712 asn_DEF_Str4_tags_1,
1713 sizeof(asn_DEF_Str4_tags_1)
1714 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1715 asn_DEF_Str4_tags_1, /* Same as above */
1716 sizeof(asn_DEF_Str4_tags_1)
1717 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00001718 &asn_PER_type_Str4_constr_1,
vlm337167e2005-11-26 11:25:14 +00001719 0, 0, /* No members */
1720 0 /* No specifics */
1721};
1722
1723
1724/*** <<< INCLUDES [PER-Visible] >>> ***/
1725
1726#include <IA5String.h>
1727
1728/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1729
1730typedef IA5String_t PER_Visible_t;
1731
1732/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1733
1734extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
1735asn_struct_free_f PER_Visible_free;
1736asn_struct_print_f PER_Visible_print;
1737asn_constr_check_f PER_Visible_constraint;
1738ber_type_decoder_f PER_Visible_decode_ber;
1739der_type_encoder_f PER_Visible_encode_der;
1740xer_type_decoder_f PER_Visible_decode_xer;
1741xer_type_encoder_f PER_Visible_encode_xer;
1742per_type_decoder_f PER_Visible_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001743per_type_encoder_f PER_Visible_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001744
1745/*** <<< CTABLES [PER-Visible] >>> ***/
1746
1747static int check_permitted_alphabet_1(const void *sptr) {
1748 /* The underlying type is IA5String */
1749 const IA5String_t *st = (const IA5String_t *)sptr;
1750 const uint8_t *ch = st->buf;
1751 const uint8_t *end = ch + st->size;
1752
1753 for(; ch < end; ch++) {
1754 uint8_t cv = *ch;
1755 if(!(cv >= 65 && cv <= 70)) return -1;
1756 }
1757 return 0;
1758}
1759
1760
1761/*** <<< CODE [PER-Visible] >>> ***/
1762
1763int
1764PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001765 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001766 const IA5String_t *st = (const IA5String_t *)sptr;
1767
1768 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001769 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001770 "%s: value not given (%s:%d)",
1771 td->name, __FILE__, __LINE__);
1772 return -1;
1773 }
1774
1775
1776 if(!check_permitted_alphabet_1(st)) {
1777 /* Constraint check succeeded */
1778 return 0;
1779 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001780 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001781 "%s: constraint failed (%s:%d)",
1782 td->name, __FILE__, __LINE__);
1783 return -1;
1784 }
1785}
1786
1787/*
1788 * This type is implemented using IA5String,
1789 * so here we adjust the DEF accordingly.
1790 */
1791static void
1792PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1793 td->free_struct = asn_DEF_IA5String.free_struct;
1794 td->print_struct = asn_DEF_IA5String.print_struct;
1795 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1796 td->der_encoder = asn_DEF_IA5String.der_encoder;
1797 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1798 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1799 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001800 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001801 if(!td->per_constraints)
1802 td->per_constraints = asn_DEF_IA5String.per_constraints;
1803 td->elements = asn_DEF_IA5String.elements;
1804 td->elements_count = asn_DEF_IA5String.elements_count;
1805 td->specifics = asn_DEF_IA5String.specifics;
1806}
1807
1808void
1809PER_Visible_free(asn_TYPE_descriptor_t *td,
1810 void *struct_ptr, int contents_only) {
1811 PER_Visible_1_inherit_TYPE_descriptor(td);
1812 td->free_struct(td, struct_ptr, contents_only);
1813}
1814
1815int
1816PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1817 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1818 PER_Visible_1_inherit_TYPE_descriptor(td);
1819 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1820}
1821
1822asn_dec_rval_t
1823PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1824 void **structure, const void *bufptr, size_t size, int tag_mode) {
1825 PER_Visible_1_inherit_TYPE_descriptor(td);
1826 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1827}
1828
1829asn_enc_rval_t
1830PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
1831 void *structure, int tag_mode, ber_tlv_tag_t tag,
1832 asn_app_consume_bytes_f *cb, void *app_key) {
1833 PER_Visible_1_inherit_TYPE_descriptor(td);
1834 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1835}
1836
1837asn_dec_rval_t
1838PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1839 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1840 PER_Visible_1_inherit_TYPE_descriptor(td);
1841 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1842}
1843
1844asn_enc_rval_t
1845PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1846 int ilevel, enum xer_encoder_flags_e flags,
1847 asn_app_consume_bytes_f *cb, void *app_key) {
1848 PER_Visible_1_inherit_TYPE_descriptor(td);
1849 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1850}
1851
1852asn_dec_rval_t
1853PER_Visible_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1854 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1855 PER_Visible_1_inherit_TYPE_descriptor(td);
1856 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1857}
1858
vlmb1b193e2006-08-18 01:46:46 +00001859asn_enc_rval_t
1860PER_Visible_encode_uper(asn_TYPE_descriptor_t *td,
1861 asn_per_constraints_t *constraints,
1862 void *structure, asn_per_outp_t *per_out) {
1863 PER_Visible_1_inherit_TYPE_descriptor(td);
1864 return td->uper_encoder(td, constraints, structure, per_out);
1865}
1866
vlm337167e2005-11-26 11:25:14 +00001867
vlm86380d32006-10-09 12:07:58 +00001868/*** <<< CTDEFS [PER-Visible] >>> ***/
1869
vlma0da1a32006-10-09 12:27:44 +00001870static asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00001871 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1872 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1873 0, 0 /* No PER character map necessary */
1874};
1875
vlm337167e2005-11-26 11:25:14 +00001876/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1877
1878static ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
1879 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1880};
vlm337167e2005-11-26 11:25:14 +00001881asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1882 "PER-Visible",
1883 "PER-Visible",
1884 PER_Visible_free,
1885 PER_Visible_print,
1886 PER_Visible_constraint,
1887 PER_Visible_decode_ber,
1888 PER_Visible_encode_der,
1889 PER_Visible_decode_xer,
1890 PER_Visible_encode_xer,
1891 PER_Visible_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00001892 PER_Visible_encode_uper,
vlm337167e2005-11-26 11:25:14 +00001893 0, /* Use generic outmost tag fetcher */
1894 asn_DEF_PER_Visible_tags_1,
1895 sizeof(asn_DEF_PER_Visible_tags_1)
1896 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1897 asn_DEF_PER_Visible_tags_1, /* Same as above */
1898 sizeof(asn_DEF_PER_Visible_tags_1)
1899 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00001900 &asn_PER_type_PER_Visible_constr_1,
vlm337167e2005-11-26 11:25:14 +00001901 0, 0, /* No members */
1902 0 /* No specifics */
1903};
1904
1905
1906/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1907
vlmea226772006-09-13 02:51:20 +00001908#include "PER-Visible.h"
vlm337167e2005-11-26 11:25:14 +00001909
1910/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1911
1912typedef PER_Visible_t PER_Visible_2_t;
1913
1914/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1915
1916extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1917asn_struct_free_f PER_Visible_2_free;
1918asn_struct_print_f PER_Visible_2_print;
1919asn_constr_check_f PER_Visible_2_constraint;
1920ber_type_decoder_f PER_Visible_2_decode_ber;
1921der_type_encoder_f PER_Visible_2_encode_der;
1922xer_type_decoder_f PER_Visible_2_decode_xer;
1923xer_type_encoder_f PER_Visible_2_encode_xer;
1924per_type_decoder_f PER_Visible_2_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00001925per_type_encoder_f PER_Visible_2_encode_uper;
vlm337167e2005-11-26 11:25:14 +00001926
1927/*** <<< CTABLES [PER-Visible-2] >>> ***/
1928
1929static int check_permitted_alphabet_1(const void *sptr) {
1930 /* The underlying type is IA5String */
1931 const IA5String_t *st = (const IA5String_t *)sptr;
1932 const uint8_t *ch = st->buf;
1933 const uint8_t *end = ch + st->size;
1934
1935 for(; ch < end; ch++) {
1936 uint8_t cv = *ch;
1937 if(!(cv >= 69 && cv <= 70)) return -1;
1938 }
1939 return 0;
1940}
1941
1942
1943/*** <<< CODE [PER-Visible-2] >>> ***/
1944
1945int
1946PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00001947 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00001948 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1949
1950 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00001951 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001952 "%s: value not given (%s:%d)",
1953 td->name, __FILE__, __LINE__);
1954 return -1;
1955 }
1956
1957
1958 if(!check_permitted_alphabet_1(st)) {
1959 /* Constraint check succeeded */
1960 return 0;
1961 } else {
vlmd4ae41c2006-07-13 13:28:32 +00001962 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00001963 "%s: constraint failed (%s:%d)",
1964 td->name, __FILE__, __LINE__);
1965 return -1;
1966 }
1967}
1968
1969/*
1970 * This type is implemented using PER_Visible,
1971 * so here we adjust the DEF accordingly.
1972 */
1973static void
1974PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1975 td->free_struct = asn_DEF_PER_Visible.free_struct;
1976 td->print_struct = asn_DEF_PER_Visible.print_struct;
1977 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1978 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1979 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1980 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1981 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00001982 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00001983 if(!td->per_constraints)
1984 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
1985 td->elements = asn_DEF_PER_Visible.elements;
1986 td->elements_count = asn_DEF_PER_Visible.elements_count;
1987 td->specifics = asn_DEF_PER_Visible.specifics;
1988}
1989
1990void
1991PER_Visible_2_free(asn_TYPE_descriptor_t *td,
1992 void *struct_ptr, int contents_only) {
1993 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1994 td->free_struct(td, struct_ptr, contents_only);
1995}
1996
1997int
1998PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1999 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2000 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2001 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2002}
2003
2004asn_dec_rval_t
2005PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2006 void **structure, const void *bufptr, size_t size, int tag_mode) {
2007 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2008 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2009}
2010
2011asn_enc_rval_t
2012PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2013 void *structure, int tag_mode, ber_tlv_tag_t tag,
2014 asn_app_consume_bytes_f *cb, void *app_key) {
2015 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2016 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2017}
2018
2019asn_dec_rval_t
2020PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2021 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2022 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2023 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2024}
2025
2026asn_enc_rval_t
2027PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2028 int ilevel, enum xer_encoder_flags_e flags,
2029 asn_app_consume_bytes_f *cb, void *app_key) {
2030 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2031 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2032}
2033
2034asn_dec_rval_t
2035PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2036 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2037 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2038 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2039}
2040
vlmb1b193e2006-08-18 01:46:46 +00002041asn_enc_rval_t
2042PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2043 asn_per_constraints_t *constraints,
2044 void *structure, asn_per_outp_t *per_out) {
2045 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2046 return td->uper_encoder(td, constraints, structure, per_out);
2047}
2048
vlm337167e2005-11-26 11:25:14 +00002049
vlm86380d32006-10-09 12:07:58 +00002050/*** <<< CTDEFS [PER-Visible-2] >>> ***/
2051
vlma0da1a32006-10-09 12:27:44 +00002052static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00002053 { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */,
2054 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2055 0, 0 /* No PER character map necessary */
2056};
2057
vlm337167e2005-11-26 11:25:14 +00002058/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
2059
2060static ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
2061 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2062};
vlm337167e2005-11-26 11:25:14 +00002063asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
2064 "PER-Visible-2",
2065 "PER-Visible-2",
2066 PER_Visible_2_free,
2067 PER_Visible_2_print,
2068 PER_Visible_2_constraint,
2069 PER_Visible_2_decode_ber,
2070 PER_Visible_2_encode_der,
2071 PER_Visible_2_decode_xer,
2072 PER_Visible_2_encode_xer,
2073 PER_Visible_2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002074 PER_Visible_2_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002075 0, /* Use generic outmost tag fetcher */
2076 asn_DEF_PER_Visible_2_tags_1,
2077 sizeof(asn_DEF_PER_Visible_2_tags_1)
2078 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
2079 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
2080 sizeof(asn_DEF_PER_Visible_2_tags_1)
2081 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00002082 &asn_PER_type_PER_Visible_2_constr_1,
vlm337167e2005-11-26 11:25:14 +00002083 0, 0, /* No members */
2084 0 /* No specifics */
2085};
2086
2087
2088/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
2089
vlmea226772006-09-13 02:51:20 +00002090#include "PER-Visible.h"
vlm337167e2005-11-26 11:25:14 +00002091
2092/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
2093
2094typedef PER_Visible_t Not_PER_Visible_1_t;
2095
2096/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
2097
2098extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
2099asn_struct_free_f Not_PER_Visible_1_free;
2100asn_struct_print_f Not_PER_Visible_1_print;
2101asn_constr_check_f Not_PER_Visible_1_constraint;
2102ber_type_decoder_f Not_PER_Visible_1_decode_ber;
2103der_type_encoder_f Not_PER_Visible_1_encode_der;
2104xer_type_decoder_f Not_PER_Visible_1_decode_xer;
2105xer_type_encoder_f Not_PER_Visible_1_encode_xer;
2106per_type_decoder_f Not_PER_Visible_1_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002107per_type_encoder_f Not_PER_Visible_1_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002108
2109/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
2110
2111static int check_permitted_alphabet_1(const void *sptr) {
2112 /* The underlying type is IA5String */
2113 const IA5String_t *st = (const IA5String_t *)sptr;
2114 const uint8_t *ch = st->buf;
2115 const uint8_t *end = ch + st->size;
2116
2117 for(; ch < end; ch++) {
2118 uint8_t cv = *ch;
2119 if(!(cv >= 65 && cv <= 70)) return -1;
2120 }
2121 return 0;
2122}
2123
2124
2125/*** <<< CODE [Not-PER-Visible-1] >>> ***/
2126
2127int
2128Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002129 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002130 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2131
2132 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002133 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002134 "%s: value not given (%s:%d)",
2135 td->name, __FILE__, __LINE__);
2136 return -1;
2137 }
2138
2139
2140 if(!check_permitted_alphabet_1(st)) {
2141 /* Constraint check succeeded */
2142 return 0;
2143 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002144 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002145 "%s: constraint failed (%s:%d)",
2146 td->name, __FILE__, __LINE__);
2147 return -1;
2148 }
2149}
2150
2151/*
2152 * This type is implemented using PER_Visible,
2153 * so here we adjust the DEF accordingly.
2154 */
2155static void
2156Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2157 td->free_struct = asn_DEF_PER_Visible.free_struct;
2158 td->print_struct = asn_DEF_PER_Visible.print_struct;
2159 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2160 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2161 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2162 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2163 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002164 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002165 if(!td->per_constraints)
2166 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2167 td->elements = asn_DEF_PER_Visible.elements;
2168 td->elements_count = asn_DEF_PER_Visible.elements_count;
2169 td->specifics = asn_DEF_PER_Visible.specifics;
2170}
2171
2172void
2173Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
2174 void *struct_ptr, int contents_only) {
2175 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2176 td->free_struct(td, struct_ptr, contents_only);
2177}
2178
2179int
2180Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2181 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2182 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2183 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2184}
2185
2186asn_dec_rval_t
2187Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2188 void **structure, const void *bufptr, size_t size, int tag_mode) {
2189 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2190 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2191}
2192
2193asn_enc_rval_t
2194Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
2195 void *structure, int tag_mode, ber_tlv_tag_t tag,
2196 asn_app_consume_bytes_f *cb, void *app_key) {
2197 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2198 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2199}
2200
2201asn_dec_rval_t
2202Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2203 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2204 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2205 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2206}
2207
2208asn_enc_rval_t
2209Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2210 int ilevel, enum xer_encoder_flags_e flags,
2211 asn_app_consume_bytes_f *cb, void *app_key) {
2212 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2213 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2214}
2215
2216asn_dec_rval_t
2217Not_PER_Visible_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2218 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2219 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2220 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2221}
2222
vlmb1b193e2006-08-18 01:46:46 +00002223asn_enc_rval_t
2224Not_PER_Visible_1_encode_uper(asn_TYPE_descriptor_t *td,
2225 asn_per_constraints_t *constraints,
2226 void *structure, asn_per_outp_t *per_out) {
2227 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2228 return td->uper_encoder(td, constraints, structure, per_out);
2229}
2230
vlm337167e2005-11-26 11:25:14 +00002231
vlm86380d32006-10-09 12:07:58 +00002232/*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/
2233
vlma0da1a32006-10-09 12:27:44 +00002234static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00002235 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
2236 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2237 0, 0 /* No PER character map necessary */
2238};
2239
vlm337167e2005-11-26 11:25:14 +00002240/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
2241
2242static ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
2243 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2244};
vlm337167e2005-11-26 11:25:14 +00002245asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
2246 "Not-PER-Visible-1",
2247 "Not-PER-Visible-1",
2248 Not_PER_Visible_1_free,
2249 Not_PER_Visible_1_print,
2250 Not_PER_Visible_1_constraint,
2251 Not_PER_Visible_1_decode_ber,
2252 Not_PER_Visible_1_encode_der,
2253 Not_PER_Visible_1_decode_xer,
2254 Not_PER_Visible_1_encode_xer,
2255 Not_PER_Visible_1_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002256 Not_PER_Visible_1_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002257 0, /* Use generic outmost tag fetcher */
2258 asn_DEF_Not_PER_Visible_1_tags_1,
2259 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2260 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2261 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
2262 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2263 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00002264 &asn_PER_type_Not_PER_Visible_1_constr_1,
vlm337167e2005-11-26 11:25:14 +00002265 0, 0, /* No members */
2266 0 /* No specifics */
2267};
2268
2269
2270/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
2271
vlmea226772006-09-13 02:51:20 +00002272#include "PER-Visible.h"
vlm337167e2005-11-26 11:25:14 +00002273
2274/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
2275
2276typedef PER_Visible_t Not_PER_Visible_2_t;
2277
2278/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
2279
2280extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
2281asn_struct_free_f Not_PER_Visible_2_free;
2282asn_struct_print_f Not_PER_Visible_2_print;
2283asn_constr_check_f Not_PER_Visible_2_constraint;
2284ber_type_decoder_f Not_PER_Visible_2_decode_ber;
2285der_type_encoder_f Not_PER_Visible_2_encode_der;
2286xer_type_decoder_f Not_PER_Visible_2_decode_xer;
2287xer_type_encoder_f Not_PER_Visible_2_encode_xer;
2288per_type_decoder_f Not_PER_Visible_2_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002289per_type_encoder_f Not_PER_Visible_2_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002290
2291/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
2292
2293static int check_permitted_alphabet_1(const void *sptr) {
2294 /* The underlying type is IA5String */
2295 const IA5String_t *st = (const IA5String_t *)sptr;
2296 const uint8_t *ch = st->buf;
2297 const uint8_t *end = ch + st->size;
2298
2299 for(; ch < end; ch++) {
2300 uint8_t cv = *ch;
2301 if(!(cv >= 65 && cv <= 66)) return -1;
2302 }
2303 return 0;
2304}
2305
2306
2307/*** <<< CODE [Not-PER-Visible-2] >>> ***/
2308
2309int
2310Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002311 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002312 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2313
2314 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002315 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002316 "%s: value not given (%s:%d)",
2317 td->name, __FILE__, __LINE__);
2318 return -1;
2319 }
2320
2321
2322 if(!check_permitted_alphabet_1(st)) {
2323 /* Constraint check succeeded */
2324 return 0;
2325 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002326 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002327 "%s: constraint failed (%s:%d)",
2328 td->name, __FILE__, __LINE__);
2329 return -1;
2330 }
2331}
2332
2333/*
2334 * This type is implemented using PER_Visible,
2335 * so here we adjust the DEF accordingly.
2336 */
2337static void
2338Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2339 td->free_struct = asn_DEF_PER_Visible.free_struct;
2340 td->print_struct = asn_DEF_PER_Visible.print_struct;
2341 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2342 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2343 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2344 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2345 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002346 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002347 if(!td->per_constraints)
2348 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2349 td->elements = asn_DEF_PER_Visible.elements;
2350 td->elements_count = asn_DEF_PER_Visible.elements_count;
2351 td->specifics = asn_DEF_PER_Visible.specifics;
2352}
2353
2354void
2355Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2356 void *struct_ptr, int contents_only) {
2357 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2358 td->free_struct(td, struct_ptr, contents_only);
2359}
2360
2361int
2362Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2363 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2364 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2365 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2366}
2367
2368asn_dec_rval_t
2369Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2370 void **structure, const void *bufptr, size_t size, int tag_mode) {
2371 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2372 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2373}
2374
2375asn_enc_rval_t
2376Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2377 void *structure, int tag_mode, ber_tlv_tag_t tag,
2378 asn_app_consume_bytes_f *cb, void *app_key) {
2379 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2380 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2381}
2382
2383asn_dec_rval_t
2384Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2385 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2386 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2387 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2388}
2389
2390asn_enc_rval_t
2391Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2392 int ilevel, enum xer_encoder_flags_e flags,
2393 asn_app_consume_bytes_f *cb, void *app_key) {
2394 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2395 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2396}
2397
2398asn_dec_rval_t
2399Not_PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2400 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2401 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2402 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2403}
2404
vlmb1b193e2006-08-18 01:46:46 +00002405asn_enc_rval_t
2406Not_PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2407 asn_per_constraints_t *constraints,
2408 void *structure, asn_per_outp_t *per_out) {
2409 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2410 return td->uper_encoder(td, constraints, structure, per_out);
2411}
2412
vlm337167e2005-11-26 11:25:14 +00002413
vlm86380d32006-10-09 12:07:58 +00002414/*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/
2415
vlma0da1a32006-10-09 12:27:44 +00002416static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00002417 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2418 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2419 0, 0 /* No PER character map necessary */
2420};
2421
vlm337167e2005-11-26 11:25:14 +00002422/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
2423
2424static ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
2425 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2426};
vlm337167e2005-11-26 11:25:14 +00002427asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
2428 "Not-PER-Visible-2",
2429 "Not-PER-Visible-2",
2430 Not_PER_Visible_2_free,
2431 Not_PER_Visible_2_print,
2432 Not_PER_Visible_2_constraint,
2433 Not_PER_Visible_2_decode_ber,
2434 Not_PER_Visible_2_encode_der,
2435 Not_PER_Visible_2_decode_xer,
2436 Not_PER_Visible_2_encode_xer,
2437 Not_PER_Visible_2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002438 Not_PER_Visible_2_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002439 0, /* Use generic outmost tag fetcher */
2440 asn_DEF_Not_PER_Visible_2_tags_1,
2441 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2442 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2443 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
2444 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2445 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00002446 &asn_PER_type_Not_PER_Visible_2_constr_1,
vlm337167e2005-11-26 11:25:14 +00002447 0, 0, /* No members */
2448 0 /* No specifics */
2449};
2450
2451
2452/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2453
vlmea226772006-09-13 02:51:20 +00002454#include "PER-Visible.h"
vlm337167e2005-11-26 11:25:14 +00002455
2456/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2457
2458typedef PER_Visible_t Not_PER_Visible_3_t;
2459
2460/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2461
2462extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
2463asn_struct_free_f Not_PER_Visible_3_free;
2464asn_struct_print_f Not_PER_Visible_3_print;
2465asn_constr_check_f Not_PER_Visible_3_constraint;
2466ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2467der_type_encoder_f Not_PER_Visible_3_encode_der;
2468xer_type_decoder_f Not_PER_Visible_3_decode_xer;
2469xer_type_encoder_f Not_PER_Visible_3_encode_xer;
2470per_type_decoder_f Not_PER_Visible_3_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002471per_type_encoder_f Not_PER_Visible_3_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002472
2473/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2474
2475static int check_permitted_alphabet_1(const void *sptr) {
2476 /* The underlying type is IA5String */
2477 const IA5String_t *st = (const IA5String_t *)sptr;
2478 const uint8_t *ch = st->buf;
2479 const uint8_t *end = ch + st->size;
2480
2481 for(; ch < end; ch++) {
2482 uint8_t cv = *ch;
2483 if(!(cv >= 65 && cv <= 66)) return -1;
2484 }
2485 return 0;
2486}
2487
2488
2489/*** <<< CODE [Not-PER-Visible-3] >>> ***/
2490
2491int
2492Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002493 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002494 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2495
2496 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002497 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002498 "%s: value not given (%s:%d)",
2499 td->name, __FILE__, __LINE__);
2500 return -1;
2501 }
2502
2503
2504 if(!check_permitted_alphabet_1(st)) {
2505 /* Constraint check succeeded */
2506 return 0;
2507 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002508 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002509 "%s: constraint failed (%s:%d)",
2510 td->name, __FILE__, __LINE__);
2511 return -1;
2512 }
2513}
2514
2515/*
2516 * This type is implemented using PER_Visible,
2517 * so here we adjust the DEF accordingly.
2518 */
2519static void
2520Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2521 td->free_struct = asn_DEF_PER_Visible.free_struct;
2522 td->print_struct = asn_DEF_PER_Visible.print_struct;
2523 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2524 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2525 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2526 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2527 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002528 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002529 if(!td->per_constraints)
2530 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2531 td->elements = asn_DEF_PER_Visible.elements;
2532 td->elements_count = asn_DEF_PER_Visible.elements_count;
2533 td->specifics = asn_DEF_PER_Visible.specifics;
2534}
2535
2536void
2537Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
2538 void *struct_ptr, int contents_only) {
2539 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2540 td->free_struct(td, struct_ptr, contents_only);
2541}
2542
2543int
2544Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2545 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2546 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2547 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2548}
2549
2550asn_dec_rval_t
2551Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2552 void **structure, const void *bufptr, size_t size, int tag_mode) {
2553 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2554 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2555}
2556
2557asn_enc_rval_t
2558Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
2559 void *structure, int tag_mode, ber_tlv_tag_t tag,
2560 asn_app_consume_bytes_f *cb, void *app_key) {
2561 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2562 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2563}
2564
2565asn_dec_rval_t
2566Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2567 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2568 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2569 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2570}
2571
2572asn_enc_rval_t
2573Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2574 int ilevel, enum xer_encoder_flags_e flags,
2575 asn_app_consume_bytes_f *cb, void *app_key) {
2576 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2577 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2578}
2579
2580asn_dec_rval_t
2581Not_PER_Visible_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2582 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2583 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2584 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2585}
2586
vlmb1b193e2006-08-18 01:46:46 +00002587asn_enc_rval_t
2588Not_PER_Visible_3_encode_uper(asn_TYPE_descriptor_t *td,
2589 asn_per_constraints_t *constraints,
2590 void *structure, asn_per_outp_t *per_out) {
2591 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2592 return td->uper_encoder(td, constraints, structure, per_out);
2593}
2594
vlm337167e2005-11-26 11:25:14 +00002595
vlm86380d32006-10-09 12:07:58 +00002596/*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/
2597
vlma0da1a32006-10-09 12:27:44 +00002598static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00002599 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2600 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2601 0, 0 /* No PER character map necessary */
2602};
2603
vlm337167e2005-11-26 11:25:14 +00002604/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2605
2606static ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
2607 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2608};
vlm337167e2005-11-26 11:25:14 +00002609asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
2610 "Not-PER-Visible-3",
2611 "Not-PER-Visible-3",
2612 Not_PER_Visible_3_free,
2613 Not_PER_Visible_3_print,
2614 Not_PER_Visible_3_constraint,
2615 Not_PER_Visible_3_decode_ber,
2616 Not_PER_Visible_3_encode_der,
2617 Not_PER_Visible_3_decode_xer,
2618 Not_PER_Visible_3_encode_xer,
2619 Not_PER_Visible_3_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002620 Not_PER_Visible_3_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002621 0, /* Use generic outmost tag fetcher */
2622 asn_DEF_Not_PER_Visible_3_tags_1,
2623 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2624 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2625 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
2626 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2627 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00002628 &asn_PER_type_Not_PER_Visible_3_constr_1,
vlm337167e2005-11-26 11:25:14 +00002629 0, 0, /* No members */
2630 0 /* No specifics */
2631};
2632
2633
2634/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2635
vlmea226772006-09-13 02:51:20 +00002636#include "PER-Visible.h"
vlm337167e2005-11-26 11:25:14 +00002637
2638/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2639
2640typedef PER_Visible_t SIZE_but_not_FROM_t;
2641
2642/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2643
2644extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
2645asn_struct_free_f SIZE_but_not_FROM_free;
2646asn_struct_print_f SIZE_but_not_FROM_print;
2647asn_constr_check_f SIZE_but_not_FROM_constraint;
2648ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2649der_type_encoder_f SIZE_but_not_FROM_encode_der;
2650xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
2651xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
2652per_type_decoder_f SIZE_but_not_FROM_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002653per_type_encoder_f SIZE_but_not_FROM_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002654
2655/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2656
2657static int check_permitted_alphabet_1(const void *sptr) {
2658 /* The underlying type is IA5String */
2659 const IA5String_t *st = (const IA5String_t *)sptr;
2660 const uint8_t *ch = st->buf;
2661 const uint8_t *end = ch + st->size;
2662
2663 for(; ch < end; ch++) {
2664 uint8_t cv = *ch;
2665 if(!(cv >= 65 && cv <= 68)) return -1;
2666 }
2667 return 0;
2668}
2669
2670
2671/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2672
2673int
2674SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002675 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002676 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2677 size_t size;
2678
2679 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002680 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002681 "%s: value not given (%s:%d)",
2682 td->name, __FILE__, __LINE__);
2683 return -1;
2684 }
2685
2686 size = st->size;
2687
2688 if((size >= 1 && size <= 4)
2689 && !check_permitted_alphabet_1(st)) {
2690 /* Constraint check succeeded */
2691 return 0;
2692 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002693 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002694 "%s: constraint failed (%s:%d)",
2695 td->name, __FILE__, __LINE__);
2696 return -1;
2697 }
2698}
2699
2700/*
2701 * This type is implemented using PER_Visible,
2702 * so here we adjust the DEF accordingly.
2703 */
2704static void
2705SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2706 td->free_struct = asn_DEF_PER_Visible.free_struct;
2707 td->print_struct = asn_DEF_PER_Visible.print_struct;
2708 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2709 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2710 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2711 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2712 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002713 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002714 if(!td->per_constraints)
2715 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2716 td->elements = asn_DEF_PER_Visible.elements;
2717 td->elements_count = asn_DEF_PER_Visible.elements_count;
2718 td->specifics = asn_DEF_PER_Visible.specifics;
2719}
2720
2721void
2722SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
2723 void *struct_ptr, int contents_only) {
2724 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2725 td->free_struct(td, struct_ptr, contents_only);
2726}
2727
2728int
2729SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2730 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2731 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2732 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2733}
2734
2735asn_dec_rval_t
2736SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2737 void **structure, const void *bufptr, size_t size, int tag_mode) {
2738 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2739 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2740}
2741
2742asn_enc_rval_t
2743SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
2744 void *structure, int tag_mode, ber_tlv_tag_t tag,
2745 asn_app_consume_bytes_f *cb, void *app_key) {
2746 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2747 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2748}
2749
2750asn_dec_rval_t
2751SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2752 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2753 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2754 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2755}
2756
2757asn_enc_rval_t
2758SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2759 int ilevel, enum xer_encoder_flags_e flags,
2760 asn_app_consume_bytes_f *cb, void *app_key) {
2761 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2762 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2763}
2764
2765asn_dec_rval_t
2766SIZE_but_not_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2767 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2768 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2769 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2770}
2771
vlmb1b193e2006-08-18 01:46:46 +00002772asn_enc_rval_t
2773SIZE_but_not_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2774 asn_per_constraints_t *constraints,
2775 void *structure, asn_per_outp_t *per_out) {
2776 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2777 return td->uper_encoder(td, constraints, structure, per_out);
2778}
2779
vlm337167e2005-11-26 11:25:14 +00002780
vlm86380d32006-10-09 12:07:58 +00002781/*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/
2782
vlma0da1a32006-10-09 12:27:44 +00002783static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00002784 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2785 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
2786 0, 0 /* No PER character map necessary */
2787};
2788
vlm337167e2005-11-26 11:25:14 +00002789/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2790
2791static ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
2792 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2793};
vlm337167e2005-11-26 11:25:14 +00002794asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
2795 "SIZE-but-not-FROM",
2796 "SIZE-but-not-FROM",
2797 SIZE_but_not_FROM_free,
2798 SIZE_but_not_FROM_print,
2799 SIZE_but_not_FROM_constraint,
2800 SIZE_but_not_FROM_decode_ber,
2801 SIZE_but_not_FROM_encode_der,
2802 SIZE_but_not_FROM_decode_xer,
2803 SIZE_but_not_FROM_encode_xer,
2804 SIZE_but_not_FROM_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002805 SIZE_but_not_FROM_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002806 0, /* Use generic outmost tag fetcher */
2807 asn_DEF_SIZE_but_not_FROM_tags_1,
2808 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2809 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2810 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
2811 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2812 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00002813 &asn_PER_type_SIZE_but_not_FROM_constr_1,
vlm337167e2005-11-26 11:25:14 +00002814 0, 0, /* No members */
2815 0 /* No specifics */
2816};
2817
2818
2819/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2820
vlmea226772006-09-13 02:51:20 +00002821#include "PER-Visible.h"
vlm337167e2005-11-26 11:25:14 +00002822
2823/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2824
2825typedef PER_Visible_t SIZE_and_FROM_t;
2826
2827/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2828
2829extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
2830asn_struct_free_f SIZE_and_FROM_free;
2831asn_struct_print_f SIZE_and_FROM_print;
2832asn_constr_check_f SIZE_and_FROM_constraint;
2833ber_type_decoder_f SIZE_and_FROM_decode_ber;
2834der_type_encoder_f SIZE_and_FROM_encode_der;
2835xer_type_decoder_f SIZE_and_FROM_decode_xer;
2836xer_type_encoder_f SIZE_and_FROM_encode_xer;
2837per_type_decoder_f SIZE_and_FROM_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00002838per_type_encoder_f SIZE_and_FROM_encode_uper;
vlm337167e2005-11-26 11:25:14 +00002839
2840/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2841
2842static int check_permitted_alphabet_1(const void *sptr) {
2843 /* The underlying type is IA5String */
2844 const IA5String_t *st = (const IA5String_t *)sptr;
2845 const uint8_t *ch = st->buf;
2846 const uint8_t *end = ch + st->size;
2847
2848 for(; ch < end; ch++) {
2849 uint8_t cv = *ch;
2850 if(!(cv >= 65 && cv <= 68)) return -1;
2851 }
2852 return 0;
2853}
2854
2855
2856/*** <<< CODE [SIZE-and-FROM] >>> ***/
2857
2858int
2859SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00002860 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00002861 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2862 size_t size;
2863
2864 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00002865 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002866 "%s: value not given (%s:%d)",
2867 td->name, __FILE__, __LINE__);
2868 return -1;
2869 }
2870
2871 size = st->size;
2872
2873 if((size >= 1 && size <= 4)
2874 && !check_permitted_alphabet_1(st)) {
2875 /* Constraint check succeeded */
2876 return 0;
2877 } else {
vlmd4ae41c2006-07-13 13:28:32 +00002878 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00002879 "%s: constraint failed (%s:%d)",
2880 td->name, __FILE__, __LINE__);
2881 return -1;
2882 }
2883}
2884
2885/*
2886 * This type is implemented using PER_Visible,
2887 * so here we adjust the DEF accordingly.
2888 */
2889static void
2890SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2891 td->free_struct = asn_DEF_PER_Visible.free_struct;
2892 td->print_struct = asn_DEF_PER_Visible.print_struct;
2893 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2894 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2895 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2896 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2897 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00002898 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00002899 if(!td->per_constraints)
2900 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2901 td->elements = asn_DEF_PER_Visible.elements;
2902 td->elements_count = asn_DEF_PER_Visible.elements_count;
2903 td->specifics = asn_DEF_PER_Visible.specifics;
2904}
2905
2906void
2907SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
2908 void *struct_ptr, int contents_only) {
2909 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2910 td->free_struct(td, struct_ptr, contents_only);
2911}
2912
2913int
2914SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2915 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2916 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2917 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2918}
2919
2920asn_dec_rval_t
2921SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2922 void **structure, const void *bufptr, size_t size, int tag_mode) {
2923 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2924 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2925}
2926
2927asn_enc_rval_t
2928SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
2929 void *structure, int tag_mode, ber_tlv_tag_t tag,
2930 asn_app_consume_bytes_f *cb, void *app_key) {
2931 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2932 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2933}
2934
2935asn_dec_rval_t
2936SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2937 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2938 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2939 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2940}
2941
2942asn_enc_rval_t
2943SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2944 int ilevel, enum xer_encoder_flags_e flags,
2945 asn_app_consume_bytes_f *cb, void *app_key) {
2946 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2947 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2948}
2949
2950asn_dec_rval_t
2951SIZE_and_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2952 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2953 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2954 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2955}
2956
vlmb1b193e2006-08-18 01:46:46 +00002957asn_enc_rval_t
2958SIZE_and_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2959 asn_per_constraints_t *constraints,
2960 void *structure, asn_per_outp_t *per_out) {
2961 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2962 return td->uper_encoder(td, constraints, structure, per_out);
2963}
2964
vlm337167e2005-11-26 11:25:14 +00002965
vlm86380d32006-10-09 12:07:58 +00002966/*** <<< CTDEFS [SIZE-and-FROM] >>> ***/
2967
vlma0da1a32006-10-09 12:27:44 +00002968static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00002969 { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */,
2970 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
2971 0, 0 /* No PER character map necessary */
2972};
2973
vlm337167e2005-11-26 11:25:14 +00002974/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
2975
2976static ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
2977 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2978};
vlm337167e2005-11-26 11:25:14 +00002979asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
2980 "SIZE-and-FROM",
2981 "SIZE-and-FROM",
2982 SIZE_and_FROM_free,
2983 SIZE_and_FROM_print,
2984 SIZE_and_FROM_constraint,
2985 SIZE_and_FROM_decode_ber,
2986 SIZE_and_FROM_encode_der,
2987 SIZE_and_FROM_decode_xer,
2988 SIZE_and_FROM_encode_xer,
2989 SIZE_and_FROM_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00002990 SIZE_and_FROM_encode_uper,
vlm337167e2005-11-26 11:25:14 +00002991 0, /* Use generic outmost tag fetcher */
2992 asn_DEF_SIZE_and_FROM_tags_1,
2993 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2994 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2995 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
2996 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2997 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00002998 &asn_PER_type_SIZE_and_FROM_constr_1,
vlm337167e2005-11-26 11:25:14 +00002999 0, 0, /* No members */
3000 0 /* No specifics */
3001};
3002
3003
3004/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
3005
vlmea226772006-09-13 02:51:20 +00003006#include "PER-Visible.h"
vlm337167e2005-11-26 11:25:14 +00003007
3008/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
3009
3010typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
3011
3012/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
3013
3014extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
3015asn_struct_free_f Neither_SIZE_nor_FROM_free;
3016asn_struct_print_f Neither_SIZE_nor_FROM_print;
3017asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
3018ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
3019der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
3020xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
3021xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
3022per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003023per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003024
3025/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
3026
3027static int check_permitted_alphabet_1(const void *sptr) {
3028 /* The underlying type is IA5String */
3029 const IA5String_t *st = (const IA5String_t *)sptr;
3030 const uint8_t *ch = st->buf;
3031 const uint8_t *end = ch + st->size;
3032
3033 for(; ch < end; ch++) {
3034 uint8_t cv = *ch;
3035 if(!(cv >= 65 && cv <= 70)) return -1;
3036 }
3037 return 0;
3038}
3039
3040
3041/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
3042
3043int
3044Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003045 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003046 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
3047
3048 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00003049 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003050 "%s: value not given (%s:%d)",
3051 td->name, __FILE__, __LINE__);
3052 return -1;
3053 }
3054
3055
3056 if(!check_permitted_alphabet_1(st)) {
3057 /* Constraint check succeeded */
3058 return 0;
3059 } else {
vlmd4ae41c2006-07-13 13:28:32 +00003060 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003061 "%s: constraint failed (%s:%d)",
3062 td->name, __FILE__, __LINE__);
3063 return -1;
3064 }
3065}
3066
3067/*
3068 * This type is implemented using PER_Visible,
3069 * so here we adjust the DEF accordingly.
3070 */
3071static void
3072Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3073 td->free_struct = asn_DEF_PER_Visible.free_struct;
3074 td->print_struct = asn_DEF_PER_Visible.print_struct;
3075 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
3076 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
3077 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
3078 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
3079 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003080 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003081 if(!td->per_constraints)
3082 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
3083 td->elements = asn_DEF_PER_Visible.elements;
3084 td->elements_count = asn_DEF_PER_Visible.elements_count;
3085 td->specifics = asn_DEF_PER_Visible.specifics;
3086}
3087
3088void
3089Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
3090 void *struct_ptr, int contents_only) {
3091 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3092 td->free_struct(td, struct_ptr, contents_only);
3093}
3094
3095int
3096Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3097 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3098 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3099 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3100}
3101
3102asn_dec_rval_t
3103Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3104 void **structure, const void *bufptr, size_t size, int tag_mode) {
3105 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3106 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3107}
3108
3109asn_enc_rval_t
3110Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
3111 void *structure, int tag_mode, ber_tlv_tag_t tag,
3112 asn_app_consume_bytes_f *cb, void *app_key) {
3113 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3114 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3115}
3116
3117asn_dec_rval_t
3118Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3119 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3120 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3121 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3122}
3123
3124asn_enc_rval_t
3125Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3126 int ilevel, enum xer_encoder_flags_e flags,
3127 asn_app_consume_bytes_f *cb, void *app_key) {
3128 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3129 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3130}
3131
3132asn_dec_rval_t
3133Neither_SIZE_nor_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3134 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3135 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3136 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3137}
3138
vlmb1b193e2006-08-18 01:46:46 +00003139asn_enc_rval_t
3140Neither_SIZE_nor_FROM_encode_uper(asn_TYPE_descriptor_t *td,
3141 asn_per_constraints_t *constraints,
3142 void *structure, asn_per_outp_t *per_out) {
3143 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3144 return td->uper_encoder(td, constraints, structure, per_out);
3145}
3146
vlm337167e2005-11-26 11:25:14 +00003147
vlm86380d32006-10-09 12:07:58 +00003148/*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/
3149
vlma0da1a32006-10-09 12:27:44 +00003150static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00003151 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
3152 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
3153 0, 0 /* No PER character map necessary */
3154};
3155
vlm337167e2005-11-26 11:25:14 +00003156/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
3157
3158static ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
3159 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
3160};
vlm337167e2005-11-26 11:25:14 +00003161asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
3162 "Neither-SIZE-nor-FROM",
3163 "Neither-SIZE-nor-FROM",
3164 Neither_SIZE_nor_FROM_free,
3165 Neither_SIZE_nor_FROM_print,
3166 Neither_SIZE_nor_FROM_constraint,
3167 Neither_SIZE_nor_FROM_decode_ber,
3168 Neither_SIZE_nor_FROM_encode_der,
3169 Neither_SIZE_nor_FROM_decode_xer,
3170 Neither_SIZE_nor_FROM_encode_xer,
3171 Neither_SIZE_nor_FROM_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003172 Neither_SIZE_nor_FROM_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003173 0, /* Use generic outmost tag fetcher */
3174 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
3175 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3176 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
3177 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
3178 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3179 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00003180 &asn_PER_type_Neither_SIZE_nor_FROM_constr_1,
vlm337167e2005-11-26 11:25:14 +00003181 0, 0, /* No members */
3182 0 /* No specifics */
3183};
3184
3185
3186/*** <<< INCLUDES [Utf8-4] >>> ***/
3187
3188#include <UTF8String.h>
3189
3190/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
3191
3192typedef UTF8String_t Utf8_4_t;
3193
3194/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
3195
3196extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
3197asn_struct_free_f Utf8_4_free;
3198asn_struct_print_f Utf8_4_print;
3199asn_constr_check_f Utf8_4_constraint;
3200ber_type_decoder_f Utf8_4_decode_ber;
3201der_type_encoder_f Utf8_4_encode_der;
3202xer_type_decoder_f Utf8_4_decode_xer;
3203xer_type_encoder_f Utf8_4_encode_xer;
3204per_type_decoder_f Utf8_4_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003205per_type_encoder_f Utf8_4_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003206
3207/*** <<< CTABLES [Utf8-4] >>> ***/
3208
3209static int check_permitted_alphabet_1(const void *sptr) {
3210 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
3211 return -1; /* Alphabet (sic!) test failed. */
3212
3213 return 0;
3214}
3215
3216
3217/*** <<< CODE [Utf8-4] >>> ***/
3218
3219int
3220Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003221 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003222 const UTF8String_t *st = (const UTF8String_t *)sptr;
3223
3224 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00003225 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003226 "%s: value not given (%s:%d)",
3227 td->name, __FILE__, __LINE__);
3228 return -1;
3229 }
3230
3231
3232 if(!check_permitted_alphabet_1(st)) {
3233 /* Constraint check succeeded */
3234 return 0;
3235 } else {
vlmd4ae41c2006-07-13 13:28:32 +00003236 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003237 "%s: constraint failed (%s:%d)",
3238 td->name, __FILE__, __LINE__);
3239 return -1;
3240 }
3241}
3242
3243/*
3244 * This type is implemented using UTF8String,
3245 * so here we adjust the DEF accordingly.
3246 */
3247static void
3248Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3249 td->free_struct = asn_DEF_UTF8String.free_struct;
3250 td->print_struct = asn_DEF_UTF8String.print_struct;
3251 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3252 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3253 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3254 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3255 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003256 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003257 if(!td->per_constraints)
3258 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3259 td->elements = asn_DEF_UTF8String.elements;
3260 td->elements_count = asn_DEF_UTF8String.elements_count;
3261 td->specifics = asn_DEF_UTF8String.specifics;
3262}
3263
3264void
3265Utf8_4_free(asn_TYPE_descriptor_t *td,
3266 void *struct_ptr, int contents_only) {
3267 Utf8_4_1_inherit_TYPE_descriptor(td);
3268 td->free_struct(td, struct_ptr, contents_only);
3269}
3270
3271int
3272Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3273 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3274 Utf8_4_1_inherit_TYPE_descriptor(td);
3275 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3276}
3277
3278asn_dec_rval_t
3279Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3280 void **structure, const void *bufptr, size_t size, int tag_mode) {
3281 Utf8_4_1_inherit_TYPE_descriptor(td);
3282 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3283}
3284
3285asn_enc_rval_t
3286Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
3287 void *structure, int tag_mode, ber_tlv_tag_t tag,
3288 asn_app_consume_bytes_f *cb, void *app_key) {
3289 Utf8_4_1_inherit_TYPE_descriptor(td);
3290 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3291}
3292
3293asn_dec_rval_t
3294Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3295 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3296 Utf8_4_1_inherit_TYPE_descriptor(td);
3297 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3298}
3299
3300asn_enc_rval_t
3301Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3302 int ilevel, enum xer_encoder_flags_e flags,
3303 asn_app_consume_bytes_f *cb, void *app_key) {
3304 Utf8_4_1_inherit_TYPE_descriptor(td);
3305 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3306}
3307
3308asn_dec_rval_t
3309Utf8_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3310 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3311 Utf8_4_1_inherit_TYPE_descriptor(td);
3312 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3313}
3314
vlmb1b193e2006-08-18 01:46:46 +00003315asn_enc_rval_t
3316Utf8_4_encode_uper(asn_TYPE_descriptor_t *td,
3317 asn_per_constraints_t *constraints,
3318 void *structure, asn_per_outp_t *per_out) {
3319 Utf8_4_1_inherit_TYPE_descriptor(td);
3320 return td->uper_encoder(td, constraints, structure, per_out);
3321}
3322
vlm337167e2005-11-26 11:25:14 +00003323
vlm86380d32006-10-09 12:07:58 +00003324/*** <<< CTDEFS [Utf8-4] >>> ***/
3325
vlma0da1a32006-10-09 12:27:44 +00003326static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00003327 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3328 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3329 0, 0 /* No PER value map */
3330};
3331
vlm337167e2005-11-26 11:25:14 +00003332/*** <<< STAT-DEFS [Utf8-4] >>> ***/
3333
3334static ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
3335 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3336};
vlm337167e2005-11-26 11:25:14 +00003337asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
3338 "Utf8-4",
3339 "Utf8-4",
3340 Utf8_4_free,
3341 Utf8_4_print,
3342 Utf8_4_constraint,
3343 Utf8_4_decode_ber,
3344 Utf8_4_encode_der,
3345 Utf8_4_decode_xer,
3346 Utf8_4_encode_xer,
3347 Utf8_4_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003348 Utf8_4_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003349 0, /* Use generic outmost tag fetcher */
3350 asn_DEF_Utf8_4_tags_1,
3351 sizeof(asn_DEF_Utf8_4_tags_1)
3352 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
3353 asn_DEF_Utf8_4_tags_1, /* Same as above */
3354 sizeof(asn_DEF_Utf8_4_tags_1)
3355 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00003356 &asn_PER_type_Utf8_4_constr_1,
vlm337167e2005-11-26 11:25:14 +00003357 0, 0, /* No members */
3358 0 /* No specifics */
3359};
3360
3361
3362/*** <<< INCLUDES [Utf8-3] >>> ***/
3363
vlmea226772006-09-13 02:51:20 +00003364#include "Utf8-2.h"
vlm337167e2005-11-26 11:25:14 +00003365
3366/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
3367
3368typedef Utf8_2_t Utf8_3_t;
3369
3370/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
3371
3372extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
3373asn_struct_free_f Utf8_3_free;
3374asn_struct_print_f Utf8_3_print;
3375asn_constr_check_f Utf8_3_constraint;
3376ber_type_decoder_f Utf8_3_decode_ber;
3377der_type_encoder_f Utf8_3_encode_der;
3378xer_type_decoder_f Utf8_3_decode_xer;
3379xer_type_encoder_f Utf8_3_encode_xer;
3380per_type_decoder_f Utf8_3_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003381per_type_encoder_f Utf8_3_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003382
3383/*** <<< CTABLES [Utf8-3] >>> ***/
3384
3385static int permitted_alphabet_table_1[128] = {
vlm4baece12006-09-21 01:52:07 +00003386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3387 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3388 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3389 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3390 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
339116,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
3392 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
339342,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
vlm337167e2005-11-26 11:25:14 +00003394};
3395
3396static int check_permitted_alphabet_1(const void *sptr) {
3397 int *table = permitted_alphabet_table_1;
3398 /* The underlying type is UTF8String */
3399 const UTF8String_t *st = (const UTF8String_t *)sptr;
3400 const uint8_t *ch = st->buf;
3401 const uint8_t *end = ch + st->size;
3402
3403 for(; ch < end; ch++) {
3404 uint8_t cv = *ch;
3405 if(cv >= 0x80) return -1;
3406 if(!table[cv]) return -1;
3407 }
3408 return 0;
3409}
3410
3411
3412/*** <<< CODE [Utf8-3] >>> ***/
3413
3414int
3415Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003416 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003417 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
3418 size_t size;
3419
3420 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00003421 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003422 "%s: value not given (%s:%d)",
3423 td->name, __FILE__, __LINE__);
3424 return -1;
3425 }
3426
3427 size = UTF8String_length(st);
3428 if((ssize_t)size < 0) {
vlmd4ae41c2006-07-13 13:28:32 +00003429 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003430 "%s: UTF-8: broken encoding (%s:%d)",
3431 td->name, __FILE__, __LINE__);
3432 return -1;
3433 }
3434
3435 if((size >= 1 && size <= 2)
3436 && !check_permitted_alphabet_1(st)) {
3437 /* Constraint check succeeded */
3438 return 0;
3439 } else {
vlmd4ae41c2006-07-13 13:28:32 +00003440 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003441 "%s: constraint failed (%s:%d)",
3442 td->name, __FILE__, __LINE__);
3443 return -1;
3444 }
3445}
3446
3447/*
3448 * This type is implemented using Utf8_2,
3449 * so here we adjust the DEF accordingly.
3450 */
3451static void
3452Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3453 td->free_struct = asn_DEF_Utf8_2.free_struct;
3454 td->print_struct = asn_DEF_Utf8_2.print_struct;
3455 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
3456 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
3457 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
3458 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
3459 td->uper_decoder = asn_DEF_Utf8_2.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003460 td->uper_encoder = asn_DEF_Utf8_2.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003461 if(!td->per_constraints)
3462 td->per_constraints = asn_DEF_Utf8_2.per_constraints;
3463 td->elements = asn_DEF_Utf8_2.elements;
3464 td->elements_count = asn_DEF_Utf8_2.elements_count;
3465 td->specifics = asn_DEF_Utf8_2.specifics;
3466}
3467
3468void
3469Utf8_3_free(asn_TYPE_descriptor_t *td,
3470 void *struct_ptr, int contents_only) {
3471 Utf8_3_1_inherit_TYPE_descriptor(td);
3472 td->free_struct(td, struct_ptr, contents_only);
3473}
3474
3475int
3476Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3477 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3478 Utf8_3_1_inherit_TYPE_descriptor(td);
3479 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3480}
3481
3482asn_dec_rval_t
3483Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3484 void **structure, const void *bufptr, size_t size, int tag_mode) {
3485 Utf8_3_1_inherit_TYPE_descriptor(td);
3486 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3487}
3488
3489asn_enc_rval_t
3490Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
3491 void *structure, int tag_mode, ber_tlv_tag_t tag,
3492 asn_app_consume_bytes_f *cb, void *app_key) {
3493 Utf8_3_1_inherit_TYPE_descriptor(td);
3494 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3495}
3496
3497asn_dec_rval_t
3498Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3499 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3500 Utf8_3_1_inherit_TYPE_descriptor(td);
3501 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3502}
3503
3504asn_enc_rval_t
3505Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3506 int ilevel, enum xer_encoder_flags_e flags,
3507 asn_app_consume_bytes_f *cb, void *app_key) {
3508 Utf8_3_1_inherit_TYPE_descriptor(td);
3509 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3510}
3511
3512asn_dec_rval_t
3513Utf8_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3514 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3515 Utf8_3_1_inherit_TYPE_descriptor(td);
3516 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3517}
3518
vlmb1b193e2006-08-18 01:46:46 +00003519asn_enc_rval_t
3520Utf8_3_encode_uper(asn_TYPE_descriptor_t *td,
3521 asn_per_constraints_t *constraints,
3522 void *structure, asn_per_outp_t *per_out) {
3523 Utf8_3_1_inherit_TYPE_descriptor(td);
3524 return td->uper_encoder(td, constraints, structure, per_out);
3525}
3526
vlm337167e2005-11-26 11:25:14 +00003527
vlm86380d32006-10-09 12:07:58 +00003528/*** <<< CTDEFS [Utf8-3] >>> ***/
3529
vlma0da1a32006-10-09 12:27:44 +00003530static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00003531 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3532 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3533 0, 0 /* No PER value map */
3534};
3535
vlm337167e2005-11-26 11:25:14 +00003536/*** <<< STAT-DEFS [Utf8-3] >>> ***/
3537
3538static ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
3539 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3540};
vlm337167e2005-11-26 11:25:14 +00003541asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
3542 "Utf8-3",
3543 "Utf8-3",
3544 Utf8_3_free,
3545 Utf8_3_print,
3546 Utf8_3_constraint,
3547 Utf8_3_decode_ber,
3548 Utf8_3_encode_der,
3549 Utf8_3_decode_xer,
3550 Utf8_3_encode_xer,
3551 Utf8_3_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003552 Utf8_3_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003553 0, /* Use generic outmost tag fetcher */
3554 asn_DEF_Utf8_3_tags_1,
3555 sizeof(asn_DEF_Utf8_3_tags_1)
3556 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3557 asn_DEF_Utf8_3_tags_1, /* Same as above */
3558 sizeof(asn_DEF_Utf8_3_tags_1)
3559 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00003560 &asn_PER_type_Utf8_3_constr_1,
vlm337167e2005-11-26 11:25:14 +00003561 0, 0, /* No members */
3562 0 /* No specifics */
3563};
3564
3565
3566/*** <<< INCLUDES [Utf8-2] >>> ***/
3567
vlmea226772006-09-13 02:51:20 +00003568#include "Utf8-1.h"
vlm337167e2005-11-26 11:25:14 +00003569
3570/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
3571
3572typedef Utf8_1_t Utf8_2_t;
3573
3574/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
3575
3576extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
3577asn_struct_free_f Utf8_2_free;
3578asn_struct_print_f Utf8_2_print;
3579asn_constr_check_f Utf8_2_constraint;
3580ber_type_decoder_f Utf8_2_decode_ber;
3581der_type_encoder_f Utf8_2_encode_der;
3582xer_type_decoder_f Utf8_2_decode_xer;
3583xer_type_encoder_f Utf8_2_encode_xer;
3584per_type_decoder_f Utf8_2_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003585per_type_encoder_f Utf8_2_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003586
3587/*** <<< CODE [Utf8-2] >>> ***/
3588
3589int
3590Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003591 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003592 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
3593 size_t size;
3594
3595 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00003596 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003597 "%s: value not given (%s:%d)",
3598 td->name, __FILE__, __LINE__);
3599 return -1;
3600 }
3601
3602 size = UTF8String_length(st);
3603 if((ssize_t)size < 0) {
vlmd4ae41c2006-07-13 13:28:32 +00003604 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003605 "%s: UTF-8: broken encoding (%s:%d)",
3606 td->name, __FILE__, __LINE__);
3607 return -1;
3608 }
3609
3610 if((size >= 1 && size <= 2)) {
3611 /* Constraint check succeeded */
3612 return 0;
3613 } else {
vlmd4ae41c2006-07-13 13:28:32 +00003614 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003615 "%s: constraint failed (%s:%d)",
3616 td->name, __FILE__, __LINE__);
3617 return -1;
3618 }
3619}
3620
3621/*
3622 * This type is implemented using Utf8_1,
3623 * so here we adjust the DEF accordingly.
3624 */
3625static void
3626Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3627 td->free_struct = asn_DEF_Utf8_1.free_struct;
3628 td->print_struct = asn_DEF_Utf8_1.print_struct;
3629 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
3630 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
3631 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
3632 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
3633 td->uper_decoder = asn_DEF_Utf8_1.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003634 td->uper_encoder = asn_DEF_Utf8_1.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003635 if(!td->per_constraints)
3636 td->per_constraints = asn_DEF_Utf8_1.per_constraints;
3637 td->elements = asn_DEF_Utf8_1.elements;
3638 td->elements_count = asn_DEF_Utf8_1.elements_count;
3639 td->specifics = asn_DEF_Utf8_1.specifics;
3640}
3641
3642void
3643Utf8_2_free(asn_TYPE_descriptor_t *td,
3644 void *struct_ptr, int contents_only) {
3645 Utf8_2_1_inherit_TYPE_descriptor(td);
3646 td->free_struct(td, struct_ptr, contents_only);
3647}
3648
3649int
3650Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3651 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3652 Utf8_2_1_inherit_TYPE_descriptor(td);
3653 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3654}
3655
3656asn_dec_rval_t
3657Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3658 void **structure, const void *bufptr, size_t size, int tag_mode) {
3659 Utf8_2_1_inherit_TYPE_descriptor(td);
3660 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3661}
3662
3663asn_enc_rval_t
3664Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
3665 void *structure, int tag_mode, ber_tlv_tag_t tag,
3666 asn_app_consume_bytes_f *cb, void *app_key) {
3667 Utf8_2_1_inherit_TYPE_descriptor(td);
3668 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3669}
3670
3671asn_dec_rval_t
3672Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3673 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3674 Utf8_2_1_inherit_TYPE_descriptor(td);
3675 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3676}
3677
3678asn_enc_rval_t
3679Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3680 int ilevel, enum xer_encoder_flags_e flags,
3681 asn_app_consume_bytes_f *cb, void *app_key) {
3682 Utf8_2_1_inherit_TYPE_descriptor(td);
3683 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3684}
3685
3686asn_dec_rval_t
3687Utf8_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3688 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3689 Utf8_2_1_inherit_TYPE_descriptor(td);
3690 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3691}
3692
vlmb1b193e2006-08-18 01:46:46 +00003693asn_enc_rval_t
3694Utf8_2_encode_uper(asn_TYPE_descriptor_t *td,
3695 asn_per_constraints_t *constraints,
3696 void *structure, asn_per_outp_t *per_out) {
3697 Utf8_2_1_inherit_TYPE_descriptor(td);
3698 return td->uper_encoder(td, constraints, structure, per_out);
3699}
3700
vlm337167e2005-11-26 11:25:14 +00003701
vlm86380d32006-10-09 12:07:58 +00003702/*** <<< CTDEFS [Utf8-2] >>> ***/
3703
vlma0da1a32006-10-09 12:27:44 +00003704static asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00003705 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3706 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3707 0, 0 /* No PER value map */
3708};
3709
vlm337167e2005-11-26 11:25:14 +00003710/*** <<< STAT-DEFS [Utf8-2] >>> ***/
3711
3712static ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
3713 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3714};
vlm337167e2005-11-26 11:25:14 +00003715asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
3716 "Utf8-2",
3717 "Utf8-2",
3718 Utf8_2_free,
3719 Utf8_2_print,
3720 Utf8_2_constraint,
3721 Utf8_2_decode_ber,
3722 Utf8_2_encode_der,
3723 Utf8_2_decode_xer,
3724 Utf8_2_encode_xer,
3725 Utf8_2_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003726 Utf8_2_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003727 0, /* Use generic outmost tag fetcher */
3728 asn_DEF_Utf8_2_tags_1,
3729 sizeof(asn_DEF_Utf8_2_tags_1)
3730 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3731 asn_DEF_Utf8_2_tags_1, /* Same as above */
3732 sizeof(asn_DEF_Utf8_2_tags_1)
3733 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00003734 &asn_PER_type_Utf8_2_constr_1,
vlm337167e2005-11-26 11:25:14 +00003735 0, 0, /* No members */
3736 0 /* No specifics */
3737};
3738
3739
3740/*** <<< INCLUDES [Utf8-1] >>> ***/
3741
3742#include <UTF8String.h>
3743
3744/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3745
3746typedef UTF8String_t Utf8_1_t;
3747
3748/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3749
3750extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3751asn_struct_free_f Utf8_1_free;
3752asn_struct_print_f Utf8_1_print;
3753asn_constr_check_f Utf8_1_constraint;
3754ber_type_decoder_f Utf8_1_decode_ber;
3755der_type_encoder_f Utf8_1_encode_der;
3756xer_type_decoder_f Utf8_1_decode_xer;
3757xer_type_encoder_f Utf8_1_encode_xer;
3758per_type_decoder_f Utf8_1_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003759per_type_encoder_f Utf8_1_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003760
3761/*** <<< CODE [Utf8-1] >>> ***/
3762
3763int
3764Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003765 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003766 /* Replace with underlying type checker */
3767 td->check_constraints = asn_DEF_UTF8String.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +00003768 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm337167e2005-11-26 11:25:14 +00003769}
3770
3771/*
3772 * This type is implemented using UTF8String,
3773 * so here we adjust the DEF accordingly.
3774 */
3775static void
3776Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3777 td->free_struct = asn_DEF_UTF8String.free_struct;
3778 td->print_struct = asn_DEF_UTF8String.print_struct;
3779 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3780 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3781 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3782 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3783 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003784 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003785 if(!td->per_constraints)
3786 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3787 td->elements = asn_DEF_UTF8String.elements;
3788 td->elements_count = asn_DEF_UTF8String.elements_count;
3789 td->specifics = asn_DEF_UTF8String.specifics;
3790}
3791
3792void
3793Utf8_1_free(asn_TYPE_descriptor_t *td,
3794 void *struct_ptr, int contents_only) {
3795 Utf8_1_1_inherit_TYPE_descriptor(td);
3796 td->free_struct(td, struct_ptr, contents_only);
3797}
3798
3799int
3800Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3801 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3802 Utf8_1_1_inherit_TYPE_descriptor(td);
3803 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3804}
3805
3806asn_dec_rval_t
3807Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3808 void **structure, const void *bufptr, size_t size, int tag_mode) {
3809 Utf8_1_1_inherit_TYPE_descriptor(td);
3810 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3811}
3812
3813asn_enc_rval_t
3814Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3815 void *structure, int tag_mode, ber_tlv_tag_t tag,
3816 asn_app_consume_bytes_f *cb, void *app_key) {
3817 Utf8_1_1_inherit_TYPE_descriptor(td);
3818 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3819}
3820
3821asn_dec_rval_t
3822Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3823 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3824 Utf8_1_1_inherit_TYPE_descriptor(td);
3825 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3826}
3827
3828asn_enc_rval_t
3829Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3830 int ilevel, enum xer_encoder_flags_e flags,
3831 asn_app_consume_bytes_f *cb, void *app_key) {
3832 Utf8_1_1_inherit_TYPE_descriptor(td);
3833 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3834}
3835
3836asn_dec_rval_t
3837Utf8_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3838 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3839 Utf8_1_1_inherit_TYPE_descriptor(td);
3840 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3841}
3842
vlmb1b193e2006-08-18 01:46:46 +00003843asn_enc_rval_t
3844Utf8_1_encode_uper(asn_TYPE_descriptor_t *td,
3845 asn_per_constraints_t *constraints,
3846 void *structure, asn_per_outp_t *per_out) {
3847 Utf8_1_1_inherit_TYPE_descriptor(td);
3848 return td->uper_encoder(td, constraints, structure, per_out);
3849}
3850
vlm337167e2005-11-26 11:25:14 +00003851
3852/*** <<< STAT-DEFS [Utf8-1] >>> ***/
3853
3854static ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
3855 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3856};
3857asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3858 "Utf8-1",
3859 "Utf8-1",
3860 Utf8_1_free,
3861 Utf8_1_print,
3862 Utf8_1_constraint,
3863 Utf8_1_decode_ber,
3864 Utf8_1_encode_der,
3865 Utf8_1_decode_xer,
3866 Utf8_1_encode_xer,
3867 Utf8_1_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00003868 Utf8_1_encode_uper,
vlm337167e2005-11-26 11:25:14 +00003869 0, /* Use generic outmost tag fetcher */
3870 asn_DEF_Utf8_1_tags_1,
3871 sizeof(asn_DEF_Utf8_1_tags_1)
3872 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3873 asn_DEF_Utf8_1_tags_1, /* Same as above */
3874 sizeof(asn_DEF_Utf8_1_tags_1)
3875 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3876 0, /* No PER visible constraints */
3877 0, 0, /* No members */
3878 0 /* No specifics */
3879};
3880
3881
3882/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
3883
vlmea226772006-09-13 02:51:20 +00003884#include "Identifier.h"
vlm337167e2005-11-26 11:25:14 +00003885
3886/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
3887
3888typedef Identifier_t VisibleIdentifier_t;
3889
3890/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
3891
3892extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
3893asn_struct_free_f VisibleIdentifier_free;
3894asn_struct_print_f VisibleIdentifier_print;
3895asn_constr_check_f VisibleIdentifier_constraint;
3896ber_type_decoder_f VisibleIdentifier_decode_ber;
3897der_type_encoder_f VisibleIdentifier_encode_der;
3898xer_type_decoder_f VisibleIdentifier_decode_xer;
3899xer_type_encoder_f VisibleIdentifier_encode_xer;
3900per_type_decoder_f VisibleIdentifier_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00003901per_type_encoder_f VisibleIdentifier_encode_uper;
vlm337167e2005-11-26 11:25:14 +00003902
3903/*** <<< CTABLES [VisibleIdentifier] >>> ***/
3904
3905static int permitted_alphabet_table_1[256] = {
vlm4baece12006-09-21 01:52:07 +00003906 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3907 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3908 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
3909 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
3910 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
391127,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
3912 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
391354,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
vlm337167e2005-11-26 11:25:14 +00003914};
vlm4baece12006-09-21 01:52:07 +00003915static int permitted_alphabet_code2value_1[64] = {
391636,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
391770,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
391886,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
3919107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
3920};
3921
vlm337167e2005-11-26 11:25:14 +00003922
3923static int check_permitted_alphabet_1(const void *sptr) {
3924 int *table = permitted_alphabet_table_1;
3925 /* The underlying type is VisibleString */
3926 const VisibleString_t *st = (const VisibleString_t *)sptr;
3927 const uint8_t *ch = st->buf;
3928 const uint8_t *end = ch + st->size;
3929
3930 for(; ch < end; ch++) {
3931 uint8_t cv = *ch;
3932 if(!table[cv]) return -1;
3933 }
3934 return 0;
3935}
3936
3937
3938/*** <<< CODE [VisibleIdentifier] >>> ***/
3939
3940int
3941VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00003942 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00003943 const Identifier_t *st = (const Identifier_t *)sptr;
3944 size_t size;
3945
3946 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00003947 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003948 "%s: value not given (%s:%d)",
3949 td->name, __FILE__, __LINE__);
3950 return -1;
3951 }
3952
3953 size = st->size;
3954
3955 if((size >= 1 && size <= 32)
3956 && !check_permitted_alphabet_1(st)) {
3957 /* Constraint check succeeded */
3958 return 0;
3959 } else {
vlmd4ae41c2006-07-13 13:28:32 +00003960 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00003961 "%s: constraint failed (%s:%d)",
3962 td->name, __FILE__, __LINE__);
3963 return -1;
3964 }
3965}
3966
3967/*
3968 * This type is implemented using Identifier,
3969 * so here we adjust the DEF accordingly.
3970 */
3971static void
3972VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3973 td->free_struct = asn_DEF_Identifier.free_struct;
3974 td->print_struct = asn_DEF_Identifier.print_struct;
3975 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
3976 td->der_encoder = asn_DEF_Identifier.der_encoder;
3977 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
3978 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
3979 td->uper_decoder = asn_DEF_Identifier.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00003980 td->uper_encoder = asn_DEF_Identifier.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00003981 if(!td->per_constraints)
3982 td->per_constraints = asn_DEF_Identifier.per_constraints;
3983 td->elements = asn_DEF_Identifier.elements;
3984 td->elements_count = asn_DEF_Identifier.elements_count;
3985 td->specifics = asn_DEF_Identifier.specifics;
3986}
3987
3988void
3989VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
3990 void *struct_ptr, int contents_only) {
3991 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3992 td->free_struct(td, struct_ptr, contents_only);
3993}
3994
3995int
3996VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3997 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3998 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3999 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4000}
4001
4002asn_dec_rval_t
4003VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4004 void **structure, const void *bufptr, size_t size, int tag_mode) {
4005 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4006 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4007}
4008
4009asn_enc_rval_t
4010VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
4011 void *structure, int tag_mode, ber_tlv_tag_t tag,
4012 asn_app_consume_bytes_f *cb, void *app_key) {
4013 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4014 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4015}
4016
4017asn_dec_rval_t
4018VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4019 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4020 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4021 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4022}
4023
4024asn_enc_rval_t
4025VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4026 int ilevel, enum xer_encoder_flags_e flags,
4027 asn_app_consume_bytes_f *cb, void *app_key) {
4028 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4029 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4030}
4031
4032asn_dec_rval_t
4033VisibleIdentifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4034 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4035 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4036 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4037}
4038
vlmb1b193e2006-08-18 01:46:46 +00004039asn_enc_rval_t
4040VisibleIdentifier_encode_uper(asn_TYPE_descriptor_t *td,
4041 asn_per_constraints_t *constraints,
4042 void *structure, asn_per_outp_t *per_out) {
4043 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4044 return td->uper_encoder(td, constraints, structure, per_out);
4045}
4046
vlm337167e2005-11-26 11:25:14 +00004047
4048/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
4049
4050static ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
4051 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
4052};
4053asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
4054 "VisibleIdentifier",
4055 "VisibleIdentifier",
4056 VisibleIdentifier_free,
4057 VisibleIdentifier_print,
4058 VisibleIdentifier_constraint,
4059 VisibleIdentifier_decode_ber,
4060 VisibleIdentifier_encode_der,
4061 VisibleIdentifier_decode_xer,
4062 VisibleIdentifier_encode_xer,
4063 VisibleIdentifier_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004064 VisibleIdentifier_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004065 0, /* Use generic outmost tag fetcher */
4066 asn_DEF_VisibleIdentifier_tags_1,
4067 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4068 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
4069 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
4070 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4071 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
4072 0, /* No PER visible constraints */
4073 0, 0, /* No members */
4074 0 /* No specifics */
4075};
4076
4077
4078/*** <<< INCLUDES [Sequence] >>> ***/
4079
vlmea226772006-09-13 02:51:20 +00004080#include "Int1.h"
4081#include "Int4.h"
vlm337167e2005-11-26 11:25:14 +00004082#include <BOOLEAN.h>
4083#include <ENUMERATED.h>
4084#include <NULL.h>
vlmea226772006-09-13 02:51:20 +00004085#include "Int5.h"
vlm337167e2005-11-26 11:25:14 +00004086#include <constr_SEQUENCE.h>
4087
4088/*** <<< DEPS [Sequence] >>> ***/
4089
4090typedef enum enum_c {
4091 enum_c_one = 1,
4092 enum_c_two = 2,
4093 /*
4094 * Enumeration is extensible
4095 */
4096 enum_c_three = 3
vlm7c8aa5e2006-03-21 07:25:18 +00004097} e_enum_c;
vlm337167e2005-11-26 11:25:14 +00004098
4099/*** <<< TYPE-DECLS [Sequence] >>> ***/
4100
4101typedef struct Sequence {
4102 Int1_t *int1_c /* DEFAULT 3 */;
4103 Int4_t int4;
4104 Int4_t int4_c;
4105 BOOLEAN_t *bool /* DEFAULT 1 */;
4106 ENUMERATED_t enum_c;
4107 NULL_t *null /* OPTIONAL */;
4108 /*
4109 * This type is extensible,
4110 * possible extensions are below.
4111 */
4112 Int5_t *int5_c /* OPTIONAL */;
4113
4114 /* Context for parsing across buffer boundaries */
4115 asn_struct_ctx_t _asn_ctx;
4116} Sequence_t;
4117
4118/*** <<< FUNC-DECLS [Sequence] >>> ***/
4119
4120/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
4121extern asn_TYPE_descriptor_t asn_DEF_Sequence;
4122
4123/*** <<< CODE [Sequence] >>> ***/
4124
4125static int
4126enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004127 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004128 /* Replace with underlying type checker */
4129 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +00004130 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm337167e2005-11-26 11:25:14 +00004131}
4132
4133/*
4134 * This type is implemented using ENUMERATED,
4135 * so here we adjust the DEF accordingly.
4136 */
4137static void
4138enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4139 td->free_struct = asn_DEF_ENUMERATED.free_struct;
4140 td->print_struct = asn_DEF_ENUMERATED.print_struct;
4141 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
4142 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
4143 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
4144 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
4145 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00004146 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00004147 if(!td->per_constraints)
4148 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
4149 td->elements = asn_DEF_ENUMERATED.elements;
4150 td->elements_count = asn_DEF_ENUMERATED.elements_count;
4151 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
4152}
4153
4154static void
4155enum_c_6_free(asn_TYPE_descriptor_t *td,
4156 void *struct_ptr, int contents_only) {
4157 enum_c_6_inherit_TYPE_descriptor(td);
4158 td->free_struct(td, struct_ptr, contents_only);
4159}
4160
4161static int
4162enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4163 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4164 enum_c_6_inherit_TYPE_descriptor(td);
4165 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4166}
4167
4168static asn_dec_rval_t
4169enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4170 void **structure, const void *bufptr, size_t size, int tag_mode) {
4171 enum_c_6_inherit_TYPE_descriptor(td);
4172 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4173}
4174
4175static asn_enc_rval_t
4176enum_c_6_encode_der(asn_TYPE_descriptor_t *td,
4177 void *structure, int tag_mode, ber_tlv_tag_t tag,
4178 asn_app_consume_bytes_f *cb, void *app_key) {
4179 enum_c_6_inherit_TYPE_descriptor(td);
4180 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4181}
4182
4183static asn_dec_rval_t
4184enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4185 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4186 enum_c_6_inherit_TYPE_descriptor(td);
4187 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4188}
4189
4190static asn_enc_rval_t
4191enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4192 int ilevel, enum xer_encoder_flags_e flags,
4193 asn_app_consume_bytes_f *cb, void *app_key) {
4194 enum_c_6_inherit_TYPE_descriptor(td);
4195 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4196}
4197
4198static asn_dec_rval_t
4199enum_c_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4200 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4201 enum_c_6_inherit_TYPE_descriptor(td);
4202 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4203}
4204
vlmb1b193e2006-08-18 01:46:46 +00004205static asn_enc_rval_t
4206enum_c_6_encode_uper(asn_TYPE_descriptor_t *td,
4207 asn_per_constraints_t *constraints,
4208 void *structure, asn_per_outp_t *per_out) {
4209 enum_c_6_inherit_TYPE_descriptor(td);
4210 return td->uper_encoder(td, constraints, structure, per_out);
4211}
4212
vlm337167e2005-11-26 11:25:14 +00004213static int
4214memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004215 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004216 const Int1_t *st = (const Int1_t *)sptr;
4217 long value;
4218
4219 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00004220 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004221 "%s: value not given (%s:%d)",
4222 td->name, __FILE__, __LINE__);
4223 return -1;
4224 }
4225
4226 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +00004227 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004228 "%s: value too large (%s:%d)",
4229 td->name, __FILE__, __LINE__);
4230 return -1;
4231 }
4232
4233 if((value >= -2)) {
4234 /* Constraint check succeeded */
4235 return 0;
4236 } else {
vlmd4ae41c2006-07-13 13:28:32 +00004237 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004238 "%s: constraint failed (%s:%d)",
4239 td->name, __FILE__, __LINE__);
4240 return -1;
4241 }
4242}
4243
4244static int
4245memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004246 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004247 const Int4_t *st = (const Int4_t *)sptr;
4248 long value;
4249
4250 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00004251 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004252 "%s: value not given (%s:%d)",
4253 td->name, __FILE__, __LINE__);
4254 return -1;
4255 }
4256
4257 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +00004258 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004259 "%s: value too large (%s:%d)",
4260 td->name, __FILE__, __LINE__);
4261 return -1;
4262 }
4263
4264 if((value >= 5 && value <= 7)) {
4265 /* Constraint check succeeded */
4266 return 0;
4267 } else {
vlmd4ae41c2006-07-13 13:28:32 +00004268 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004269 "%s: constraint failed (%s:%d)",
4270 td->name, __FILE__, __LINE__);
4271 return -1;
4272 }
4273}
4274
4275static int
4276memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004277 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004278 const Int5_t *st = (const Int5_t *)sptr;
4279 long value;
4280
4281 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00004282 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004283 "%s: value not given (%s:%d)",
4284 td->name, __FILE__, __LINE__);
4285 return -1;
4286 }
4287
4288 if(asn_INTEGER2long(st, &value)) {
vlmd4ae41c2006-07-13 13:28:32 +00004289 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004290 "%s: value too large (%s:%d)",
4291 td->name, __FILE__, __LINE__);
4292 return -1;
4293 }
4294
4295 if((value == 5)) {
4296 /* Constraint check succeeded */
4297 return 0;
4298 } else {
vlmd4ae41c2006-07-13 13:28:32 +00004299 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004300 "%s: constraint failed (%s:%d)",
4301 td->name, __FILE__, __LINE__);
4302 return -1;
4303 }
4304}
4305
4306
vlm86380d32006-10-09 12:07:58 +00004307/*** <<< CTDEFS [Sequence] >>> ***/
4308
vlma0da1a32006-10-09 12:27:44 +00004309static asn_per_constraints_t asn_PER_type_enum_c_constr_6 = {
vlm86380d32006-10-09 12:07:58 +00004310 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
4311 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4312 0, 0 /* No PER value map */
4313};
vlma0da1a32006-10-09 12:27:44 +00004314static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 = {
vlm86380d32006-10-09 12:07:58 +00004315 { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
4316 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4317 0, 0 /* No PER value map */
4318};
vlma0da1a32006-10-09 12:27:44 +00004319static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 = {
vlm86380d32006-10-09 12:07:58 +00004320 { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
4321 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4322 0, 0 /* No PER value map */
4323};
vlma0da1a32006-10-09 12:27:44 +00004324static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 = {
vlm86380d32006-10-09 12:07:58 +00004325 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
4326 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4327 0, 0 /* No PER value map */
4328};
4329
vlm337167e2005-11-26 11:25:14 +00004330/*** <<< STAT-DEFS [Sequence] >>> ***/
4331
vlmb1b193e2006-08-18 01:46:46 +00004332static int asn_DFL_2_set_3(int set_value, void **sptr) {
vlm337167e2005-11-26 11:25:14 +00004333 Int1_t *st = *sptr;
4334
4335 if(!st) {
vlmb1b193e2006-08-18 01:46:46 +00004336 if(!set_value) return -1; /* Not a default value */
vlm337167e2005-11-26 11:25:14 +00004337 st = (*sptr = CALLOC(1, sizeof(*st)));
4338 if(!st) return -1;
4339 }
4340
vlmb1b193e2006-08-18 01:46:46 +00004341 if(set_value) {
4342 /* Install default value 3 */
4343 return asn_long2INTEGER(st, 3);
4344 } else {
4345 /* Test default value 3 */
4346 long value;
4347 if(asn_INTEGER2long(st, &value))
4348 return -1;
4349 return (value == 3);
4350 }
vlm337167e2005-11-26 11:25:14 +00004351}
vlmb1b193e2006-08-18 01:46:46 +00004352static int asn_DFL_5_set_1(int set_value, void **sptr) {
vlm337167e2005-11-26 11:25:14 +00004353 BOOLEAN_t *st = *sptr;
4354
4355 if(!st) {
vlmb1b193e2006-08-18 01:46:46 +00004356 if(!set_value) return -1; /* Not a default value */
vlm337167e2005-11-26 11:25:14 +00004357 st = (*sptr = CALLOC(1, sizeof(*st)));
4358 if(!st) return -1;
4359 }
4360
vlmb1b193e2006-08-18 01:46:46 +00004361 if(set_value) {
4362 /* Install default value 1 */
4363 *st = 1;
4364 return 0;
4365 } else {
4366 /* Test default value 1 */
4367 return (*st == 1);
4368 }
vlm337167e2005-11-26 11:25:14 +00004369}
4370static asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
4371 { 1, 3, "one" },
4372 { 2, 3, "two" },
4373 { 3, 5, "three" }
4374 /* This list is extensible */
4375};
4376static unsigned int asn_MAP_enum_c_enum2value_6[] = {
4377 0, /* one(1) */
4378 2, /* three(3) */
4379 1 /* two(2) */
4380 /* This list is extensible */
4381};
4382static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
4383 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
4384 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
4385 3, /* Number of elements in the maps */
4386 3, /* Extensions before this member */
4387 1 /* Strict enumeration */
4388};
4389static ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
4390 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4391};
vlm337167e2005-11-26 11:25:14 +00004392static /* Use -fall-defs-global to expose */
4393asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
4394 "enum-c",
4395 "enum-c",
4396 enum_c_6_free,
4397 enum_c_6_print,
4398 enum_c_6_constraint,
4399 enum_c_6_decode_ber,
4400 enum_c_6_encode_der,
4401 enum_c_6_decode_xer,
4402 enum_c_6_encode_xer,
4403 enum_c_6_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004404 enum_c_6_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004405 0, /* Use generic outmost tag fetcher */
4406 asn_DEF_enum_c_tags_6,
4407 sizeof(asn_DEF_enum_c_tags_6)
4408 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
4409 asn_DEF_enum_c_tags_6, /* Same as above */
4410 sizeof(asn_DEF_enum_c_tags_6)
4411 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00004412 &asn_PER_type_enum_c_constr_6,
vlm337167e2005-11-26 11:25:14 +00004413 0, 0, /* Defined elsewhere */
4414 &asn_SPC_enum_c_specs_6 /* Additional specs */
4415};
4416
vlm337167e2005-11-26 11:25:14 +00004417static asn_TYPE_member_t asn_MBR_Sequence_1[] = {
4418 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
4419 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4420 .tag_mode = 0,
4421 .type = &asn_DEF_Int1,
4422 .memb_constraints = memb_int1_c_constraint_1,
vlma0da1a32006-10-09 12:27:44 +00004423 .per_constraints = &asn_PER_memb_int1_c_constr_2,
vlm337167e2005-11-26 11:25:14 +00004424 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
4425 .name = "int1-c"
4426 },
4427 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
4428 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
4429 .tag_mode = +1, /* EXPLICIT tag at current level */
4430 .type = &asn_DEF_Int4,
4431 .memb_constraints = 0, /* Defer constraints checking to the member type */
4432 .per_constraints = 0, /* No PER visible constraints */
4433 .default_value = 0,
4434 .name = "int4"
4435 },
4436 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
4437 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4438 .tag_mode = 0,
4439 .type = &asn_DEF_Int4,
4440 .memb_constraints = memb_int4_c_constraint_1,
vlma0da1a32006-10-09 12:27:44 +00004441 .per_constraints = &asn_PER_memb_int4_c_constr_4,
vlm337167e2005-11-26 11:25:14 +00004442 .default_value = 0,
4443 .name = "int4-c"
4444 },
4445 { ATF_POINTER, 1, offsetof(struct Sequence, bool),
4446 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
4447 .tag_mode = 0,
4448 .type = &asn_DEF_BOOLEAN,
4449 .memb_constraints = 0, /* Defer constraints checking to the member type */
4450 .per_constraints = 0, /* No PER visible constraints */
4451 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
4452 .name = "bool"
4453 },
4454 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
4455 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
4456 .tag_mode = 0,
4457 .type = &asn_DEF_enum_c_6,
4458 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlmb0267572006-10-09 12:52:15 +00004459 .per_constraints = 0, /* No PER visible constraints */
vlm337167e2005-11-26 11:25:14 +00004460 .default_value = 0,
4461 .name = "enum-c"
4462 },
4463 { ATF_POINTER, 2, offsetof(struct Sequence, null),
4464 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
4465 .tag_mode = 0,
4466 .type = &asn_DEF_NULL,
4467 .memb_constraints = 0, /* Defer constraints checking to the member type */
4468 .per_constraints = 0, /* No PER visible constraints */
4469 .default_value = 0,
4470 .name = "null"
4471 },
4472 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
4473 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4474 .tag_mode = 0,
4475 .type = &asn_DEF_Int5,
4476 .memb_constraints = memb_int5_c_constraint_1,
vlma0da1a32006-10-09 12:27:44 +00004477 .per_constraints = &asn_PER_memb_int5_c_constr_13,
vlm337167e2005-11-26 11:25:14 +00004478 .default_value = 0,
4479 .name = "int5-c"
4480 },
4481};
4482static int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
4483static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
4484 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4485};
4486static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
4487 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool at 59 */
4488 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c at 56 */
4489 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c at 58 */
4490 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c at 62 */
4491 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null at 64 */
4492 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c at 60 */
4493 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 at 57 */
4494};
4495static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
4496 sizeof(struct Sequence),
4497 offsetof(struct Sequence, _asn_ctx),
4498 asn_MAP_Sequence_tag2el_1,
4499 7, /* Count of tags in the map */
4500 asn_MAP_Sequence_oms_1, /* Optional members */
4501 3, 1, /* Root/Additions */
4502 5, /* Start extensions */
4503 8 /* Stop extensions */
4504};
4505asn_TYPE_descriptor_t asn_DEF_Sequence = {
4506 "Sequence",
4507 "Sequence",
4508 SEQUENCE_free,
4509 SEQUENCE_print,
4510 SEQUENCE_constraint,
4511 SEQUENCE_decode_ber,
4512 SEQUENCE_encode_der,
4513 SEQUENCE_decode_xer,
4514 SEQUENCE_encode_xer,
4515 SEQUENCE_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004516 SEQUENCE_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004517 0, /* Use generic outmost tag fetcher */
4518 asn_DEF_Sequence_tags_1,
4519 sizeof(asn_DEF_Sequence_tags_1)
4520 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4521 asn_DEF_Sequence_tags_1, /* Same as above */
4522 sizeof(asn_DEF_Sequence_tags_1)
4523 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4524 0, /* No PER visible constraints */
4525 asn_MBR_Sequence_1,
4526 7, /* Elements count */
4527 &asn_SPC_Sequence_specs_1 /* Additional specs */
4528};
4529
4530
4531/*** <<< INCLUDES [SequenceOf] >>> ***/
4532
4533#include <asn_SEQUENCE_OF.h>
4534#include <constr_SEQUENCE_OF.h>
4535
4536/*** <<< FWD-DECLS [SequenceOf] >>> ***/
4537
4538struct Sequence;
4539
4540/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
4541
4542typedef struct SequenceOf {
4543 A_SEQUENCE_OF(struct Sequence) list;
4544
4545 /* Context for parsing across buffer boundaries */
4546 asn_struct_ctx_t _asn_ctx;
4547} SequenceOf_t;
4548
4549/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
4550
4551extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
4552
4553/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
4554
vlmea226772006-09-13 02:51:20 +00004555#include "Sequence.h"
vlm337167e2005-11-26 11:25:14 +00004556
vlm86380d32006-10-09 12:07:58 +00004557/*** <<< CTDEFS [SequenceOf] >>> ***/
4558
vlma0da1a32006-10-09 12:27:44 +00004559static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00004560 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4561 { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */,
4562 0, 0 /* No PER value map */
4563};
4564
vlm337167e2005-11-26 11:25:14 +00004565/*** <<< STAT-DEFS [SequenceOf] >>> ***/
4566
4567static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
4568 { ATF_POINTER, 0, 0,
4569 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
4570 .tag_mode = 0,
4571 .type = &asn_DEF_Sequence,
4572 .memb_constraints = 0, /* Defer constraints checking to the member type */
4573 .per_constraints = 0, /* No PER visible constraints */
4574 .default_value = 0,
4575 .name = ""
4576 },
4577};
4578static ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
4579 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4580};
4581static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
4582 sizeof(struct SequenceOf),
4583 offsetof(struct SequenceOf, _asn_ctx),
4584 0, /* XER encoding is XMLDelimitedItemList */
4585};
vlm337167e2005-11-26 11:25:14 +00004586asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
4587 "SequenceOf",
4588 "SequenceOf",
4589 SEQUENCE_OF_free,
4590 SEQUENCE_OF_print,
4591 SEQUENCE_OF_constraint,
4592 SEQUENCE_OF_decode_ber,
4593 SEQUENCE_OF_encode_der,
4594 SEQUENCE_OF_decode_xer,
4595 SEQUENCE_OF_encode_xer,
4596 SEQUENCE_OF_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004597 SEQUENCE_OF_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004598 0, /* Use generic outmost tag fetcher */
4599 asn_DEF_SequenceOf_tags_1,
4600 sizeof(asn_DEF_SequenceOf_tags_1)
4601 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4602 asn_DEF_SequenceOf_tags_1, /* Same as above */
4603 sizeof(asn_DEF_SequenceOf_tags_1)
4604 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00004605 &asn_PER_type_SequenceOf_constr_1,
vlm337167e2005-11-26 11:25:14 +00004606 asn_MBR_SequenceOf_1,
4607 1, /* Single element */
4608 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
4609};
4610
4611
4612/*** <<< INCLUDES [Enum0] >>> ***/
4613
4614#include <ENUMERATED.h>
4615
4616/*** <<< DEPS [Enum0] >>> ***/
4617
4618typedef enum Enum0 {
4619 Enum0_one = 0,
4620 Enum0_two = 1
vlm7c8aa5e2006-03-21 07:25:18 +00004621} e_Enum0;
vlm337167e2005-11-26 11:25:14 +00004622
4623/*** <<< TYPE-DECLS [Enum0] >>> ***/
4624
4625typedef ENUMERATED_t Enum0_t;
4626
4627/*** <<< FUNC-DECLS [Enum0] >>> ***/
4628
4629extern asn_TYPE_descriptor_t asn_DEF_Enum0;
4630asn_struct_free_f Enum0_free;
4631asn_struct_print_f Enum0_print;
4632asn_constr_check_f Enum0_constraint;
4633ber_type_decoder_f Enum0_decode_ber;
4634der_type_encoder_f Enum0_encode_der;
4635xer_type_decoder_f Enum0_decode_xer;
4636xer_type_encoder_f Enum0_encode_xer;
4637per_type_decoder_f Enum0_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00004638per_type_encoder_f Enum0_encode_uper;
vlm337167e2005-11-26 11:25:14 +00004639
4640/*** <<< CODE [Enum0] >>> ***/
4641
4642int
4643Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004644 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004645 /* Replace with underlying type checker */
4646 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +00004647 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm337167e2005-11-26 11:25:14 +00004648}
4649
4650/*
4651 * This type is implemented using ENUMERATED,
4652 * so here we adjust the DEF accordingly.
4653 */
4654static void
4655Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4656 td->free_struct = asn_DEF_ENUMERATED.free_struct;
4657 td->print_struct = asn_DEF_ENUMERATED.print_struct;
4658 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
4659 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
4660 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
4661 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
4662 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00004663 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00004664 if(!td->per_constraints)
4665 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
4666 td->elements = asn_DEF_ENUMERATED.elements;
4667 td->elements_count = asn_DEF_ENUMERATED.elements_count;
4668 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
4669}
4670
4671void
4672Enum0_free(asn_TYPE_descriptor_t *td,
4673 void *struct_ptr, int contents_only) {
4674 Enum0_1_inherit_TYPE_descriptor(td);
4675 td->free_struct(td, struct_ptr, contents_only);
4676}
4677
4678int
4679Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4680 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4681 Enum0_1_inherit_TYPE_descriptor(td);
4682 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4683}
4684
4685asn_dec_rval_t
4686Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4687 void **structure, const void *bufptr, size_t size, int tag_mode) {
4688 Enum0_1_inherit_TYPE_descriptor(td);
4689 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4690}
4691
4692asn_enc_rval_t
4693Enum0_encode_der(asn_TYPE_descriptor_t *td,
4694 void *structure, int tag_mode, ber_tlv_tag_t tag,
4695 asn_app_consume_bytes_f *cb, void *app_key) {
4696 Enum0_1_inherit_TYPE_descriptor(td);
4697 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4698}
4699
4700asn_dec_rval_t
4701Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4702 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4703 Enum0_1_inherit_TYPE_descriptor(td);
4704 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4705}
4706
4707asn_enc_rval_t
4708Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4709 int ilevel, enum xer_encoder_flags_e flags,
4710 asn_app_consume_bytes_f *cb, void *app_key) {
4711 Enum0_1_inherit_TYPE_descriptor(td);
4712 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4713}
4714
4715asn_dec_rval_t
4716Enum0_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4717 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4718 Enum0_1_inherit_TYPE_descriptor(td);
4719 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4720}
4721
vlmb1b193e2006-08-18 01:46:46 +00004722asn_enc_rval_t
4723Enum0_encode_uper(asn_TYPE_descriptor_t *td,
4724 asn_per_constraints_t *constraints,
4725 void *structure, asn_per_outp_t *per_out) {
4726 Enum0_1_inherit_TYPE_descriptor(td);
4727 return td->uper_encoder(td, constraints, structure, per_out);
4728}
4729
vlm337167e2005-11-26 11:25:14 +00004730
vlm86380d32006-10-09 12:07:58 +00004731/*** <<< CTDEFS [Enum0] >>> ***/
4732
vlma0da1a32006-10-09 12:27:44 +00004733static asn_per_constraints_t asn_PER_type_Enum0_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00004734 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4735 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4736 0, 0 /* No PER value map */
4737};
4738
vlm337167e2005-11-26 11:25:14 +00004739/*** <<< STAT-DEFS [Enum0] >>> ***/
4740
4741static asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
4742 { 0, 3, "one" },
4743 { 1, 3, "two" }
4744};
4745static unsigned int asn_MAP_Enum0_enum2value_1[] = {
4746 0, /* one(0) */
4747 1 /* two(1) */
4748};
4749static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
4750 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
4751 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
4752 2, /* Number of elements in the maps */
4753 0, /* Enumeration is not extensible */
4754 1 /* Strict enumeration */
4755};
4756static ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
4757 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4758};
vlm337167e2005-11-26 11:25:14 +00004759asn_TYPE_descriptor_t asn_DEF_Enum0 = {
4760 "Enum0",
4761 "Enum0",
4762 Enum0_free,
4763 Enum0_print,
4764 Enum0_constraint,
4765 Enum0_decode_ber,
4766 Enum0_encode_der,
4767 Enum0_decode_xer,
4768 Enum0_encode_xer,
4769 Enum0_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004770 Enum0_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004771 0, /* Use generic outmost tag fetcher */
4772 asn_DEF_Enum0_tags_1,
4773 sizeof(asn_DEF_Enum0_tags_1)
4774 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4775 asn_DEF_Enum0_tags_1, /* Same as above */
4776 sizeof(asn_DEF_Enum0_tags_1)
4777 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00004778 &asn_PER_type_Enum0_constr_1,
vlm337167e2005-11-26 11:25:14 +00004779 0, 0, /* Defined elsewhere */
4780 &asn_SPC_Enum0_specs_1 /* Additional specs */
4781};
4782
4783
4784/*** <<< INCLUDES [Enum1] >>> ***/
4785
4786#include <NativeEnumerated.h>
4787
4788/*** <<< DEPS [Enum1] >>> ***/
4789
4790typedef enum Enum1 {
4791 Enum1_one = 0,
4792 Enum1_two = 1
vlm7c8aa5e2006-03-21 07:25:18 +00004793} e_Enum1;
vlm337167e2005-11-26 11:25:14 +00004794
4795/*** <<< TYPE-DECLS [Enum1] >>> ***/
4796
4797typedef long Enum1_t;
4798
4799/*** <<< FUNC-DECLS [Enum1] >>> ***/
4800
4801extern asn_TYPE_descriptor_t asn_DEF_Enum1;
4802asn_struct_free_f Enum1_free;
4803asn_struct_print_f Enum1_print;
4804asn_constr_check_f Enum1_constraint;
4805ber_type_decoder_f Enum1_decode_ber;
4806der_type_encoder_f Enum1_encode_der;
4807xer_type_decoder_f Enum1_decode_xer;
4808xer_type_encoder_f Enum1_encode_xer;
4809per_type_decoder_f Enum1_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00004810per_type_encoder_f Enum1_encode_uper;
vlm337167e2005-11-26 11:25:14 +00004811
4812/*** <<< CODE [Enum1] >>> ***/
4813
4814int
4815Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00004816 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00004817 long value;
4818
4819 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00004820 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004821 "%s: value not given (%s:%d)",
4822 td->name, __FILE__, __LINE__);
4823 return -1;
4824 }
4825
4826 value = *(const long *)sptr;
4827
4828 if((value == 0)) {
4829 /* Constraint check succeeded */
4830 return 0;
4831 } else {
vlmd4ae41c2006-07-13 13:28:32 +00004832 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00004833 "%s: constraint failed (%s:%d)",
4834 td->name, __FILE__, __LINE__);
4835 return -1;
4836 }
4837}
4838
4839/*
4840 * This type is implemented using NativeEnumerated,
4841 * so here we adjust the DEF accordingly.
4842 */
4843static void
4844Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4845 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4846 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
4847 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4848 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4849 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4850 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4851 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00004852 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00004853 if(!td->per_constraints)
4854 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4855 td->elements = asn_DEF_NativeEnumerated.elements;
4856 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4857 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
4858}
4859
4860void
4861Enum1_free(asn_TYPE_descriptor_t *td,
4862 void *struct_ptr, int contents_only) {
4863 Enum1_1_inherit_TYPE_descriptor(td);
4864 td->free_struct(td, struct_ptr, contents_only);
4865}
4866
4867int
4868Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4869 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4870 Enum1_1_inherit_TYPE_descriptor(td);
4871 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4872}
4873
4874asn_dec_rval_t
4875Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4876 void **structure, const void *bufptr, size_t size, int tag_mode) {
4877 Enum1_1_inherit_TYPE_descriptor(td);
4878 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4879}
4880
4881asn_enc_rval_t
4882Enum1_encode_der(asn_TYPE_descriptor_t *td,
4883 void *structure, int tag_mode, ber_tlv_tag_t tag,
4884 asn_app_consume_bytes_f *cb, void *app_key) {
4885 Enum1_1_inherit_TYPE_descriptor(td);
4886 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4887}
4888
4889asn_dec_rval_t
4890Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4891 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4892 Enum1_1_inherit_TYPE_descriptor(td);
4893 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4894}
4895
4896asn_enc_rval_t
4897Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4898 int ilevel, enum xer_encoder_flags_e flags,
4899 asn_app_consume_bytes_f *cb, void *app_key) {
4900 Enum1_1_inherit_TYPE_descriptor(td);
4901 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4902}
4903
4904asn_dec_rval_t
4905Enum1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4906 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4907 Enum1_1_inherit_TYPE_descriptor(td);
4908 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4909}
4910
vlmb1b193e2006-08-18 01:46:46 +00004911asn_enc_rval_t
4912Enum1_encode_uper(asn_TYPE_descriptor_t *td,
4913 asn_per_constraints_t *constraints,
4914 void *structure, asn_per_outp_t *per_out) {
4915 Enum1_1_inherit_TYPE_descriptor(td);
4916 return td->uper_encoder(td, constraints, structure, per_out);
4917}
4918
vlm337167e2005-11-26 11:25:14 +00004919
vlm86380d32006-10-09 12:07:58 +00004920/*** <<< CTDEFS [Enum1] >>> ***/
4921
vlma0da1a32006-10-09 12:27:44 +00004922static asn_per_constraints_t asn_PER_type_Enum1_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00004923 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4924 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4925 0, 0 /* No PER value map */
4926};
4927
vlm337167e2005-11-26 11:25:14 +00004928/*** <<< STAT-DEFS [Enum1] >>> ***/
4929
4930static asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
4931 { 0, 3, "one" },
4932 { 1, 3, "two" }
4933};
4934static unsigned int asn_MAP_Enum1_enum2value_1[] = {
4935 0, /* one(0) */
4936 1 /* two(1) */
4937};
4938static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
4939 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
4940 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
4941 2, /* Number of elements in the maps */
4942 0, /* Enumeration is not extensible */
4943 1 /* Strict enumeration */
4944};
4945static ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
4946 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4947};
vlm337167e2005-11-26 11:25:14 +00004948asn_TYPE_descriptor_t asn_DEF_Enum1 = {
4949 "Enum1",
4950 "Enum1",
4951 Enum1_free,
4952 Enum1_print,
4953 Enum1_constraint,
4954 Enum1_decode_ber,
4955 Enum1_encode_der,
4956 Enum1_decode_xer,
4957 Enum1_encode_xer,
4958 Enum1_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00004959 Enum1_encode_uper,
vlm337167e2005-11-26 11:25:14 +00004960 0, /* Use generic outmost tag fetcher */
4961 asn_DEF_Enum1_tags_1,
4962 sizeof(asn_DEF_Enum1_tags_1)
4963 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4964 asn_DEF_Enum1_tags_1, /* Same as above */
4965 sizeof(asn_DEF_Enum1_tags_1)
4966 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00004967 &asn_PER_type_Enum1_constr_1,
vlm337167e2005-11-26 11:25:14 +00004968 0, 0, /* Defined elsewhere */
4969 &asn_SPC_Enum1_specs_1 /* Additional specs */
4970};
4971
4972
4973/*** <<< INCLUDES [Identifier] >>> ***/
4974
4975#include <VisibleString.h>
4976
4977/*** <<< TYPE-DECLS [Identifier] >>> ***/
4978
4979typedef VisibleString_t Identifier_t;
4980
4981/*** <<< FUNC-DECLS [Identifier] >>> ***/
4982
4983extern asn_TYPE_descriptor_t asn_DEF_Identifier;
4984asn_struct_free_f Identifier_free;
4985asn_struct_print_f Identifier_print;
4986asn_constr_check_f Identifier_constraint;
4987ber_type_decoder_f Identifier_decode_ber;
4988der_type_encoder_f Identifier_encode_der;
4989xer_type_decoder_f Identifier_decode_xer;
4990xer_type_encoder_f Identifier_encode_xer;
4991per_type_decoder_f Identifier_decode_uper;
vlmb1b193e2006-08-18 01:46:46 +00004992per_type_encoder_f Identifier_encode_uper;
vlm337167e2005-11-26 11:25:14 +00004993
4994/*** <<< CTABLES [Identifier] >>> ***/
4995
4996static int permitted_alphabet_table_1[256] = {
vlm4baece12006-09-21 01:52:07 +00004997 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4998 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4999 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
5000 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
5001 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
500227,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
5003 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
500454,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
vlm337167e2005-11-26 11:25:14 +00005005};
vlm4baece12006-09-21 01:52:07 +00005006static int permitted_alphabet_code2value_1[64] = {
500736,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
500870,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
500986,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
5010107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
5011};
5012
vlm337167e2005-11-26 11:25:14 +00005013
5014static int check_permitted_alphabet_1(const void *sptr) {
5015 int *table = permitted_alphabet_table_1;
5016 /* The underlying type is VisibleString */
5017 const VisibleString_t *st = (const VisibleString_t *)sptr;
5018 const uint8_t *ch = st->buf;
5019 const uint8_t *end = ch + st->size;
5020
5021 for(; ch < end; ch++) {
5022 uint8_t cv = *ch;
5023 if(!table[cv]) return -1;
5024 }
5025 return 0;
5026}
5027
5028
5029/*** <<< CODE [Identifier] >>> ***/
5030
5031int
5032Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +00005033 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm337167e2005-11-26 11:25:14 +00005034 const VisibleString_t *st = (const VisibleString_t *)sptr;
5035 size_t size;
5036
5037 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +00005038 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00005039 "%s: value not given (%s:%d)",
5040 td->name, __FILE__, __LINE__);
5041 return -1;
5042 }
5043
5044 size = st->size;
5045
5046 if((size >= 1 && size <= 32)
5047 && !check_permitted_alphabet_1(st)) {
5048 /* Constraint check succeeded */
5049 return 0;
5050 } else {
vlmd4ae41c2006-07-13 13:28:32 +00005051 _ASN_CTFAIL(app_key, td, sptr,
vlm337167e2005-11-26 11:25:14 +00005052 "%s: constraint failed (%s:%d)",
5053 td->name, __FILE__, __LINE__);
5054 return -1;
5055 }
5056}
5057
vlm86380d32006-10-09 12:07:58 +00005058static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) {
5059 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
5060 return -1;
5061 return permitted_alphabet_table_1[value] - 1;
5062}
5063static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) {
5064 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
5065 return -1;
5066 return permitted_alphabet_code2value_1[code];
5067}
vlm337167e2005-11-26 11:25:14 +00005068/*
5069 * This type is implemented using VisibleString,
5070 * so here we adjust the DEF accordingly.
5071 */
5072static void
5073Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
5074 td->free_struct = asn_DEF_VisibleString.free_struct;
5075 td->print_struct = asn_DEF_VisibleString.print_struct;
5076 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
5077 td->der_encoder = asn_DEF_VisibleString.der_encoder;
5078 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
5079 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
5080 td->uper_decoder = asn_DEF_VisibleString.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +00005081 td->uper_encoder = asn_DEF_VisibleString.uper_encoder;
vlm337167e2005-11-26 11:25:14 +00005082 if(!td->per_constraints)
5083 td->per_constraints = asn_DEF_VisibleString.per_constraints;
5084 td->elements = asn_DEF_VisibleString.elements;
5085 td->elements_count = asn_DEF_VisibleString.elements_count;
5086 td->specifics = asn_DEF_VisibleString.specifics;
5087}
5088
5089void
5090Identifier_free(asn_TYPE_descriptor_t *td,
5091 void *struct_ptr, int contents_only) {
5092 Identifier_1_inherit_TYPE_descriptor(td);
5093 td->free_struct(td, struct_ptr, contents_only);
5094}
5095
5096int
5097Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
5098 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
5099 Identifier_1_inherit_TYPE_descriptor(td);
5100 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
5101}
5102
5103asn_dec_rval_t
5104Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5105 void **structure, const void *bufptr, size_t size, int tag_mode) {
5106 Identifier_1_inherit_TYPE_descriptor(td);
5107 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
5108}
5109
5110asn_enc_rval_t
5111Identifier_encode_der(asn_TYPE_descriptor_t *td,
5112 void *structure, int tag_mode, ber_tlv_tag_t tag,
5113 asn_app_consume_bytes_f *cb, void *app_key) {
5114 Identifier_1_inherit_TYPE_descriptor(td);
5115 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
5116}
5117
5118asn_dec_rval_t
5119Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5120 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
5121 Identifier_1_inherit_TYPE_descriptor(td);
5122 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
5123}
5124
5125asn_enc_rval_t
5126Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
5127 int ilevel, enum xer_encoder_flags_e flags,
5128 asn_app_consume_bytes_f *cb, void *app_key) {
5129 Identifier_1_inherit_TYPE_descriptor(td);
5130 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
5131}
5132
5133asn_dec_rval_t
5134Identifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5135 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
5136 Identifier_1_inherit_TYPE_descriptor(td);
5137 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
5138}
5139
vlmb1b193e2006-08-18 01:46:46 +00005140asn_enc_rval_t
5141Identifier_encode_uper(asn_TYPE_descriptor_t *td,
5142 asn_per_constraints_t *constraints,
5143 void *structure, asn_per_outp_t *per_out) {
5144 Identifier_1_inherit_TYPE_descriptor(td);
5145 return td->uper_encoder(td, constraints, structure, per_out);
5146}
5147
vlm337167e2005-11-26 11:25:14 +00005148
vlm86380d32006-10-09 12:07:58 +00005149/*** <<< CTDEFS [Identifier] >>> ***/
5150
vlma0da1a32006-10-09 12:27:44 +00005151static asn_per_constraints_t asn_PER_type_Identifier_constr_1 = {
vlm86380d32006-10-09 12:07:58 +00005152 { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */,
5153 { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
5154 asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */
5155 asn_PER_MAP_Identifier_1_c2v /* PER code to value map */
5156};
5157
vlm337167e2005-11-26 11:25:14 +00005158/*** <<< STAT-DEFS [Identifier] >>> ***/
5159
5160static ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
5161 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
5162};
vlm337167e2005-11-26 11:25:14 +00005163asn_TYPE_descriptor_t asn_DEF_Identifier = {
5164 "Identifier",
5165 "Identifier",
5166 Identifier_free,
5167 Identifier_print,
5168 Identifier_constraint,
5169 Identifier_decode_ber,
5170 Identifier_encode_der,
5171 Identifier_decode_xer,
5172 Identifier_encode_xer,
5173 Identifier_decode_uper,
vlmb1b193e2006-08-18 01:46:46 +00005174 Identifier_encode_uper,
vlm337167e2005-11-26 11:25:14 +00005175 0, /* Use generic outmost tag fetcher */
5176 asn_DEF_Identifier_tags_1,
5177 sizeof(asn_DEF_Identifier_tags_1)
5178 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
5179 asn_DEF_Identifier_tags_1, /* Same as above */
5180 sizeof(asn_DEF_Identifier_tags_1)
5181 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
vlma0da1a32006-10-09 12:27:44 +00005182 &asn_PER_type_Identifier_constr_1,
vlm337167e2005-11-26 11:25:14 +00005183 0, 0, /* No members */
5184 0 /* No specifics */
5185};
5186