blob: e675d08a37973c26400db0748c3f142a403cb57d [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 Walkinb33425f2017-07-14 14:59:52 +040042 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +000043 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
44 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +000045 .name = ""
46 },
47};
Lev Walkina7591b52014-10-12 18:37:35 -070048static const ber_tlv_tag_t asn_DEF_data_tags_2[] = {
Lev Walkinc8285712005-03-04 22:18:20 +000049 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
50};
Lev Walkin59b176e2005-11-26 11:25:14 +000051static asn_SET_OF_specifics_t asn_SPC_data_specs_2 = {
Lev Walkinc8285712005-03-04 22:18:20 +000052 sizeof(struct data),
53 offsetof(struct data, _asn_ctx),
54 0, /* XER encoding is XMLDelimitedItemList */
55};
56static /* Use -fall-defs-global to expose */
57asn_TYPE_descriptor_t asn_DEF_data_2 = {
58 "data",
59 "data",
60 SEQUENCE_OF_free,
61 SEQUENCE_OF_print,
62 SEQUENCE_OF_constraint,
63 SEQUENCE_OF_decode_ber,
64 SEQUENCE_OF_encode_der,
65 SEQUENCE_OF_decode_xer,
66 SEQUENCE_OF_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -070067 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +040068 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +000069 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +000070 asn_DEF_data_tags_2,
71 sizeof(asn_DEF_data_tags_2)
72 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
73 asn_DEF_data_tags_2, /* Same as above */
74 sizeof(asn_DEF_data_tags_2)
75 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +040076 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +000077 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +000078 asn_MBR_data_2,
79 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +000080 &asn_SPC_data_specs_2 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +000081};
82
83static asn_TYPE_member_t asn_MBR_Type_1[] = {
84 { ATF_NOFLAGS, 0, offsetof(struct Type, data),
85 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
86 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000087 .type = &asn_DEF_data_2,
Lev Walkinc8285712005-03-04 22:18:20 +000088 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040089 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +000090 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
91 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +000092 .name = "data"
93 },
94};
Lev Walkina7591b52014-10-12 18:37:35 -070095static const ber_tlv_tag_t asn_DEF_Type_tags_1[] = {
Lev Walkinc8285712005-03-04 22:18:20 +000096 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
97};
Lev Walkina7591b52014-10-12 18:37:35 -070098static const asn_TYPE_tag2member_t asn_MAP_Type_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070099 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data */
Lev Walkinc8285712005-03-04 22:18:20 +0000100};
Lev Walkin59b176e2005-11-26 11:25:14 +0000101static asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000102 sizeof(struct Type),
103 offsetof(struct Type, _asn_ctx),
Lev Walkin59b176e2005-11-26 11:25:14 +0000104 asn_MAP_Type_tag2el_1,
Lev Walkinc8285712005-03-04 22:18:20 +0000105 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000106 0, 0, 0, /* Optional elements (not needed) */
Lev Walkinc8285712005-03-04 22:18:20 +0000107 -1, /* Start extensions */
108 -1 /* Stop extensions */
109};
110asn_TYPE_descriptor_t asn_DEF_Type = {
111 "Type",
112 "Type",
113 SEQUENCE_free,
114 SEQUENCE_print,
115 SEQUENCE_constraint,
116 SEQUENCE_decode_ber,
117 SEQUENCE_encode_der,
118 SEQUENCE_decode_xer,
119 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700120 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400121 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000122 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000123 asn_DEF_Type_tags_1,
124 sizeof(asn_DEF_Type_tags_1)
125 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
126 asn_DEF_Type_tags_1, /* Same as above */
127 sizeof(asn_DEF_Type_tags_1)
128 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400129 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000130 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000131 asn_MBR_Type_1,
132 1, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000133 &asn_SPC_Type_specs_1 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000134};
135
136
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000137/*** <<< INCLUDES [EpytRef] >>> ***/
138
Lev Walkin22b5ed42006-09-13 02:51:20 +0000139#include "Epyt.h"
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000140
141/*** <<< TYPE-DECLS [EpytRef] >>> ***/
142
143typedef Epyt_t EpytRef_t;
144
145/*** <<< FUNC-DECLS [EpytRef] >>> ***/
146
147extern asn_TYPE_descriptor_t asn_DEF_EpytRef;
148asn_struct_free_f EpytRef_free;
149asn_struct_print_f EpytRef_print;
150asn_constr_check_f EpytRef_constraint;
151ber_type_decoder_f EpytRef_decode_ber;
152der_type_encoder_f EpytRef_encode_der;
153xer_type_decoder_f EpytRef_decode_xer;
154xer_type_encoder_f EpytRef_encode_xer;
155
156/*** <<< CODE [EpytRef] >>> ***/
157
158int
159EpytRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000160 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000161 /* Replace with underlying type checker */
162 td->check_constraints = asn_DEF_Epyt.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000163 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000164}
165
166/*
167 * This type is implemented using Epyt,
168 * so here we adjust the DEF accordingly.
169 */
170static void
Lev Walkine8318b82005-03-06 09:29:03 +0000171EpytRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000172 td->free_struct = asn_DEF_Epyt.free_struct;
173 td->print_struct = asn_DEF_Epyt.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800174 td->check_constraints = asn_DEF_Epyt.check_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000175 td->ber_decoder = asn_DEF_Epyt.ber_decoder;
176 td->der_encoder = asn_DEF_Epyt.der_encoder;
177 td->xer_decoder = asn_DEF_Epyt.xer_decoder;
178 td->xer_encoder = asn_DEF_Epyt.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000179 td->uper_decoder = asn_DEF_Epyt.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000180 td->uper_encoder = asn_DEF_Epyt.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700181 td->oer_decoder = asn_DEF_Epyt.oer_decoder;
182 td->oer_encoder = asn_DEF_Epyt.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400183 if(!td->oer_constraints)
184 td->oer_constraints = asn_DEF_Epyt.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000185 if(!td->per_constraints)
186 td->per_constraints = asn_DEF_Epyt.per_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000187 td->elements = asn_DEF_Epyt.elements;
188 td->elements_count = asn_DEF_Epyt.elements_count;
189 td->specifics = asn_DEF_Epyt.specifics;
190}
191
192void
193EpytRef_free(asn_TYPE_descriptor_t *td,
194 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +0000195 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000196 td->free_struct(td, struct_ptr, contents_only);
197}
198
199int
200EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
201 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000202 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000203 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
204}
205
206asn_dec_rval_t
207EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000208 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +0000209 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000210 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
211}
212
213asn_enc_rval_t
214EpytRef_encode_der(asn_TYPE_descriptor_t *td,
215 void *structure, int tag_mode, ber_tlv_tag_t tag,
216 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000217 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000218 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
219}
220
221asn_dec_rval_t
222EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000223 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +0000224 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000225 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
226}
227
228asn_enc_rval_t
229EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
230 int ilevel, enum xer_encoder_flags_e flags,
231 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000232 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000233 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
234}
235
236
237/*** <<< STAT-DEFS [EpytRef] >>> ***/
238
Lev Walkina7591b52014-10-12 18:37:35 -0700239static const ber_tlv_tag_t asn_DEF_EpytRef_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000240 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
241};
242asn_TYPE_descriptor_t asn_DEF_EpytRef = {
243 "EpytRef",
244 "EpytRef",
245 EpytRef_free,
246 EpytRef_print,
247 EpytRef_constraint,
248 EpytRef_decode_ber,
249 EpytRef_encode_der,
250 EpytRef_decode_xer,
251 EpytRef_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700252 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400253 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000254 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000255 asn_DEF_EpytRef_tags_1,
256 sizeof(asn_DEF_EpytRef_tags_1)
257 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
258 asn_DEF_EpytRef_tags_1, /* Same as above */
259 sizeof(asn_DEF_EpytRef_tags_1)
260 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400261 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000262 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000263 0, 0, /* Defined elsewhere */
264 0 /* No specifics */
265};
266
267
Lev Walkinc8285712005-03-04 22:18:20 +0000268/*** <<< INCLUDES [Epyt] >>> ***/
269
270#include <asn_SET_OF.h>
271#include <constr_SET_OF.h>
272#include <constr_SEQUENCE.h>
273
274/*** <<< FWD-DECLS [Epyt] >>> ***/
275
Lev Walkinbf56d542005-03-04 23:50:56 +0000276struct Type;
277struct Ypet;
Lev Walkinc8285712005-03-04 22:18:20 +0000278
279/*** <<< TYPE-DECLS [Epyt] >>> ***/
280
281typedef struct Epyt {
282 struct stype {
283 A_SET_OF(struct Type) list;
284
285 /* Context for parsing across buffer boundaries */
286 asn_struct_ctx_t _asn_ctx;
287 } stype;
288 struct Type *type /* OPTIONAL */;
289 struct Ypet *ypet /* OPTIONAL */;
290
291 /* Context for parsing across buffer boundaries */
292 asn_struct_ctx_t _asn_ctx;
293} Epyt_t;
294
295/*** <<< FUNC-DECLS [Epyt] >>> ***/
296
297extern asn_TYPE_descriptor_t asn_DEF_Epyt;
298
299/*** <<< POST-INCLUDE [Epyt] >>> ***/
300
Lev Walkin22b5ed42006-09-13 02:51:20 +0000301#include "Type.h"
302#include "Ypet.h"
Lev Walkinc8285712005-03-04 22:18:20 +0000303
304/*** <<< STAT-DEFS [Epyt] >>> ***/
305
306static asn_TYPE_member_t asn_MBR_stype_2[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000307 { ATF_POINTER, 0, 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000308 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
309 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000310 .type = &asn_DEF_Type,
Lev Walkinc8285712005-03-04 22:18:20 +0000311 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400312 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000313 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
314 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000315 .name = ""
316 },
317};
Lev Walkina7591b52014-10-12 18:37:35 -0700318static const ber_tlv_tag_t asn_DEF_stype_tags_2[] = {
Lev Walkinc8285712005-03-04 22:18:20 +0000319 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
320};
Lev Walkin59b176e2005-11-26 11:25:14 +0000321static asn_SET_OF_specifics_t asn_SPC_stype_specs_2 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000322 sizeof(struct stype),
323 offsetof(struct stype, _asn_ctx),
324 0, /* XER encoding is XMLDelimitedItemList */
325};
326static /* Use -fall-defs-global to expose */
327asn_TYPE_descriptor_t asn_DEF_stype_2 = {
328 "stype",
329 "stype",
330 SET_OF_free,
331 SET_OF_print,
332 SET_OF_constraint,
333 SET_OF_decode_ber,
334 SET_OF_encode_der,
335 SET_OF_decode_xer,
336 SET_OF_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700337 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400338 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000339 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000340 asn_DEF_stype_tags_2,
341 sizeof(asn_DEF_stype_tags_2)
342 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
343 asn_DEF_stype_tags_2, /* Same as above */
344 sizeof(asn_DEF_stype_tags_2)
345 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400346 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000347 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000348 asn_MBR_stype_2,
349 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000350 &asn_SPC_stype_specs_2 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000351};
352
353static asn_TYPE_member_t asn_MBR_Epyt_1[] = {
354 { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype),
355 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
356 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000357 .type = &asn_DEF_stype_2,
Lev Walkinc8285712005-03-04 22:18:20 +0000358 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400359 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000360 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
361 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000362 .name = "stype"
363 },
364 { ATF_POINTER, 2, offsetof(struct Epyt, type),
365 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
366 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000367 .type = &asn_DEF_Type,
Lev Walkinc8285712005-03-04 22:18:20 +0000368 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400369 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000370 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
371 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000372 .name = "type"
373 },
374 { ATF_POINTER, 1, offsetof(struct Epyt, ypet),
375 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
376 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000377 .type = &asn_DEF_Ypet,
Lev Walkinc8285712005-03-04 22:18:20 +0000378 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400379 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000380 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
381 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000382 .name = "ypet"
383 },
384};
Lev Walkina7591b52014-10-12 18:37:35 -0700385static const ber_tlv_tag_t asn_DEF_Epyt_tags_1[] = {
Lev Walkinc8285712005-03-04 22:18:20 +0000386 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
387};
Lev Walkina7591b52014-10-12 18:37:35 -0700388static const asn_TYPE_tag2member_t asn_MAP_Epyt_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700389 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type */
390 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype */
391 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet */
Lev Walkinc8285712005-03-04 22:18:20 +0000392};
Lev Walkin59b176e2005-11-26 11:25:14 +0000393static asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000394 sizeof(struct Epyt),
395 offsetof(struct Epyt, _asn_ctx),
Lev Walkin59b176e2005-11-26 11:25:14 +0000396 asn_MAP_Epyt_tag2el_1,
Lev Walkinc8285712005-03-04 22:18:20 +0000397 3, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000398 0, 0, 0, /* Optional elements (not needed) */
Lev Walkinc8285712005-03-04 22:18:20 +0000399 -1, /* Start extensions */
400 -1 /* Stop extensions */
401};
402asn_TYPE_descriptor_t asn_DEF_Epyt = {
403 "Epyt",
404 "Epyt",
405 SEQUENCE_free,
406 SEQUENCE_print,
407 SEQUENCE_constraint,
408 SEQUENCE_decode_ber,
409 SEQUENCE_encode_der,
410 SEQUENCE_decode_xer,
411 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700412 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400413 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000414 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000415 asn_DEF_Epyt_tags_1,
416 sizeof(asn_DEF_Epyt_tags_1)
417 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
418 asn_DEF_Epyt_tags_1, /* Same as above */
419 sizeof(asn_DEF_Epyt_tags_1)
420 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400421 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000422 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000423 asn_MBR_Epyt_1,
424 3, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000425 &asn_SPC_Epyt_specs_1 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000426};
427
428
429/*** <<< INCLUDES [Ypet] >>> ***/
430
Lev Walkinc8285712005-03-04 22:18:20 +0000431#include <INTEGER.h>
Lev Walkine8318b82005-03-06 09:29:03 +0000432#include <IA5String.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +0000433#include "EnumType.h"
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000434#include <asn_SET_OF.h>
435#include <constr_SET_OF.h>
Lev Walkinc8285712005-03-04 22:18:20 +0000436#include <constr_SET.h>
437
438/*** <<< DEPS [Ypet] >>> ***/
439
440
441/*
442 * Method of determining the components presence
443 */
444typedef enum Ypet_PR {
445 Ypet_PR_epyt, /* Member epyt is present */
446 Ypet_PR_plain, /* Member plain is present */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000447 Ypet_PR_senums, /* Member senums is present */
Lev Walkine8318b82005-03-06 09:29:03 +0000448 Ypet_PR_patest1, /* Member patest1 is present */
449 Ypet_PR_patest2, /* Member patest2 is present */
Lev Walkinc8285712005-03-04 22:18:20 +0000450} Ypet_PR;
451
Lev Walkinb85a8132005-08-18 13:38:19 +0000452/*** <<< FWD-DECLS [Ypet] >>> ***/
453
454struct Epyt;
455
Lev Walkinc8285712005-03-04 22:18:20 +0000456/*** <<< TYPE-DECLS [Ypet] >>> ***/
457
458typedef struct Ypet {
Lev Walkinb85a8132005-08-18 13:38:19 +0000459 struct Epyt *epyt;
Lev Walkinc8285712005-03-04 22:18:20 +0000460 INTEGER_t *plain /* DEFAULT 7 */;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000461 struct senums {
462 A_SET_OF(EnumType_t) list;
463
464 /* Context for parsing across buffer boundaries */
465 asn_struct_ctx_t _asn_ctx;
466 } senums;
Lev Walkine8318b82005-03-06 09:29:03 +0000467 IA5String_t patest1;
468 IA5String_t patest2;
Lev Walkinc8285712005-03-04 22:18:20 +0000469
470 /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
471 unsigned int _presence_map
Lev Walkine8318b82005-03-06 09:29:03 +0000472 [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
Lev Walkinc8285712005-03-04 22:18:20 +0000473
474 /* Context for parsing across buffer boundaries */
475 asn_struct_ctx_t _asn_ctx;
476} Ypet_t;
477
478/*** <<< FUNC-DECLS [Ypet] >>> ***/
479
480extern asn_TYPE_descriptor_t asn_DEF_Ypet;
481
Lev Walkinb85a8132005-08-18 13:38:19 +0000482/*** <<< POST-INCLUDE [Ypet] >>> ***/
483
Lev Walkin22b5ed42006-09-13 02:51:20 +0000484#include "Epyt.h"
Lev Walkinb85a8132005-08-18 13:38:19 +0000485
Lev Walkine8318b82005-03-06 09:29:03 +0000486/*** <<< CTABLES [Ypet] >>> ***/
487
488static int check_permitted_alphabet_6(const void *sptr) {
489 /* The underlying type is IA5String */
490 const IA5String_t *st = (const IA5String_t *)sptr;
491 const uint8_t *ch = st->buf;
492 const uint8_t *end = ch + st->size;
493
494 for(; ch < end; ch++) {
495 uint8_t cv = *ch;
496 if(!(cv >= 65 && cv <= 90)) return -1;
497 }
498 return 0;
499}
500
501static int check_permitted_alphabet_7(const void *sptr) {
502 /* The underlying type is IA5String */
503 const IA5String_t *st = (const IA5String_t *)sptr;
504 const uint8_t *ch = st->buf;
505 const uint8_t *end = ch + st->size;
506
507 for(; ch < end; ch++) {
508 uint8_t cv = *ch;
509 if(!(cv >= 97 && cv <= 122)) return -1;
510 }
511 return 0;
512}
513
514
515/*** <<< CODE [Ypet] >>> ***/
516
517static int
Lev Walkin59b176e2005-11-26 11:25:14 +0000518memb_patest1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000519 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000520 const IA5String_t *st = (const IA5String_t *)sptr;
521
522 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700523 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000524 "%s: value not given (%s:%d)",
525 td->name, __FILE__, __LINE__);
526 return -1;
527 }
528
529
530 if(!check_permitted_alphabet_6(st)) {
531 /* Constraint check succeeded */
532 return 0;
533 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700534 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000535 "%s: constraint failed (%s:%d)",
536 td->name, __FILE__, __LINE__);
537 return -1;
538 }
539}
540
541static int
Lev Walkin59b176e2005-11-26 11:25:14 +0000542memb_patest2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000543 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000544 const IA5String_t *st = (const IA5String_t *)sptr;
545
546 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700547 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000548 "%s: value not given (%s:%d)",
549 td->name, __FILE__, __LINE__);
550 return -1;
551 }
552
553
554 if(!check_permitted_alphabet_7(st)) {
555 /* Constraint check succeeded */
556 return 0;
557 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700558 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000559 "%s: constraint failed (%s:%d)",
560 td->name, __FILE__, __LINE__);
561 return -1;
562 }
563}
564
565
Lev Walkinc8285712005-03-04 22:18:20 +0000566/*** <<< STAT-DEFS [Ypet] >>> ***/
567
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000568static int asn_DFL_3_set_7(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000569 INTEGER_t *st = *sptr;
570
571 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000572 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +0000573 st = (*sptr = CALLOC(1, sizeof(*st)));
574 if(!st) return -1;
575 }
576
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000577 if(set_value) {
578 /* Install default value 7 */
579 return asn_long2INTEGER(st, 7);
580 } else {
581 /* Test default value 7 */
582 long value;
583 if(asn_INTEGER2long(st, &value))
584 return -1;
585 return (value == 7);
586 }
Lev Walkin59b176e2005-11-26 11:25:14 +0000587}
Lev Walkine8318b82005-03-06 09:29:03 +0000588static asn_TYPE_member_t asn_MBR_senums_4[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000589 { ATF_POINTER, 0, 0,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000590 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
591 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000592 .type = &asn_DEF_EnumType,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000593 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400594 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000595 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
596 .default_value = 0,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000597 .name = ""
598 },
599};
Lev Walkina7591b52014-10-12 18:37:35 -0700600static const ber_tlv_tag_t asn_DEF_senums_tags_4[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000601 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
602};
Lev Walkin59b176e2005-11-26 11:25:14 +0000603static asn_SET_OF_specifics_t asn_SPC_senums_specs_4 = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000604 sizeof(struct senums),
605 offsetof(struct senums, _asn_ctx),
606 1, /* XER encoding is XMLValueList */
607};
608static /* Use -fall-defs-global to expose */
Lev Walkine8318b82005-03-06 09:29:03 +0000609asn_TYPE_descriptor_t asn_DEF_senums_4 = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000610 "senums",
611 "senums",
612 SET_OF_free,
613 SET_OF_print,
614 SET_OF_constraint,
615 SET_OF_decode_ber,
616 SET_OF_encode_der,
617 SET_OF_decode_xer,
618 SET_OF_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700619 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400620 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000621 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000622 asn_DEF_senums_tags_4,
623 sizeof(asn_DEF_senums_tags_4)
624 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
625 asn_DEF_senums_tags_4, /* Same as above */
626 sizeof(asn_DEF_senums_tags_4)
627 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400628 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000629 0, /* No PER visible constraints */
Lev Walkine8318b82005-03-06 09:29:03 +0000630 asn_MBR_senums_4,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000631 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000632 &asn_SPC_senums_specs_4 /* Additional specs */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000633};
634
Lev Walkinc8285712005-03-04 22:18:20 +0000635static asn_TYPE_member_t asn_MBR_Ypet_1[] = {
Lev Walkinb85a8132005-08-18 13:38:19 +0000636 { ATF_POINTER, 0, offsetof(struct Ypet, epyt),
Lev Walkinc8285712005-03-04 22:18:20 +0000637 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
638 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000639 .type = &asn_DEF_Epyt,
Lev Walkinc8285712005-03-04 22:18:20 +0000640 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400641 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000642 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
643 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000644 .name = "epyt"
645 },
646 { ATF_POINTER, 1, offsetof(struct Ypet, plain),
647 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
648 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000649 .type = &asn_DEF_INTEGER,
Lev Walkinc8285712005-03-04 22:18:20 +0000650 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400651 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000652 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
653 .default_value = asn_DFL_3_set_7, /* DEFAULT 7 */
Lev Walkinc8285712005-03-04 22:18:20 +0000654 .name = "plain"
655 },
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000656 { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
657 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
658 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000659 .type = &asn_DEF_senums_4,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000660 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400661 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000662 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
663 .default_value = 0,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000664 .name = "senums"
665 },
Lev Walkine8318b82005-03-06 09:29:03 +0000666 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),
667 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
668 .tag_mode = +1, /* EXPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000669 .type = &asn_DEF_IA5String,
Lev Walkin59b176e2005-11-26 11:25:14 +0000670 .memb_constraints = memb_patest1_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400671 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000672 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
673 .default_value = 0,
Lev Walkine8318b82005-03-06 09:29:03 +0000674 .name = "patest1"
675 },
676 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),
677 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
678 .tag_mode = +1, /* EXPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000679 .type = &asn_DEF_IA5String,
Lev Walkin59b176e2005-11-26 11:25:14 +0000680 .memb_constraints = memb_patest2_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400681 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000682 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
683 .default_value = 0,
Lev Walkine8318b82005-03-06 09:29:03 +0000684 .name = "patest2"
685 },
Lev Walkinc8285712005-03-04 22:18:20 +0000686};
Lev Walkina7591b52014-10-12 18:37:35 -0700687static const ber_tlv_tag_t asn_DEF_Ypet_tags_1[] = {
Lev Walkinc8285712005-03-04 22:18:20 +0000688 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
689};
Lev Walkina7591b52014-10-12 18:37:35 -0700690static const asn_TYPE_tag2member_t asn_MAP_Ypet_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700691 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain */
692 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt */
693 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums */
694 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 */
695 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 */
Lev Walkinc8285712005-03-04 22:18:20 +0000696};
Lev Walkina7591b52014-10-12 18:37:35 -0700697static const uint8_t asn_MAP_Ypet_mmap_1[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {
Lev Walkine8318b82005-03-06 09:29:03 +0000698 (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)
Lev Walkinc8285712005-03-04 22:18:20 +0000699};
Lev Walkin59b176e2005-11-26 11:25:14 +0000700static asn_SET_specifics_t asn_SPC_Ypet_specs_1 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000701 sizeof(struct Ypet),
702 offsetof(struct Ypet, _asn_ctx),
703 offsetof(struct Ypet, _presence_map),
Lev Walkin59b176e2005-11-26 11:25:14 +0000704 asn_MAP_Ypet_tag2el_1,
Lev Walkine8318b82005-03-06 09:29:03 +0000705 5, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000706 asn_MAP_Ypet_tag2el_1, /* Same as above */
Lev Walkine8318b82005-03-06 09:29:03 +0000707 5, /* Count of tags in the CXER map */
Lev Walkinc8285712005-03-04 22:18:20 +0000708 0, /* Whether extensible */
Lev Walkin46ef3f32017-07-06 08:47:53 -0700709 (const unsigned int *)asn_MAP_Ypet_mmap_1 /* Mandatory elements map */
Lev Walkinc8285712005-03-04 22:18:20 +0000710};
711asn_TYPE_descriptor_t asn_DEF_Ypet = {
712 "Ypet",
713 "Ypet",
714 SET_free,
715 SET_print,
716 SET_constraint,
717 SET_decode_ber,
718 SET_encode_der,
719 SET_decode_xer,
720 SET_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700721 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400722 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000723 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000724 asn_DEF_Ypet_tags_1,
725 sizeof(asn_DEF_Ypet_tags_1)
726 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
727 asn_DEF_Ypet_tags_1, /* Same as above */
728 sizeof(asn_DEF_Ypet_tags_1)
729 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400730 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000731 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000732 asn_MBR_Ypet_1,
Lev Walkine8318b82005-03-06 09:29:03 +0000733 5, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000734 &asn_SPC_Ypet_specs_1 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000735};
736
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000737
738/*** <<< INCLUDES [EnumType] >>> ***/
739
740#include <ENUMERATED.h>
741
742/*** <<< DEPS [EnumType] >>> ***/
743
744typedef enum EnumType {
745 EnumType_one = 0,
746 EnumType_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +0000747} e_EnumType;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000748
749/*** <<< TYPE-DECLS [EnumType] >>> ***/
750
751typedef ENUMERATED_t EnumType_t;
752
753/*** <<< FUNC-DECLS [EnumType] >>> ***/
754
755extern asn_TYPE_descriptor_t asn_DEF_EnumType;
756asn_struct_free_f EnumType_free;
757asn_struct_print_f EnumType_print;
758asn_constr_check_f EnumType_constraint;
759ber_type_decoder_f EnumType_decode_ber;
760der_type_encoder_f EnumType_encode_der;
761xer_type_decoder_f EnumType_decode_xer;
762xer_type_encoder_f EnumType_encode_xer;
763
764/*** <<< CODE [EnumType] >>> ***/
765
766int
767EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000768 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000769 /* Replace with underlying type checker */
770 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000771 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000772}
773
774/*
775 * This type is implemented using ENUMERATED,
776 * so here we adjust the DEF accordingly.
777 */
778static void
779EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
780 td->free_struct = asn_DEF_ENUMERATED.free_struct;
781 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800782 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000783 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
784 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
785 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
786 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000787 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000788 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700789 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
790 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400791 if(!td->oer_constraints)
792 td->oer_constraints = asn_DEF_ENUMERATED.oer_constraints;
Lev Walkin59b176e2005-11-26 11:25:14 +0000793 if(!td->per_constraints)
794 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000795 td->elements = asn_DEF_ENUMERATED.elements;
796 td->elements_count = asn_DEF_ENUMERATED.elements_count;
Lev Walkin29a82192005-03-29 19:05:37 +0000797 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000798}
799
800void
801EnumType_free(asn_TYPE_descriptor_t *td,
802 void *struct_ptr, int contents_only) {
803 EnumType_1_inherit_TYPE_descriptor(td);
804 td->free_struct(td, struct_ptr, contents_only);
805}
806
807int
808EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
809 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
810 EnumType_1_inherit_TYPE_descriptor(td);
811 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
812}
813
814asn_dec_rval_t
815EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000816 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000817 EnumType_1_inherit_TYPE_descriptor(td);
818 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
819}
820
821asn_enc_rval_t
822EnumType_encode_der(asn_TYPE_descriptor_t *td,
823 void *structure, int tag_mode, ber_tlv_tag_t tag,
824 asn_app_consume_bytes_f *cb, void *app_key) {
825 EnumType_1_inherit_TYPE_descriptor(td);
826 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
827}
828
829asn_dec_rval_t
830EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000831 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000832 EnumType_1_inherit_TYPE_descriptor(td);
833 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
834}
835
836asn_enc_rval_t
837EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
838 int ilevel, enum xer_encoder_flags_e flags,
839 asn_app_consume_bytes_f *cb, void *app_key) {
840 EnumType_1_inherit_TYPE_descriptor(td);
841 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
842}
843
844
845/*** <<< STAT-DEFS [EnumType] >>> ***/
846
Lev Walkina7591b52014-10-12 18:37:35 -0700847static const asn_INTEGER_enum_map_t asn_MAP_EnumType_value2enum_1[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000848 { 0, 3, "one" },
849 { 1, 3, "two" }
850};
Lev Walkina7591b52014-10-12 18:37:35 -0700851static const unsigned int asn_MAP_EnumType_enum2value_1[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000852 0, /* one(0) */
853 1 /* two(1) */
854};
johvike70c4072017-05-09 11:06:12 +0200855static asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000856 asn_MAP_EnumType_value2enum_1, /* "tag" => N; sorted by tag */
857 asn_MAP_EnumType_enum2value_1, /* N => "tag"; sorted by N */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000858 2, /* Number of elements in the maps */
859 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +0000860 1, /* Strict enumeration */
861 0, /* Native long size */
862 0
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000863};
Lev Walkina7591b52014-10-12 18:37:35 -0700864static const ber_tlv_tag_t asn_DEF_EnumType_tags_1[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000865 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
866};
867asn_TYPE_descriptor_t asn_DEF_EnumType = {
868 "EnumType",
869 "EnumType",
870 EnumType_free,
871 EnumType_print,
872 EnumType_constraint,
873 EnumType_decode_ber,
874 EnumType_encode_der,
875 EnumType_decode_xer,
876 EnumType_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700877 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400878 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000879 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000880 asn_DEF_EnumType_tags_1,
881 sizeof(asn_DEF_EnumType_tags_1)
882 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
883 asn_DEF_EnumType_tags_1, /* Same as above */
884 sizeof(asn_DEF_EnumType_tags_1)
885 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400886 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000887 0, /* No PER visible constraints */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000888 0, 0, /* Defined elsewhere */
Lev Walkin59b176e2005-11-26 11:25:14 +0000889 &asn_SPC_EnumType_specs_1 /* Additional specs */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000890};
891