blob: 682621b6a69dee7b2465b2100b1296c453c1ca41 [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;
26extern asn_TYPE_descriptor_t asn_DEF_TestType_16P1;
Lev Walkin15750402005-07-03 05:27:19 +000027
Lev Walkina00d6b32006-03-21 03:40:38 +000028/*** <<< CODE [TestType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +000029
30static int
Lev Walkina00d6b32006-03-21 03:40:38 +000031memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000032 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +000033 long value;
34
35 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070036 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +000037 "%s: value not given (%s:%d)",
38 td->name, __FILE__, __LINE__);
39 return -1;
40 }
41
Lev Walkinc3f0b892005-08-14 02:40:04 +000042 value = *(const long *)sptr;
Lev Walkin15750402005-07-03 05:27:19 +000043
44 if((value >= 1 && value <= 10)) {
45 /* Constraint check succeeded */
46 return 0;
47 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -070048 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +000049 "%s: constraint failed (%s:%d)",
50 td->name, __FILE__, __LINE__);
51 return -1;
52 }
53}
54
55
Lev Walkina00d6b32006-03-21 03:40:38 +000056/*** <<< STAT-DEFS [TestType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +000057
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000058static int asn_DFL_2_set_0(int set_value, void **sptr) {
Lev Walkin0c0bca62006-03-21 04:48:15 +000059 long *st = *sptr;
60
61 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000062 if(!set_value) return -1; /* Not a default value */
Lev Walkin0c0bca62006-03-21 04:48:15 +000063 st = (*sptr = CALLOC(1, sizeof(*st)));
64 if(!st) return -1;
65 }
66
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000067 if(set_value) {
68 /* Install default value 0 */
69 *st = 0;
70 return 0;
71 } else {
72 /* Test default value 0 */
73 return (*st == 0);
74 }
Lev Walkin0c0bca62006-03-21 04:48:15 +000075}
Lev Walkina00d6b32006-03-21 03:40:38 +000076static asn_TYPE_member_t asn_MBR_TestType_16P0_1[] = {
Lev Walkin0c0bca62006-03-21 04:48:15 +000077 { ATF_NOFLAGS, 1, offsetof(struct TestType_16P0, common),
Lev Walkin15750402005-07-03 05:27:19 +000078 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
79 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000080 .type = &asn_DEF_NativeInteger,
Lev Walkina00d6b32006-03-21 03:40:38 +000081 .memb_constraints = memb_common_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +040082 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +000083 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
Lev Walkin0c0bca62006-03-21 04:48:15 +000084 .default_value = asn_DFL_2_set_0, /* DEFAULT 0 */
Lev Walkin15750402005-07-03 05:27:19 +000085 .name = "common"
86 },
87};
Lev Walkina7591b52014-10-12 18:37:35 -070088static const ber_tlv_tag_t asn_DEF_TestType_16P0_tags_1[] = {
Lev Walkin15750402005-07-03 05:27:19 +000089 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
90};
Lev Walkina7591b52014-10-12 18:37:35 -070091static const asn_TYPE_tag2member_t asn_MAP_TestType_16P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070092 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +000093};
Lev Walkina00d6b32006-03-21 03:40:38 +000094static asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1 = {
95 sizeof(struct TestType_16P0),
96 offsetof(struct TestType_16P0, _asn_ctx),
97 asn_MAP_TestType_16P0_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +000098 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +000099 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000100 -1, /* Start extensions */
101 -1 /* Stop extensions */
102};
Lev Walkina00d6b32006-03-21 03:40:38 +0000103asn_TYPE_descriptor_t asn_DEF_TestType_16P0 = {
104 "TestType",
105 "TestType",
Lev Walkin15750402005-07-03 05:27:19 +0000106 SEQUENCE_free,
107 SEQUENCE_print,
108 SEQUENCE_constraint,
109 SEQUENCE_decode_ber,
110 SEQUENCE_encode_der,
111 SEQUENCE_decode_xer,
112 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700113 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400114 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000115 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000116 asn_DEF_TestType_16P0_tags_1,
117 sizeof(asn_DEF_TestType_16P0_tags_1)
118 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
119 asn_DEF_TestType_16P0_tags_1, /* Same as above */
120 sizeof(asn_DEF_TestType_16P0_tags_1)
121 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400122 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000123 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000124 asn_MBR_TestType_16P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000125 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000126 &asn_SPC_TestType_16P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000127};
128
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000129static int asn_DFL_4_set_0(int set_value, void **sptr) {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000130 BOOLEAN_t *st = *sptr;
131
132 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000133 if(!set_value) return -1; /* Not a default value */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000134 st = (*sptr = CALLOC(1, sizeof(*st)));
135 if(!st) return -1;
136 }
137
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000138 if(set_value) {
139 /* Install default value 0 */
140 *st = 0;
141 return 0;
142 } else {
143 /* Test default value 0 */
144 return (*st == 0);
145 }
Lev Walkin0c0bca62006-03-21 04:48:15 +0000146}
Lev Walkina00d6b32006-03-21 03:40:38 +0000147static asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000148 { ATF_NOFLAGS, 1, offsetof(struct TestType_16P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000149 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
150 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000151 .type = &asn_DEF_BOOLEAN,
Lev Walkin15750402005-07-03 05:27:19 +0000152 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400153 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000154 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000155 .default_value = asn_DFL_4_set_0, /* DEFAULT 0 */
Lev Walkin15750402005-07-03 05:27:19 +0000156 .name = "common"
157 },
158};
Lev Walkina7591b52014-10-12 18:37:35 -0700159static const ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000160 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
161};
Lev Walkina7591b52014-10-12 18:37:35 -0700162static const asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700163 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000164};
Lev Walkina00d6b32006-03-21 03:40:38 +0000165static asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = {
166 sizeof(struct TestType_16P1),
167 offsetof(struct TestType_16P1, _asn_ctx),
168 asn_MAP_TestType_16P1_tag2el_3,
Lev Walkin15750402005-07-03 05:27:19 +0000169 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000170 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000171 -1, /* Start extensions */
172 -1 /* Stop extensions */
173};
Lev Walkina00d6b32006-03-21 03:40:38 +0000174asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = {
175 "TestType",
176 "TestType",
Lev Walkin15750402005-07-03 05:27:19 +0000177 SEQUENCE_free,
178 SEQUENCE_print,
179 SEQUENCE_constraint,
180 SEQUENCE_decode_ber,
181 SEQUENCE_encode_der,
182 SEQUENCE_decode_xer,
183 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700184 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400185 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000186 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000187 asn_DEF_TestType_16P1_tags_3,
188 sizeof(asn_DEF_TestType_16P1_tags_3)
189 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
190 asn_DEF_TestType_16P1_tags_3, /* Same as above */
191 sizeof(asn_DEF_TestType_16P1_tags_3)
192 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400193 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000194 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000195 asn_MBR_TestType_16P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000196 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000197 &asn_SPC_TestType_16P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000198};
199
Lev Walkina00d6b32006-03-21 03:40:38 +0000200
201/*** <<< INCLUDES [TestChoice] >>> ***/
202
Lev Walkin22b5ed42006-09-13 02:51:20 +0000203#include "TestType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000204#include <constr_CHOICE.h>
205
206/*** <<< DEPS [TestChoice] >>> ***/
207
208typedef enum TestChoice_PR {
209 TestChoice_PR_NOTHING, /* No components present */
210 TestChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000211 TestChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000212} TestChoice_PR;
213
214/*** <<< TYPE-DECLS [TestChoice] >>> ***/
215
216typedef struct TestChoice {
217 TestChoice_PR present;
218 union TestChoice_u {
219 TestType_16P0_t type1;
220 TestType_16P1_t type2;
221 } choice;
222
223 /* Context for parsing across buffer boundaries */
224 asn_struct_ctx_t _asn_ctx;
225} TestChoice_t;
226
227/*** <<< FUNC-DECLS [TestChoice] >>> ***/
228
229extern asn_TYPE_descriptor_t asn_DEF_TestChoice;
230
231/*** <<< STAT-DEFS [TestChoice] >>> ***/
232
Lev Walkin15750402005-07-03 05:27:19 +0000233static asn_TYPE_member_t asn_MBR_TestChoice_1[] = {
234 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type1),
235 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
236 .tag_mode = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +0000237 .type = &asn_DEF_TestType_16P0,
Lev Walkin15750402005-07-03 05:27:19 +0000238 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400239 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000240 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
241 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000242 .name = "type1"
243 },
244 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type2),
245 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
246 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000247 .type = &asn_DEF_TestType_16P1,
Lev Walkin15750402005-07-03 05:27:19 +0000248 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400249 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000250 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
251 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000252 .name = "type2"
253 },
254};
Lev Walkina7591b52014-10-12 18:37:35 -0700255static const asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700256 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 */
257 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000258};
Lev Walkin59b176e2005-11-26 11:25:14 +0000259static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000260 sizeof(struct TestChoice),
261 offsetof(struct TestChoice, _asn_ctx),
262 offsetof(struct TestChoice, present),
263 sizeof(((struct TestChoice *)0)->present),
Lev Walkin59b176e2005-11-26 11:25:14 +0000264 asn_MAP_TestChoice_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000265 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000266 .canonical_order = 0,
267 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000268};
269asn_TYPE_descriptor_t asn_DEF_TestChoice = {
270 "TestChoice",
271 "TestChoice",
272 CHOICE_free,
273 CHOICE_print,
274 CHOICE_constraint,
275 CHOICE_decode_ber,
276 CHOICE_encode_der,
277 CHOICE_decode_xer,
278 CHOICE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700279 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400280 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000281 CHOICE_outmost_tag,
282 0, /* No effective tags (pointer) */
283 0, /* No effective tags (count) */
284 0, /* No tags (pointer) */
285 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400286 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000287 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000288 asn_MBR_TestChoice_1,
289 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000290 &asn_SPC_TestChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000291};
292
293
Lev Walkina00d6b32006-03-21 03:40:38 +0000294/*** <<< INCLUDES [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000295
Lev Walkinc3f0b892005-08-14 02:40:04 +0000296#include <NativeInteger.h>
Lev Walkin15750402005-07-03 05:27:19 +0000297#include <constr_SEQUENCE.h>
298#include <BOOLEAN.h>
Lev Walkin15750402005-07-03 05:27:19 +0000299
Lev Walkina00d6b32006-03-21 03:40:38 +0000300/*** <<< TYPE-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000301
Lev Walkina00d6b32006-03-21 03:40:38 +0000302typedef struct AutoType_34P0 {
303 long common;
Lev Walkin15750402005-07-03 05:27:19 +0000304
305 /* Context for parsing across buffer boundaries */
306 asn_struct_ctx_t _asn_ctx;
Lev Walkina00d6b32006-03-21 03:40:38 +0000307} AutoType_34P0_t;
308typedef struct AutoType_34P1 {
309 BOOLEAN_t common;
310
311 /* Context for parsing across buffer boundaries */
312 asn_struct_ctx_t _asn_ctx;
313} AutoType_34P1_t;
Lev Walkin15750402005-07-03 05:27:19 +0000314
Lev Walkina00d6b32006-03-21 03:40:38 +0000315/*** <<< FUNC-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000316
Lev Walkina00d6b32006-03-21 03:40:38 +0000317extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0;
318extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1;
Lev Walkin15750402005-07-03 05:27:19 +0000319
Lev Walkina00d6b32006-03-21 03:40:38 +0000320/*** <<< CODE [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000321
322static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000323memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000324 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000325 long value;
326
327 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700328 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000329 "%s: value not given (%s:%d)",
330 td->name, __FILE__, __LINE__);
331 return -1;
332 }
333
Lev Walkinc3f0b892005-08-14 02:40:04 +0000334 value = *(const long *)sptr;
Lev Walkin15750402005-07-03 05:27:19 +0000335
336 if((value == 0)) {
337 /* Constraint check succeeded */
338 return 0;
339 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700340 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000341 "%s: constraint failed (%s:%d)",
342 td->name, __FILE__, __LINE__);
343 return -1;
344 }
345}
346
347static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000348memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000349 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000350 BOOLEAN_t value;
351
352 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700353 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000354 "%s: value not given (%s:%d)",
355 td->name, __FILE__, __LINE__);
356 return -1;
357 }
358
359 value = (*(const long *)sptr) ? 1 : 0;
360
361 if((value <= 0)) {
362 /* Constraint check succeeded */
363 return 0;
364 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700365 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000366 "%s: constraint failed (%s:%d)",
367 td->name, __FILE__, __LINE__);
368 return -1;
369 }
370}
371
372
Lev Walkina00d6b32006-03-21 03:40:38 +0000373/*** <<< STAT-DEFS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000374
Lev Walkina00d6b32006-03-21 03:40:38 +0000375static asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = {
376 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common),
Lev Walkin15750402005-07-03 05:27:19 +0000377 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
378 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000379 .type = &asn_DEF_NativeInteger,
Lev Walkina00d6b32006-03-21 03:40:38 +0000380 .memb_constraints = memb_common_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400381 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000382 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
383 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000384 .name = "common"
385 },
386};
Lev Walkina7591b52014-10-12 18:37:35 -0700387static const ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000388 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
389};
Lev Walkina7591b52014-10-12 18:37:35 -0700390static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700391 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000392};
Lev Walkina00d6b32006-03-21 03:40:38 +0000393static asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = {
394 sizeof(struct AutoType_34P0),
395 offsetof(struct AutoType_34P0, _asn_ctx),
396 asn_MAP_AutoType_34P0_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000397 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000398 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000399 -1, /* Start extensions */
400 -1 /* Stop extensions */
401};
Lev Walkina00d6b32006-03-21 03:40:38 +0000402asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = {
403 "AutoType",
404 "AutoType",
Lev Walkin15750402005-07-03 05:27:19 +0000405 SEQUENCE_free,
406 SEQUENCE_print,
407 SEQUENCE_constraint,
408 SEQUENCE_decode_ber,
409 SEQUENCE_encode_der,
410 SEQUENCE_decode_xer,
411 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700412 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400413 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000414 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000415 asn_DEF_AutoType_34P0_tags_1,
416 sizeof(asn_DEF_AutoType_34P0_tags_1)
417 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
418 asn_DEF_AutoType_34P0_tags_1, /* Same as above */
419 sizeof(asn_DEF_AutoType_34P0_tags_1)
420 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400421 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000422 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000423 asn_MBR_AutoType_34P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000424 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000425 &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000426};
427
Lev Walkina00d6b32006-03-21 03:40:38 +0000428static asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = {
429 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000430 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
431 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000432 .type = &asn_DEF_BOOLEAN,
Lev Walkina00d6b32006-03-21 03:40:38 +0000433 .memb_constraints = memb_common_constraint_3,
Lev Walkinb33425f2017-07-14 14:59:52 +0400434 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000435 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
436 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000437 .name = "common"
438 },
439};
Lev Walkina7591b52014-10-12 18:37:35 -0700440static const ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000441 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
442};
Lev Walkina7591b52014-10-12 18:37:35 -0700443static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700444 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000445};
Lev Walkina00d6b32006-03-21 03:40:38 +0000446static asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = {
447 sizeof(struct AutoType_34P1),
448 offsetof(struct AutoType_34P1, _asn_ctx),
449 asn_MAP_AutoType_34P1_tag2el_3,
Lev Walkin15750402005-07-03 05:27:19 +0000450 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000451 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000452 -1, /* Start extensions */
453 -1 /* Stop extensions */
454};
Lev Walkina00d6b32006-03-21 03:40:38 +0000455asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = {
456 "AutoType",
457 "AutoType",
Lev Walkin15750402005-07-03 05:27:19 +0000458 SEQUENCE_free,
459 SEQUENCE_print,
460 SEQUENCE_constraint,
461 SEQUENCE_decode_ber,
462 SEQUENCE_encode_der,
463 SEQUENCE_decode_xer,
464 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700465 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400466 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000467 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000468 asn_DEF_AutoType_34P1_tags_3,
469 sizeof(asn_DEF_AutoType_34P1_tags_3)
470 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
471 asn_DEF_AutoType_34P1_tags_3, /* Same as above */
472 sizeof(asn_DEF_AutoType_34P1_tags_3)
473 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400474 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000475 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000476 asn_MBR_AutoType_34P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000477 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000478 &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000479};
480
Lev Walkina00d6b32006-03-21 03:40:38 +0000481
482/*** <<< INCLUDES [AutoChoice] >>> ***/
483
Lev Walkin22b5ed42006-09-13 02:51:20 +0000484#include "AutoType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000485#include <constr_CHOICE.h>
486
487/*** <<< DEPS [AutoChoice] >>> ***/
488
489typedef enum AutoChoice_PR {
490 AutoChoice_PR_NOTHING, /* No components present */
491 AutoChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000492 AutoChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000493} AutoChoice_PR;
494
495/*** <<< TYPE-DECLS [AutoChoice] >>> ***/
496
497typedef struct AutoChoice {
498 AutoChoice_PR present;
499 union AutoChoice_u {
500 AutoType_34P0_t type1;
501 AutoType_34P1_t type2;
502 } choice;
503
504 /* Context for parsing across buffer boundaries */
505 asn_struct_ctx_t _asn_ctx;
506} AutoChoice_t;
507
508/*** <<< FUNC-DECLS [AutoChoice] >>> ***/
509
510extern asn_TYPE_descriptor_t asn_DEF_AutoChoice;
511
512/*** <<< STAT-DEFS [AutoChoice] >>> ***/
513
Lev Walkin15750402005-07-03 05:27:19 +0000514static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = {
515 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type1),
516 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
517 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000518 .type = &asn_DEF_AutoType_34P0,
Lev Walkin15750402005-07-03 05:27:19 +0000519 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400520 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000521 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
522 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000523 .name = "type1"
524 },
525 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type2),
526 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
527 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000528 .type = &asn_DEF_AutoType_34P1,
Lev Walkin15750402005-07-03 05:27:19 +0000529 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400530 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000531 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
532 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000533 .name = "type2"
534 },
535};
Lev Walkina7591b52014-10-12 18:37:35 -0700536static const asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700537 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 */
538 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000539};
Lev Walkin59b176e2005-11-26 11:25:14 +0000540static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000541 sizeof(struct AutoChoice),
542 offsetof(struct AutoChoice, _asn_ctx),
543 offsetof(struct AutoChoice, present),
544 sizeof(((struct AutoChoice *)0)->present),
Lev Walkin59b176e2005-11-26 11:25:14 +0000545 asn_MAP_AutoChoice_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000546 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000547 .canonical_order = 0,
548 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000549};
550asn_TYPE_descriptor_t asn_DEF_AutoChoice = {
551 "AutoChoice",
552 "AutoChoice",
553 CHOICE_free,
554 CHOICE_print,
555 CHOICE_constraint,
556 CHOICE_decode_ber,
557 CHOICE_encode_der,
558 CHOICE_decode_xer,
559 CHOICE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700560 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400561 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000562 CHOICE_outmost_tag,
563 0, /* No effective tags (pointer) */
564 0, /* No effective tags (count) */
565 0, /* No tags (pointer) */
566 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400567 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000568 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000569 asn_MBR_AutoChoice_1,
570 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000571 &asn_SPC_AutoChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000572};
573