blob: 7f5134fd7d3ba83f923575e90b1995684b2e6108 [file] [log] [blame]
Lev Walkinc8285712005-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
Lev Walkinbf56d542005-03-04 23:50:56 +000010struct Epyt;
Lev Walkinc8285712005-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
Lev Walkin22b5ed42006-09-13 02:51:20 +000032#include "EpytRef.h"
Lev Walkinc8285712005-03-04 22:18:20 +000033
34/*** <<< STAT-DEFS [Type] >>> ***/
35
36static asn_TYPE_member_t asn_MBR_data_2[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +000037 { ATF_POINTER, 0, 0,
Lev Walkinc8285712005-03-04 22:18:20 +000038 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
39 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000040 .type = &asn_DEF_EpytRef,
Lev Walkinc8285712005-03-04 22:18:20 +000041 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +000042 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
43 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +000044 .name = ""
45 },
46};
Lev Walkina7591b52014-10-12 18:37:35 -070047static const ber_tlv_tag_t asn_DEF_data_tags_2[] = {
Lev Walkinc8285712005-03-04 22:18:20 +000048 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
49};
Lev Walkin59b176e2005-11-26 11:25:14 +000050static asn_SET_OF_specifics_t asn_SPC_data_specs_2 = {
Lev Walkinc8285712005-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,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000066 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +000067 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-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 */
Lev Walkinc8285712005-03-04 22:18:20 +000075 asn_MBR_data_2,
76 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +000077 &asn_SPC_data_specs_2 /* Additional specs */
Lev Walkinc8285712005-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,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000084 .type = &asn_DEF_data_2,
Lev Walkinc8285712005-03-04 22:18:20 +000085 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +000086 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
87 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +000088 .name = "data"
89 },
90};
Lev Walkina7591b52014-10-12 18:37:35 -070091static const ber_tlv_tag_t asn_DEF_Type_tags_1[] = {
Lev Walkinc8285712005-03-04 22:18:20 +000092 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
93};
Lev Walkina7591b52014-10-12 18:37:35 -070094static const asn_TYPE_tag2member_t asn_MAP_Type_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070095 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data */
Lev Walkinc8285712005-03-04 22:18:20 +000096};
Lev Walkin59b176e2005-11-26 11:25:14 +000097static asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1 = {
Lev Walkinc8285712005-03-04 22:18:20 +000098 sizeof(struct Type),
99 offsetof(struct Type, _asn_ctx),
Lev Walkin59b176e2005-11-26 11:25:14 +0000100 asn_MAP_Type_tag2el_1,
Lev Walkinc8285712005-03-04 22:18:20 +0000101 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000102 0, 0, 0, /* Optional elements (not needed) */
Lev Walkinc8285712005-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,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000116 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000117 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-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 */
Lev Walkinc8285712005-03-04 22:18:20 +0000125 asn_MBR_Type_1,
126 1, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000127 &asn_SPC_Type_specs_1 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000128};
129
130
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000131/*** <<< INCLUDES [EpytRef] >>> ***/
132
Lev Walkin22b5ed42006-09-13 02:51:20 +0000133#include "Epyt.h"
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000134
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,
Lev Walkin1eded352006-07-13 11:19:01 +0000154 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000155 /* Replace with underlying type checker */
156 td->check_constraints = asn_DEF_Epyt.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000157 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000158}
159
160/*
161 * This type is implemented using Epyt,
162 * so here we adjust the DEF accordingly.
163 */
164static void
Lev Walkine8318b82005-03-06 09:29:03 +0000165EpytRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000166 td->free_struct = asn_DEF_Epyt.free_struct;
167 td->print_struct = asn_DEF_Epyt.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800168 td->check_constraints = asn_DEF_Epyt.check_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000169 td->ber_decoder = asn_DEF_Epyt.ber_decoder;
170 td->der_encoder = asn_DEF_Epyt.der_encoder;
171 td->xer_decoder = asn_DEF_Epyt.xer_decoder;
172 td->xer_encoder = asn_DEF_Epyt.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000173 td->uper_decoder = asn_DEF_Epyt.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000174 td->uper_encoder = asn_DEF_Epyt.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000175 if(!td->per_constraints)
176 td->per_constraints = asn_DEF_Epyt.per_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000177 td->elements = asn_DEF_Epyt.elements;
178 td->elements_count = asn_DEF_Epyt.elements_count;
179 td->specifics = asn_DEF_Epyt.specifics;
180}
181
182void
183EpytRef_free(asn_TYPE_descriptor_t *td,
184 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +0000185 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000186 td->free_struct(td, struct_ptr, contents_only);
187}
188
189int
190EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
191 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000192 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000193 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
194}
195
196asn_dec_rval_t
197EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000198 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +0000199 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000200 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
201}
202
203asn_enc_rval_t
204EpytRef_encode_der(asn_TYPE_descriptor_t *td,
205 void *structure, int tag_mode, ber_tlv_tag_t tag,
206 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000207 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000208 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
209}
210
211asn_dec_rval_t
212EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000213 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +0000214 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000215 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
216}
217
218asn_enc_rval_t
219EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
220 int ilevel, enum xer_encoder_flags_e flags,
221 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000222 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000223 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
224}
225
226
227/*** <<< STAT-DEFS [EpytRef] >>> ***/
228
Lev Walkina7591b52014-10-12 18:37:35 -0700229static const ber_tlv_tag_t asn_DEF_EpytRef_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000230 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
231};
232asn_TYPE_descriptor_t asn_DEF_EpytRef = {
233 "EpytRef",
234 "EpytRef",
235 EpytRef_free,
236 EpytRef_print,
237 EpytRef_constraint,
238 EpytRef_decode_ber,
239 EpytRef_encode_der,
240 EpytRef_decode_xer,
241 EpytRef_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000242 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000243 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000244 asn_DEF_EpytRef_tags_1,
245 sizeof(asn_DEF_EpytRef_tags_1)
246 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
247 asn_DEF_EpytRef_tags_1, /* Same as above */
248 sizeof(asn_DEF_EpytRef_tags_1)
249 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
250 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000251 0, 0, /* Defined elsewhere */
252 0 /* No specifics */
253};
254
255
Lev Walkinc8285712005-03-04 22:18:20 +0000256/*** <<< INCLUDES [Epyt] >>> ***/
257
258#include <asn_SET_OF.h>
259#include <constr_SET_OF.h>
260#include <constr_SEQUENCE.h>
261
262/*** <<< FWD-DECLS [Epyt] >>> ***/
263
Lev Walkinbf56d542005-03-04 23:50:56 +0000264struct Type;
265struct Ypet;
Lev Walkinc8285712005-03-04 22:18:20 +0000266
267/*** <<< TYPE-DECLS [Epyt] >>> ***/
268
269typedef struct Epyt {
270 struct stype {
271 A_SET_OF(struct Type) list;
272
273 /* Context for parsing across buffer boundaries */
274 asn_struct_ctx_t _asn_ctx;
275 } stype;
276 struct Type *type /* OPTIONAL */;
277 struct Ypet *ypet /* OPTIONAL */;
278
279 /* Context for parsing across buffer boundaries */
280 asn_struct_ctx_t _asn_ctx;
281} Epyt_t;
282
283/*** <<< FUNC-DECLS [Epyt] >>> ***/
284
285extern asn_TYPE_descriptor_t asn_DEF_Epyt;
286
287/*** <<< POST-INCLUDE [Epyt] >>> ***/
288
Lev Walkin22b5ed42006-09-13 02:51:20 +0000289#include "Type.h"
290#include "Ypet.h"
Lev Walkinc8285712005-03-04 22:18:20 +0000291
292/*** <<< STAT-DEFS [Epyt] >>> ***/
293
294static asn_TYPE_member_t asn_MBR_stype_2[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000295 { ATF_POINTER, 0, 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000296 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
297 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000298 .type = &asn_DEF_Type,
Lev Walkinc8285712005-03-04 22:18:20 +0000299 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000300 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
301 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000302 .name = ""
303 },
304};
Lev Walkina7591b52014-10-12 18:37:35 -0700305static const ber_tlv_tag_t asn_DEF_stype_tags_2[] = {
Lev Walkinc8285712005-03-04 22:18:20 +0000306 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
307};
Lev Walkin59b176e2005-11-26 11:25:14 +0000308static asn_SET_OF_specifics_t asn_SPC_stype_specs_2 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000309 sizeof(struct stype),
310 offsetof(struct stype, _asn_ctx),
311 0, /* XER encoding is XMLDelimitedItemList */
312};
313static /* Use -fall-defs-global to expose */
314asn_TYPE_descriptor_t asn_DEF_stype_2 = {
315 "stype",
316 "stype",
317 SET_OF_free,
318 SET_OF_print,
319 SET_OF_constraint,
320 SET_OF_decode_ber,
321 SET_OF_encode_der,
322 SET_OF_decode_xer,
323 SET_OF_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000324 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000325 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000326 asn_DEF_stype_tags_2,
327 sizeof(asn_DEF_stype_tags_2)
328 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
329 asn_DEF_stype_tags_2, /* Same as above */
330 sizeof(asn_DEF_stype_tags_2)
331 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
332 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000333 asn_MBR_stype_2,
334 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000335 &asn_SPC_stype_specs_2 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000336};
337
338static asn_TYPE_member_t asn_MBR_Epyt_1[] = {
339 { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype),
340 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
341 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000342 .type = &asn_DEF_stype_2,
Lev Walkinc8285712005-03-04 22:18:20 +0000343 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000344 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
345 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000346 .name = "stype"
347 },
348 { ATF_POINTER, 2, offsetof(struct Epyt, type),
349 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
350 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000351 .type = &asn_DEF_Type,
Lev Walkinc8285712005-03-04 22:18:20 +0000352 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000353 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
354 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000355 .name = "type"
356 },
357 { ATF_POINTER, 1, offsetof(struct Epyt, ypet),
358 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
359 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000360 .type = &asn_DEF_Ypet,
Lev Walkinc8285712005-03-04 22:18:20 +0000361 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000362 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
363 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000364 .name = "ypet"
365 },
366};
Lev Walkina7591b52014-10-12 18:37:35 -0700367static const ber_tlv_tag_t asn_DEF_Epyt_tags_1[] = {
Lev Walkinc8285712005-03-04 22:18:20 +0000368 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
369};
Lev Walkina7591b52014-10-12 18:37:35 -0700370static const asn_TYPE_tag2member_t asn_MAP_Epyt_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700371 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type */
372 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype */
373 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet */
Lev Walkinc8285712005-03-04 22:18:20 +0000374};
Lev Walkin59b176e2005-11-26 11:25:14 +0000375static asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000376 sizeof(struct Epyt),
377 offsetof(struct Epyt, _asn_ctx),
Lev Walkin59b176e2005-11-26 11:25:14 +0000378 asn_MAP_Epyt_tag2el_1,
Lev Walkinc8285712005-03-04 22:18:20 +0000379 3, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000380 0, 0, 0, /* Optional elements (not needed) */
Lev Walkinc8285712005-03-04 22:18:20 +0000381 -1, /* Start extensions */
382 -1 /* Stop extensions */
383};
384asn_TYPE_descriptor_t asn_DEF_Epyt = {
385 "Epyt",
386 "Epyt",
387 SEQUENCE_free,
388 SEQUENCE_print,
389 SEQUENCE_constraint,
390 SEQUENCE_decode_ber,
391 SEQUENCE_encode_der,
392 SEQUENCE_decode_xer,
393 SEQUENCE_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000394 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000395 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000396 asn_DEF_Epyt_tags_1,
397 sizeof(asn_DEF_Epyt_tags_1)
398 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
399 asn_DEF_Epyt_tags_1, /* Same as above */
400 sizeof(asn_DEF_Epyt_tags_1)
401 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
402 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000403 asn_MBR_Epyt_1,
404 3, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000405 &asn_SPC_Epyt_specs_1 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000406};
407
408
409/*** <<< INCLUDES [Ypet] >>> ***/
410
Lev Walkinc8285712005-03-04 22:18:20 +0000411#include <INTEGER.h>
Lev Walkine8318b82005-03-06 09:29:03 +0000412#include <IA5String.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +0000413#include "EnumType.h"
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000414#include <asn_SET_OF.h>
415#include <constr_SET_OF.h>
Lev Walkinc8285712005-03-04 22:18:20 +0000416#include <constr_SET.h>
417
418/*** <<< DEPS [Ypet] >>> ***/
419
420
421/*
422 * Method of determining the components presence
423 */
424typedef enum Ypet_PR {
425 Ypet_PR_epyt, /* Member epyt is present */
426 Ypet_PR_plain, /* Member plain is present */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000427 Ypet_PR_senums, /* Member senums is present */
Lev Walkine8318b82005-03-06 09:29:03 +0000428 Ypet_PR_patest1, /* Member patest1 is present */
429 Ypet_PR_patest2, /* Member patest2 is present */
Lev Walkinc8285712005-03-04 22:18:20 +0000430} Ypet_PR;
431
Lev Walkinb85a8132005-08-18 13:38:19 +0000432/*** <<< FWD-DECLS [Ypet] >>> ***/
433
434struct Epyt;
435
Lev Walkinc8285712005-03-04 22:18:20 +0000436/*** <<< TYPE-DECLS [Ypet] >>> ***/
437
438typedef struct Ypet {
Lev Walkinb85a8132005-08-18 13:38:19 +0000439 struct Epyt *epyt;
Lev Walkinc8285712005-03-04 22:18:20 +0000440 INTEGER_t *plain /* DEFAULT 7 */;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000441 struct senums {
442 A_SET_OF(EnumType_t) list;
443
444 /* Context for parsing across buffer boundaries */
445 asn_struct_ctx_t _asn_ctx;
446 } senums;
Lev Walkine8318b82005-03-06 09:29:03 +0000447 IA5String_t patest1;
448 IA5String_t patest2;
Lev Walkinc8285712005-03-04 22:18:20 +0000449
450 /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
451 unsigned int _presence_map
Lev Walkine8318b82005-03-06 09:29:03 +0000452 [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
Lev Walkinc8285712005-03-04 22:18:20 +0000453
454 /* Context for parsing across buffer boundaries */
455 asn_struct_ctx_t _asn_ctx;
456} Ypet_t;
457
458/*** <<< FUNC-DECLS [Ypet] >>> ***/
459
460extern asn_TYPE_descriptor_t asn_DEF_Ypet;
461
Lev Walkinb85a8132005-08-18 13:38:19 +0000462/*** <<< POST-INCLUDE [Ypet] >>> ***/
463
Lev Walkin22b5ed42006-09-13 02:51:20 +0000464#include "Epyt.h"
Lev Walkinb85a8132005-08-18 13:38:19 +0000465
Lev Walkine8318b82005-03-06 09:29:03 +0000466/*** <<< CTABLES [Ypet] >>> ***/
467
468static int check_permitted_alphabet_6(const void *sptr) {
469 /* The underlying type is IA5String */
470 const IA5String_t *st = (const IA5String_t *)sptr;
471 const uint8_t *ch = st->buf;
472 const uint8_t *end = ch + st->size;
473
474 for(; ch < end; ch++) {
475 uint8_t cv = *ch;
476 if(!(cv >= 65 && cv <= 90)) return -1;
477 }
478 return 0;
479}
480
481static int check_permitted_alphabet_7(const void *sptr) {
482 /* The underlying type is IA5String */
483 const IA5String_t *st = (const IA5String_t *)sptr;
484 const uint8_t *ch = st->buf;
485 const uint8_t *end = ch + st->size;
486
487 for(; ch < end; ch++) {
488 uint8_t cv = *ch;
489 if(!(cv >= 97 && cv <= 122)) return -1;
490 }
491 return 0;
492}
493
494
495/*** <<< CODE [Ypet] >>> ***/
496
497static int
Lev Walkin59b176e2005-11-26 11:25:14 +0000498memb_patest1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000499 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000500 const IA5String_t *st = (const IA5String_t *)sptr;
501
502 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700503 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000504 "%s: value not given (%s:%d)",
505 td->name, __FILE__, __LINE__);
506 return -1;
507 }
508
509
510 if(!check_permitted_alphabet_6(st)) {
511 /* Constraint check succeeded */
512 return 0;
513 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700514 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000515 "%s: constraint failed (%s:%d)",
516 td->name, __FILE__, __LINE__);
517 return -1;
518 }
519}
520
521static int
Lev Walkin59b176e2005-11-26 11:25:14 +0000522memb_patest2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000523 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000524 const IA5String_t *st = (const IA5String_t *)sptr;
525
526 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700527 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000528 "%s: value not given (%s:%d)",
529 td->name, __FILE__, __LINE__);
530 return -1;
531 }
532
533
534 if(!check_permitted_alphabet_7(st)) {
535 /* Constraint check succeeded */
536 return 0;
537 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700538 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000539 "%s: constraint failed (%s:%d)",
540 td->name, __FILE__, __LINE__);
541 return -1;
542 }
543}
544
545
Lev Walkinc8285712005-03-04 22:18:20 +0000546/*** <<< STAT-DEFS [Ypet] >>> ***/
547
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000548static int asn_DFL_3_set_7(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000549 INTEGER_t *st = *sptr;
550
551 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000552 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +0000553 st = (*sptr = CALLOC(1, sizeof(*st)));
554 if(!st) return -1;
555 }
556
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000557 if(set_value) {
558 /* Install default value 7 */
559 return asn_long2INTEGER(st, 7);
560 } else {
561 /* Test default value 7 */
562 long value;
563 if(asn_INTEGER2long(st, &value))
564 return -1;
565 return (value == 7);
566 }
Lev Walkin59b176e2005-11-26 11:25:14 +0000567}
Lev Walkine8318b82005-03-06 09:29:03 +0000568static asn_TYPE_member_t asn_MBR_senums_4[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000569 { ATF_POINTER, 0, 0,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000570 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
571 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000572 .type = &asn_DEF_EnumType,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000573 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000574 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
575 .default_value = 0,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000576 .name = ""
577 },
578};
Lev Walkina7591b52014-10-12 18:37:35 -0700579static const ber_tlv_tag_t asn_DEF_senums_tags_4[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000580 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
581};
Lev Walkin59b176e2005-11-26 11:25:14 +0000582static asn_SET_OF_specifics_t asn_SPC_senums_specs_4 = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000583 sizeof(struct senums),
584 offsetof(struct senums, _asn_ctx),
585 1, /* XER encoding is XMLValueList */
586};
587static /* Use -fall-defs-global to expose */
Lev Walkine8318b82005-03-06 09:29:03 +0000588asn_TYPE_descriptor_t asn_DEF_senums_4 = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000589 "senums",
590 "senums",
591 SET_OF_free,
592 SET_OF_print,
593 SET_OF_constraint,
594 SET_OF_decode_ber,
595 SET_OF_encode_der,
596 SET_OF_decode_xer,
597 SET_OF_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000598 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000599 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000600 asn_DEF_senums_tags_4,
601 sizeof(asn_DEF_senums_tags_4)
602 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
603 asn_DEF_senums_tags_4, /* Same as above */
604 sizeof(asn_DEF_senums_tags_4)
605 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
606 0, /* No PER visible constraints */
Lev Walkine8318b82005-03-06 09:29:03 +0000607 asn_MBR_senums_4,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000608 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000609 &asn_SPC_senums_specs_4 /* Additional specs */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000610};
611
Lev Walkinc8285712005-03-04 22:18:20 +0000612static asn_TYPE_member_t asn_MBR_Ypet_1[] = {
Lev Walkinb85a8132005-08-18 13:38:19 +0000613 { ATF_POINTER, 0, offsetof(struct Ypet, epyt),
Lev Walkinc8285712005-03-04 22:18:20 +0000614 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
615 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000616 .type = &asn_DEF_Epyt,
Lev Walkinc8285712005-03-04 22:18:20 +0000617 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000618 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
619 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000620 .name = "epyt"
621 },
622 { ATF_POINTER, 1, offsetof(struct Ypet, plain),
623 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
624 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000625 .type = &asn_DEF_INTEGER,
Lev Walkinc8285712005-03-04 22:18:20 +0000626 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000627 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
628 .default_value = asn_DFL_3_set_7, /* DEFAULT 7 */
Lev Walkinc8285712005-03-04 22:18:20 +0000629 .name = "plain"
630 },
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000631 { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
632 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
633 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000634 .type = &asn_DEF_senums_4,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000635 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000636 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
637 .default_value = 0,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000638 .name = "senums"
639 },
Lev Walkine8318b82005-03-06 09:29:03 +0000640 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),
641 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
642 .tag_mode = +1, /* EXPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000643 .type = &asn_DEF_IA5String,
Lev Walkin59b176e2005-11-26 11:25:14 +0000644 .memb_constraints = memb_patest1_constraint_1,
645 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
646 .default_value = 0,
Lev Walkine8318b82005-03-06 09:29:03 +0000647 .name = "patest1"
648 },
649 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),
650 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
651 .tag_mode = +1, /* EXPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000652 .type = &asn_DEF_IA5String,
Lev Walkin59b176e2005-11-26 11:25:14 +0000653 .memb_constraints = memb_patest2_constraint_1,
654 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
655 .default_value = 0,
Lev Walkine8318b82005-03-06 09:29:03 +0000656 .name = "patest2"
657 },
Lev Walkinc8285712005-03-04 22:18:20 +0000658};
Lev Walkina7591b52014-10-12 18:37:35 -0700659static const ber_tlv_tag_t asn_DEF_Ypet_tags_1[] = {
Lev Walkinc8285712005-03-04 22:18:20 +0000660 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
661};
Lev Walkina7591b52014-10-12 18:37:35 -0700662static const asn_TYPE_tag2member_t asn_MAP_Ypet_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700663 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain */
664 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt */
665 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums */
666 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 */
667 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 */
Lev Walkinc8285712005-03-04 22:18:20 +0000668};
Lev Walkina7591b52014-10-12 18:37:35 -0700669static const uint8_t asn_MAP_Ypet_mmap_1[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {
Lev Walkine8318b82005-03-06 09:29:03 +0000670 (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)
Lev Walkinc8285712005-03-04 22:18:20 +0000671};
Lev Walkin59b176e2005-11-26 11:25:14 +0000672static asn_SET_specifics_t asn_SPC_Ypet_specs_1 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000673 sizeof(struct Ypet),
674 offsetof(struct Ypet, _asn_ctx),
675 offsetof(struct Ypet, _presence_map),
Lev Walkin59b176e2005-11-26 11:25:14 +0000676 asn_MAP_Ypet_tag2el_1,
Lev Walkine8318b82005-03-06 09:29:03 +0000677 5, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000678 asn_MAP_Ypet_tag2el_1, /* Same as above */
Lev Walkine8318b82005-03-06 09:29:03 +0000679 5, /* Count of tags in the CXER map */
Lev Walkinc8285712005-03-04 22:18:20 +0000680 0, /* Whether extensible */
Lev Walkin59b176e2005-11-26 11:25:14 +0000681 (unsigned int *)asn_MAP_Ypet_mmap_1 /* Mandatory elements map */
Lev Walkinc8285712005-03-04 22:18:20 +0000682};
683asn_TYPE_descriptor_t asn_DEF_Ypet = {
684 "Ypet",
685 "Ypet",
686 SET_free,
687 SET_print,
688 SET_constraint,
689 SET_decode_ber,
690 SET_encode_der,
691 SET_decode_xer,
692 SET_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000693 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000694 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000695 asn_DEF_Ypet_tags_1,
696 sizeof(asn_DEF_Ypet_tags_1)
697 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
698 asn_DEF_Ypet_tags_1, /* Same as above */
699 sizeof(asn_DEF_Ypet_tags_1)
700 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
701 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000702 asn_MBR_Ypet_1,
Lev Walkine8318b82005-03-06 09:29:03 +0000703 5, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000704 &asn_SPC_Ypet_specs_1 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000705};
706
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000707
708/*** <<< INCLUDES [EnumType] >>> ***/
709
710#include <ENUMERATED.h>
711
712/*** <<< DEPS [EnumType] >>> ***/
713
714typedef enum EnumType {
715 EnumType_one = 0,
716 EnumType_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +0000717} e_EnumType;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000718
719/*** <<< TYPE-DECLS [EnumType] >>> ***/
720
721typedef ENUMERATED_t EnumType_t;
722
723/*** <<< FUNC-DECLS [EnumType] >>> ***/
724
725extern asn_TYPE_descriptor_t asn_DEF_EnumType;
726asn_struct_free_f EnumType_free;
727asn_struct_print_f EnumType_print;
728asn_constr_check_f EnumType_constraint;
729ber_type_decoder_f EnumType_decode_ber;
730der_type_encoder_f EnumType_encode_der;
731xer_type_decoder_f EnumType_decode_xer;
732xer_type_encoder_f EnumType_encode_xer;
733
734/*** <<< CODE [EnumType] >>> ***/
735
736int
737EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000738 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000739 /* Replace with underlying type checker */
740 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000741 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000742}
743
744/*
745 * This type is implemented using ENUMERATED,
746 * so here we adjust the DEF accordingly.
747 */
748static void
749EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
750 td->free_struct = asn_DEF_ENUMERATED.free_struct;
751 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800752 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000753 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
754 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
755 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
756 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000757 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000758 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000759 if(!td->per_constraints)
760 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000761 td->elements = asn_DEF_ENUMERATED.elements;
762 td->elements_count = asn_DEF_ENUMERATED.elements_count;
Lev Walkin29a82192005-03-29 19:05:37 +0000763 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000764}
765
766void
767EnumType_free(asn_TYPE_descriptor_t *td,
768 void *struct_ptr, int contents_only) {
769 EnumType_1_inherit_TYPE_descriptor(td);
770 td->free_struct(td, struct_ptr, contents_only);
771}
772
773int
774EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
775 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
776 EnumType_1_inherit_TYPE_descriptor(td);
777 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
778}
779
780asn_dec_rval_t
781EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000782 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000783 EnumType_1_inherit_TYPE_descriptor(td);
784 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
785}
786
787asn_enc_rval_t
788EnumType_encode_der(asn_TYPE_descriptor_t *td,
789 void *structure, int tag_mode, ber_tlv_tag_t tag,
790 asn_app_consume_bytes_f *cb, void *app_key) {
791 EnumType_1_inherit_TYPE_descriptor(td);
792 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
793}
794
795asn_dec_rval_t
796EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000797 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000798 EnumType_1_inherit_TYPE_descriptor(td);
799 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
800}
801
802asn_enc_rval_t
803EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
804 int ilevel, enum xer_encoder_flags_e flags,
805 asn_app_consume_bytes_f *cb, void *app_key) {
806 EnumType_1_inherit_TYPE_descriptor(td);
807 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
808}
809
810
811/*** <<< STAT-DEFS [EnumType] >>> ***/
812
Lev Walkina7591b52014-10-12 18:37:35 -0700813static const asn_INTEGER_enum_map_t asn_MAP_EnumType_value2enum_1[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000814 { 0, 3, "one" },
815 { 1, 3, "two" }
816};
Lev Walkina7591b52014-10-12 18:37:35 -0700817static const unsigned int asn_MAP_EnumType_enum2value_1[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000818 0, /* one(0) */
819 1 /* two(1) */
820};
Lev Walkina7591b52014-10-12 18:37:35 -0700821static const asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000822 asn_MAP_EnumType_value2enum_1, /* "tag" => N; sorted by tag */
823 asn_MAP_EnumType_enum2value_1, /* N => "tag"; sorted by N */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000824 2, /* Number of elements in the maps */
825 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +0000826 1, /* Strict enumeration */
827 0, /* Native long size */
828 0
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000829};
Lev Walkina7591b52014-10-12 18:37:35 -0700830static const ber_tlv_tag_t asn_DEF_EnumType_tags_1[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000831 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
832};
833asn_TYPE_descriptor_t asn_DEF_EnumType = {
834 "EnumType",
835 "EnumType",
836 EnumType_free,
837 EnumType_print,
838 EnumType_constraint,
839 EnumType_decode_ber,
840 EnumType_encode_der,
841 EnumType_decode_xer,
842 EnumType_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000843 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000844 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000845 asn_DEF_EnumType_tags_1,
846 sizeof(asn_DEF_EnumType_tags_1)
847 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
848 asn_DEF_EnumType_tags_1, /* Same as above */
849 sizeof(asn_DEF_EnumType_tags_1)
850 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
851 0, /* No PER visible constraints */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000852 0, 0, /* Defined elsewhere */
Lev Walkin59b176e2005-11-26 11:25:14 +0000853 &asn_SPC_EnumType_specs_1 /* Additional specs */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000854};
855