blob: 6b9b672ee44e946328f10583608aee6c8dfc1bbc [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,
112 SEQUENCE_constraint,
113 SEQUENCE_decode_ber,
114 SEQUENCE_encode_der,
115 SEQUENCE_decode_xer,
116 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700117 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400118 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000119 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000120 asn_DEF_TestType_16P0_tags_1,
121 sizeof(asn_DEF_TestType_16P0_tags_1)
122 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
123 asn_DEF_TestType_16P0_tags_1, /* Same as above */
124 sizeof(asn_DEF_TestType_16P0_tags_1)
125 /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400126 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000127 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000128 asn_MBR_TestType_16P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000129 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000130 &asn_SPC_TestType_16P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000131};
132
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000133static int asn_DFL_4_set_0(int set_value, void **sptr) {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000134 BOOLEAN_t *st = *sptr;
135
136 if(!st) {
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000137 if(!set_value) return -1; /* Not a default value */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000138 st = (*sptr = CALLOC(1, sizeof(*st)));
139 if(!st) return -1;
140 }
141
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000142 if(set_value) {
143 /* Install default value 0 */
144 *st = 0;
145 return 0;
146 } else {
147 /* Test default value 0 */
148 return (*st == 0);
149 }
Lev Walkin0c0bca62006-03-21 04:48:15 +0000150}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800151asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = {
Lev Walkin0c0bca62006-03-21 04:48:15 +0000152 { ATF_NOFLAGS, 1, offsetof(struct TestType_16P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000153 .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
154 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000155 .type = &asn_DEF_BOOLEAN,
Lev Walkin15750402005-07-03 05:27:19 +0000156 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400157 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000158 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
Lev Walkin0c0bca62006-03-21 04:48:15 +0000159 .default_value = asn_DFL_4_set_0, /* DEFAULT 0 */
Lev Walkin15750402005-07-03 05:27:19 +0000160 .name = "common"
161 },
162};
Lev Walkina7591b52014-10-12 18:37:35 -0700163static const ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000164 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
165};
Lev Walkina7591b52014-10-12 18:37:35 -0700166static const asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700167 { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000168};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800169asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000170 sizeof(struct TestType_16P1),
171 offsetof(struct TestType_16P1, _asn_ctx),
172 asn_MAP_TestType_16P1_tag2el_3,
Lev Walkin15750402005-07-03 05:27:19 +0000173 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000174 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000175 -1, /* Start extensions */
176 -1 /* Stop extensions */
177};
Lev Walkina00d6b32006-03-21 03:40:38 +0000178asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = {
179 "TestType",
180 "TestType",
Lev Walkin15750402005-07-03 05:27:19 +0000181 SEQUENCE_free,
182 SEQUENCE_print,
183 SEQUENCE_constraint,
184 SEQUENCE_decode_ber,
185 SEQUENCE_encode_der,
186 SEQUENCE_decode_xer,
187 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700188 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400189 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000190 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000191 asn_DEF_TestType_16P1_tags_3,
192 sizeof(asn_DEF_TestType_16P1_tags_3)
193 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
194 asn_DEF_TestType_16P1_tags_3, /* Same as above */
195 sizeof(asn_DEF_TestType_16P1_tags_3)
196 /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400197 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000198 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000199 asn_MBR_TestType_16P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000200 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000201 &asn_SPC_TestType_16P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000202};
203
Lev Walkina00d6b32006-03-21 03:40:38 +0000204
205/*** <<< INCLUDES [TestChoice] >>> ***/
206
Lev Walkin22b5ed42006-09-13 02:51:20 +0000207#include "TestType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000208#include <constr_CHOICE.h>
209
210/*** <<< DEPS [TestChoice] >>> ***/
211
212typedef enum TestChoice_PR {
213 TestChoice_PR_NOTHING, /* No components present */
214 TestChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000215 TestChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000216} TestChoice_PR;
217
218/*** <<< TYPE-DECLS [TestChoice] >>> ***/
219
220typedef struct TestChoice {
221 TestChoice_PR present;
222 union TestChoice_u {
223 TestType_16P0_t type1;
224 TestType_16P1_t type2;
225 } choice;
226
227 /* Context for parsing across buffer boundaries */
228 asn_struct_ctx_t _asn_ctx;
229} TestChoice_t;
230
231/*** <<< FUNC-DECLS [TestChoice] >>> ***/
232
233extern asn_TYPE_descriptor_t asn_DEF_TestChoice;
234
235/*** <<< STAT-DEFS [TestChoice] >>> ***/
236
Lev Walkin15750402005-07-03 05:27:19 +0000237static asn_TYPE_member_t asn_MBR_TestChoice_1[] = {
238 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type1),
239 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
240 .tag_mode = 0,
Lev Walkina00d6b32006-03-21 03:40:38 +0000241 .type = &asn_DEF_TestType_16P0,
Lev Walkin15750402005-07-03 05:27:19 +0000242 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400243 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000244 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
245 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000246 .name = "type1"
247 },
248 { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type2),
249 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
250 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000251 .type = &asn_DEF_TestType_16P1,
Lev Walkin15750402005-07-03 05:27:19 +0000252 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400253 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000254 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
255 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000256 .name = "type2"
257 },
258};
Lev Walkina7591b52014-10-12 18:37:35 -0700259static const asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700260 { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 */
261 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000262};
Lev Walkin59b176e2005-11-26 11:25:14 +0000263static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000264 sizeof(struct TestChoice),
265 offsetof(struct TestChoice, _asn_ctx),
266 offsetof(struct TestChoice, present),
267 sizeof(((struct TestChoice *)0)->present),
Lev Walkin59b176e2005-11-26 11:25:14 +0000268 asn_MAP_TestChoice_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000269 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000270 .canonical_order = 0,
271 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000272};
273asn_TYPE_descriptor_t asn_DEF_TestChoice = {
274 "TestChoice",
275 "TestChoice",
276 CHOICE_free,
277 CHOICE_print,
278 CHOICE_constraint,
279 CHOICE_decode_ber,
280 CHOICE_encode_der,
281 CHOICE_decode_xer,
282 CHOICE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700283 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400284 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000285 CHOICE_outmost_tag,
286 0, /* No effective tags (pointer) */
287 0, /* No effective tags (count) */
288 0, /* No tags (pointer) */
289 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400290 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000291 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000292 asn_MBR_TestChoice_1,
293 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000294 &asn_SPC_TestChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000295};
296
297
Lev Walkina00d6b32006-03-21 03:40:38 +0000298/*** <<< INCLUDES [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000299
Lev Walkinc3f0b892005-08-14 02:40:04 +0000300#include <NativeInteger.h>
Lev Walkin15750402005-07-03 05:27:19 +0000301#include <constr_SEQUENCE.h>
302#include <BOOLEAN.h>
Lev Walkin15750402005-07-03 05:27:19 +0000303
Lev Walkina00d6b32006-03-21 03:40:38 +0000304/*** <<< TYPE-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000305
Lev Walkina00d6b32006-03-21 03:40:38 +0000306typedef struct AutoType_34P0 {
307 long common;
Lev Walkin15750402005-07-03 05:27:19 +0000308
309 /* Context for parsing across buffer boundaries */
310 asn_struct_ctx_t _asn_ctx;
Lev Walkina00d6b32006-03-21 03:40:38 +0000311} AutoType_34P0_t;
312typedef struct AutoType_34P1 {
313 BOOLEAN_t common;
314
315 /* Context for parsing across buffer boundaries */
316 asn_struct_ctx_t _asn_ctx;
317} AutoType_34P1_t;
Lev Walkin15750402005-07-03 05:27:19 +0000318
Lev Walkina00d6b32006-03-21 03:40:38 +0000319/*** <<< FUNC-DECLS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000320
Lev Walkina00d6b32006-03-21 03:40:38 +0000321extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800322extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1;
323extern asn_TYPE_member_t asn_MBR_AutoType_34P0_1[1];
Lev Walkina00d6b32006-03-21 03:40:38 +0000324extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800325extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3;
326extern asn_TYPE_member_t asn_MBR_AutoType_34P1_3[1];
Lev Walkin15750402005-07-03 05:27:19 +0000327
Lev Walkina00d6b32006-03-21 03:40:38 +0000328/*** <<< CODE [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000329
330static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000331memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000332 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000333 long value;
334
335 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700336 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000337 "%s: value not given (%s:%d)",
338 td->name, __FILE__, __LINE__);
339 return -1;
340 }
341
Lev Walkinc3f0b892005-08-14 02:40:04 +0000342 value = *(const long *)sptr;
Lev Walkin15750402005-07-03 05:27:19 +0000343
344 if((value == 0)) {
345 /* Constraint check succeeded */
346 return 0;
347 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700348 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000349 "%s: constraint failed (%s:%d)",
350 td->name, __FILE__, __LINE__);
351 return -1;
352 }
353}
354
355static int
Lev Walkina00d6b32006-03-21 03:40:38 +0000356memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000357 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin15750402005-07-03 05:27:19 +0000358 BOOLEAN_t value;
359
360 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700361 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000362 "%s: value not given (%s:%d)",
363 td->name, __FILE__, __LINE__);
364 return -1;
365 }
366
367 value = (*(const long *)sptr) ? 1 : 0;
368
369 if((value <= 0)) {
370 /* Constraint check succeeded */
371 return 0;
372 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700373 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin15750402005-07-03 05:27:19 +0000374 "%s: constraint failed (%s:%d)",
375 td->name, __FILE__, __LINE__);
376 return -1;
377 }
378}
379
380
Lev Walkina00d6b32006-03-21 03:40:38 +0000381/*** <<< STAT-DEFS [AutoType] >>> ***/
Lev Walkin15750402005-07-03 05:27:19 +0000382
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800383asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000384 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common),
Lev Walkin15750402005-07-03 05:27:19 +0000385 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
386 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000387 .type = &asn_DEF_NativeInteger,
Lev Walkina00d6b32006-03-21 03:40:38 +0000388 .memb_constraints = memb_common_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400389 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000390 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
391 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000392 .name = "common"
393 },
394};
Lev Walkina7591b52014-10-12 18:37:35 -0700395static const ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000396 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
397};
Lev Walkina7591b52014-10-12 18:37:35 -0700398static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700399 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000400};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800401asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000402 sizeof(struct AutoType_34P0),
403 offsetof(struct AutoType_34P0, _asn_ctx),
404 asn_MAP_AutoType_34P0_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000405 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000406 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000407 -1, /* Start extensions */
408 -1 /* Stop extensions */
409};
Lev Walkina00d6b32006-03-21 03:40:38 +0000410asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = {
411 "AutoType",
412 "AutoType",
Lev Walkin15750402005-07-03 05:27:19 +0000413 SEQUENCE_free,
414 SEQUENCE_print,
415 SEQUENCE_constraint,
416 SEQUENCE_decode_ber,
417 SEQUENCE_encode_der,
418 SEQUENCE_decode_xer,
419 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700420 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400421 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000422 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000423 asn_DEF_AutoType_34P0_tags_1,
424 sizeof(asn_DEF_AutoType_34P0_tags_1)
425 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
426 asn_DEF_AutoType_34P0_tags_1, /* Same as above */
427 sizeof(asn_DEF_AutoType_34P0_tags_1)
428 /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400429 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000430 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000431 asn_MBR_AutoType_34P0_1,
Lev Walkin15750402005-07-03 05:27:19 +0000432 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000433 &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000434};
435
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800436asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000437 { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common),
Lev Walkin15750402005-07-03 05:27:19 +0000438 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
439 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000440 .type = &asn_DEF_BOOLEAN,
Lev Walkina00d6b32006-03-21 03:40:38 +0000441 .memb_constraints = memb_common_constraint_3,
Lev Walkinb33425f2017-07-14 14:59:52 +0400442 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000443 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
444 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000445 .name = "common"
446 },
447};
Lev Walkina7591b52014-10-12 18:37:35 -0700448static const ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = {
Lev Walkin15750402005-07-03 05:27:19 +0000449 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
450};
Lev Walkina7591b52014-10-12 18:37:35 -0700451static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700452 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */
Lev Walkin15750402005-07-03 05:27:19 +0000453};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800454asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = {
Lev Walkina00d6b32006-03-21 03:40:38 +0000455 sizeof(struct AutoType_34P1),
456 offsetof(struct AutoType_34P1, _asn_ctx),
457 asn_MAP_AutoType_34P1_tag2el_3,
Lev Walkin15750402005-07-03 05:27:19 +0000458 1, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000459 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin15750402005-07-03 05:27:19 +0000460 -1, /* Start extensions */
461 -1 /* Stop extensions */
462};
Lev Walkina00d6b32006-03-21 03:40:38 +0000463asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = {
464 "AutoType",
465 "AutoType",
Lev Walkin15750402005-07-03 05:27:19 +0000466 SEQUENCE_free,
467 SEQUENCE_print,
468 SEQUENCE_constraint,
469 SEQUENCE_decode_ber,
470 SEQUENCE_encode_der,
471 SEQUENCE_decode_xer,
472 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700473 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400474 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000475 0, /* Use generic outmost tag fetcher */
Lev Walkina00d6b32006-03-21 03:40:38 +0000476 asn_DEF_AutoType_34P1_tags_3,
477 sizeof(asn_DEF_AutoType_34P1_tags_3)
478 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
479 asn_DEF_AutoType_34P1_tags_3, /* Same as above */
480 sizeof(asn_DEF_AutoType_34P1_tags_3)
481 /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400482 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000483 0, /* No PER visible constraints */
Lev Walkina00d6b32006-03-21 03:40:38 +0000484 asn_MBR_AutoType_34P1_3,
Lev Walkin15750402005-07-03 05:27:19 +0000485 1, /* Elements count */
Lev Walkina00d6b32006-03-21 03:40:38 +0000486 &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000487};
488
Lev Walkina00d6b32006-03-21 03:40:38 +0000489
490/*** <<< INCLUDES [AutoChoice] >>> ***/
491
Lev Walkin22b5ed42006-09-13 02:51:20 +0000492#include "AutoType.h"
Lev Walkina00d6b32006-03-21 03:40:38 +0000493#include <constr_CHOICE.h>
494
495/*** <<< DEPS [AutoChoice] >>> ***/
496
497typedef enum AutoChoice_PR {
498 AutoChoice_PR_NOTHING, /* No components present */
499 AutoChoice_PR_type1,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000500 AutoChoice_PR_type2
Lev Walkina00d6b32006-03-21 03:40:38 +0000501} AutoChoice_PR;
502
503/*** <<< TYPE-DECLS [AutoChoice] >>> ***/
504
505typedef struct AutoChoice {
506 AutoChoice_PR present;
507 union AutoChoice_u {
508 AutoType_34P0_t type1;
509 AutoType_34P1_t type2;
510 } choice;
511
512 /* Context for parsing across buffer boundaries */
513 asn_struct_ctx_t _asn_ctx;
514} AutoChoice_t;
515
516/*** <<< FUNC-DECLS [AutoChoice] >>> ***/
517
518extern asn_TYPE_descriptor_t asn_DEF_AutoChoice;
519
520/*** <<< STAT-DEFS [AutoChoice] >>> ***/
521
Lev Walkin15750402005-07-03 05:27:19 +0000522static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = {
523 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type1),
524 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
525 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000526 .type = &asn_DEF_AutoType_34P0,
Lev Walkin15750402005-07-03 05:27:19 +0000527 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400528 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000529 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
530 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000531 .name = "type1"
532 },
533 { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type2),
534 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
535 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkina00d6b32006-03-21 03:40:38 +0000536 .type = &asn_DEF_AutoType_34P1,
Lev Walkin15750402005-07-03 05:27:19 +0000537 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400538 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000539 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
540 .default_value = 0,
Lev Walkin15750402005-07-03 05:27:19 +0000541 .name = "type2"
542 },
543};
Lev Walkina7591b52014-10-12 18:37:35 -0700544static const asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700545 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 */
546 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 */
Lev Walkin15750402005-07-03 05:27:19 +0000547};
Lev Walkin59b176e2005-11-26 11:25:14 +0000548static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = {
Lev Walkin15750402005-07-03 05:27:19 +0000549 sizeof(struct AutoChoice),
550 offsetof(struct AutoChoice, _asn_ctx),
551 offsetof(struct AutoChoice, present),
552 sizeof(((struct AutoChoice *)0)->present),
Lev Walkin59b176e2005-11-26 11:25:14 +0000553 asn_MAP_AutoChoice_tag2el_1,
Lev Walkin15750402005-07-03 05:27:19 +0000554 2, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000555 .canonical_order = 0,
556 .ext_start = -1 /* Extensions start */
Lev Walkin15750402005-07-03 05:27:19 +0000557};
558asn_TYPE_descriptor_t asn_DEF_AutoChoice = {
559 "AutoChoice",
560 "AutoChoice",
561 CHOICE_free,
562 CHOICE_print,
563 CHOICE_constraint,
564 CHOICE_decode_ber,
565 CHOICE_encode_der,
566 CHOICE_decode_xer,
567 CHOICE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700568 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400569 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin15750402005-07-03 05:27:19 +0000570 CHOICE_outmost_tag,
571 0, /* No effective tags (pointer) */
572 0, /* No effective tags (count) */
573 0, /* No tags (pointer) */
574 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400575 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000576 0, /* No PER visible constraints */
Lev Walkin15750402005-07-03 05:27:19 +0000577 asn_MBR_AutoChoice_1,
578 2, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000579 &asn_SPC_AutoChoice_specs_1 /* Additional specs */
Lev Walkin15750402005-07-03 05:27:19 +0000580};
581