blob: 0def1eee34c51de3a97c5b1b07737bb01df3e712 [file] [log] [blame]
vlm0b567bf2005-03-04 22:18:20 +00001
2/*** <<< INCLUDES [Type] >>> ***/
3
4#include <asn_SEQUENCE_OF.h>
5#include <constr_SEQUENCE_OF.h>
6#include <constr_SEQUENCE.h>
7
8/*** <<< FWD-DECLS [Type] >>> ***/
9
vlm5feb7522005-03-04 23:50:56 +000010struct Epyt;
vlm0b567bf2005-03-04 22:18:20 +000011
12/*** <<< TYPE-DECLS [Type] >>> ***/
13
14typedef struct Type {
15 struct data {
16 A_SEQUENCE_OF(struct Epyt) list;
17
18 /* Context for parsing across buffer boundaries */
19 asn_struct_ctx_t _asn_ctx;
20 } data;
21
22 /* Context for parsing across buffer boundaries */
23 asn_struct_ctx_t _asn_ctx;
24} Type_t;
25
26/*** <<< FUNC-DECLS [Type] >>> ***/
27
28extern asn_TYPE_descriptor_t asn_DEF_Type;
29
30/*** <<< POST-INCLUDE [Type] >>> ***/
31
vlm1f7df782005-03-04 23:48:19 +000032#include <EpytRef.h>
vlm0b567bf2005-03-04 22:18:20 +000033
34/*** <<< STAT-DEFS [Type] >>> ***/
35
36static asn_TYPE_member_t asn_MBR_data_2[] = {
37 { ATF_NOFLAGS, 0, 0,
38 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
39 .tag_mode = 0,
vlm1f7df782005-03-04 23:48:19 +000040 .type = (void *)&asn_DEF_EpytRef,
vlm0b567bf2005-03-04 22:18:20 +000041 .memb_constraints = 0, /* Defer constraints checking to the member type */
42 .name = ""
43 },
44};
45static ber_tlv_tag_t asn_DEF_data_2_tags[] = {
46 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
47};
48static asn_SET_OF_specifics_t asn_SPC_data_2_specs = {
49 sizeof(struct data),
50 offsetof(struct data, _asn_ctx),
51 0, /* XER encoding is XMLDelimitedItemList */
52};
53static /* Use -fall-defs-global to expose */
54asn_TYPE_descriptor_t asn_DEF_data_2 = {
55 "data",
56 "data",
57 SEQUENCE_OF_free,
58 SEQUENCE_OF_print,
59 SEQUENCE_OF_constraint,
60 SEQUENCE_OF_decode_ber,
61 SEQUENCE_OF_encode_der,
62 SEQUENCE_OF_decode_xer,
63 SEQUENCE_OF_encode_xer,
64 0, /* Use generic outmost tag fetcher */
65 asn_DEF_data_2_tags,
66 sizeof(asn_DEF_data_2_tags)
67 /sizeof(asn_DEF_data_2_tags[0]), /* 1 */
68 asn_DEF_data_2_tags, /* Same as above */
69 sizeof(asn_DEF_data_2_tags)
70 /sizeof(asn_DEF_data_2_tags[0]), /* 1 */
71 asn_MBR_data_2,
72 1, /* Single element */
73 &asn_SPC_data_2_specs /* Additional specs */
74};
75
76static asn_TYPE_member_t asn_MBR_Type_1[] = {
77 { ATF_NOFLAGS, 0, offsetof(struct Type, data),
78 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
79 .tag_mode = 0,
80 .type = (void *)&asn_DEF_data_2,
81 .memb_constraints = 0, /* Defer constraints checking to the member type */
82 .name = "data"
83 },
84};
85static ber_tlv_tag_t asn_DEF_Type_1_tags[] = {
86 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
87};
88static asn_TYPE_tag2member_t asn_MAP_Type_1_tag2el[] = {
89 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data at 16 */
90};
91static asn_SEQUENCE_specifics_t asn_SPC_Type_1_specs = {
92 sizeof(struct Type),
93 offsetof(struct Type, _asn_ctx),
94 asn_MAP_Type_1_tag2el,
95 1, /* Count of tags in the map */
96 -1, /* Start extensions */
97 -1 /* Stop extensions */
98};
99asn_TYPE_descriptor_t asn_DEF_Type = {
100 "Type",
101 "Type",
102 SEQUENCE_free,
103 SEQUENCE_print,
104 SEQUENCE_constraint,
105 SEQUENCE_decode_ber,
106 SEQUENCE_encode_der,
107 SEQUENCE_decode_xer,
108 SEQUENCE_encode_xer,
109 0, /* Use generic outmost tag fetcher */
110 asn_DEF_Type_1_tags,
111 sizeof(asn_DEF_Type_1_tags)
112 /sizeof(asn_DEF_Type_1_tags[0]), /* 1 */
113 asn_DEF_Type_1_tags, /* Same as above */
114 sizeof(asn_DEF_Type_1_tags)
115 /sizeof(asn_DEF_Type_1_tags[0]), /* 1 */
116 asn_MBR_Type_1,
117 1, /* Elements count */
118 &asn_SPC_Type_1_specs /* Additional specs */
119};
120
121
vlm1f7df782005-03-04 23:48:19 +0000122/*** <<< INCLUDES [EpytRef] >>> ***/
123
124#include <Epyt.h>
125
126/*** <<< TYPE-DECLS [EpytRef] >>> ***/
127
128typedef Epyt_t EpytRef_t;
129
130/*** <<< FUNC-DECLS [EpytRef] >>> ***/
131
132extern asn_TYPE_descriptor_t asn_DEF_EpytRef;
133asn_struct_free_f EpytRef_free;
134asn_struct_print_f EpytRef_print;
135asn_constr_check_f EpytRef_constraint;
136ber_type_decoder_f EpytRef_decode_ber;
137der_type_encoder_f EpytRef_encode_der;
138xer_type_decoder_f EpytRef_decode_xer;
139xer_type_encoder_f EpytRef_encode_xer;
140
141/*** <<< CODE [EpytRef] >>> ***/
142
143int
144EpytRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
145 asn_app_consume_bytes_f *app_errlog, void *app_key) {
146 /* Replace with underlying type checker */
147 td->check_constraints = asn_DEF_Epyt.check_constraints;
148 return td->check_constraints(td, sptr, app_errlog, app_key);
149}
150
151/*
152 * This type is implemented using Epyt,
153 * so here we adjust the DEF accordingly.
154 */
155static void
vlm67d57fe2005-03-06 09:29:03 +0000156EpytRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
vlm1f7df782005-03-04 23:48:19 +0000157 td->free_struct = asn_DEF_Epyt.free_struct;
158 td->print_struct = asn_DEF_Epyt.print_struct;
159 td->ber_decoder = asn_DEF_Epyt.ber_decoder;
160 td->der_encoder = asn_DEF_Epyt.der_encoder;
161 td->xer_decoder = asn_DEF_Epyt.xer_decoder;
162 td->xer_encoder = asn_DEF_Epyt.xer_encoder;
163 td->elements = asn_DEF_Epyt.elements;
164 td->elements_count = asn_DEF_Epyt.elements_count;
165 td->specifics = asn_DEF_Epyt.specifics;
166}
167
168void
169EpytRef_free(asn_TYPE_descriptor_t *td,
170 void *struct_ptr, int contents_only) {
vlm67d57fe2005-03-06 09:29:03 +0000171 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000172 td->free_struct(td, struct_ptr, contents_only);
173}
174
175int
176EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
177 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
vlm67d57fe2005-03-06 09:29:03 +0000178 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000179 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
180}
181
182asn_dec_rval_t
183EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000184 void **structure, const void *bufptr, size_t size, int tag_mode) {
vlm67d57fe2005-03-06 09:29:03 +0000185 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000186 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
187}
188
189asn_enc_rval_t
190EpytRef_encode_der(asn_TYPE_descriptor_t *td,
191 void *structure, int tag_mode, ber_tlv_tag_t tag,
192 asn_app_consume_bytes_f *cb, void *app_key) {
vlm67d57fe2005-03-06 09:29:03 +0000193 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000194 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
195}
196
197asn_dec_rval_t
198EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000199 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
vlm67d57fe2005-03-06 09:29:03 +0000200 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000201 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
202}
203
204asn_enc_rval_t
205EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
206 int ilevel, enum xer_encoder_flags_e flags,
207 asn_app_consume_bytes_f *cb, void *app_key) {
vlm67d57fe2005-03-06 09:29:03 +0000208 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000209 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
210}
211
212
213/*** <<< STAT-DEFS [EpytRef] >>> ***/
214
vlm67d57fe2005-03-06 09:29:03 +0000215static ber_tlv_tag_t asn_DEF_EpytRef_1_tags[] = {
vlm1f7df782005-03-04 23:48:19 +0000216 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
217};
218asn_TYPE_descriptor_t asn_DEF_EpytRef = {
219 "EpytRef",
220 "EpytRef",
221 EpytRef_free,
222 EpytRef_print,
223 EpytRef_constraint,
224 EpytRef_decode_ber,
225 EpytRef_encode_der,
226 EpytRef_decode_xer,
227 EpytRef_encode_xer,
228 0, /* Use generic outmost tag fetcher */
vlm67d57fe2005-03-06 09:29:03 +0000229 asn_DEF_EpytRef_1_tags,
230 sizeof(asn_DEF_EpytRef_1_tags)
231 /sizeof(asn_DEF_EpytRef_1_tags[0]), /* 1 */
232 asn_DEF_EpytRef_1_tags, /* Same as above */
233 sizeof(asn_DEF_EpytRef_1_tags)
234 /sizeof(asn_DEF_EpytRef_1_tags[0]), /* 1 */
vlm1f7df782005-03-04 23:48:19 +0000235 0, 0, /* Defined elsewhere */
236 0 /* No specifics */
237};
238
239
vlm0b567bf2005-03-04 22:18:20 +0000240/*** <<< INCLUDES [Epyt] >>> ***/
241
242#include <asn_SET_OF.h>
243#include <constr_SET_OF.h>
244#include <constr_SEQUENCE.h>
245
246/*** <<< FWD-DECLS [Epyt] >>> ***/
247
vlm5feb7522005-03-04 23:50:56 +0000248struct Type;
249struct Ypet;
vlm0b567bf2005-03-04 22:18:20 +0000250
251/*** <<< TYPE-DECLS [Epyt] >>> ***/
252
253typedef struct Epyt {
254 struct stype {
255 A_SET_OF(struct Type) list;
256
257 /* Context for parsing across buffer boundaries */
258 asn_struct_ctx_t _asn_ctx;
259 } stype;
260 struct Type *type /* OPTIONAL */;
261 struct Ypet *ypet /* OPTIONAL */;
262
263 /* Context for parsing across buffer boundaries */
264 asn_struct_ctx_t _asn_ctx;
265} Epyt_t;
266
267/*** <<< FUNC-DECLS [Epyt] >>> ***/
268
269extern asn_TYPE_descriptor_t asn_DEF_Epyt;
270
271/*** <<< POST-INCLUDE [Epyt] >>> ***/
272
273#include <Type.h>
274#include <Ypet.h>
275
276/*** <<< STAT-DEFS [Epyt] >>> ***/
277
278static asn_TYPE_member_t asn_MBR_stype_2[] = {
279 { ATF_NOFLAGS, 0, 0,
280 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
281 .tag_mode = 0,
282 .type = (void *)&asn_DEF_Type,
283 .memb_constraints = 0, /* Defer constraints checking to the member type */
284 .name = ""
285 },
286};
287static ber_tlv_tag_t asn_DEF_stype_2_tags[] = {
288 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
289};
290static asn_SET_OF_specifics_t asn_SPC_stype_2_specs = {
291 sizeof(struct stype),
292 offsetof(struct stype, _asn_ctx),
293 0, /* XER encoding is XMLDelimitedItemList */
294};
295static /* Use -fall-defs-global to expose */
296asn_TYPE_descriptor_t asn_DEF_stype_2 = {
297 "stype",
298 "stype",
299 SET_OF_free,
300 SET_OF_print,
301 SET_OF_constraint,
302 SET_OF_decode_ber,
303 SET_OF_encode_der,
304 SET_OF_decode_xer,
305 SET_OF_encode_xer,
306 0, /* Use generic outmost tag fetcher */
307 asn_DEF_stype_2_tags,
308 sizeof(asn_DEF_stype_2_tags)
309 /sizeof(asn_DEF_stype_2_tags[0]), /* 1 */
310 asn_DEF_stype_2_tags, /* Same as above */
311 sizeof(asn_DEF_stype_2_tags)
312 /sizeof(asn_DEF_stype_2_tags[0]), /* 1 */
313 asn_MBR_stype_2,
314 1, /* Single element */
315 &asn_SPC_stype_2_specs /* Additional specs */
316};
317
318static asn_TYPE_member_t asn_MBR_Epyt_1[] = {
319 { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype),
320 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
321 .tag_mode = 0,
322 .type = (void *)&asn_DEF_stype_2,
323 .memb_constraints = 0, /* Defer constraints checking to the member type */
324 .name = "stype"
325 },
326 { ATF_POINTER, 2, offsetof(struct Epyt, type),
327 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
328 .tag_mode = 0,
329 .type = (void *)&asn_DEF_Type,
330 .memb_constraints = 0, /* Defer constraints checking to the member type */
331 .name = "type"
332 },
333 { ATF_POINTER, 1, offsetof(struct Epyt, ypet),
334 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
335 .tag_mode = 0,
336 .type = (void *)&asn_DEF_Ypet,
337 .memb_constraints = 0, /* Defer constraints checking to the member type */
338 .name = "ypet"
339 },
340};
341static ber_tlv_tag_t asn_DEF_Epyt_1_tags[] = {
342 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
343};
344static asn_TYPE_tag2member_t asn_MAP_Epyt_1_tag2el[] = {
345 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type at 22 */
346 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype at 21 */
347 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet at 23 */
348};
349static asn_SEQUENCE_specifics_t asn_SPC_Epyt_1_specs = {
350 sizeof(struct Epyt),
351 offsetof(struct Epyt, _asn_ctx),
352 asn_MAP_Epyt_1_tag2el,
353 3, /* Count of tags in the map */
354 -1, /* Start extensions */
355 -1 /* Stop extensions */
356};
357asn_TYPE_descriptor_t asn_DEF_Epyt = {
358 "Epyt",
359 "Epyt",
360 SEQUENCE_free,
361 SEQUENCE_print,
362 SEQUENCE_constraint,
363 SEQUENCE_decode_ber,
364 SEQUENCE_encode_der,
365 SEQUENCE_decode_xer,
366 SEQUENCE_encode_xer,
367 0, /* Use generic outmost tag fetcher */
368 asn_DEF_Epyt_1_tags,
369 sizeof(asn_DEF_Epyt_1_tags)
370 /sizeof(asn_DEF_Epyt_1_tags[0]), /* 1 */
371 asn_DEF_Epyt_1_tags, /* Same as above */
372 sizeof(asn_DEF_Epyt_1_tags)
373 /sizeof(asn_DEF_Epyt_1_tags[0]), /* 1 */
374 asn_MBR_Epyt_1,
375 3, /* Elements count */
376 &asn_SPC_Epyt_1_specs /* Additional specs */
377};
378
379
380/*** <<< INCLUDES [Ypet] >>> ***/
381
382#include <Epyt.h>
383#include <INTEGER.h>
vlm67d57fe2005-03-06 09:29:03 +0000384#include <IA5String.h>
vlm6c5d5e52005-03-04 22:38:22 +0000385#include <EnumType.h>
386#include <asn_SET_OF.h>
387#include <constr_SET_OF.h>
vlm0b567bf2005-03-04 22:18:20 +0000388#include <constr_SET.h>
389
390/*** <<< DEPS [Ypet] >>> ***/
391
392
393/*
394 * Method of determining the components presence
395 */
396typedef enum Ypet_PR {
397 Ypet_PR_epyt, /* Member epyt is present */
398 Ypet_PR_plain, /* Member plain is present */
vlm6c5d5e52005-03-04 22:38:22 +0000399 Ypet_PR_senums, /* Member senums is present */
vlm67d57fe2005-03-06 09:29:03 +0000400 Ypet_PR_patest1, /* Member patest1 is present */
401 Ypet_PR_patest2, /* Member patest2 is present */
vlm0b567bf2005-03-04 22:18:20 +0000402} Ypet_PR;
403
404/*** <<< TYPE-DECLS [Ypet] >>> ***/
405
406typedef struct Ypet {
407 Epyt_t epyt;
408 INTEGER_t *plain /* DEFAULT 7 */;
vlm6c5d5e52005-03-04 22:38:22 +0000409 struct senums {
410 A_SET_OF(EnumType_t) list;
411
412 /* Context for parsing across buffer boundaries */
413 asn_struct_ctx_t _asn_ctx;
414 } senums;
vlm67d57fe2005-03-06 09:29:03 +0000415 IA5String_t patest1;
416 IA5String_t patest2;
vlm0b567bf2005-03-04 22:18:20 +0000417
418 /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
419 unsigned int _presence_map
vlm67d57fe2005-03-06 09:29:03 +0000420 [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
vlm0b567bf2005-03-04 22:18:20 +0000421
422 /* Context for parsing across buffer boundaries */
423 asn_struct_ctx_t _asn_ctx;
424} Ypet_t;
425
426/*** <<< FUNC-DECLS [Ypet] >>> ***/
427
428extern asn_TYPE_descriptor_t asn_DEF_Ypet;
429
vlm67d57fe2005-03-06 09:29:03 +0000430/*** <<< CTABLES [Ypet] >>> ***/
431
432static int check_permitted_alphabet_6(const void *sptr) {
433 /* The underlying type is IA5String */
434 const IA5String_t *st = (const IA5String_t *)sptr;
435 const uint8_t *ch = st->buf;
436 const uint8_t *end = ch + st->size;
437
438 for(; ch < end; ch++) {
439 uint8_t cv = *ch;
440 if(!(cv >= 65 && cv <= 90)) return -1;
441 }
442 return 0;
443}
444
445static int check_permitted_alphabet_7(const void *sptr) {
446 /* The underlying type is IA5String */
447 const IA5String_t *st = (const IA5String_t *)sptr;
448 const uint8_t *ch = st->buf;
449 const uint8_t *end = ch + st->size;
450
451 for(; ch < end; ch++) {
452 uint8_t cv = *ch;
453 if(!(cv >= 97 && cv <= 122)) return -1;
454 }
455 return 0;
456}
457
458
459/*** <<< CODE [Ypet] >>> ***/
460
461static int
462memb_patest1_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
463 asn_app_consume_bytes_f *app_errlog, void *app_key) {
464 const IA5String_t *st = (const IA5String_t *)sptr;
465
466 if(!sptr) {
467 _ASN_ERRLOG(app_errlog, app_key,
468 "%s: value not given (%s:%d)",
469 td->name, __FILE__, __LINE__);
470 return -1;
471 }
472
473
474 if(!check_permitted_alphabet_6(st)) {
475 /* Constraint check succeeded */
476 return 0;
477 } else {
478 _ASN_ERRLOG(app_errlog, app_key,
479 "%s: constraint failed (%s:%d)",
480 td->name, __FILE__, __LINE__);
481 return -1;
482 }
483}
484
485static int
486memb_patest2_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
487 asn_app_consume_bytes_f *app_errlog, void *app_key) {
488 const IA5String_t *st = (const IA5String_t *)sptr;
489
490 if(!sptr) {
491 _ASN_ERRLOG(app_errlog, app_key,
492 "%s: value not given (%s:%d)",
493 td->name, __FILE__, __LINE__);
494 return -1;
495 }
496
497
498 if(!check_permitted_alphabet_7(st)) {
499 /* Constraint check succeeded */
500 return 0;
501 } else {
502 _ASN_ERRLOG(app_errlog, app_key,
503 "%s: constraint failed (%s:%d)",
504 td->name, __FILE__, __LINE__);
505 return -1;
506 }
507}
508
509
vlm0b567bf2005-03-04 22:18:20 +0000510/*** <<< STAT-DEFS [Ypet] >>> ***/
511
vlm67d57fe2005-03-06 09:29:03 +0000512static asn_TYPE_member_t asn_MBR_senums_4[] = {
vlm6c5d5e52005-03-04 22:38:22 +0000513 { ATF_NOFLAGS, 0, 0,
514 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
515 .tag_mode = 0,
516 .type = (void *)&asn_DEF_EnumType,
517 .memb_constraints = 0, /* Defer constraints checking to the member type */
518 .name = ""
519 },
520};
vlm67d57fe2005-03-06 09:29:03 +0000521static ber_tlv_tag_t asn_DEF_senums_4_tags[] = {
vlm6c5d5e52005-03-04 22:38:22 +0000522 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
523};
vlm67d57fe2005-03-06 09:29:03 +0000524static asn_SET_OF_specifics_t asn_SPC_senums_4_specs = {
vlm6c5d5e52005-03-04 22:38:22 +0000525 sizeof(struct senums),
526 offsetof(struct senums, _asn_ctx),
527 1, /* XER encoding is XMLValueList */
528};
529static /* Use -fall-defs-global to expose */
vlm67d57fe2005-03-06 09:29:03 +0000530asn_TYPE_descriptor_t asn_DEF_senums_4 = {
vlm6c5d5e52005-03-04 22:38:22 +0000531 "senums",
532 "senums",
533 SET_OF_free,
534 SET_OF_print,
535 SET_OF_constraint,
536 SET_OF_decode_ber,
537 SET_OF_encode_der,
538 SET_OF_decode_xer,
539 SET_OF_encode_xer,
540 0, /* Use generic outmost tag fetcher */
vlm67d57fe2005-03-06 09:29:03 +0000541 asn_DEF_senums_4_tags,
542 sizeof(asn_DEF_senums_4_tags)
543 /sizeof(asn_DEF_senums_4_tags[0]), /* 1 */
544 asn_DEF_senums_4_tags, /* Same as above */
545 sizeof(asn_DEF_senums_4_tags)
546 /sizeof(asn_DEF_senums_4_tags[0]), /* 1 */
547 asn_MBR_senums_4,
vlm6c5d5e52005-03-04 22:38:22 +0000548 1, /* Single element */
vlm67d57fe2005-03-06 09:29:03 +0000549 &asn_SPC_senums_4_specs /* Additional specs */
vlm6c5d5e52005-03-04 22:38:22 +0000550};
551
vlm0b567bf2005-03-04 22:18:20 +0000552static asn_TYPE_member_t asn_MBR_Ypet_1[] = {
553 { ATF_NOFLAGS, 0, offsetof(struct Ypet, epyt),
554 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
555 .tag_mode = 0,
556 .type = (void *)&asn_DEF_Epyt,
557 .memb_constraints = 0, /* Defer constraints checking to the member type */
558 .name = "epyt"
559 },
560 { ATF_POINTER, 1, offsetof(struct Ypet, plain),
561 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
562 .tag_mode = 0,
563 .type = (void *)&asn_DEF_INTEGER,
564 .memb_constraints = 0, /* Defer constraints checking to the member type */
565 .name = "plain"
566 },
vlm6c5d5e52005-03-04 22:38:22 +0000567 { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
568 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
569 .tag_mode = 0,
vlm67d57fe2005-03-06 09:29:03 +0000570 .type = (void *)&asn_DEF_senums_4,
vlm6c5d5e52005-03-04 22:38:22 +0000571 .memb_constraints = 0, /* Defer constraints checking to the member type */
572 .name = "senums"
573 },
vlm67d57fe2005-03-06 09:29:03 +0000574 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),
575 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
576 .tag_mode = +1, /* EXPLICIT tag at current level */
577 .type = (void *)&asn_DEF_IA5String,
578 .memb_constraints = memb_patest1_1_constraint,
579 .name = "patest1"
580 },
581 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),
582 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
583 .tag_mode = +1, /* EXPLICIT tag at current level */
584 .type = (void *)&asn_DEF_IA5String,
585 .memb_constraints = memb_patest2_1_constraint,
586 .name = "patest2"
587 },
vlm0b567bf2005-03-04 22:18:20 +0000588};
589static ber_tlv_tag_t asn_DEF_Ypet_1_tags[] = {
590 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
591};
592static asn_TYPE_tag2member_t asn_MAP_Ypet_1_tag2el[] = {
593 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain at 28 */
vlm6c5d5e52005-03-04 22:38:22 +0000594 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt at 27 */
vlm67d57fe2005-03-06 09:29:03 +0000595 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums at 29 */
596 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 at 30 */
597 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 at 31 */
vlm0b567bf2005-03-04 22:18:20 +0000598};
vlm67d57fe2005-03-06 09:29:03 +0000599static uint8_t asn_MAP_Ypet_1_mmap[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {
600 (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)
vlm0b567bf2005-03-04 22:18:20 +0000601};
602static asn_SET_specifics_t asn_SPC_Ypet_1_specs = {
603 sizeof(struct Ypet),
604 offsetof(struct Ypet, _asn_ctx),
605 offsetof(struct Ypet, _presence_map),
606 asn_MAP_Ypet_1_tag2el,
vlm67d57fe2005-03-06 09:29:03 +0000607 5, /* Count of tags in the map */
vlm0b567bf2005-03-04 22:18:20 +0000608 asn_MAP_Ypet_1_tag2el, /* Same as above */
vlm67d57fe2005-03-06 09:29:03 +0000609 5, /* Count of tags in the CXER map */
vlm0b567bf2005-03-04 22:18:20 +0000610 0, /* Whether extensible */
611 (unsigned int *)asn_MAP_Ypet_1_mmap /* Mandatory elements map */
612};
613asn_TYPE_descriptor_t asn_DEF_Ypet = {
614 "Ypet",
615 "Ypet",
616 SET_free,
617 SET_print,
618 SET_constraint,
619 SET_decode_ber,
620 SET_encode_der,
621 SET_decode_xer,
622 SET_encode_xer,
623 0, /* Use generic outmost tag fetcher */
624 asn_DEF_Ypet_1_tags,
625 sizeof(asn_DEF_Ypet_1_tags)
626 /sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */
627 asn_DEF_Ypet_1_tags, /* Same as above */
628 sizeof(asn_DEF_Ypet_1_tags)
629 /sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */
630 asn_MBR_Ypet_1,
vlm67d57fe2005-03-06 09:29:03 +0000631 5, /* Elements count */
vlm0b567bf2005-03-04 22:18:20 +0000632 &asn_SPC_Ypet_1_specs /* Additional specs */
633};
634
vlm6c5d5e52005-03-04 22:38:22 +0000635
636/*** <<< INCLUDES [EnumType] >>> ***/
637
638#include <ENUMERATED.h>
639
640/*** <<< DEPS [EnumType] >>> ***/
641
642typedef enum EnumType {
643 EnumType_one = 0,
644 EnumType_two = 1
645} EnumType_e;
646
647/*** <<< TYPE-DECLS [EnumType] >>> ***/
648
649typedef ENUMERATED_t EnumType_t;
650
651/*** <<< FUNC-DECLS [EnumType] >>> ***/
652
653extern asn_TYPE_descriptor_t asn_DEF_EnumType;
654asn_struct_free_f EnumType_free;
655asn_struct_print_f EnumType_print;
656asn_constr_check_f EnumType_constraint;
657ber_type_decoder_f EnumType_decode_ber;
658der_type_encoder_f EnumType_encode_der;
659xer_type_decoder_f EnumType_decode_xer;
660xer_type_encoder_f EnumType_encode_xer;
661
662/*** <<< CODE [EnumType] >>> ***/
663
664int
665EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
666 asn_app_consume_bytes_f *app_errlog, void *app_key) {
667 /* Replace with underlying type checker */
668 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
669 return td->check_constraints(td, sptr, app_errlog, app_key);
670}
671
672/*
673 * This type is implemented using ENUMERATED,
674 * so here we adjust the DEF accordingly.
675 */
676static void
677EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
678 td->free_struct = asn_DEF_ENUMERATED.free_struct;
679 td->print_struct = asn_DEF_ENUMERATED.print_struct;
680 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
681 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
682 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
683 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
684 td->elements = asn_DEF_ENUMERATED.elements;
685 td->elements_count = asn_DEF_ENUMERATED.elements_count;
vlm541def92005-03-29 19:05:37 +0000686 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
vlm6c5d5e52005-03-04 22:38:22 +0000687}
688
689void
690EnumType_free(asn_TYPE_descriptor_t *td,
691 void *struct_ptr, int contents_only) {
692 EnumType_1_inherit_TYPE_descriptor(td);
693 td->free_struct(td, struct_ptr, contents_only);
694}
695
696int
697EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
698 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
699 EnumType_1_inherit_TYPE_descriptor(td);
700 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
701}
702
703asn_dec_rval_t
704EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000705 void **structure, const void *bufptr, size_t size, int tag_mode) {
vlm6c5d5e52005-03-04 22:38:22 +0000706 EnumType_1_inherit_TYPE_descriptor(td);
707 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
708}
709
710asn_enc_rval_t
711EnumType_encode_der(asn_TYPE_descriptor_t *td,
712 void *structure, int tag_mode, ber_tlv_tag_t tag,
713 asn_app_consume_bytes_f *cb, void *app_key) {
714 EnumType_1_inherit_TYPE_descriptor(td);
715 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
716}
717
718asn_dec_rval_t
719EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000720 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
vlm6c5d5e52005-03-04 22:38:22 +0000721 EnumType_1_inherit_TYPE_descriptor(td);
722 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
723}
724
725asn_enc_rval_t
726EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
727 int ilevel, enum xer_encoder_flags_e flags,
728 asn_app_consume_bytes_f *cb, void *app_key) {
729 EnumType_1_inherit_TYPE_descriptor(td);
730 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
731}
732
733
734/*** <<< STAT-DEFS [EnumType] >>> ***/
735
736static asn_INTEGER_enum_map_t asn_MAP_EnumType_1_value2enum[] = {
737 { 0, 3, "one" },
738 { 1, 3, "two" }
739};
740static unsigned int asn_MAP_EnumType_1_enum2value[] = {
741 0, /* one(0) */
742 1 /* two(1) */
743};
744static asn_INTEGER_specifics_t asn_SPC_EnumType_1_specs = {
745 asn_MAP_EnumType_1_value2enum, /* "tag" => N; sorted by tag */
746 asn_MAP_EnumType_1_enum2value, /* N => "tag"; sorted by N */
747 2, /* Number of elements in the maps */
748 0, /* Enumeration is not extensible */
749 1 /* Strict enumeration */
750};
751static ber_tlv_tag_t asn_DEF_EnumType_1_tags[] = {
752 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
753};
754asn_TYPE_descriptor_t asn_DEF_EnumType = {
755 "EnumType",
756 "EnumType",
757 EnumType_free,
758 EnumType_print,
759 EnumType_constraint,
760 EnumType_decode_ber,
761 EnumType_encode_der,
762 EnumType_decode_xer,
763 EnumType_encode_xer,
764 0, /* Use generic outmost tag fetcher */
765 asn_DEF_EnumType_1_tags,
766 sizeof(asn_DEF_EnumType_1_tags)
767 /sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */
768 asn_DEF_EnumType_1_tags, /* Same as above */
769 sizeof(asn_DEF_EnumType_1_tags)
770 /sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */
771 0, 0, /* Defined elsewhere */
772 &asn_SPC_EnumType_1_specs /* Additional specs */
773};
774