blob: b36cb1310cd049d6ae516a1aa7d342072197126f [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 Walkin67a30122017-08-10 05:48:54 -070085 .type_selector = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +000086 .memb_constraints = memb_common_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +040087 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +000088 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
Lev Walkin0c0bca62006-03-21 04:48:15 +000089 .default_value = asn_DFL_2_set_0, /* DEFAULT 0 */
Lev Walkin15750402005-07-03 05:27:19 +000090 .name = "common"
91 },
92};
Lev Walkina7591b52014-10-12 18:37:35 -070093static const ber_tlv_tag_t asn_DEF_TestType_16P0_tags_1[] = {
Lev Walkin15750402005-07-03 05:27:19 +000094 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
95};
Lev Walkina7591b52014-10-12 18:37:35 -070096static const asn_TYPE_tag2member_t asn_MAP_TestType_16P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070097 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +000098};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080099asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000100 sizeof(struct TestType_16P0),
101 offsetof(struct TestType_16P0, _asn_ctx),
102 asn_MAP_TestType_16P0_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000103 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000104 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000105 -1, /* Start extensions */
106 -1 /* Stop extensions */
107};
Lev Walkina00d6b32006-03-21 03:40:38 +0000108asn_TYPE_descriptor_t asn_DEF_TestType_16P0 = {
109 "TestType",
110 "TestType",
Lev Walkin15750402005-07-03 05:27:19 +0000111 SEQUENCE_free,
112 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700113 SEQUENCE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000114 SEQUENCE_constraint,
115 SEQUENCE_decode_ber,
116 SEQUENCE_encode_der,
117 SEQUENCE_decode_xer,
118 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700119 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400120 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000121 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000122 asn_DEF_TestType_16P0_tags_1,
123 sizeof(asn_DEF_TestType_16P0_tags_1)
124 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
125 asn_DEF_TestType_16P0_tags_1, /* Same as above */
126 sizeof(asn_DEF_TestType_16P0_tags_1)
127 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400128 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000129 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000130 asn_MBR_TestType_16P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000131 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000132 &asn_SPC_TestType_16P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000133};
134
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000135static int asn_DFL_4_set_0(int set_value, void **sptr) {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000136 BOOLEAN_t *st = *sptr;
137
138 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000139 if(!set_value) return -1; /* Not a default value */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000140 st = (*sptr = CALLOC(1, sizeof(*st)));
141 if(!st) return -1;
142 }
143
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000144 if(set_value) {
145 /* Install default value 0 */
146 *st = 0;
147 return 0;
148 } else {
149 /* Test default value 0 */
150 return (*st == 0);
151 }
Lev Walkin0c0bca62006-03-21 04:48:15 +0000152}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800153asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000154 { ATF_NOFLAGS, 1, offsetof(struct TestType_16P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000155 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
156 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000157 .type = &asn_DEF_BOOLEAN,
Lev Walkin67a30122017-08-10 05:48:54 -0700158 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000159 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400160 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000161 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000162 .default_value = asn_DFL_4_set_0, /* DEFAULT 0 */
Lev Walkin15750402005-07-03 05:27:19 +0000163 .name = "common"
164 },
165};
Lev Walkina7591b52014-10-12 18:37:35 -0700166static const ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000167 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
168};
Lev Walkina7591b52014-10-12 18:37:35 -0700169static const asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700170 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000171};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800172asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000173 sizeof(struct TestType_16P1),
174 offsetof(struct TestType_16P1, _asn_ctx),
175 asn_MAP_TestType_16P1_tag2el_3,
Lev Walkin15750402005-07-03 05:27:19 +0000176 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000177 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000178 -1, /* Start extensions */
179 -1 /* Stop extensions */
180};
Lev Walkina00d6b32006-03-21 03:40:38 +0000181asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = {
182 "TestType",
183 "TestType",
Lev Walkin15750402005-07-03 05:27:19 +0000184 SEQUENCE_free,
185 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700186 SEQUENCE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000187 SEQUENCE_constraint,
188 SEQUENCE_decode_ber,
189 SEQUENCE_encode_der,
190 SEQUENCE_decode_xer,
191 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700192 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400193 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000194 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000195 asn_DEF_TestType_16P1_tags_3,
196 sizeof(asn_DEF_TestType_16P1_tags_3)
197 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
198 asn_DEF_TestType_16P1_tags_3, /* Same as above */
199 sizeof(asn_DEF_TestType_16P1_tags_3)
200 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400201 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000202 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000203 asn_MBR_TestType_16P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000204 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000205 &asn_SPC_TestType_16P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000206};
207
Lev Walkina00d6b32006-03-21 03:40:38 +0000208
209/*** <<< INCLUDES [TestChoice] >>> ***/
210
Lev Walkin22b5ed42006-09-13 02:51:20 +0000211#include "TestType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000212#include <constr_CHOICE.h>
213
214/*** <<< DEPS [TestChoice] >>> ***/
215
216typedef enum TestChoice_PR {
217 TestChoice_PR_NOTHING, /* No components present */
218 TestChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000219 TestChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000220} TestChoice_PR;
221
222/*** <<< TYPE-DECLS [TestChoice] >>> ***/
223
224typedef struct TestChoice {
225 TestChoice_PR present;
226 union TestChoice_u {
227 TestType_16P0_t type1;
228 TestType_16P1_t type2;
229 } choice;
230
231 /* Context for parsing across buffer boundaries */
232 asn_struct_ctx_t _asn_ctx;
233} TestChoice_t;
234
235/*** <<< FUNC-DECLS [TestChoice] >>> ***/
236
237extern asn_TYPE_descriptor_t asn_DEF_TestChoice;
238
239/*** <<< STAT-DEFS [TestChoice] >>> ***/
240
Lev Walkin15750402005-07-03 05:27:19 +0000241static asn_TYPE_member_t asn_MBR_TestChoice_1[] = {
242 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type1),
243 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
244 .tag_mode = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +0000245 .type = &asn_DEF_TestType_16P0,
Lev Walkin67a30122017-08-10 05:48:54 -0700246 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000247 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400248 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000249 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
250 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000251 .name = "type1"
252 },
253 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type2),
254 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
255 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000256 .type = &asn_DEF_TestType_16P1,
Lev Walkin67a30122017-08-10 05:48:54 -0700257 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000258 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400259 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000260 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
261 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000262 .name = "type2"
263 },
264};
Lev Walkina7591b52014-10-12 18:37:35 -0700265static const asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700266 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 */
267 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000268};
Lev Walkin59b176e2005-11-26 11:25:14 +0000269static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000270 sizeof(struct TestChoice),
271 offsetof(struct TestChoice, _asn_ctx),
272 offsetof(struct TestChoice, present),
273 sizeof(((struct TestChoice *)0)->present),
Lev Walkin59b176e2005-11-26 11:25:14 +0000274 asn_MAP_TestChoice_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000275 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000276 .canonical_order = 0,
277 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000278};
279asn_TYPE_descriptor_t asn_DEF_TestChoice = {
280 "TestChoice",
281 "TestChoice",
282 CHOICE_free,
283 CHOICE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700284 CHOICE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000285 CHOICE_constraint,
286 CHOICE_decode_ber,
287 CHOICE_encode_der,
288 CHOICE_decode_xer,
289 CHOICE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700290 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400291 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000292 CHOICE_outmost_tag,
293 0, /* No effective tags (pointer) */
294 0, /* No effective tags (count) */
295 0, /* No tags (pointer) */
296 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400297 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000298 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000299 asn_MBR_TestChoice_1,
300 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000301 &asn_SPC_TestChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000302};
303
304
Lev Walkina00d6b32006-03-21 03:40:38 +0000305/*** <<< INCLUDES [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000306
Lev Walkinc3f0b892005-08-14 02:40:04 +0000307#include <NativeInteger.h>
Lev Walkin15750402005-07-03 05:27:19 +0000308#include <constr_SEQUENCE.h>
309#include <BOOLEAN.h>
Lev Walkin15750402005-07-03 05:27:19 +0000310
Lev Walkina00d6b32006-03-21 03:40:38 +0000311/*** <<< TYPE-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000312
Lev Walkina00d6b32006-03-21 03:40:38 +0000313typedef struct AutoType_34P0 {
314 long common;
Lev Walkin15750402005-07-03 05:27:19 +0000315
316 /* Context for parsing across buffer boundaries */
317 asn_struct_ctx_t _asn_ctx;
Lev Walkina00d6b32006-03-21 03:40:38 +0000318} AutoType_34P0_t;
319typedef struct AutoType_34P1 {
320 BOOLEAN_t common;
321
322 /* Context for parsing across buffer boundaries */
323 asn_struct_ctx_t _asn_ctx;
324} AutoType_34P1_t;
Lev Walkin15750402005-07-03 05:27:19 +0000325
Lev Walkina00d6b32006-03-21 03:40:38 +0000326/*** <<< FUNC-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000327
Lev Walkina00d6b32006-03-21 03:40:38 +0000328extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800329extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1;
330extern asn_TYPE_member_t asn_MBR_AutoType_34P0_1[1];
Lev Walkina00d6b32006-03-21 03:40:38 +0000331extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800332extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3;
333extern asn_TYPE_member_t asn_MBR_AutoType_34P1_3[1];
Lev Walkin15750402005-07-03 05:27:19 +0000334
Lev Walkina00d6b32006-03-21 03:40:38 +0000335/*** <<< CODE [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000336
337static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000338memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000339 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000340 long value;
341
342 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700343 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000344 "%s: value not given (%s:%d)",
345 td->name, __FILE__, __LINE__);
346 return -1;
347 }
348
Lev Walkinc3f0b892005-08-14 02:40:04 +0000349 value = *(const long *)sptr;
Lev Walkin15750402005-07-03 05:27:19 +0000350
351 if((value == 0)) {
352 /* Constraint check succeeded */
353 return 0;
354 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700355 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000356 "%s: constraint failed (%s:%d)",
357 td->name, __FILE__, __LINE__);
358 return -1;
359 }
360}
361
362static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000363memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000364 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000365 BOOLEAN_t value;
366
367 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700368 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000369 "%s: value not given (%s:%d)",
370 td->name, __FILE__, __LINE__);
371 return -1;
372 }
373
374 value = (*(const long *)sptr) ? 1 : 0;
375
376 if((value <= 0)) {
377 /* Constraint check succeeded */
378 return 0;
379 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700380 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000381 "%s: constraint failed (%s:%d)",
382 td->name, __FILE__, __LINE__);
383 return -1;
384 }
385}
386
387
Lev Walkina00d6b32006-03-21 03:40:38 +0000388/*** <<< STAT-DEFS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000389
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800390asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000391 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common),
Lev Walkin15750402005-07-03 05:27:19 +0000392 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
393 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000394 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700395 .type_selector = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +0000396 .memb_constraints = memb_common_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400397 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000398 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
399 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000400 .name = "common"
401 },
402};
Lev Walkina7591b52014-10-12 18:37:35 -0700403static const ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000404 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
405};
Lev Walkina7591b52014-10-12 18:37:35 -0700406static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700407 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000408};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800409asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000410 sizeof(struct AutoType_34P0),
411 offsetof(struct AutoType_34P0, _asn_ctx),
412 asn_MAP_AutoType_34P0_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000413 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000414 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000415 -1, /* Start extensions */
416 -1 /* Stop extensions */
417};
Lev Walkina00d6b32006-03-21 03:40:38 +0000418asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = {
419 "AutoType",
420 "AutoType",
Lev Walkin15750402005-07-03 05:27:19 +0000421 SEQUENCE_free,
422 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700423 SEQUENCE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000424 SEQUENCE_constraint,
425 SEQUENCE_decode_ber,
426 SEQUENCE_encode_der,
427 SEQUENCE_decode_xer,
428 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700429 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400430 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000431 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000432 asn_DEF_AutoType_34P0_tags_1,
433 sizeof(asn_DEF_AutoType_34P0_tags_1)
434 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
435 asn_DEF_AutoType_34P0_tags_1, /* Same as above */
436 sizeof(asn_DEF_AutoType_34P0_tags_1)
437 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400438 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000439 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000440 asn_MBR_AutoType_34P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000441 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000442 &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000443};
444
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800445asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000446 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000447 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
448 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000449 .type = &asn_DEF_BOOLEAN,
Lev Walkin67a30122017-08-10 05:48:54 -0700450 .type_selector = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +0000451 .memb_constraints = memb_common_constraint_3,
Lev Walkinb33425f2017-07-14 14:59:52 +0400452 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000453 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
454 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000455 .name = "common"
456 },
457};
Lev Walkina7591b52014-10-12 18:37:35 -0700458static const ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000459 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
460};
Lev Walkina7591b52014-10-12 18:37:35 -0700461static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700462 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000463};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800464asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000465 sizeof(struct AutoType_34P1),
466 offsetof(struct AutoType_34P1, _asn_ctx),
467 asn_MAP_AutoType_34P1_tag2el_3,
Lev Walkin15750402005-07-03 05:27:19 +0000468 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000469 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000470 -1, /* Start extensions */
471 -1 /* Stop extensions */
472};
Lev Walkina00d6b32006-03-21 03:40:38 +0000473asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = {
474 "AutoType",
475 "AutoType",
Lev Walkin15750402005-07-03 05:27:19 +0000476 SEQUENCE_free,
477 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700478 SEQUENCE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000479 SEQUENCE_constraint,
480 SEQUENCE_decode_ber,
481 SEQUENCE_encode_der,
482 SEQUENCE_decode_xer,
483 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700484 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400485 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000486 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000487 asn_DEF_AutoType_34P1_tags_3,
488 sizeof(asn_DEF_AutoType_34P1_tags_3)
489 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
490 asn_DEF_AutoType_34P1_tags_3, /* Same as above */
491 sizeof(asn_DEF_AutoType_34P1_tags_3)
492 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400493 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000494 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000495 asn_MBR_AutoType_34P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000496 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000497 &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000498};
499
Lev Walkina00d6b32006-03-21 03:40:38 +0000500
501/*** <<< INCLUDES [AutoChoice] >>> ***/
502
Lev Walkin22b5ed42006-09-13 02:51:20 +0000503#include "AutoType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000504#include <constr_CHOICE.h>
505
506/*** <<< DEPS [AutoChoice] >>> ***/
507
508typedef enum AutoChoice_PR {
509 AutoChoice_PR_NOTHING, /* No components present */
510 AutoChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000511 AutoChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000512} AutoChoice_PR;
513
514/*** <<< TYPE-DECLS [AutoChoice] >>> ***/
515
516typedef struct AutoChoice {
517 AutoChoice_PR present;
518 union AutoChoice_u {
519 AutoType_34P0_t type1;
520 AutoType_34P1_t type2;
521 } choice;
522
523 /* Context for parsing across buffer boundaries */
524 asn_struct_ctx_t _asn_ctx;
525} AutoChoice_t;
526
527/*** <<< FUNC-DECLS [AutoChoice] >>> ***/
528
529extern asn_TYPE_descriptor_t asn_DEF_AutoChoice;
530
531/*** <<< STAT-DEFS [AutoChoice] >>> ***/
532
Lev Walkin15750402005-07-03 05:27:19 +0000533static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = {
534 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type1),
535 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
536 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000537 .type = &asn_DEF_AutoType_34P0,
Lev Walkin67a30122017-08-10 05:48:54 -0700538 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000539 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400540 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000541 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
542 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000543 .name = "type1"
544 },
545 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type2),
546 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
547 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000548 .type = &asn_DEF_AutoType_34P1,
Lev Walkin67a30122017-08-10 05:48:54 -0700549 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000550 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400551 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000552 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
553 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000554 .name = "type2"
555 },
556};
Lev Walkina7591b52014-10-12 18:37:35 -0700557static const asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700558 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 */
559 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000560};
Lev Walkin59b176e2005-11-26 11:25:14 +0000561static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000562 sizeof(struct AutoChoice),
563 offsetof(struct AutoChoice, _asn_ctx),
564 offsetof(struct AutoChoice, present),
565 sizeof(((struct AutoChoice *)0)->present),
Lev Walkin59b176e2005-11-26 11:25:14 +0000566 asn_MAP_AutoChoice_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000567 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000568 .canonical_order = 0,
569 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000570};
571asn_TYPE_descriptor_t asn_DEF_AutoChoice = {
572 "AutoChoice",
573 "AutoChoice",
574 CHOICE_free,
575 CHOICE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700576 CHOICE_compare,
Lev Walkin15750402005-07-03 05:27:19 +0000577 CHOICE_constraint,
578 CHOICE_decode_ber,
579 CHOICE_encode_der,
580 CHOICE_decode_xer,
581 CHOICE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700582 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400583 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000584 CHOICE_outmost_tag,
585 0, /* No effective tags (pointer) */
586 0, /* No effective tags (count) */
587 0, /* No tags (pointer) */
588 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400589 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000590 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000591 asn_MBR_AutoChoice_1,
592 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000593 &asn_SPC_AutoChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000594};
595