blob: 7ca216b06627fc1b9e8423b039a576a9de363f07 [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),
Lev Walkine3917082017-08-23 10:29:38 -0700102 .tag2el = asn_MAP_TestType_16P0_tag2el_1,
103 .tag2el_count = 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",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800111 &asn_OP_SEQUENCE,
Lev Walkin15750402005-07-03 05:27:19 +0000112 SEQUENCE_constraint,
Lev Walkina00d6b32006-03-21 03:40:38 +0000113 asn_DEF_TestType_16P0_tags_1,
114 sizeof(asn_DEF_TestType_16P0_tags_1)
115 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
116 asn_DEF_TestType_16P0_tags_1, /* Same as above */
117 sizeof(asn_DEF_TestType_16P0_tags_1)
118 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400119 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000120 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000121 asn_MBR_TestType_16P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000122 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000123 &asn_SPC_TestType_16P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000124};
125
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000126static int asn_DFL_4_set_0(int set_value, void **sptr) {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000127 BOOLEAN_t *st = *sptr;
128
129 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000130 if(!set_value) return -1; /* Not a default value */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000131 st = (*sptr = CALLOC(1, sizeof(*st)));
132 if(!st) return -1;
133 }
134
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000135 if(set_value) {
136 /* Install default value 0 */
137 *st = 0;
138 return 0;
139 } else {
140 /* Test default value 0 */
141 return (*st == 0);
142 }
Lev Walkin0c0bca62006-03-21 04:48:15 +0000143}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800144asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000145 { ATF_NOFLAGS, 1, offsetof(struct TestType_16P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000146 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
147 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000148 .type = &asn_DEF_BOOLEAN,
Lev Walkin67a30122017-08-10 05:48:54 -0700149 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000150 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400151 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000152 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000153 .default_value = asn_DFL_4_set_0, /* DEFAULT 0 */
Lev Walkin15750402005-07-03 05:27:19 +0000154 .name = "common"
155 },
156};
Lev Walkina7591b52014-10-12 18:37:35 -0700157static const ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000158 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
159};
Lev Walkina7591b52014-10-12 18:37:35 -0700160static const asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700161 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000162};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800163asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000164 sizeof(struct TestType_16P1),
165 offsetof(struct TestType_16P1, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700166 .tag2el = asn_MAP_TestType_16P1_tag2el_3,
167 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000168 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000169 -1, /* Start extensions */
170 -1 /* Stop extensions */
171};
Lev Walkina00d6b32006-03-21 03:40:38 +0000172asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = {
173 "TestType",
174 "TestType",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800175 &asn_OP_SEQUENCE,
Lev Walkin15750402005-07-03 05:27:19 +0000176 SEQUENCE_constraint,
Lev Walkina00d6b32006-03-21 03:40:38 +0000177 asn_DEF_TestType_16P1_tags_3,
178 sizeof(asn_DEF_TestType_16P1_tags_3)
179 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
180 asn_DEF_TestType_16P1_tags_3, /* Same as above */
181 sizeof(asn_DEF_TestType_16P1_tags_3)
182 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400183 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000184 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000185 asn_MBR_TestType_16P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000186 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000187 &asn_SPC_TestType_16P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000188};
189
Lev Walkina00d6b32006-03-21 03:40:38 +0000190
191/*** <<< INCLUDES [TestChoice] >>> ***/
192
Lev Walkin22b5ed42006-09-13 02:51:20 +0000193#include "TestType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000194#include <constr_CHOICE.h>
195
196/*** <<< DEPS [TestChoice] >>> ***/
197
198typedef enum TestChoice_PR {
199 TestChoice_PR_NOTHING, /* No components present */
200 TestChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000201 TestChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000202} TestChoice_PR;
203
204/*** <<< TYPE-DECLS [TestChoice] >>> ***/
205
206typedef struct TestChoice {
207 TestChoice_PR present;
208 union TestChoice_u {
209 TestType_16P0_t type1;
210 TestType_16P1_t type2;
211 } choice;
212
213 /* Context for parsing across buffer boundaries */
214 asn_struct_ctx_t _asn_ctx;
215} TestChoice_t;
216
217/*** <<< FUNC-DECLS [TestChoice] >>> ***/
218
219extern asn_TYPE_descriptor_t asn_DEF_TestChoice;
220
221/*** <<< STAT-DEFS [TestChoice] >>> ***/
222
Lev Walkin15750402005-07-03 05:27:19 +0000223static asn_TYPE_member_t asn_MBR_TestChoice_1[] = {
224 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type1),
225 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
226 .tag_mode = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +0000227 .type = &asn_DEF_TestType_16P0,
Lev Walkin67a30122017-08-10 05:48:54 -0700228 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000229 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400230 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000231 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
232 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000233 .name = "type1"
234 },
235 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type2),
236 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
237 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000238 .type = &asn_DEF_TestType_16P1,
Lev Walkin67a30122017-08-10 05:48:54 -0700239 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000240 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400241 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000242 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
243 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000244 .name = "type2"
245 },
246};
Lev Walkina7591b52014-10-12 18:37:35 -0700247static const asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700248 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 */
249 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000250};
Lev Walkin59b176e2005-11-26 11:25:14 +0000251static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000252 sizeof(struct TestChoice),
253 offsetof(struct TestChoice, _asn_ctx),
254 offsetof(struct TestChoice, present),
255 sizeof(((struct TestChoice *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700256 .tag2el = asn_MAP_TestChoice_tag2el_1,
257 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000258 .canonical_order = 0,
259 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000260};
261asn_TYPE_descriptor_t asn_DEF_TestChoice = {
262 "TestChoice",
263 "TestChoice",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800264 &asn_OP_CHOICE,
Lev Walkin15750402005-07-03 05:27:19 +0000265 CHOICE_constraint,
Lev Walkin15750402005-07-03 05:27:19 +0000266 0, /* No effective tags (pointer) */
267 0, /* No effective tags (count) */
268 0, /* No tags (pointer) */
269 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400270 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000271 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000272 asn_MBR_TestChoice_1,
273 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000274 &asn_SPC_TestChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000275};
276
277
Lev Walkina00d6b32006-03-21 03:40:38 +0000278/*** <<< INCLUDES [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000279
Lev Walkinc3f0b892005-08-14 02:40:04 +0000280#include <NativeInteger.h>
Lev Walkin15750402005-07-03 05:27:19 +0000281#include <constr_SEQUENCE.h>
282#include <BOOLEAN.h>
Lev Walkin15750402005-07-03 05:27:19 +0000283
Lev Walkina00d6b32006-03-21 03:40:38 +0000284/*** <<< TYPE-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000285
Lev Walkina00d6b32006-03-21 03:40:38 +0000286typedef struct AutoType_34P0 {
287 long common;
Lev Walkin15750402005-07-03 05:27:19 +0000288
289 /* Context for parsing across buffer boundaries */
290 asn_struct_ctx_t _asn_ctx;
Lev Walkina00d6b32006-03-21 03:40:38 +0000291} AutoType_34P0_t;
292typedef struct AutoType_34P1 {
293 BOOLEAN_t common;
294
295 /* Context for parsing across buffer boundaries */
296 asn_struct_ctx_t _asn_ctx;
297} AutoType_34P1_t;
Lev Walkin15750402005-07-03 05:27:19 +0000298
Lev Walkina00d6b32006-03-21 03:40:38 +0000299/*** <<< FUNC-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000300
Lev Walkina00d6b32006-03-21 03:40:38 +0000301extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800302extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1;
303extern asn_TYPE_member_t asn_MBR_AutoType_34P0_1[1];
Lev Walkina00d6b32006-03-21 03:40:38 +0000304extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800305extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3;
306extern asn_TYPE_member_t asn_MBR_AutoType_34P1_3[1];
Lev Walkin15750402005-07-03 05:27:19 +0000307
Lev Walkina00d6b32006-03-21 03:40:38 +0000308/*** <<< CODE [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000309
310static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000311memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000312 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000313 long value;
314
315 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700316 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000317 "%s: value not given (%s:%d)",
318 td->name, __FILE__, __LINE__);
319 return -1;
320 }
321
Lev Walkinc3f0b892005-08-14 02:40:04 +0000322 value = *(const long *)sptr;
Lev Walkin15750402005-07-03 05:27:19 +0000323
324 if((value == 0)) {
325 /* Constraint check succeeded */
326 return 0;
327 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700328 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000329 "%s: constraint failed (%s:%d)",
330 td->name, __FILE__, __LINE__);
331 return -1;
332 }
333}
334
335static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000336memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000337 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000338 BOOLEAN_t value;
339
340 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700341 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000342 "%s: value not given (%s:%d)",
343 td->name, __FILE__, __LINE__);
344 return -1;
345 }
346
347 value = (*(const long *)sptr) ? 1 : 0;
348
349 if((value <= 0)) {
350 /* Constraint check succeeded */
351 return 0;
352 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700353 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000354 "%s: constraint failed (%s:%d)",
355 td->name, __FILE__, __LINE__);
356 return -1;
357 }
358}
359
360
Lev Walkina00d6b32006-03-21 03:40:38 +0000361/*** <<< STAT-DEFS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000362
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800363asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000364 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common),
Lev Walkin15750402005-07-03 05:27:19 +0000365 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
366 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000367 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700368 .type_selector = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +0000369 .memb_constraints = memb_common_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400370 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000371 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
372 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000373 .name = "common"
374 },
375};
Lev Walkina7591b52014-10-12 18:37:35 -0700376static const ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000377 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
378};
Lev Walkina7591b52014-10-12 18:37:35 -0700379static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700380 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000381};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800382asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000383 sizeof(struct AutoType_34P0),
384 offsetof(struct AutoType_34P0, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700385 .tag2el = asn_MAP_AutoType_34P0_tag2el_1,
386 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000387 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000388 -1, /* Start extensions */
389 -1 /* Stop extensions */
390};
Lev Walkina00d6b32006-03-21 03:40:38 +0000391asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = {
392 "AutoType",
393 "AutoType",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800394 &asn_OP_SEQUENCE,
Lev Walkin15750402005-07-03 05:27:19 +0000395 SEQUENCE_constraint,
Lev Walkina00d6b32006-03-21 03:40:38 +0000396 asn_DEF_AutoType_34P0_tags_1,
397 sizeof(asn_DEF_AutoType_34P0_tags_1)
398 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
399 asn_DEF_AutoType_34P0_tags_1, /* Same as above */
400 sizeof(asn_DEF_AutoType_34P0_tags_1)
401 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400402 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000403 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000404 asn_MBR_AutoType_34P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000405 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000406 &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000407};
408
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800409asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000410 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000411 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
412 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000413 .type = &asn_DEF_BOOLEAN,
Lev Walkin67a30122017-08-10 05:48:54 -0700414 .type_selector = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +0000415 .memb_constraints = memb_common_constraint_3,
Lev Walkinb33425f2017-07-14 14:59:52 +0400416 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000417 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
418 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000419 .name = "common"
420 },
421};
Lev Walkina7591b52014-10-12 18:37:35 -0700422static const ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000423 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
424};
Lev Walkina7591b52014-10-12 18:37:35 -0700425static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700426 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000427};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800428asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000429 sizeof(struct AutoType_34P1),
430 offsetof(struct AutoType_34P1, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700431 .tag2el = asn_MAP_AutoType_34P1_tag2el_3,
432 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000433 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000434 -1, /* Start extensions */
435 -1 /* Stop extensions */
436};
Lev Walkina00d6b32006-03-21 03:40:38 +0000437asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = {
438 "AutoType",
439 "AutoType",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800440 &asn_OP_SEQUENCE,
Lev Walkin15750402005-07-03 05:27:19 +0000441 SEQUENCE_constraint,
Lev Walkina00d6b32006-03-21 03:40:38 +0000442 asn_DEF_AutoType_34P1_tags_3,
443 sizeof(asn_DEF_AutoType_34P1_tags_3)
444 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
445 asn_DEF_AutoType_34P1_tags_3, /* Same as above */
446 sizeof(asn_DEF_AutoType_34P1_tags_3)
447 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400448 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000449 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000450 asn_MBR_AutoType_34P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000451 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000452 &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000453};
454
Lev Walkina00d6b32006-03-21 03:40:38 +0000455
456/*** <<< INCLUDES [AutoChoice] >>> ***/
457
Lev Walkin22b5ed42006-09-13 02:51:20 +0000458#include "AutoType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000459#include <constr_CHOICE.h>
460
461/*** <<< DEPS [AutoChoice] >>> ***/
462
463typedef enum AutoChoice_PR {
464 AutoChoice_PR_NOTHING, /* No components present */
465 AutoChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000466 AutoChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000467} AutoChoice_PR;
468
469/*** <<< TYPE-DECLS [AutoChoice] >>> ***/
470
471typedef struct AutoChoice {
472 AutoChoice_PR present;
473 union AutoChoice_u {
474 AutoType_34P0_t type1;
475 AutoType_34P1_t type2;
476 } choice;
477
478 /* Context for parsing across buffer boundaries */
479 asn_struct_ctx_t _asn_ctx;
480} AutoChoice_t;
481
482/*** <<< FUNC-DECLS [AutoChoice] >>> ***/
483
484extern asn_TYPE_descriptor_t asn_DEF_AutoChoice;
485
486/*** <<< STAT-DEFS [AutoChoice] >>> ***/
487
Lev Walkin15750402005-07-03 05:27:19 +0000488static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = {
489 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type1),
490 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
491 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000492 .type = &asn_DEF_AutoType_34P0,
Lev Walkin67a30122017-08-10 05:48:54 -0700493 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000494 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400495 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000496 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
497 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000498 .name = "type1"
499 },
500 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type2),
501 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
502 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000503 .type = &asn_DEF_AutoType_34P1,
Lev Walkin67a30122017-08-10 05:48:54 -0700504 .type_selector = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000505 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400506 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000507 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
508 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000509 .name = "type2"
510 },
511};
Lev Walkina7591b52014-10-12 18:37:35 -0700512static const asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700513 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 */
514 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000515};
Lev Walkin59b176e2005-11-26 11:25:14 +0000516static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000517 sizeof(struct AutoChoice),
518 offsetof(struct AutoChoice, _asn_ctx),
519 offsetof(struct AutoChoice, present),
520 sizeof(((struct AutoChoice *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700521 .tag2el = asn_MAP_AutoChoice_tag2el_1,
522 .tag2el_count = 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000523 .canonical_order = 0,
524 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000525};
526asn_TYPE_descriptor_t asn_DEF_AutoChoice = {
527 "AutoChoice",
528 "AutoChoice",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800529 &asn_OP_CHOICE,
Lev Walkin15750402005-07-03 05:27:19 +0000530 CHOICE_constraint,
Lev Walkin15750402005-07-03 05:27:19 +0000531 0, /* No effective tags (pointer) */
532 0, /* No effective tags (count) */
533 0, /* No tags (pointer) */
534 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400535 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000536 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000537 asn_MBR_AutoChoice_1,
538 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000539 &asn_SPC_AutoChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000540};
541