blob: 1764553249f60afc50202c7cf036ebcbaa0dbf89 [file] [log] [blame]
Lev Walkin59b176e2005-11-26 11:25:14 +00001
2/*** <<< INCLUDES [Int1] >>> ***/
3
Lev Walkin2a744a72013-03-27 01:56:23 -07004#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00005
6/*** <<< TYPE-DECLS [Int1] >>> ***/
7
Lev Walkin2a744a72013-03-27 01:56:23 -07008typedef long Int1_t;
Lev Walkin59b176e2005-11-26 11:25:14 +00009
10/*** <<< FUNC-DECLS [Int1] >>> ***/
11
12extern asn_TYPE_descriptor_t asn_DEF_Int1;
13asn_struct_free_f Int1_free;
14asn_struct_print_f Int1_print;
15asn_constr_check_f Int1_constraint;
16ber_type_decoder_f Int1_decode_ber;
17der_type_encoder_f Int1_encode_der;
18xer_type_decoder_f Int1_decode_xer;
19xer_type_encoder_f Int1_encode_xer;
20per_type_decoder_f Int1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000021per_type_encoder_f Int1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +000022
23/*** <<< CODE [Int1] >>> ***/
24
25int
26Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000027 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +000028 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -070029 td->check_constraints = asn_DEF_NativeInteger.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +000030 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +000031}
32
33/*
Lev Walkin2a744a72013-03-27 01:56:23 -070034 * This type is implemented using NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +000035 * so here we adjust the DEF accordingly.
36 */
37static void
38Int1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -070039 td->free_struct = asn_DEF_NativeInteger.free_struct;
40 td->print_struct = asn_DEF_NativeInteger.print_struct;
41 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
42 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
43 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
44 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
45 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
46 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +000047 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -070048 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
49 td->elements = asn_DEF_NativeInteger.elements;
50 td->elements_count = asn_DEF_NativeInteger.elements_count;
51 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin59b176e2005-11-26 11:25:14 +000052}
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 long value;
171
172 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000173 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000174 "%s: value not given (%s:%d)",
175 td->name, __FILE__, __LINE__);
176 return -1;
177 }
178
Lev Walkin2a744a72013-03-27 01:56:23 -0700179 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000180
181 if((value >= 0)) {
182 /* Constraint check succeeded */
183 return 0;
184 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000185 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000186 "%s: constraint failed (%s:%d)",
187 td->name, __FILE__, __LINE__);
188 return -1;
189 }
190}
191
192/*
193 * This type is implemented using Int1,
194 * so here we adjust the DEF accordingly.
195 */
196static void
197Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
198 td->free_struct = asn_DEF_Int1.free_struct;
199 td->print_struct = asn_DEF_Int1.print_struct;
200 td->ber_decoder = asn_DEF_Int1.ber_decoder;
201 td->der_encoder = asn_DEF_Int1.der_encoder;
202 td->xer_decoder = asn_DEF_Int1.xer_decoder;
203 td->xer_encoder = asn_DEF_Int1.xer_encoder;
204 td->uper_decoder = asn_DEF_Int1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000205 td->uper_encoder = asn_DEF_Int1.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000206 if(!td->per_constraints)
207 td->per_constraints = asn_DEF_Int1.per_constraints;
208 td->elements = asn_DEF_Int1.elements;
209 td->elements_count = asn_DEF_Int1.elements_count;
210 td->specifics = asn_DEF_Int1.specifics;
211}
212
213void
214Int2_free(asn_TYPE_descriptor_t *td,
215 void *struct_ptr, int contents_only) {
216 Int2_1_inherit_TYPE_descriptor(td);
217 td->free_struct(td, struct_ptr, contents_only);
218}
219
220int
221Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
222 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
223 Int2_1_inherit_TYPE_descriptor(td);
224 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
225}
226
227asn_dec_rval_t
228Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
229 void **structure, const void *bufptr, size_t size, int tag_mode) {
230 Int2_1_inherit_TYPE_descriptor(td);
231 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
232}
233
234asn_enc_rval_t
235Int2_encode_der(asn_TYPE_descriptor_t *td,
236 void *structure, int tag_mode, ber_tlv_tag_t tag,
237 asn_app_consume_bytes_f *cb, void *app_key) {
238 Int2_1_inherit_TYPE_descriptor(td);
239 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
240}
241
242asn_dec_rval_t
243Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
244 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
245 Int2_1_inherit_TYPE_descriptor(td);
246 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
247}
248
249asn_enc_rval_t
250Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
251 int ilevel, enum xer_encoder_flags_e flags,
252 asn_app_consume_bytes_f *cb, void *app_key) {
253 Int2_1_inherit_TYPE_descriptor(td);
254 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
255}
256
257asn_dec_rval_t
258Int2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
259 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
260 Int2_1_inherit_TYPE_descriptor(td);
261 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
262}
263
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000264asn_enc_rval_t
265Int2_encode_uper(asn_TYPE_descriptor_t *td,
266 asn_per_constraints_t *constraints,
267 void *structure, asn_per_outp_t *per_out) {
268 Int2_1_inherit_TYPE_descriptor(td);
269 return td->uper_encoder(td, constraints, structure, per_out);
270}
271
Lev Walkin59b176e2005-11-26 11:25:14 +0000272
Lev Walkin725883b2006-10-09 12:07:58 +0000273/*** <<< CTDEFS [Int2] >>> ***/
274
Lev Walkin4b5dae32006-10-09 12:27:44 +0000275static asn_per_constraints_t asn_PER_type_Int2_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +0000276 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */,
277 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
278 0, 0 /* No PER value map */
279};
280
Lev Walkin59b176e2005-11-26 11:25:14 +0000281/*** <<< STAT-DEFS [Int2] >>> ***/
282
283static ber_tlv_tag_t asn_DEF_Int2_tags_1[] = {
284 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
285};
Lev Walkin59b176e2005-11-26 11:25:14 +0000286asn_TYPE_descriptor_t asn_DEF_Int2 = {
287 "Int2",
288 "Int2",
289 Int2_free,
290 Int2_print,
291 Int2_constraint,
292 Int2_decode_ber,
293 Int2_encode_der,
294 Int2_decode_xer,
295 Int2_encode_xer,
296 Int2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000297 Int2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000298 0, /* Use generic outmost tag fetcher */
299 asn_DEF_Int2_tags_1,
300 sizeof(asn_DEF_Int2_tags_1)
301 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
302 asn_DEF_Int2_tags_1, /* Same as above */
303 sizeof(asn_DEF_Int2_tags_1)
304 /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000305 &asn_PER_type_Int2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000306 0, 0, /* No members */
307 0 /* No specifics */
308};
309
310
311/*** <<< INCLUDES [Int3] >>> ***/
312
Lev Walkin22b5ed42006-09-13 02:51:20 +0000313#include "Int2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000314
315/*** <<< TYPE-DECLS [Int3] >>> ***/
316
317typedef Int2_t Int3_t;
318
319/*** <<< FUNC-DECLS [Int3] >>> ***/
320
321extern asn_TYPE_descriptor_t asn_DEF_Int3;
322asn_struct_free_f Int3_free;
323asn_struct_print_f Int3_print;
324asn_constr_check_f Int3_constraint;
325ber_type_decoder_f Int3_decode_ber;
326der_type_encoder_f Int3_encode_der;
327xer_type_decoder_f Int3_decode_xer;
328xer_type_encoder_f Int3_encode_xer;
329per_type_decoder_f Int3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000330per_type_encoder_f Int3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000331
332/*** <<< CODE [Int3] >>> ***/
333
334int
335Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000336 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000337 long value;
338
339 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000340 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000341 "%s: value not given (%s:%d)",
342 td->name, __FILE__, __LINE__);
343 return -1;
344 }
345
Lev Walkin2a744a72013-03-27 01:56:23 -0700346 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000347
348 if((value >= 0 && value <= 10)) {
349 /* Constraint check succeeded */
350 return 0;
351 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000352 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000353 "%s: constraint failed (%s:%d)",
354 td->name, __FILE__, __LINE__);
355 return -1;
356 }
357}
358
359/*
360 * This type is implemented using Int2,
361 * so here we adjust the DEF accordingly.
362 */
363static void
364Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
365 td->free_struct = asn_DEF_Int2.free_struct;
366 td->print_struct = asn_DEF_Int2.print_struct;
367 td->ber_decoder = asn_DEF_Int2.ber_decoder;
368 td->der_encoder = asn_DEF_Int2.der_encoder;
369 td->xer_decoder = asn_DEF_Int2.xer_decoder;
370 td->xer_encoder = asn_DEF_Int2.xer_encoder;
371 td->uper_decoder = asn_DEF_Int2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000372 td->uper_encoder = asn_DEF_Int2.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000373 if(!td->per_constraints)
374 td->per_constraints = asn_DEF_Int2.per_constraints;
375 td->elements = asn_DEF_Int2.elements;
376 td->elements_count = asn_DEF_Int2.elements_count;
377 td->specifics = asn_DEF_Int2.specifics;
378}
379
380void
381Int3_free(asn_TYPE_descriptor_t *td,
382 void *struct_ptr, int contents_only) {
383 Int3_1_inherit_TYPE_descriptor(td);
384 td->free_struct(td, struct_ptr, contents_only);
385}
386
387int
388Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
389 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
390 Int3_1_inherit_TYPE_descriptor(td);
391 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
392}
393
394asn_dec_rval_t
395Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
396 void **structure, const void *bufptr, size_t size, int tag_mode) {
397 Int3_1_inherit_TYPE_descriptor(td);
398 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
399}
400
401asn_enc_rval_t
402Int3_encode_der(asn_TYPE_descriptor_t *td,
403 void *structure, int tag_mode, ber_tlv_tag_t tag,
404 asn_app_consume_bytes_f *cb, void *app_key) {
405 Int3_1_inherit_TYPE_descriptor(td);
406 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
407}
408
409asn_dec_rval_t
410Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
411 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
412 Int3_1_inherit_TYPE_descriptor(td);
413 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
414}
415
416asn_enc_rval_t
417Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
418 int ilevel, enum xer_encoder_flags_e flags,
419 asn_app_consume_bytes_f *cb, void *app_key) {
420 Int3_1_inherit_TYPE_descriptor(td);
421 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
422}
423
424asn_dec_rval_t
425Int3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
426 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
427 Int3_1_inherit_TYPE_descriptor(td);
428 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
429}
430
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000431asn_enc_rval_t
432Int3_encode_uper(asn_TYPE_descriptor_t *td,
433 asn_per_constraints_t *constraints,
434 void *structure, asn_per_outp_t *per_out) {
435 Int3_1_inherit_TYPE_descriptor(td);
436 return td->uper_encoder(td, constraints, structure, per_out);
437}
438
Lev Walkin59b176e2005-11-26 11:25:14 +0000439
Lev Walkin725883b2006-10-09 12:07:58 +0000440/*** <<< CTDEFS [Int3] >>> ***/
441
Lev Walkin4b5dae32006-10-09 12:27:44 +0000442static asn_per_constraints_t asn_PER_type_Int3_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +0000443 { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */,
444 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
445 0, 0 /* No PER value map */
446};
447
Lev Walkin59b176e2005-11-26 11:25:14 +0000448/*** <<< STAT-DEFS [Int3] >>> ***/
449
450static ber_tlv_tag_t asn_DEF_Int3_tags_1[] = {
451 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
452};
Lev Walkin59b176e2005-11-26 11:25:14 +0000453asn_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 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000472 &asn_PER_type_Int3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000473 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 long value;
505
506 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000507 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000508 "%s: value not given (%s:%d)",
509 td->name, __FILE__, __LINE__);
510 return -1;
511 }
512
Lev Walkin2a744a72013-03-27 01:56:23 -0700513 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000514
515 if((value >= 1 && value <= 10)) {
516 /* Constraint check succeeded */
517 return 0;
518 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000519 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000520 "%s: constraint failed (%s:%d)",
521 td->name, __FILE__, __LINE__);
522 return -1;
523 }
524}
525
526/*
527 * This type is implemented using Int3,
528 * so here we adjust the DEF accordingly.
529 */
530static void
531Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
532 td->free_struct = asn_DEF_Int3.free_struct;
533 td->print_struct = asn_DEF_Int3.print_struct;
534 td->ber_decoder = asn_DEF_Int3.ber_decoder;
535 td->der_encoder = asn_DEF_Int3.der_encoder;
536 td->xer_decoder = asn_DEF_Int3.xer_decoder;
537 td->xer_encoder = asn_DEF_Int3.xer_encoder;
538 td->uper_decoder = asn_DEF_Int3.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000539 td->uper_encoder = asn_DEF_Int3.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000540 if(!td->per_constraints)
541 td->per_constraints = asn_DEF_Int3.per_constraints;
542 td->elements = asn_DEF_Int3.elements;
543 td->elements_count = asn_DEF_Int3.elements_count;
544 td->specifics = asn_DEF_Int3.specifics;
545}
546
547void
548Int4_free(asn_TYPE_descriptor_t *td,
549 void *struct_ptr, int contents_only) {
550 Int4_1_inherit_TYPE_descriptor(td);
551 td->free_struct(td, struct_ptr, contents_only);
552}
553
554int
555Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
556 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
557 Int4_1_inherit_TYPE_descriptor(td);
558 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
559}
560
561asn_dec_rval_t
562Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
563 void **structure, const void *bufptr, size_t size, int tag_mode) {
564 Int4_1_inherit_TYPE_descriptor(td);
565 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
566}
567
568asn_enc_rval_t
569Int4_encode_der(asn_TYPE_descriptor_t *td,
570 void *structure, int tag_mode, ber_tlv_tag_t tag,
571 asn_app_consume_bytes_f *cb, void *app_key) {
572 Int4_1_inherit_TYPE_descriptor(td);
573 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
574}
575
576asn_dec_rval_t
577Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
578 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
579 Int4_1_inherit_TYPE_descriptor(td);
580 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
581}
582
583asn_enc_rval_t
584Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
585 int ilevel, enum xer_encoder_flags_e flags,
586 asn_app_consume_bytes_f *cb, void *app_key) {
587 Int4_1_inherit_TYPE_descriptor(td);
588 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
589}
590
591asn_dec_rval_t
592Int4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
593 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
594 Int4_1_inherit_TYPE_descriptor(td);
595 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
596}
597
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000598asn_enc_rval_t
599Int4_encode_uper(asn_TYPE_descriptor_t *td,
600 asn_per_constraints_t *constraints,
601 void *structure, asn_per_outp_t *per_out) {
602 Int4_1_inherit_TYPE_descriptor(td);
603 return td->uper_encoder(td, constraints, structure, per_out);
604}
605
Lev Walkin59b176e2005-11-26 11:25:14 +0000606
Lev Walkin725883b2006-10-09 12:07:58 +0000607/*** <<< CTDEFS [Int4] >>> ***/
608
Lev Walkin4b5dae32006-10-09 12:27:44 +0000609static asn_per_constraints_t asn_PER_type_Int4_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +0000610 { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */,
611 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
612 0, 0 /* No PER value map */
613};
614
Lev Walkin59b176e2005-11-26 11:25:14 +0000615/*** <<< STAT-DEFS [Int4] >>> ***/
616
617static ber_tlv_tag_t asn_DEF_Int4_tags_1[] = {
618 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
619};
Lev Walkin59b176e2005-11-26 11:25:14 +0000620asn_TYPE_descriptor_t asn_DEF_Int4 = {
621 "Int4",
622 "Int4",
623 Int4_free,
624 Int4_print,
625 Int4_constraint,
626 Int4_decode_ber,
627 Int4_encode_der,
628 Int4_decode_xer,
629 Int4_encode_xer,
630 Int4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000631 Int4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000632 0, /* Use generic outmost tag fetcher */
633 asn_DEF_Int4_tags_1,
634 sizeof(asn_DEF_Int4_tags_1)
635 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
636 asn_DEF_Int4_tags_1, /* Same as above */
637 sizeof(asn_DEF_Int4_tags_1)
638 /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000639 &asn_PER_type_Int4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000640 0, 0, /* No members */
641 0 /* No specifics */
642};
643
644
645/*** <<< INCLUDES [Int5] >>> ***/
646
Lev Walkin22b5ed42006-09-13 02:51:20 +0000647#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +0000648
649/*** <<< TYPE-DECLS [Int5] >>> ***/
650
651typedef Int4_t Int5_t;
652
653/*** <<< FUNC-DECLS [Int5] >>> ***/
654
655extern asn_TYPE_descriptor_t asn_DEF_Int5;
656asn_struct_free_f Int5_free;
657asn_struct_print_f Int5_print;
658asn_constr_check_f Int5_constraint;
659ber_type_decoder_f Int5_decode_ber;
660der_type_encoder_f Int5_encode_der;
661xer_type_decoder_f Int5_decode_xer;
662xer_type_encoder_f Int5_encode_xer;
663per_type_decoder_f Int5_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000664per_type_encoder_f Int5_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000665
666/*** <<< CODE [Int5] >>> ***/
667
668int
669Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000670 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000671 long value;
672
673 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000674 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000675 "%s: value not given (%s:%d)",
676 td->name, __FILE__, __LINE__);
677 return -1;
678 }
679
Lev Walkin2a744a72013-03-27 01:56:23 -0700680 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000681
682 if((value == 5)) {
683 /* Constraint check succeeded */
684 return 0;
685 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000686 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000687 "%s: constraint failed (%s:%d)",
688 td->name, __FILE__, __LINE__);
689 return -1;
690 }
691}
692
693/*
694 * This type is implemented using Int4,
695 * so here we adjust the DEF accordingly.
696 */
697static void
698Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
699 td->free_struct = asn_DEF_Int4.free_struct;
700 td->print_struct = asn_DEF_Int4.print_struct;
701 td->ber_decoder = asn_DEF_Int4.ber_decoder;
702 td->der_encoder = asn_DEF_Int4.der_encoder;
703 td->xer_decoder = asn_DEF_Int4.xer_decoder;
704 td->xer_encoder = asn_DEF_Int4.xer_encoder;
705 td->uper_decoder = asn_DEF_Int4.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000706 td->uper_encoder = asn_DEF_Int4.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000707 if(!td->per_constraints)
708 td->per_constraints = asn_DEF_Int4.per_constraints;
709 td->elements = asn_DEF_Int4.elements;
710 td->elements_count = asn_DEF_Int4.elements_count;
711 td->specifics = asn_DEF_Int4.specifics;
712}
713
714void
715Int5_free(asn_TYPE_descriptor_t *td,
716 void *struct_ptr, int contents_only) {
717 Int5_1_inherit_TYPE_descriptor(td);
718 td->free_struct(td, struct_ptr, contents_only);
719}
720
721int
722Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
723 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
724 Int5_1_inherit_TYPE_descriptor(td);
725 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
726}
727
728asn_dec_rval_t
729Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
730 void **structure, const void *bufptr, size_t size, int tag_mode) {
731 Int5_1_inherit_TYPE_descriptor(td);
732 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
733}
734
735asn_enc_rval_t
736Int5_encode_der(asn_TYPE_descriptor_t *td,
737 void *structure, int tag_mode, ber_tlv_tag_t tag,
738 asn_app_consume_bytes_f *cb, void *app_key) {
739 Int5_1_inherit_TYPE_descriptor(td);
740 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
741}
742
743asn_dec_rval_t
744Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
745 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
746 Int5_1_inherit_TYPE_descriptor(td);
747 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
748}
749
750asn_enc_rval_t
751Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
752 int ilevel, enum xer_encoder_flags_e flags,
753 asn_app_consume_bytes_f *cb, void *app_key) {
754 Int5_1_inherit_TYPE_descriptor(td);
755 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
756}
757
758asn_dec_rval_t
759Int5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
760 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
761 Int5_1_inherit_TYPE_descriptor(td);
762 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
763}
764
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000765asn_enc_rval_t
766Int5_encode_uper(asn_TYPE_descriptor_t *td,
767 asn_per_constraints_t *constraints,
768 void *structure, asn_per_outp_t *per_out) {
769 Int5_1_inherit_TYPE_descriptor(td);
770 return td->uper_encoder(td, constraints, structure, per_out);
771}
772
Lev Walkin59b176e2005-11-26 11:25:14 +0000773
Lev Walkin725883b2006-10-09 12:07:58 +0000774/*** <<< CTDEFS [Int5] >>> ***/
775
Lev Walkin4b5dae32006-10-09 12:27:44 +0000776static asn_per_constraints_t asn_PER_type_Int5_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +0000777 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
778 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
779 0, 0 /* No PER value map */
780};
781
Lev Walkin59b176e2005-11-26 11:25:14 +0000782/*** <<< STAT-DEFS [Int5] >>> ***/
783
784static ber_tlv_tag_t asn_DEF_Int5_tags_1[] = {
785 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
786};
Lev Walkin59b176e2005-11-26 11:25:14 +0000787asn_TYPE_descriptor_t asn_DEF_Int5 = {
788 "Int5",
789 "Int5",
790 Int5_free,
791 Int5_print,
792 Int5_constraint,
793 Int5_decode_ber,
794 Int5_encode_der,
795 Int5_decode_xer,
796 Int5_encode_xer,
797 Int5_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000798 Int5_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000799 0, /* Use generic outmost tag fetcher */
800 asn_DEF_Int5_tags_1,
801 sizeof(asn_DEF_Int5_tags_1)
802 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
803 asn_DEF_Int5_tags_1, /* Same as above */
804 sizeof(asn_DEF_Int5_tags_1)
805 /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000806 &asn_PER_type_Int5_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000807 0, 0, /* No members */
808 0 /* No specifics */
809};
810
811
812/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
813
Lev Walkin2a744a72013-03-27 01:56:23 -0700814#include <NativeInteger.h>
Lev Walkin59b176e2005-11-26 11:25:14 +0000815
816/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
817
Lev Walkin2a744a72013-03-27 01:56:23 -0700818typedef long ExtensibleExtensions_t;
Lev Walkin59b176e2005-11-26 11:25:14 +0000819
820/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
821
822extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
823asn_struct_free_f ExtensibleExtensions_free;
824asn_struct_print_f ExtensibleExtensions_print;
825asn_constr_check_f ExtensibleExtensions_constraint;
826ber_type_decoder_f ExtensibleExtensions_decode_ber;
827der_type_encoder_f ExtensibleExtensions_encode_der;
828xer_type_decoder_f ExtensibleExtensions_decode_xer;
829xer_type_encoder_f ExtensibleExtensions_encode_xer;
830per_type_decoder_f ExtensibleExtensions_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000831per_type_encoder_f ExtensibleExtensions_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000832
833/*** <<< CODE [ExtensibleExtensions] >>> ***/
834
835int
836ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000837 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000838 long value;
839
840 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000841 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000842 "%s: value not given (%s:%d)",
843 td->name, __FILE__, __LINE__);
844 return -1;
845 }
846
Lev Walkin2a744a72013-03-27 01:56:23 -0700847 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +0000848
849 if((value >= 1 && value <= 256)) {
850 /* Constraint check succeeded */
851 return 0;
852 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000853 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +0000854 "%s: constraint failed (%s:%d)",
855 td->name, __FILE__, __LINE__);
856 return -1;
857 }
858}
859
860/*
Lev Walkin2a744a72013-03-27 01:56:23 -0700861 * This type is implemented using NativeInteger,
Lev Walkin59b176e2005-11-26 11:25:14 +0000862 * so here we adjust the DEF accordingly.
863 */
864static void
865ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -0700866 td->free_struct = asn_DEF_NativeInteger.free_struct;
867 td->print_struct = asn_DEF_NativeInteger.print_struct;
868 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
869 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
870 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
871 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
872 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
873 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000874 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -0700875 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
876 td->elements = asn_DEF_NativeInteger.elements;
877 td->elements_count = asn_DEF_NativeInteger.elements_count;
878 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin59b176e2005-11-26 11:25:14 +0000879}
880
881void
882ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
883 void *struct_ptr, int contents_only) {
884 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
885 td->free_struct(td, struct_ptr, contents_only);
886}
887
888int
889ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
890 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
891 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
892 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
893}
894
895asn_dec_rval_t
896ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
897 void **structure, const void *bufptr, size_t size, int tag_mode) {
898 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
899 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
900}
901
902asn_enc_rval_t
903ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
904 void *structure, int tag_mode, ber_tlv_tag_t tag,
905 asn_app_consume_bytes_f *cb, void *app_key) {
906 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
907 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
908}
909
910asn_dec_rval_t
911ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
912 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
913 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
914 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
915}
916
917asn_enc_rval_t
918ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
919 int ilevel, enum xer_encoder_flags_e flags,
920 asn_app_consume_bytes_f *cb, void *app_key) {
921 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
922 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
923}
924
925asn_dec_rval_t
926ExtensibleExtensions_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
927 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
928 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
929 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
930}
931
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000932asn_enc_rval_t
933ExtensibleExtensions_encode_uper(asn_TYPE_descriptor_t *td,
934 asn_per_constraints_t *constraints,
935 void *structure, asn_per_outp_t *per_out) {
936 ExtensibleExtensions_1_inherit_TYPE_descriptor(td);
937 return td->uper_encoder(td, constraints, structure, per_out);
938}
939
Lev Walkin59b176e2005-11-26 11:25:14 +0000940
Lev Walkin725883b2006-10-09 12:07:58 +0000941/*** <<< CTDEFS [ExtensibleExtensions] >>> ***/
942
Lev Walkin4b5dae32006-10-09 12:27:44 +0000943static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +0000944 { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */,
945 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
946 0, 0 /* No PER value map */
947};
948
Lev Walkin59b176e2005-11-26 11:25:14 +0000949/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
950
951static ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = {
952 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
953};
Lev Walkin59b176e2005-11-26 11:25:14 +0000954asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
955 "ExtensibleExtensions",
956 "ExtensibleExtensions",
957 ExtensibleExtensions_free,
958 ExtensibleExtensions_print,
959 ExtensibleExtensions_constraint,
960 ExtensibleExtensions_decode_ber,
961 ExtensibleExtensions_encode_der,
962 ExtensibleExtensions_decode_xer,
963 ExtensibleExtensions_encode_xer,
964 ExtensibleExtensions_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000965 ExtensibleExtensions_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +0000966 0, /* Use generic outmost tag fetcher */
967 asn_DEF_ExtensibleExtensions_tags_1,
968 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
969 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
970 asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */
971 sizeof(asn_DEF_ExtensibleExtensions_tags_1)
972 /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +0000973 &asn_PER_type_ExtensibleExtensions_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +0000974 0, 0, /* No members */
975 0 /* No specifics */
976};
977
978
979/*** <<< INCLUDES [Str1] >>> ***/
980
981#include <IA5String.h>
982
983/*** <<< TYPE-DECLS [Str1] >>> ***/
984
985typedef IA5String_t Str1_t;
986
987/*** <<< FUNC-DECLS [Str1] >>> ***/
988
989extern asn_TYPE_descriptor_t asn_DEF_Str1;
990asn_struct_free_f Str1_free;
991asn_struct_print_f Str1_print;
992asn_constr_check_f Str1_constraint;
993ber_type_decoder_f Str1_decode_ber;
994der_type_encoder_f Str1_encode_der;
995xer_type_decoder_f Str1_decode_xer;
996xer_type_encoder_f Str1_encode_xer;
997per_type_decoder_f Str1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000998per_type_encoder_f Str1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +0000999
1000/*** <<< CODE [Str1] >>> ***/
1001
1002int
1003Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001004 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001005 /* Replace with underlying type checker */
1006 td->check_constraints = asn_DEF_IA5String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00001007 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00001008}
1009
1010/*
1011 * This type is implemented using IA5String,
1012 * so here we adjust the DEF accordingly.
1013 */
1014static void
1015Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1016 td->free_struct = asn_DEF_IA5String.free_struct;
1017 td->print_struct = asn_DEF_IA5String.print_struct;
1018 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1019 td->der_encoder = asn_DEF_IA5String.der_encoder;
1020 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1021 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1022 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001023 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001024 if(!td->per_constraints)
1025 td->per_constraints = asn_DEF_IA5String.per_constraints;
1026 td->elements = asn_DEF_IA5String.elements;
1027 td->elements_count = asn_DEF_IA5String.elements_count;
1028 td->specifics = asn_DEF_IA5String.specifics;
1029}
1030
1031void
1032Str1_free(asn_TYPE_descriptor_t *td,
1033 void *struct_ptr, int contents_only) {
1034 Str1_1_inherit_TYPE_descriptor(td);
1035 td->free_struct(td, struct_ptr, contents_only);
1036}
1037
1038int
1039Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1040 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1041 Str1_1_inherit_TYPE_descriptor(td);
1042 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1043}
1044
1045asn_dec_rval_t
1046Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1047 void **structure, const void *bufptr, size_t size, int tag_mode) {
1048 Str1_1_inherit_TYPE_descriptor(td);
1049 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1050}
1051
1052asn_enc_rval_t
1053Str1_encode_der(asn_TYPE_descriptor_t *td,
1054 void *structure, int tag_mode, ber_tlv_tag_t tag,
1055 asn_app_consume_bytes_f *cb, void *app_key) {
1056 Str1_1_inherit_TYPE_descriptor(td);
1057 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1058}
1059
1060asn_dec_rval_t
1061Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1062 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1063 Str1_1_inherit_TYPE_descriptor(td);
1064 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1065}
1066
1067asn_enc_rval_t
1068Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1069 int ilevel, enum xer_encoder_flags_e flags,
1070 asn_app_consume_bytes_f *cb, void *app_key) {
1071 Str1_1_inherit_TYPE_descriptor(td);
1072 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1073}
1074
1075asn_dec_rval_t
1076Str1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1077 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1078 Str1_1_inherit_TYPE_descriptor(td);
1079 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1080}
1081
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001082asn_enc_rval_t
1083Str1_encode_uper(asn_TYPE_descriptor_t *td,
1084 asn_per_constraints_t *constraints,
1085 void *structure, asn_per_outp_t *per_out) {
1086 Str1_1_inherit_TYPE_descriptor(td);
1087 return td->uper_encoder(td, constraints, structure, per_out);
1088}
1089
Lev Walkin59b176e2005-11-26 11:25:14 +00001090
1091/*** <<< STAT-DEFS [Str1] >>> ***/
1092
1093static ber_tlv_tag_t asn_DEF_Str1_tags_1[] = {
1094 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1095};
1096asn_TYPE_descriptor_t asn_DEF_Str1 = {
1097 "Str1",
1098 "Str1",
1099 Str1_free,
1100 Str1_print,
1101 Str1_constraint,
1102 Str1_decode_ber,
1103 Str1_encode_der,
1104 Str1_decode_xer,
1105 Str1_encode_xer,
1106 Str1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001107 Str1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001108 0, /* Use generic outmost tag fetcher */
1109 asn_DEF_Str1_tags_1,
1110 sizeof(asn_DEF_Str1_tags_1)
1111 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1112 asn_DEF_Str1_tags_1, /* Same as above */
1113 sizeof(asn_DEF_Str1_tags_1)
1114 /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */
1115 0, /* No PER visible constraints */
1116 0, 0, /* No members */
1117 0 /* No specifics */
1118};
1119
1120
1121/*** <<< INCLUDES [Str2] >>> ***/
1122
Lev Walkin22b5ed42006-09-13 02:51:20 +00001123#include "Str1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001124
1125/*** <<< TYPE-DECLS [Str2] >>> ***/
1126
1127typedef Str1_t Str2_t;
1128
1129/*** <<< FUNC-DECLS [Str2] >>> ***/
1130
1131extern asn_TYPE_descriptor_t asn_DEF_Str2;
1132asn_struct_free_f Str2_free;
1133asn_struct_print_f Str2_print;
1134asn_constr_check_f Str2_constraint;
1135ber_type_decoder_f Str2_decode_ber;
1136der_type_encoder_f Str2_encode_der;
1137xer_type_decoder_f Str2_decode_xer;
1138xer_type_encoder_f Str2_encode_xer;
1139per_type_decoder_f Str2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001140per_type_encoder_f Str2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001141
1142/*** <<< CTABLES [Str2] >>> ***/
1143
1144static int check_permitted_alphabet_1(const void *sptr) {
1145 /* The underlying type is IA5String */
1146 const IA5String_t *st = (const IA5String_t *)sptr;
1147 const uint8_t *ch = st->buf;
1148 const uint8_t *end = ch + st->size;
1149
1150 for(; ch < end; ch++) {
1151 uint8_t cv = *ch;
1152 if(!(cv <= 127)) return -1;
1153 }
1154 return 0;
1155}
1156
1157
1158/*** <<< CODE [Str2] >>> ***/
1159
1160int
1161Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001162 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001163 const Str1_t *st = (const Str1_t *)sptr;
1164 size_t size;
1165
1166 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001167 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001168 "%s: value not given (%s:%d)",
1169 td->name, __FILE__, __LINE__);
1170 return -1;
1171 }
1172
1173 size = st->size;
1174
1175 if(((size <= 20) || (size >= 25 && size <= 30))
1176 && !check_permitted_alphabet_1(st)) {
1177 /* Constraint check succeeded */
1178 return 0;
1179 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001180 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001181 "%s: constraint failed (%s:%d)",
1182 td->name, __FILE__, __LINE__);
1183 return -1;
1184 }
1185}
1186
1187/*
1188 * This type is implemented using Str1,
1189 * so here we adjust the DEF accordingly.
1190 */
1191static void
1192Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1193 td->free_struct = asn_DEF_Str1.free_struct;
1194 td->print_struct = asn_DEF_Str1.print_struct;
1195 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1196 td->der_encoder = asn_DEF_Str1.der_encoder;
1197 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1198 td->xer_encoder = asn_DEF_Str1.xer_encoder;
1199 td->uper_decoder = asn_DEF_Str1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001200 td->uper_encoder = asn_DEF_Str1.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001201 if(!td->per_constraints)
1202 td->per_constraints = asn_DEF_Str1.per_constraints;
1203 td->elements = asn_DEF_Str1.elements;
1204 td->elements_count = asn_DEF_Str1.elements_count;
1205 td->specifics = asn_DEF_Str1.specifics;
1206}
1207
1208void
1209Str2_free(asn_TYPE_descriptor_t *td,
1210 void *struct_ptr, int contents_only) {
1211 Str2_1_inherit_TYPE_descriptor(td);
1212 td->free_struct(td, struct_ptr, contents_only);
1213}
1214
1215int
1216Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1217 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1218 Str2_1_inherit_TYPE_descriptor(td);
1219 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1220}
1221
1222asn_dec_rval_t
1223Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1224 void **structure, const void *bufptr, size_t size, int tag_mode) {
1225 Str2_1_inherit_TYPE_descriptor(td);
1226 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1227}
1228
1229asn_enc_rval_t
1230Str2_encode_der(asn_TYPE_descriptor_t *td,
1231 void *structure, int tag_mode, ber_tlv_tag_t tag,
1232 asn_app_consume_bytes_f *cb, void *app_key) {
1233 Str2_1_inherit_TYPE_descriptor(td);
1234 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1235}
1236
1237asn_dec_rval_t
1238Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1239 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1240 Str2_1_inherit_TYPE_descriptor(td);
1241 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1242}
1243
1244asn_enc_rval_t
1245Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1246 int ilevel, enum xer_encoder_flags_e flags,
1247 asn_app_consume_bytes_f *cb, void *app_key) {
1248 Str2_1_inherit_TYPE_descriptor(td);
1249 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1250}
1251
1252asn_dec_rval_t
1253Str2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1254 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1255 Str2_1_inherit_TYPE_descriptor(td);
1256 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1257}
1258
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001259asn_enc_rval_t
1260Str2_encode_uper(asn_TYPE_descriptor_t *td,
1261 asn_per_constraints_t *constraints,
1262 void *structure, asn_per_outp_t *per_out) {
1263 Str2_1_inherit_TYPE_descriptor(td);
1264 return td->uper_encoder(td, constraints, structure, per_out);
1265}
1266
Lev Walkin59b176e2005-11-26 11:25:14 +00001267
Lev Walkin725883b2006-10-09 12:07:58 +00001268/*** <<< CTDEFS [Str2] >>> ***/
1269
Lev Walkin4b5dae32006-10-09 12:27:44 +00001270static asn_per_constraints_t asn_PER_type_Str2_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00001271 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1272 { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */,
1273 0, 0 /* No PER character map necessary */
1274};
1275
Lev Walkin59b176e2005-11-26 11:25:14 +00001276/*** <<< STAT-DEFS [Str2] >>> ***/
1277
1278static ber_tlv_tag_t asn_DEF_Str2_tags_1[] = {
1279 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1280};
Lev Walkin59b176e2005-11-26 11:25:14 +00001281asn_TYPE_descriptor_t asn_DEF_Str2 = {
1282 "Str2",
1283 "Str2",
1284 Str2_free,
1285 Str2_print,
1286 Str2_constraint,
1287 Str2_decode_ber,
1288 Str2_encode_der,
1289 Str2_decode_xer,
1290 Str2_encode_xer,
1291 Str2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001292 Str2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001293 0, /* Use generic outmost tag fetcher */
1294 asn_DEF_Str2_tags_1,
1295 sizeof(asn_DEF_Str2_tags_1)
1296 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
1297 asn_DEF_Str2_tags_1, /* Same as above */
1298 sizeof(asn_DEF_Str2_tags_1)
1299 /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001300 &asn_PER_type_Str2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001301 0, 0, /* No members */
1302 0 /* No specifics */
1303};
1304
1305
1306/*** <<< INCLUDES [Str3] >>> ***/
1307
Lev Walkin22b5ed42006-09-13 02:51:20 +00001308#include "Str2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001309
1310/*** <<< TYPE-DECLS [Str3] >>> ***/
1311
1312typedef Str2_t Str3_t;
1313
1314/*** <<< FUNC-DECLS [Str3] >>> ***/
1315
1316extern asn_TYPE_descriptor_t asn_DEF_Str3;
1317asn_struct_free_f Str3_free;
1318asn_struct_print_f Str3_print;
1319asn_constr_check_f Str3_constraint;
1320ber_type_decoder_f Str3_decode_ber;
1321der_type_encoder_f Str3_encode_der;
1322xer_type_decoder_f Str3_decode_xer;
1323xer_type_encoder_f Str3_encode_xer;
1324per_type_decoder_f Str3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001325per_type_encoder_f Str3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001326
1327/*** <<< CTABLES [Str3] >>> ***/
1328
1329static int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00001330 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1331 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1332 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, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */
1335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1336 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */
Lev Walkin59b176e2005-11-26 11:25:14 +00001337};
Lev Walkin5b62ca82006-09-21 01:52:07 +00001338static int permitted_alphabet_code2value_1[6] = {
133965,66,67,100,101,102,};
1340
Lev Walkin59b176e2005-11-26 11:25:14 +00001341
1342static int check_permitted_alphabet_1(const void *sptr) {
1343 int *table = permitted_alphabet_table_1;
1344 /* The underlying type is IA5String */
1345 const IA5String_t *st = (const IA5String_t *)sptr;
1346 const uint8_t *ch = st->buf;
1347 const uint8_t *end = ch + st->size;
1348
1349 for(; ch < end; ch++) {
1350 uint8_t cv = *ch;
1351 if(!table[cv]) return -1;
1352 }
1353 return 0;
1354}
1355
1356
1357/*** <<< CODE [Str3] >>> ***/
1358
1359int
1360Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001361 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001362 const Str2_t *st = (const Str2_t *)sptr;
1363 size_t size;
1364
1365 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001366 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001367 "%s: value not given (%s:%d)",
1368 td->name, __FILE__, __LINE__);
1369 return -1;
1370 }
1371
1372 size = st->size;
1373
1374 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
1375 && !check_permitted_alphabet_1(st)) {
1376 /* Constraint check succeeded */
1377 return 0;
1378 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001379 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001380 "%s: constraint failed (%s:%d)",
1381 td->name, __FILE__, __LINE__);
1382 return -1;
1383 }
1384}
1385
Lev Walkin725883b2006-10-09 12:07:58 +00001386static int asn_PER_MAP_Str3_1_v2c(unsigned int value) {
1387 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
1388 return -1;
1389 return permitted_alphabet_table_1[value] - 1;
1390}
1391static int asn_PER_MAP_Str3_1_c2v(unsigned int code) {
1392 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
1393 return -1;
1394 return permitted_alphabet_code2value_1[code];
1395}
Lev Walkin59b176e2005-11-26 11:25:14 +00001396/*
1397 * This type is implemented using Str2,
1398 * so here we adjust the DEF accordingly.
1399 */
1400static void
1401Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1402 td->free_struct = asn_DEF_Str2.free_struct;
1403 td->print_struct = asn_DEF_Str2.print_struct;
1404 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1405 td->der_encoder = asn_DEF_Str2.der_encoder;
1406 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1407 td->xer_encoder = asn_DEF_Str2.xer_encoder;
1408 td->uper_decoder = asn_DEF_Str2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001409 td->uper_encoder = asn_DEF_Str2.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001410 if(!td->per_constraints)
1411 td->per_constraints = asn_DEF_Str2.per_constraints;
1412 td->elements = asn_DEF_Str2.elements;
1413 td->elements_count = asn_DEF_Str2.elements_count;
1414 td->specifics = asn_DEF_Str2.specifics;
1415}
1416
1417void
1418Str3_free(asn_TYPE_descriptor_t *td,
1419 void *struct_ptr, int contents_only) {
1420 Str3_1_inherit_TYPE_descriptor(td);
1421 td->free_struct(td, struct_ptr, contents_only);
1422}
1423
1424int
1425Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1426 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1427 Str3_1_inherit_TYPE_descriptor(td);
1428 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1429}
1430
1431asn_dec_rval_t
1432Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1433 void **structure, const void *bufptr, size_t size, int tag_mode) {
1434 Str3_1_inherit_TYPE_descriptor(td);
1435 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1436}
1437
1438asn_enc_rval_t
1439Str3_encode_der(asn_TYPE_descriptor_t *td,
1440 void *structure, int tag_mode, ber_tlv_tag_t tag,
1441 asn_app_consume_bytes_f *cb, void *app_key) {
1442 Str3_1_inherit_TYPE_descriptor(td);
1443 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1444}
1445
1446asn_dec_rval_t
1447Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1448 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1449 Str3_1_inherit_TYPE_descriptor(td);
1450 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1451}
1452
1453asn_enc_rval_t
1454Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1455 int ilevel, enum xer_encoder_flags_e flags,
1456 asn_app_consume_bytes_f *cb, void *app_key) {
1457 Str3_1_inherit_TYPE_descriptor(td);
1458 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1459}
1460
1461asn_dec_rval_t
1462Str3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1463 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1464 Str3_1_inherit_TYPE_descriptor(td);
1465 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1466}
1467
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001468asn_enc_rval_t
1469Str3_encode_uper(asn_TYPE_descriptor_t *td,
1470 asn_per_constraints_t *constraints,
1471 void *structure, asn_per_outp_t *per_out) {
1472 Str3_1_inherit_TYPE_descriptor(td);
1473 return td->uper_encoder(td, constraints, structure, per_out);
1474}
1475
Lev Walkin59b176e2005-11-26 11:25:14 +00001476
Lev Walkin725883b2006-10-09 12:07:58 +00001477/*** <<< CTDEFS [Str3] >>> ***/
1478
Lev Walkin4b5dae32006-10-09 12:27:44 +00001479static asn_per_constraints_t asn_PER_type_Str3_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00001480 { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */,
1481 { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */,
1482 asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */
1483 asn_PER_MAP_Str3_1_c2v /* PER code to value map */
1484};
1485
Lev Walkin59b176e2005-11-26 11:25:14 +00001486/*** <<< STAT-DEFS [Str3] >>> ***/
1487
1488static ber_tlv_tag_t asn_DEF_Str3_tags_1[] = {
1489 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1490};
Lev Walkin59b176e2005-11-26 11:25:14 +00001491asn_TYPE_descriptor_t asn_DEF_Str3 = {
1492 "Str3",
1493 "Str3",
1494 Str3_free,
1495 Str3_print,
1496 Str3_constraint,
1497 Str3_decode_ber,
1498 Str3_encode_der,
1499 Str3_decode_xer,
1500 Str3_encode_xer,
1501 Str3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001502 Str3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001503 0, /* Use generic outmost tag fetcher */
1504 asn_DEF_Str3_tags_1,
1505 sizeof(asn_DEF_Str3_tags_1)
1506 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
1507 asn_DEF_Str3_tags_1, /* Same as above */
1508 sizeof(asn_DEF_Str3_tags_1)
1509 /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001510 &asn_PER_type_Str3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001511 0, 0, /* No members */
1512 0 /* No specifics */
1513};
1514
1515
1516/*** <<< INCLUDES [Str4] >>> ***/
1517
1518#include <IA5String.h>
1519
1520/*** <<< TYPE-DECLS [Str4] >>> ***/
1521
1522typedef IA5String_t Str4_t;
1523
1524/*** <<< FUNC-DECLS [Str4] >>> ***/
1525
1526extern asn_TYPE_descriptor_t asn_DEF_Str4;
1527asn_struct_free_f Str4_free;
1528asn_struct_print_f Str4_print;
1529asn_constr_check_f Str4_constraint;
1530ber_type_decoder_f Str4_decode_ber;
1531der_type_encoder_f Str4_encode_der;
1532xer_type_decoder_f Str4_decode_xer;
1533xer_type_encoder_f Str4_encode_xer;
1534per_type_decoder_f Str4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001535per_type_encoder_f Str4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001536
1537/*** <<< CTABLES [Str4] >>> ***/
1538
1539static int check_permitted_alphabet_1(const void *sptr) {
1540 /* The underlying type is IA5String */
1541 const IA5String_t *st = (const IA5String_t *)sptr;
1542 const uint8_t *ch = st->buf;
1543 const uint8_t *end = ch + st->size;
1544
1545 for(; ch < end; ch++) {
1546 uint8_t cv = *ch;
1547 if(!(cv <= 127)) return -1;
1548 }
1549 return 0;
1550}
1551
1552
1553/*** <<< CODE [Str4] >>> ***/
1554
1555int
1556Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001557 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001558 const IA5String_t *st = (const IA5String_t *)sptr;
1559
1560 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001561 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001562 "%s: value not given (%s:%d)",
1563 td->name, __FILE__, __LINE__);
1564 return -1;
1565 }
1566
1567
1568 if(!check_permitted_alphabet_1(st)) {
1569 /* Constraint check succeeded */
1570 return 0;
1571 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001572 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001573 "%s: constraint failed (%s:%d)",
1574 td->name, __FILE__, __LINE__);
1575 return -1;
1576 }
1577}
1578
1579/*
1580 * This type is implemented using IA5String,
1581 * so here we adjust the DEF accordingly.
1582 */
1583static void
1584Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1585 td->free_struct = asn_DEF_IA5String.free_struct;
1586 td->print_struct = asn_DEF_IA5String.print_struct;
1587 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1588 td->der_encoder = asn_DEF_IA5String.der_encoder;
1589 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1590 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1591 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001592 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001593 if(!td->per_constraints)
1594 td->per_constraints = asn_DEF_IA5String.per_constraints;
1595 td->elements = asn_DEF_IA5String.elements;
1596 td->elements_count = asn_DEF_IA5String.elements_count;
1597 td->specifics = asn_DEF_IA5String.specifics;
1598}
1599
1600void
1601Str4_free(asn_TYPE_descriptor_t *td,
1602 void *struct_ptr, int contents_only) {
1603 Str4_1_inherit_TYPE_descriptor(td);
1604 td->free_struct(td, struct_ptr, contents_only);
1605}
1606
1607int
1608Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1609 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1610 Str4_1_inherit_TYPE_descriptor(td);
1611 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1612}
1613
1614asn_dec_rval_t
1615Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1616 void **structure, const void *bufptr, size_t size, int tag_mode) {
1617 Str4_1_inherit_TYPE_descriptor(td);
1618 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1619}
1620
1621asn_enc_rval_t
1622Str4_encode_der(asn_TYPE_descriptor_t *td,
1623 void *structure, int tag_mode, ber_tlv_tag_t tag,
1624 asn_app_consume_bytes_f *cb, void *app_key) {
1625 Str4_1_inherit_TYPE_descriptor(td);
1626 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1627}
1628
1629asn_dec_rval_t
1630Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1631 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1632 Str4_1_inherit_TYPE_descriptor(td);
1633 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1634}
1635
1636asn_enc_rval_t
1637Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1638 int ilevel, enum xer_encoder_flags_e flags,
1639 asn_app_consume_bytes_f *cb, void *app_key) {
1640 Str4_1_inherit_TYPE_descriptor(td);
1641 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1642}
1643
1644asn_dec_rval_t
1645Str4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1646 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1647 Str4_1_inherit_TYPE_descriptor(td);
1648 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1649}
1650
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001651asn_enc_rval_t
1652Str4_encode_uper(asn_TYPE_descriptor_t *td,
1653 asn_per_constraints_t *constraints,
1654 void *structure, asn_per_outp_t *per_out) {
1655 Str4_1_inherit_TYPE_descriptor(td);
1656 return td->uper_encoder(td, constraints, structure, per_out);
1657}
1658
Lev Walkin59b176e2005-11-26 11:25:14 +00001659
Lev Walkin725883b2006-10-09 12:07:58 +00001660/*** <<< CTDEFS [Str4] >>> ***/
1661
Lev Walkin4b5dae32006-10-09 12:27:44 +00001662static asn_per_constraints_t asn_PER_type_Str4_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00001663 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
1664 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1665 0, 0 /* No PER character map necessary */
1666};
1667
Lev Walkin59b176e2005-11-26 11:25:14 +00001668/*** <<< STAT-DEFS [Str4] >>> ***/
1669
1670static ber_tlv_tag_t asn_DEF_Str4_tags_1[] = {
1671 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1672};
Lev Walkin59b176e2005-11-26 11:25:14 +00001673asn_TYPE_descriptor_t asn_DEF_Str4 = {
1674 "Str4",
1675 "Str4",
1676 Str4_free,
1677 Str4_print,
1678 Str4_constraint,
1679 Str4_decode_ber,
1680 Str4_encode_der,
1681 Str4_decode_xer,
1682 Str4_encode_xer,
1683 Str4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001684 Str4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001685 0, /* Use generic outmost tag fetcher */
1686 asn_DEF_Str4_tags_1,
1687 sizeof(asn_DEF_Str4_tags_1)
1688 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
1689 asn_DEF_Str4_tags_1, /* Same as above */
1690 sizeof(asn_DEF_Str4_tags_1)
1691 /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001692 &asn_PER_type_Str4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001693 0, 0, /* No members */
1694 0 /* No specifics */
1695};
1696
1697
1698/*** <<< INCLUDES [PER-Visible] >>> ***/
1699
1700#include <IA5String.h>
1701
1702/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1703
1704typedef IA5String_t PER_Visible_t;
1705
1706/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1707
1708extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
1709asn_struct_free_f PER_Visible_free;
1710asn_struct_print_f PER_Visible_print;
1711asn_constr_check_f PER_Visible_constraint;
1712ber_type_decoder_f PER_Visible_decode_ber;
1713der_type_encoder_f PER_Visible_encode_der;
1714xer_type_decoder_f PER_Visible_decode_xer;
1715xer_type_encoder_f PER_Visible_encode_xer;
1716per_type_decoder_f PER_Visible_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001717per_type_encoder_f PER_Visible_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001718
1719/*** <<< CTABLES [PER-Visible] >>> ***/
1720
1721static int check_permitted_alphabet_1(const void *sptr) {
1722 /* The underlying type is IA5String */
1723 const IA5String_t *st = (const IA5String_t *)sptr;
1724 const uint8_t *ch = st->buf;
1725 const uint8_t *end = ch + st->size;
1726
1727 for(; ch < end; ch++) {
1728 uint8_t cv = *ch;
1729 if(!(cv >= 65 && cv <= 70)) return -1;
1730 }
1731 return 0;
1732}
1733
1734
1735/*** <<< CODE [PER-Visible] >>> ***/
1736
1737int
1738PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001739 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001740 const IA5String_t *st = (const IA5String_t *)sptr;
1741
1742 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001743 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001744 "%s: value not given (%s:%d)",
1745 td->name, __FILE__, __LINE__);
1746 return -1;
1747 }
1748
1749
1750 if(!check_permitted_alphabet_1(st)) {
1751 /* Constraint check succeeded */
1752 return 0;
1753 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001754 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001755 "%s: constraint failed (%s:%d)",
1756 td->name, __FILE__, __LINE__);
1757 return -1;
1758 }
1759}
1760
1761/*
1762 * This type is implemented using IA5String,
1763 * so here we adjust the DEF accordingly.
1764 */
1765static void
1766PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1767 td->free_struct = asn_DEF_IA5String.free_struct;
1768 td->print_struct = asn_DEF_IA5String.print_struct;
1769 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1770 td->der_encoder = asn_DEF_IA5String.der_encoder;
1771 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1772 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1773 td->uper_decoder = asn_DEF_IA5String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001774 td->uper_encoder = asn_DEF_IA5String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001775 if(!td->per_constraints)
1776 td->per_constraints = asn_DEF_IA5String.per_constraints;
1777 td->elements = asn_DEF_IA5String.elements;
1778 td->elements_count = asn_DEF_IA5String.elements_count;
1779 td->specifics = asn_DEF_IA5String.specifics;
1780}
1781
1782void
1783PER_Visible_free(asn_TYPE_descriptor_t *td,
1784 void *struct_ptr, int contents_only) {
1785 PER_Visible_1_inherit_TYPE_descriptor(td);
1786 td->free_struct(td, struct_ptr, contents_only);
1787}
1788
1789int
1790PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1791 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1792 PER_Visible_1_inherit_TYPE_descriptor(td);
1793 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1794}
1795
1796asn_dec_rval_t
1797PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1798 void **structure, const void *bufptr, size_t size, int tag_mode) {
1799 PER_Visible_1_inherit_TYPE_descriptor(td);
1800 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1801}
1802
1803asn_enc_rval_t
1804PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
1805 void *structure, int tag_mode, ber_tlv_tag_t tag,
1806 asn_app_consume_bytes_f *cb, void *app_key) {
1807 PER_Visible_1_inherit_TYPE_descriptor(td);
1808 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1809}
1810
1811asn_dec_rval_t
1812PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1813 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1814 PER_Visible_1_inherit_TYPE_descriptor(td);
1815 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1816}
1817
1818asn_enc_rval_t
1819PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1820 int ilevel, enum xer_encoder_flags_e flags,
1821 asn_app_consume_bytes_f *cb, void *app_key) {
1822 PER_Visible_1_inherit_TYPE_descriptor(td);
1823 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1824}
1825
1826asn_dec_rval_t
1827PER_Visible_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1828 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
1829 PER_Visible_1_inherit_TYPE_descriptor(td);
1830 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
1831}
1832
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001833asn_enc_rval_t
1834PER_Visible_encode_uper(asn_TYPE_descriptor_t *td,
1835 asn_per_constraints_t *constraints,
1836 void *structure, asn_per_outp_t *per_out) {
1837 PER_Visible_1_inherit_TYPE_descriptor(td);
1838 return td->uper_encoder(td, constraints, structure, per_out);
1839}
1840
Lev Walkin59b176e2005-11-26 11:25:14 +00001841
Lev Walkin725883b2006-10-09 12:07:58 +00001842/*** <<< CTDEFS [PER-Visible] >>> ***/
1843
Lev Walkin4b5dae32006-10-09 12:27:44 +00001844static asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00001845 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
1846 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
1847 0, 0 /* No PER character map necessary */
1848};
1849
Lev Walkin59b176e2005-11-26 11:25:14 +00001850/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1851
1852static ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = {
1853 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1854};
Lev Walkin59b176e2005-11-26 11:25:14 +00001855asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
1856 "PER-Visible",
1857 "PER-Visible",
1858 PER_Visible_free,
1859 PER_Visible_print,
1860 PER_Visible_constraint,
1861 PER_Visible_decode_ber,
1862 PER_Visible_encode_der,
1863 PER_Visible_decode_xer,
1864 PER_Visible_encode_xer,
1865 PER_Visible_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001866 PER_Visible_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00001867 0, /* Use generic outmost tag fetcher */
1868 asn_DEF_PER_Visible_tags_1,
1869 sizeof(asn_DEF_PER_Visible_tags_1)
1870 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
1871 asn_DEF_PER_Visible_tags_1, /* Same as above */
1872 sizeof(asn_DEF_PER_Visible_tags_1)
1873 /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00001874 &asn_PER_type_PER_Visible_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00001875 0, 0, /* No members */
1876 0 /* No specifics */
1877};
1878
1879
1880/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1881
Lev Walkin22b5ed42006-09-13 02:51:20 +00001882#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00001883
1884/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1885
1886typedef PER_Visible_t PER_Visible_2_t;
1887
1888/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1889
1890extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
1891asn_struct_free_f PER_Visible_2_free;
1892asn_struct_print_f PER_Visible_2_print;
1893asn_constr_check_f PER_Visible_2_constraint;
1894ber_type_decoder_f PER_Visible_2_decode_ber;
1895der_type_encoder_f PER_Visible_2_encode_der;
1896xer_type_decoder_f PER_Visible_2_decode_xer;
1897xer_type_encoder_f PER_Visible_2_encode_xer;
1898per_type_decoder_f PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001899per_type_encoder_f PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00001900
1901/*** <<< CTABLES [PER-Visible-2] >>> ***/
1902
1903static int check_permitted_alphabet_1(const void *sptr) {
1904 /* The underlying type is IA5String */
1905 const IA5String_t *st = (const IA5String_t *)sptr;
1906 const uint8_t *ch = st->buf;
1907 const uint8_t *end = ch + st->size;
1908
1909 for(; ch < end; ch++) {
1910 uint8_t cv = *ch;
1911 if(!(cv >= 69 && cv <= 70)) return -1;
1912 }
1913 return 0;
1914}
1915
1916
1917/*** <<< CODE [PER-Visible-2] >>> ***/
1918
1919int
1920PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001921 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00001922 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
1923
1924 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001925 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001926 "%s: value not given (%s:%d)",
1927 td->name, __FILE__, __LINE__);
1928 return -1;
1929 }
1930
1931
1932 if(!check_permitted_alphabet_1(st)) {
1933 /* Constraint check succeeded */
1934 return 0;
1935 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001936 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00001937 "%s: constraint failed (%s:%d)",
1938 td->name, __FILE__, __LINE__);
1939 return -1;
1940 }
1941}
1942
1943/*
1944 * This type is implemented using PER_Visible,
1945 * so here we adjust the DEF accordingly.
1946 */
1947static void
1948PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1949 td->free_struct = asn_DEF_PER_Visible.free_struct;
1950 td->print_struct = asn_DEF_PER_Visible.print_struct;
1951 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1952 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1953 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1954 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1955 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001956 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001957 if(!td->per_constraints)
1958 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
1959 td->elements = asn_DEF_PER_Visible.elements;
1960 td->elements_count = asn_DEF_PER_Visible.elements_count;
1961 td->specifics = asn_DEF_PER_Visible.specifics;
1962}
1963
1964void
1965PER_Visible_2_free(asn_TYPE_descriptor_t *td,
1966 void *struct_ptr, int contents_only) {
1967 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1968 td->free_struct(td, struct_ptr, contents_only);
1969}
1970
1971int
1972PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1973 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1974 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1975 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1976}
1977
1978asn_dec_rval_t
1979PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1980 void **structure, const void *bufptr, size_t size, int tag_mode) {
1981 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1982 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1983}
1984
1985asn_enc_rval_t
1986PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
1987 void *structure, int tag_mode, ber_tlv_tag_t tag,
1988 asn_app_consume_bytes_f *cb, void *app_key) {
1989 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1990 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1991}
1992
1993asn_dec_rval_t
1994PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1995 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1996 PER_Visible_2_1_inherit_TYPE_descriptor(td);
1997 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1998}
1999
2000asn_enc_rval_t
2001PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2002 int ilevel, enum xer_encoder_flags_e flags,
2003 asn_app_consume_bytes_f *cb, void *app_key) {
2004 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2005 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2006}
2007
2008asn_dec_rval_t
2009PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2010 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2011 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2012 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2013}
2014
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002015asn_enc_rval_t
2016PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2017 asn_per_constraints_t *constraints,
2018 void *structure, asn_per_outp_t *per_out) {
2019 PER_Visible_2_1_inherit_TYPE_descriptor(td);
2020 return td->uper_encoder(td, constraints, structure, per_out);
2021}
2022
Lev Walkin59b176e2005-11-26 11:25:14 +00002023
Lev Walkin725883b2006-10-09 12:07:58 +00002024/*** <<< CTDEFS [PER-Visible-2] >>> ***/
2025
Lev Walkin4b5dae32006-10-09 12:27:44 +00002026static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00002027 { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */,
2028 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2029 0, 0 /* No PER character map necessary */
2030};
2031
Lev Walkin59b176e2005-11-26 11:25:14 +00002032/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
2033
2034static ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = {
2035 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2036};
Lev Walkin59b176e2005-11-26 11:25:14 +00002037asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
2038 "PER-Visible-2",
2039 "PER-Visible-2",
2040 PER_Visible_2_free,
2041 PER_Visible_2_print,
2042 PER_Visible_2_constraint,
2043 PER_Visible_2_decode_ber,
2044 PER_Visible_2_encode_der,
2045 PER_Visible_2_decode_xer,
2046 PER_Visible_2_encode_xer,
2047 PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002048 PER_Visible_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002049 0, /* Use generic outmost tag fetcher */
2050 asn_DEF_PER_Visible_2_tags_1,
2051 sizeof(asn_DEF_PER_Visible_2_tags_1)
2052 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
2053 asn_DEF_PER_Visible_2_tags_1, /* Same as above */
2054 sizeof(asn_DEF_PER_Visible_2_tags_1)
2055 /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002056 &asn_PER_type_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002057 0, 0, /* No members */
2058 0 /* No specifics */
2059};
2060
2061
2062/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
2063
Lev Walkin22b5ed42006-09-13 02:51:20 +00002064#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002065
2066/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
2067
2068typedef PER_Visible_t Not_PER_Visible_1_t;
2069
2070/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
2071
2072extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
2073asn_struct_free_f Not_PER_Visible_1_free;
2074asn_struct_print_f Not_PER_Visible_1_print;
2075asn_constr_check_f Not_PER_Visible_1_constraint;
2076ber_type_decoder_f Not_PER_Visible_1_decode_ber;
2077der_type_encoder_f Not_PER_Visible_1_encode_der;
2078xer_type_decoder_f Not_PER_Visible_1_decode_xer;
2079xer_type_encoder_f Not_PER_Visible_1_encode_xer;
2080per_type_decoder_f Not_PER_Visible_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002081per_type_encoder_f Not_PER_Visible_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002082
2083/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
2084
2085static int check_permitted_alphabet_1(const void *sptr) {
2086 /* The underlying type is IA5String */
2087 const IA5String_t *st = (const IA5String_t *)sptr;
2088 const uint8_t *ch = st->buf;
2089 const uint8_t *end = ch + st->size;
2090
2091 for(; ch < end; ch++) {
2092 uint8_t cv = *ch;
2093 if(!(cv >= 65 && cv <= 70)) return -1;
2094 }
2095 return 0;
2096}
2097
2098
2099/*** <<< CODE [Not-PER-Visible-1] >>> ***/
2100
2101int
2102Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002103 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002104 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2105
2106 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002107 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002108 "%s: value not given (%s:%d)",
2109 td->name, __FILE__, __LINE__);
2110 return -1;
2111 }
2112
2113
2114 if(!check_permitted_alphabet_1(st)) {
2115 /* Constraint check succeeded */
2116 return 0;
2117 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002118 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002119 "%s: constraint failed (%s:%d)",
2120 td->name, __FILE__, __LINE__);
2121 return -1;
2122 }
2123}
2124
2125/*
2126 * This type is implemented using PER_Visible,
2127 * so here we adjust the DEF accordingly.
2128 */
2129static void
2130Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2131 td->free_struct = asn_DEF_PER_Visible.free_struct;
2132 td->print_struct = asn_DEF_PER_Visible.print_struct;
2133 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2134 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2135 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2136 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2137 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002138 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002139 if(!td->per_constraints)
2140 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2141 td->elements = asn_DEF_PER_Visible.elements;
2142 td->elements_count = asn_DEF_PER_Visible.elements_count;
2143 td->specifics = asn_DEF_PER_Visible.specifics;
2144}
2145
2146void
2147Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
2148 void *struct_ptr, int contents_only) {
2149 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2150 td->free_struct(td, struct_ptr, contents_only);
2151}
2152
2153int
2154Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2155 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2156 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2157 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2158}
2159
2160asn_dec_rval_t
2161Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2162 void **structure, const void *bufptr, size_t size, int tag_mode) {
2163 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2164 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2165}
2166
2167asn_enc_rval_t
2168Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
2169 void *structure, int tag_mode, ber_tlv_tag_t tag,
2170 asn_app_consume_bytes_f *cb, void *app_key) {
2171 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2172 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2173}
2174
2175asn_dec_rval_t
2176Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2177 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2178 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2179 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2180}
2181
2182asn_enc_rval_t
2183Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2184 int ilevel, enum xer_encoder_flags_e flags,
2185 asn_app_consume_bytes_f *cb, void *app_key) {
2186 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2187 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2188}
2189
2190asn_dec_rval_t
2191Not_PER_Visible_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2192 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2193 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2194 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2195}
2196
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002197asn_enc_rval_t
2198Not_PER_Visible_1_encode_uper(asn_TYPE_descriptor_t *td,
2199 asn_per_constraints_t *constraints,
2200 void *structure, asn_per_outp_t *per_out) {
2201 Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);
2202 return td->uper_encoder(td, constraints, structure, per_out);
2203}
2204
Lev Walkin59b176e2005-11-26 11:25:14 +00002205
Lev Walkin725883b2006-10-09 12:07:58 +00002206/*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/
2207
Lev Walkin4b5dae32006-10-09 12:27:44 +00002208static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00002209 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
2210 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2211 0, 0 /* No PER character map necessary */
2212};
2213
Lev Walkin59b176e2005-11-26 11:25:14 +00002214/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
2215
2216static ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = {
2217 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2218};
Lev Walkin59b176e2005-11-26 11:25:14 +00002219asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
2220 "Not-PER-Visible-1",
2221 "Not-PER-Visible-1",
2222 Not_PER_Visible_1_free,
2223 Not_PER_Visible_1_print,
2224 Not_PER_Visible_1_constraint,
2225 Not_PER_Visible_1_decode_ber,
2226 Not_PER_Visible_1_encode_der,
2227 Not_PER_Visible_1_decode_xer,
2228 Not_PER_Visible_1_encode_xer,
2229 Not_PER_Visible_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002230 Not_PER_Visible_1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002231 0, /* Use generic outmost tag fetcher */
2232 asn_DEF_Not_PER_Visible_1_tags_1,
2233 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2234 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
2235 asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */
2236 sizeof(asn_DEF_Not_PER_Visible_1_tags_1)
2237 /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002238 &asn_PER_type_Not_PER_Visible_1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002239 0, 0, /* No members */
2240 0 /* No specifics */
2241};
2242
2243
2244/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
2245
Lev Walkin22b5ed42006-09-13 02:51:20 +00002246#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002247
2248/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
2249
2250typedef PER_Visible_t Not_PER_Visible_2_t;
2251
2252/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
2253
2254extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
2255asn_struct_free_f Not_PER_Visible_2_free;
2256asn_struct_print_f Not_PER_Visible_2_print;
2257asn_constr_check_f Not_PER_Visible_2_constraint;
2258ber_type_decoder_f Not_PER_Visible_2_decode_ber;
2259der_type_encoder_f Not_PER_Visible_2_encode_der;
2260xer_type_decoder_f Not_PER_Visible_2_decode_xer;
2261xer_type_encoder_f Not_PER_Visible_2_encode_xer;
2262per_type_decoder_f Not_PER_Visible_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002263per_type_encoder_f Not_PER_Visible_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002264
2265/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
2266
2267static int check_permitted_alphabet_1(const void *sptr) {
2268 /* The underlying type is IA5String */
2269 const IA5String_t *st = (const IA5String_t *)sptr;
2270 const uint8_t *ch = st->buf;
2271 const uint8_t *end = ch + st->size;
2272
2273 for(; ch < end; ch++) {
2274 uint8_t cv = *ch;
2275 if(!(cv >= 65 && cv <= 66)) return -1;
2276 }
2277 return 0;
2278}
2279
2280
2281/*** <<< CODE [Not-PER-Visible-2] >>> ***/
2282
2283int
2284Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002285 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002286 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2287
2288 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002289 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002290 "%s: value not given (%s:%d)",
2291 td->name, __FILE__, __LINE__);
2292 return -1;
2293 }
2294
2295
2296 if(!check_permitted_alphabet_1(st)) {
2297 /* Constraint check succeeded */
2298 return 0;
2299 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002300 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002301 "%s: constraint failed (%s:%d)",
2302 td->name, __FILE__, __LINE__);
2303 return -1;
2304 }
2305}
2306
2307/*
2308 * This type is implemented using PER_Visible,
2309 * so here we adjust the DEF accordingly.
2310 */
2311static void
2312Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2313 td->free_struct = asn_DEF_PER_Visible.free_struct;
2314 td->print_struct = asn_DEF_PER_Visible.print_struct;
2315 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2316 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2317 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2318 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2319 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002320 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002321 if(!td->per_constraints)
2322 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2323 td->elements = asn_DEF_PER_Visible.elements;
2324 td->elements_count = asn_DEF_PER_Visible.elements_count;
2325 td->specifics = asn_DEF_PER_Visible.specifics;
2326}
2327
2328void
2329Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
2330 void *struct_ptr, int contents_only) {
2331 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2332 td->free_struct(td, struct_ptr, contents_only);
2333}
2334
2335int
2336Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2337 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2338 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2339 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2340}
2341
2342asn_dec_rval_t
2343Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2344 void **structure, const void *bufptr, size_t size, int tag_mode) {
2345 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2346 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2347}
2348
2349asn_enc_rval_t
2350Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
2351 void *structure, int tag_mode, ber_tlv_tag_t tag,
2352 asn_app_consume_bytes_f *cb, void *app_key) {
2353 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2354 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2355}
2356
2357asn_dec_rval_t
2358Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2359 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2360 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2361 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2362}
2363
2364asn_enc_rval_t
2365Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2366 int ilevel, enum xer_encoder_flags_e flags,
2367 asn_app_consume_bytes_f *cb, void *app_key) {
2368 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2369 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2370}
2371
2372asn_dec_rval_t
2373Not_PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2374 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2375 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2376 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2377}
2378
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002379asn_enc_rval_t
2380Not_PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td,
2381 asn_per_constraints_t *constraints,
2382 void *structure, asn_per_outp_t *per_out) {
2383 Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);
2384 return td->uper_encoder(td, constraints, structure, per_out);
2385}
2386
Lev Walkin59b176e2005-11-26 11:25:14 +00002387
Lev Walkin725883b2006-10-09 12:07:58 +00002388/*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/
2389
Lev Walkin4b5dae32006-10-09 12:27:44 +00002390static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00002391 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2392 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2393 0, 0 /* No PER character map necessary */
2394};
2395
Lev Walkin59b176e2005-11-26 11:25:14 +00002396/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
2397
2398static ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = {
2399 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2400};
Lev Walkin59b176e2005-11-26 11:25:14 +00002401asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
2402 "Not-PER-Visible-2",
2403 "Not-PER-Visible-2",
2404 Not_PER_Visible_2_free,
2405 Not_PER_Visible_2_print,
2406 Not_PER_Visible_2_constraint,
2407 Not_PER_Visible_2_decode_ber,
2408 Not_PER_Visible_2_encode_der,
2409 Not_PER_Visible_2_decode_xer,
2410 Not_PER_Visible_2_encode_xer,
2411 Not_PER_Visible_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002412 Not_PER_Visible_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002413 0, /* Use generic outmost tag fetcher */
2414 asn_DEF_Not_PER_Visible_2_tags_1,
2415 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2416 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
2417 asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */
2418 sizeof(asn_DEF_Not_PER_Visible_2_tags_1)
2419 /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002420 &asn_PER_type_Not_PER_Visible_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002421 0, 0, /* No members */
2422 0 /* No specifics */
2423};
2424
2425
2426/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2427
Lev Walkin22b5ed42006-09-13 02:51:20 +00002428#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002429
2430/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2431
2432typedef PER_Visible_t Not_PER_Visible_3_t;
2433
2434/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2435
2436extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
2437asn_struct_free_f Not_PER_Visible_3_free;
2438asn_struct_print_f Not_PER_Visible_3_print;
2439asn_constr_check_f Not_PER_Visible_3_constraint;
2440ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2441der_type_encoder_f Not_PER_Visible_3_encode_der;
2442xer_type_decoder_f Not_PER_Visible_3_decode_xer;
2443xer_type_encoder_f Not_PER_Visible_3_encode_xer;
2444per_type_decoder_f Not_PER_Visible_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002445per_type_encoder_f Not_PER_Visible_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002446
2447/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2448
2449static int check_permitted_alphabet_1(const void *sptr) {
2450 /* The underlying type is IA5String */
2451 const IA5String_t *st = (const IA5String_t *)sptr;
2452 const uint8_t *ch = st->buf;
2453 const uint8_t *end = ch + st->size;
2454
2455 for(; ch < end; ch++) {
2456 uint8_t cv = *ch;
2457 if(!(cv >= 65 && cv <= 66)) return -1;
2458 }
2459 return 0;
2460}
2461
2462
2463/*** <<< CODE [Not-PER-Visible-3] >>> ***/
2464
2465int
2466Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002467 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002468 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2469
2470 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002471 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002472 "%s: value not given (%s:%d)",
2473 td->name, __FILE__, __LINE__);
2474 return -1;
2475 }
2476
2477
2478 if(!check_permitted_alphabet_1(st)) {
2479 /* Constraint check succeeded */
2480 return 0;
2481 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002482 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002483 "%s: constraint failed (%s:%d)",
2484 td->name, __FILE__, __LINE__);
2485 return -1;
2486 }
2487}
2488
2489/*
2490 * This type is implemented using PER_Visible,
2491 * so here we adjust the DEF accordingly.
2492 */
2493static void
2494Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2495 td->free_struct = asn_DEF_PER_Visible.free_struct;
2496 td->print_struct = asn_DEF_PER_Visible.print_struct;
2497 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2498 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2499 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2500 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2501 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002502 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002503 if(!td->per_constraints)
2504 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2505 td->elements = asn_DEF_PER_Visible.elements;
2506 td->elements_count = asn_DEF_PER_Visible.elements_count;
2507 td->specifics = asn_DEF_PER_Visible.specifics;
2508}
2509
2510void
2511Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
2512 void *struct_ptr, int contents_only) {
2513 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2514 td->free_struct(td, struct_ptr, contents_only);
2515}
2516
2517int
2518Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2519 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2520 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2521 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2522}
2523
2524asn_dec_rval_t
2525Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2526 void **structure, const void *bufptr, size_t size, int tag_mode) {
2527 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2528 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2529}
2530
2531asn_enc_rval_t
2532Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
2533 void *structure, int tag_mode, ber_tlv_tag_t tag,
2534 asn_app_consume_bytes_f *cb, void *app_key) {
2535 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2536 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2537}
2538
2539asn_dec_rval_t
2540Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2541 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2542 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2543 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2544}
2545
2546asn_enc_rval_t
2547Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2548 int ilevel, enum xer_encoder_flags_e flags,
2549 asn_app_consume_bytes_f *cb, void *app_key) {
2550 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2551 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2552}
2553
2554asn_dec_rval_t
2555Not_PER_Visible_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2556 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2557 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2558 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2559}
2560
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002561asn_enc_rval_t
2562Not_PER_Visible_3_encode_uper(asn_TYPE_descriptor_t *td,
2563 asn_per_constraints_t *constraints,
2564 void *structure, asn_per_outp_t *per_out) {
2565 Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);
2566 return td->uper_encoder(td, constraints, structure, per_out);
2567}
2568
Lev Walkin59b176e2005-11-26 11:25:14 +00002569
Lev Walkin725883b2006-10-09 12:07:58 +00002570/*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/
2571
Lev Walkin4b5dae32006-10-09 12:27:44 +00002572static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00002573 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2574 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
2575 0, 0 /* No PER character map necessary */
2576};
2577
Lev Walkin59b176e2005-11-26 11:25:14 +00002578/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2579
2580static ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = {
2581 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2582};
Lev Walkin59b176e2005-11-26 11:25:14 +00002583asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
2584 "Not-PER-Visible-3",
2585 "Not-PER-Visible-3",
2586 Not_PER_Visible_3_free,
2587 Not_PER_Visible_3_print,
2588 Not_PER_Visible_3_constraint,
2589 Not_PER_Visible_3_decode_ber,
2590 Not_PER_Visible_3_encode_der,
2591 Not_PER_Visible_3_decode_xer,
2592 Not_PER_Visible_3_encode_xer,
2593 Not_PER_Visible_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002594 Not_PER_Visible_3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002595 0, /* Use generic outmost tag fetcher */
2596 asn_DEF_Not_PER_Visible_3_tags_1,
2597 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2598 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
2599 asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */
2600 sizeof(asn_DEF_Not_PER_Visible_3_tags_1)
2601 /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002602 &asn_PER_type_Not_PER_Visible_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002603 0, 0, /* No members */
2604 0 /* No specifics */
2605};
2606
2607
2608/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2609
Lev Walkin22b5ed42006-09-13 02:51:20 +00002610#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002611
2612/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2613
2614typedef PER_Visible_t SIZE_but_not_FROM_t;
2615
2616/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2617
2618extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
2619asn_struct_free_f SIZE_but_not_FROM_free;
2620asn_struct_print_f SIZE_but_not_FROM_print;
2621asn_constr_check_f SIZE_but_not_FROM_constraint;
2622ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2623der_type_encoder_f SIZE_but_not_FROM_encode_der;
2624xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
2625xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
2626per_type_decoder_f SIZE_but_not_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002627per_type_encoder_f SIZE_but_not_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002628
2629/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2630
2631static int check_permitted_alphabet_1(const void *sptr) {
2632 /* The underlying type is IA5String */
2633 const IA5String_t *st = (const IA5String_t *)sptr;
2634 const uint8_t *ch = st->buf;
2635 const uint8_t *end = ch + st->size;
2636
2637 for(; ch < end; ch++) {
2638 uint8_t cv = *ch;
2639 if(!(cv >= 65 && cv <= 68)) return -1;
2640 }
2641 return 0;
2642}
2643
2644
2645/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2646
2647int
2648SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002649 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002650 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2651 size_t size;
2652
2653 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002654 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002655 "%s: value not given (%s:%d)",
2656 td->name, __FILE__, __LINE__);
2657 return -1;
2658 }
2659
2660 size = st->size;
2661
2662 if((size >= 1 && size <= 4)
2663 && !check_permitted_alphabet_1(st)) {
2664 /* Constraint check succeeded */
2665 return 0;
2666 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002667 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002668 "%s: constraint failed (%s:%d)",
2669 td->name, __FILE__, __LINE__);
2670 return -1;
2671 }
2672}
2673
2674/*
2675 * This type is implemented using PER_Visible,
2676 * so here we adjust the DEF accordingly.
2677 */
2678static void
2679SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2680 td->free_struct = asn_DEF_PER_Visible.free_struct;
2681 td->print_struct = asn_DEF_PER_Visible.print_struct;
2682 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2683 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2684 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2685 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2686 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002687 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002688 if(!td->per_constraints)
2689 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2690 td->elements = asn_DEF_PER_Visible.elements;
2691 td->elements_count = asn_DEF_PER_Visible.elements_count;
2692 td->specifics = asn_DEF_PER_Visible.specifics;
2693}
2694
2695void
2696SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
2697 void *struct_ptr, int contents_only) {
2698 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2699 td->free_struct(td, struct_ptr, contents_only);
2700}
2701
2702int
2703SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2704 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2705 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2706 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2707}
2708
2709asn_dec_rval_t
2710SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2711 void **structure, const void *bufptr, size_t size, int tag_mode) {
2712 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2713 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2714}
2715
2716asn_enc_rval_t
2717SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
2718 void *structure, int tag_mode, ber_tlv_tag_t tag,
2719 asn_app_consume_bytes_f *cb, void *app_key) {
2720 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2721 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2722}
2723
2724asn_dec_rval_t
2725SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2726 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2727 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2728 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2729}
2730
2731asn_enc_rval_t
2732SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2733 int ilevel, enum xer_encoder_flags_e flags,
2734 asn_app_consume_bytes_f *cb, void *app_key) {
2735 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2736 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2737}
2738
2739asn_dec_rval_t
2740SIZE_but_not_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2741 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2742 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2743 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2744}
2745
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002746asn_enc_rval_t
2747SIZE_but_not_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2748 asn_per_constraints_t *constraints,
2749 void *structure, asn_per_outp_t *per_out) {
2750 SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);
2751 return td->uper_encoder(td, constraints, structure, per_out);
2752}
2753
Lev Walkin59b176e2005-11-26 11:25:14 +00002754
Lev Walkin725883b2006-10-09 12:07:58 +00002755/*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/
2756
Lev Walkin4b5dae32006-10-09 12:27:44 +00002757static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00002758 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
2759 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
2760 0, 0 /* No PER character map necessary */
2761};
2762
Lev Walkin59b176e2005-11-26 11:25:14 +00002763/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2764
2765static ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = {
2766 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2767};
Lev Walkin59b176e2005-11-26 11:25:14 +00002768asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
2769 "SIZE-but-not-FROM",
2770 "SIZE-but-not-FROM",
2771 SIZE_but_not_FROM_free,
2772 SIZE_but_not_FROM_print,
2773 SIZE_but_not_FROM_constraint,
2774 SIZE_but_not_FROM_decode_ber,
2775 SIZE_but_not_FROM_encode_der,
2776 SIZE_but_not_FROM_decode_xer,
2777 SIZE_but_not_FROM_encode_xer,
2778 SIZE_but_not_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002779 SIZE_but_not_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002780 0, /* Use generic outmost tag fetcher */
2781 asn_DEF_SIZE_but_not_FROM_tags_1,
2782 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2783 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
2784 asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */
2785 sizeof(asn_DEF_SIZE_but_not_FROM_tags_1)
2786 /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002787 &asn_PER_type_SIZE_but_not_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002788 0, 0, /* No members */
2789 0 /* No specifics */
2790};
2791
2792
2793/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2794
Lev Walkin22b5ed42006-09-13 02:51:20 +00002795#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002796
2797/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2798
2799typedef PER_Visible_t SIZE_and_FROM_t;
2800
2801/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2802
2803extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
2804asn_struct_free_f SIZE_and_FROM_free;
2805asn_struct_print_f SIZE_and_FROM_print;
2806asn_constr_check_f SIZE_and_FROM_constraint;
2807ber_type_decoder_f SIZE_and_FROM_decode_ber;
2808der_type_encoder_f SIZE_and_FROM_encode_der;
2809xer_type_decoder_f SIZE_and_FROM_decode_xer;
2810xer_type_encoder_f SIZE_and_FROM_encode_xer;
2811per_type_decoder_f SIZE_and_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002812per_type_encoder_f SIZE_and_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002813
2814/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2815
2816static int check_permitted_alphabet_1(const void *sptr) {
2817 /* The underlying type is IA5String */
2818 const IA5String_t *st = (const IA5String_t *)sptr;
2819 const uint8_t *ch = st->buf;
2820 const uint8_t *end = ch + st->size;
2821
2822 for(; ch < end; ch++) {
2823 uint8_t cv = *ch;
2824 if(!(cv >= 65 && cv <= 68)) return -1;
2825 }
2826 return 0;
2827}
2828
2829
2830/*** <<< CODE [SIZE-and-FROM] >>> ***/
2831
2832int
2833SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002834 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00002835 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
2836 size_t size;
2837
2838 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002839 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002840 "%s: value not given (%s:%d)",
2841 td->name, __FILE__, __LINE__);
2842 return -1;
2843 }
2844
2845 size = st->size;
2846
2847 if((size >= 1 && size <= 4)
2848 && !check_permitted_alphabet_1(st)) {
2849 /* Constraint check succeeded */
2850 return 0;
2851 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002852 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00002853 "%s: constraint failed (%s:%d)",
2854 td->name, __FILE__, __LINE__);
2855 return -1;
2856 }
2857}
2858
2859/*
2860 * This type is implemented using PER_Visible,
2861 * so here we adjust the DEF accordingly.
2862 */
2863static void
2864SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2865 td->free_struct = asn_DEF_PER_Visible.free_struct;
2866 td->print_struct = asn_DEF_PER_Visible.print_struct;
2867 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2868 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2869 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2870 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2871 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002872 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002873 if(!td->per_constraints)
2874 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
2875 td->elements = asn_DEF_PER_Visible.elements;
2876 td->elements_count = asn_DEF_PER_Visible.elements_count;
2877 td->specifics = asn_DEF_PER_Visible.specifics;
2878}
2879
2880void
2881SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
2882 void *struct_ptr, int contents_only) {
2883 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2884 td->free_struct(td, struct_ptr, contents_only);
2885}
2886
2887int
2888SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2889 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2890 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2891 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2892}
2893
2894asn_dec_rval_t
2895SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2896 void **structure, const void *bufptr, size_t size, int tag_mode) {
2897 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2898 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2899}
2900
2901asn_enc_rval_t
2902SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
2903 void *structure, int tag_mode, ber_tlv_tag_t tag,
2904 asn_app_consume_bytes_f *cb, void *app_key) {
2905 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2906 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2907}
2908
2909asn_dec_rval_t
2910SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2911 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2912 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2913 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2914}
2915
2916asn_enc_rval_t
2917SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2918 int ilevel, enum xer_encoder_flags_e flags,
2919 asn_app_consume_bytes_f *cb, void *app_key) {
2920 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2921 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2922}
2923
2924asn_dec_rval_t
2925SIZE_and_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2926 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
2927 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2928 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
2929}
2930
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002931asn_enc_rval_t
2932SIZE_and_FROM_encode_uper(asn_TYPE_descriptor_t *td,
2933 asn_per_constraints_t *constraints,
2934 void *structure, asn_per_outp_t *per_out) {
2935 SIZE_and_FROM_1_inherit_TYPE_descriptor(td);
2936 return td->uper_encoder(td, constraints, structure, per_out);
2937}
2938
Lev Walkin59b176e2005-11-26 11:25:14 +00002939
Lev Walkin725883b2006-10-09 12:07:58 +00002940/*** <<< CTDEFS [SIZE-and-FROM] >>> ***/
2941
Lev Walkin4b5dae32006-10-09 12:27:44 +00002942static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00002943 { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */,
2944 { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
2945 0, 0 /* No PER character map necessary */
2946};
2947
Lev Walkin59b176e2005-11-26 11:25:14 +00002948/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
2949
2950static ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = {
2951 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
2952};
Lev Walkin59b176e2005-11-26 11:25:14 +00002953asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
2954 "SIZE-and-FROM",
2955 "SIZE-and-FROM",
2956 SIZE_and_FROM_free,
2957 SIZE_and_FROM_print,
2958 SIZE_and_FROM_constraint,
2959 SIZE_and_FROM_decode_ber,
2960 SIZE_and_FROM_encode_der,
2961 SIZE_and_FROM_decode_xer,
2962 SIZE_and_FROM_encode_xer,
2963 SIZE_and_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002964 SIZE_and_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00002965 0, /* Use generic outmost tag fetcher */
2966 asn_DEF_SIZE_and_FROM_tags_1,
2967 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2968 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
2969 asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */
2970 sizeof(asn_DEF_SIZE_and_FROM_tags_1)
2971 /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00002972 &asn_PER_type_SIZE_and_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00002973 0, 0, /* No members */
2974 0 /* No specifics */
2975};
2976
2977
2978/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
2979
Lev Walkin22b5ed42006-09-13 02:51:20 +00002980#include "PER-Visible.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00002981
2982/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2983
2984typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
2985
2986/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2987
2988extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
2989asn_struct_free_f Neither_SIZE_nor_FROM_free;
2990asn_struct_print_f Neither_SIZE_nor_FROM_print;
2991asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
2992ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
2993der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
2994xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
2995xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
2996per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002997per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00002998
2999/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
3000
3001static int check_permitted_alphabet_1(const void *sptr) {
3002 /* The underlying type is IA5String */
3003 const IA5String_t *st = (const IA5String_t *)sptr;
3004 const uint8_t *ch = st->buf;
3005 const uint8_t *end = ch + st->size;
3006
3007 for(; ch < end; ch++) {
3008 uint8_t cv = *ch;
3009 if(!(cv >= 65 && cv <= 70)) return -1;
3010 }
3011 return 0;
3012}
3013
3014
3015/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
3016
3017int
3018Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003019 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003020 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
3021
3022 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003023 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003024 "%s: value not given (%s:%d)",
3025 td->name, __FILE__, __LINE__);
3026 return -1;
3027 }
3028
3029
3030 if(!check_permitted_alphabet_1(st)) {
3031 /* Constraint check succeeded */
3032 return 0;
3033 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003034 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003035 "%s: constraint failed (%s:%d)",
3036 td->name, __FILE__, __LINE__);
3037 return -1;
3038 }
3039}
3040
3041/*
3042 * This type is implemented using PER_Visible,
3043 * so here we adjust the DEF accordingly.
3044 */
3045static void
3046Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3047 td->free_struct = asn_DEF_PER_Visible.free_struct;
3048 td->print_struct = asn_DEF_PER_Visible.print_struct;
3049 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
3050 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
3051 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
3052 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
3053 td->uper_decoder = asn_DEF_PER_Visible.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003054 td->uper_encoder = asn_DEF_PER_Visible.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003055 if(!td->per_constraints)
3056 td->per_constraints = asn_DEF_PER_Visible.per_constraints;
3057 td->elements = asn_DEF_PER_Visible.elements;
3058 td->elements_count = asn_DEF_PER_Visible.elements_count;
3059 td->specifics = asn_DEF_PER_Visible.specifics;
3060}
3061
3062void
3063Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
3064 void *struct_ptr, int contents_only) {
3065 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3066 td->free_struct(td, struct_ptr, contents_only);
3067}
3068
3069int
3070Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3071 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3072 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3073 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3074}
3075
3076asn_dec_rval_t
3077Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3078 void **structure, const void *bufptr, size_t size, int tag_mode) {
3079 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3080 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3081}
3082
3083asn_enc_rval_t
3084Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
3085 void *structure, int tag_mode, ber_tlv_tag_t tag,
3086 asn_app_consume_bytes_f *cb, void *app_key) {
3087 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3088 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3089}
3090
3091asn_dec_rval_t
3092Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3093 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3094 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3095 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3096}
3097
3098asn_enc_rval_t
3099Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3100 int ilevel, enum xer_encoder_flags_e flags,
3101 asn_app_consume_bytes_f *cb, void *app_key) {
3102 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3103 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3104}
3105
3106asn_dec_rval_t
3107Neither_SIZE_nor_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3108 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3109 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3110 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3111}
3112
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003113asn_enc_rval_t
3114Neither_SIZE_nor_FROM_encode_uper(asn_TYPE_descriptor_t *td,
3115 asn_per_constraints_t *constraints,
3116 void *structure, asn_per_outp_t *per_out) {
3117 Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td);
3118 return td->uper_encoder(td, constraints, structure, per_out);
3119}
3120
Lev Walkin59b176e2005-11-26 11:25:14 +00003121
Lev Walkin725883b2006-10-09 12:07:58 +00003122/*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/
3123
Lev Walkin4b5dae32006-10-09 12:27:44 +00003124static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00003125 { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */,
3126 { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */,
3127 0, 0 /* No PER character map necessary */
3128};
3129
Lev Walkin59b176e2005-11-26 11:25:14 +00003130/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
3131
3132static ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = {
3133 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
3134};
Lev Walkin59b176e2005-11-26 11:25:14 +00003135asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
3136 "Neither-SIZE-nor-FROM",
3137 "Neither-SIZE-nor-FROM",
3138 Neither_SIZE_nor_FROM_free,
3139 Neither_SIZE_nor_FROM_print,
3140 Neither_SIZE_nor_FROM_constraint,
3141 Neither_SIZE_nor_FROM_decode_ber,
3142 Neither_SIZE_nor_FROM_encode_der,
3143 Neither_SIZE_nor_FROM_decode_xer,
3144 Neither_SIZE_nor_FROM_encode_xer,
3145 Neither_SIZE_nor_FROM_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003146 Neither_SIZE_nor_FROM_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003147 0, /* Use generic outmost tag fetcher */
3148 asn_DEF_Neither_SIZE_nor_FROM_tags_1,
3149 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3150 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
3151 asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */
3152 sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1)
3153 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003154 &asn_PER_type_Neither_SIZE_nor_FROM_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003155 0, 0, /* No members */
3156 0 /* No specifics */
3157};
3158
3159
3160/*** <<< INCLUDES [Utf8-4] >>> ***/
3161
3162#include <UTF8String.h>
3163
3164/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
3165
3166typedef UTF8String_t Utf8_4_t;
3167
3168/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
3169
3170extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
3171asn_struct_free_f Utf8_4_free;
3172asn_struct_print_f Utf8_4_print;
3173asn_constr_check_f Utf8_4_constraint;
3174ber_type_decoder_f Utf8_4_decode_ber;
3175der_type_encoder_f Utf8_4_encode_der;
3176xer_type_decoder_f Utf8_4_decode_xer;
3177xer_type_encoder_f Utf8_4_encode_xer;
3178per_type_decoder_f Utf8_4_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003179per_type_encoder_f Utf8_4_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003180
3181/*** <<< CTABLES [Utf8-4] >>> ***/
3182
3183static int check_permitted_alphabet_1(const void *sptr) {
3184 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
3185 return -1; /* Alphabet (sic!) test failed. */
3186
3187 return 0;
3188}
3189
3190
3191/*** <<< CODE [Utf8-4] >>> ***/
3192
3193int
3194Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003195 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003196 const UTF8String_t *st = (const UTF8String_t *)sptr;
3197
3198 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003199 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003200 "%s: value not given (%s:%d)",
3201 td->name, __FILE__, __LINE__);
3202 return -1;
3203 }
3204
3205
3206 if(!check_permitted_alphabet_1(st)) {
3207 /* Constraint check succeeded */
3208 return 0;
3209 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003210 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003211 "%s: constraint failed (%s:%d)",
3212 td->name, __FILE__, __LINE__);
3213 return -1;
3214 }
3215}
3216
3217/*
3218 * This type is implemented using UTF8String,
3219 * so here we adjust the DEF accordingly.
3220 */
3221static void
3222Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3223 td->free_struct = asn_DEF_UTF8String.free_struct;
3224 td->print_struct = asn_DEF_UTF8String.print_struct;
3225 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3226 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3227 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3228 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3229 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003230 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003231 if(!td->per_constraints)
3232 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3233 td->elements = asn_DEF_UTF8String.elements;
3234 td->elements_count = asn_DEF_UTF8String.elements_count;
3235 td->specifics = asn_DEF_UTF8String.specifics;
3236}
3237
3238void
3239Utf8_4_free(asn_TYPE_descriptor_t *td,
3240 void *struct_ptr, int contents_only) {
3241 Utf8_4_1_inherit_TYPE_descriptor(td);
3242 td->free_struct(td, struct_ptr, contents_only);
3243}
3244
3245int
3246Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3247 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3248 Utf8_4_1_inherit_TYPE_descriptor(td);
3249 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3250}
3251
3252asn_dec_rval_t
3253Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3254 void **structure, const void *bufptr, size_t size, int tag_mode) {
3255 Utf8_4_1_inherit_TYPE_descriptor(td);
3256 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3257}
3258
3259asn_enc_rval_t
3260Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
3261 void *structure, int tag_mode, ber_tlv_tag_t tag,
3262 asn_app_consume_bytes_f *cb, void *app_key) {
3263 Utf8_4_1_inherit_TYPE_descriptor(td);
3264 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3265}
3266
3267asn_dec_rval_t
3268Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3269 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3270 Utf8_4_1_inherit_TYPE_descriptor(td);
3271 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3272}
3273
3274asn_enc_rval_t
3275Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3276 int ilevel, enum xer_encoder_flags_e flags,
3277 asn_app_consume_bytes_f *cb, void *app_key) {
3278 Utf8_4_1_inherit_TYPE_descriptor(td);
3279 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3280}
3281
3282asn_dec_rval_t
3283Utf8_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3284 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3285 Utf8_4_1_inherit_TYPE_descriptor(td);
3286 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3287}
3288
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003289asn_enc_rval_t
3290Utf8_4_encode_uper(asn_TYPE_descriptor_t *td,
3291 asn_per_constraints_t *constraints,
3292 void *structure, asn_per_outp_t *per_out) {
3293 Utf8_4_1_inherit_TYPE_descriptor(td);
3294 return td->uper_encoder(td, constraints, structure, per_out);
3295}
3296
Lev Walkin59b176e2005-11-26 11:25:14 +00003297
Lev Walkin725883b2006-10-09 12:07:58 +00003298/*** <<< CTDEFS [Utf8-4] >>> ***/
3299
Lev Walkin4b5dae32006-10-09 12:27:44 +00003300static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00003301 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3302 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3303 0, 0 /* No PER value map */
3304};
3305
Lev Walkin59b176e2005-11-26 11:25:14 +00003306/*** <<< STAT-DEFS [Utf8-4] >>> ***/
3307
3308static ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = {
3309 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3310};
Lev Walkin59b176e2005-11-26 11:25:14 +00003311asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
3312 "Utf8-4",
3313 "Utf8-4",
3314 Utf8_4_free,
3315 Utf8_4_print,
3316 Utf8_4_constraint,
3317 Utf8_4_decode_ber,
3318 Utf8_4_encode_der,
3319 Utf8_4_decode_xer,
3320 Utf8_4_encode_xer,
3321 Utf8_4_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003322 Utf8_4_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003323 0, /* Use generic outmost tag fetcher */
3324 asn_DEF_Utf8_4_tags_1,
3325 sizeof(asn_DEF_Utf8_4_tags_1)
3326 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
3327 asn_DEF_Utf8_4_tags_1, /* Same as above */
3328 sizeof(asn_DEF_Utf8_4_tags_1)
3329 /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003330 &asn_PER_type_Utf8_4_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003331 0, 0, /* No members */
3332 0 /* No specifics */
3333};
3334
3335
3336/*** <<< INCLUDES [Utf8-3] >>> ***/
3337
Lev Walkin22b5ed42006-09-13 02:51:20 +00003338#include "Utf8-2.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003339
3340/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
3341
3342typedef Utf8_2_t Utf8_3_t;
3343
3344/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
3345
3346extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
3347asn_struct_free_f Utf8_3_free;
3348asn_struct_print_f Utf8_3_print;
3349asn_constr_check_f Utf8_3_constraint;
3350ber_type_decoder_f Utf8_3_decode_ber;
3351der_type_encoder_f Utf8_3_encode_der;
3352xer_type_decoder_f Utf8_3_decode_xer;
3353xer_type_encoder_f Utf8_3_encode_xer;
3354per_type_decoder_f Utf8_3_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003355per_type_encoder_f Utf8_3_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003356
3357/*** <<< CTABLES [Utf8-3] >>> ***/
3358
3359static int permitted_alphabet_table_1[128] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003360 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3361 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3362 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3363 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3364 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */
336516,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */
3366 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */
336742,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003368};
3369
3370static int check_permitted_alphabet_1(const void *sptr) {
3371 int *table = permitted_alphabet_table_1;
3372 /* The underlying type is UTF8String */
3373 const UTF8String_t *st = (const UTF8String_t *)sptr;
3374 const uint8_t *ch = st->buf;
3375 const uint8_t *end = ch + st->size;
3376
3377 for(; ch < end; ch++) {
3378 uint8_t cv = *ch;
3379 if(cv >= 0x80) return -1;
3380 if(!table[cv]) return -1;
3381 }
3382 return 0;
3383}
3384
3385
3386/*** <<< CODE [Utf8-3] >>> ***/
3387
3388int
3389Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003390 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003391 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
3392 size_t size;
3393
3394 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003395 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003396 "%s: value not given (%s:%d)",
3397 td->name, __FILE__, __LINE__);
3398 return -1;
3399 }
3400
3401 size = UTF8String_length(st);
3402 if((ssize_t)size < 0) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003403 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003404 "%s: UTF-8: broken encoding (%s:%d)",
3405 td->name, __FILE__, __LINE__);
3406 return -1;
3407 }
3408
3409 if((size >= 1 && size <= 2)
3410 && !check_permitted_alphabet_1(st)) {
3411 /* Constraint check succeeded */
3412 return 0;
3413 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003414 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003415 "%s: constraint failed (%s:%d)",
3416 td->name, __FILE__, __LINE__);
3417 return -1;
3418 }
3419}
3420
3421/*
3422 * This type is implemented using Utf8_2,
3423 * so here we adjust the DEF accordingly.
3424 */
3425static void
3426Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3427 td->free_struct = asn_DEF_Utf8_2.free_struct;
3428 td->print_struct = asn_DEF_Utf8_2.print_struct;
3429 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
3430 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
3431 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
3432 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
3433 td->uper_decoder = asn_DEF_Utf8_2.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003434 td->uper_encoder = asn_DEF_Utf8_2.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003435 if(!td->per_constraints)
3436 td->per_constraints = asn_DEF_Utf8_2.per_constraints;
3437 td->elements = asn_DEF_Utf8_2.elements;
3438 td->elements_count = asn_DEF_Utf8_2.elements_count;
3439 td->specifics = asn_DEF_Utf8_2.specifics;
3440}
3441
3442void
3443Utf8_3_free(asn_TYPE_descriptor_t *td,
3444 void *struct_ptr, int contents_only) {
3445 Utf8_3_1_inherit_TYPE_descriptor(td);
3446 td->free_struct(td, struct_ptr, contents_only);
3447}
3448
3449int
3450Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3451 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3452 Utf8_3_1_inherit_TYPE_descriptor(td);
3453 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3454}
3455
3456asn_dec_rval_t
3457Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3458 void **structure, const void *bufptr, size_t size, int tag_mode) {
3459 Utf8_3_1_inherit_TYPE_descriptor(td);
3460 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3461}
3462
3463asn_enc_rval_t
3464Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
3465 void *structure, int tag_mode, ber_tlv_tag_t tag,
3466 asn_app_consume_bytes_f *cb, void *app_key) {
3467 Utf8_3_1_inherit_TYPE_descriptor(td);
3468 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3469}
3470
3471asn_dec_rval_t
3472Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3473 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3474 Utf8_3_1_inherit_TYPE_descriptor(td);
3475 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3476}
3477
3478asn_enc_rval_t
3479Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3480 int ilevel, enum xer_encoder_flags_e flags,
3481 asn_app_consume_bytes_f *cb, void *app_key) {
3482 Utf8_3_1_inherit_TYPE_descriptor(td);
3483 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3484}
3485
3486asn_dec_rval_t
3487Utf8_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3488 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3489 Utf8_3_1_inherit_TYPE_descriptor(td);
3490 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3491}
3492
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003493asn_enc_rval_t
3494Utf8_3_encode_uper(asn_TYPE_descriptor_t *td,
3495 asn_per_constraints_t *constraints,
3496 void *structure, asn_per_outp_t *per_out) {
3497 Utf8_3_1_inherit_TYPE_descriptor(td);
3498 return td->uper_encoder(td, constraints, structure, per_out);
3499}
3500
Lev Walkin59b176e2005-11-26 11:25:14 +00003501
Lev Walkin725883b2006-10-09 12:07:58 +00003502/*** <<< CTDEFS [Utf8-3] >>> ***/
3503
Lev Walkin4b5dae32006-10-09 12:27:44 +00003504static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00003505 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3506 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3507 0, 0 /* No PER value map */
3508};
3509
Lev Walkin59b176e2005-11-26 11:25:14 +00003510/*** <<< STAT-DEFS [Utf8-3] >>> ***/
3511
3512static ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = {
3513 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3514};
Lev Walkin59b176e2005-11-26 11:25:14 +00003515asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
3516 "Utf8-3",
3517 "Utf8-3",
3518 Utf8_3_free,
3519 Utf8_3_print,
3520 Utf8_3_constraint,
3521 Utf8_3_decode_ber,
3522 Utf8_3_encode_der,
3523 Utf8_3_decode_xer,
3524 Utf8_3_encode_xer,
3525 Utf8_3_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003526 Utf8_3_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003527 0, /* Use generic outmost tag fetcher */
3528 asn_DEF_Utf8_3_tags_1,
3529 sizeof(asn_DEF_Utf8_3_tags_1)
3530 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
3531 asn_DEF_Utf8_3_tags_1, /* Same as above */
3532 sizeof(asn_DEF_Utf8_3_tags_1)
3533 /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003534 &asn_PER_type_Utf8_3_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003535 0, 0, /* No members */
3536 0 /* No specifics */
3537};
3538
3539
3540/*** <<< INCLUDES [Utf8-2] >>> ***/
3541
Lev Walkin22b5ed42006-09-13 02:51:20 +00003542#include "Utf8-1.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003543
3544/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
3545
3546typedef Utf8_1_t Utf8_2_t;
3547
3548/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
3549
3550extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
3551asn_struct_free_f Utf8_2_free;
3552asn_struct_print_f Utf8_2_print;
3553asn_constr_check_f Utf8_2_constraint;
3554ber_type_decoder_f Utf8_2_decode_ber;
3555der_type_encoder_f Utf8_2_encode_der;
3556xer_type_decoder_f Utf8_2_decode_xer;
3557xer_type_encoder_f Utf8_2_encode_xer;
3558per_type_decoder_f Utf8_2_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003559per_type_encoder_f Utf8_2_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003560
3561/*** <<< CODE [Utf8-2] >>> ***/
3562
3563int
3564Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003565 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003566 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
3567 size_t size;
3568
3569 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003570 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003571 "%s: value not given (%s:%d)",
3572 td->name, __FILE__, __LINE__);
3573 return -1;
3574 }
3575
3576 size = UTF8String_length(st);
3577 if((ssize_t)size < 0) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003578 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003579 "%s: UTF-8: broken encoding (%s:%d)",
3580 td->name, __FILE__, __LINE__);
3581 return -1;
3582 }
3583
3584 if((size >= 1 && size <= 2)) {
3585 /* Constraint check succeeded */
3586 return 0;
3587 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003588 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003589 "%s: constraint failed (%s:%d)",
3590 td->name, __FILE__, __LINE__);
3591 return -1;
3592 }
3593}
3594
3595/*
3596 * This type is implemented using Utf8_1,
3597 * so here we adjust the DEF accordingly.
3598 */
3599static void
3600Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3601 td->free_struct = asn_DEF_Utf8_1.free_struct;
3602 td->print_struct = asn_DEF_Utf8_1.print_struct;
3603 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
3604 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
3605 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
3606 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
3607 td->uper_decoder = asn_DEF_Utf8_1.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003608 td->uper_encoder = asn_DEF_Utf8_1.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003609 if(!td->per_constraints)
3610 td->per_constraints = asn_DEF_Utf8_1.per_constraints;
3611 td->elements = asn_DEF_Utf8_1.elements;
3612 td->elements_count = asn_DEF_Utf8_1.elements_count;
3613 td->specifics = asn_DEF_Utf8_1.specifics;
3614}
3615
3616void
3617Utf8_2_free(asn_TYPE_descriptor_t *td,
3618 void *struct_ptr, int contents_only) {
3619 Utf8_2_1_inherit_TYPE_descriptor(td);
3620 td->free_struct(td, struct_ptr, contents_only);
3621}
3622
3623int
3624Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3625 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3626 Utf8_2_1_inherit_TYPE_descriptor(td);
3627 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3628}
3629
3630asn_dec_rval_t
3631Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3632 void **structure, const void *bufptr, size_t size, int tag_mode) {
3633 Utf8_2_1_inherit_TYPE_descriptor(td);
3634 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3635}
3636
3637asn_enc_rval_t
3638Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
3639 void *structure, int tag_mode, ber_tlv_tag_t tag,
3640 asn_app_consume_bytes_f *cb, void *app_key) {
3641 Utf8_2_1_inherit_TYPE_descriptor(td);
3642 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3643}
3644
3645asn_dec_rval_t
3646Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3647 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3648 Utf8_2_1_inherit_TYPE_descriptor(td);
3649 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3650}
3651
3652asn_enc_rval_t
3653Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3654 int ilevel, enum xer_encoder_flags_e flags,
3655 asn_app_consume_bytes_f *cb, void *app_key) {
3656 Utf8_2_1_inherit_TYPE_descriptor(td);
3657 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3658}
3659
3660asn_dec_rval_t
3661Utf8_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3662 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3663 Utf8_2_1_inherit_TYPE_descriptor(td);
3664 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3665}
3666
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003667asn_enc_rval_t
3668Utf8_2_encode_uper(asn_TYPE_descriptor_t *td,
3669 asn_per_constraints_t *constraints,
3670 void *structure, asn_per_outp_t *per_out) {
3671 Utf8_2_1_inherit_TYPE_descriptor(td);
3672 return td->uper_encoder(td, constraints, structure, per_out);
3673}
3674
Lev Walkin59b176e2005-11-26 11:25:14 +00003675
Lev Walkin725883b2006-10-09 12:07:58 +00003676/*** <<< CTDEFS [Utf8-2] >>> ***/
3677
Lev Walkin4b5dae32006-10-09 12:27:44 +00003678static asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00003679 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3680 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
3681 0, 0 /* No PER value map */
3682};
3683
Lev Walkin59b176e2005-11-26 11:25:14 +00003684/*** <<< STAT-DEFS [Utf8-2] >>> ***/
3685
3686static ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = {
3687 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3688};
Lev Walkin59b176e2005-11-26 11:25:14 +00003689asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
3690 "Utf8-2",
3691 "Utf8-2",
3692 Utf8_2_free,
3693 Utf8_2_print,
3694 Utf8_2_constraint,
3695 Utf8_2_decode_ber,
3696 Utf8_2_encode_der,
3697 Utf8_2_decode_xer,
3698 Utf8_2_encode_xer,
3699 Utf8_2_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003700 Utf8_2_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003701 0, /* Use generic outmost tag fetcher */
3702 asn_DEF_Utf8_2_tags_1,
3703 sizeof(asn_DEF_Utf8_2_tags_1)
3704 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
3705 asn_DEF_Utf8_2_tags_1, /* Same as above */
3706 sizeof(asn_DEF_Utf8_2_tags_1)
3707 /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00003708 &asn_PER_type_Utf8_2_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00003709 0, 0, /* No members */
3710 0 /* No specifics */
3711};
3712
3713
3714/*** <<< INCLUDES [Utf8-1] >>> ***/
3715
3716#include <UTF8String.h>
3717
3718/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3719
3720typedef UTF8String_t Utf8_1_t;
3721
3722/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3723
3724extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3725asn_struct_free_f Utf8_1_free;
3726asn_struct_print_f Utf8_1_print;
3727asn_constr_check_f Utf8_1_constraint;
3728ber_type_decoder_f Utf8_1_decode_ber;
3729der_type_encoder_f Utf8_1_encode_der;
3730xer_type_decoder_f Utf8_1_decode_xer;
3731xer_type_encoder_f Utf8_1_encode_xer;
3732per_type_decoder_f Utf8_1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003733per_type_encoder_f Utf8_1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003734
3735/*** <<< CODE [Utf8-1] >>> ***/
3736
3737int
3738Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003739 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003740 /* Replace with underlying type checker */
3741 td->check_constraints = asn_DEF_UTF8String.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00003742 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00003743}
3744
3745/*
3746 * This type is implemented using UTF8String,
3747 * so here we adjust the DEF accordingly.
3748 */
3749static void
3750Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3751 td->free_struct = asn_DEF_UTF8String.free_struct;
3752 td->print_struct = asn_DEF_UTF8String.print_struct;
3753 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3754 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3755 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3756 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3757 td->uper_decoder = asn_DEF_UTF8String.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003758 td->uper_encoder = asn_DEF_UTF8String.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003759 if(!td->per_constraints)
3760 td->per_constraints = asn_DEF_UTF8String.per_constraints;
3761 td->elements = asn_DEF_UTF8String.elements;
3762 td->elements_count = asn_DEF_UTF8String.elements_count;
3763 td->specifics = asn_DEF_UTF8String.specifics;
3764}
3765
3766void
3767Utf8_1_free(asn_TYPE_descriptor_t *td,
3768 void *struct_ptr, int contents_only) {
3769 Utf8_1_1_inherit_TYPE_descriptor(td);
3770 td->free_struct(td, struct_ptr, contents_only);
3771}
3772
3773int
3774Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3775 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3776 Utf8_1_1_inherit_TYPE_descriptor(td);
3777 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3778}
3779
3780asn_dec_rval_t
3781Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3782 void **structure, const void *bufptr, size_t size, int tag_mode) {
3783 Utf8_1_1_inherit_TYPE_descriptor(td);
3784 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3785}
3786
3787asn_enc_rval_t
3788Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3789 void *structure, int tag_mode, ber_tlv_tag_t tag,
3790 asn_app_consume_bytes_f *cb, void *app_key) {
3791 Utf8_1_1_inherit_TYPE_descriptor(td);
3792 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3793}
3794
3795asn_dec_rval_t
3796Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3797 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3798 Utf8_1_1_inherit_TYPE_descriptor(td);
3799 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3800}
3801
3802asn_enc_rval_t
3803Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3804 int ilevel, enum xer_encoder_flags_e flags,
3805 asn_app_consume_bytes_f *cb, void *app_key) {
3806 Utf8_1_1_inherit_TYPE_descriptor(td);
3807 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3808}
3809
3810asn_dec_rval_t
3811Utf8_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3812 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
3813 Utf8_1_1_inherit_TYPE_descriptor(td);
3814 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
3815}
3816
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003817asn_enc_rval_t
3818Utf8_1_encode_uper(asn_TYPE_descriptor_t *td,
3819 asn_per_constraints_t *constraints,
3820 void *structure, asn_per_outp_t *per_out) {
3821 Utf8_1_1_inherit_TYPE_descriptor(td);
3822 return td->uper_encoder(td, constraints, structure, per_out);
3823}
3824
Lev Walkin59b176e2005-11-26 11:25:14 +00003825
3826/*** <<< STAT-DEFS [Utf8-1] >>> ***/
3827
3828static ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = {
3829 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3830};
3831asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3832 "Utf8-1",
3833 "Utf8-1",
3834 Utf8_1_free,
3835 Utf8_1_print,
3836 Utf8_1_constraint,
3837 Utf8_1_decode_ber,
3838 Utf8_1_encode_der,
3839 Utf8_1_decode_xer,
3840 Utf8_1_encode_xer,
3841 Utf8_1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003842 Utf8_1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00003843 0, /* Use generic outmost tag fetcher */
3844 asn_DEF_Utf8_1_tags_1,
3845 sizeof(asn_DEF_Utf8_1_tags_1)
3846 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3847 asn_DEF_Utf8_1_tags_1, /* Same as above */
3848 sizeof(asn_DEF_Utf8_1_tags_1)
3849 /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */
3850 0, /* No PER visible constraints */
3851 0, 0, /* No members */
3852 0 /* No specifics */
3853};
3854
3855
3856/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
3857
Lev Walkin22b5ed42006-09-13 02:51:20 +00003858#include "Identifier.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00003859
3860/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
3861
3862typedef Identifier_t VisibleIdentifier_t;
3863
3864/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
3865
3866extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
3867asn_struct_free_f VisibleIdentifier_free;
3868asn_struct_print_f VisibleIdentifier_print;
3869asn_constr_check_f VisibleIdentifier_constraint;
3870ber_type_decoder_f VisibleIdentifier_decode_ber;
3871der_type_encoder_f VisibleIdentifier_encode_der;
3872xer_type_decoder_f VisibleIdentifier_decode_xer;
3873xer_type_encoder_f VisibleIdentifier_encode_xer;
3874per_type_decoder_f VisibleIdentifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003875per_type_encoder_f VisibleIdentifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00003876
3877/*** <<< CTABLES [VisibleIdentifier] >>> ***/
3878
3879static int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00003880 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3881 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
3882 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
3883 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
3884 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
388527,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
3886 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
388754,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00003888};
Lev Walkin5b62ca82006-09-21 01:52:07 +00003889static int permitted_alphabet_code2value_1[64] = {
389036,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
389170,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
389286,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
3893107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
3894};
3895
Lev Walkin59b176e2005-11-26 11:25:14 +00003896
3897static int check_permitted_alphabet_1(const void *sptr) {
3898 int *table = permitted_alphabet_table_1;
3899 /* The underlying type is VisibleString */
3900 const VisibleString_t *st = (const VisibleString_t *)sptr;
3901 const uint8_t *ch = st->buf;
3902 const uint8_t *end = ch + st->size;
3903
3904 for(; ch < end; ch++) {
3905 uint8_t cv = *ch;
3906 if(!table[cv]) return -1;
3907 }
3908 return 0;
3909}
3910
3911
3912/*** <<< CODE [VisibleIdentifier] >>> ***/
3913
3914int
3915VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00003916 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00003917 const Identifier_t *st = (const Identifier_t *)sptr;
3918 size_t size;
3919
3920 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003921 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003922 "%s: value not given (%s:%d)",
3923 td->name, __FILE__, __LINE__);
3924 return -1;
3925 }
3926
3927 size = st->size;
3928
3929 if((size >= 1 && size <= 32)
3930 && !check_permitted_alphabet_1(st)) {
3931 /* Constraint check succeeded */
3932 return 0;
3933 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00003934 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00003935 "%s: constraint failed (%s:%d)",
3936 td->name, __FILE__, __LINE__);
3937 return -1;
3938 }
3939}
3940
3941/*
3942 * This type is implemented using Identifier,
3943 * so here we adjust the DEF accordingly.
3944 */
3945static void
3946VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3947 td->free_struct = asn_DEF_Identifier.free_struct;
3948 td->print_struct = asn_DEF_Identifier.print_struct;
3949 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
3950 td->der_encoder = asn_DEF_Identifier.der_encoder;
3951 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
3952 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
3953 td->uper_decoder = asn_DEF_Identifier.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00003954 td->uper_encoder = asn_DEF_Identifier.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00003955 if(!td->per_constraints)
3956 td->per_constraints = asn_DEF_Identifier.per_constraints;
3957 td->elements = asn_DEF_Identifier.elements;
3958 td->elements_count = asn_DEF_Identifier.elements_count;
3959 td->specifics = asn_DEF_Identifier.specifics;
3960}
3961
3962void
3963VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
3964 void *struct_ptr, int contents_only) {
3965 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3966 td->free_struct(td, struct_ptr, contents_only);
3967}
3968
3969int
3970VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3971 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3972 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3973 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3974}
3975
3976asn_dec_rval_t
3977VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3978 void **structure, const void *bufptr, size_t size, int tag_mode) {
3979 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3980 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3981}
3982
3983asn_enc_rval_t
3984VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
3985 void *structure, int tag_mode, ber_tlv_tag_t tag,
3986 asn_app_consume_bytes_f *cb, void *app_key) {
3987 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3988 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3989}
3990
3991asn_dec_rval_t
3992VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3993 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
3994 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
3995 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3996}
3997
3998asn_enc_rval_t
3999VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4000 int ilevel, enum xer_encoder_flags_e flags,
4001 asn_app_consume_bytes_f *cb, void *app_key) {
4002 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4003 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4004}
4005
4006asn_dec_rval_t
4007VisibleIdentifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4008 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4009 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4010 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4011}
4012
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004013asn_enc_rval_t
4014VisibleIdentifier_encode_uper(asn_TYPE_descriptor_t *td,
4015 asn_per_constraints_t *constraints,
4016 void *structure, asn_per_outp_t *per_out) {
4017 VisibleIdentifier_1_inherit_TYPE_descriptor(td);
4018 return td->uper_encoder(td, constraints, structure, per_out);
4019}
4020
Lev Walkin59b176e2005-11-26 11:25:14 +00004021
4022/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
4023
4024static ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
4025 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
4026};
4027asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
4028 "VisibleIdentifier",
4029 "VisibleIdentifier",
4030 VisibleIdentifier_free,
4031 VisibleIdentifier_print,
4032 VisibleIdentifier_constraint,
4033 VisibleIdentifier_decode_ber,
4034 VisibleIdentifier_encode_der,
4035 VisibleIdentifier_decode_xer,
4036 VisibleIdentifier_encode_xer,
4037 VisibleIdentifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004038 VisibleIdentifier_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004039 0, /* Use generic outmost tag fetcher */
4040 asn_DEF_VisibleIdentifier_tags_1,
4041 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4042 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
4043 asn_DEF_VisibleIdentifier_tags_1, /* Same as above */
4044 sizeof(asn_DEF_VisibleIdentifier_tags_1)
4045 /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
4046 0, /* No PER visible constraints */
4047 0, 0, /* No members */
4048 0 /* No specifics */
4049};
4050
4051
4052/*** <<< INCLUDES [Sequence] >>> ***/
4053
Lev Walkin22b5ed42006-09-13 02:51:20 +00004054#include "Int1.h"
4055#include "Int4.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004056#include <BOOLEAN.h>
Lev Walkin2a744a72013-03-27 01:56:23 -07004057#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00004058#include <NULL.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +00004059#include "Int5.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004060#include <constr_SEQUENCE.h>
4061
4062/*** <<< DEPS [Sequence] >>> ***/
4063
4064typedef enum enum_c {
4065 enum_c_one = 1,
4066 enum_c_two = 2,
4067 /*
4068 * Enumeration is extensible
4069 */
4070 enum_c_three = 3
Lev Walkin171487e2006-03-21 07:25:18 +00004071} e_enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00004072
4073/*** <<< TYPE-DECLS [Sequence] >>> ***/
4074
4075typedef struct Sequence {
4076 Int1_t *int1_c /* DEFAULT 3 */;
4077 Int4_t int4;
4078 Int4_t int4_c;
Lev Walkin2a744a72013-03-27 01:56:23 -07004079 BOOLEAN_t *Bool /* DEFAULT 1 */;
4080 long enum_c;
Lev Walkin59b176e2005-11-26 11:25:14 +00004081 NULL_t *null /* OPTIONAL */;
4082 /*
4083 * This type is extensible,
4084 * possible extensions are below.
4085 */
4086 Int5_t *int5_c /* OPTIONAL */;
4087
4088 /* Context for parsing across buffer boundaries */
4089 asn_struct_ctx_t _asn_ctx;
4090} Sequence_t;
4091
4092/*** <<< FUNC-DECLS [Sequence] >>> ***/
4093
4094/* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */
4095extern asn_TYPE_descriptor_t asn_DEF_Sequence;
4096
4097/*** <<< CODE [Sequence] >>> ***/
4098
4099static int
4100enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004101 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004102 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -07004103 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004104 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004105}
4106
4107/*
Lev Walkin2a744a72013-03-27 01:56:23 -07004108 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00004109 * so here we adjust the DEF accordingly.
4110 */
4111static void
4112enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -07004113 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4114 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
4115 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4116 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4117 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4118 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4119 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
4120 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004121 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -07004122 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4123 td->elements = asn_DEF_NativeEnumerated.elements;
4124 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4125 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
Lev Walkin59b176e2005-11-26 11:25:14 +00004126}
4127
4128static void
4129enum_c_6_free(asn_TYPE_descriptor_t *td,
4130 void *struct_ptr, int contents_only) {
4131 enum_c_6_inherit_TYPE_descriptor(td);
4132 td->free_struct(td, struct_ptr, contents_only);
4133}
4134
4135static int
4136enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4137 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4138 enum_c_6_inherit_TYPE_descriptor(td);
4139 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4140}
4141
4142static asn_dec_rval_t
4143enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4144 void **structure, const void *bufptr, size_t size, int tag_mode) {
4145 enum_c_6_inherit_TYPE_descriptor(td);
4146 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4147}
4148
4149static asn_enc_rval_t
4150enum_c_6_encode_der(asn_TYPE_descriptor_t *td,
4151 void *structure, int tag_mode, ber_tlv_tag_t tag,
4152 asn_app_consume_bytes_f *cb, void *app_key) {
4153 enum_c_6_inherit_TYPE_descriptor(td);
4154 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4155}
4156
4157static asn_dec_rval_t
4158enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4159 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4160 enum_c_6_inherit_TYPE_descriptor(td);
4161 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4162}
4163
4164static asn_enc_rval_t
4165enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4166 int ilevel, enum xer_encoder_flags_e flags,
4167 asn_app_consume_bytes_f *cb, void *app_key) {
4168 enum_c_6_inherit_TYPE_descriptor(td);
4169 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4170}
4171
4172static asn_dec_rval_t
4173enum_c_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4174 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4175 enum_c_6_inherit_TYPE_descriptor(td);
4176 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4177}
4178
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004179static asn_enc_rval_t
4180enum_c_6_encode_uper(asn_TYPE_descriptor_t *td,
4181 asn_per_constraints_t *constraints,
4182 void *structure, asn_per_outp_t *per_out) {
4183 enum_c_6_inherit_TYPE_descriptor(td);
4184 return td->uper_encoder(td, constraints, structure, per_out);
4185}
4186
Lev Walkin59b176e2005-11-26 11:25:14 +00004187static int
4188memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004189 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004190 long value;
4191
4192 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004193 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004194 "%s: value not given (%s:%d)",
4195 td->name, __FILE__, __LINE__);
4196 return -1;
4197 }
4198
Lev Walkin2a744a72013-03-27 01:56:23 -07004199 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004200
4201 if((value >= -2)) {
4202 /* Constraint check succeeded */
4203 return 0;
4204 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004205 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004206 "%s: constraint failed (%s:%d)",
4207 td->name, __FILE__, __LINE__);
4208 return -1;
4209 }
4210}
4211
4212static int
4213memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004214 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004215 long value;
4216
4217 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004218 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004219 "%s: value not given (%s:%d)",
4220 td->name, __FILE__, __LINE__);
4221 return -1;
4222 }
4223
Lev Walkin2a744a72013-03-27 01:56:23 -07004224 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004225
4226 if((value >= 5 && value <= 7)) {
4227 /* Constraint check succeeded */
4228 return 0;
4229 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004230 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004231 "%s: constraint failed (%s:%d)",
4232 td->name, __FILE__, __LINE__);
4233 return -1;
4234 }
4235}
4236
4237static int
4238memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004239 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004240 long value;
4241
4242 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004243 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004244 "%s: value not given (%s:%d)",
4245 td->name, __FILE__, __LINE__);
4246 return -1;
4247 }
4248
Lev Walkin2a744a72013-03-27 01:56:23 -07004249 value = *(const long *)sptr;
Lev Walkin59b176e2005-11-26 11:25:14 +00004250
4251 if((value == 5)) {
4252 /* Constraint check succeeded */
4253 return 0;
4254 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004255 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004256 "%s: constraint failed (%s:%d)",
4257 td->name, __FILE__, __LINE__);
4258 return -1;
4259 }
4260}
4261
4262
Lev Walkin725883b2006-10-09 12:07:58 +00004263/*** <<< CTDEFS [Sequence] >>> ***/
4264
Lev Walkin4b5dae32006-10-09 12:27:44 +00004265static asn_per_constraints_t asn_PER_type_enum_c_constr_6 = {
Lev Walkin725883b2006-10-09 12:07:58 +00004266 { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
4267 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4268 0, 0 /* No PER value map */
4269};
Lev Walkin4b5dae32006-10-09 12:27:44 +00004270static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 = {
Lev Walkin725883b2006-10-09 12:07:58 +00004271 { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */,
4272 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4273 0, 0 /* No PER value map */
4274};
Lev Walkin4b5dae32006-10-09 12:27:44 +00004275static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 = {
Lev Walkin725883b2006-10-09 12:07:58 +00004276 { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */,
4277 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4278 0, 0 /* No PER value map */
4279};
Lev Walkin4b5dae32006-10-09 12:27:44 +00004280static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 = {
Lev Walkin725883b2006-10-09 12:07:58 +00004281 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */,
4282 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4283 0, 0 /* No PER value map */
4284};
4285
Lev Walkin59b176e2005-11-26 11:25:14 +00004286/*** <<< STAT-DEFS [Sequence] >>> ***/
4287
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004288static int asn_DFL_2_set_3(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004289 Int1_t *st = *sptr;
4290
4291 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004292 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004293 st = (*sptr = CALLOC(1, sizeof(*st)));
4294 if(!st) return -1;
4295 }
4296
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004297 if(set_value) {
4298 /* Install default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07004299 *st = 3;
4300 return 0;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004301 } else {
4302 /* Test default value 3 */
Lev Walkin2a744a72013-03-27 01:56:23 -07004303 return (*st == 3);
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004304 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004305}
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004306static int asn_DFL_5_set_1(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004307 BOOLEAN_t *st = *sptr;
4308
4309 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004310 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +00004311 st = (*sptr = CALLOC(1, sizeof(*st)));
4312 if(!st) return -1;
4313 }
4314
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004315 if(set_value) {
4316 /* Install default value 1 */
4317 *st = 1;
4318 return 0;
4319 } else {
4320 /* Test default value 1 */
4321 return (*st == 1);
4322 }
Lev Walkin59b176e2005-11-26 11:25:14 +00004323}
4324static asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = {
4325 { 1, 3, "one" },
4326 { 2, 3, "two" },
4327 { 3, 5, "three" }
4328 /* This list is extensible */
4329};
4330static unsigned int asn_MAP_enum_c_enum2value_6[] = {
4331 0, /* one(1) */
4332 2, /* three(3) */
4333 1 /* two(2) */
4334 /* This list is extensible */
4335};
4336static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = {
4337 asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */
4338 asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */
4339 3, /* Number of elements in the maps */
4340 3, /* Extensions before this member */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004341 1, /* Strict enumeration */
4342 0, /* Native long size */
4343 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004344};
4345static ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = {
4346 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4347};
Lev Walkin59b176e2005-11-26 11:25:14 +00004348static /* Use -fall-defs-global to expose */
4349asn_TYPE_descriptor_t asn_DEF_enum_c_6 = {
4350 "enum-c",
4351 "enum-c",
4352 enum_c_6_free,
4353 enum_c_6_print,
4354 enum_c_6_constraint,
4355 enum_c_6_decode_ber,
4356 enum_c_6_encode_der,
4357 enum_c_6_decode_xer,
4358 enum_c_6_encode_xer,
4359 enum_c_6_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004360 enum_c_6_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004361 0, /* Use generic outmost tag fetcher */
4362 asn_DEF_enum_c_tags_6,
4363 sizeof(asn_DEF_enum_c_tags_6)
4364 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
4365 asn_DEF_enum_c_tags_6, /* Same as above */
4366 sizeof(asn_DEF_enum_c_tags_6)
4367 /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004368 &asn_PER_type_enum_c_constr_6,
Lev Walkin59b176e2005-11-26 11:25:14 +00004369 0, 0, /* Defined elsewhere */
4370 &asn_SPC_enum_c_specs_6 /* Additional specs */
4371};
4372
Lev Walkin59b176e2005-11-26 11:25:14 +00004373static asn_TYPE_member_t asn_MBR_Sequence_1[] = {
4374 { ATF_POINTER, 1, offsetof(struct Sequence, int1_c),
4375 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4376 .tag_mode = 0,
4377 .type = &asn_DEF_Int1,
4378 .memb_constraints = memb_int1_c_constraint_1,
Lev Walkin4b5dae32006-10-09 12:27:44 +00004379 .per_constraints = &asn_PER_memb_int1_c_constr_2,
Lev Walkin59b176e2005-11-26 11:25:14 +00004380 .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */
4381 .name = "int1-c"
4382 },
4383 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4),
4384 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
4385 .tag_mode = +1, /* EXPLICIT tag at current level */
4386 .type = &asn_DEF_Int4,
4387 .memb_constraints = 0, /* Defer constraints checking to the member type */
4388 .per_constraints = 0, /* No PER visible constraints */
4389 .default_value = 0,
4390 .name = "int4"
4391 },
4392 { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c),
4393 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4394 .tag_mode = 0,
4395 .type = &asn_DEF_Int4,
4396 .memb_constraints = memb_int4_c_constraint_1,
Lev Walkin4b5dae32006-10-09 12:27:44 +00004397 .per_constraints = &asn_PER_memb_int4_c_constr_4,
Lev Walkin59b176e2005-11-26 11:25:14 +00004398 .default_value = 0,
4399 .name = "int4-c"
4400 },
Lev Walkin2a744a72013-03-27 01:56:23 -07004401 { ATF_POINTER, 1, offsetof(struct Sequence, Bool),
Lev Walkin59b176e2005-11-26 11:25:14 +00004402 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
4403 .tag_mode = 0,
4404 .type = &asn_DEF_BOOLEAN,
4405 .memb_constraints = 0, /* Defer constraints checking to the member type */
4406 .per_constraints = 0, /* No PER visible constraints */
4407 .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */
4408 .name = "bool"
4409 },
4410 { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c),
4411 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
4412 .tag_mode = 0,
4413 .type = &asn_DEF_enum_c_6,
4414 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin07aaa342006-10-09 12:52:15 +00004415 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +00004416 .default_value = 0,
4417 .name = "enum-c"
4418 },
4419 { ATF_POINTER, 2, offsetof(struct Sequence, null),
4420 .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)),
4421 .tag_mode = 0,
4422 .type = &asn_DEF_NULL,
4423 .memb_constraints = 0, /* Defer constraints checking to the member type */
4424 .per_constraints = 0, /* No PER visible constraints */
4425 .default_value = 0,
4426 .name = "null"
4427 },
4428 { ATF_POINTER, 1, offsetof(struct Sequence, int5_c),
4429 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
4430 .tag_mode = 0,
4431 .type = &asn_DEF_Int5,
4432 .memb_constraints = memb_int5_c_constraint_1,
Lev Walkin4b5dae32006-10-09 12:27:44 +00004433 .per_constraints = &asn_PER_memb_int5_c_constr_13,
Lev Walkin59b176e2005-11-26 11:25:14 +00004434 .default_value = 0,
4435 .name = "int5-c"
4436 },
4437};
4438static int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 };
4439static ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = {
4440 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4441};
4442static asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = {
4443 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool at 59 */
4444 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c at 56 */
4445 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c at 58 */
4446 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c at 62 */
4447 { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null at 64 */
4448 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c at 60 */
4449 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 at 57 */
4450};
4451static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = {
4452 sizeof(struct Sequence),
4453 offsetof(struct Sequence, _asn_ctx),
4454 asn_MAP_Sequence_tag2el_1,
4455 7, /* Count of tags in the map */
4456 asn_MAP_Sequence_oms_1, /* Optional members */
4457 3, 1, /* Root/Additions */
4458 5, /* Start extensions */
4459 8 /* Stop extensions */
4460};
4461asn_TYPE_descriptor_t asn_DEF_Sequence = {
4462 "Sequence",
4463 "Sequence",
4464 SEQUENCE_free,
4465 SEQUENCE_print,
4466 SEQUENCE_constraint,
4467 SEQUENCE_decode_ber,
4468 SEQUENCE_encode_der,
4469 SEQUENCE_decode_xer,
4470 SEQUENCE_encode_xer,
4471 SEQUENCE_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004472 SEQUENCE_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004473 0, /* Use generic outmost tag fetcher */
4474 asn_DEF_Sequence_tags_1,
4475 sizeof(asn_DEF_Sequence_tags_1)
4476 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4477 asn_DEF_Sequence_tags_1, /* Same as above */
4478 sizeof(asn_DEF_Sequence_tags_1)
4479 /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */
4480 0, /* No PER visible constraints */
4481 asn_MBR_Sequence_1,
4482 7, /* Elements count */
4483 &asn_SPC_Sequence_specs_1 /* Additional specs */
4484};
4485
4486
4487/*** <<< INCLUDES [SequenceOf] >>> ***/
4488
4489#include <asn_SEQUENCE_OF.h>
4490#include <constr_SEQUENCE_OF.h>
4491
4492/*** <<< FWD-DECLS [SequenceOf] >>> ***/
4493
4494struct Sequence;
4495
4496/*** <<< TYPE-DECLS [SequenceOf] >>> ***/
4497
4498typedef struct SequenceOf {
4499 A_SEQUENCE_OF(struct Sequence) list;
4500
4501 /* Context for parsing across buffer boundaries */
4502 asn_struct_ctx_t _asn_ctx;
4503} SequenceOf_t;
4504
4505/*** <<< FUNC-DECLS [SequenceOf] >>> ***/
4506
4507extern asn_TYPE_descriptor_t asn_DEF_SequenceOf;
4508
4509/*** <<< POST-INCLUDE [SequenceOf] >>> ***/
4510
Lev Walkin22b5ed42006-09-13 02:51:20 +00004511#include "Sequence.h"
Lev Walkin59b176e2005-11-26 11:25:14 +00004512
Lev Walkin725883b2006-10-09 12:07:58 +00004513/*** <<< CTDEFS [SequenceOf] >>> ***/
4514
Lev Walkin4b5dae32006-10-09 12:27:44 +00004515static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00004516 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4517 { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */,
4518 0, 0 /* No PER value map */
4519};
4520
Lev Walkin59b176e2005-11-26 11:25:14 +00004521/*** <<< STAT-DEFS [SequenceOf] >>> ***/
4522
4523static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = {
4524 { ATF_POINTER, 0, 0,
4525 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
4526 .tag_mode = 0,
4527 .type = &asn_DEF_Sequence,
4528 .memb_constraints = 0, /* Defer constraints checking to the member type */
4529 .per_constraints = 0, /* No PER visible constraints */
4530 .default_value = 0,
4531 .name = ""
4532 },
4533};
4534static ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = {
4535 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
4536};
4537static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = {
4538 sizeof(struct SequenceOf),
4539 offsetof(struct SequenceOf, _asn_ctx),
4540 0, /* XER encoding is XMLDelimitedItemList */
4541};
Lev Walkin59b176e2005-11-26 11:25:14 +00004542asn_TYPE_descriptor_t asn_DEF_SequenceOf = {
4543 "SequenceOf",
4544 "SequenceOf",
4545 SEQUENCE_OF_free,
4546 SEQUENCE_OF_print,
4547 SEQUENCE_OF_constraint,
4548 SEQUENCE_OF_decode_ber,
4549 SEQUENCE_OF_encode_der,
4550 SEQUENCE_OF_decode_xer,
4551 SEQUENCE_OF_encode_xer,
4552 SEQUENCE_OF_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004553 SEQUENCE_OF_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004554 0, /* Use generic outmost tag fetcher */
4555 asn_DEF_SequenceOf_tags_1,
4556 sizeof(asn_DEF_SequenceOf_tags_1)
4557 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
4558 asn_DEF_SequenceOf_tags_1, /* Same as above */
4559 sizeof(asn_DEF_SequenceOf_tags_1)
4560 /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004561 &asn_PER_type_SequenceOf_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004562 asn_MBR_SequenceOf_1,
4563 1, /* Single element */
4564 &asn_SPC_SequenceOf_specs_1 /* Additional specs */
4565};
4566
4567
4568/*** <<< INCLUDES [Enum0] >>> ***/
4569
Lev Walkin2a744a72013-03-27 01:56:23 -07004570#include <NativeEnumerated.h>
Lev Walkin59b176e2005-11-26 11:25:14 +00004571
4572/*** <<< DEPS [Enum0] >>> ***/
4573
4574typedef enum Enum0 {
4575 Enum0_one = 0,
4576 Enum0_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004577} e_Enum0;
Lev Walkin59b176e2005-11-26 11:25:14 +00004578
4579/*** <<< TYPE-DECLS [Enum0] >>> ***/
4580
Lev Walkin2a744a72013-03-27 01:56:23 -07004581typedef long Enum0_t;
Lev Walkin59b176e2005-11-26 11:25:14 +00004582
4583/*** <<< FUNC-DECLS [Enum0] >>> ***/
4584
4585extern asn_TYPE_descriptor_t asn_DEF_Enum0;
4586asn_struct_free_f Enum0_free;
4587asn_struct_print_f Enum0_print;
4588asn_constr_check_f Enum0_constraint;
4589ber_type_decoder_f Enum0_decode_ber;
4590der_type_encoder_f Enum0_encode_der;
4591xer_type_decoder_f Enum0_decode_xer;
4592xer_type_encoder_f Enum0_encode_xer;
4593per_type_decoder_f Enum0_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004594per_type_encoder_f Enum0_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004595
4596/*** <<< CODE [Enum0] >>> ***/
4597
4598int
4599Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004600 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004601 /* Replace with underlying type checker */
Lev Walkin2a744a72013-03-27 01:56:23 -07004602 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00004603 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin59b176e2005-11-26 11:25:14 +00004604}
4605
4606/*
Lev Walkin2a744a72013-03-27 01:56:23 -07004607 * This type is implemented using NativeEnumerated,
Lev Walkin59b176e2005-11-26 11:25:14 +00004608 * so here we adjust the DEF accordingly.
4609 */
4610static void
4611Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin2a744a72013-03-27 01:56:23 -07004612 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4613 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
4614 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4615 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4616 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4617 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4618 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
4619 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004620 if(!td->per_constraints)
Lev Walkin2a744a72013-03-27 01:56:23 -07004621 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4622 td->elements = asn_DEF_NativeEnumerated.elements;
4623 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4624 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
Lev Walkin59b176e2005-11-26 11:25:14 +00004625}
4626
4627void
4628Enum0_free(asn_TYPE_descriptor_t *td,
4629 void *struct_ptr, int contents_only) {
4630 Enum0_1_inherit_TYPE_descriptor(td);
4631 td->free_struct(td, struct_ptr, contents_only);
4632}
4633
4634int
4635Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4636 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4637 Enum0_1_inherit_TYPE_descriptor(td);
4638 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4639}
4640
4641asn_dec_rval_t
4642Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4643 void **structure, const void *bufptr, size_t size, int tag_mode) {
4644 Enum0_1_inherit_TYPE_descriptor(td);
4645 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4646}
4647
4648asn_enc_rval_t
4649Enum0_encode_der(asn_TYPE_descriptor_t *td,
4650 void *structure, int tag_mode, ber_tlv_tag_t tag,
4651 asn_app_consume_bytes_f *cb, void *app_key) {
4652 Enum0_1_inherit_TYPE_descriptor(td);
4653 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4654}
4655
4656asn_dec_rval_t
4657Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4658 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4659 Enum0_1_inherit_TYPE_descriptor(td);
4660 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4661}
4662
4663asn_enc_rval_t
4664Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4665 int ilevel, enum xer_encoder_flags_e flags,
4666 asn_app_consume_bytes_f *cb, void *app_key) {
4667 Enum0_1_inherit_TYPE_descriptor(td);
4668 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4669}
4670
4671asn_dec_rval_t
4672Enum0_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4673 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4674 Enum0_1_inherit_TYPE_descriptor(td);
4675 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4676}
4677
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004678asn_enc_rval_t
4679Enum0_encode_uper(asn_TYPE_descriptor_t *td,
4680 asn_per_constraints_t *constraints,
4681 void *structure, asn_per_outp_t *per_out) {
4682 Enum0_1_inherit_TYPE_descriptor(td);
4683 return td->uper_encoder(td, constraints, structure, per_out);
4684}
4685
Lev Walkin59b176e2005-11-26 11:25:14 +00004686
Lev Walkin725883b2006-10-09 12:07:58 +00004687/*** <<< CTDEFS [Enum0] >>> ***/
4688
Lev Walkin4b5dae32006-10-09 12:27:44 +00004689static asn_per_constraints_t asn_PER_type_Enum0_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00004690 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4691 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4692 0, 0 /* No PER value map */
4693};
4694
Lev Walkin59b176e2005-11-26 11:25:14 +00004695/*** <<< STAT-DEFS [Enum0] >>> ***/
4696
4697static asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = {
4698 { 0, 3, "one" },
4699 { 1, 3, "two" }
4700};
4701static unsigned int asn_MAP_Enum0_enum2value_1[] = {
4702 0, /* one(0) */
4703 1 /* two(1) */
4704};
4705static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = {
4706 asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */
4707 asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */
4708 2, /* Number of elements in the maps */
4709 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004710 1, /* Strict enumeration */
4711 0, /* Native long size */
4712 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004713};
4714static ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = {
4715 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4716};
Lev Walkin59b176e2005-11-26 11:25:14 +00004717asn_TYPE_descriptor_t asn_DEF_Enum0 = {
4718 "Enum0",
4719 "Enum0",
4720 Enum0_free,
4721 Enum0_print,
4722 Enum0_constraint,
4723 Enum0_decode_ber,
4724 Enum0_encode_der,
4725 Enum0_decode_xer,
4726 Enum0_encode_xer,
4727 Enum0_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004728 Enum0_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004729 0, /* Use generic outmost tag fetcher */
4730 asn_DEF_Enum0_tags_1,
4731 sizeof(asn_DEF_Enum0_tags_1)
4732 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
4733 asn_DEF_Enum0_tags_1, /* Same as above */
4734 sizeof(asn_DEF_Enum0_tags_1)
4735 /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004736 &asn_PER_type_Enum0_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004737 0, 0, /* Defined elsewhere */
4738 &asn_SPC_Enum0_specs_1 /* Additional specs */
4739};
4740
4741
4742/*** <<< INCLUDES [Enum1] >>> ***/
4743
4744#include <NativeEnumerated.h>
4745
4746/*** <<< DEPS [Enum1] >>> ***/
4747
4748typedef enum Enum1 {
4749 Enum1_one = 0,
4750 Enum1_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +00004751} e_Enum1;
Lev Walkin59b176e2005-11-26 11:25:14 +00004752
4753/*** <<< TYPE-DECLS [Enum1] >>> ***/
4754
4755typedef long Enum1_t;
4756
4757/*** <<< FUNC-DECLS [Enum1] >>> ***/
4758
4759extern asn_TYPE_descriptor_t asn_DEF_Enum1;
4760asn_struct_free_f Enum1_free;
4761asn_struct_print_f Enum1_print;
4762asn_constr_check_f Enum1_constraint;
4763ber_type_decoder_f Enum1_decode_ber;
4764der_type_encoder_f Enum1_encode_der;
4765xer_type_decoder_f Enum1_decode_xer;
4766xer_type_encoder_f Enum1_encode_xer;
4767per_type_decoder_f Enum1_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004768per_type_encoder_f Enum1_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004769
4770/*** <<< CODE [Enum1] >>> ***/
4771
4772int
4773Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004774 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004775 long value;
4776
4777 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004778 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004779 "%s: value not given (%s:%d)",
4780 td->name, __FILE__, __LINE__);
4781 return -1;
4782 }
4783
4784 value = *(const long *)sptr;
4785
4786 if((value == 0)) {
4787 /* Constraint check succeeded */
4788 return 0;
4789 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004790 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004791 "%s: constraint failed (%s:%d)",
4792 td->name, __FILE__, __LINE__);
4793 return -1;
4794 }
4795}
4796
4797/*
4798 * This type is implemented using NativeEnumerated,
4799 * so here we adjust the DEF accordingly.
4800 */
4801static void
4802Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
4803 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
4804 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
4805 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
4806 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
4807 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
4808 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
4809 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004810 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00004811 if(!td->per_constraints)
4812 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
4813 td->elements = asn_DEF_NativeEnumerated.elements;
4814 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
4815 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
4816}
4817
4818void
4819Enum1_free(asn_TYPE_descriptor_t *td,
4820 void *struct_ptr, int contents_only) {
4821 Enum1_1_inherit_TYPE_descriptor(td);
4822 td->free_struct(td, struct_ptr, contents_only);
4823}
4824
4825int
4826Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
4827 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
4828 Enum1_1_inherit_TYPE_descriptor(td);
4829 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
4830}
4831
4832asn_dec_rval_t
4833Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4834 void **structure, const void *bufptr, size_t size, int tag_mode) {
4835 Enum1_1_inherit_TYPE_descriptor(td);
4836 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
4837}
4838
4839asn_enc_rval_t
4840Enum1_encode_der(asn_TYPE_descriptor_t *td,
4841 void *structure, int tag_mode, ber_tlv_tag_t tag,
4842 asn_app_consume_bytes_f *cb, void *app_key) {
4843 Enum1_1_inherit_TYPE_descriptor(td);
4844 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
4845}
4846
4847asn_dec_rval_t
4848Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4849 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
4850 Enum1_1_inherit_TYPE_descriptor(td);
4851 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
4852}
4853
4854asn_enc_rval_t
4855Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
4856 int ilevel, enum xer_encoder_flags_e flags,
4857 asn_app_consume_bytes_f *cb, void *app_key) {
4858 Enum1_1_inherit_TYPE_descriptor(td);
4859 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
4860}
4861
4862asn_dec_rval_t
4863Enum1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
4864 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
4865 Enum1_1_inherit_TYPE_descriptor(td);
4866 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
4867}
4868
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004869asn_enc_rval_t
4870Enum1_encode_uper(asn_TYPE_descriptor_t *td,
4871 asn_per_constraints_t *constraints,
4872 void *structure, asn_per_outp_t *per_out) {
4873 Enum1_1_inherit_TYPE_descriptor(td);
4874 return td->uper_encoder(td, constraints, structure, per_out);
4875}
4876
Lev Walkin59b176e2005-11-26 11:25:14 +00004877
Lev Walkin725883b2006-10-09 12:07:58 +00004878/*** <<< CTDEFS [Enum1] >>> ***/
4879
Lev Walkin4b5dae32006-10-09 12:27:44 +00004880static asn_per_constraints_t asn_PER_type_Enum1_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00004881 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
4882 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
4883 0, 0 /* No PER value map */
4884};
4885
Lev Walkin59b176e2005-11-26 11:25:14 +00004886/*** <<< STAT-DEFS [Enum1] >>> ***/
4887
4888static asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = {
4889 { 0, 3, "one" },
4890 { 1, 3, "two" }
4891};
4892static unsigned int asn_MAP_Enum1_enum2value_1[] = {
4893 0, /* one(0) */
4894 1 /* two(1) */
4895};
4896static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = {
4897 asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */
4898 asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */
4899 2, /* Number of elements in the maps */
4900 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +00004901 1, /* Strict enumeration */
4902 0, /* Native long size */
4903 0
Lev Walkin59b176e2005-11-26 11:25:14 +00004904};
4905static ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = {
4906 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
4907};
Lev Walkin59b176e2005-11-26 11:25:14 +00004908asn_TYPE_descriptor_t asn_DEF_Enum1 = {
4909 "Enum1",
4910 "Enum1",
4911 Enum1_free,
4912 Enum1_print,
4913 Enum1_constraint,
4914 Enum1_decode_ber,
4915 Enum1_encode_der,
4916 Enum1_decode_xer,
4917 Enum1_encode_xer,
4918 Enum1_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004919 Enum1_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00004920 0, /* Use generic outmost tag fetcher */
4921 asn_DEF_Enum1_tags_1,
4922 sizeof(asn_DEF_Enum1_tags_1)
4923 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
4924 asn_DEF_Enum1_tags_1, /* Same as above */
4925 sizeof(asn_DEF_Enum1_tags_1)
4926 /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00004927 &asn_PER_type_Enum1_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00004928 0, 0, /* Defined elsewhere */
4929 &asn_SPC_Enum1_specs_1 /* Additional specs */
4930};
4931
4932
4933/*** <<< INCLUDES [Identifier] >>> ***/
4934
4935#include <VisibleString.h>
4936
4937/*** <<< TYPE-DECLS [Identifier] >>> ***/
4938
4939typedef VisibleString_t Identifier_t;
4940
4941/*** <<< FUNC-DECLS [Identifier] >>> ***/
4942
4943extern asn_TYPE_descriptor_t asn_DEF_Identifier;
4944asn_struct_free_f Identifier_free;
4945asn_struct_print_f Identifier_print;
4946asn_constr_check_f Identifier_constraint;
4947ber_type_decoder_f Identifier_decode_ber;
4948der_type_encoder_f Identifier_encode_der;
4949xer_type_decoder_f Identifier_decode_xer;
4950xer_type_encoder_f Identifier_encode_xer;
4951per_type_decoder_f Identifier_decode_uper;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00004952per_type_encoder_f Identifier_encode_uper;
Lev Walkin59b176e2005-11-26 11:25:14 +00004953
4954/*** <<< CTABLES [Identifier] >>> ***/
4955
4956static int permitted_alphabet_table_1[256] = {
Lev Walkin5b62ca82006-09-21 01:52:07 +00004957 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4958 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
4959 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */
4960 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */
4961 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */
496227,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */
4963 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */
496454,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
Lev Walkin59b176e2005-11-26 11:25:14 +00004965};
Lev Walkin5b62ca82006-09-21 01:52:07 +00004966static int permitted_alphabet_code2value_1[64] = {
496736,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,
496870,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,
496986,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106,
4970107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,
4971};
4972
Lev Walkin59b176e2005-11-26 11:25:14 +00004973
4974static int check_permitted_alphabet_1(const void *sptr) {
4975 int *table = permitted_alphabet_table_1;
4976 /* The underlying type is VisibleString */
4977 const VisibleString_t *st = (const VisibleString_t *)sptr;
4978 const uint8_t *ch = st->buf;
4979 const uint8_t *end = ch + st->size;
4980
4981 for(; ch < end; ch++) {
4982 uint8_t cv = *ch;
4983 if(!table[cv]) return -1;
4984 }
4985 return 0;
4986}
4987
4988
4989/*** <<< CODE [Identifier] >>> ***/
4990
4991int
4992Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00004993 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin59b176e2005-11-26 11:25:14 +00004994 const VisibleString_t *st = (const VisibleString_t *)sptr;
4995 size_t size;
4996
4997 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00004998 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00004999 "%s: value not given (%s:%d)",
5000 td->name, __FILE__, __LINE__);
5001 return -1;
5002 }
5003
5004 size = st->size;
5005
5006 if((size >= 1 && size <= 32)
5007 && !check_permitted_alphabet_1(st)) {
5008 /* Constraint check succeeded */
5009 return 0;
5010 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00005011 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin59b176e2005-11-26 11:25:14 +00005012 "%s: constraint failed (%s:%d)",
5013 td->name, __FILE__, __LINE__);
5014 return -1;
5015 }
5016}
5017
Lev Walkin725883b2006-10-09 12:07:58 +00005018static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) {
5019 if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
5020 return -1;
5021 return permitted_alphabet_table_1[value] - 1;
5022}
5023static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) {
5024 if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
5025 return -1;
5026 return permitted_alphabet_code2value_1[code];
5027}
Lev Walkin59b176e2005-11-26 11:25:14 +00005028/*
5029 * This type is implemented using VisibleString,
5030 * so here we adjust the DEF accordingly.
5031 */
5032static void
5033Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
5034 td->free_struct = asn_DEF_VisibleString.free_struct;
5035 td->print_struct = asn_DEF_VisibleString.print_struct;
5036 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
5037 td->der_encoder = asn_DEF_VisibleString.der_encoder;
5038 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
5039 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
5040 td->uper_decoder = asn_DEF_VisibleString.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005041 td->uper_encoder = asn_DEF_VisibleString.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00005042 if(!td->per_constraints)
5043 td->per_constraints = asn_DEF_VisibleString.per_constraints;
5044 td->elements = asn_DEF_VisibleString.elements;
5045 td->elements_count = asn_DEF_VisibleString.elements_count;
5046 td->specifics = asn_DEF_VisibleString.specifics;
5047}
5048
5049void
5050Identifier_free(asn_TYPE_descriptor_t *td,
5051 void *struct_ptr, int contents_only) {
5052 Identifier_1_inherit_TYPE_descriptor(td);
5053 td->free_struct(td, struct_ptr, contents_only);
5054}
5055
5056int
5057Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
5058 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
5059 Identifier_1_inherit_TYPE_descriptor(td);
5060 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
5061}
5062
5063asn_dec_rval_t
5064Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5065 void **structure, const void *bufptr, size_t size, int tag_mode) {
5066 Identifier_1_inherit_TYPE_descriptor(td);
5067 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
5068}
5069
5070asn_enc_rval_t
5071Identifier_encode_der(asn_TYPE_descriptor_t *td,
5072 void *structure, int tag_mode, ber_tlv_tag_t tag,
5073 asn_app_consume_bytes_f *cb, void *app_key) {
5074 Identifier_1_inherit_TYPE_descriptor(td);
5075 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
5076}
5077
5078asn_dec_rval_t
5079Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5080 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
5081 Identifier_1_inherit_TYPE_descriptor(td);
5082 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
5083}
5084
5085asn_enc_rval_t
5086Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
5087 int ilevel, enum xer_encoder_flags_e flags,
5088 asn_app_consume_bytes_f *cb, void *app_key) {
5089 Identifier_1_inherit_TYPE_descriptor(td);
5090 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
5091}
5092
5093asn_dec_rval_t
5094Identifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
5095 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
5096 Identifier_1_inherit_TYPE_descriptor(td);
5097 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
5098}
5099
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005100asn_enc_rval_t
5101Identifier_encode_uper(asn_TYPE_descriptor_t *td,
5102 asn_per_constraints_t *constraints,
5103 void *structure, asn_per_outp_t *per_out) {
5104 Identifier_1_inherit_TYPE_descriptor(td);
5105 return td->uper_encoder(td, constraints, structure, per_out);
5106}
5107
Lev Walkin59b176e2005-11-26 11:25:14 +00005108
Lev Walkin725883b2006-10-09 12:07:58 +00005109/*** <<< CTDEFS [Identifier] >>> ***/
5110
Lev Walkin4b5dae32006-10-09 12:27:44 +00005111static asn_per_constraints_t asn_PER_type_Identifier_constr_1 = {
Lev Walkin725883b2006-10-09 12:07:58 +00005112 { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */,
5113 { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
5114 asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */
5115 asn_PER_MAP_Identifier_1_c2v /* PER code to value map */
5116};
5117
Lev Walkin59b176e2005-11-26 11:25:14 +00005118/*** <<< STAT-DEFS [Identifier] >>> ***/
5119
5120static ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = {
5121 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
5122};
Lev Walkin59b176e2005-11-26 11:25:14 +00005123asn_TYPE_descriptor_t asn_DEF_Identifier = {
5124 "Identifier",
5125 "Identifier",
5126 Identifier_free,
5127 Identifier_print,
5128 Identifier_constraint,
5129 Identifier_decode_ber,
5130 Identifier_encode_der,
5131 Identifier_decode_xer,
5132 Identifier_encode_xer,
5133 Identifier_decode_uper,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00005134 Identifier_encode_uper,
Lev Walkin59b176e2005-11-26 11:25:14 +00005135 0, /* Use generic outmost tag fetcher */
5136 asn_DEF_Identifier_tags_1,
5137 sizeof(asn_DEF_Identifier_tags_1)
5138 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
5139 asn_DEF_Identifier_tags_1, /* Same as above */
5140 sizeof(asn_DEF_Identifier_tags_1)
5141 /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */
Lev Walkin4b5dae32006-10-09 12:27:44 +00005142 &asn_PER_type_Identifier_constr_1,
Lev Walkin59b176e2005-11-26 11:25:14 +00005143 0, 0, /* No members */
5144 0 /* No specifics */
5145};
5146