blob: e64d2af0460731292415e96f7f4d422bab7c4439 [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 Walkinba68c912017-07-06 07:52:39 -070067 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +000068 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +000069 asn_DEF_data_tags_2,
70 sizeof(asn_DEF_data_tags_2)
71 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
72 asn_DEF_data_tags_2, /* Same as above */
73 sizeof(asn_DEF_data_tags_2)
74 /sizeof(asn_DEF_data_tags_2[0]), /* 1 */
75 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +000076 asn_MBR_data_2,
77 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +000078 &asn_SPC_data_specs_2 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +000079};
80
81static asn_TYPE_member_t asn_MBR_Type_1[] = {
82 { ATF_NOFLAGS, 0, offsetof(struct Type, data),
83 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
84 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000085 .type = &asn_DEF_data_2,
Lev Walkinc8285712005-03-04 22:18:20 +000086 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +000087 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
88 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +000089 .name = "data"
90 },
91};
Lev Walkina7591b52014-10-12 18:37:35 -070092static const ber_tlv_tag_t asn_DEF_Type_tags_1[] = {
Lev Walkinc8285712005-03-04 22:18:20 +000093 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
94};
Lev Walkina7591b52014-10-12 18:37:35 -070095static const asn_TYPE_tag2member_t asn_MAP_Type_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070096 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data */
Lev Walkinc8285712005-03-04 22:18:20 +000097};
Lev Walkin59b176e2005-11-26 11:25:14 +000098static asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1 = {
Lev Walkinc8285712005-03-04 22:18:20 +000099 sizeof(struct Type),
100 offsetof(struct Type, _asn_ctx),
Lev Walkin59b176e2005-11-26 11:25:14 +0000101 asn_MAP_Type_tag2el_1,
Lev Walkinc8285712005-03-04 22:18:20 +0000102 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000103 0, 0, 0, /* Optional elements (not needed) */
Lev Walkinc8285712005-03-04 22:18:20 +0000104 -1, /* Start extensions */
105 -1 /* Stop extensions */
106};
107asn_TYPE_descriptor_t asn_DEF_Type = {
108 "Type",
109 "Type",
110 SEQUENCE_free,
111 SEQUENCE_print,
112 SEQUENCE_constraint,
113 SEQUENCE_decode_ber,
114 SEQUENCE_encode_der,
115 SEQUENCE_decode_xer,
116 SEQUENCE_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000117 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinba68c912017-07-06 07:52:39 -0700118 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000119 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000120 asn_DEF_Type_tags_1,
121 sizeof(asn_DEF_Type_tags_1)
122 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
123 asn_DEF_Type_tags_1, /* Same as above */
124 sizeof(asn_DEF_Type_tags_1)
125 /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */
126 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000127 asn_MBR_Type_1,
128 1, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000129 &asn_SPC_Type_specs_1 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000130};
131
132
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000133/*** <<< INCLUDES [EpytRef] >>> ***/
134
Lev Walkin22b5ed42006-09-13 02:51:20 +0000135#include "Epyt.h"
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000136
137/*** <<< TYPE-DECLS [EpytRef] >>> ***/
138
139typedef Epyt_t EpytRef_t;
140
141/*** <<< FUNC-DECLS [EpytRef] >>> ***/
142
143extern asn_TYPE_descriptor_t asn_DEF_EpytRef;
144asn_struct_free_f EpytRef_free;
145asn_struct_print_f EpytRef_print;
146asn_constr_check_f EpytRef_constraint;
147ber_type_decoder_f EpytRef_decode_ber;
148der_type_encoder_f EpytRef_encode_der;
149xer_type_decoder_f EpytRef_decode_xer;
150xer_type_encoder_f EpytRef_encode_xer;
151
152/*** <<< CODE [EpytRef] >>> ***/
153
154int
155EpytRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000156 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000157 /* Replace with underlying type checker */
158 td->check_constraints = asn_DEF_Epyt.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000159 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000160}
161
162/*
163 * This type is implemented using Epyt,
164 * so here we adjust the DEF accordingly.
165 */
166static void
Lev Walkine8318b82005-03-06 09:29:03 +0000167EpytRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000168 td->free_struct = asn_DEF_Epyt.free_struct;
169 td->print_struct = asn_DEF_Epyt.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800170 td->check_constraints = asn_DEF_Epyt.check_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000171 td->ber_decoder = asn_DEF_Epyt.ber_decoder;
172 td->der_encoder = asn_DEF_Epyt.der_encoder;
173 td->xer_decoder = asn_DEF_Epyt.xer_decoder;
174 td->xer_encoder = asn_DEF_Epyt.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000175 td->uper_decoder = asn_DEF_Epyt.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000176 td->uper_encoder = asn_DEF_Epyt.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700177 td->oer_decoder = asn_DEF_Epyt.oer_decoder;
178 td->oer_encoder = asn_DEF_Epyt.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000179 if(!td->per_constraints)
180 td->per_constraints = asn_DEF_Epyt.per_constraints;
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000181 td->elements = asn_DEF_Epyt.elements;
182 td->elements_count = asn_DEF_Epyt.elements_count;
183 td->specifics = asn_DEF_Epyt.specifics;
184}
185
186void
187EpytRef_free(asn_TYPE_descriptor_t *td,
188 void *struct_ptr, int contents_only) {
Lev Walkine8318b82005-03-06 09:29:03 +0000189 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000190 td->free_struct(td, struct_ptr, contents_only);
191}
192
193int
194EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
195 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000196 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000197 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
198}
199
200asn_dec_rval_t
201EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000202 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkine8318b82005-03-06 09:29:03 +0000203 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000204 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
205}
206
207asn_enc_rval_t
208EpytRef_encode_der(asn_TYPE_descriptor_t *td,
209 void *structure, int tag_mode, ber_tlv_tag_t tag,
210 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000211 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000212 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
213}
214
215asn_dec_rval_t
216EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000217 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkine8318b82005-03-06 09:29:03 +0000218 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000219 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
220}
221
222asn_enc_rval_t
223EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
224 int ilevel, enum xer_encoder_flags_e flags,
225 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000226 EpytRef_1_inherit_TYPE_descriptor(td);
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000227 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
228}
229
230
231/*** <<< STAT-DEFS [EpytRef] >>> ***/
232
Lev Walkina7591b52014-10-12 18:37:35 -0700233static const ber_tlv_tag_t asn_DEF_EpytRef_tags_1[] = {
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000234 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
235};
236asn_TYPE_descriptor_t asn_DEF_EpytRef = {
237 "EpytRef",
238 "EpytRef",
239 EpytRef_free,
240 EpytRef_print,
241 EpytRef_constraint,
242 EpytRef_decode_ber,
243 EpytRef_encode_der,
244 EpytRef_decode_xer,
245 EpytRef_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000246 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinba68c912017-07-06 07:52:39 -0700247 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000248 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000249 asn_DEF_EpytRef_tags_1,
250 sizeof(asn_DEF_EpytRef_tags_1)
251 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
252 asn_DEF_EpytRef_tags_1, /* Same as above */
253 sizeof(asn_DEF_EpytRef_tags_1)
254 /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */
255 0, /* No PER visible constraints */
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000256 0, 0, /* Defined elsewhere */
257 0 /* No specifics */
258};
259
260
Lev Walkinc8285712005-03-04 22:18:20 +0000261/*** <<< INCLUDES [Epyt] >>> ***/
262
263#include <asn_SET_OF.h>
264#include <constr_SET_OF.h>
265#include <constr_SEQUENCE.h>
266
267/*** <<< FWD-DECLS [Epyt] >>> ***/
268
Lev Walkinbf56d542005-03-04 23:50:56 +0000269struct Type;
270struct Ypet;
Lev Walkinc8285712005-03-04 22:18:20 +0000271
272/*** <<< TYPE-DECLS [Epyt] >>> ***/
273
274typedef struct Epyt {
275 struct stype {
276 A_SET_OF(struct Type) list;
277
278 /* Context for parsing across buffer boundaries */
279 asn_struct_ctx_t _asn_ctx;
280 } stype;
281 struct Type *type /* OPTIONAL */;
282 struct Ypet *ypet /* OPTIONAL */;
283
284 /* Context for parsing across buffer boundaries */
285 asn_struct_ctx_t _asn_ctx;
286} Epyt_t;
287
288/*** <<< FUNC-DECLS [Epyt] >>> ***/
289
290extern asn_TYPE_descriptor_t asn_DEF_Epyt;
291
292/*** <<< POST-INCLUDE [Epyt] >>> ***/
293
Lev Walkin22b5ed42006-09-13 02:51:20 +0000294#include "Type.h"
295#include "Ypet.h"
Lev Walkinc8285712005-03-04 22:18:20 +0000296
297/*** <<< STAT-DEFS [Epyt] >>> ***/
298
299static asn_TYPE_member_t asn_MBR_stype_2[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000300 { ATF_POINTER, 0, 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000301 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
302 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000303 .type = &asn_DEF_Type,
Lev Walkinc8285712005-03-04 22:18:20 +0000304 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000305 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
306 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000307 .name = ""
308 },
309};
Lev Walkina7591b52014-10-12 18:37:35 -0700310static const ber_tlv_tag_t asn_DEF_stype_tags_2[] = {
Lev Walkinc8285712005-03-04 22:18:20 +0000311 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
312};
Lev Walkin59b176e2005-11-26 11:25:14 +0000313static asn_SET_OF_specifics_t asn_SPC_stype_specs_2 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000314 sizeof(struct stype),
315 offsetof(struct stype, _asn_ctx),
316 0, /* XER encoding is XMLDelimitedItemList */
317};
318static /* Use -fall-defs-global to expose */
319asn_TYPE_descriptor_t asn_DEF_stype_2 = {
320 "stype",
321 "stype",
322 SET_OF_free,
323 SET_OF_print,
324 SET_OF_constraint,
325 SET_OF_decode_ber,
326 SET_OF_encode_der,
327 SET_OF_decode_xer,
328 SET_OF_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000329 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinba68c912017-07-06 07:52:39 -0700330 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000331 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000332 asn_DEF_stype_tags_2,
333 sizeof(asn_DEF_stype_tags_2)
334 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
335 asn_DEF_stype_tags_2, /* Same as above */
336 sizeof(asn_DEF_stype_tags_2)
337 /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */
338 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000339 asn_MBR_stype_2,
340 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000341 &asn_SPC_stype_specs_2 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000342};
343
344static asn_TYPE_member_t asn_MBR_Epyt_1[] = {
345 { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype),
346 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
347 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000348 .type = &asn_DEF_stype_2,
Lev Walkinc8285712005-03-04 22:18:20 +0000349 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000350 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
351 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000352 .name = "stype"
353 },
354 { ATF_POINTER, 2, offsetof(struct Epyt, type),
355 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
356 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000357 .type = &asn_DEF_Type,
Lev Walkinc8285712005-03-04 22:18:20 +0000358 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000359 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
360 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000361 .name = "type"
362 },
363 { ATF_POINTER, 1, offsetof(struct Epyt, ypet),
364 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
365 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000366 .type = &asn_DEF_Ypet,
Lev Walkinc8285712005-03-04 22:18:20 +0000367 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000368 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
369 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000370 .name = "ypet"
371 },
372};
Lev Walkina7591b52014-10-12 18:37:35 -0700373static const ber_tlv_tag_t asn_DEF_Epyt_tags_1[] = {
Lev Walkinc8285712005-03-04 22:18:20 +0000374 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
375};
Lev Walkina7591b52014-10-12 18:37:35 -0700376static const asn_TYPE_tag2member_t asn_MAP_Epyt_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700377 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type */
378 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype */
379 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet */
Lev Walkinc8285712005-03-04 22:18:20 +0000380};
Lev Walkin59b176e2005-11-26 11:25:14 +0000381static asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000382 sizeof(struct Epyt),
383 offsetof(struct Epyt, _asn_ctx),
Lev Walkin59b176e2005-11-26 11:25:14 +0000384 asn_MAP_Epyt_tag2el_1,
Lev Walkinc8285712005-03-04 22:18:20 +0000385 3, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000386 0, 0, 0, /* Optional elements (not needed) */
Lev Walkinc8285712005-03-04 22:18:20 +0000387 -1, /* Start extensions */
388 -1 /* Stop extensions */
389};
390asn_TYPE_descriptor_t asn_DEF_Epyt = {
391 "Epyt",
392 "Epyt",
393 SEQUENCE_free,
394 SEQUENCE_print,
395 SEQUENCE_constraint,
396 SEQUENCE_decode_ber,
397 SEQUENCE_encode_der,
398 SEQUENCE_decode_xer,
399 SEQUENCE_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000400 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinba68c912017-07-06 07:52:39 -0700401 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000402 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000403 asn_DEF_Epyt_tags_1,
404 sizeof(asn_DEF_Epyt_tags_1)
405 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
406 asn_DEF_Epyt_tags_1, /* Same as above */
407 sizeof(asn_DEF_Epyt_tags_1)
408 /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */
409 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000410 asn_MBR_Epyt_1,
411 3, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000412 &asn_SPC_Epyt_specs_1 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000413};
414
415
416/*** <<< INCLUDES [Ypet] >>> ***/
417
Lev Walkinc8285712005-03-04 22:18:20 +0000418#include <INTEGER.h>
Lev Walkine8318b82005-03-06 09:29:03 +0000419#include <IA5String.h>
Lev Walkin22b5ed42006-09-13 02:51:20 +0000420#include "EnumType.h"
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000421#include <asn_SET_OF.h>
422#include <constr_SET_OF.h>
Lev Walkinc8285712005-03-04 22:18:20 +0000423#include <constr_SET.h>
424
425/*** <<< DEPS [Ypet] >>> ***/
426
427
428/*
429 * Method of determining the components presence
430 */
431typedef enum Ypet_PR {
432 Ypet_PR_epyt, /* Member epyt is present */
433 Ypet_PR_plain, /* Member plain is present */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000434 Ypet_PR_senums, /* Member senums is present */
Lev Walkine8318b82005-03-06 09:29:03 +0000435 Ypet_PR_patest1, /* Member patest1 is present */
436 Ypet_PR_patest2, /* Member patest2 is present */
Lev Walkinc8285712005-03-04 22:18:20 +0000437} Ypet_PR;
438
Lev Walkinb85a8132005-08-18 13:38:19 +0000439/*** <<< FWD-DECLS [Ypet] >>> ***/
440
441struct Epyt;
442
Lev Walkinc8285712005-03-04 22:18:20 +0000443/*** <<< TYPE-DECLS [Ypet] >>> ***/
444
445typedef struct Ypet {
Lev Walkinb85a8132005-08-18 13:38:19 +0000446 struct Epyt *epyt;
Lev Walkinc8285712005-03-04 22:18:20 +0000447 INTEGER_t *plain /* DEFAULT 7 */;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000448 struct senums {
449 A_SET_OF(EnumType_t) list;
450
451 /* Context for parsing across buffer boundaries */
452 asn_struct_ctx_t _asn_ctx;
453 } senums;
Lev Walkine8318b82005-03-06 09:29:03 +0000454 IA5String_t patest1;
455 IA5String_t patest2;
Lev Walkinc8285712005-03-04 22:18:20 +0000456
457 /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */
458 unsigned int _presence_map
Lev Walkine8318b82005-03-06 09:29:03 +0000459 [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
Lev Walkinc8285712005-03-04 22:18:20 +0000460
461 /* Context for parsing across buffer boundaries */
462 asn_struct_ctx_t _asn_ctx;
463} Ypet_t;
464
465/*** <<< FUNC-DECLS [Ypet] >>> ***/
466
467extern asn_TYPE_descriptor_t asn_DEF_Ypet;
468
Lev Walkinb85a8132005-08-18 13:38:19 +0000469/*** <<< POST-INCLUDE [Ypet] >>> ***/
470
Lev Walkin22b5ed42006-09-13 02:51:20 +0000471#include "Epyt.h"
Lev Walkinb85a8132005-08-18 13:38:19 +0000472
Lev Walkine8318b82005-03-06 09:29:03 +0000473/*** <<< CTABLES [Ypet] >>> ***/
474
475static int check_permitted_alphabet_6(const void *sptr) {
476 /* The underlying type is IA5String */
477 const IA5String_t *st = (const IA5String_t *)sptr;
478 const uint8_t *ch = st->buf;
479 const uint8_t *end = ch + st->size;
480
481 for(; ch < end; ch++) {
482 uint8_t cv = *ch;
483 if(!(cv >= 65 && cv <= 90)) return -1;
484 }
485 return 0;
486}
487
488static int check_permitted_alphabet_7(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 >= 97 && cv <= 122)) return -1;
497 }
498 return 0;
499}
500
501
502/*** <<< CODE [Ypet] >>> ***/
503
504static int
Lev Walkin59b176e2005-11-26 11:25:14 +0000505memb_patest1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000506 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000507 const IA5String_t *st = (const IA5String_t *)sptr;
508
509 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700510 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000511 "%s: value not given (%s:%d)",
512 td->name, __FILE__, __LINE__);
513 return -1;
514 }
515
516
517 if(!check_permitted_alphabet_6(st)) {
518 /* Constraint check succeeded */
519 return 0;
520 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700521 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000522 "%s: constraint failed (%s:%d)",
523 td->name, __FILE__, __LINE__);
524 return -1;
525 }
526}
527
528static int
Lev Walkin59b176e2005-11-26 11:25:14 +0000529memb_patest2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000530 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkine8318b82005-03-06 09:29:03 +0000531 const IA5String_t *st = (const IA5String_t *)sptr;
532
533 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700534 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000535 "%s: value not given (%s:%d)",
536 td->name, __FILE__, __LINE__);
537 return -1;
538 }
539
540
541 if(!check_permitted_alphabet_7(st)) {
542 /* Constraint check succeeded */
543 return 0;
544 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700545 ASN__CTFAIL(app_key, td, sptr,
Lev Walkine8318b82005-03-06 09:29:03 +0000546 "%s: constraint failed (%s:%d)",
547 td->name, __FILE__, __LINE__);
548 return -1;
549 }
550}
551
552
Lev Walkinc8285712005-03-04 22:18:20 +0000553/*** <<< STAT-DEFS [Ypet] >>> ***/
554
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000555static int asn_DFL_3_set_7(int set_value, void **sptr) {
Lev Walkin59b176e2005-11-26 11:25:14 +0000556 INTEGER_t *st = *sptr;
557
558 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000559 if(!set_value) return -1; /* Not a default value */
Lev Walkin59b176e2005-11-26 11:25:14 +0000560 st = (*sptr = CALLOC(1, sizeof(*st)));
561 if(!st) return -1;
562 }
563
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000564 if(set_value) {
565 /* Install default value 7 */
566 return asn_long2INTEGER(st, 7);
567 } else {
568 /* Test default value 7 */
569 long value;
570 if(asn_INTEGER2long(st, &value))
571 return -1;
572 return (value == 7);
573 }
Lev Walkin59b176e2005-11-26 11:25:14 +0000574}
Lev Walkine8318b82005-03-06 09:29:03 +0000575static asn_TYPE_member_t asn_MBR_senums_4[] = {
Lev Walkin8eb4b572005-08-16 16:57:17 +0000576 { ATF_POINTER, 0, 0,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000577 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
578 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000579 .type = &asn_DEF_EnumType,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000580 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000581 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
582 .default_value = 0,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000583 .name = ""
584 },
585};
Lev Walkina7591b52014-10-12 18:37:35 -0700586static const ber_tlv_tag_t asn_DEF_senums_tags_4[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000587 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
588};
Lev Walkin59b176e2005-11-26 11:25:14 +0000589static asn_SET_OF_specifics_t asn_SPC_senums_specs_4 = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000590 sizeof(struct senums),
591 offsetof(struct senums, _asn_ctx),
592 1, /* XER encoding is XMLValueList */
593};
594static /* Use -fall-defs-global to expose */
Lev Walkine8318b82005-03-06 09:29:03 +0000595asn_TYPE_descriptor_t asn_DEF_senums_4 = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000596 "senums",
597 "senums",
598 SET_OF_free,
599 SET_OF_print,
600 SET_OF_constraint,
601 SET_OF_decode_ber,
602 SET_OF_encode_der,
603 SET_OF_decode_xer,
604 SET_OF_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000605 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinba68c912017-07-06 07:52:39 -0700606 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000607 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000608 asn_DEF_senums_tags_4,
609 sizeof(asn_DEF_senums_tags_4)
610 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
611 asn_DEF_senums_tags_4, /* Same as above */
612 sizeof(asn_DEF_senums_tags_4)
613 /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */
614 0, /* No PER visible constraints */
Lev Walkine8318b82005-03-06 09:29:03 +0000615 asn_MBR_senums_4,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000616 1, /* Single element */
Lev Walkin59b176e2005-11-26 11:25:14 +0000617 &asn_SPC_senums_specs_4 /* Additional specs */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000618};
619
Lev Walkinc8285712005-03-04 22:18:20 +0000620static asn_TYPE_member_t asn_MBR_Ypet_1[] = {
Lev Walkinb85a8132005-08-18 13:38:19 +0000621 { ATF_POINTER, 0, offsetof(struct Ypet, epyt),
Lev Walkinc8285712005-03-04 22:18:20 +0000622 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
623 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000624 .type = &asn_DEF_Epyt,
Lev Walkinc8285712005-03-04 22:18:20 +0000625 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000626 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
627 .default_value = 0,
Lev Walkinc8285712005-03-04 22:18:20 +0000628 .name = "epyt"
629 },
630 { ATF_POINTER, 1, offsetof(struct Ypet, plain),
631 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
632 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000633 .type = &asn_DEF_INTEGER,
Lev Walkinc8285712005-03-04 22:18:20 +0000634 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000635 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
636 .default_value = asn_DFL_3_set_7, /* DEFAULT 7 */
Lev Walkinc8285712005-03-04 22:18:20 +0000637 .name = "plain"
638 },
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000639 { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),
640 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
641 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000642 .type = &asn_DEF_senums_4,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000643 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin59b176e2005-11-26 11:25:14 +0000644 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
645 .default_value = 0,
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000646 .name = "senums"
647 },
Lev Walkine8318b82005-03-06 09:29:03 +0000648 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),
649 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
650 .tag_mode = +1, /* EXPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000651 .type = &asn_DEF_IA5String,
Lev Walkin59b176e2005-11-26 11:25:14 +0000652 .memb_constraints = memb_patest1_constraint_1,
653 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
654 .default_value = 0,
Lev Walkine8318b82005-03-06 09:29:03 +0000655 .name = "patest1"
656 },
657 { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),
658 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
659 .tag_mode = +1, /* EXPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000660 .type = &asn_DEF_IA5String,
Lev Walkin59b176e2005-11-26 11:25:14 +0000661 .memb_constraints = memb_patest2_constraint_1,
662 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
663 .default_value = 0,
Lev Walkine8318b82005-03-06 09:29:03 +0000664 .name = "patest2"
665 },
Lev Walkinc8285712005-03-04 22:18:20 +0000666};
Lev Walkina7591b52014-10-12 18:37:35 -0700667static const ber_tlv_tag_t asn_DEF_Ypet_tags_1[] = {
Lev Walkinc8285712005-03-04 22:18:20 +0000668 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
669};
Lev Walkina7591b52014-10-12 18:37:35 -0700670static const asn_TYPE_tag2member_t asn_MAP_Ypet_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700671 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain */
672 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt */
673 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums */
674 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 */
675 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 */
Lev Walkinc8285712005-03-04 22:18:20 +0000676};
Lev Walkina7591b52014-10-12 18:37:35 -0700677static const uint8_t asn_MAP_Ypet_mmap_1[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {
Lev Walkine8318b82005-03-06 09:29:03 +0000678 (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)
Lev Walkinc8285712005-03-04 22:18:20 +0000679};
Lev Walkin59b176e2005-11-26 11:25:14 +0000680static asn_SET_specifics_t asn_SPC_Ypet_specs_1 = {
Lev Walkinc8285712005-03-04 22:18:20 +0000681 sizeof(struct Ypet),
682 offsetof(struct Ypet, _asn_ctx),
683 offsetof(struct Ypet, _presence_map),
Lev Walkin59b176e2005-11-26 11:25:14 +0000684 asn_MAP_Ypet_tag2el_1,
Lev Walkine8318b82005-03-06 09:29:03 +0000685 5, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000686 asn_MAP_Ypet_tag2el_1, /* Same as above */
Lev Walkine8318b82005-03-06 09:29:03 +0000687 5, /* Count of tags in the CXER map */
Lev Walkinc8285712005-03-04 22:18:20 +0000688 0, /* Whether extensible */
Lev Walkin46ef3f32017-07-06 08:47:53 -0700689 (const unsigned int *)asn_MAP_Ypet_mmap_1 /* Mandatory elements map */
Lev Walkinc8285712005-03-04 22:18:20 +0000690};
691asn_TYPE_descriptor_t asn_DEF_Ypet = {
692 "Ypet",
693 "Ypet",
694 SET_free,
695 SET_print,
696 SET_constraint,
697 SET_decode_ber,
698 SET_encode_der,
699 SET_decode_xer,
700 SET_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000701 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinba68c912017-07-06 07:52:39 -0700702 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinc8285712005-03-04 22:18:20 +0000703 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000704 asn_DEF_Ypet_tags_1,
705 sizeof(asn_DEF_Ypet_tags_1)
706 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
707 asn_DEF_Ypet_tags_1, /* Same as above */
708 sizeof(asn_DEF_Ypet_tags_1)
709 /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */
710 0, /* No PER visible constraints */
Lev Walkinc8285712005-03-04 22:18:20 +0000711 asn_MBR_Ypet_1,
Lev Walkine8318b82005-03-06 09:29:03 +0000712 5, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000713 &asn_SPC_Ypet_specs_1 /* Additional specs */
Lev Walkinc8285712005-03-04 22:18:20 +0000714};
715
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000716
717/*** <<< INCLUDES [EnumType] >>> ***/
718
719#include <ENUMERATED.h>
720
721/*** <<< DEPS [EnumType] >>> ***/
722
723typedef enum EnumType {
724 EnumType_one = 0,
725 EnumType_two = 1
Lev Walkin171487e2006-03-21 07:25:18 +0000726} e_EnumType;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000727
728/*** <<< TYPE-DECLS [EnumType] >>> ***/
729
730typedef ENUMERATED_t EnumType_t;
731
732/*** <<< FUNC-DECLS [EnumType] >>> ***/
733
734extern asn_TYPE_descriptor_t asn_DEF_EnumType;
735asn_struct_free_f EnumType_free;
736asn_struct_print_f EnumType_print;
737asn_constr_check_f EnumType_constraint;
738ber_type_decoder_f EnumType_decode_ber;
739der_type_encoder_f EnumType_encode_der;
740xer_type_decoder_f EnumType_decode_xer;
741xer_type_encoder_f EnumType_encode_xer;
742
743/*** <<< CODE [EnumType] >>> ***/
744
745int
746EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000747 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000748 /* Replace with underlying type checker */
749 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000750 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000751}
752
753/*
754 * This type is implemented using ENUMERATED,
755 * so here we adjust the DEF accordingly.
756 */
757static void
758EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
759 td->free_struct = asn_DEF_ENUMERATED.free_struct;
760 td->print_struct = asn_DEF_ENUMERATED.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800761 td->check_constraints = asn_DEF_ENUMERATED.check_constraints;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000762 td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder;
763 td->der_encoder = asn_DEF_ENUMERATED.der_encoder;
764 td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder;
765 td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000766 td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000767 td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700768 td->oer_decoder = asn_DEF_ENUMERATED.oer_decoder;
769 td->oer_encoder = asn_DEF_ENUMERATED.oer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000770 if(!td->per_constraints)
771 td->per_constraints = asn_DEF_ENUMERATED.per_constraints;
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000772 td->elements = asn_DEF_ENUMERATED.elements;
773 td->elements_count = asn_DEF_ENUMERATED.elements_count;
Lev Walkin29a82192005-03-29 19:05:37 +0000774 /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000775}
776
777void
778EnumType_free(asn_TYPE_descriptor_t *td,
779 void *struct_ptr, int contents_only) {
780 EnumType_1_inherit_TYPE_descriptor(td);
781 td->free_struct(td, struct_ptr, contents_only);
782}
783
784int
785EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
786 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
787 EnumType_1_inherit_TYPE_descriptor(td);
788 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
789}
790
791asn_dec_rval_t
792EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000793 void **structure, const void *bufptr, size_t size, int tag_mode) {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000794 EnumType_1_inherit_TYPE_descriptor(td);
795 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
796}
797
798asn_enc_rval_t
799EnumType_encode_der(asn_TYPE_descriptor_t *td,
800 void *structure, int tag_mode, ber_tlv_tag_t tag,
801 asn_app_consume_bytes_f *cb, void *app_key) {
802 EnumType_1_inherit_TYPE_descriptor(td);
803 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
804}
805
806asn_dec_rval_t
807EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkin3ebc65a2005-03-17 21:57:19 +0000808 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000809 EnumType_1_inherit_TYPE_descriptor(td);
810 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
811}
812
813asn_enc_rval_t
814EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
815 int ilevel, enum xer_encoder_flags_e flags,
816 asn_app_consume_bytes_f *cb, void *app_key) {
817 EnumType_1_inherit_TYPE_descriptor(td);
818 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
819}
820
821
822/*** <<< STAT-DEFS [EnumType] >>> ***/
823
Lev Walkina7591b52014-10-12 18:37:35 -0700824static const asn_INTEGER_enum_map_t asn_MAP_EnumType_value2enum_1[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000825 { 0, 3, "one" },
826 { 1, 3, "two" }
827};
Lev Walkina7591b52014-10-12 18:37:35 -0700828static const unsigned int asn_MAP_EnumType_enum2value_1[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000829 0, /* one(0) */
830 1 /* two(1) */
831};
johvike70c4072017-05-09 11:06:12 +0200832static asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1 = {
Lev Walkin59b176e2005-11-26 11:25:14 +0000833 asn_MAP_EnumType_value2enum_1, /* "tag" => N; sorted by tag */
834 asn_MAP_EnumType_enum2value_1, /* N => "tag"; sorted by N */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000835 2, /* Number of elements in the maps */
836 0, /* Enumeration is not extensible */
Lev Walkin8bb57a22007-12-03 13:41:36 +0000837 1, /* Strict enumeration */
838 0, /* Native long size */
839 0
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000840};
Lev Walkina7591b52014-10-12 18:37:35 -0700841static const ber_tlv_tag_t asn_DEF_EnumType_tags_1[] = {
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000842 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
843};
844asn_TYPE_descriptor_t asn_DEF_EnumType = {
845 "EnumType",
846 "EnumType",
847 EnumType_free,
848 EnumType_print,
849 EnumType_constraint,
850 EnumType_decode_ber,
851 EnumType_encode_der,
852 EnumType_decode_xer,
853 EnumType_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000854 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinba68c912017-07-06 07:52:39 -0700855 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000856 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000857 asn_DEF_EnumType_tags_1,
858 sizeof(asn_DEF_EnumType_tags_1)
859 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
860 asn_DEF_EnumType_tags_1, /* Same as above */
861 sizeof(asn_DEF_EnumType_tags_1)
862 /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */
863 0, /* No PER visible constraints */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000864 0, 0, /* Defined elsewhere */
Lev Walkin59b176e2005-11-26 11:25:14 +0000865 &asn_SPC_EnumType_specs_1 /* Additional specs */
Lev Walkinfe7f6ec2005-03-04 22:38:22 +0000866};
867