Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 1 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 2 | /*** <<< INCLUDES [TestType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 3 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 4 | #include <NativeInteger.h> |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 5 | #include <constr_SEQUENCE.h> |
| 6 | #include <BOOLEAN.h> |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 7 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 8 | /*** <<< TYPE-DECLS [TestType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 9 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 10 | typedef struct TestType_16P0 { |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 11 | long common /* DEFAULT 0 */; |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 12 | |
| 13 | /* Context for parsing across buffer boundaries */ |
| 14 | asn_struct_ctx_t _asn_ctx; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 15 | } TestType_16P0_t; |
| 16 | typedef struct TestType_16P1 { |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 17 | BOOLEAN_t common /* DEFAULT 0 */; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 18 | |
| 19 | /* Context for parsing across buffer boundaries */ |
| 20 | asn_struct_ctx_t _asn_ctx; |
| 21 | } TestType_16P1_t; |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 22 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 23 | /*** <<< FUNC-DECLS [TestType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 24 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 25 | extern asn_TYPE_descriptor_t asn_DEF_TestType_16P0; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 26 | extern asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1; |
| 27 | extern asn_TYPE_member_t asn_MBR_TestType_16P0_1[1]; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 28 | extern asn_TYPE_descriptor_t asn_DEF_TestType_16P1; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 29 | extern asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3; |
| 30 | extern asn_TYPE_member_t asn_MBR_TestType_16P1_3[1]; |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 31 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 32 | /*** <<< CODE [TestType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 33 | |
| 34 | static int |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 35 | memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 36 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 37 | long value; |
| 38 | |
| 39 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 40 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 41 | "%s: value not given (%s:%d)", |
| 42 | td->name, __FILE__, __LINE__); |
| 43 | return -1; |
| 44 | } |
| 45 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 46 | value = *(const long *)sptr; |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 47 | |
| 48 | if((value >= 1 && value <= 10)) { |
| 49 | /* Constraint check succeeded */ |
| 50 | return 0; |
| 51 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 52 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 53 | "%s: constraint failed (%s:%d)", |
| 54 | td->name, __FILE__, __LINE__); |
| 55 | return -1; |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 60 | /*** <<< STAT-DEFS [TestType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 61 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 62 | static int asn_DFL_2_set_0(int set_value, void **sptr) { |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 63 | long *st = *sptr; |
| 64 | |
| 65 | if(!st) { |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 66 | if(!set_value) return -1; /* Not a default value */ |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 67 | st = (*sptr = CALLOC(1, sizeof(*st))); |
| 68 | if(!st) return -1; |
| 69 | } |
| 70 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 71 | 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 Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 79 | } |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 80 | asn_TYPE_member_t asn_MBR_TestType_16P0_1[] = { |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 81 | { ATF_NOFLAGS, 1, offsetof(struct TestType_16P0, common), |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 82 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 83 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 84 | .type = &asn_DEF_NativeInteger, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 85 | .type_selector = 0, |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 86 | .memb_constraints = memb_common_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 87 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 88 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 89 | .default_value = asn_DFL_2_set_0, /* DEFAULT 0 */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 90 | .name = "common" |
| 91 | }, |
| 92 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 93 | static const ber_tlv_tag_t asn_DEF_TestType_16P0_tags_1[] = { |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 94 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 95 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 96 | static const asn_TYPE_tag2member_t asn_MAP_TestType_16P0_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 97 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* common */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 98 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 99 | asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1 = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 100 | sizeof(struct TestType_16P0), |
| 101 | offsetof(struct TestType_16P0, _asn_ctx), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 102 | .tag2el = asn_MAP_TestType_16P0_tag2el_1, |
| 103 | .tag2el_count = 1, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 104 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 105 | -1, /* Start extensions */ |
| 106 | -1 /* Stop extensions */ |
| 107 | }; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 108 | asn_TYPE_descriptor_t asn_DEF_TestType_16P0 = { |
| 109 | "TestType", |
| 110 | "TestType", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 111 | &asn_OP_SEQUENCE, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 112 | SEQUENCE_constraint, |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 113 | 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 Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 119 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 120 | 0, /* No PER visible constraints */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 121 | asn_MBR_TestType_16P0_1, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 122 | 1, /* Elements count */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 123 | &asn_SPC_TestType_16P0_specs_1 /* Additional specs */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 124 | }; |
| 125 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 126 | static int asn_DFL_4_set_0(int set_value, void **sptr) { |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 127 | BOOLEAN_t *st = *sptr; |
| 128 | |
| 129 | if(!st) { |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 130 | if(!set_value) return -1; /* Not a default value */ |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 131 | st = (*sptr = CALLOC(1, sizeof(*st))); |
| 132 | if(!st) return -1; |
| 133 | } |
| 134 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 135 | 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 Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 143 | } |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 144 | asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = { |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 145 | { ATF_NOFLAGS, 1, offsetof(struct TestType_16P1, common), |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 146 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 147 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 148 | .type = &asn_DEF_BOOLEAN, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 149 | .type_selector = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 150 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 151 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 152 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
Lev Walkin | 0c0bca6 | 2006-03-21 04:48:15 +0000 | [diff] [blame] | 153 | .default_value = asn_DFL_4_set_0, /* DEFAULT 0 */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 154 | .name = "common" |
| 155 | }, |
| 156 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 157 | static const ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = { |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 158 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 159 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 160 | static const asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 161 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 162 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 163 | asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 164 | sizeof(struct TestType_16P1), |
| 165 | offsetof(struct TestType_16P1, _asn_ctx), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 166 | .tag2el = asn_MAP_TestType_16P1_tag2el_3, |
| 167 | .tag2el_count = 1, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 168 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 169 | -1, /* Start extensions */ |
| 170 | -1 /* Stop extensions */ |
| 171 | }; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 172 | asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = { |
| 173 | "TestType", |
| 174 | "TestType", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 175 | &asn_OP_SEQUENCE, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 176 | SEQUENCE_constraint, |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 177 | 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 Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 183 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 184 | 0, /* No PER visible constraints */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 185 | asn_MBR_TestType_16P1_3, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 186 | 1, /* Elements count */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 187 | &asn_SPC_TestType_16P1_specs_3 /* Additional specs */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 188 | }; |
| 189 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 190 | |
| 191 | /*** <<< INCLUDES [TestChoice] >>> ***/ |
| 192 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 193 | #include "TestType.h" |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 194 | #include <constr_CHOICE.h> |
| 195 | |
| 196 | /*** <<< DEPS [TestChoice] >>> ***/ |
| 197 | |
| 198 | typedef enum TestChoice_PR { |
| 199 | TestChoice_PR_NOTHING, /* No components present */ |
| 200 | TestChoice_PR_type1, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 201 | TestChoice_PR_type2 |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 202 | } TestChoice_PR; |
| 203 | |
| 204 | /*** <<< TYPE-DECLS [TestChoice] >>> ***/ |
| 205 | |
| 206 | typedef 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 | |
| 219 | extern asn_TYPE_descriptor_t asn_DEF_TestChoice; |
| 220 | |
| 221 | /*** <<< STAT-DEFS [TestChoice] >>> ***/ |
| 222 | |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 223 | static 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 Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 227 | .type = &asn_DEF_TestType_16P0, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 228 | .type_selector = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 229 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 230 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 231 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 232 | .default_value = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 233 | .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 Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 238 | .type = &asn_DEF_TestType_16P1, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 239 | .type_selector = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 240 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 241 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 242 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 243 | .default_value = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 244 | .name = "type2" |
| 245 | }, |
| 246 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 247 | static const asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 248 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 */ |
| 249 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 250 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 251 | static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = { |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 252 | sizeof(struct TestChoice), |
| 253 | offsetof(struct TestChoice, _asn_ctx), |
| 254 | offsetof(struct TestChoice, present), |
| 255 | sizeof(((struct TestChoice *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 256 | .tag2el = asn_MAP_TestChoice_tag2el_1, |
| 257 | .tag2el_count = 2, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 258 | .canonical_order = 0, |
| 259 | .ext_start = -1 /* Extensions start */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 260 | }; |
| 261 | asn_TYPE_descriptor_t asn_DEF_TestChoice = { |
| 262 | "TestChoice", |
| 263 | "TestChoice", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 264 | &asn_OP_CHOICE, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 265 | CHOICE_constraint, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 266 | 0, /* No effective tags (pointer) */ |
| 267 | 0, /* No effective tags (count) */ |
| 268 | 0, /* No tags (pointer) */ |
| 269 | 0, /* No tags (count) */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 270 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 271 | 0, /* No PER visible constraints */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 272 | asn_MBR_TestChoice_1, |
| 273 | 2, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 274 | &asn_SPC_TestChoice_specs_1 /* Additional specs */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 275 | }; |
| 276 | |
| 277 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 278 | /*** <<< INCLUDES [AutoType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 279 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 280 | #include <NativeInteger.h> |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 281 | #include <constr_SEQUENCE.h> |
| 282 | #include <BOOLEAN.h> |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 283 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 284 | /*** <<< TYPE-DECLS [AutoType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 285 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 286 | typedef struct AutoType_34P0 { |
| 287 | long common; |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 288 | |
| 289 | /* Context for parsing across buffer boundaries */ |
| 290 | asn_struct_ctx_t _asn_ctx; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 291 | } AutoType_34P0_t; |
| 292 | typedef 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 Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 298 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 299 | /*** <<< FUNC-DECLS [AutoType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 300 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 301 | extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 302 | extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1; |
| 303 | extern asn_TYPE_member_t asn_MBR_AutoType_34P0_1[1]; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 304 | extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 305 | extern asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3; |
| 306 | extern asn_TYPE_member_t asn_MBR_AutoType_34P1_3[1]; |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 307 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 308 | /*** <<< CODE [AutoType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 309 | |
| 310 | static int |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 311 | memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 312 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 313 | long value; |
| 314 | |
| 315 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 316 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 317 | "%s: value not given (%s:%d)", |
| 318 | td->name, __FILE__, __LINE__); |
| 319 | return -1; |
| 320 | } |
| 321 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 322 | value = *(const long *)sptr; |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 323 | |
| 324 | if((value == 0)) { |
| 325 | /* Constraint check succeeded */ |
| 326 | return 0; |
| 327 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 328 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 329 | "%s: constraint failed (%s:%d)", |
| 330 | td->name, __FILE__, __LINE__); |
| 331 | return -1; |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | static int |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 336 | memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 337 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 338 | BOOLEAN_t value; |
| 339 | |
| 340 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 341 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 342 | "%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 Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 353 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 354 | "%s: constraint failed (%s:%d)", |
| 355 | td->name, __FILE__, __LINE__); |
| 356 | return -1; |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 361 | /*** <<< STAT-DEFS [AutoType] >>> ***/ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 362 | |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 363 | asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 364 | { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common), |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 365 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 366 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 367 | .type = &asn_DEF_NativeInteger, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 368 | .type_selector = 0, |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 369 | .memb_constraints = memb_common_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 370 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 371 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 372 | .default_value = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 373 | .name = "common" |
| 374 | }, |
| 375 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 376 | static const ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = { |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 377 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 378 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 379 | static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 380 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 381 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 382 | asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 383 | sizeof(struct AutoType_34P0), |
| 384 | offsetof(struct AutoType_34P0, _asn_ctx), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 385 | .tag2el = asn_MAP_AutoType_34P0_tag2el_1, |
| 386 | .tag2el_count = 1, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 387 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 388 | -1, /* Start extensions */ |
| 389 | -1 /* Stop extensions */ |
| 390 | }; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 391 | asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = { |
| 392 | "AutoType", |
| 393 | "AutoType", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 394 | &asn_OP_SEQUENCE, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 395 | SEQUENCE_constraint, |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 396 | 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 Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 402 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 403 | 0, /* No PER visible constraints */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 404 | asn_MBR_AutoType_34P0_1, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 405 | 1, /* Elements count */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 406 | &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 407 | }; |
| 408 | |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 409 | asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 410 | { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common), |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 411 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 412 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 413 | .type = &asn_DEF_BOOLEAN, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 414 | .type_selector = 0, |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 415 | .memb_constraints = memb_common_constraint_3, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 416 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 417 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 418 | .default_value = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 419 | .name = "common" |
| 420 | }, |
| 421 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 422 | static const ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = { |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 423 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 424 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 425 | static const asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 426 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 427 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 428 | asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 429 | sizeof(struct AutoType_34P1), |
| 430 | offsetof(struct AutoType_34P1, _asn_ctx), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 431 | .tag2el = asn_MAP_AutoType_34P1_tag2el_3, |
| 432 | .tag2el_count = 1, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 433 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 434 | -1, /* Start extensions */ |
| 435 | -1 /* Stop extensions */ |
| 436 | }; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 437 | asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = { |
| 438 | "AutoType", |
| 439 | "AutoType", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 440 | &asn_OP_SEQUENCE, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 441 | SEQUENCE_constraint, |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 442 | 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 Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 448 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 449 | 0, /* No PER visible constraints */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 450 | asn_MBR_AutoType_34P1_3, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 451 | 1, /* Elements count */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 452 | &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 453 | }; |
| 454 | |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 455 | |
| 456 | /*** <<< INCLUDES [AutoChoice] >>> ***/ |
| 457 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 458 | #include "AutoType.h" |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 459 | #include <constr_CHOICE.h> |
| 460 | |
| 461 | /*** <<< DEPS [AutoChoice] >>> ***/ |
| 462 | |
| 463 | typedef enum AutoChoice_PR { |
| 464 | AutoChoice_PR_NOTHING, /* No components present */ |
| 465 | AutoChoice_PR_type1, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 466 | AutoChoice_PR_type2 |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 467 | } AutoChoice_PR; |
| 468 | |
| 469 | /*** <<< TYPE-DECLS [AutoChoice] >>> ***/ |
| 470 | |
| 471 | typedef 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 | |
| 484 | extern asn_TYPE_descriptor_t asn_DEF_AutoChoice; |
| 485 | |
| 486 | /*** <<< STAT-DEFS [AutoChoice] >>> ***/ |
| 487 | |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 488 | static 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 Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 492 | .type = &asn_DEF_AutoType_34P0, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 493 | .type_selector = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 494 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 495 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 496 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 497 | .default_value = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 498 | .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 Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 503 | .type = &asn_DEF_AutoType_34P1, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 504 | .type_selector = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 505 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 506 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 507 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 508 | .default_value = 0, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 509 | .name = "type2" |
| 510 | }, |
| 511 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 512 | static const asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 513 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 */ |
| 514 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 515 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 516 | static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = { |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 517 | sizeof(struct AutoChoice), |
| 518 | offsetof(struct AutoChoice, _asn_ctx), |
| 519 | offsetof(struct AutoChoice, present), |
| 520 | sizeof(((struct AutoChoice *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 521 | .tag2el = asn_MAP_AutoChoice_tag2el_1, |
| 522 | .tag2el_count = 2, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 523 | .canonical_order = 0, |
| 524 | .ext_start = -1 /* Extensions start */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 525 | }; |
| 526 | asn_TYPE_descriptor_t asn_DEF_AutoChoice = { |
| 527 | "AutoChoice", |
| 528 | "AutoChoice", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 529 | &asn_OP_CHOICE, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 530 | CHOICE_constraint, |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 531 | 0, /* No effective tags (pointer) */ |
| 532 | 0, /* No effective tags (count) */ |
| 533 | 0, /* No tags (pointer) */ |
| 534 | 0, /* No tags (count) */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 535 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 536 | 0, /* No PER visible constraints */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 537 | asn_MBR_AutoChoice_1, |
| 538 | 2, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 539 | &asn_SPC_AutoChoice_specs_1 /* Additional specs */ |
Lev Walkin | 1575040 | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 540 | }; |
| 541 | |