blob: 3e2911dfb6620388d55d29a1fd962b4a1a8a5fc3 [file] [log] [blame]
Lev Walkin59b176e2005-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;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000021per_type_encoder_f Int1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +000022
23/*** <<< CODE [Int1] >>> ***/
24
25int
26Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000027 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +000028 /* Replace with underlying type checker */
29 td->check_constraints = asn_DEF_INTEGER.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +000030 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +000031}
32
33/*
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;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000046 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-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
Lev Walkin9f5bb3a2006-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
Lev Walkin59b176e2005-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,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000130 Int1_encode_uper,
Lev Walkin59b176e2005-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
Lev Walkin22b5ed42006-09-13 02:51:20 +0000146#include "Int1.h"
Lev Walkin59b176e2005-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;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000163per_type_encoder_f Int2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000164
165/*** <<< CODE [Int2] >>> ***/
166
167int
168Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000169 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000170 const Int1_t *st = (const Int1_t *)sptr;
171 long value;
172
173 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000174 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000175 "%s: value not given (%s:%d)",
176 td->name, __FILE__, __LINE__);
177 return -1;
178 }
179
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 {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000187 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-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;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000207 td->uper_encoder = asn_DEF_Int1.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000208 if(!td->per_constraints)
209 td->per_constraints = asn_DEF_Int1.per_constraints;
210 td->elements = asn_DEF_Int1.elements;
211 td->elements_count = asn_DEF_Int1.elements_count;
212 td->specifics = asn_DEF_Int1.specifics;
213}
214
215void
216Int2_free(asn_TYPE_descriptor_t *td,
217 void *struct_ptr, int contents_only) {
218 Int2_1_inherit_TYPE_descriptor(td);
219 td->free_struct(td, struct_ptr, contents_only);
220}
221
222int
223Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
224 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
225 Int2_1_inherit_TYPE_descriptor(td);
226 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
227}
228
229asn_dec_rval_t
230Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
231 void **structure, const void *bufptr, size_t size, int tag_mode) {
232 Int2_1_inherit_TYPE_descriptor(td);
233 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
234}
235
236asn_enc_rval_t
237Int2_encode_der(asn_TYPE_descriptor_t *td,
238 void *structure, int tag_mode, ber_tlv_tag_t tag,
239 asn_app_consume_bytes_f *cb, void *app_key) {
240 Int2_1_inherit_TYPE_descriptor(td);
241 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
242}
243
244asn_dec_rval_t
245Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
246 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
247 Int2_1_inherit_TYPE_descriptor(td);
248 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
249}
250
251asn_enc_rval_t
252Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
253 int ilevel, enum xer_encoder_flags_e flags,
254 asn_app_consume_bytes_f *cb, void *app_key) {
255 Int2_1_inherit_TYPE_descriptor(td);
256 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
257}
258
259asn_dec_rval_t
260Int2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
261 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
262 Int2_1_inherit_TYPE_descriptor(td);
263 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
264}
265
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000266asn_enc_rval_t
267Int2_encode_uper(asn_TYPE_descriptor_t *td,
268 asn_per_constraints_t *constraints,
269 void *structure, asn_per_outp_t *per_out) {
270 Int2_1_inherit_TYPE_descriptor(td);
271 return td->uper_encoder(td, constraints, structure, per_out);
272}
273
Lev Walkin59b176e2005-11-26 11:25:14 +0000274
275/*** <<< STAT-DEFS [Int2] >>> ***/
276
277static ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
278 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
279};
280static asn_per_constraints_t asn_PER_Int2_constr_1 = {
281 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
282 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
283};
284asn_TYPE_descriptor_t asn_DEF_Int2 = {
285 "Int2",
286 "Int2",
287 Int2_free,
288 Int2_print,
289 Int2_constraint,
290 Int2_decode_ber,
291 Int2_encode_der,
292 Int2_decode_xer,
293 Int2_encode_xer,
294 Int2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000295 Int2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000296 0, /* Use generic outmost tag fetcher */
297 asn_DEF_Int2_tags_1,
298 sizeof(asn_DEF_Int2_tags_1)
299 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
300 asn_DEF_Int2_tags_1, /* Same as above */
301 sizeof(asn_DEF_Int2_tags_1)
302 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
303 &asn_PER_Int2_constr_1,
304 0, 0, /* No members */
305 0 /* No specifics */
306};
307
308
309/*** <<< INCLUDES [Int3] >>> ***/
310
Lev Walkin22b5ed42006-09-13 02:51:20 +0000311#include "Int2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000312
313/*** <<< TYPE-DECLS [Int3] >>> ***/
314
315typedef Int2_t Int3_t;
316
317/*** <<< FUNC-DECLS [Int3] >>> ***/
318
319extern asn_TYPE_descriptor_t asn_DEF_Int3;
320asn_struct_free_f Int3_free;
321asn_struct_print_f Int3_print;
322asn_constr_check_f Int3_constraint;
323ber_type_decoder_f Int3_decode_ber;
324der_type_encoder_f Int3_encode_der;
325xer_type_decoder_f Int3_decode_xer;
326xer_type_encoder_f Int3_encode_xer;
327per_type_decoder_f Int3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000328per_type_encoder_f Int3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000329
330/*** <<< CODE [Int3] >>> ***/
331
332int
333Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000334 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000335 const Int2_t *st = (const Int2_t *)sptr;
336 long value;
337
338 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000339 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000340 "%s: value not given (%s:%d)",
341 td->name, __FILE__, __LINE__);
342 return -1;
343 }
344
345 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000346 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000347 "%s: value too large (%s:%d)",
348 td->name, __FILE__, __LINE__);
349 return -1;
350 }
351
352 if((value >= 0 && value <= 10)) {
353 /* Constraint check succeeded */
354 return 0;
355 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000356 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000357 "%s: constraint failed (%s:%d)",
358 td->name, __FILE__, __LINE__);
359 return -1;
360 }
361}
362
363/*
364 * This type is implemented using Int2,
365 * so here we adjust the DEF accordingly.
366 */
367static void
368Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
369 td->free_struct = asn_DEF_Int2.free_struct;
370 td->print_struct = asn_DEF_Int2.print_struct;
371 td->ber_decoder = asn_DEF_Int2.ber_decoder;
372 td->der_encoder = asn_DEF_Int2.der_encoder;
373 td->xer_decoder = asn_DEF_Int2.xer_decoder;
374 td->xer_encoder = asn_DEF_Int2.xer_encoder;
375 td->uper_decoder = asn_DEF_Int2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000376 td->uper_encoder = asn_DEF_Int2.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000377 if(!td->per_constraints)
378 td->per_constraints = asn_DEF_Int2.per_constraints;
379 td->elements = asn_DEF_Int2.elements;
380 td->elements_count = asn_DEF_Int2.elements_count;
381 td->specifics = asn_DEF_Int2.specifics;
382}
383
384void
385Int3_free(asn_TYPE_descriptor_t *td,
386 void *struct_ptr, int contents_only) {
387 Int3_1_inherit_TYPE_descriptor(td);
388 td->free_struct(td, struct_ptr, contents_only);
389}
390
391int
392Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
393 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
394 Int3_1_inherit_TYPE_descriptor(td);
395 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
396}
397
398asn_dec_rval_t
399Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
400 void **structure, const void *bufptr, size_t size, int tag_mode) {
401 Int3_1_inherit_TYPE_descriptor(td);
402 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
403}
404
405asn_enc_rval_t
406Int3_encode_der(asn_TYPE_descriptor_t *td,
407 void *structure, int tag_mode, ber_tlv_tag_t tag,
408 asn_app_consume_bytes_f *cb, void *app_key) {
409 Int3_1_inherit_TYPE_descriptor(td);
410 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
411}
412
413asn_dec_rval_t
414Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
415 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
416 Int3_1_inherit_TYPE_descriptor(td);
417 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
418}
419
420asn_enc_rval_t
421Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
422 int ilevel, enum xer_encoder_flags_e flags,
423 asn_app_consume_bytes_f *cb, void *app_key) {
424 Int3_1_inherit_TYPE_descriptor(td);
425 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
426}
427
428asn_dec_rval_t
429Int3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
430 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
431 Int3_1_inherit_TYPE_descriptor(td);
432 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
433}
434
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000435asn_enc_rval_t
436Int3_encode_uper(asn_TYPE_descriptor_t *td,
437 asn_per_constraints_t *constraints,
438 void *structure, asn_per_outp_t *per_out) {
439 Int3_1_inherit_TYPE_descriptor(td);
440 return td->uper_encoder(td, constraints, structure, per_out);
441}
442
Lev Walkin59b176e2005-11-26 11:25:14 +0000443
444/*** <<< STAT-DEFS [Int3] >>> ***/
445
446static ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
447 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
448};
449static asn_per_constraints_t asn_PER_Int3_constr_1 = {
450 { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
451 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
452};
453asn_TYPE_descriptor_t asn_DEF_Int3 = {
454 "Int3",
455 "Int3",
456 Int3_free,
457 Int3_print,
458 Int3_constraint,
459 Int3_decode_ber,
460 Int3_encode_der,
461 Int3_decode_xer,
462 Int3_encode_xer,
463 Int3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000464 Int3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000465 0, /* Use generic outmost tag fetcher */
466 asn_DEF_Int3_tags_1,
467 sizeof(asn_DEF_Int3_tags_1)
468 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
469 asn_DEF_Int3_tags_1, /* Same as above */
470 sizeof(asn_DEF_Int3_tags_1)
471 /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */
472 &asn_PER_Int3_constr_1,
473 0, 0, /* No members */
474 0 /* No specifics */
475};
476
477
478/*** <<< INCLUDES [Int4] >>> ***/
479
Lev Walkin22b5ed42006-09-13 02:51:20 +0000480#include "Int3.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000481
482/*** <<< TYPE-DECLS [Int4] >>> ***/
483
484typedef Int3_t Int4_t;
485
486/*** <<< FUNC-DECLS [Int4] >>> ***/
487
488extern asn_TYPE_descriptor_t asn_DEF_Int4;
489asn_struct_free_f Int4_free;
490asn_struct_print_f Int4_print;
491asn_constr_check_f Int4_constraint;
492ber_type_decoder_f Int4_decode_ber;
493der_type_encoder_f Int4_encode_der;
494xer_type_decoder_f Int4_decode_xer;
495xer_type_encoder_f Int4_encode_xer;
496per_type_decoder_f Int4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000497per_type_encoder_f Int4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000498
499/*** <<< CODE [Int4] >>> ***/
500
501int
502Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000503 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000504 const Int3_t *st = (const Int3_t *)sptr;
505 long value;
506
507 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000508 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000509 "%s: value not given (%s:%d)",
510 td->name, __FILE__, __LINE__);
511 return -1;
512 }
513
514 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000515 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000516 "%s: value too large (%s:%d)",
517 td->name, __FILE__, __LINE__);
518 return -1;
519 }
520
521 if((value >= 1 && value <= 10)) {
522 /* Constraint check succeeded */
523 return 0;
524 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000525 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000526 "%s: constraint failed (%s:%d)",
527 td->name, __FILE__, __LINE__);
528 return -1;
529 }
530}
531
532/*
533 * This type is implemented using Int3,
534 * so here we adjust the DEF accordingly.
535 */
536static void
537Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
538 td->free_struct = asn_DEF_Int3.free_struct;
539 td->print_struct = asn_DEF_Int3.print_struct;
540 td->ber_decoder = asn_DEF_Int3.ber_decoder;
541 td->der_encoder = asn_DEF_Int3.der_encoder;
542 td->xer_decoder = asn_DEF_Int3.xer_decoder;
543 td->xer_encoder = asn_DEF_Int3.xer_encoder;
544 td->uper_decoder = asn_DEF_Int3.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000545 td->uper_encoder = asn_DEF_Int3.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000546 if(!td->per_constraints)
547 td->per_constraints = asn_DEF_Int3.per_constraints;
548 td->elements = asn_DEF_Int3.elements;
549 td->elements_count = asn_DEF_Int3.elements_count;
550 td->specifics = asn_DEF_Int3.specifics;
551}
552
553void
554Int4_free(asn_TYPE_descriptor_t *td,
555 void *struct_ptr, int contents_only) {
556 Int4_1_inherit_TYPE_descriptor(td);
557 td->free_struct(td, struct_ptr, contents_only);
558}
559
560int
561Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
562 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
563 Int4_1_inherit_TYPE_descriptor(td);
564 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
565}
566
567asn_dec_rval_t
568Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
569 void **structure, const void *bufptr, size_t size, int tag_mode) {
570 Int4_1_inherit_TYPE_descriptor(td);
571 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
572}
573
574asn_enc_rval_t
575Int4_encode_der(asn_TYPE_descriptor_t *td,
576 void *structure, int tag_mode, ber_tlv_tag_t tag,
577 asn_app_consume_bytes_f *cb, void *app_key) {
578 Int4_1_inherit_TYPE_descriptor(td);
579 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
580}
581
582asn_dec_rval_t
583Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
584 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
585 Int4_1_inherit_TYPE_descriptor(td);
586 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
587}
588
589asn_enc_rval_t
590Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
591 int ilevel, enum xer_encoder_flags_e flags,
592 asn_app_consume_bytes_f *cb, void *app_key) {
593 Int4_1_inherit_TYPE_descriptor(td);
594 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
595}
596
597asn_dec_rval_t
598Int4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
599 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
600 Int4_1_inherit_TYPE_descriptor(td);
601 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
602}
603
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000604asn_enc_rval_t
605Int4_encode_uper(asn_TYPE_descriptor_t *td,
606 asn_per_constraints_t *constraints,
607 void *structure, asn_per_outp_t *per_out) {
608 Int4_1_inherit_TYPE_descriptor(td);
609 return td->uper_encoder(td, constraints, structure, per_out);
610}
611
Lev Walkin59b176e2005-11-26 11:25:14 +0000612
613/*** <<< STAT-DEFS [Int4] >>> ***/
614
615static ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
616 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
617};
618static asn_per_constraints_t asn_PER_Int4_constr_1 = {
619 { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
620 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
621};
622asn_TYPE_descriptor_t asn_DEF_Int4 = {
623 "Int4",
624 "Int4",
625 Int4_free,
626 Int4_print,
627 Int4_constraint,
628 Int4_decode_ber,
629 Int4_encode_der,
630 Int4_decode_xer,
631 Int4_encode_xer,
632 Int4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000633 Int4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000634 0, /* Use generic outmost tag fetcher */
635 asn_DEF_Int4_tags_1,
636 sizeof(asn_DEF_Int4_tags_1)
637 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
638 asn_DEF_Int4_tags_1, /* Same as above */
639 sizeof(asn_DEF_Int4_tags_1)
640 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
641 &asn_PER_Int4_constr_1,
642 0, 0, /* No members */
643 0 /* No specifics */
644};
645
646
647/*** <<< INCLUDES [Int5] >>> ***/
648
Lev Walkin22b5ed42006-09-13 02:51:20 +0000649#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000650
651/*** <<< TYPE-DECLS [Int5] >>> ***/
652
653typedef Int4_t Int5_t;
654
655/*** <<< FUNC-DECLS [Int5] >>> ***/
656
657extern asn_TYPE_descriptor_t asn_DEF_Int5;
658asn_struct_free_f Int5_free;
659asn_struct_print_f Int5_print;
660asn_constr_check_f Int5_constraint;
661ber_type_decoder_f Int5_decode_ber;
662der_type_encoder_f Int5_encode_der;
663xer_type_decoder_f Int5_decode_xer;
664xer_type_encoder_f Int5_encode_xer;
665per_type_decoder_f Int5_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000666per_type_encoder_f Int5_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000667
668/*** <<< CODE [Int5] >>> ***/
669
670int
671Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000672 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000673 const Int4_t *st = (const Int4_t *)sptr;
674 long value;
675
676 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000677 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000678 "%s: value not given (%s:%d)",
679 td->name, __FILE__, __LINE__);
680 return -1;
681 }
682
683 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000684 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000685 "%s: value too large (%s:%d)",
686 td->name, __FILE__, __LINE__);
687 return -1;
688 }
689
690 if((value == 5)) {
691 /* Constraint check succeeded */
692 return 0;
693 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000694 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000695 "%s: constraint failed (%s:%d)",
696 td->name, __FILE__, __LINE__);
697 return -1;
698 }
699}
700
701/*
702 * This type is implemented using Int4,
703 * so here we adjust the DEF accordingly.
704 */
705static void
706Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
707 td->free_struct = asn_DEF_Int4.free_struct;
708 td->print_struct = asn_DEF_Int4.print_struct;
709 td->ber_decoder = asn_DEF_Int4.ber_decoder;
710 td->der_encoder = asn_DEF_Int4.der_encoder;
711 td->xer_decoder = asn_DEF_Int4.xer_decoder;
712 td->xer_encoder = asn_DEF_Int4.xer_encoder;
713 td->uper_decoder = asn_DEF_Int4.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000714 td->uper_encoder = asn_DEF_Int4.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000715 if(!td->per_constraints)
716 td->per_constraints = asn_DEF_Int4.per_constraints;
717 td->elements = asn_DEF_Int4.elements;
718 td->elements_count = asn_DEF_Int4.elements_count;
719 td->specifics = asn_DEF_Int4.specifics;
720}
721
722void
723Int5_free(asn_TYPE_descriptor_t *td,
724 void *struct_ptr, int contents_only) {
725 Int5_1_inherit_TYPE_descriptor(td);
726 td->free_struct(td, struct_ptr, contents_only);
727}
728
729int
730Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
731 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
732 Int5_1_inherit_TYPE_descriptor(td);
733 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
734}
735
736asn_dec_rval_t
737Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
738 void **structure, const void *bufptr, size_t size, int tag_mode) {
739 Int5_1_inherit_TYPE_descriptor(td);
740 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
741}
742
743asn_enc_rval_t
744Int5_encode_der(asn_TYPE_descriptor_t *td,
745 void *structure, int tag_mode, ber_tlv_tag_t tag,
746 asn_app_consume_bytes_f *cb, void *app_key) {
747 Int5_1_inherit_TYPE_descriptor(td);
748 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
749}
750
751asn_dec_rval_t
752Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
753 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
754 Int5_1_inherit_TYPE_descriptor(td);
755 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
756}
757
758asn_enc_rval_t
759Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
760 int ilevel, enum xer_encoder_flags_e flags,
761 asn_app_consume_bytes_f *cb, void *app_key) {
762 Int5_1_inherit_TYPE_descriptor(td);
763 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
764}
765
766asn_dec_rval_t
767Int5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
768 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
769 Int5_1_inherit_TYPE_descriptor(td);
770 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
771}
772
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000773asn_enc_rval_t
774Int5_encode_uper(asn_TYPE_descriptor_t *td,
775 asn_per_constraints_t *constraints,
776 void *structure, asn_per_outp_t *per_out) {
777 Int5_1_inherit_TYPE_descriptor(td);
778 return td->uper_encoder(td, constraints, structure, per_out);
779}
780
Lev Walkin59b176e2005-11-26 11:25:14 +0000781
782/*** <<< STAT-DEFS [Int5] >>> ***/
783
784static ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
785 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
786};
787static asn_per_constraints_t asn_PER_Int5_constr_1 = {
788 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
789 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
790};
791asn_TYPE_descriptor_t asn_DEF_Int5 = {
792 "Int5",
793 "Int5",
794 Int5_free,
795 Int5_print,
796 Int5_constraint,
797 Int5_decode_ber,
798 Int5_encode_der,
799 Int5_decode_xer,
800 Int5_encode_xer,
801 Int5_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000802 Int5_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000803 0, /* Use generic outmost tag fetcher */
804 asn_DEF_Int5_tags_1,
805 sizeof(asn_DEF_Int5_tags_1)
806 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
807 asn_DEF_Int5_tags_1, /* Same as above */
808 sizeof(asn_DEF_Int5_tags_1)
809 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
810 &asn_PER_Int5_constr_1,
811 0, 0, /* No members */
812 0 /* No specifics */
813};
814
815
816/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
817
818#include <INTEGER.h>
819
820/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
821
822typedef INTEGER_t ExtensibleExtensions_t;
823
824/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
825
826extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
827asn_struct_free_f ExtensibleExtensions_free;
828asn_struct_print_f ExtensibleExtensions_print;
829asn_constr_check_f ExtensibleExtensions_constraint;
830ber_type_decoder_f ExtensibleExtensions_decode_ber;
831der_type_encoder_f ExtensibleExtensions_encode_der;
832xer_type_decoder_f ExtensibleExtensions_decode_xer;
833xer_type_encoder_f ExtensibleExtensions_encode_xer;
834per_type_decoder_f ExtensibleExtensions_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000835per_type_encoder_f ExtensibleExtensions_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000836
837/*** <<< CODE [ExtensibleExtensions] >>> ***/
838
839int
840ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000841 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000842 const INTEGER_t *st = (const INTEGER_t *)sptr;
843 long value;
844
845 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000846 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000847 "%s: value not given (%s:%d)",
848 td->name, __FILE__, __LINE__);
849 return -1;
850 }
851
852 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000853 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000854 "%s: value too large (%s:%d)",
855 td->name, __FILE__, __LINE__);
856 return -1;
857 }
858
859 if((value >= 1 && value <= 256)) {
860 /* Constraint check succeeded */
861 return 0;
862 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000863 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000864 "%s: constraint failed (%s:%d)",
865 td->name, __FILE__, __LINE__);
866 return -1;
867 }
868}
869
870/*
871 * This type is implemented using INTEGER,
872 * so here we adjust the DEF accordingly.
873 */
874static void
875ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
876 td->free_struct = asn_DEF_INTEGER.free_struct;
877 td->print_struct = asn_DEF_INTEGER.print_struct;
878 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
879 td->der_encoder = asn_DEF_INTEGER.der_encoder;
880 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
881 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
882 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000883 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000884 if(!td->per_constraints)
885 td->per_constraints = asn_DEF_INTEGER.per_constraints;
886 td->elements = asn_DEF_INTEGER.elements;
887 td->elements_count = asn_DEF_INTEGER.elements_count;
888 td->specifics = asn_DEF_INTEGER.specifics;
889}
890
891void
892ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
893 void *struct_ptr, int contents_only) {
894 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
895 td->free_struct(td, struct_ptr, contents_only);
896}
897
898int
899ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
900 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
901 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
902 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
903}
904
905asn_dec_rval_t
906ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
907 void **structure, const void *bufptr, size_t size, int tag_mode) {
908 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
909 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
910}
911
912asn_enc_rval_t
913ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
914 void *structure, int tag_mode, ber_tlv_tag_t tag,
915 asn_app_consume_bytes_f *cb, void *app_key) {
916 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
917 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
918}
919
920asn_dec_rval_t
921ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
922 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
923 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
924 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
925}
926
927asn_enc_rval_t
928ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
929 int ilevel, enum xer_encoder_flags_e flags,
930 asn_app_consume_bytes_f *cb, void *app_key) {
931 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
932 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
933}
934
935asn_dec_rval_t
936ExtensibleExtensions_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
937 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
938 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
939 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
940}
941
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000942asn_enc_rval_t
943ExtensibleExtensions_encode_uper(asn_TYPE_descriptor_t *td,
944 asn_per_constraints_t *constraints,
945 void *structure, asn_per_outp_t *per_out) {
946 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
947 return td->uper_encoder(td, constraints, structure, per_out);
948}
949
Lev Walkin59b176e2005-11-26 11:25:14 +0000950
951/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
952
953static ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
954 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
955};
956static asn_per_constraints_t asn_PER_ExtensibleExtensions_constr_1 = {
957 { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
958 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
959};
960asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
961 "ExtensibleExtensions",
962 "ExtensibleExtensions",
963 ExtensibleExtensions_free,
964 ExtensibleExtensions_print,
965 ExtensibleExtensions_constraint,
966 ExtensibleExtensions_decode_ber,
967 ExtensibleExtensions_encode_der,
968 ExtensibleExtensions_decode_xer,
969 ExtensibleExtensions_encode_xer,
970 ExtensibleExtensions_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000971 ExtensibleExtensions_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000972 0, /* Use generic outmost tag fetcher */
973 asn_DEF_ExtensibleExtensions_tags_1,
974 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
975 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
976 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
977 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
978 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
979 &asn_PER_ExtensibleExtensions_constr_1,
980 0, 0, /* No members */
981 0 /* No specifics */
982};
983
984
985/*** <<< INCLUDES [Str1] >>> ***/
986
987#include <IA5String.h>
988
989/*** <<< TYPE-DECLS [Str1] >>> ***/
990
991typedef IA5String_t Str1_t;
992
993/*** <<< FUNC-DECLS [Str1] >>> ***/
994
995extern asn_TYPE_descriptor_t asn_DEF_Str1;
996asn_struct_free_f Str1_free;
997asn_struct_print_f Str1_print;
998asn_constr_check_f Str1_constraint;
999ber_type_decoder_f Str1_decode_ber;
1000der_type_encoder_f Str1_encode_der;
1001xer_type_decoder_f Str1_decode_xer;
1002xer_type_encoder_f Str1_encode_xer;
1003per_type_decoder_f Str1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001004per_type_encoder_f Str1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001005
1006/*** <<< CODE [Str1] >>> ***/
1007
1008int
1009Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001010 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001011 /* Replace with underlying type checker */
1012 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00001013 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00001014}
1015
1016/*
1017 * This type is implemented using IA5String,
1018 * so here we adjust the DEF accordingly.
1019 */
1020static void
1021Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1022 td->free_struct = asn_DEF_IA5String.free_struct;
1023 td->print_struct = asn_DEF_IA5String.print_struct;
1024 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1025 td->der_encoder = asn_DEF_IA5String.der_encoder;
1026 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1027 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1028 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001029 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001030 if(!td->per_constraints)
1031 td->per_constraints = asn_DEF_IA5String.per_constraints;
1032 td->elements = asn_DEF_IA5String.elements;
1033 td->elements_count = asn_DEF_IA5String.elements_count;
1034 td->specifics = asn_DEF_IA5String.specifics;
1035}
1036
1037void
1038Str1_free(asn_TYPE_descriptor_t *td,
1039 void *struct_ptr, int contents_only) {
1040 Str1_1_inherit_TYPE_descriptor(td);
1041 td->free_struct(td, struct_ptr, contents_only);
1042}
1043
1044int
1045Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1046 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1047 Str1_1_inherit_TYPE_descriptor(td);
1048 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1049}
1050
1051asn_dec_rval_t
1052Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1053 void **structure, const void *bufptr, size_t size, int tag_mode) {
1054 Str1_1_inherit_TYPE_descriptor(td);
1055 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1056}
1057
1058asn_enc_rval_t
1059Str1_encode_der(asn_TYPE_descriptor_t *td,
1060 void *structure, int tag_mode, ber_tlv_tag_t tag,
1061 asn_app_consume_bytes_f *cb, void *app_key) {
1062 Str1_1_inherit_TYPE_descriptor(td);
1063 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1064}
1065
1066asn_dec_rval_t
1067Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1068 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1069 Str1_1_inherit_TYPE_descriptor(td);
1070 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1071}
1072
1073asn_enc_rval_t
1074Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1075 int ilevel, enum xer_encoder_flags_e flags,
1076 asn_app_consume_bytes_f *cb, void *app_key) {
1077 Str1_1_inherit_TYPE_descriptor(td);
1078 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1079}
1080
1081asn_dec_rval_t
1082Str1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1083 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1084 Str1_1_inherit_TYPE_descriptor(td);
1085 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1086}
1087
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001088asn_enc_rval_t
1089Str1_encode_uper(asn_TYPE_descriptor_t *td,
1090 asn_per_constraints_t *constraints,
1091 void *structure, asn_per_outp_t *per_out) {
1092 Str1_1_inherit_TYPE_descriptor(td);
1093 return td->uper_encoder(td, constraints, structure, per_out);
1094}
1095
Lev Walkin59b176e2005-11-26 11:25:14 +00001096
1097/*** <<< STAT-DEFS [Str1] >>> ***/
1098
1099static ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
1100 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1101};
1102asn_TYPE_descriptor_t asn_DEF_Str1 = {
1103 "Str1",
1104 "Str1",
1105 Str1_free,
1106 Str1_print,
1107 Str1_constraint,
1108 Str1_decode_ber,
1109 Str1_encode_der,
1110 Str1_decode_xer,
1111 Str1_encode_xer,
1112 Str1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001113 Str1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001114 0, /* Use generic outmost tag fetcher */
1115 asn_DEF_Str1_tags_1,
1116 sizeof(asn_DEF_Str1_tags_1)
1117 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1118 asn_DEF_Str1_tags_1, /* Same as above */
1119 sizeof(asn_DEF_Str1_tags_1)
1120 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1121 0, /* No PER visible constraints */
1122 0, 0, /* No members */
1123 0 /* No specifics */
1124};
1125
1126
1127/*** <<< INCLUDES [Str2] >>> ***/
1128
Lev Walkin22b5ed42006-09-13 02:51:20 +00001129#include "Str1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001130
1131/*** <<< TYPE-DECLS [Str2] >>> ***/
1132
1133typedef Str1_t Str2_t;
1134
1135/*** <<< FUNC-DECLS [Str2] >>> ***/
1136
1137extern asn_TYPE_descriptor_t asn_DEF_Str2;
1138asn_struct_free_f Str2_free;
1139asn_struct_print_f Str2_print;
1140asn_constr_check_f Str2_constraint;
1141ber_type_decoder_f Str2_decode_ber;
1142der_type_encoder_f Str2_encode_der;
1143xer_type_decoder_f Str2_decode_xer;
1144xer_type_encoder_f Str2_encode_xer;
1145per_type_decoder_f Str2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001146per_type_encoder_f Str2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001147
1148/*** <<< CTABLES [Str2] >>> ***/
1149
1150static int check_permitted_alphabet_1(const void *sptr) {
1151 /* The underlying type is IA5String */
1152 const IA5String_t *st = (const IA5String_t *)sptr;
1153 const uint8_t *ch = st->buf;
1154 const uint8_t *end = ch + st->size;
1155
1156 for(; ch < end; ch++) {
1157 uint8_t cv = *ch;
1158 if(!(cv <= 127)) return -1;
1159 }
1160 return 0;
1161}
1162
1163
1164/*** <<< CODE [Str2] >>> ***/
1165
1166int
1167Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001168 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001169 const Str1_t *st = (const Str1_t *)sptr;
1170 size_t size;
1171
1172 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001173 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001174 "%s: value not given (%s:%d)",
1175 td->name, __FILE__, __LINE__);
1176 return -1;
1177 }
1178
1179 size = st->size;
1180
1181 if(((size <= 20) || (size >= 25 && size <= 30))
1182 && !check_permitted_alphabet_1(st)) {
1183 /* Constraint check succeeded */
1184 return 0;
1185 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001186 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001187 "%s: constraint failed (%s:%d)",
1188 td->name, __FILE__, __LINE__);
1189 return -1;
1190 }
1191}
1192
1193/*
1194 * This type is implemented using Str1,
1195 * so here we adjust the DEF accordingly.
1196 */
1197static void
1198Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1199 td->free_struct = asn_DEF_Str1.free_struct;
1200 td->print_struct = asn_DEF_Str1.print_struct;
1201 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1202 td->der_encoder = asn_DEF_Str1.der_encoder;
1203 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1204 td->xer_encoder = asn_DEF_Str1.xer_encoder;
1205 td->uper_decoder = asn_DEF_Str1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001206 td->uper_encoder = asn_DEF_Str1.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001207 if(!td->per_constraints)
1208 td->per_constraints = asn_DEF_Str1.per_constraints;
1209 td->elements = asn_DEF_Str1.elements;
1210 td->elements_count = asn_DEF_Str1.elements_count;
1211 td->specifics = asn_DEF_Str1.specifics;
1212}
1213
1214void
1215Str2_free(asn_TYPE_descriptor_t *td,
1216 void *struct_ptr, int contents_only) {
1217 Str2_1_inherit_TYPE_descriptor(td);
1218 td->free_struct(td, struct_ptr, contents_only);
1219}
1220
1221int
1222Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1223 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1224 Str2_1_inherit_TYPE_descriptor(td);
1225 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1226}
1227
1228asn_dec_rval_t
1229Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1230 void **structure, const void *bufptr, size_t size, int tag_mode) {
1231 Str2_1_inherit_TYPE_descriptor(td);
1232 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1233}
1234
1235asn_enc_rval_t
1236Str2_encode_der(asn_TYPE_descriptor_t *td,
1237 void *structure, int tag_mode, ber_tlv_tag_t tag,
1238 asn_app_consume_bytes_f *cb, void *app_key) {
1239 Str2_1_inherit_TYPE_descriptor(td);
1240 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1241}
1242
1243asn_dec_rval_t
1244Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1245 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1246 Str2_1_inherit_TYPE_descriptor(td);
1247 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1248}
1249
1250asn_enc_rval_t
1251Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1252 int ilevel, enum xer_encoder_flags_e flags,
1253 asn_app_consume_bytes_f *cb, void *app_key) {
1254 Str2_1_inherit_TYPE_descriptor(td);
1255 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1256}
1257
1258asn_dec_rval_t
1259Str2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1260 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1261 Str2_1_inherit_TYPE_descriptor(td);
1262 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1263}
1264
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001265asn_enc_rval_t
1266Str2_encode_uper(asn_TYPE_descriptor_t *td,
1267 asn_per_constraints_t *constraints,
1268 void *structure, asn_per_outp_t *per_out) {
1269 Str2_1_inherit_TYPE_descriptor(td);
1270 return td->uper_encoder(td, constraints, structure, per_out);
1271}
1272
Lev Walkin59b176e2005-11-26 11:25:14 +00001273
1274/*** <<< STAT-DEFS [Str2] >>> ***/
1275
1276static ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
1277 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1278};
1279static asn_per_constraints_t asn_PER_Str2_constr_1 = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001280 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
Lev Walkin59b176e2005-11-26 11:25:14 +00001281 { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */
1282};
1283asn_TYPE_descriptor_t asn_DEF_Str2 = {
1284 "Str2",
1285 "Str2",
1286 Str2_free,
1287 Str2_print,
1288 Str2_constraint,
1289 Str2_decode_ber,
1290 Str2_encode_der,
1291 Str2_decode_xer,
1292 Str2_encode_xer,
1293 Str2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001294 Str2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001295 0, /* Use generic outmost tag fetcher */
1296 asn_DEF_Str2_tags_1,
1297 sizeof(asn_DEF_Str2_tags_1)
1298 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1299 asn_DEF_Str2_tags_1, /* Same as above */
1300 sizeof(asn_DEF_Str2_tags_1)
1301 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1302 &asn_PER_Str2_constr_1,
1303 0, 0, /* No members */
1304 0 /* No specifics */
1305};
1306
1307
1308/*** <<< INCLUDES [Str3] >>> ***/
1309
Lev Walkin22b5ed42006-09-13 02:51:20 +00001310#include "Str2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001311
1312/*** <<< TYPE-DECLS [Str3] >>> ***/
1313
1314typedef Str2_t Str3_t;
1315
1316/*** <<< FUNC-DECLS [Str3] >>> ***/
1317
1318extern asn_TYPE_descriptor_t asn_DEF_Str3;
1319asn_struct_free_f Str3_free;
1320asn_struct_print_f Str3_print;
1321asn_constr_check_f Str3_constraint;
1322ber_type_decoder_f Str3_decode_ber;
1323der_type_encoder_f Str3_encode_der;
1324xer_type_decoder_f Str3_decode_xer;
1325xer_type_encoder_f Str3_encode_xer;
1326per_type_decoder_f Str3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001327per_type_encoder_f Str3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001328
1329/*** <<< CTABLES [Str3] >>> ***/
1330
1331static int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1333 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1334 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1336 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
1337 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1338 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin59b176e2005-11-26 11:25:14 +00001339};
Lev Walkin5b62ca82006-09-21 01:52:07 +00001340static int permitted_alphabet_code2value_1[6] = {
134165,66,67,100,101,102,};
1342
Lev Walkin59b176e2005-11-26 11:25:14 +00001343
1344static int check_permitted_alphabet_1(const void *sptr) {
1345 int *table = permitted_alphabet_table_1;
1346 /* The underlying type is IA5String */
1347 const IA5String_t *st = (const IA5String_t *)sptr;
1348 const uint8_t *ch = st->buf;
1349 const uint8_t *end = ch + st->size;
1350
1351 for(; ch < end; ch++) {
1352 uint8_t cv = *ch;
1353 if(!table[cv]) return -1;
1354 }
1355 return 0;
1356}
1357
1358
1359/*** <<< CODE [Str3] >>> ***/
1360
1361int
1362Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001363 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001364 const Str2_t *st = (const Str2_t *)sptr;
1365 size_t size;
1366
1367 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001368 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001369 "%s: value not given (%s:%d)",
1370 td->name, __FILE__, __LINE__);
1371 return -1;
1372 }
1373
1374 size = st->size;
1375
1376 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
1377 && !check_permitted_alphabet_1(st)) {
1378 /* Constraint check succeeded */
1379 return 0;
1380 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001381 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001382 "%s: constraint failed (%s:%d)",
1383 td->name, __FILE__, __LINE__);
1384 return -1;
1385 }
1386}
1387
1388/*
1389 * This type is implemented using Str2,
1390 * so here we adjust the DEF accordingly.
1391 */
1392static void
1393Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1394 td->free_struct = asn_DEF_Str2.free_struct;
1395 td->print_struct = asn_DEF_Str2.print_struct;
1396 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1397 td->der_encoder = asn_DEF_Str2.der_encoder;
1398 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1399 td->xer_encoder = asn_DEF_Str2.xer_encoder;
1400 td->uper_decoder = asn_DEF_Str2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001401 td->uper_encoder = asn_DEF_Str2.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001402 if(!td->per_constraints)
1403 td->per_constraints = asn_DEF_Str2.per_constraints;
1404 td->elements = asn_DEF_Str2.elements;
1405 td->elements_count = asn_DEF_Str2.elements_count;
1406 td->specifics = asn_DEF_Str2.specifics;
1407}
1408
1409void
1410Str3_free(asn_TYPE_descriptor_t *td,
1411 void *struct_ptr, int contents_only) {
1412 Str3_1_inherit_TYPE_descriptor(td);
1413 td->free_struct(td, struct_ptr, contents_only);
1414}
1415
1416int
1417Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1418 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1419 Str3_1_inherit_TYPE_descriptor(td);
1420 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1421}
1422
1423asn_dec_rval_t
1424Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1425 void **structure, const void *bufptr, size_t size, int tag_mode) {
1426 Str3_1_inherit_TYPE_descriptor(td);
1427 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1428}
1429
1430asn_enc_rval_t
1431Str3_encode_der(asn_TYPE_descriptor_t *td,
1432 void *structure, int tag_mode, ber_tlv_tag_t tag,
1433 asn_app_consume_bytes_f *cb, void *app_key) {
1434 Str3_1_inherit_TYPE_descriptor(td);
1435 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1436}
1437
1438asn_dec_rval_t
1439Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1440 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1441 Str3_1_inherit_TYPE_descriptor(td);
1442 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1443}
1444
1445asn_enc_rval_t
1446Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1447 int ilevel, enum xer_encoder_flags_e flags,
1448 asn_app_consume_bytes_f *cb, void *app_key) {
1449 Str3_1_inherit_TYPE_descriptor(td);
1450 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1451}
1452
1453asn_dec_rval_t
1454Str3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1455 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1456 Str3_1_inherit_TYPE_descriptor(td);
1457 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1458}
1459
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001460asn_enc_rval_t
1461Str3_encode_uper(asn_TYPE_descriptor_t *td,
1462 asn_per_constraints_t *constraints,
1463 void *structure, asn_per_outp_t *per_out) {
1464 Str3_1_inherit_TYPE_descriptor(td);
1465 return td->uper_encoder(td, constraints, structure, per_out);
1466}
1467
Lev Walkin59b176e2005-11-26 11:25:14 +00001468
1469/*** <<< STAT-DEFS [Str3] >>> ***/
1470
1471static ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
1472 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1473};
1474static asn_per_constraints_t asn_PER_Str3_constr_1 = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001475 { APC_CONSTRAINED, 6, 6, 65, 102 } /* (65..102) */,
Lev Walkin59b176e2005-11-26 11:25:14 +00001476 { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */
1477};
1478asn_TYPE_descriptor_t asn_DEF_Str3 = {
1479 "Str3",
1480 "Str3",
1481 Str3_free,
1482 Str3_print,
1483 Str3_constraint,
1484 Str3_decode_ber,
1485 Str3_encode_der,
1486 Str3_decode_xer,
1487 Str3_encode_xer,
1488 Str3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001489 Str3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001490 0, /* Use generic outmost tag fetcher */
1491 asn_DEF_Str3_tags_1,
1492 sizeof(asn_DEF_Str3_tags_1)
1493 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1494 asn_DEF_Str3_tags_1, /* Same as above */
1495 sizeof(asn_DEF_Str3_tags_1)
1496 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1497 &asn_PER_Str3_constr_1,
1498 0, 0, /* No members */
1499 0 /* No specifics */
1500};
1501
1502
1503/*** <<< INCLUDES [Str4] >>> ***/
1504
1505#include <IA5String.h>
1506
1507/*** <<< TYPE-DECLS [Str4] >>> ***/
1508
1509typedef IA5String_t Str4_t;
1510
1511/*** <<< FUNC-DECLS [Str4] >>> ***/
1512
1513extern asn_TYPE_descriptor_t asn_DEF_Str4;
1514asn_struct_free_f Str4_free;
1515asn_struct_print_f Str4_print;
1516asn_constr_check_f Str4_constraint;
1517ber_type_decoder_f Str4_decode_ber;
1518der_type_encoder_f Str4_encode_der;
1519xer_type_decoder_f Str4_decode_xer;
1520xer_type_encoder_f Str4_encode_xer;
1521per_type_decoder_f Str4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001522per_type_encoder_f Str4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001523
1524/*** <<< CTABLES [Str4] >>> ***/
1525
1526static int check_permitted_alphabet_1(const void *sptr) {
1527 /* The underlying type is IA5String */
1528 const IA5String_t *st = (const IA5String_t *)sptr;
1529 const uint8_t *ch = st->buf;
1530 const uint8_t *end = ch + st->size;
1531
1532 for(; ch < end; ch++) {
1533 uint8_t cv = *ch;
1534 if(!(cv <= 127)) return -1;
1535 }
1536 return 0;
1537}
1538
1539
1540/*** <<< CODE [Str4] >>> ***/
1541
1542int
1543Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001544 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001545 const IA5String_t *st = (const IA5String_t *)sptr;
1546
1547 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001548 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001549 "%s: value not given (%s:%d)",
1550 td->name, __FILE__, __LINE__);
1551 return -1;
1552 }
1553
1554
1555 if(!check_permitted_alphabet_1(st)) {
1556 /* Constraint check succeeded */
1557 return 0;
1558 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001559 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001560 "%s: constraint failed (%s:%d)",
1561 td->name, __FILE__, __LINE__);
1562 return -1;
1563 }
1564}
1565
1566/*
1567 * This type is implemented using IA5String,
1568 * so here we adjust the DEF accordingly.
1569 */
1570static void
1571Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1572 td->free_struct = asn_DEF_IA5String.free_struct;
1573 td->print_struct = asn_DEF_IA5String.print_struct;
1574 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1575 td->der_encoder = asn_DEF_IA5String.der_encoder;
1576 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1577 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1578 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001579 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001580 if(!td->per_constraints)
1581 td->per_constraints = asn_DEF_IA5String.per_constraints;
1582 td->elements = asn_DEF_IA5String.elements;
1583 td->elements_count = asn_DEF_IA5String.elements_count;
1584 td->specifics = asn_DEF_IA5String.specifics;
1585}
1586
1587void
1588Str4_free(asn_TYPE_descriptor_t *td,
1589 void *struct_ptr, int contents_only) {
1590 Str4_1_inherit_TYPE_descriptor(td);
1591 td->free_struct(td, struct_ptr, contents_only);
1592}
1593
1594int
1595Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1596 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1597 Str4_1_inherit_TYPE_descriptor(td);
1598 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1599}
1600
1601asn_dec_rval_t
1602Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1603 void **structure, const void *bufptr, size_t size, int tag_mode) {
1604 Str4_1_inherit_TYPE_descriptor(td);
1605 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1606}
1607
1608asn_enc_rval_t
1609Str4_encode_der(asn_TYPE_descriptor_t *td,
1610 void *structure, int tag_mode, ber_tlv_tag_t tag,
1611 asn_app_consume_bytes_f *cb, void *app_key) {
1612 Str4_1_inherit_TYPE_descriptor(td);
1613 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1614}
1615
1616asn_dec_rval_t
1617Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1618 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1619 Str4_1_inherit_TYPE_descriptor(td);
1620 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1621}
1622
1623asn_enc_rval_t
1624Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1625 int ilevel, enum xer_encoder_flags_e flags,
1626 asn_app_consume_bytes_f *cb, void *app_key) {
1627 Str4_1_inherit_TYPE_descriptor(td);
1628 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1629}
1630
1631asn_dec_rval_t
1632Str4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1633 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1634 Str4_1_inherit_TYPE_descriptor(td);
1635 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1636}
1637
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001638asn_enc_rval_t
1639Str4_encode_uper(asn_TYPE_descriptor_t *td,
1640 asn_per_constraints_t *constraints,
1641 void *structure, asn_per_outp_t *per_out) {
1642 Str4_1_inherit_TYPE_descriptor(td);
1643 return td->uper_encoder(td, constraints, structure, per_out);
1644}
1645
Lev Walkin59b176e2005-11-26 11:25:14 +00001646
1647/*** <<< STAT-DEFS [Str4] >>> ***/
1648
1649static ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
1650 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1651};
1652static asn_per_constraints_t asn_PER_Str4_constr_1 = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001653 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
Lev Walkin59b176e2005-11-26 11:25:14 +00001654 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
1655};
1656asn_TYPE_descriptor_t asn_DEF_Str4 = {
1657 "Str4",
1658 "Str4",
1659 Str4_free,
1660 Str4_print,
1661 Str4_constraint,
1662 Str4_decode_ber,
1663 Str4_encode_der,
1664 Str4_decode_xer,
1665 Str4_encode_xer,
1666 Str4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001667 Str4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001668 0, /* Use generic outmost tag fetcher */
1669 asn_DEF_Str4_tags_1,
1670 sizeof(asn_DEF_Str4_tags_1)
1671 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1672 asn_DEF_Str4_tags_1, /* Same as above */
1673 sizeof(asn_DEF_Str4_tags_1)
1674 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1675 &asn_PER_Str4_constr_1,
1676 0, 0, /* No members */
1677 0 /* No specifics */
1678};
1679
1680
1681/*** <<< INCLUDES [PER-Visible] >>> ***/
1682
1683#include <IA5String.h>
1684
1685/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1686
1687typedef IA5String_t PER_Visible_t;
1688
1689/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1690
1691extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
1692asn_struct_free_f PER_Visible_free;
1693asn_struct_print_f PER_Visible_print;
1694asn_constr_check_f PER_Visible_constraint;
1695ber_type_decoder_f PER_Visible_decode_ber;
1696der_type_encoder_f PER_Visible_encode_der;
1697xer_type_decoder_f PER_Visible_decode_xer;
1698xer_type_encoder_f PER_Visible_encode_xer;
1699per_type_decoder_f PER_Visible_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001700per_type_encoder_f PER_Visible_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001701
1702/*** <<< CTABLES [PER-Visible] >>> ***/
1703
1704static int check_permitted_alphabet_1(const void *sptr) {
1705 /* The underlying type is IA5String */
1706 const IA5String_t *st = (const IA5String_t *)sptr;
1707 const uint8_t *ch = st->buf;
1708 const uint8_t *end = ch + st->size;
1709
1710 for(; ch < end; ch++) {
1711 uint8_t cv = *ch;
1712 if(!(cv >= 65 && cv <= 70)) return -1;
1713 }
1714 return 0;
1715}
1716
1717
1718/*** <<< CODE [PER-Visible] >>> ***/
1719
1720int
1721PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001722 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001723 const IA5String_t *st = (const IA5String_t *)sptr;
1724
1725 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001726 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001727 "%s: value not given (%s:%d)",
1728 td->name, __FILE__, __LINE__);
1729 return -1;
1730 }
1731
1732
1733 if(!check_permitted_alphabet_1(st)) {
1734 /* Constraint check succeeded */
1735 return 0;
1736 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001737 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001738 "%s: constraint failed (%s:%d)",
1739 td->name, __FILE__, __LINE__);
1740 return -1;
1741 }
1742}
1743
1744/*
1745 * This type is implemented using IA5String,
1746 * so here we adjust the DEF accordingly.
1747 */
1748static void
1749PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1750 td->free_struct = asn_DEF_IA5String.free_struct;
1751 td->print_struct = asn_DEF_IA5String.print_struct;
1752 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1753 td->der_encoder = asn_DEF_IA5String.der_encoder;
1754 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1755 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1756 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001757 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001758 if(!td->per_constraints)
1759 td->per_constraints = asn_DEF_IA5String.per_constraints;
1760 td->elements = asn_DEF_IA5String.elements;
1761 td->elements_count = asn_DEF_IA5String.elements_count;
1762 td->specifics = asn_DEF_IA5String.specifics;
1763}
1764
1765void
1766PER_Visible_free(asn_TYPE_descriptor_t *td,
1767 void *struct_ptr, int contents_only) {
1768 PER_Visible_1_inherit_TYPE_descriptor(td);
1769 td->free_struct(td, struct_ptr, contents_only);
1770}
1771
1772int
1773PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1774 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1775 PER_Visible_1_inherit_TYPE_descriptor(td);
1776 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1777}
1778
1779asn_dec_rval_t
1780PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1781 void **structure, const void *bufptr, size_t size, int tag_mode) {
1782 PER_Visible_1_inherit_TYPE_descriptor(td);
1783 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1784}
1785
1786asn_enc_rval_t
1787PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
1788 void *structure, int tag_mode, ber_tlv_tag_t tag,
1789 asn_app_consume_bytes_f *cb, void *app_key) {
1790 PER_Visible_1_inherit_TYPE_descriptor(td);
1791 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1792}
1793
1794asn_dec_rval_t
1795PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1796 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1797 PER_Visible_1_inherit_TYPE_descriptor(td);
1798 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1799}
1800
1801asn_enc_rval_t
1802PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1803 int ilevel, enum xer_encoder_flags_e flags,
1804 asn_app_consume_bytes_f *cb, void *app_key) {
1805 PER_Visible_1_inherit_TYPE_descriptor(td);
1806 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1807}
1808
1809asn_dec_rval_t
1810PER_Visible_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1811 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1812 PER_Visible_1_inherit_TYPE_descriptor(td);
1813 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1814}
1815
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001816asn_enc_rval_t
1817PER_Visible_encode_uper(asn_TYPE_descriptor_t *td,
1818 asn_per_constraints_t *constraints,
1819 void *structure, asn_per_outp_t *per_out) {
1820 PER_Visible_1_inherit_TYPE_descriptor(td);
1821 return td->uper_encoder(td, constraints, structure, per_out);
1822}
1823
Lev Walkin59b176e2005-11-26 11:25:14 +00001824
1825/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1826
1827static ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
1828 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1829};
1830static asn_per_constraints_t asn_PER_PER_Visible_constr_1 = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001831 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
Lev Walkin59b176e2005-11-26 11:25:14 +00001832 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
1833};
1834asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1835 "PER-Visible",
1836 "PER-Visible",
1837 PER_Visible_free,
1838 PER_Visible_print,
1839 PER_Visible_constraint,
1840 PER_Visible_decode_ber,
1841 PER_Visible_encode_der,
1842 PER_Visible_decode_xer,
1843 PER_Visible_encode_xer,
1844 PER_Visible_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001845 PER_Visible_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001846 0, /* Use generic outmost tag fetcher */
1847 asn_DEF_PER_Visible_tags_1,
1848 sizeof(asn_DEF_PER_Visible_tags_1)
1849 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1850 asn_DEF_PER_Visible_tags_1, /* Same as above */
1851 sizeof(asn_DEF_PER_Visible_tags_1)
1852 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1853 &asn_PER_PER_Visible_constr_1,
1854 0, 0, /* No members */
1855 0 /* No specifics */
1856};
1857
1858
1859/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1860
Lev Walkin22b5ed42006-09-13 02:51:20 +00001861#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001862
1863/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1864
1865typedef PER_Visible_t PER_Visible_2_t;
1866
1867/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1868
1869extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1870asn_struct_free_f PER_Visible_2_free;
1871asn_struct_print_f PER_Visible_2_print;
1872asn_constr_check_f PER_Visible_2_constraint;
1873ber_type_decoder_f PER_Visible_2_decode_ber;
1874der_type_encoder_f PER_Visible_2_encode_der;
1875xer_type_decoder_f PER_Visible_2_decode_xer;
1876xer_type_encoder_f PER_Visible_2_encode_xer;
1877per_type_decoder_f PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001878per_type_encoder_f PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001879
1880/*** <<< CTABLES [PER-Visible-2] >>> ***/
1881
1882static int check_permitted_alphabet_1(const void *sptr) {
1883 /* The underlying type is IA5String */
1884 const IA5String_t *st = (const IA5String_t *)sptr;
1885 const uint8_t *ch = st->buf;
1886 const uint8_t *end = ch + st->size;
1887
1888 for(; ch < end; ch++) {
1889 uint8_t cv = *ch;
1890 if(!(cv >= 69 && cv <= 70)) return -1;
1891 }
1892 return 0;
1893}
1894
1895
1896/*** <<< CODE [PER-Visible-2] >>> ***/
1897
1898int
1899PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001900 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001901 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1902
1903 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001904 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001905 "%s: value not given (%s:%d)",
1906 td->name, __FILE__, __LINE__);
1907 return -1;
1908 }
1909
1910
1911 if(!check_permitted_alphabet_1(st)) {
1912 /* Constraint check succeeded */
1913 return 0;
1914 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001915 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001916 "%s: constraint failed (%s:%d)",
1917 td->name, __FILE__, __LINE__);
1918 return -1;
1919 }
1920}
1921
1922/*
1923 * This type is implemented using PER_Visible,
1924 * so here we adjust the DEF accordingly.
1925 */
1926static void
1927PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1928 td->free_struct = asn_DEF_PER_Visible.free_struct;
1929 td->print_struct = asn_DEF_PER_Visible.print_struct;
1930 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1931 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1932 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1933 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1934 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001935 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001936 if(!td->per_constraints)
1937 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
1938 td->elements = asn_DEF_PER_Visible.elements;
1939 td->elements_count = asn_DEF_PER_Visible.elements_count;
1940 td->specifics = asn_DEF_PER_Visible.specifics;
1941}
1942
1943void
1944PER_Visible_2_free(asn_TYPE_descriptor_t *td,
1945 void *struct_ptr, int contents_only) {
1946 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1947 td->free_struct(td, struct_ptr, contents_only);
1948}
1949
1950int
1951PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1952 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1953 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1954 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1955}
1956
1957asn_dec_rval_t
1958PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1959 void **structure, const void *bufptr, size_t size, int tag_mode) {
1960 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1961 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1962}
1963
1964asn_enc_rval_t
1965PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
1966 void *structure, int tag_mode, ber_tlv_tag_t tag,
1967 asn_app_consume_bytes_f *cb, void *app_key) {
1968 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1969 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1970}
1971
1972asn_dec_rval_t
1973PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1974 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1975 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1976 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1977}
1978
1979asn_enc_rval_t
1980PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1981 int ilevel, enum xer_encoder_flags_e flags,
1982 asn_app_consume_bytes_f *cb, void *app_key) {
1983 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1984 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1985}
1986
1987asn_dec_rval_t
1988PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1989 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1990 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1991 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1992}
1993
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001994asn_enc_rval_t
1995PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
1996 asn_per_constraints_t *constraints,
1997 void *structure, asn_per_outp_t *per_out) {
1998 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1999 return td->uper_encoder(td, constraints, structure, per_out);
2000}
2001
Lev Walkin59b176e2005-11-26 11:25:14 +00002002
2003/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
2004
2005static ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
2006 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2007};
2008static asn_per_constraints_t asn_PER_PER_Visible_2_constr_1 = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00002009 { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */,
Lev Walkin59b176e2005-11-26 11:25:14 +00002010 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
2011};
2012asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
2013 "PER-Visible-2",
2014 "PER-Visible-2",
2015 PER_Visible_2_free,
2016 PER_Visible_2_print,
2017 PER_Visible_2_constraint,
2018 PER_Visible_2_decode_ber,
2019 PER_Visible_2_encode_der,
2020 PER_Visible_2_decode_xer,
2021 PER_Visible_2_encode_xer,
2022 PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002023 PER_Visible_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002024 0, /* Use generic outmost tag fetcher */
2025 asn_DEF_PER_Visible_2_tags_1,
2026 sizeof(asn_DEF_PER_Visible_2_tags_1)
2027 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
2028 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
2029 sizeof(asn_DEF_PER_Visible_2_tags_1)
2030 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
2031 &asn_PER_PER_Visible_2_constr_1,
2032 0, 0, /* No members */
2033 0 /* No specifics */
2034};
2035
2036
2037/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
2038
Lev Walkin22b5ed42006-09-13 02:51:20 +00002039#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002040
2041/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
2042
2043typedef PER_Visible_t Not_PER_Visible_1_t;
2044
2045/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
2046
2047extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
2048asn_struct_free_f Not_PER_Visible_1_free;
2049asn_struct_print_f Not_PER_Visible_1_print;
2050asn_constr_check_f Not_PER_Visible_1_constraint;
2051ber_type_decoder_f Not_PER_Visible_1_decode_ber;
2052der_type_encoder_f Not_PER_Visible_1_encode_der;
2053xer_type_decoder_f Not_PER_Visible_1_decode_xer;
2054xer_type_encoder_f Not_PER_Visible_1_encode_xer;
2055per_type_decoder_f Not_PER_Visible_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002056per_type_encoder_f Not_PER_Visible_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002057
2058/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
2059
2060static int check_permitted_alphabet_1(const void *sptr) {
2061 /* The underlying type is IA5String */
2062 const IA5String_t *st = (const IA5String_t *)sptr;
2063 const uint8_t *ch = st->buf;
2064 const uint8_t *end = ch + st->size;
2065
2066 for(; ch < end; ch++) {
2067 uint8_t cv = *ch;
2068 if(!(cv >= 65 && cv <= 70)) return -1;
2069 }
2070 return 0;
2071}
2072
2073
2074/*** <<< CODE [Not-PER-Visible-1] >>> ***/
2075
2076int
2077Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002078 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002079 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2080
2081 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002082 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002083 "%s: value not given (%s:%d)",
2084 td->name, __FILE__, __LINE__);
2085 return -1;
2086 }
2087
2088
2089 if(!check_permitted_alphabet_1(st)) {
2090 /* Constraint check succeeded */
2091 return 0;
2092 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002093 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002094 "%s: constraint failed (%s:%d)",
2095 td->name, __FILE__, __LINE__);
2096 return -1;
2097 }
2098}
2099
2100/*
2101 * This type is implemented using PER_Visible,
2102 * so here we adjust the DEF accordingly.
2103 */
2104static void
2105Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2106 td->free_struct = asn_DEF_PER_Visible.free_struct;
2107 td->print_struct = asn_DEF_PER_Visible.print_struct;
2108 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2109 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2110 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2111 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2112 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002113 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002114 if(!td->per_constraints)
2115 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2116 td->elements = asn_DEF_PER_Visible.elements;
2117 td->elements_count = asn_DEF_PER_Visible.elements_count;
2118 td->specifics = asn_DEF_PER_Visible.specifics;
2119}
2120
2121void
2122Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
2123 void *struct_ptr, int contents_only) {
2124 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2125 td->free_struct(td, struct_ptr, contents_only);
2126}
2127
2128int
2129Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2130 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2131 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2132 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2133}
2134
2135asn_dec_rval_t
2136Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2137 void **structure, const void *bufptr, size_t size, int tag_mode) {
2138 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2139 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2140}
2141
2142asn_enc_rval_t
2143Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
2144 void *structure, int tag_mode, ber_tlv_tag_t tag,
2145 asn_app_consume_bytes_f *cb, void *app_key) {
2146 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2147 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2148}
2149
2150asn_dec_rval_t
2151Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2152 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2153 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2154 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2155}
2156
2157asn_enc_rval_t
2158Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2159 int ilevel, enum xer_encoder_flags_e flags,
2160 asn_app_consume_bytes_f *cb, void *app_key) {
2161 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2162 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2163}
2164
2165asn_dec_rval_t
2166Not_PER_Visible_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2167 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2168 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2169 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2170}
2171
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002172asn_enc_rval_t
2173Not_PER_Visible_1_encode_uper(asn_TYPE_descriptor_t *td,
2174 asn_per_constraints_t *constraints,
2175 void *structure, asn_per_outp_t *per_out) {
2176 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2177 return td->uper_encoder(td, constraints, structure, per_out);
2178}
2179
Lev Walkin59b176e2005-11-26 11:25:14 +00002180
2181/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
2182
2183static ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
2184 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2185};
2186static asn_per_constraints_t asn_PER_Not_PER_Visible_1_constr_1 = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00002187 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
Lev Walkin59b176e2005-11-26 11:25:14 +00002188 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
2189};
2190asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
2191 "Not-PER-Visible-1",
2192 "Not-PER-Visible-1",
2193 Not_PER_Visible_1_free,
2194 Not_PER_Visible_1_print,
2195 Not_PER_Visible_1_constraint,
2196 Not_PER_Visible_1_decode_ber,
2197 Not_PER_Visible_1_encode_der,
2198 Not_PER_Visible_1_decode_xer,
2199 Not_PER_Visible_1_encode_xer,
2200 Not_PER_Visible_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002201 Not_PER_Visible_1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002202 0, /* Use generic outmost tag fetcher */
2203 asn_DEF_Not_PER_Visible_1_tags_1,
2204 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2205 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2206 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
2207 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2208 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2209 &asn_PER_Not_PER_Visible_1_constr_1,
2210 0, 0, /* No members */
2211 0 /* No specifics */
2212};
2213
2214
2215/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
2216
Lev Walkin22b5ed42006-09-13 02:51:20 +00002217#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002218
2219/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
2220
2221typedef PER_Visible_t Not_PER_Visible_2_t;
2222
2223/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
2224
2225extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
2226asn_struct_free_f Not_PER_Visible_2_free;
2227asn_struct_print_f Not_PER_Visible_2_print;
2228asn_constr_check_f Not_PER_Visible_2_constraint;
2229ber_type_decoder_f Not_PER_Visible_2_decode_ber;
2230der_type_encoder_f Not_PER_Visible_2_encode_der;
2231xer_type_decoder_f Not_PER_Visible_2_decode_xer;
2232xer_type_encoder_f Not_PER_Visible_2_encode_xer;
2233per_type_decoder_f Not_PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002234per_type_encoder_f Not_PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002235
2236/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
2237
2238static int check_permitted_alphabet_1(const void *sptr) {
2239 /* The underlying type is IA5String */
2240 const IA5String_t *st = (const IA5String_t *)sptr;
2241 const uint8_t *ch = st->buf;
2242 const uint8_t *end = ch + st->size;
2243
2244 for(; ch < end; ch++) {
2245 uint8_t cv = *ch;
2246 if(!(cv >= 65 && cv <= 66)) return -1;
2247 }
2248 return 0;
2249}
2250
2251
2252/*** <<< CODE [Not-PER-Visible-2] >>> ***/
2253
2254int
2255Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002256 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002257 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2258
2259 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002260 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002261 "%s: value not given (%s:%d)",
2262 td->name, __FILE__, __LINE__);
2263 return -1;
2264 }
2265
2266
2267 if(!check_permitted_alphabet_1(st)) {
2268 /* Constraint check succeeded */
2269 return 0;
2270 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002271 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002272 "%s: constraint failed (%s:%d)",
2273 td->name, __FILE__, __LINE__);
2274 return -1;
2275 }
2276}
2277
2278/*
2279 * This type is implemented using PER_Visible,
2280 * so here we adjust the DEF accordingly.
2281 */
2282static void
2283Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2284 td->free_struct = asn_DEF_PER_Visible.free_struct;
2285 td->print_struct = asn_DEF_PER_Visible.print_struct;
2286 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2287 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2288 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2289 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2290 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002291 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002292 if(!td->per_constraints)
2293 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2294 td->elements = asn_DEF_PER_Visible.elements;
2295 td->elements_count = asn_DEF_PER_Visible.elements_count;
2296 td->specifics = asn_DEF_PER_Visible.specifics;
2297}
2298
2299void
2300Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2301 void *struct_ptr, int contents_only) {
2302 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2303 td->free_struct(td, struct_ptr, contents_only);
2304}
2305
2306int
2307Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2308 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2309 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2310 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2311}
2312
2313asn_dec_rval_t
2314Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2315 void **structure, const void *bufptr, size_t size, int tag_mode) {
2316 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2317 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2318}
2319
2320asn_enc_rval_t
2321Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2322 void *structure, int tag_mode, ber_tlv_tag_t tag,
2323 asn_app_consume_bytes_f *cb, void *app_key) {
2324 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2325 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2326}
2327
2328asn_dec_rval_t
2329Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2330 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2331 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2332 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2333}
2334
2335asn_enc_rval_t
2336Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2337 int ilevel, enum xer_encoder_flags_e flags,
2338 asn_app_consume_bytes_f *cb, void *app_key) {
2339 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2340 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2341}
2342
2343asn_dec_rval_t
2344Not_PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2345 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2346 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2347 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2348}
2349
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002350asn_enc_rval_t
2351Not_PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2352 asn_per_constraints_t *constraints,
2353 void *structure, asn_per_outp_t *per_out) {
2354 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2355 return td->uper_encoder(td, constraints, structure, per_out);
2356}
2357
Lev Walkin59b176e2005-11-26 11:25:14 +00002358
2359/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
2360
2361static ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
2362 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2363};
2364static asn_per_constraints_t asn_PER_Not_PER_Visible_2_constr_1 = {
2365 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2366 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
2367};
2368asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
2369 "Not-PER-Visible-2",
2370 "Not-PER-Visible-2",
2371 Not_PER_Visible_2_free,
2372 Not_PER_Visible_2_print,
2373 Not_PER_Visible_2_constraint,
2374 Not_PER_Visible_2_decode_ber,
2375 Not_PER_Visible_2_encode_der,
2376 Not_PER_Visible_2_decode_xer,
2377 Not_PER_Visible_2_encode_xer,
2378 Not_PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002379 Not_PER_Visible_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002380 0, /* Use generic outmost tag fetcher */
2381 asn_DEF_Not_PER_Visible_2_tags_1,
2382 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2383 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2384 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
2385 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2386 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2387 &asn_PER_Not_PER_Visible_2_constr_1,
2388 0, 0, /* No members */
2389 0 /* No specifics */
2390};
2391
2392
2393/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2394
Lev Walkin22b5ed42006-09-13 02:51:20 +00002395#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002396
2397/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2398
2399typedef PER_Visible_t Not_PER_Visible_3_t;
2400
2401/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2402
2403extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
2404asn_struct_free_f Not_PER_Visible_3_free;
2405asn_struct_print_f Not_PER_Visible_3_print;
2406asn_constr_check_f Not_PER_Visible_3_constraint;
2407ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2408der_type_encoder_f Not_PER_Visible_3_encode_der;
2409xer_type_decoder_f Not_PER_Visible_3_decode_xer;
2410xer_type_encoder_f Not_PER_Visible_3_encode_xer;
2411per_type_decoder_f Not_PER_Visible_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002412per_type_encoder_f Not_PER_Visible_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002413
2414/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2415
2416static int check_permitted_alphabet_1(const void *sptr) {
2417 /* The underlying type is IA5String */
2418 const IA5String_t *st = (const IA5String_t *)sptr;
2419 const uint8_t *ch = st->buf;
2420 const uint8_t *end = ch + st->size;
2421
2422 for(; ch < end; ch++) {
2423 uint8_t cv = *ch;
2424 if(!(cv >= 65 && cv <= 66)) return -1;
2425 }
2426 return 0;
2427}
2428
2429
2430/*** <<< CODE [Not-PER-Visible-3] >>> ***/
2431
2432int
2433Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002434 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002435 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2436
2437 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002438 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002439 "%s: value not given (%s:%d)",
2440 td->name, __FILE__, __LINE__);
2441 return -1;
2442 }
2443
2444
2445 if(!check_permitted_alphabet_1(st)) {
2446 /* Constraint check succeeded */
2447 return 0;
2448 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002449 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002450 "%s: constraint failed (%s:%d)",
2451 td->name, __FILE__, __LINE__);
2452 return -1;
2453 }
2454}
2455
2456/*
2457 * This type is implemented using PER_Visible,
2458 * so here we adjust the DEF accordingly.
2459 */
2460static void
2461Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2462 td->free_struct = asn_DEF_PER_Visible.free_struct;
2463 td->print_struct = asn_DEF_PER_Visible.print_struct;
2464 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2465 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2466 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2467 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2468 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002469 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002470 if(!td->per_constraints)
2471 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2472 td->elements = asn_DEF_PER_Visible.elements;
2473 td->elements_count = asn_DEF_PER_Visible.elements_count;
2474 td->specifics = asn_DEF_PER_Visible.specifics;
2475}
2476
2477void
2478Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
2479 void *struct_ptr, int contents_only) {
2480 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2481 td->free_struct(td, struct_ptr, contents_only);
2482}
2483
2484int
2485Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2486 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2487 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2488 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2489}
2490
2491asn_dec_rval_t
2492Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2493 void **structure, const void *bufptr, size_t size, int tag_mode) {
2494 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2495 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2496}
2497
2498asn_enc_rval_t
2499Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
2500 void *structure, int tag_mode, ber_tlv_tag_t tag,
2501 asn_app_consume_bytes_f *cb, void *app_key) {
2502 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2503 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2504}
2505
2506asn_dec_rval_t
2507Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2508 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2509 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2510 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2511}
2512
2513asn_enc_rval_t
2514Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2515 int ilevel, enum xer_encoder_flags_e flags,
2516 asn_app_consume_bytes_f *cb, void *app_key) {
2517 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2518 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2519}
2520
2521asn_dec_rval_t
2522Not_PER_Visible_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2523 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2524 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2525 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2526}
2527
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002528asn_enc_rval_t
2529Not_PER_Visible_3_encode_uper(asn_TYPE_descriptor_t *td,
2530 asn_per_constraints_t *constraints,
2531 void *structure, asn_per_outp_t *per_out) {
2532 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2533 return td->uper_encoder(td, constraints, structure, per_out);
2534}
2535
Lev Walkin59b176e2005-11-26 11:25:14 +00002536
2537/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2538
2539static ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
2540 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2541};
2542static asn_per_constraints_t asn_PER_Not_PER_Visible_3_constr_1 = {
2543 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2544 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
2545};
2546asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
2547 "Not-PER-Visible-3",
2548 "Not-PER-Visible-3",
2549 Not_PER_Visible_3_free,
2550 Not_PER_Visible_3_print,
2551 Not_PER_Visible_3_constraint,
2552 Not_PER_Visible_3_decode_ber,
2553 Not_PER_Visible_3_encode_der,
2554 Not_PER_Visible_3_decode_xer,
2555 Not_PER_Visible_3_encode_xer,
2556 Not_PER_Visible_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002557 Not_PER_Visible_3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002558 0, /* Use generic outmost tag fetcher */
2559 asn_DEF_Not_PER_Visible_3_tags_1,
2560 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2561 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2562 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
2563 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2564 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2565 &asn_PER_Not_PER_Visible_3_constr_1,
2566 0, 0, /* No members */
2567 0 /* No specifics */
2568};
2569
2570
2571/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2572
Lev Walkin22b5ed42006-09-13 02:51:20 +00002573#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002574
2575/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2576
2577typedef PER_Visible_t SIZE_but_not_FROM_t;
2578
2579/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2580
2581extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
2582asn_struct_free_f SIZE_but_not_FROM_free;
2583asn_struct_print_f SIZE_but_not_FROM_print;
2584asn_constr_check_f SIZE_but_not_FROM_constraint;
2585ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2586der_type_encoder_f SIZE_but_not_FROM_encode_der;
2587xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
2588xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
2589per_type_decoder_f SIZE_but_not_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002590per_type_encoder_f SIZE_but_not_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002591
2592/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2593
2594static int check_permitted_alphabet_1(const void *sptr) {
2595 /* The underlying type is IA5String */
2596 const IA5String_t *st = (const IA5String_t *)sptr;
2597 const uint8_t *ch = st->buf;
2598 const uint8_t *end = ch + st->size;
2599
2600 for(; ch < end; ch++) {
2601 uint8_t cv = *ch;
2602 if(!(cv >= 65 && cv <= 68)) return -1;
2603 }
2604 return 0;
2605}
2606
2607
2608/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2609
2610int
2611SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002612 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002613 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2614 size_t size;
2615
2616 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002617 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002618 "%s: value not given (%s:%d)",
2619 td->name, __FILE__, __LINE__);
2620 return -1;
2621 }
2622
2623 size = st->size;
2624
2625 if((size >= 1 && size <= 4)
2626 && !check_permitted_alphabet_1(st)) {
2627 /* Constraint check succeeded */
2628 return 0;
2629 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002630 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002631 "%s: constraint failed (%s:%d)",
2632 td->name, __FILE__, __LINE__);
2633 return -1;
2634 }
2635}
2636
2637/*
2638 * This type is implemented using PER_Visible,
2639 * so here we adjust the DEF accordingly.
2640 */
2641static void
2642SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2643 td->free_struct = asn_DEF_PER_Visible.free_struct;
2644 td->print_struct = asn_DEF_PER_Visible.print_struct;
2645 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2646 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2647 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2648 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2649 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002650 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002651 if(!td->per_constraints)
2652 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2653 td->elements = asn_DEF_PER_Visible.elements;
2654 td->elements_count = asn_DEF_PER_Visible.elements_count;
2655 td->specifics = asn_DEF_PER_Visible.specifics;
2656}
2657
2658void
2659SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
2660 void *struct_ptr, int contents_only) {
2661 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2662 td->free_struct(td, struct_ptr, contents_only);
2663}
2664
2665int
2666SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2667 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2668 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2669 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2670}
2671
2672asn_dec_rval_t
2673SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2674 void **structure, const void *bufptr, size_t size, int tag_mode) {
2675 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2676 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2677}
2678
2679asn_enc_rval_t
2680SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
2681 void *structure, int tag_mode, ber_tlv_tag_t tag,
2682 asn_app_consume_bytes_f *cb, void *app_key) {
2683 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2684 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2685}
2686
2687asn_dec_rval_t
2688SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2689 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2690 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2691 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2692}
2693
2694asn_enc_rval_t
2695SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2696 int ilevel, enum xer_encoder_flags_e flags,
2697 asn_app_consume_bytes_f *cb, void *app_key) {
2698 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2699 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2700}
2701
2702asn_dec_rval_t
2703SIZE_but_not_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2704 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2705 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2706 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2707}
2708
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002709asn_enc_rval_t
2710SIZE_but_not_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2711 asn_per_constraints_t *constraints,
2712 void *structure, asn_per_outp_t *per_out) {
2713 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2714 return td->uper_encoder(td, constraints, structure, per_out);
2715}
2716
Lev Walkin59b176e2005-11-26 11:25:14 +00002717
2718/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2719
2720static ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
2721 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2722};
2723static asn_per_constraints_t asn_PER_SIZE_but_not_FROM_constr_1 = {
2724 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2725 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */
2726};
2727asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
2728 "SIZE-but-not-FROM",
2729 "SIZE-but-not-FROM",
2730 SIZE_but_not_FROM_free,
2731 SIZE_but_not_FROM_print,
2732 SIZE_but_not_FROM_constraint,
2733 SIZE_but_not_FROM_decode_ber,
2734 SIZE_but_not_FROM_encode_der,
2735 SIZE_but_not_FROM_decode_xer,
2736 SIZE_but_not_FROM_encode_xer,
2737 SIZE_but_not_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002738 SIZE_but_not_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002739 0, /* Use generic outmost tag fetcher */
2740 asn_DEF_SIZE_but_not_FROM_tags_1,
2741 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2742 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2743 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
2744 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2745 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2746 &asn_PER_SIZE_but_not_FROM_constr_1,
2747 0, 0, /* No members */
2748 0 /* No specifics */
2749};
2750
2751
2752/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2753
Lev Walkin22b5ed42006-09-13 02:51:20 +00002754#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002755
2756/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2757
2758typedef PER_Visible_t SIZE_and_FROM_t;
2759
2760/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2761
2762extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
2763asn_struct_free_f SIZE_and_FROM_free;
2764asn_struct_print_f SIZE_and_FROM_print;
2765asn_constr_check_f SIZE_and_FROM_constraint;
2766ber_type_decoder_f SIZE_and_FROM_decode_ber;
2767der_type_encoder_f SIZE_and_FROM_encode_der;
2768xer_type_decoder_f SIZE_and_FROM_decode_xer;
2769xer_type_encoder_f SIZE_and_FROM_encode_xer;
2770per_type_decoder_f SIZE_and_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002771per_type_encoder_f SIZE_and_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002772
2773/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2774
2775static int check_permitted_alphabet_1(const void *sptr) {
2776 /* The underlying type is IA5String */
2777 const IA5String_t *st = (const IA5String_t *)sptr;
2778 const uint8_t *ch = st->buf;
2779 const uint8_t *end = ch + st->size;
2780
2781 for(; ch < end; ch++) {
2782 uint8_t cv = *ch;
2783 if(!(cv >= 65 && cv <= 68)) return -1;
2784 }
2785 return 0;
2786}
2787
2788
2789/*** <<< CODE [SIZE-and-FROM] >>> ***/
2790
2791int
2792SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002793 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002794 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2795 size_t size;
2796
2797 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002798 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002799 "%s: value not given (%s:%d)",
2800 td->name, __FILE__, __LINE__);
2801 return -1;
2802 }
2803
2804 size = st->size;
2805
2806 if((size >= 1 && size <= 4)
2807 && !check_permitted_alphabet_1(st)) {
2808 /* Constraint check succeeded */
2809 return 0;
2810 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002811 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002812 "%s: constraint failed (%s:%d)",
2813 td->name, __FILE__, __LINE__);
2814 return -1;
2815 }
2816}
2817
2818/*
2819 * This type is implemented using PER_Visible,
2820 * so here we adjust the DEF accordingly.
2821 */
2822static void
2823SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2824 td->free_struct = asn_DEF_PER_Visible.free_struct;
2825 td->print_struct = asn_DEF_PER_Visible.print_struct;
2826 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2827 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2828 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2829 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2830 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002831 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002832 if(!td->per_constraints)
2833 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2834 td->elements = asn_DEF_PER_Visible.elements;
2835 td->elements_count = asn_DEF_PER_Visible.elements_count;
2836 td->specifics = asn_DEF_PER_Visible.specifics;
2837}
2838
2839void
2840SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
2841 void *struct_ptr, int contents_only) {
2842 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2843 td->free_struct(td, struct_ptr, contents_only);
2844}
2845
2846int
2847SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2848 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2849 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2850 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2851}
2852
2853asn_dec_rval_t
2854SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2855 void **structure, const void *bufptr, size_t size, int tag_mode) {
2856 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2857 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2858}
2859
2860asn_enc_rval_t
2861SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
2862 void *structure, int tag_mode, ber_tlv_tag_t tag,
2863 asn_app_consume_bytes_f *cb, void *app_key) {
2864 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2865 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2866}
2867
2868asn_dec_rval_t
2869SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2870 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2871 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2872 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2873}
2874
2875asn_enc_rval_t
2876SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2877 int ilevel, enum xer_encoder_flags_e flags,
2878 asn_app_consume_bytes_f *cb, void *app_key) {
2879 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2880 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2881}
2882
2883asn_dec_rval_t
2884SIZE_and_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2885 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2886 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2887 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2888}
2889
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002890asn_enc_rval_t
2891SIZE_and_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2892 asn_per_constraints_t *constraints,
2893 void *structure, asn_per_outp_t *per_out) {
2894 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2895 return td->uper_encoder(td, constraints, structure, per_out);
2896}
2897
Lev Walkin59b176e2005-11-26 11:25:14 +00002898
2899/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
2900
2901static ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
2902 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2903};
2904static asn_per_constraints_t asn_PER_SIZE_and_FROM_constr_1 = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00002905 { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */,
Lev Walkin59b176e2005-11-26 11:25:14 +00002906 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */
2907};
2908asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
2909 "SIZE-and-FROM",
2910 "SIZE-and-FROM",
2911 SIZE_and_FROM_free,
2912 SIZE_and_FROM_print,
2913 SIZE_and_FROM_constraint,
2914 SIZE_and_FROM_decode_ber,
2915 SIZE_and_FROM_encode_der,
2916 SIZE_and_FROM_decode_xer,
2917 SIZE_and_FROM_encode_xer,
2918 SIZE_and_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002919 SIZE_and_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002920 0, /* Use generic outmost tag fetcher */
2921 asn_DEF_SIZE_and_FROM_tags_1,
2922 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2923 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2924 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
2925 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2926 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2927 &asn_PER_SIZE_and_FROM_constr_1,
2928 0, 0, /* No members */
2929 0 /* No specifics */
2930};
2931
2932
2933/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
2934
Lev Walkin22b5ed42006-09-13 02:51:20 +00002935#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002936
2937/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2938
2939typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
2940
2941/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2942
2943extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
2944asn_struct_free_f Neither_SIZE_nor_FROM_free;
2945asn_struct_print_f Neither_SIZE_nor_FROM_print;
2946asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
2947ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
2948der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
2949xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
2950xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
2951per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002952per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002953
2954/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
2955
2956static int check_permitted_alphabet_1(const void *sptr) {
2957 /* The underlying type is IA5String */
2958 const IA5String_t *st = (const IA5String_t *)sptr;
2959 const uint8_t *ch = st->buf;
2960 const uint8_t *end = ch + st->size;
2961
2962 for(; ch < end; ch++) {
2963 uint8_t cv = *ch;
2964 if(!(cv >= 65 && cv <= 70)) return -1;
2965 }
2966 return 0;
2967}
2968
2969
2970/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
2971
2972int
2973Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002974 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002975 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2976
2977 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002978 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002979 "%s: value not given (%s:%d)",
2980 td->name, __FILE__, __LINE__);
2981 return -1;
2982 }
2983
2984
2985 if(!check_permitted_alphabet_1(st)) {
2986 /* Constraint check succeeded */
2987 return 0;
2988 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002989 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002990 "%s: constraint failed (%s:%d)",
2991 td->name, __FILE__, __LINE__);
2992 return -1;
2993 }
2994}
2995
2996/*
2997 * This type is implemented using PER_Visible,
2998 * so here we adjust the DEF accordingly.
2999 */
3000static void
3001Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3002 td->free_struct = asn_DEF_PER_Visible.free_struct;
3003 td->print_struct = asn_DEF_PER_Visible.print_struct;
3004 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
3005 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
3006 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
3007 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
3008 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003009 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003010 if(!td->per_constraints)
3011 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
3012 td->elements = asn_DEF_PER_Visible.elements;
3013 td->elements_count = asn_DEF_PER_Visible.elements_count;
3014 td->specifics = asn_DEF_PER_Visible.specifics;
3015}
3016
3017void
3018Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
3019 void *struct_ptr, int contents_only) {
3020 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3021 td->free_struct(td, struct_ptr, contents_only);
3022}
3023
3024int
3025Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3026 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3027 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3028 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3029}
3030
3031asn_dec_rval_t
3032Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3033 void **structure, const void *bufptr, size_t size, int tag_mode) {
3034 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3035 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3036}
3037
3038asn_enc_rval_t
3039Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
3040 void *structure, int tag_mode, ber_tlv_tag_t tag,
3041 asn_app_consume_bytes_f *cb, void *app_key) {
3042 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3043 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3044}
3045
3046asn_dec_rval_t
3047Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3048 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3049 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3050 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3051}
3052
3053asn_enc_rval_t
3054Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3055 int ilevel, enum xer_encoder_flags_e flags,
3056 asn_app_consume_bytes_f *cb, void *app_key) {
3057 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3058 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3059}
3060
3061asn_dec_rval_t
3062Neither_SIZE_nor_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3063 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3064 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3065 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3066}
3067
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003068asn_enc_rval_t
3069Neither_SIZE_nor_FROM_encode_uper(asn_TYPE_descriptor_t *td,
3070 asn_per_constraints_t *constraints,
3071 void *structure, asn_per_outp_t *per_out) {
3072 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3073 return td->uper_encoder(td, constraints, structure, per_out);
3074}
3075
Lev Walkin59b176e2005-11-26 11:25:14 +00003076
3077/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
3078
3079static ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
3080 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
3081};
3082static asn_per_constraints_t asn_PER_Neither_SIZE_nor_FROM_constr_1 = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003083 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
Lev Walkin59b176e2005-11-26 11:25:14 +00003084 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */
3085};
3086asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
3087 "Neither-SIZE-nor-FROM",
3088 "Neither-SIZE-nor-FROM",
3089 Neither_SIZE_nor_FROM_free,
3090 Neither_SIZE_nor_FROM_print,
3091 Neither_SIZE_nor_FROM_constraint,
3092 Neither_SIZE_nor_FROM_decode_ber,
3093 Neither_SIZE_nor_FROM_encode_der,
3094 Neither_SIZE_nor_FROM_decode_xer,
3095 Neither_SIZE_nor_FROM_encode_xer,
3096 Neither_SIZE_nor_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003097 Neither_SIZE_nor_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003098 0, /* Use generic outmost tag fetcher */
3099 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
3100 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3101 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
3102 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
3103 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3104 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
3105 &asn_PER_Neither_SIZE_nor_FROM_constr_1,
3106 0, 0, /* No members */
3107 0 /* No specifics */
3108};
3109
3110
3111/*** <<< INCLUDES [Utf8-4] >>> ***/
3112
3113#include <UTF8String.h>
3114
3115/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
3116
3117typedef UTF8String_t Utf8_4_t;
3118
3119/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
3120
3121extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
3122asn_struct_free_f Utf8_4_free;
3123asn_struct_print_f Utf8_4_print;
3124asn_constr_check_f Utf8_4_constraint;
3125ber_type_decoder_f Utf8_4_decode_ber;
3126der_type_encoder_f Utf8_4_encode_der;
3127xer_type_decoder_f Utf8_4_decode_xer;
3128xer_type_encoder_f Utf8_4_encode_xer;
3129per_type_decoder_f Utf8_4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003130per_type_encoder_f Utf8_4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003131
3132/*** <<< CTABLES [Utf8-4] >>> ***/
3133
3134static int check_permitted_alphabet_1(const void *sptr) {
3135 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
3136 return -1; /* Alphabet (sic!) test failed. */
3137
3138 return 0;
3139}
3140
3141
3142/*** <<< CODE [Utf8-4] >>> ***/
3143
3144int
3145Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003146 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003147 const UTF8String_t *st = (const UTF8String_t *)sptr;
3148
3149 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003150 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003151 "%s: value not given (%s:%d)",
3152 td->name, __FILE__, __LINE__);
3153 return -1;
3154 }
3155
3156
3157 if(!check_permitted_alphabet_1(st)) {
3158 /* Constraint check succeeded */
3159 return 0;
3160 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003161 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003162 "%s: constraint failed (%s:%d)",
3163 td->name, __FILE__, __LINE__);
3164 return -1;
3165 }
3166}
3167
3168/*
3169 * This type is implemented using UTF8String,
3170 * so here we adjust the DEF accordingly.
3171 */
3172static void
3173Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3174 td->free_struct = asn_DEF_UTF8String.free_struct;
3175 td->print_struct = asn_DEF_UTF8String.print_struct;
3176 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3177 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3178 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3179 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3180 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003181 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003182 if(!td->per_constraints)
3183 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3184 td->elements = asn_DEF_UTF8String.elements;
3185 td->elements_count = asn_DEF_UTF8String.elements_count;
3186 td->specifics = asn_DEF_UTF8String.specifics;
3187}
3188
3189void
3190Utf8_4_free(asn_TYPE_descriptor_t *td,
3191 void *struct_ptr, int contents_only) {
3192 Utf8_4_1_inherit_TYPE_descriptor(td);
3193 td->free_struct(td, struct_ptr, contents_only);
3194}
3195
3196int
3197Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3198 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3199 Utf8_4_1_inherit_TYPE_descriptor(td);
3200 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3201}
3202
3203asn_dec_rval_t
3204Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3205 void **structure, const void *bufptr, size_t size, int tag_mode) {
3206 Utf8_4_1_inherit_TYPE_descriptor(td);
3207 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3208}
3209
3210asn_enc_rval_t
3211Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
3212 void *structure, int tag_mode, ber_tlv_tag_t tag,
3213 asn_app_consume_bytes_f *cb, void *app_key) {
3214 Utf8_4_1_inherit_TYPE_descriptor(td);
3215 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3216}
3217
3218asn_dec_rval_t
3219Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3220 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3221 Utf8_4_1_inherit_TYPE_descriptor(td);
3222 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3223}
3224
3225asn_enc_rval_t
3226Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3227 int ilevel, enum xer_encoder_flags_e flags,
3228 asn_app_consume_bytes_f *cb, void *app_key) {
3229 Utf8_4_1_inherit_TYPE_descriptor(td);
3230 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3231}
3232
3233asn_dec_rval_t
3234Utf8_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3235 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3236 Utf8_4_1_inherit_TYPE_descriptor(td);
3237 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3238}
3239
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003240asn_enc_rval_t
3241Utf8_4_encode_uper(asn_TYPE_descriptor_t *td,
3242 asn_per_constraints_t *constraints,
3243 void *structure, asn_per_outp_t *per_out) {
3244 Utf8_4_1_inherit_TYPE_descriptor(td);
3245 return td->uper_encoder(td, constraints, structure, per_out);
3246}
3247
Lev Walkin59b176e2005-11-26 11:25:14 +00003248
3249/*** <<< STAT-DEFS [Utf8-4] >>> ***/
3250
3251static ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
3252 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3253};
3254static asn_per_constraints_t asn_PER_Utf8_4_constr_1 = {
3255 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3256 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
3257};
3258asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
3259 "Utf8-4",
3260 "Utf8-4",
3261 Utf8_4_free,
3262 Utf8_4_print,
3263 Utf8_4_constraint,
3264 Utf8_4_decode_ber,
3265 Utf8_4_encode_der,
3266 Utf8_4_decode_xer,
3267 Utf8_4_encode_xer,
3268 Utf8_4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003269 Utf8_4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003270 0, /* Use generic outmost tag fetcher */
3271 asn_DEF_Utf8_4_tags_1,
3272 sizeof(asn_DEF_Utf8_4_tags_1)
3273 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
3274 asn_DEF_Utf8_4_tags_1, /* Same as above */
3275 sizeof(asn_DEF_Utf8_4_tags_1)
3276 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
3277 &asn_PER_Utf8_4_constr_1,
3278 0, 0, /* No members */
3279 0 /* No specifics */
3280};
3281
3282
3283/*** <<< INCLUDES [Utf8-3] >>> ***/
3284
Lev Walkin22b5ed42006-09-13 02:51:20 +00003285#include "Utf8-2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003286
3287/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
3288
3289typedef Utf8_2_t Utf8_3_t;
3290
3291/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
3292
3293extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
3294asn_struct_free_f Utf8_3_free;
3295asn_struct_print_f Utf8_3_print;
3296asn_constr_check_f Utf8_3_constraint;
3297ber_type_decoder_f Utf8_3_decode_ber;
3298der_type_encoder_f Utf8_3_encode_der;
3299xer_type_decoder_f Utf8_3_decode_xer;
3300xer_type_encoder_f Utf8_3_encode_xer;
3301per_type_decoder_f Utf8_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003302per_type_encoder_f Utf8_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003303
3304/*** <<< CTABLES [Utf8-3] >>> ***/
3305
3306static int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003307 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3308 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3309 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3310 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3311 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
331216,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
3313 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
331442,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003315};
Lev Walkin5b62ca82006-09-21 01:52:07 +00003316static int permitted_alphabet_code2value_1[52] = {
331765,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,
331881,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,
3319103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,
3320119,120,121,122,};
3321
Lev Walkin59b176e2005-11-26 11:25:14 +00003322
3323static int check_permitted_alphabet_1(const void *sptr) {
3324 int *table = permitted_alphabet_table_1;
3325 /* The underlying type is UTF8String */
3326 const UTF8String_t *st = (const UTF8String_t *)sptr;
3327 const uint8_t *ch = st->buf;
3328 const uint8_t *end = ch + st->size;
3329
3330 for(; ch < end; ch++) {
3331 uint8_t cv = *ch;
3332 if(cv >= 0x80) return -1;
3333 if(!table[cv]) return -1;
3334 }
3335 return 0;
3336}
3337
3338
3339/*** <<< CODE [Utf8-3] >>> ***/
3340
3341int
3342Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003343 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003344 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
3345 size_t size;
3346
3347 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003348 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003349 "%s: value not given (%s:%d)",
3350 td->name, __FILE__, __LINE__);
3351 return -1;
3352 }
3353
3354 size = UTF8String_length(st);
3355 if((ssize_t)size < 0) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003356 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003357 "%s: UTF-8: broken encoding (%s:%d)",
3358 td->name, __FILE__, __LINE__);
3359 return -1;
3360 }
3361
3362 if((size >= 1 && size <= 2)
3363 && !check_permitted_alphabet_1(st)) {
3364 /* Constraint check succeeded */
3365 return 0;
3366 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003367 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003368 "%s: constraint failed (%s:%d)",
3369 td->name, __FILE__, __LINE__);
3370 return -1;
3371 }
3372}
3373
3374/*
3375 * This type is implemented using Utf8_2,
3376 * so here we adjust the DEF accordingly.
3377 */
3378static void
3379Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3380 td->free_struct = asn_DEF_Utf8_2.free_struct;
3381 td->print_struct = asn_DEF_Utf8_2.print_struct;
3382 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
3383 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
3384 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
3385 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
3386 td->uper_decoder = asn_DEF_Utf8_2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003387 td->uper_encoder = asn_DEF_Utf8_2.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003388 if(!td->per_constraints)
3389 td->per_constraints = asn_DEF_Utf8_2.per_constraints;
3390 td->elements = asn_DEF_Utf8_2.elements;
3391 td->elements_count = asn_DEF_Utf8_2.elements_count;
3392 td->specifics = asn_DEF_Utf8_2.specifics;
3393}
3394
3395void
3396Utf8_3_free(asn_TYPE_descriptor_t *td,
3397 void *struct_ptr, int contents_only) {
3398 Utf8_3_1_inherit_TYPE_descriptor(td);
3399 td->free_struct(td, struct_ptr, contents_only);
3400}
3401
3402int
3403Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3404 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3405 Utf8_3_1_inherit_TYPE_descriptor(td);
3406 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3407}
3408
3409asn_dec_rval_t
3410Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3411 void **structure, const void *bufptr, size_t size, int tag_mode) {
3412 Utf8_3_1_inherit_TYPE_descriptor(td);
3413 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3414}
3415
3416asn_enc_rval_t
3417Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
3418 void *structure, int tag_mode, ber_tlv_tag_t tag,
3419 asn_app_consume_bytes_f *cb, void *app_key) {
3420 Utf8_3_1_inherit_TYPE_descriptor(td);
3421 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3422}
3423
3424asn_dec_rval_t
3425Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3426 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3427 Utf8_3_1_inherit_TYPE_descriptor(td);
3428 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3429}
3430
3431asn_enc_rval_t
3432Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3433 int ilevel, enum xer_encoder_flags_e flags,
3434 asn_app_consume_bytes_f *cb, void *app_key) {
3435 Utf8_3_1_inherit_TYPE_descriptor(td);
3436 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3437}
3438
3439asn_dec_rval_t
3440Utf8_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3441 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3442 Utf8_3_1_inherit_TYPE_descriptor(td);
3443 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3444}
3445
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003446asn_enc_rval_t
3447Utf8_3_encode_uper(asn_TYPE_descriptor_t *td,
3448 asn_per_constraints_t *constraints,
3449 void *structure, asn_per_outp_t *per_out) {
3450 Utf8_3_1_inherit_TYPE_descriptor(td);
3451 return td->uper_encoder(td, constraints, structure, per_out);
3452}
3453
Lev Walkin59b176e2005-11-26 11:25:14 +00003454
3455/*** <<< STAT-DEFS [Utf8-3] >>> ***/
3456
3457static ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
3458 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3459};
3460static asn_per_constraints_t asn_PER_Utf8_3_constr_1 = {
3461 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3462 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
3463};
3464asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
3465 "Utf8-3",
3466 "Utf8-3",
3467 Utf8_3_free,
3468 Utf8_3_print,
3469 Utf8_3_constraint,
3470 Utf8_3_decode_ber,
3471 Utf8_3_encode_der,
3472 Utf8_3_decode_xer,
3473 Utf8_3_encode_xer,
3474 Utf8_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003475 Utf8_3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003476 0, /* Use generic outmost tag fetcher */
3477 asn_DEF_Utf8_3_tags_1,
3478 sizeof(asn_DEF_Utf8_3_tags_1)
3479 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3480 asn_DEF_Utf8_3_tags_1, /* Same as above */
3481 sizeof(asn_DEF_Utf8_3_tags_1)
3482 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3483 &asn_PER_Utf8_3_constr_1,
3484 0, 0, /* No members */
3485 0 /* No specifics */
3486};
3487
3488
3489/*** <<< INCLUDES [Utf8-2] >>> ***/
3490
Lev Walkin22b5ed42006-09-13 02:51:20 +00003491#include "Utf8-1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003492
3493/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
3494
3495typedef Utf8_1_t Utf8_2_t;
3496
3497/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
3498
3499extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
3500asn_struct_free_f Utf8_2_free;
3501asn_struct_print_f Utf8_2_print;
3502asn_constr_check_f Utf8_2_constraint;
3503ber_type_decoder_f Utf8_2_decode_ber;
3504der_type_encoder_f Utf8_2_encode_der;
3505xer_type_decoder_f Utf8_2_decode_xer;
3506xer_type_encoder_f Utf8_2_encode_xer;
3507per_type_decoder_f Utf8_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003508per_type_encoder_f Utf8_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003509
3510/*** <<< CODE [Utf8-2] >>> ***/
3511
3512int
3513Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003514 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003515 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
3516 size_t size;
3517
3518 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003519 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003520 "%s: value not given (%s:%d)",
3521 td->name, __FILE__, __LINE__);
3522 return -1;
3523 }
3524
3525 size = UTF8String_length(st);
3526 if((ssize_t)size < 0) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003527 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003528 "%s: UTF-8: broken encoding (%s:%d)",
3529 td->name, __FILE__, __LINE__);
3530 return -1;
3531 }
3532
3533 if((size >= 1 && size <= 2)) {
3534 /* Constraint check succeeded */
3535 return 0;
3536 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003537 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003538 "%s: constraint failed (%s:%d)",
3539 td->name, __FILE__, __LINE__);
3540 return -1;
3541 }
3542}
3543
3544/*
3545 * This type is implemented using Utf8_1,
3546 * so here we adjust the DEF accordingly.
3547 */
3548static void
3549Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3550 td->free_struct = asn_DEF_Utf8_1.free_struct;
3551 td->print_struct = asn_DEF_Utf8_1.print_struct;
3552 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
3553 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
3554 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
3555 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
3556 td->uper_decoder = asn_DEF_Utf8_1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003557 td->uper_encoder = asn_DEF_Utf8_1.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003558 if(!td->per_constraints)
3559 td->per_constraints = asn_DEF_Utf8_1.per_constraints;
3560 td->elements = asn_DEF_Utf8_1.elements;
3561 td->elements_count = asn_DEF_Utf8_1.elements_count;
3562 td->specifics = asn_DEF_Utf8_1.specifics;
3563}
3564
3565void
3566Utf8_2_free(asn_TYPE_descriptor_t *td,
3567 void *struct_ptr, int contents_only) {
3568 Utf8_2_1_inherit_TYPE_descriptor(td);
3569 td->free_struct(td, struct_ptr, contents_only);
3570}
3571
3572int
3573Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3574 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3575 Utf8_2_1_inherit_TYPE_descriptor(td);
3576 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3577}
3578
3579asn_dec_rval_t
3580Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3581 void **structure, const void *bufptr, size_t size, int tag_mode) {
3582 Utf8_2_1_inherit_TYPE_descriptor(td);
3583 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3584}
3585
3586asn_enc_rval_t
3587Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
3588 void *structure, int tag_mode, ber_tlv_tag_t tag,
3589 asn_app_consume_bytes_f *cb, void *app_key) {
3590 Utf8_2_1_inherit_TYPE_descriptor(td);
3591 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3592}
3593
3594asn_dec_rval_t
3595Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3596 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3597 Utf8_2_1_inherit_TYPE_descriptor(td);
3598 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3599}
3600
3601asn_enc_rval_t
3602Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3603 int ilevel, enum xer_encoder_flags_e flags,
3604 asn_app_consume_bytes_f *cb, void *app_key) {
3605 Utf8_2_1_inherit_TYPE_descriptor(td);
3606 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3607}
3608
3609asn_dec_rval_t
3610Utf8_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3611 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3612 Utf8_2_1_inherit_TYPE_descriptor(td);
3613 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3614}
3615
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003616asn_enc_rval_t
3617Utf8_2_encode_uper(asn_TYPE_descriptor_t *td,
3618 asn_per_constraints_t *constraints,
3619 void *structure, asn_per_outp_t *per_out) {
3620 Utf8_2_1_inherit_TYPE_descriptor(td);
3621 return td->uper_encoder(td, constraints, structure, per_out);
3622}
3623
Lev Walkin59b176e2005-11-26 11:25:14 +00003624
3625/*** <<< STAT-DEFS [Utf8-2] >>> ***/
3626
3627static ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
3628 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3629};
3630static asn_per_constraints_t asn_PER_Utf8_2_constr_1 = {
3631 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3632 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
3633};
3634asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
3635 "Utf8-2",
3636 "Utf8-2",
3637 Utf8_2_free,
3638 Utf8_2_print,
3639 Utf8_2_constraint,
3640 Utf8_2_decode_ber,
3641 Utf8_2_encode_der,
3642 Utf8_2_decode_xer,
3643 Utf8_2_encode_xer,
3644 Utf8_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003645 Utf8_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003646 0, /* Use generic outmost tag fetcher */
3647 asn_DEF_Utf8_2_tags_1,
3648 sizeof(asn_DEF_Utf8_2_tags_1)
3649 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3650 asn_DEF_Utf8_2_tags_1, /* Same as above */
3651 sizeof(asn_DEF_Utf8_2_tags_1)
3652 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3653 &asn_PER_Utf8_2_constr_1,
3654 0, 0, /* No members */
3655 0 /* No specifics */
3656};
3657
3658
3659/*** <<< INCLUDES [Utf8-1] >>> ***/
3660
3661#include <UTF8String.h>
3662
3663/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3664
3665typedef UTF8String_t Utf8_1_t;
3666
3667/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3668
3669extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3670asn_struct_free_f Utf8_1_free;
3671asn_struct_print_f Utf8_1_print;
3672asn_constr_check_f Utf8_1_constraint;
3673ber_type_decoder_f Utf8_1_decode_ber;
3674der_type_encoder_f Utf8_1_encode_der;
3675xer_type_decoder_f Utf8_1_decode_xer;
3676xer_type_encoder_f Utf8_1_encode_xer;
3677per_type_decoder_f Utf8_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003678per_type_encoder_f Utf8_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003679
3680/*** <<< CODE [Utf8-1] >>> ***/
3681
3682int
3683Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003684 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003685 /* Replace with underlying type checker */
3686 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00003687 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00003688}
3689
3690/*
3691 * This type is implemented using UTF8String,
3692 * so here we adjust the DEF accordingly.
3693 */
3694static void
3695Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3696 td->free_struct = asn_DEF_UTF8String.free_struct;
3697 td->print_struct = asn_DEF_UTF8String.print_struct;
3698 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3699 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3700 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3701 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3702 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003703 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003704 if(!td->per_constraints)
3705 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3706 td->elements = asn_DEF_UTF8String.elements;
3707 td->elements_count = asn_DEF_UTF8String.elements_count;
3708 td->specifics = asn_DEF_UTF8String.specifics;
3709}
3710
3711void
3712Utf8_1_free(asn_TYPE_descriptor_t *td,
3713 void *struct_ptr, int contents_only) {
3714 Utf8_1_1_inherit_TYPE_descriptor(td);
3715 td->free_struct(td, struct_ptr, contents_only);
3716}
3717
3718int
3719Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3720 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3721 Utf8_1_1_inherit_TYPE_descriptor(td);
3722 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3723}
3724
3725asn_dec_rval_t
3726Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3727 void **structure, const void *bufptr, size_t size, int tag_mode) {
3728 Utf8_1_1_inherit_TYPE_descriptor(td);
3729 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3730}
3731
3732asn_enc_rval_t
3733Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3734 void *structure, int tag_mode, ber_tlv_tag_t tag,
3735 asn_app_consume_bytes_f *cb, void *app_key) {
3736 Utf8_1_1_inherit_TYPE_descriptor(td);
3737 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3738}
3739
3740asn_dec_rval_t
3741Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3742 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3743 Utf8_1_1_inherit_TYPE_descriptor(td);
3744 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3745}
3746
3747asn_enc_rval_t
3748Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3749 int ilevel, enum xer_encoder_flags_e flags,
3750 asn_app_consume_bytes_f *cb, void *app_key) {
3751 Utf8_1_1_inherit_TYPE_descriptor(td);
3752 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3753}
3754
3755asn_dec_rval_t
3756Utf8_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3757 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3758 Utf8_1_1_inherit_TYPE_descriptor(td);
3759 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3760}
3761
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003762asn_enc_rval_t
3763Utf8_1_encode_uper(asn_TYPE_descriptor_t *td,
3764 asn_per_constraints_t *constraints,
3765 void *structure, asn_per_outp_t *per_out) {
3766 Utf8_1_1_inherit_TYPE_descriptor(td);
3767 return td->uper_encoder(td, constraints, structure, per_out);
3768}
3769
Lev Walkin59b176e2005-11-26 11:25:14 +00003770
3771/*** <<< STAT-DEFS [Utf8-1] >>> ***/
3772
3773static ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
3774 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3775};
3776asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3777 "Utf8-1",
3778 "Utf8-1",
3779 Utf8_1_free,
3780 Utf8_1_print,
3781 Utf8_1_constraint,
3782 Utf8_1_decode_ber,
3783 Utf8_1_encode_der,
3784 Utf8_1_decode_xer,
3785 Utf8_1_encode_xer,
3786 Utf8_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003787 Utf8_1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003788 0, /* Use generic outmost tag fetcher */
3789 asn_DEF_Utf8_1_tags_1,
3790 sizeof(asn_DEF_Utf8_1_tags_1)
3791 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3792 asn_DEF_Utf8_1_tags_1, /* Same as above */
3793 sizeof(asn_DEF_Utf8_1_tags_1)
3794 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3795 0, /* No PER visible constraints */
3796 0, 0, /* No members */
3797 0 /* No specifics */
3798};
3799
3800
3801/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
3802
Lev Walkin22b5ed42006-09-13 02:51:20 +00003803#include "Identifier.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003804
3805/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
3806
3807typedef Identifier_t VisibleIdentifier_t;
3808
3809/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
3810
3811extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
3812asn_struct_free_f VisibleIdentifier_free;
3813asn_struct_print_f VisibleIdentifier_print;
3814asn_constr_check_f VisibleIdentifier_constraint;
3815ber_type_decoder_f VisibleIdentifier_decode_ber;
3816der_type_encoder_f VisibleIdentifier_encode_der;
3817xer_type_decoder_f VisibleIdentifier_decode_xer;
3818xer_type_encoder_f VisibleIdentifier_encode_xer;
3819per_type_decoder_f VisibleIdentifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003820per_type_encoder_f VisibleIdentifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003821
3822/*** <<< CTABLES [VisibleIdentifier] >>> ***/
3823
3824static int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003825 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3826 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3827 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
3828 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
3829 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
383027,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
3831 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
383254,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003833};
Lev Walkin5b62ca82006-09-21 01:52:07 +00003834static int permitted_alphabet_code2value_1[64] = {
383536,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
383670,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
383786,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
3838107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
3839};
3840
Lev Walkin59b176e2005-11-26 11:25:14 +00003841
3842static int check_permitted_alphabet_1(const void *sptr) {
3843 int *table = permitted_alphabet_table_1;
3844 /* The underlying type is VisibleString */
3845 const VisibleString_t *st = (const VisibleString_t *)sptr;
3846 const uint8_t *ch = st->buf;
3847 const uint8_t *end = ch + st->size;
3848
3849 for(; ch < end; ch++) {
3850 uint8_t cv = *ch;
3851 if(!table[cv]) return -1;
3852 }
3853 return 0;
3854}
3855
3856
3857/*** <<< CODE [VisibleIdentifier] >>> ***/
3858
3859int
3860VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003861 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003862 const Identifier_t *st = (const Identifier_t *)sptr;
3863 size_t size;
3864
3865 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003866 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003867 "%s: value not given (%s:%d)",
3868 td->name, __FILE__, __LINE__);
3869 return -1;
3870 }
3871
3872 size = st->size;
3873
3874 if((size >= 1 && size <= 32)
3875 && !check_permitted_alphabet_1(st)) {
3876 /* Constraint check succeeded */
3877 return 0;
3878 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003879 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003880 "%s: constraint failed (%s:%d)",
3881 td->name, __FILE__, __LINE__);
3882 return -1;
3883 }
3884}
3885
3886/*
3887 * This type is implemented using Identifier,
3888 * so here we adjust the DEF accordingly.
3889 */
3890static void
3891VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3892 td->free_struct = asn_DEF_Identifier.free_struct;
3893 td->print_struct = asn_DEF_Identifier.print_struct;
3894 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
3895 td->der_encoder = asn_DEF_Identifier.der_encoder;
3896 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
3897 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
3898 td->uper_decoder = asn_DEF_Identifier.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003899 td->uper_encoder = asn_DEF_Identifier.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003900 if(!td->per_constraints)
3901 td->per_constraints = asn_DEF_Identifier.per_constraints;
3902 td->elements = asn_DEF_Identifier.elements;
3903 td->elements_count = asn_DEF_Identifier.elements_count;
3904 td->specifics = asn_DEF_Identifier.specifics;
3905}
3906
3907void
3908VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
3909 void *struct_ptr, int contents_only) {
3910 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3911 td->free_struct(td, struct_ptr, contents_only);
3912}
3913
3914int
3915VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3916 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3917 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3918 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3919}
3920
3921asn_dec_rval_t
3922VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3923 void **structure, const void *bufptr, size_t size, int tag_mode) {
3924 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3925 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3926}
3927
3928asn_enc_rval_t
3929VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
3930 void *structure, int tag_mode, ber_tlv_tag_t tag,
3931 asn_app_consume_bytes_f *cb, void *app_key) {
3932 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3933 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3934}
3935
3936asn_dec_rval_t
3937VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3938 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3939 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3940 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3941}
3942
3943asn_enc_rval_t
3944VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3945 int ilevel, enum xer_encoder_flags_e flags,
3946 asn_app_consume_bytes_f *cb, void *app_key) {
3947 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3948 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3949}
3950
3951asn_dec_rval_t
3952VisibleIdentifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3953 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3954 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3955 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3956}
3957
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003958asn_enc_rval_t
3959VisibleIdentifier_encode_uper(asn_TYPE_descriptor_t *td,
3960 asn_per_constraints_t *constraints,
3961 void *structure, asn_per_outp_t *per_out) {
3962 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3963 return td->uper_encoder(td, constraints, structure, per_out);
3964}
3965
Lev Walkin59b176e2005-11-26 11:25:14 +00003966
3967/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
3968
3969static ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
3970 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
3971};
3972asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
3973 "VisibleIdentifier",
3974 "VisibleIdentifier",
3975 VisibleIdentifier_free,
3976 VisibleIdentifier_print,
3977 VisibleIdentifier_constraint,
3978 VisibleIdentifier_decode_ber,
3979 VisibleIdentifier_encode_der,
3980 VisibleIdentifier_decode_xer,
3981 VisibleIdentifier_encode_xer,
3982 VisibleIdentifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003983 VisibleIdentifier_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003984 0, /* Use generic outmost tag fetcher */
3985 asn_DEF_VisibleIdentifier_tags_1,
3986 sizeof(asn_DEF_VisibleIdentifier_tags_1)
3987 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
3988 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
3989 sizeof(asn_DEF_VisibleIdentifier_tags_1)
3990 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
3991 0, /* No PER visible constraints */
3992 0, 0, /* No members */
3993 0 /* No specifics */
3994};
3995
3996
3997/*** <<< INCLUDES [Sequence] >>> ***/
3998
Lev Walkin22b5ed42006-09-13 02:51:20 +00003999#include "Int1.h"
4000#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004001#include <BOOLEAN.h>
4002#include <ENUMERATED.h>
4003#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00004004#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004005#include <constr_SEQUENCE.h>
4006
4007/*** <<< DEPS [Sequence] >>> ***/
4008
4009typedef enum enum_c {
4010 enum_c_one = 1,
4011 enum_c_two = 2,
4012 /*
4013 * Enumeration is extensible
4014 */
4015 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00004016} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00004017
4018/*** <<< TYPE-DECLS [Sequence] >>> ***/
4019
4020typedef struct Sequence {
4021 Int1_t *int1_c /* DEFAULT 3 */;
4022 Int4_t int4;
4023 Int4_t int4_c;
4024 BOOLEAN_t *bool /* DEFAULT 1 */;
4025 ENUMERATED_t enum_c;
4026 NULL_t *null /* OPTIONAL */;
4027 /*
4028 * This type is extensible,
4029 * possible extensions are below.
4030 */
4031 Int5_t *int5_c /* OPTIONAL */;
4032
4033 /* Context for parsing across buffer boundaries */
4034 asn_struct_ctx_t _asn_ctx;
4035} Sequence_t;
4036
4037/*** <<< FUNC-DECLS [Sequence] >>> ***/
4038
4039/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
4040extern asn_TYPE_descriptor_t asn_DEF_Sequence;
4041
4042/*** <<< CODE [Sequence] >>> ***/
4043
4044static int
4045enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004046 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004047 /* Replace with underlying type checker */
4048 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004049 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004050}
4051
4052/*
4053 * This type is implemented using ENUMERATED,
4054 * so here we adjust the DEF accordingly.
4055 */
4056static void
4057enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4058 td->free_struct = asn_DEF_ENUMERATED.free_struct;
4059 td->print_struct = asn_DEF_ENUMERATED.print_struct;
4060 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
4061 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
4062 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
4063 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
4064 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004065 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004066 if(!td->per_constraints)
4067 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
4068 td->elements = asn_DEF_ENUMERATED.elements;
4069 td->elements_count = asn_DEF_ENUMERATED.elements_count;
4070 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
4071}
4072
4073static void
4074enum_c_6_free(asn_TYPE_descriptor_t *td,
4075 void *struct_ptr, int contents_only) {
4076 enum_c_6_inherit_TYPE_descriptor(td);
4077 td->free_struct(td, struct_ptr, contents_only);
4078}
4079
4080static int
4081enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4082 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4083 enum_c_6_inherit_TYPE_descriptor(td);
4084 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4085}
4086
4087static asn_dec_rval_t
4088enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4089 void **structure, const void *bufptr, size_t size, int tag_mode) {
4090 enum_c_6_inherit_TYPE_descriptor(td);
4091 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4092}
4093
4094static asn_enc_rval_t
4095enum_c_6_encode_der(asn_TYPE_descriptor_t *td,
4096 void *structure, int tag_mode, ber_tlv_tag_t tag,
4097 asn_app_consume_bytes_f *cb, void *app_key) {
4098 enum_c_6_inherit_TYPE_descriptor(td);
4099 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4100}
4101
4102static asn_dec_rval_t
4103enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4104 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4105 enum_c_6_inherit_TYPE_descriptor(td);
4106 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4107}
4108
4109static asn_enc_rval_t
4110enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4111 int ilevel, enum xer_encoder_flags_e flags,
4112 asn_app_consume_bytes_f *cb, void *app_key) {
4113 enum_c_6_inherit_TYPE_descriptor(td);
4114 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4115}
4116
4117static asn_dec_rval_t
4118enum_c_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4119 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4120 enum_c_6_inherit_TYPE_descriptor(td);
4121 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4122}
4123
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004124static asn_enc_rval_t
4125enum_c_6_encode_uper(asn_TYPE_descriptor_t *td,
4126 asn_per_constraints_t *constraints,
4127 void *structure, asn_per_outp_t *per_out) {
4128 enum_c_6_inherit_TYPE_descriptor(td);
4129 return td->uper_encoder(td, constraints, structure, per_out);
4130}
4131
Lev Walkin59b176e2005-11-26 11:25:14 +00004132static int
4133memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004134 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004135 const Int1_t *st = (const Int1_t *)sptr;
4136 long value;
4137
4138 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004139 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004140 "%s: value not given (%s:%d)",
4141 td->name, __FILE__, __LINE__);
4142 return -1;
4143 }
4144
4145 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004146 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004147 "%s: value too large (%s:%d)",
4148 td->name, __FILE__, __LINE__);
4149 return -1;
4150 }
4151
4152 if((value >= -2)) {
4153 /* Constraint check succeeded */
4154 return 0;
4155 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004156 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004157 "%s: constraint failed (%s:%d)",
4158 td->name, __FILE__, __LINE__);
4159 return -1;
4160 }
4161}
4162
4163static int
4164memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004165 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004166 const Int4_t *st = (const Int4_t *)sptr;
4167 long value;
4168
4169 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004170 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004171 "%s: value not given (%s:%d)",
4172 td->name, __FILE__, __LINE__);
4173 return -1;
4174 }
4175
4176 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004177 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004178 "%s: value too large (%s:%d)",
4179 td->name, __FILE__, __LINE__);
4180 return -1;
4181 }
4182
4183 if((value >= 5 && value <= 7)) {
4184 /* Constraint check succeeded */
4185 return 0;
4186 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004187 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004188 "%s: constraint failed (%s:%d)",
4189 td->name, __FILE__, __LINE__);
4190 return -1;
4191 }
4192}
4193
4194static int
4195memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004196 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004197 const Int5_t *st = (const Int5_t *)sptr;
4198 long value;
4199
4200 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004201 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004202 "%s: value not given (%s:%d)",
4203 td->name, __FILE__, __LINE__);
4204 return -1;
4205 }
4206
4207 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004208 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004209 "%s: value too large (%s:%d)",
4210 td->name, __FILE__, __LINE__);
4211 return -1;
4212 }
4213
4214 if((value == 5)) {
4215 /* Constraint check succeeded */
4216 return 0;
4217 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004218 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004219 "%s: constraint failed (%s:%d)",
4220 td->name, __FILE__, __LINE__);
4221 return -1;
4222 }
4223}
4224
4225
4226/*** <<< STAT-DEFS [Sequence] >>> ***/
4227
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004228static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004229 Int1_t *st = *sptr;
4230
4231 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004232 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004233 st = (*sptr = CALLOC(1, sizeof(*st)));
4234 if(!st) return -1;
4235 }
4236
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004237 if(set_value) {
4238 /* Install default value 3 */
4239 return asn_long2INTEGER(st, 3);
4240 } else {
4241 /* Test default value 3 */
4242 long value;
4243 if(asn_INTEGER2long(st, &value))
4244 return -1;
4245 return (value == 3);
4246 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004247}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004248static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004249 BOOLEAN_t *st = *sptr;
4250
4251 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004252 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004253 st = (*sptr = CALLOC(1, sizeof(*st)));
4254 if(!st) return -1;
4255 }
4256
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004257 if(set_value) {
4258 /* Install default value 1 */
4259 *st = 1;
4260 return 0;
4261 } else {
4262 /* Test default value 1 */
4263 return (*st == 1);
4264 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004265}
4266static asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
4267 { 1, 3, "one" },
4268 { 2, 3, "two" },
4269 { 3, 5, "three" }
4270 /* This list is extensible */
4271};
4272static unsigned int asn_MAP_enum_c_enum2value_6[] = {
4273 0, /* one(1) */
4274 2, /* three(3) */
4275 1 /* two(2) */
4276 /* This list is extensible */
4277};
4278static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
4279 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
4280 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
4281 3, /* Number of elements in the maps */
4282 3, /* Extensions before this member */
4283 1 /* Strict enumeration */
4284};
4285static ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
4286 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4287};
4288static asn_per_constraints_t asn_PER_enum_c_constr_6 = {
4289 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
4290 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4291};
4292static /* Use -fall-defs-global to expose */
4293asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
4294 "enum-c",
4295 "enum-c",
4296 enum_c_6_free,
4297 enum_c_6_print,
4298 enum_c_6_constraint,
4299 enum_c_6_decode_ber,
4300 enum_c_6_encode_der,
4301 enum_c_6_decode_xer,
4302 enum_c_6_encode_xer,
4303 enum_c_6_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004304 enum_c_6_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004305 0, /* Use generic outmost tag fetcher */
4306 asn_DEF_enum_c_tags_6,
4307 sizeof(asn_DEF_enum_c_tags_6)
4308 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
4309 asn_DEF_enum_c_tags_6, /* Same as above */
4310 sizeof(asn_DEF_enum_c_tags_6)
4311 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
4312 &asn_PER_enum_c_constr_6,
4313 0, 0, /* Defined elsewhere */
4314 &asn_SPC_enum_c_specs_6 /* Additional specs */
4315};
4316
4317static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 = {
4318 { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
4319 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4320};
4321static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 = {
4322 { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
4323 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4324};
4325static asn_per_constraints_t asn_PER_memb_enum_c_constr_6 = {
4326 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
4327 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4328};
4329static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 = {
4330 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
4331 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4332};
4333static asn_TYPE_member_t asn_MBR_Sequence_1[] = {
4334 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
4335 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4336 .tag_mode = 0,
4337 .type = &asn_DEF_Int1,
4338 .memb_constraints = memb_int1_c_constraint_1,
4339 .per_constraints = &asn_PER_memb_int1_c_constr_2,
4340 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
4341 .name = "int1-c"
4342 },
4343 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
4344 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
4345 .tag_mode = +1, /* EXPLICIT tag at current level */
4346 .type = &asn_DEF_Int4,
4347 .memb_constraints = 0, /* Defer constraints checking to the member type */
4348 .per_constraints = 0, /* No PER visible constraints */
4349 .default_value = 0,
4350 .name = "int4"
4351 },
4352 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
4353 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4354 .tag_mode = 0,
4355 .type = &asn_DEF_Int4,
4356 .memb_constraints = memb_int4_c_constraint_1,
4357 .per_constraints = &asn_PER_memb_int4_c_constr_4,
4358 .default_value = 0,
4359 .name = "int4-c"
4360 },
4361 { ATF_POINTER, 1, offsetof(struct Sequence, bool),
4362 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
4363 .tag_mode = 0,
4364 .type = &asn_DEF_BOOLEAN,
4365 .memb_constraints = 0, /* Defer constraints checking to the member type */
4366 .per_constraints = 0, /* No PER visible constraints */
4367 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
4368 .name = "bool"
4369 },
4370 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
4371 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
4372 .tag_mode = 0,
4373 .type = &asn_DEF_enum_c_6,
4374 .memb_constraints = 0, /* Defer constraints checking to the member type */
4375 .per_constraints = &asn_PER_memb_enum_c_constr_6,
4376 .default_value = 0,
4377 .name = "enum-c"
4378 },
4379 { ATF_POINTER, 2, offsetof(struct Sequence, null),
4380 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
4381 .tag_mode = 0,
4382 .type = &asn_DEF_NULL,
4383 .memb_constraints = 0, /* Defer constraints checking to the member type */
4384 .per_constraints = 0, /* No PER visible constraints */
4385 .default_value = 0,
4386 .name = "null"
4387 },
4388 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
4389 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4390 .tag_mode = 0,
4391 .type = &asn_DEF_Int5,
4392 .memb_constraints = memb_int5_c_constraint_1,
4393 .per_constraints = &asn_PER_memb_int5_c_constr_13,
4394 .default_value = 0,
4395 .name = "int5-c"
4396 },
4397};
4398static int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
4399static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
4400 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4401};
4402static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
4403 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool at 59 */
4404 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c at 56 */
4405 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c at 58 */
4406 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c at 62 */
4407 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null at 64 */
4408 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c at 60 */
4409 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 at 57 */
4410};
4411static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
4412 sizeof(struct Sequence),
4413 offsetof(struct Sequence, _asn_ctx),
4414 asn_MAP_Sequence_tag2el_1,
4415 7, /* Count of tags in the map */
4416 asn_MAP_Sequence_oms_1, /* Optional members */
4417 3, 1, /* Root/Additions */
4418 5, /* Start extensions */
4419 8 /* Stop extensions */
4420};
4421asn_TYPE_descriptor_t asn_DEF_Sequence = {
4422 "Sequence",
4423 "Sequence",
4424 SEQUENCE_free,
4425 SEQUENCE_print,
4426 SEQUENCE_constraint,
4427 SEQUENCE_decode_ber,
4428 SEQUENCE_encode_der,
4429 SEQUENCE_decode_xer,
4430 SEQUENCE_encode_xer,
4431 SEQUENCE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004432 SEQUENCE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004433 0, /* Use generic outmost tag fetcher */
4434 asn_DEF_Sequence_tags_1,
4435 sizeof(asn_DEF_Sequence_tags_1)
4436 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4437 asn_DEF_Sequence_tags_1, /* Same as above */
4438 sizeof(asn_DEF_Sequence_tags_1)
4439 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4440 0, /* No PER visible constraints */
4441 asn_MBR_Sequence_1,
4442 7, /* Elements count */
4443 &asn_SPC_Sequence_specs_1 /* Additional specs */
4444};
4445
4446
4447/*** <<< INCLUDES [SequenceOf] >>> ***/
4448
4449#include <asn_SEQUENCE_OF.h>
4450#include <constr_SEQUENCE_OF.h>
4451
4452/*** <<< FWD-DECLS [SequenceOf] >>> ***/
4453
4454struct Sequence;
4455
4456/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
4457
4458typedef struct SequenceOf {
4459 A_SEQUENCE_OF(struct Sequence) list;
4460
4461 /* Context for parsing across buffer boundaries */
4462 asn_struct_ctx_t _asn_ctx;
4463} SequenceOf_t;
4464
4465/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
4466
4467extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
4468
4469/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
4470
Lev Walkin22b5ed42006-09-13 02:51:20 +00004471#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004472
4473/*** <<< STAT-DEFS [SequenceOf] >>> ***/
4474
4475static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
4476 { ATF_POINTER, 0, 0,
4477 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
4478 .tag_mode = 0,
4479 .type = &asn_DEF_Sequence,
4480 .memb_constraints = 0, /* Defer constraints checking to the member type */
4481 .per_constraints = 0, /* No PER visible constraints */
4482 .default_value = 0,
4483 .name = ""
4484 },
4485};
4486static ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
4487 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4488};
4489static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
4490 sizeof(struct SequenceOf),
4491 offsetof(struct SequenceOf, _asn_ctx),
4492 0, /* XER encoding is XMLDelimitedItemList */
4493};
4494static asn_per_constraints_t asn_PER_SequenceOf_constr_1 = {
4495 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4496 { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */
4497};
4498asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
4499 "SequenceOf",
4500 "SequenceOf",
4501 SEQUENCE_OF_free,
4502 SEQUENCE_OF_print,
4503 SEQUENCE_OF_constraint,
4504 SEQUENCE_OF_decode_ber,
4505 SEQUENCE_OF_encode_der,
4506 SEQUENCE_OF_decode_xer,
4507 SEQUENCE_OF_encode_xer,
4508 SEQUENCE_OF_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004509 SEQUENCE_OF_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004510 0, /* Use generic outmost tag fetcher */
4511 asn_DEF_SequenceOf_tags_1,
4512 sizeof(asn_DEF_SequenceOf_tags_1)
4513 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4514 asn_DEF_SequenceOf_tags_1, /* Same as above */
4515 sizeof(asn_DEF_SequenceOf_tags_1)
4516 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4517 &asn_PER_SequenceOf_constr_1,
4518 asn_MBR_SequenceOf_1,
4519 1, /* Single element */
4520 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
4521};
4522
4523
4524/*** <<< INCLUDES [Enum0] >>> ***/
4525
4526#include <ENUMERATED.h>
4527
4528/*** <<< DEPS [Enum0] >>> ***/
4529
4530typedef enum Enum0 {
4531 Enum0_one = 0,
4532 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004533} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00004534
4535/*** <<< TYPE-DECLS [Enum0] >>> ***/
4536
4537typedef ENUMERATED_t Enum0_t;
4538
4539/*** <<< FUNC-DECLS [Enum0] >>> ***/
4540
4541extern asn_TYPE_descriptor_t asn_DEF_Enum0;
4542asn_struct_free_f Enum0_free;
4543asn_struct_print_f Enum0_print;
4544asn_constr_check_f Enum0_constraint;
4545ber_type_decoder_f Enum0_decode_ber;
4546der_type_encoder_f Enum0_encode_der;
4547xer_type_decoder_f Enum0_decode_xer;
4548xer_type_encoder_f Enum0_encode_xer;
4549per_type_decoder_f Enum0_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004550per_type_encoder_f Enum0_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004551
4552/*** <<< CODE [Enum0] >>> ***/
4553
4554int
4555Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004556 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004557 /* Replace with underlying type checker */
4558 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004559 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004560}
4561
4562/*
4563 * This type is implemented using ENUMERATED,
4564 * so here we adjust the DEF accordingly.
4565 */
4566static void
4567Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4568 td->free_struct = asn_DEF_ENUMERATED.free_struct;
4569 td->print_struct = asn_DEF_ENUMERATED.print_struct;
4570 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
4571 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
4572 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
4573 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
4574 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004575 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004576 if(!td->per_constraints)
4577 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
4578 td->elements = asn_DEF_ENUMERATED.elements;
4579 td->elements_count = asn_DEF_ENUMERATED.elements_count;
4580 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
4581}
4582
4583void
4584Enum0_free(asn_TYPE_descriptor_t *td,
4585 void *struct_ptr, int contents_only) {
4586 Enum0_1_inherit_TYPE_descriptor(td);
4587 td->free_struct(td, struct_ptr, contents_only);
4588}
4589
4590int
4591Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4592 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4593 Enum0_1_inherit_TYPE_descriptor(td);
4594 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4595}
4596
4597asn_dec_rval_t
4598Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4599 void **structure, const void *bufptr, size_t size, int tag_mode) {
4600 Enum0_1_inherit_TYPE_descriptor(td);
4601 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4602}
4603
4604asn_enc_rval_t
4605Enum0_encode_der(asn_TYPE_descriptor_t *td,
4606 void *structure, int tag_mode, ber_tlv_tag_t tag,
4607 asn_app_consume_bytes_f *cb, void *app_key) {
4608 Enum0_1_inherit_TYPE_descriptor(td);
4609 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4610}
4611
4612asn_dec_rval_t
4613Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4614 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4615 Enum0_1_inherit_TYPE_descriptor(td);
4616 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4617}
4618
4619asn_enc_rval_t
4620Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4621 int ilevel, enum xer_encoder_flags_e flags,
4622 asn_app_consume_bytes_f *cb, void *app_key) {
4623 Enum0_1_inherit_TYPE_descriptor(td);
4624 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4625}
4626
4627asn_dec_rval_t
4628Enum0_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4629 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4630 Enum0_1_inherit_TYPE_descriptor(td);
4631 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4632}
4633
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004634asn_enc_rval_t
4635Enum0_encode_uper(asn_TYPE_descriptor_t *td,
4636 asn_per_constraints_t *constraints,
4637 void *structure, asn_per_outp_t *per_out) {
4638 Enum0_1_inherit_TYPE_descriptor(td);
4639 return td->uper_encoder(td, constraints, structure, per_out);
4640}
4641
Lev Walkin59b176e2005-11-26 11:25:14 +00004642
4643/*** <<< STAT-DEFS [Enum0] >>> ***/
4644
4645static asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
4646 { 0, 3, "one" },
4647 { 1, 3, "two" }
4648};
4649static unsigned int asn_MAP_Enum0_enum2value_1[] = {
4650 0, /* one(0) */
4651 1 /* two(1) */
4652};
4653static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
4654 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
4655 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
4656 2, /* Number of elements in the maps */
4657 0, /* Enumeration is not extensible */
4658 1 /* Strict enumeration */
4659};
4660static ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
4661 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4662};
4663static asn_per_constraints_t asn_PER_Enum0_constr_1 = {
4664 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4665 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4666};
4667asn_TYPE_descriptor_t asn_DEF_Enum0 = {
4668 "Enum0",
4669 "Enum0",
4670 Enum0_free,
4671 Enum0_print,
4672 Enum0_constraint,
4673 Enum0_decode_ber,
4674 Enum0_encode_der,
4675 Enum0_decode_xer,
4676 Enum0_encode_xer,
4677 Enum0_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004678 Enum0_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004679 0, /* Use generic outmost tag fetcher */
4680 asn_DEF_Enum0_tags_1,
4681 sizeof(asn_DEF_Enum0_tags_1)
4682 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4683 asn_DEF_Enum0_tags_1, /* Same as above */
4684 sizeof(asn_DEF_Enum0_tags_1)
4685 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4686 &asn_PER_Enum0_constr_1,
4687 0, 0, /* Defined elsewhere */
4688 &asn_SPC_Enum0_specs_1 /* Additional specs */
4689};
4690
4691
4692/*** <<< INCLUDES [Enum1] >>> ***/
4693
4694#include <NativeEnumerated.h>
4695
4696/*** <<< DEPS [Enum1] >>> ***/
4697
4698typedef enum Enum1 {
4699 Enum1_one = 0,
4700 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004701} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00004702
4703/*** <<< TYPE-DECLS [Enum1] >>> ***/
4704
4705typedef long Enum1_t;
4706
4707/*** <<< FUNC-DECLS [Enum1] >>> ***/
4708
4709extern asn_TYPE_descriptor_t asn_DEF_Enum1;
4710asn_struct_free_f Enum1_free;
4711asn_struct_print_f Enum1_print;
4712asn_constr_check_f Enum1_constraint;
4713ber_type_decoder_f Enum1_decode_ber;
4714der_type_encoder_f Enum1_encode_der;
4715xer_type_decoder_f Enum1_decode_xer;
4716xer_type_encoder_f Enum1_encode_xer;
4717per_type_decoder_f Enum1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004718per_type_encoder_f Enum1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004719
4720/*** <<< CODE [Enum1] >>> ***/
4721
4722int
4723Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004724 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004725 long value;
4726
4727 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004728 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004729 "%s: value not given (%s:%d)",
4730 td->name, __FILE__, __LINE__);
4731 return -1;
4732 }
4733
4734 value = *(const long *)sptr;
4735
4736 if((value == 0)) {
4737 /* Constraint check succeeded */
4738 return 0;
4739 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004740 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004741 "%s: constraint failed (%s:%d)",
4742 td->name, __FILE__, __LINE__);
4743 return -1;
4744 }
4745}
4746
4747/*
4748 * This type is implemented using NativeEnumerated,
4749 * so here we adjust the DEF accordingly.
4750 */
4751static void
4752Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4753 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4754 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
4755 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4756 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4757 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4758 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4759 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004760 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004761 if(!td->per_constraints)
4762 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4763 td->elements = asn_DEF_NativeEnumerated.elements;
4764 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4765 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
4766}
4767
4768void
4769Enum1_free(asn_TYPE_descriptor_t *td,
4770 void *struct_ptr, int contents_only) {
4771 Enum1_1_inherit_TYPE_descriptor(td);
4772 td->free_struct(td, struct_ptr, contents_only);
4773}
4774
4775int
4776Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4777 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4778 Enum1_1_inherit_TYPE_descriptor(td);
4779 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4780}
4781
4782asn_dec_rval_t
4783Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4784 void **structure, const void *bufptr, size_t size, int tag_mode) {
4785 Enum1_1_inherit_TYPE_descriptor(td);
4786 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4787}
4788
4789asn_enc_rval_t
4790Enum1_encode_der(asn_TYPE_descriptor_t *td,
4791 void *structure, int tag_mode, ber_tlv_tag_t tag,
4792 asn_app_consume_bytes_f *cb, void *app_key) {
4793 Enum1_1_inherit_TYPE_descriptor(td);
4794 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4795}
4796
4797asn_dec_rval_t
4798Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4799 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4800 Enum1_1_inherit_TYPE_descriptor(td);
4801 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4802}
4803
4804asn_enc_rval_t
4805Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4806 int ilevel, enum xer_encoder_flags_e flags,
4807 asn_app_consume_bytes_f *cb, void *app_key) {
4808 Enum1_1_inherit_TYPE_descriptor(td);
4809 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4810}
4811
4812asn_dec_rval_t
4813Enum1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4814 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4815 Enum1_1_inherit_TYPE_descriptor(td);
4816 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4817}
4818
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004819asn_enc_rval_t
4820Enum1_encode_uper(asn_TYPE_descriptor_t *td,
4821 asn_per_constraints_t *constraints,
4822 void *structure, asn_per_outp_t *per_out) {
4823 Enum1_1_inherit_TYPE_descriptor(td);
4824 return td->uper_encoder(td, constraints, structure, per_out);
4825}
4826
Lev Walkin59b176e2005-11-26 11:25:14 +00004827
4828/*** <<< STAT-DEFS [Enum1] >>> ***/
4829
4830static asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
4831 { 0, 3, "one" },
4832 { 1, 3, "two" }
4833};
4834static unsigned int asn_MAP_Enum1_enum2value_1[] = {
4835 0, /* one(0) */
4836 1 /* two(1) */
4837};
4838static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
4839 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
4840 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
4841 2, /* Number of elements in the maps */
4842 0, /* Enumeration is not extensible */
4843 1 /* Strict enumeration */
4844};
4845static ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
4846 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4847};
4848static asn_per_constraints_t asn_PER_Enum1_constr_1 = {
4849 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4850 { APC_UNCONSTRAINED, -1, -1, 0, 0 }
4851};
4852asn_TYPE_descriptor_t asn_DEF_Enum1 = {
4853 "Enum1",
4854 "Enum1",
4855 Enum1_free,
4856 Enum1_print,
4857 Enum1_constraint,
4858 Enum1_decode_ber,
4859 Enum1_encode_der,
4860 Enum1_decode_xer,
4861 Enum1_encode_xer,
4862 Enum1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004863 Enum1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004864 0, /* Use generic outmost tag fetcher */
4865 asn_DEF_Enum1_tags_1,
4866 sizeof(asn_DEF_Enum1_tags_1)
4867 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4868 asn_DEF_Enum1_tags_1, /* Same as above */
4869 sizeof(asn_DEF_Enum1_tags_1)
4870 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4871 &asn_PER_Enum1_constr_1,
4872 0, 0, /* Defined elsewhere */
4873 &asn_SPC_Enum1_specs_1 /* Additional specs */
4874};
4875
4876
4877/*** <<< INCLUDES [Identifier] >>> ***/
4878
4879#include <VisibleString.h>
4880
4881/*** <<< TYPE-DECLS [Identifier] >>> ***/
4882
4883typedef VisibleString_t Identifier_t;
4884
4885/*** <<< FUNC-DECLS [Identifier] >>> ***/
4886
4887extern asn_TYPE_descriptor_t asn_DEF_Identifier;
4888asn_struct_free_f Identifier_free;
4889asn_struct_print_f Identifier_print;
4890asn_constr_check_f Identifier_constraint;
4891ber_type_decoder_f Identifier_decode_ber;
4892der_type_encoder_f Identifier_encode_der;
4893xer_type_decoder_f Identifier_decode_xer;
4894xer_type_encoder_f Identifier_encode_xer;
4895per_type_decoder_f Identifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004896per_type_encoder_f Identifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004897
4898/*** <<< CTABLES [Identifier] >>> ***/
4899
4900static int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00004901 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4902 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4903 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
4904 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
4905 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
490627,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
4907 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
490854,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00004909};
Lev Walkin5b62ca82006-09-21 01:52:07 +00004910static int permitted_alphabet_code2value_1[64] = {
491136,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
491270,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
491386,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
4914107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
4915};
4916
Lev Walkin59b176e2005-11-26 11:25:14 +00004917
4918static int check_permitted_alphabet_1(const void *sptr) {
4919 int *table = permitted_alphabet_table_1;
4920 /* The underlying type is VisibleString */
4921 const VisibleString_t *st = (const VisibleString_t *)sptr;
4922 const uint8_t *ch = st->buf;
4923 const uint8_t *end = ch + st->size;
4924
4925 for(; ch < end; ch++) {
4926 uint8_t cv = *ch;
4927 if(!table[cv]) return -1;
4928 }
4929 return 0;
4930}
4931
4932
4933/*** <<< CODE [Identifier] >>> ***/
4934
4935int
4936Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004937 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004938 const VisibleString_t *st = (const VisibleString_t *)sptr;
4939 size_t size;
4940
4941 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004942 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004943 "%s: value not given (%s:%d)",
4944 td->name, __FILE__, __LINE__);
4945 return -1;
4946 }
4947
4948 size = st->size;
4949
4950 if((size >= 1 && size <= 32)
4951 && !check_permitted_alphabet_1(st)) {
4952 /* Constraint check succeeded */
4953 return 0;
4954 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004955 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004956 "%s: constraint failed (%s:%d)",
4957 td->name, __FILE__, __LINE__);
4958 return -1;
4959 }
4960}
4961
4962/*
4963 * This type is implemented using VisibleString,
4964 * so here we adjust the DEF accordingly.
4965 */
4966static void
4967Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4968 td->free_struct = asn_DEF_VisibleString.free_struct;
4969 td->print_struct = asn_DEF_VisibleString.print_struct;
4970 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
4971 td->der_encoder = asn_DEF_VisibleString.der_encoder;
4972 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
4973 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
4974 td->uper_decoder = asn_DEF_VisibleString.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004975 td->uper_encoder = asn_DEF_VisibleString.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004976 if(!td->per_constraints)
4977 td->per_constraints = asn_DEF_VisibleString.per_constraints;
4978 td->elements = asn_DEF_VisibleString.elements;
4979 td->elements_count = asn_DEF_VisibleString.elements_count;
4980 td->specifics = asn_DEF_VisibleString.specifics;
4981}
4982
4983void
4984Identifier_free(asn_TYPE_descriptor_t *td,
4985 void *struct_ptr, int contents_only) {
4986 Identifier_1_inherit_TYPE_descriptor(td);
4987 td->free_struct(td, struct_ptr, contents_only);
4988}
4989
4990int
4991Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4992 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4993 Identifier_1_inherit_TYPE_descriptor(td);
4994 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4995}
4996
4997asn_dec_rval_t
4998Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4999 void **structure, const void *bufptr, size_t size, int tag_mode) {
5000 Identifier_1_inherit_TYPE_descriptor(td);
5001 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
5002}
5003
5004asn_enc_rval_t
5005Identifier_encode_der(asn_TYPE_descriptor_t *td,
5006 void *structure, int tag_mode, ber_tlv_tag_t tag,
5007 asn_app_consume_bytes_f *cb, void *app_key) {
5008 Identifier_1_inherit_TYPE_descriptor(td);
5009 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
5010}
5011
5012asn_dec_rval_t
5013Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5014 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
5015 Identifier_1_inherit_TYPE_descriptor(td);
5016 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
5017}
5018
5019asn_enc_rval_t
5020Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
5021 int ilevel, enum xer_encoder_flags_e flags,
5022 asn_app_consume_bytes_f *cb, void *app_key) {
5023 Identifier_1_inherit_TYPE_descriptor(td);
5024 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
5025}
5026
5027asn_dec_rval_t
5028Identifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5029 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
5030 Identifier_1_inherit_TYPE_descriptor(td);
5031 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
5032}
5033
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005034asn_enc_rval_t
5035Identifier_encode_uper(asn_TYPE_descriptor_t *td,
5036 asn_per_constraints_t *constraints,
5037 void *structure, asn_per_outp_t *per_out) {
5038 Identifier_1_inherit_TYPE_descriptor(td);
5039 return td->uper_encoder(td, constraints, structure, per_out);
5040}
5041
Lev Walkin59b176e2005-11-26 11:25:14 +00005042
5043/*** <<< STAT-DEFS [Identifier] >>> ***/
5044
5045static ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
5046 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
5047};
5048static asn_per_constraints_t asn_PER_Identifier_constr_1 = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00005049 { APC_CONSTRAINED, 7, 7, 36, 122 } /* (36..122) */,
Lev Walkin59b176e2005-11-26 11:25:14 +00005050 { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */
5051};
5052asn_TYPE_descriptor_t asn_DEF_Identifier = {
5053 "Identifier",
5054 "Identifier",
5055 Identifier_free,
5056 Identifier_print,
5057 Identifier_constraint,
5058 Identifier_decode_ber,
5059 Identifier_encode_der,
5060 Identifier_decode_xer,
5061 Identifier_encode_xer,
5062 Identifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005063 Identifier_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00005064 0, /* Use generic outmost tag fetcher */
5065 asn_DEF_Identifier_tags_1,
5066 sizeof(asn_DEF_Identifier_tags_1)
5067 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
5068 asn_DEF_Identifier_tags_1, /* Same as above */
5069 sizeof(asn_DEF_Identifier_tags_1)
5070 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
5071 &asn_PER_Identifier_constr_1,
5072 0, 0, /* No members */
5073 0 /* No specifics */
5074};
5075