blob: 101e06e11325b5857cf379ebd6c8a36797074c66 [file] [log] [blame]
Lev Walkin15750402005-07-03 05:27:19 +00001
Lev Walkina00d6b32006-03-21 03:40:38 +00002/*** <<< INCLUDES [TestType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +00003
Lev Walkinc3f0b892005-08-14 02:40:04 +00004#include <NativeInteger.h>
Lev Walkin15750402005-07-03 05:27:19 +00005#include <constr_SEQUENCE.h>
6#include <BOOLEAN.h>
Lev Walkin15750402005-07-03 05:27:19 +00007
Lev Walkina00d6b32006-03-21 03:40:38 +00008/*** <<< TYPE-DECLS [TestType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +00009
Lev Walkina00d6b32006-03-21 03:40:38 +000010typedef struct TestType_16P0 {
Lev Walkin0c0bca62006-03-21 04:48:15 +000011 long common /* DEFAULT 0 */;
Lev Walkin15750402005-07-03 05:27:19 +000012
13 /* Context for parsing across buffer boundaries */
14 asn_struct_ctx_t _asn_ctx;
Lev Walkina00d6b32006-03-21 03:40:38 +000015} TestType_16P0_t;
16typedef struct TestType_16P1 {
Lev Walkin0c0bca62006-03-21 04:48:15 +000017 BOOLEAN_t common /* DEFAULT 0 */;
Lev Walkina00d6b32006-03-21 03:40:38 +000018
19 /* Context for parsing across buffer boundaries */
20 asn_struct_ctx_t _asn_ctx;
21} TestType_16P1_t;
Lev Walkin15750402005-07-03 05:27:19 +000022
Lev Walkina00d6b32006-03-21 03:40:38 +000023/*** <<< FUNC-DECLS [TestType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +000024
Lev Walkina00d6b32006-03-21 03:40:38 +000025extern asn_TYPE_descriptor_t asn_DEF_TestType_16P0;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080026extern asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1;
27extern asn_TYPE_member_t asn_MBR_TestType_16P0_1[1];
Lev Walkina00d6b32006-03-21 03:40:38 +000028extern asn_TYPE_descriptor_t asn_DEF_TestType_16P1;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080029extern asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3;
30extern asn_TYPE_member_t asn_MBR_TestType_16P1_3[1];
Lev Walkin15750402005-07-03 05:27:19 +000031
Lev Walkina00d6b32006-03-21 03:40:38 +000032/*** <<< CODE [TestType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +000033
34static int
Lev Walkina00d6b32006-03-21 03:40:38 +000035memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000036 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +000037 long value;
38
39 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070040 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +000041 "%s: value not given (%s:%d)",
42 td->name, __FILE__, __LINE__);
43 return -1;
44 }
45
Lev Walkinc3f0b892005-08-14 02:40:04 +000046 value = *(const long *)sptr;
Lev Walkin15750402005-07-03 05:27:19 +000047
48 if((value >= 1 && value <= 10)) {
49 /* Constraint check succeeded */
50 return 0;
51 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -070052 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +000053 "%s: constraint failed (%s:%d)",
54 td->name, __FILE__, __LINE__);
55 return -1;
56 }
57}
58
59
Lev Walkina00d6b32006-03-21 03:40:38 +000060/*** <<< STAT-DEFS [TestType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +000061
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000062static int asn_DFL_2_set_0(int set_value, void **sptr) {
Lev Walkin0c0bca62006-03-21 04:48:15 +000063 long *st = *sptr;
64
65 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000066 if(!set_value) return -1; /* Not a default value */
Lev Walkin0c0bca62006-03-21 04:48:15 +000067 st = (*sptr = CALLOC(1, sizeof(*st)));
68 if(!st) return -1;
69 }
70
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000071 if(set_value) {
72 /* Install default value 0 */
73 *st = 0;
74 return 0;
75 } else {
76 /* Test default value 0 */
77 return (*st == 0);
78 }
Lev Walkin0c0bca62006-03-21 04:48:15 +000079}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080080asn_TYPE_member_t asn_MBR_TestType_16P0_1[] = {
Lev Walkin0c0bca62006-03-21 04:48:15 +000081 { ATF_NOFLAGS, 1, offsetof(struct TestType_16P0, common),
Lev Walkin15750402005-07-03 05:27:19 +000082 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
83 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000084 .type = &asn_DEF_NativeInteger,
Lev Walkina00d6b32006-03-21 03:40:38 +000085 .memb_constraints = memb_common_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +040086 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +000087 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
Lev Walkin0c0bca62006-03-21 04:48:15 +000088 .default_value = asn_DFL_2_set_0, /* DEFAULT 0 */
Lev Walkin15750402005-07-03 05:27:19 +000089 .name = "common"
90 },
91};
Lev Walkina7591b52014-10-12 18:37:35 -070092static const ber_tlv_tag_t asn_DEF_TestType_16P0_tags_1[] = {
Lev Walkin15750402005-07-03 05:27:19 +000093 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
94};
Lev Walkina7591b52014-10-12 18:37:35 -070095static const asn_TYPE_tag2member_t asn_MAP_TestType_16P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070096 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +000097};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080098asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1 = {
Lev Walkina00d6b32006-03-21 03:40:38 +000099 sizeof(struct TestType_16P0),
100 offsetof(struct TestType_16P0, _asn_ctx),
101 asn_MAP_TestType_16P0_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000102 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000103 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000104 -1, /* Start extensions */
105 -1 /* Stop extensions */
106};
Lev Walkina00d6b32006-03-21 03:40:38 +0000107asn_TYPE_descriptor_t asn_DEF_TestType_16P0 = {
108 "TestType",
109 "TestType",
Lev Walkin15750402005-07-03 05:27:19 +0000110 SEQUENCE_free,
111 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700112 SEQUENCE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000113 SEQUENCE_constraint,
114 SEQUENCE_decode_ber,
115 SEQUENCE_encode_der,
116 SEQUENCE_decode_xer,
117 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700118 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400119 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000120 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000121 asn_DEF_TestType_16P0_tags_1,
122 sizeof(asn_DEF_TestType_16P0_tags_1)
123 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
124 asn_DEF_TestType_16P0_tags_1, /* Same as above */
125 sizeof(asn_DEF_TestType_16P0_tags_1)
126 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400127 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000128 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000129 asn_MBR_TestType_16P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000130 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000131 &asn_SPC_TestType_16P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000132};
133
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000134static int asn_DFL_4_set_0(int set_value, void **sptr) {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000135 BOOLEAN_t *st = *sptr;
136
137 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000138 if(!set_value) return -1; /* Not a default value */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000139 st = (*sptr = CALLOC(1, sizeof(*st)));
140 if(!st) return -1;
141 }
142
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000143 if(set_value) {
144 /* Install default value 0 */
145 *st = 0;
146 return 0;
147 } else {
148 /* Test default value 0 */
149 return (*st == 0);
150 }
Lev Walkin0c0bca62006-03-21 04:48:15 +0000151}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800152asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000153 { ATF_NOFLAGS, 1, offsetof(struct TestType_16P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000154 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
155 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000156 .type = &asn_DEF_BOOLEAN,
Lev Walkin15750402005-07-03 05:27:19 +0000157 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400158 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000159 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000160 .default_value = asn_DFL_4_set_0, /* DEFAULT 0 */
Lev Walkin15750402005-07-03 05:27:19 +0000161 .name = "common"
162 },
163};
Lev Walkina7591b52014-10-12 18:37:35 -0700164static const ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000165 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
166};
Lev Walkina7591b52014-10-12 18:37:35 -0700167static const asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700168 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000169};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800170asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000171 sizeof(struct TestType_16P1),
172 offsetof(struct TestType_16P1, _asn_ctx),
173 asn_MAP_TestType_16P1_tag2el_3,
Lev Walkin15750402005-07-03 05:27:19 +0000174 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000175 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000176 -1, /* Start extensions */
177 -1 /* Stop extensions */
178};
Lev Walkina00d6b32006-03-21 03:40:38 +0000179asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = {
180 "TestType",
181 "TestType",
Lev Walkin15750402005-07-03 05:27:19 +0000182 SEQUENCE_free,
183 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700184 SEQUENCE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000185 SEQUENCE_constraint,
186 SEQUENCE_decode_ber,
187 SEQUENCE_encode_der,
188 SEQUENCE_decode_xer,
189 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700190 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400191 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000192 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000193 asn_DEF_TestType_16P1_tags_3,
194 sizeof(asn_DEF_TestType_16P1_tags_3)
195 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
196 asn_DEF_TestType_16P1_tags_3, /* Same as above */
197 sizeof(asn_DEF_TestType_16P1_tags_3)
198 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400199 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000200 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000201 asn_MBR_TestType_16P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000202 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000203 &asn_SPC_TestType_16P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000204};
205
Lev Walkina00d6b32006-03-21 03:40:38 +0000206
207/*** <<< INCLUDES [TestChoice] >>> ***/
208
Lev Walkin22b5ed42006-09-13 02:51:20 +0000209#include "TestType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000210#include <constr_CHOICE.h>
211
212/*** <<< DEPS [TestChoice] >>> ***/
213
214typedef enum TestChoice_PR {
215 TestChoice_PR_NOTHING, /* No components present */
216 TestChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000217 TestChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000218} TestChoice_PR;
219
220/*** <<< TYPE-DECLS [TestChoice] >>> ***/
221
222typedef struct TestChoice {
223 TestChoice_PR present;
224 union TestChoice_u {
225 TestType_16P0_t type1;
226 TestType_16P1_t type2;
227 } choice;
228
229 /* Context for parsing across buffer boundaries */
230 asn_struct_ctx_t _asn_ctx;
231} TestChoice_t;
232
233/*** <<< FUNC-DECLS [TestChoice] >>> ***/
234
235extern asn_TYPE_descriptor_t asn_DEF_TestChoice;
236
237/*** <<< STAT-DEFS [TestChoice] >>> ***/
238
Lev Walkin15750402005-07-03 05:27:19 +0000239static asn_TYPE_member_t asn_MBR_TestChoice_1[] = {
240 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type1),
241 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
242 .tag_mode = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +0000243 .type = &asn_DEF_TestType_16P0,
Lev Walkin15750402005-07-03 05:27:19 +0000244 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400245 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000246 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
247 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000248 .name = "type1"
249 },
250 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type2),
251 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
252 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000253 .type = &asn_DEF_TestType_16P1,
Lev Walkin15750402005-07-03 05:27:19 +0000254 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400255 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000256 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
257 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000258 .name = "type2"
259 },
260};
Lev Walkina7591b52014-10-12 18:37:35 -0700261static const asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700262 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 */
263 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000264};
Lev Walkin59b176e2005-11-26 11:25:14 +0000265static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000266 sizeof(struct TestChoice),
267 offsetof(struct TestChoice, _asn_ctx),
268 offsetof(struct TestChoice, present),
269 sizeof(((struct TestChoice *)0)->present),
Lev Walkin59b176e2005-11-26 11:25:14 +0000270 asn_MAP_TestChoice_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000271 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000272 .canonical_order = 0,
273 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000274};
275asn_TYPE_descriptor_t asn_DEF_TestChoice = {
276 "TestChoice",
277 "TestChoice",
278 CHOICE_free,
279 CHOICE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700280 CHOICE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000281 CHOICE_constraint,
282 CHOICE_decode_ber,
283 CHOICE_encode_der,
284 CHOICE_decode_xer,
285 CHOICE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700286 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400287 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000288 CHOICE_outmost_tag,
289 0, /* No effective tags (pointer) */
290 0, /* No effective tags (count) */
291 0, /* No tags (pointer) */
292 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400293 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000294 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000295 asn_MBR_TestChoice_1,
296 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000297 &asn_SPC_TestChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000298};
299
300
Lev Walkina00d6b32006-03-21 03:40:38 +0000301/*** <<< INCLUDES [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000302
Lev Walkinc3f0b892005-08-14 02:40:04 +0000303#include <NativeInteger.h>
Lev Walkin15750402005-07-03 05:27:19 +0000304#include <constr_SEQUENCE.h>
305#include <BOOLEAN.h>
Lev Walkin15750402005-07-03 05:27:19 +0000306
Lev Walkina00d6b32006-03-21 03:40:38 +0000307/*** <<< TYPE-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000308
Lev Walkina00d6b32006-03-21 03:40:38 +0000309typedef struct AutoType_34P0 {
310 long common;
Lev Walkin15750402005-07-03 05:27:19 +0000311
312 /* Context for parsing across buffer boundaries */
313 asn_struct_ctx_t _asn_ctx;
Lev Walkina00d6b32006-03-21 03:40:38 +0000314} AutoType_34P0_t;
315typedef struct AutoType_34P1 {
316 BOOLEAN_t common;
317
318 /* Context for parsing across buffer boundaries */
319 asn_struct_ctx_t _asn_ctx;
320} AutoType_34P1_t;
Lev Walkin15750402005-07-03 05:27:19 +0000321
Lev Walkina00d6b32006-03-21 03:40:38 +0000322/*** <<< FUNC-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000323
Lev Walkina00d6b32006-03-21 03:40:38 +0000324extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800325extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1;
326extern asn_TYPE_member_t asn_MBR_AutoType_34P0_1[1];
Lev Walkina00d6b32006-03-21 03:40:38 +0000327extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800328extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3;
329extern asn_TYPE_member_t asn_MBR_AutoType_34P1_3[1];
Lev Walkin15750402005-07-03 05:27:19 +0000330
Lev Walkina00d6b32006-03-21 03:40:38 +0000331/*** <<< CODE [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000332
333static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000334memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000335 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000336 long value;
337
338 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700339 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000340 "%s: value not given (%s:%d)",
341 td->name, __FILE__, __LINE__);
342 return -1;
343 }
344
Lev Walkinc3f0b892005-08-14 02:40:04 +0000345 value = *(const long *)sptr;
Lev Walkin15750402005-07-03 05:27:19 +0000346
347 if((value == 0)) {
348 /* Constraint check succeeded */
349 return 0;
350 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700351 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000352 "%s: constraint failed (%s:%d)",
353 td->name, __FILE__, __LINE__);
354 return -1;
355 }
356}
357
358static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000359memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000360 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000361 BOOLEAN_t value;
362
363 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700364 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000365 "%s: value not given (%s:%d)",
366 td->name, __FILE__, __LINE__);
367 return -1;
368 }
369
370 value = (*(const long *)sptr) ? 1 : 0;
371
372 if((value <= 0)) {
373 /* Constraint check succeeded */
374 return 0;
375 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700376 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000377 "%s: constraint failed (%s:%d)",
378 td->name, __FILE__, __LINE__);
379 return -1;
380 }
381}
382
383
Lev Walkina00d6b32006-03-21 03:40:38 +0000384/*** <<< STAT-DEFS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000385
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800386asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000387 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common),
Lev Walkin15750402005-07-03 05:27:19 +0000388 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
389 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000390 .type = &asn_DEF_NativeInteger,
Lev Walkina00d6b32006-03-21 03:40:38 +0000391 .memb_constraints = memb_common_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400392 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000393 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
394 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000395 .name = "common"
396 },
397};
Lev Walkina7591b52014-10-12 18:37:35 -0700398static const ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000399 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
400};
Lev Walkina7591b52014-10-12 18:37:35 -0700401static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700402 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000403};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800404asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000405 sizeof(struct AutoType_34P0),
406 offsetof(struct AutoType_34P0, _asn_ctx),
407 asn_MAP_AutoType_34P0_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000408 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000409 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000410 -1, /* Start extensions */
411 -1 /* Stop extensions */
412};
Lev Walkina00d6b32006-03-21 03:40:38 +0000413asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = {
414 "AutoType",
415 "AutoType",
Lev Walkin15750402005-07-03 05:27:19 +0000416 SEQUENCE_free,
417 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700418 SEQUENCE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000419 SEQUENCE_constraint,
420 SEQUENCE_decode_ber,
421 SEQUENCE_encode_der,
422 SEQUENCE_decode_xer,
423 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700424 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400425 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000426 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000427 asn_DEF_AutoType_34P0_tags_1,
428 sizeof(asn_DEF_AutoType_34P0_tags_1)
429 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
430 asn_DEF_AutoType_34P0_tags_1, /* Same as above */
431 sizeof(asn_DEF_AutoType_34P0_tags_1)
432 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400433 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000434 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000435 asn_MBR_AutoType_34P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000436 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000437 &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000438};
439
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800440asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000441 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000442 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
443 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000444 .type = &asn_DEF_BOOLEAN,
Lev Walkina00d6b32006-03-21 03:40:38 +0000445 .memb_constraints = memb_common_constraint_3,
Lev Walkinb33425f2017-07-14 14:59:52 +0400446 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000447 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
448 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000449 .name = "common"
450 },
451};
Lev Walkina7591b52014-10-12 18:37:35 -0700452static const ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000453 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
454};
Lev Walkina7591b52014-10-12 18:37:35 -0700455static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700456 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000457};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800458asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000459 sizeof(struct AutoType_34P1),
460 offsetof(struct AutoType_34P1, _asn_ctx),
461 asn_MAP_AutoType_34P1_tag2el_3,
Lev Walkin15750402005-07-03 05:27:19 +0000462 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000463 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000464 -1, /* Start extensions */
465 -1 /* Stop extensions */
466};
Lev Walkina00d6b32006-03-21 03:40:38 +0000467asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = {
468 "AutoType",
469 "AutoType",
Lev Walkin15750402005-07-03 05:27:19 +0000470 SEQUENCE_free,
471 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700472 SEQUENCE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000473 SEQUENCE_constraint,
474 SEQUENCE_decode_ber,
475 SEQUENCE_encode_der,
476 SEQUENCE_decode_xer,
477 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700478 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400479 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000480 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000481 asn_DEF_AutoType_34P1_tags_3,
482 sizeof(asn_DEF_AutoType_34P1_tags_3)
483 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
484 asn_DEF_AutoType_34P1_tags_3, /* Same as above */
485 sizeof(asn_DEF_AutoType_34P1_tags_3)
486 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400487 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000488 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000489 asn_MBR_AutoType_34P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000490 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000491 &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000492};
493
Lev Walkina00d6b32006-03-21 03:40:38 +0000494
495/*** <<< INCLUDES [AutoChoice] >>> ***/
496
Lev Walkin22b5ed42006-09-13 02:51:20 +0000497#include "AutoType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000498#include <constr_CHOICE.h>
499
500/*** <<< DEPS [AutoChoice] >>> ***/
501
502typedef enum AutoChoice_PR {
503 AutoChoice_PR_NOTHING, /* No components present */
504 AutoChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000505 AutoChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000506} AutoChoice_PR;
507
508/*** <<< TYPE-DECLS [AutoChoice] >>> ***/
509
510typedef struct AutoChoice {
511 AutoChoice_PR present;
512 union AutoChoice_u {
513 AutoType_34P0_t type1;
514 AutoType_34P1_t type2;
515 } choice;
516
517 /* Context for parsing across buffer boundaries */
518 asn_struct_ctx_t _asn_ctx;
519} AutoChoice_t;
520
521/*** <<< FUNC-DECLS [AutoChoice] >>> ***/
522
523extern asn_TYPE_descriptor_t asn_DEF_AutoChoice;
524
525/*** <<< STAT-DEFS [AutoChoice] >>> ***/
526
Lev Walkin15750402005-07-03 05:27:19 +0000527static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = {
528 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type1),
529 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
530 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000531 .type = &asn_DEF_AutoType_34P0,
Lev Walkin15750402005-07-03 05:27:19 +0000532 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400533 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000534 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
535 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000536 .name = "type1"
537 },
538 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type2),
539 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
540 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000541 .type = &asn_DEF_AutoType_34P1,
Lev Walkin15750402005-07-03 05:27:19 +0000542 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400543 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000544 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
545 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000546 .name = "type2"
547 },
548};
Lev Walkina7591b52014-10-12 18:37:35 -0700549static const asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700550 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 */
551 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000552};
Lev Walkin59b176e2005-11-26 11:25:14 +0000553static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000554 sizeof(struct AutoChoice),
555 offsetof(struct AutoChoice, _asn_ctx),
556 offsetof(struct AutoChoice, present),
557 sizeof(((struct AutoChoice *)0)->present),
Lev Walkin59b176e2005-11-26 11:25:14 +0000558 asn_MAP_AutoChoice_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000559 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000560 .canonical_order = 0,
561 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000562};
563asn_TYPE_descriptor_t asn_DEF_AutoChoice = {
564 "AutoChoice",
565 "AutoChoice",
566 CHOICE_free,
567 CHOICE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700568 CHOICE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000569 CHOICE_constraint,
570 CHOICE_decode_ber,
571 CHOICE_encode_der,
572 CHOICE_decode_xer,
573 CHOICE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700574 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400575 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000576 CHOICE_outmost_tag,
577 0, /* No effective tags (pointer) */
578 0, /* No effective tags (count) */
579 0, /* No tags (pointer) */
580 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400581 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000582 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000583 asn_MBR_AutoChoice_1,
584 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000585 &asn_SPC_AutoChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000586};
587