blob: 5fe6fc333e8405be7b799ea78d695cf45101deda [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[] = {
vlm2cebdf32005-08-16 16:57:17 +000037 { ATF_POINTER, 0, 0,
vlm0b567bf2005-03-04 22:18:20 +000038 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
39 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +000040 .type = &asn_DEF_EpytRef,
vlm0b567bf2005-03-04 22:18:20 +000041 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +000042 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
43 .default_value = 0,
vlm0b567bf2005-03-04 22:18:20 +000044 .name = ""
45 },
46};
vlm337167e2005-11-26 11:25:14 +000047static ber_tlv_tag_t asn_DEF_data_tags_2[] = {
vlm0b567bf2005-03-04 22:18:20 +000048 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
49};
vlm337167e2005-11-26 11:25:14 +000050static asn_SET_OF_specifics_t asn_SPC_data_specs_2 = {
vlm0b567bf2005-03-04 22:18:20 +000051 sizeof(struct data),
52 offsetof(struct data, _asn_ctx),
53 0, /* XER encoding is XMLDelimitedItemList */
54};
55static /* Use -fall-defs-global to expose */
56asn_TYPE_descriptor_t asn_DEF_data_2 = {
57 "data",
58 "data",
59 SEQUENCE_OF_free,
60 SEQUENCE_OF_print,
61 SEQUENCE_OF_constraint,
62 SEQUENCE_OF_decode_ber,
63 SEQUENCE_OF_encode_der,
64 SEQUENCE_OF_decode_xer,
65 SEQUENCE_OF_encode_xer,
vlm337167e2005-11-26 11:25:14 +000066 0, /* No PER decoder, -gen-PER to enable */
vlm0b567bf2005-03-04 22:18:20 +000067 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +000068 asn_DEF_data_tags_2,
69 sizeof(asn_DEF_data_tags_2)
70 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
71 asn_DEF_data_tags_2, /* Same as above */
72 sizeof(asn_DEF_data_tags_2)
73 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
74 0, /* No PER visible constraints */
vlm0b567bf2005-03-04 22:18:20 +000075 asn_MBR_data_2,
76 1, /* Single element */
vlm337167e2005-11-26 11:25:14 +000077 &asn_SPC_data_specs_2 /* Additional specs */
vlm0b567bf2005-03-04 22:18:20 +000078};
79
80static asn_TYPE_member_t asn_MBR_Type_1[] = {
81 { ATF_NOFLAGS, 0, offsetof(struct Type, data),
82 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
83 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +000084 .type = &asn_DEF_data_2,
vlm0b567bf2005-03-04 22:18:20 +000085 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +000086 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
87 .default_value = 0,
vlm0b567bf2005-03-04 22:18:20 +000088 .name = "data"
89 },
90};
vlm337167e2005-11-26 11:25:14 +000091static ber_tlv_tag_t asn_DEF_Type_tags_1[] = {
vlm0b567bf2005-03-04 22:18:20 +000092 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
93};
vlm337167e2005-11-26 11:25:14 +000094static asn_TYPE_tag2member_t asn_MAP_Type_tag2el_1[] = {
vlm0b567bf2005-03-04 22:18:20 +000095 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data at 16 */
96};
vlm337167e2005-11-26 11:25:14 +000097static asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1 = {
vlm0b567bf2005-03-04 22:18:20 +000098 sizeof(struct Type),
99 offsetof(struct Type, _asn_ctx),
vlm337167e2005-11-26 11:25:14 +0000100 asn_MAP_Type_tag2el_1,
vlm0b567bf2005-03-04 22:18:20 +0000101 1, /* Count of tags in the map */
vlm337167e2005-11-26 11:25:14 +0000102 0, 0, 0, /* Optional elements (not needed) */
vlm0b567bf2005-03-04 22:18:20 +0000103 -1, /* Start extensions */
104 -1 /* Stop extensions */
105};
106asn_TYPE_descriptor_t asn_DEF_Type = {
107 "Type",
108 "Type",
109 SEQUENCE_free,
110 SEQUENCE_print,
111 SEQUENCE_constraint,
112 SEQUENCE_decode_ber,
113 SEQUENCE_encode_der,
114 SEQUENCE_decode_xer,
115 SEQUENCE_encode_xer,
vlm337167e2005-11-26 11:25:14 +0000116 0, /* No PER decoder, -gen-PER to enable */
vlm0b567bf2005-03-04 22:18:20 +0000117 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +0000118 asn_DEF_Type_tags_1,
119 sizeof(asn_DEF_Type_tags_1)
120 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
121 asn_DEF_Type_tags_1, /* Same as above */
122 sizeof(asn_DEF_Type_tags_1)
123 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
124 0, /* No PER visible constraints */
vlm0b567bf2005-03-04 22:18:20 +0000125 asn_MBR_Type_1,
126 1, /* Elements count */
vlm337167e2005-11-26 11:25:14 +0000127 &asn_SPC_Type_specs_1 /* Additional specs */
vlm0b567bf2005-03-04 22:18:20 +0000128};
129
130
vlm1f7df782005-03-04 23:48:19 +0000131/*** <<< INCLUDES [EpytRef] >>> ***/
132
133#include <Epyt.h>
134
135/*** <<< TYPE-DECLS [EpytRef] >>> ***/
136
137typedef Epyt_t EpytRef_t;
138
139/*** <<< FUNC-DECLS [EpytRef] >>> ***/
140
141extern asn_TYPE_descriptor_t asn_DEF_EpytRef;
142asn_struct_free_f EpytRef_free;
143asn_struct_print_f EpytRef_print;
144asn_constr_check_f EpytRef_constraint;
145ber_type_decoder_f EpytRef_decode_ber;
146der_type_encoder_f EpytRef_encode_der;
147xer_type_decoder_f EpytRef_decode_xer;
148xer_type_encoder_f EpytRef_encode_xer;
149
150/*** <<< CODE [EpytRef] >>> ***/
151
152int
153EpytRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
154 asn_app_consume_bytes_f *app_errlog, void *app_key) {
155 /* Replace with underlying type checker */
156 td->check_constraints = asn_DEF_Epyt.check_constraints;
157 return td->check_constraints(td, sptr, app_errlog, app_key);
158}
159
160/*
161 * This type is implemented using Epyt,
162 * so here we adjust the DEF accordingly.
163 */
164static void
vlm67d57fe2005-03-06 09:29:03 +0000165EpytRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
vlm1f7df782005-03-04 23:48:19 +0000166 td->free_struct = asn_DEF_Epyt.free_struct;
167 td->print_struct = asn_DEF_Epyt.print_struct;
168 td->ber_decoder = asn_DEF_Epyt.ber_decoder;
169 td->der_encoder = asn_DEF_Epyt.der_encoder;
170 td->xer_decoder = asn_DEF_Epyt.xer_decoder;
171 td->xer_encoder = asn_DEF_Epyt.xer_encoder;
vlm337167e2005-11-26 11:25:14 +0000172 td->uper_decoder = asn_DEF_Epyt.uper_decoder;
173 if(!td->per_constraints)
174 td->per_constraints = asn_DEF_Epyt.per_constraints;
vlm1f7df782005-03-04 23:48:19 +0000175 td->elements = asn_DEF_Epyt.elements;
176 td->elements_count = asn_DEF_Epyt.elements_count;
177 td->specifics = asn_DEF_Epyt.specifics;
178}
179
180void
181EpytRef_free(asn_TYPE_descriptor_t *td,
182 void *struct_ptr, int contents_only) {
vlm67d57fe2005-03-06 09:29:03 +0000183 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000184 td->free_struct(td, struct_ptr, contents_only);
185}
186
187int
188EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
189 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
vlm67d57fe2005-03-06 09:29:03 +0000190 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000191 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
192}
193
194asn_dec_rval_t
195EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000196 void **structure, const void *bufptr, size_t size, int tag_mode) {
vlm67d57fe2005-03-06 09:29:03 +0000197 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000198 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
199}
200
201asn_enc_rval_t
202EpytRef_encode_der(asn_TYPE_descriptor_t *td,
203 void *structure, int tag_mode, ber_tlv_tag_t tag,
204 asn_app_consume_bytes_f *cb, void *app_key) {
vlm67d57fe2005-03-06 09:29:03 +0000205 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000206 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
207}
208
209asn_dec_rval_t
210EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000211 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
vlm67d57fe2005-03-06 09:29:03 +0000212 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000213 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
214}
215
216asn_enc_rval_t
217EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
218 int ilevel, enum xer_encoder_flags_e flags,
219 asn_app_consume_bytes_f *cb, void *app_key) {
vlm67d57fe2005-03-06 09:29:03 +0000220 EpytRef_1_inherit_TYPE_descriptor(td);
vlm1f7df782005-03-04 23:48:19 +0000221 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
222}
223
224
225/*** <<< STAT-DEFS [EpytRef] >>> ***/
226
vlm337167e2005-11-26 11:25:14 +0000227static ber_tlv_tag_t asn_DEF_EpytRef_tags_1[] = {
vlm1f7df782005-03-04 23:48:19 +0000228 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
229};
230asn_TYPE_descriptor_t asn_DEF_EpytRef = {
231 "EpytRef",
232 "EpytRef",
233 EpytRef_free,
234 EpytRef_print,
235 EpytRef_constraint,
236 EpytRef_decode_ber,
237 EpytRef_encode_der,
238 EpytRef_decode_xer,
239 EpytRef_encode_xer,
vlm337167e2005-11-26 11:25:14 +0000240 0, /* No PER decoder, -gen-PER to enable */
vlm1f7df782005-03-04 23:48:19 +0000241 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +0000242 asn_DEF_EpytRef_tags_1,
243 sizeof(asn_DEF_EpytRef_tags_1)
244 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
245 asn_DEF_EpytRef_tags_1, /* Same as above */
246 sizeof(asn_DEF_EpytRef_tags_1)
247 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
248 0, /* No PER visible constraints */
vlm1f7df782005-03-04 23:48:19 +0000249 0, 0, /* Defined elsewhere */
250 0 /* No specifics */
251};
252
253
vlm0b567bf2005-03-04 22:18:20 +0000254/*** <<< INCLUDES [Epyt] >>> ***/
255
256#include <asn_SET_OF.h>
257#include <constr_SET_OF.h>
258#include <constr_SEQUENCE.h>
259
260/*** <<< FWD-DECLS [Epyt] >>> ***/
261
vlm5feb7522005-03-04 23:50:56 +0000262struct Type;
263struct Ypet;
vlm0b567bf2005-03-04 22:18:20 +0000264
265/*** <<< TYPE-DECLS [Epyt] >>> ***/
266
267typedef struct Epyt {
268 struct stype {
269 A_SET_OF(struct Type) list;
270
271 /* Context for parsing across buffer boundaries */
272 asn_struct_ctx_t _asn_ctx;
273 } stype;
274 struct Type *type /* OPTIONAL */;
275 struct Ypet *ypet /* OPTIONAL */;
276
277 /* Context for parsing across buffer boundaries */
278 asn_struct_ctx_t _asn_ctx;
279} Epyt_t;
280
281/*** <<< FUNC-DECLS [Epyt] >>> ***/
282
283extern asn_TYPE_descriptor_t asn_DEF_Epyt;
284
285/*** <<< POST-INCLUDE [Epyt] >>> ***/
286
287#include <Type.h>
288#include <Ypet.h>
289
290/*** <<< STAT-DEFS [Epyt] >>> ***/
291
292static asn_TYPE_member_t asn_MBR_stype_2[] = {
vlm2cebdf32005-08-16 16:57:17 +0000293 { ATF_POINTER, 0, 0,
vlm0b567bf2005-03-04 22:18:20 +0000294 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
295 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000296 .type = &asn_DEF_Type,
vlm0b567bf2005-03-04 22:18:20 +0000297 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000298 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
299 .default_value = 0,
vlm0b567bf2005-03-04 22:18:20 +0000300 .name = ""
301 },
302};
vlm337167e2005-11-26 11:25:14 +0000303static ber_tlv_tag_t asn_DEF_stype_tags_2[] = {
vlm0b567bf2005-03-04 22:18:20 +0000304 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
305};
vlm337167e2005-11-26 11:25:14 +0000306static asn_SET_OF_specifics_t asn_SPC_stype_specs_2 = {
vlm0b567bf2005-03-04 22:18:20 +0000307 sizeof(struct stype),
308 offsetof(struct stype, _asn_ctx),
309 0, /* XER encoding is XMLDelimitedItemList */
310};
311static /* Use -fall-defs-global to expose */
312asn_TYPE_descriptor_t asn_DEF_stype_2 = {
313 "stype",
314 "stype",
315 SET_OF_free,
316 SET_OF_print,
317 SET_OF_constraint,
318 SET_OF_decode_ber,
319 SET_OF_encode_der,
320 SET_OF_decode_xer,
321 SET_OF_encode_xer,
vlm337167e2005-11-26 11:25:14 +0000322 0, /* No PER decoder, -gen-PER to enable */
vlm0b567bf2005-03-04 22:18:20 +0000323 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +0000324 asn_DEF_stype_tags_2,
325 sizeof(asn_DEF_stype_tags_2)
326 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
327 asn_DEF_stype_tags_2, /* Same as above */
328 sizeof(asn_DEF_stype_tags_2)
329 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
330 0, /* No PER visible constraints */
vlm0b567bf2005-03-04 22:18:20 +0000331 asn_MBR_stype_2,
332 1, /* Single element */
vlm337167e2005-11-26 11:25:14 +0000333 &asn_SPC_stype_specs_2 /* Additional specs */
vlm0b567bf2005-03-04 22:18:20 +0000334};
335
336static asn_TYPE_member_t asn_MBR_Epyt_1[] = {
337 { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype),
338 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
339 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000340 .type = &asn_DEF_stype_2,
vlm0b567bf2005-03-04 22:18:20 +0000341 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000342 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
343 .default_value = 0,
vlm0b567bf2005-03-04 22:18:20 +0000344 .name = "stype"
345 },
346 { ATF_POINTER, 2, offsetof(struct Epyt, type),
347 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
348 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000349 .type = &asn_DEF_Type,
vlm0b567bf2005-03-04 22:18:20 +0000350 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000351 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
352 .default_value = 0,
vlm0b567bf2005-03-04 22:18:20 +0000353 .name = "type"
354 },
355 { ATF_POINTER, 1, offsetof(struct Epyt, ypet),
356 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
357 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000358 .type = &asn_DEF_Ypet,
vlm0b567bf2005-03-04 22:18:20 +0000359 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000360 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
361 .default_value = 0,
vlm0b567bf2005-03-04 22:18:20 +0000362 .name = "ypet"
363 },
364};
vlm337167e2005-11-26 11:25:14 +0000365static ber_tlv_tag_t asn_DEF_Epyt_tags_1[] = {
vlm0b567bf2005-03-04 22:18:20 +0000366 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
367};
vlm337167e2005-11-26 11:25:14 +0000368static asn_TYPE_tag2member_t asn_MAP_Epyt_tag2el_1[] = {
vlm0b567bf2005-03-04 22:18:20 +0000369 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type at 22 */
370 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype at 21 */
371 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet at 23 */
372};
vlm337167e2005-11-26 11:25:14 +0000373static asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1 = {
vlm0b567bf2005-03-04 22:18:20 +0000374 sizeof(struct Epyt),
375 offsetof(struct Epyt, _asn_ctx),
vlm337167e2005-11-26 11:25:14 +0000376 asn_MAP_Epyt_tag2el_1,
vlm0b567bf2005-03-04 22:18:20 +0000377 3, /* Count of tags in the map */
vlm337167e2005-11-26 11:25:14 +0000378 0, 0, 0, /* Optional elements (not needed) */
vlm0b567bf2005-03-04 22:18:20 +0000379 -1, /* Start extensions */
380 -1 /* Stop extensions */
381};
382asn_TYPE_descriptor_t asn_DEF_Epyt = {
383 "Epyt",
384 "Epyt",
385 SEQUENCE_free,
386 SEQUENCE_print,
387 SEQUENCE_constraint,
388 SEQUENCE_decode_ber,
389 SEQUENCE_encode_der,
390 SEQUENCE_decode_xer,
391 SEQUENCE_encode_xer,
vlm337167e2005-11-26 11:25:14 +0000392 0, /* No PER decoder, -gen-PER to enable */
vlm0b567bf2005-03-04 22:18:20 +0000393 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +0000394 asn_DEF_Epyt_tags_1,
395 sizeof(asn_DEF_Epyt_tags_1)
396 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
397 asn_DEF_Epyt_tags_1, /* Same as above */
398 sizeof(asn_DEF_Epyt_tags_1)
399 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
400 0, /* No PER visible constraints */
vlm0b567bf2005-03-04 22:18:20 +0000401 asn_MBR_Epyt_1,
402 3, /* Elements count */
vlm337167e2005-11-26 11:25:14 +0000403 &asn_SPC_Epyt_specs_1 /* Additional specs */
vlm0b567bf2005-03-04 22:18:20 +0000404};
405
406
407/*** <<< INCLUDES [Ypet] >>> ***/
408
vlm0b567bf2005-03-04 22:18:20 +0000409#include <INTEGER.h>
vlm67d57fe2005-03-06 09:29:03 +0000410#include <IA5String.h>
vlm6c5d5e52005-03-04 22:38:22 +0000411#include <EnumType.h>
412#include <asn_SET_OF.h>
413#include <constr_SET_OF.h>
vlm0b567bf2005-03-04 22:18:20 +0000414#include <constr_SET.h>
415
416/*** <<< DEPS [Ypet] >>> ***/
417
418
419/*
420 * Method of determining the components presence
421 */
422typedef enum Ypet_PR {
423 Ypet_PR_epyt, /* Member epyt is present */
424 Ypet_PR_plain, /* Member plain is present */
vlm6c5d5e52005-03-04 22:38:22 +0000425 Ypet_PR_senums, /* Member senums is present */
vlm67d57fe2005-03-06 09:29:03 +0000426 Ypet_PR_patest1, /* Member patest1 is present */
427 Ypet_PR_patest2, /* Member patest2 is present */
vlm0b567bf2005-03-04 22:18:20 +0000428} Ypet_PR;
429
vlm6c4a8502005-08-18 13:38:19 +0000430/*** <<< FWD-DECLS [Ypet] >>> ***/
431
432struct Epyt;
433
vlm0b567bf2005-03-04 22:18:20 +0000434/*** <<< TYPE-DECLS [Ypet] >>> ***/
435
436typedef struct Ypet {
vlm6c4a8502005-08-18 13:38:19 +0000437 struct Epyt *epyt;
vlm0b567bf2005-03-04 22:18:20 +0000438 INTEGER_t *plain /* DEFAULT 7 */;
vlm6c5d5e52005-03-04 22:38:22 +0000439 struct senums {
440 A_SET_OF(EnumType_t) list;
441
442 /* Context for parsing across buffer boundaries */
443 asn_struct_ctx_t _asn_ctx;
444 } senums;
vlm67d57fe2005-03-06 09:29:03 +0000445 IA5String_t patest1;
446 IA5String_t patest2;
vlm0b567bf2005-03-04 22:18:20 +0000447
448 /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
449 unsigned int _presence_map
vlm67d57fe2005-03-06 09:29:03 +0000450 [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
vlm0b567bf2005-03-04 22:18:20 +0000451
452 /* Context for parsing across buffer boundaries */
453 asn_struct_ctx_t _asn_ctx;
454} Ypet_t;
455
456/*** <<< FUNC-DECLS [Ypet] >>> ***/
457
458extern asn_TYPE_descriptor_t asn_DEF_Ypet;
459
vlm6c4a8502005-08-18 13:38:19 +0000460/*** <<< POST-INCLUDE [Ypet] >>> ***/
461
462#include <Epyt.h>
463
vlm67d57fe2005-03-06 09:29:03 +0000464/*** <<< CTABLES [Ypet] >>> ***/
465
466static int check_permitted_alphabet_6(const void *sptr) {
467 /* The underlying type is IA5String */
468 const IA5String_t *st = (const IA5String_t *)sptr;
469 const uint8_t *ch = st->buf;
470 const uint8_t *end = ch + st->size;
471
472 for(; ch < end; ch++) {
473 uint8_t cv = *ch;
474 if(!(cv >= 65 && cv <= 90)) return -1;
475 }
476 return 0;
477}
478
479static int check_permitted_alphabet_7(const void *sptr) {
480 /* The underlying type is IA5String */
481 const IA5String_t *st = (const IA5String_t *)sptr;
482 const uint8_t *ch = st->buf;
483 const uint8_t *end = ch + st->size;
484
485 for(; ch < end; ch++) {
486 uint8_t cv = *ch;
487 if(!(cv >= 97 && cv <= 122)) return -1;
488 }
489 return 0;
490}
491
492
493/*** <<< CODE [Ypet] >>> ***/
494
495static int
vlm337167e2005-11-26 11:25:14 +0000496memb_patest1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlm67d57fe2005-03-06 09:29:03 +0000497 asn_app_consume_bytes_f *app_errlog, void *app_key) {
498 const IA5String_t *st = (const IA5String_t *)sptr;
499
500 if(!sptr) {
501 _ASN_ERRLOG(app_errlog, app_key,
502 "%s: value not given (%s:%d)",
503 td->name, __FILE__, __LINE__);
504 return -1;
505 }
506
507
508 if(!check_permitted_alphabet_6(st)) {
509 /* Constraint check succeeded */
510 return 0;
511 } else {
512 _ASN_ERRLOG(app_errlog, app_key,
513 "%s: constraint failed (%s:%d)",
514 td->name, __FILE__, __LINE__);
515 return -1;
516 }
517}
518
519static int
vlm337167e2005-11-26 11:25:14 +0000520memb_patest2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlm67d57fe2005-03-06 09:29:03 +0000521 asn_app_consume_bytes_f *app_errlog, void *app_key) {
522 const IA5String_t *st = (const IA5String_t *)sptr;
523
524 if(!sptr) {
525 _ASN_ERRLOG(app_errlog, app_key,
526 "%s: value not given (%s:%d)",
527 td->name, __FILE__, __LINE__);
528 return -1;
529 }
530
531
532 if(!check_permitted_alphabet_7(st)) {
533 /* Constraint check succeeded */
534 return 0;
535 } else {
536 _ASN_ERRLOG(app_errlog, app_key,
537 "%s: constraint failed (%s:%d)",
538 td->name, __FILE__, __LINE__);
539 return -1;
540 }
541}
542
543
vlm0b567bf2005-03-04 22:18:20 +0000544/*** <<< STAT-DEFS [Ypet] >>> ***/
545
vlm337167e2005-11-26 11:25:14 +0000546static int asn_DFL_3_set_7(void **sptr) {
547 INTEGER_t *st = *sptr;
548
549 if(!st) {
550 st = (*sptr = CALLOC(1, sizeof(*st)));
551 if(!st) return -1;
552 }
553
554 /* Install default value 7 */
555 return asn_long2INTEGER(st, 7);
556}
vlm67d57fe2005-03-06 09:29:03 +0000557static asn_TYPE_member_t asn_MBR_senums_4[] = {
vlm2cebdf32005-08-16 16:57:17 +0000558 { ATF_POINTER, 0, 0,
vlm6c5d5e52005-03-04 22:38:22 +0000559 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
560 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000561 .type = &asn_DEF_EnumType,
vlm6c5d5e52005-03-04 22:38:22 +0000562 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000563 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
564 .default_value = 0,
vlm6c5d5e52005-03-04 22:38:22 +0000565 .name = ""
566 },
567};
vlm337167e2005-11-26 11:25:14 +0000568static ber_tlv_tag_t asn_DEF_senums_tags_4[] = {
vlm6c5d5e52005-03-04 22:38:22 +0000569 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
570};
vlm337167e2005-11-26 11:25:14 +0000571static asn_SET_OF_specifics_t asn_SPC_senums_specs_4 = {
vlm6c5d5e52005-03-04 22:38:22 +0000572 sizeof(struct senums),
573 offsetof(struct senums, _asn_ctx),
574 1, /* XER encoding is XMLValueList */
575};
576static /* Use -fall-defs-global to expose */
vlm67d57fe2005-03-06 09:29:03 +0000577asn_TYPE_descriptor_t asn_DEF_senums_4 = {
vlm6c5d5e52005-03-04 22:38:22 +0000578 "senums",
579 "senums",
580 SET_OF_free,
581 SET_OF_print,
582 SET_OF_constraint,
583 SET_OF_decode_ber,
584 SET_OF_encode_der,
585 SET_OF_decode_xer,
586 SET_OF_encode_xer,
vlm337167e2005-11-26 11:25:14 +0000587 0, /* No PER decoder, -gen-PER to enable */
vlm6c5d5e52005-03-04 22:38:22 +0000588 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +0000589 asn_DEF_senums_tags_4,
590 sizeof(asn_DEF_senums_tags_4)
591 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
592 asn_DEF_senums_tags_4, /* Same as above */
593 sizeof(asn_DEF_senums_tags_4)
594 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
595 0, /* No PER visible constraints */
vlm67d57fe2005-03-06 09:29:03 +0000596 asn_MBR_senums_4,
vlm6c5d5e52005-03-04 22:38:22 +0000597 1, /* Single element */
vlm337167e2005-11-26 11:25:14 +0000598 &asn_SPC_senums_specs_4 /* Additional specs */
vlm6c5d5e52005-03-04 22:38:22 +0000599};
600
vlm0b567bf2005-03-04 22:18:20 +0000601static asn_TYPE_member_t asn_MBR_Ypet_1[] = {
vlm6c4a8502005-08-18 13:38:19 +0000602 { ATF_POINTER, 0, offsetof(struct Ypet, epyt),
vlm0b567bf2005-03-04 22:18:20 +0000603 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
604 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000605 .type = &asn_DEF_Epyt,
vlm0b567bf2005-03-04 22:18:20 +0000606 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000607 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
608 .default_value = 0,
vlm0b567bf2005-03-04 22:18:20 +0000609 .name = "epyt"
610 },
611 { ATF_POINTER, 1, offsetof(struct Ypet, plain),
612 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
613 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000614 .type = &asn_DEF_INTEGER,
vlm0b567bf2005-03-04 22:18:20 +0000615 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000616 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
617 .default_value = asn_DFL_3_set_7, /* DEFAULT 7 */
vlm0b567bf2005-03-04 22:18:20 +0000618 .name = "plain"
619 },
vlm6c5d5e52005-03-04 22:38:22 +0000620 { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
621 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
622 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000623 .type = &asn_DEF_senums_4,
vlm6c5d5e52005-03-04 22:38:22 +0000624 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000625 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
626 .default_value = 0,
vlm6c5d5e52005-03-04 22:38:22 +0000627 .name = "senums"
628 },
vlm67d57fe2005-03-06 09:29:03 +0000629 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),
630 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
631 .tag_mode = +1, /* EXPLICIT tag at current level */
vlme0fea712005-08-29 10:31:14 +0000632 .type = &asn_DEF_IA5String,
vlm337167e2005-11-26 11:25:14 +0000633 .memb_constraints = memb_patest1_constraint_1,
634 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
635 .default_value = 0,
vlm67d57fe2005-03-06 09:29:03 +0000636 .name = "patest1"
637 },
638 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),
639 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
640 .tag_mode = +1, /* EXPLICIT tag at current level */
vlme0fea712005-08-29 10:31:14 +0000641 .type = &asn_DEF_IA5String,
vlm337167e2005-11-26 11:25:14 +0000642 .memb_constraints = memb_patest2_constraint_1,
643 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
644 .default_value = 0,
vlm67d57fe2005-03-06 09:29:03 +0000645 .name = "patest2"
646 },
vlm0b567bf2005-03-04 22:18:20 +0000647};
vlm337167e2005-11-26 11:25:14 +0000648static ber_tlv_tag_t asn_DEF_Ypet_tags_1[] = {
vlm0b567bf2005-03-04 22:18:20 +0000649 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
650};
vlm337167e2005-11-26 11:25:14 +0000651static asn_TYPE_tag2member_t asn_MAP_Ypet_tag2el_1[] = {
vlm0b567bf2005-03-04 22:18:20 +0000652 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain at 28 */
vlm6c5d5e52005-03-04 22:38:22 +0000653 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt at 27 */
vlm67d57fe2005-03-06 09:29:03 +0000654 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums at 29 */
655 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 at 30 */
656 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 at 31 */
vlm0b567bf2005-03-04 22:18:20 +0000657};
vlm337167e2005-11-26 11:25:14 +0000658static uint8_t asn_MAP_Ypet_mmap_1[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {
vlm67d57fe2005-03-06 09:29:03 +0000659 (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)
vlm0b567bf2005-03-04 22:18:20 +0000660};
vlm337167e2005-11-26 11:25:14 +0000661static asn_SET_specifics_t asn_SPC_Ypet_specs_1 = {
vlm0b567bf2005-03-04 22:18:20 +0000662 sizeof(struct Ypet),
663 offsetof(struct Ypet, _asn_ctx),
664 offsetof(struct Ypet, _presence_map),
vlm337167e2005-11-26 11:25:14 +0000665 asn_MAP_Ypet_tag2el_1,
vlm67d57fe2005-03-06 09:29:03 +0000666 5, /* Count of tags in the map */
vlm337167e2005-11-26 11:25:14 +0000667 asn_MAP_Ypet_tag2el_1, /* Same as above */
vlm67d57fe2005-03-06 09:29:03 +0000668 5, /* Count of tags in the CXER map */
vlm0b567bf2005-03-04 22:18:20 +0000669 0, /* Whether extensible */
vlm337167e2005-11-26 11:25:14 +0000670 (unsigned int *)asn_MAP_Ypet_mmap_1 /* Mandatory elements map */
vlm0b567bf2005-03-04 22:18:20 +0000671};
672asn_TYPE_descriptor_t asn_DEF_Ypet = {
673 "Ypet",
674 "Ypet",
675 SET_free,
676 SET_print,
677 SET_constraint,
678 SET_decode_ber,
679 SET_encode_der,
680 SET_decode_xer,
681 SET_encode_xer,
vlm337167e2005-11-26 11:25:14 +0000682 0, /* No PER decoder, -gen-PER to enable */
vlm0b567bf2005-03-04 22:18:20 +0000683 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +0000684 asn_DEF_Ypet_tags_1,
685 sizeof(asn_DEF_Ypet_tags_1)
686 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
687 asn_DEF_Ypet_tags_1, /* Same as above */
688 sizeof(asn_DEF_Ypet_tags_1)
689 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
690 0, /* No PER visible constraints */
vlm0b567bf2005-03-04 22:18:20 +0000691 asn_MBR_Ypet_1,
vlm67d57fe2005-03-06 09:29:03 +0000692 5, /* Elements count */
vlm337167e2005-11-26 11:25:14 +0000693 &asn_SPC_Ypet_specs_1 /* Additional specs */
vlm0b567bf2005-03-04 22:18:20 +0000694};
695
vlm6c5d5e52005-03-04 22:38:22 +0000696
697/*** <<< INCLUDES [EnumType] >>> ***/
698
699#include <ENUMERATED.h>
700
701/*** <<< DEPS [EnumType] >>> ***/
702
703typedef enum EnumType {
704 EnumType_one = 0,
705 EnumType_two = 1
vlm7c8aa5e2006-03-21 07:25:18 +0000706} e_EnumType;
vlm6c5d5e52005-03-04 22:38:22 +0000707
708/*** <<< TYPE-DECLS [EnumType] >>> ***/
709
710typedef ENUMERATED_t EnumType_t;
711
712/*** <<< FUNC-DECLS [EnumType] >>> ***/
713
714extern asn_TYPE_descriptor_t asn_DEF_EnumType;
715asn_struct_free_f EnumType_free;
716asn_struct_print_f EnumType_print;
717asn_constr_check_f EnumType_constraint;
718ber_type_decoder_f EnumType_decode_ber;
719der_type_encoder_f EnumType_encode_der;
720xer_type_decoder_f EnumType_decode_xer;
721xer_type_encoder_f EnumType_encode_xer;
722
723/*** <<< CODE [EnumType] >>> ***/
724
725int
726EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
727 asn_app_consume_bytes_f *app_errlog, void *app_key) {
728 /* Replace with underlying type checker */
729 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
730 return td->check_constraints(td, sptr, app_errlog, app_key);
731}
732
733/*
734 * This type is implemented using ENUMERATED,
735 * so here we adjust the DEF accordingly.
736 */
737static void
738EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
739 td->free_struct = asn_DEF_ENUMERATED.free_struct;
740 td->print_struct = asn_DEF_ENUMERATED.print_struct;
741 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
742 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
743 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
744 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
vlm337167e2005-11-26 11:25:14 +0000745 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
746 if(!td->per_constraints)
747 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
vlm6c5d5e52005-03-04 22:38:22 +0000748 td->elements = asn_DEF_ENUMERATED.elements;
749 td->elements_count = asn_DEF_ENUMERATED.elements_count;
vlm541def92005-03-29 19:05:37 +0000750 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
vlm6c5d5e52005-03-04 22:38:22 +0000751}
752
753void
754EnumType_free(asn_TYPE_descriptor_t *td,
755 void *struct_ptr, int contents_only) {
756 EnumType_1_inherit_TYPE_descriptor(td);
757 td->free_struct(td, struct_ptr, contents_only);
758}
759
760int
761EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
762 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
763 EnumType_1_inherit_TYPE_descriptor(td);
764 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
765}
766
767asn_dec_rval_t
768EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000769 void **structure, const void *bufptr, size_t size, int tag_mode) {
vlm6c5d5e52005-03-04 22:38:22 +0000770 EnumType_1_inherit_TYPE_descriptor(td);
771 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
772}
773
774asn_enc_rval_t
775EnumType_encode_der(asn_TYPE_descriptor_t *td,
776 void *structure, int tag_mode, ber_tlv_tag_t tag,
777 asn_app_consume_bytes_f *cb, void *app_key) {
778 EnumType_1_inherit_TYPE_descriptor(td);
779 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
780}
781
782asn_dec_rval_t
783EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlmc04faea2005-03-17 21:57:19 +0000784 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
vlm6c5d5e52005-03-04 22:38:22 +0000785 EnumType_1_inherit_TYPE_descriptor(td);
786 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
787}
788
789asn_enc_rval_t
790EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
791 int ilevel, enum xer_encoder_flags_e flags,
792 asn_app_consume_bytes_f *cb, void *app_key) {
793 EnumType_1_inherit_TYPE_descriptor(td);
794 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
795}
796
797
798/*** <<< STAT-DEFS [EnumType] >>> ***/
799
vlm337167e2005-11-26 11:25:14 +0000800static asn_INTEGER_enum_map_t asn_MAP_EnumType_value2enum_1[] = {
vlm6c5d5e52005-03-04 22:38:22 +0000801 { 0, 3, "one" },
802 { 1, 3, "two" }
803};
vlm337167e2005-11-26 11:25:14 +0000804static unsigned int asn_MAP_EnumType_enum2value_1[] = {
vlm6c5d5e52005-03-04 22:38:22 +0000805 0, /* one(0) */
806 1 /* two(1) */
807};
vlm337167e2005-11-26 11:25:14 +0000808static asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1 = {
809 asn_MAP_EnumType_value2enum_1, /* "tag" => N; sorted by tag */
810 asn_MAP_EnumType_enum2value_1, /* N => "tag"; sorted by N */
vlm6c5d5e52005-03-04 22:38:22 +0000811 2, /* Number of elements in the maps */
812 0, /* Enumeration is not extensible */
813 1 /* Strict enumeration */
814};
vlm337167e2005-11-26 11:25:14 +0000815static ber_tlv_tag_t asn_DEF_EnumType_tags_1[] = {
vlm6c5d5e52005-03-04 22:38:22 +0000816 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
817};
818asn_TYPE_descriptor_t asn_DEF_EnumType = {
819 "EnumType",
820 "EnumType",
821 EnumType_free,
822 EnumType_print,
823 EnumType_constraint,
824 EnumType_decode_ber,
825 EnumType_encode_der,
826 EnumType_decode_xer,
827 EnumType_encode_xer,
vlm337167e2005-11-26 11:25:14 +0000828 0, /* No PER decoder, -gen-PER to enable */
vlm6c5d5e52005-03-04 22:38:22 +0000829 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +0000830 asn_DEF_EnumType_tags_1,
831 sizeof(asn_DEF_EnumType_tags_1)
832 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
833 asn_DEF_EnumType_tags_1, /* Same as above */
834 sizeof(asn_DEF_EnumType_tags_1)
835 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
836 0, /* No PER visible constraints */
vlm6c5d5e52005-03-04 22:38:22 +0000837 0, 0, /* Defined elsewhere */
vlm337167e2005-11-26 11:25:14 +0000838 &asn_SPC_EnumType_specs_1 /* Additional specs */
vlm6c5d5e52005-03-04 22:38:22 +0000839};
840