vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 1 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 2 | /*** <<< INCLUDES [TestType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 3 | |
vlm | a33a216 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 4 | #include <NativeInteger.h> |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 5 | #include <constr_SEQUENCE.h> |
| 6 | #include <BOOLEAN.h> |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 7 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 8 | /*** <<< TYPE-DECLS [TestType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 9 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 10 | typedef struct TestType_16P0 { |
| 11 | long common; |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 12 | |
| 13 | /* Context for parsing across buffer boundaries */ |
| 14 | asn_struct_ctx_t _asn_ctx; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 15 | } TestType_16P0_t; |
| 16 | typedef struct TestType_16P1 { |
| 17 | BOOLEAN_t common; |
| 18 | |
| 19 | /* Context for parsing across buffer boundaries */ |
| 20 | asn_struct_ctx_t _asn_ctx; |
| 21 | } TestType_16P1_t; |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 22 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 23 | /*** <<< FUNC-DECLS [TestType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 24 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 25 | extern asn_TYPE_descriptor_t asn_DEF_TestType_16P0; |
| 26 | extern asn_TYPE_descriptor_t asn_DEF_TestType_16P1; |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 27 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 28 | /*** <<< CODE [TestType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 29 | |
| 30 | static int |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 31 | memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 32 | asn_app_consume_bytes_f *app_errlog, void *app_key) { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 33 | long value; |
| 34 | |
| 35 | if(!sptr) { |
| 36 | _ASN_ERRLOG(app_errlog, app_key, |
| 37 | "%s: value not given (%s:%d)", |
| 38 | td->name, __FILE__, __LINE__); |
| 39 | return -1; |
| 40 | } |
| 41 | |
vlm | a33a216 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 42 | value = *(const long *)sptr; |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 43 | |
| 44 | if((value >= 1 && value <= 10)) { |
| 45 | /* Constraint check succeeded */ |
| 46 | return 0; |
| 47 | } else { |
| 48 | _ASN_ERRLOG(app_errlog, app_key, |
| 49 | "%s: constraint failed (%s:%d)", |
| 50 | td->name, __FILE__, __LINE__); |
| 51 | return -1; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 56 | /*** <<< STAT-DEFS [TestType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 57 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 58 | static asn_TYPE_member_t asn_MBR_TestType_16P0_1[] = { |
| 59 | { ATF_NOFLAGS, 0, offsetof(struct TestType_16P0, common), |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 60 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 61 | .tag_mode = 0, |
vlm | e0fea71 | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 62 | .type = &asn_DEF_NativeInteger, |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 63 | .memb_constraints = memb_common_constraint_1, |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 64 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 65 | .default_value = 0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 66 | .name = "common" |
| 67 | }, |
| 68 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 69 | static ber_tlv_tag_t asn_DEF_TestType_16P0_tags_1[] = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 70 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 71 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 72 | static asn_TYPE_tag2member_t asn_MAP_TestType_16P0_tag2el_1[] = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 73 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* common at 20 */ |
| 74 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 75 | static asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1 = { |
| 76 | sizeof(struct TestType_16P0), |
| 77 | offsetof(struct TestType_16P0, _asn_ctx), |
| 78 | asn_MAP_TestType_16P0_tag2el_1, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 79 | 1, /* Count of tags in the map */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 80 | 0, 0, 0, /* Optional elements (not needed) */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 81 | -1, /* Start extensions */ |
| 82 | -1 /* Stop extensions */ |
| 83 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 84 | asn_TYPE_descriptor_t asn_DEF_TestType_16P0 = { |
| 85 | "TestType", |
| 86 | "TestType", |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 87 | SEQUENCE_free, |
| 88 | SEQUENCE_print, |
| 89 | SEQUENCE_constraint, |
| 90 | SEQUENCE_decode_ber, |
| 91 | SEQUENCE_encode_der, |
| 92 | SEQUENCE_decode_xer, |
| 93 | SEQUENCE_encode_xer, |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 94 | 0, /* No PER decoder, -gen-PER to enable */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 95 | 0, /* Use generic outmost tag fetcher */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 96 | asn_DEF_TestType_16P0_tags_1, |
| 97 | sizeof(asn_DEF_TestType_16P0_tags_1) |
| 98 | /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */ |
| 99 | asn_DEF_TestType_16P0_tags_1, /* Same as above */ |
| 100 | sizeof(asn_DEF_TestType_16P0_tags_1) |
| 101 | /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 102 | 0, /* No PER visible constraints */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 103 | asn_MBR_TestType_16P0_1, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 104 | 1, /* Elements count */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 105 | &asn_SPC_TestType_16P0_specs_1 /* Additional specs */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 106 | }; |
| 107 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 108 | static asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = { |
| 109 | { ATF_NOFLAGS, 0, offsetof(struct TestType_16P1, common), |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 110 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 111 | .tag_mode = 0, |
vlm | e0fea71 | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 112 | .type = &asn_DEF_BOOLEAN, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 113 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 114 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 115 | .default_value = 0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 116 | .name = "common" |
| 117 | }, |
| 118 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 119 | static ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 120 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 121 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 122 | static asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 123 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common at 21 */ |
| 124 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 125 | static asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = { |
| 126 | sizeof(struct TestType_16P1), |
| 127 | offsetof(struct TestType_16P1, _asn_ctx), |
| 128 | asn_MAP_TestType_16P1_tag2el_3, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 129 | 1, /* Count of tags in the map */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 130 | 0, 0, 0, /* Optional elements (not needed) */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 131 | -1, /* Start extensions */ |
| 132 | -1 /* Stop extensions */ |
| 133 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 134 | asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = { |
| 135 | "TestType", |
| 136 | "TestType", |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 137 | SEQUENCE_free, |
| 138 | SEQUENCE_print, |
| 139 | SEQUENCE_constraint, |
| 140 | SEQUENCE_decode_ber, |
| 141 | SEQUENCE_encode_der, |
| 142 | SEQUENCE_decode_xer, |
| 143 | SEQUENCE_encode_xer, |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 144 | 0, /* No PER decoder, -gen-PER to enable */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 145 | 0, /* Use generic outmost tag fetcher */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 146 | asn_DEF_TestType_16P1_tags_3, |
| 147 | sizeof(asn_DEF_TestType_16P1_tags_3) |
| 148 | /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */ |
| 149 | asn_DEF_TestType_16P1_tags_3, /* Same as above */ |
| 150 | sizeof(asn_DEF_TestType_16P1_tags_3) |
| 151 | /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 152 | 0, /* No PER visible constraints */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 153 | asn_MBR_TestType_16P1_3, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 154 | 1, /* Elements count */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 155 | &asn_SPC_TestType_16P1_specs_3 /* Additional specs */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 156 | }; |
| 157 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 158 | |
| 159 | /*** <<< INCLUDES [TestChoice] >>> ***/ |
| 160 | |
| 161 | #include <TestType.h> |
| 162 | #include <constr_CHOICE.h> |
| 163 | |
| 164 | /*** <<< DEPS [TestChoice] >>> ***/ |
| 165 | |
| 166 | typedef enum TestChoice_PR { |
| 167 | TestChoice_PR_NOTHING, /* No components present */ |
| 168 | TestChoice_PR_type1, |
| 169 | TestChoice_PR_type2, |
| 170 | } TestChoice_PR; |
| 171 | |
| 172 | /*** <<< TYPE-DECLS [TestChoice] >>> ***/ |
| 173 | |
| 174 | typedef struct TestChoice { |
| 175 | TestChoice_PR present; |
| 176 | union TestChoice_u { |
| 177 | TestType_16P0_t type1; |
| 178 | TestType_16P1_t type2; |
| 179 | } choice; |
| 180 | |
| 181 | /* Context for parsing across buffer boundaries */ |
| 182 | asn_struct_ctx_t _asn_ctx; |
| 183 | } TestChoice_t; |
| 184 | |
| 185 | /*** <<< FUNC-DECLS [TestChoice] >>> ***/ |
| 186 | |
| 187 | extern asn_TYPE_descriptor_t asn_DEF_TestChoice; |
| 188 | |
| 189 | /*** <<< STAT-DEFS [TestChoice] >>> ***/ |
| 190 | |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 191 | static asn_TYPE_member_t asn_MBR_TestChoice_1[] = { |
| 192 | { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type1), |
| 193 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 194 | .tag_mode = 0, |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 195 | .type = &asn_DEF_TestType_16P0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 196 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 197 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 198 | .default_value = 0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 199 | .name = "type1" |
| 200 | }, |
| 201 | { ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type2), |
| 202 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 203 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 204 | .type = &asn_DEF_TestType_16P1, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 205 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 206 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 207 | .default_value = 0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 208 | .name = "type2" |
| 209 | }, |
| 210 | }; |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 211 | static asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = { |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 212 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 at 20 */ |
| 213 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 at 21 */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 214 | }; |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 215 | static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 216 | sizeof(struct TestChoice), |
| 217 | offsetof(struct TestChoice, _asn_ctx), |
| 218 | offsetof(struct TestChoice, present), |
| 219 | sizeof(((struct TestChoice *)0)->present), |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 220 | asn_MAP_TestChoice_tag2el_1, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 221 | 2, /* Count of tags in the map */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 222 | .canonical_order = 0, |
| 223 | .ext_start = -1 /* Extensions start */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 224 | }; |
| 225 | asn_TYPE_descriptor_t asn_DEF_TestChoice = { |
| 226 | "TestChoice", |
| 227 | "TestChoice", |
| 228 | CHOICE_free, |
| 229 | CHOICE_print, |
| 230 | CHOICE_constraint, |
| 231 | CHOICE_decode_ber, |
| 232 | CHOICE_encode_der, |
| 233 | CHOICE_decode_xer, |
| 234 | CHOICE_encode_xer, |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 235 | 0, /* No PER decoder, -gen-PER to enable */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 236 | CHOICE_outmost_tag, |
| 237 | 0, /* No effective tags (pointer) */ |
| 238 | 0, /* No effective tags (count) */ |
| 239 | 0, /* No tags (pointer) */ |
| 240 | 0, /* No tags (count) */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 241 | 0, /* No PER visible constraints */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 242 | asn_MBR_TestChoice_1, |
| 243 | 2, /* Elements count */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 244 | &asn_SPC_TestChoice_specs_1 /* Additional specs */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 245 | }; |
| 246 | |
| 247 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 248 | /*** <<< INCLUDES [AutoType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 249 | |
vlm | a33a216 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 250 | #include <NativeInteger.h> |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 251 | #include <constr_SEQUENCE.h> |
| 252 | #include <BOOLEAN.h> |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 253 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 254 | /*** <<< TYPE-DECLS [AutoType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 255 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 256 | typedef struct AutoType_34P0 { |
| 257 | long common; |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 258 | |
| 259 | /* Context for parsing across buffer boundaries */ |
| 260 | asn_struct_ctx_t _asn_ctx; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 261 | } AutoType_34P0_t; |
| 262 | typedef struct AutoType_34P1 { |
| 263 | BOOLEAN_t common; |
| 264 | |
| 265 | /* Context for parsing across buffer boundaries */ |
| 266 | asn_struct_ctx_t _asn_ctx; |
| 267 | } AutoType_34P1_t; |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 268 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 269 | /*** <<< FUNC-DECLS [AutoType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 270 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 271 | extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0; |
| 272 | extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1; |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 273 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 274 | /*** <<< CODE [AutoType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 275 | |
| 276 | static int |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 277 | memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 278 | asn_app_consume_bytes_f *app_errlog, void *app_key) { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 279 | long value; |
| 280 | |
| 281 | if(!sptr) { |
| 282 | _ASN_ERRLOG(app_errlog, app_key, |
| 283 | "%s: value not given (%s:%d)", |
| 284 | td->name, __FILE__, __LINE__); |
| 285 | return -1; |
| 286 | } |
| 287 | |
vlm | a33a216 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 288 | value = *(const long *)sptr; |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 289 | |
| 290 | if((value == 0)) { |
| 291 | /* Constraint check succeeded */ |
| 292 | return 0; |
| 293 | } else { |
| 294 | _ASN_ERRLOG(app_errlog, app_key, |
| 295 | "%s: constraint failed (%s:%d)", |
| 296 | td->name, __FILE__, __LINE__); |
| 297 | return -1; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | static int |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 302 | memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 303 | asn_app_consume_bytes_f *app_errlog, void *app_key) { |
| 304 | BOOLEAN_t value; |
| 305 | |
| 306 | if(!sptr) { |
| 307 | _ASN_ERRLOG(app_errlog, app_key, |
| 308 | "%s: value not given (%s:%d)", |
| 309 | td->name, __FILE__, __LINE__); |
| 310 | return -1; |
| 311 | } |
| 312 | |
| 313 | value = (*(const long *)sptr) ? 1 : 0; |
| 314 | |
| 315 | if((value <= 0)) { |
| 316 | /* Constraint check succeeded */ |
| 317 | return 0; |
| 318 | } else { |
| 319 | _ASN_ERRLOG(app_errlog, app_key, |
| 320 | "%s: constraint failed (%s:%d)", |
| 321 | td->name, __FILE__, __LINE__); |
| 322 | return -1; |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 327 | /*** <<< STAT-DEFS [AutoType] >>> ***/ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 328 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 329 | static asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = { |
| 330 | { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common), |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 331 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 332 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
vlm | e0fea71 | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 333 | .type = &asn_DEF_NativeInteger, |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 334 | .memb_constraints = memb_common_constraint_1, |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 335 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 336 | .default_value = 0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 337 | .name = "common" |
| 338 | }, |
| 339 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 340 | static ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 341 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 342 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 343 | static asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 344 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common at 37 */ |
| 345 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 346 | static asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = { |
| 347 | sizeof(struct AutoType_34P0), |
| 348 | offsetof(struct AutoType_34P0, _asn_ctx), |
| 349 | asn_MAP_AutoType_34P0_tag2el_1, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 350 | 1, /* Count of tags in the map */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 351 | 0, 0, 0, /* Optional elements (not needed) */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 352 | -1, /* Start extensions */ |
| 353 | -1 /* Stop extensions */ |
| 354 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 355 | asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = { |
| 356 | "AutoType", |
| 357 | "AutoType", |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 358 | SEQUENCE_free, |
| 359 | SEQUENCE_print, |
| 360 | SEQUENCE_constraint, |
| 361 | SEQUENCE_decode_ber, |
| 362 | SEQUENCE_encode_der, |
| 363 | SEQUENCE_decode_xer, |
| 364 | SEQUENCE_encode_xer, |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 365 | 0, /* No PER decoder, -gen-PER to enable */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 366 | 0, /* Use generic outmost tag fetcher */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 367 | asn_DEF_AutoType_34P0_tags_1, |
| 368 | sizeof(asn_DEF_AutoType_34P0_tags_1) |
| 369 | /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */ |
| 370 | asn_DEF_AutoType_34P0_tags_1, /* Same as above */ |
| 371 | sizeof(asn_DEF_AutoType_34P0_tags_1) |
| 372 | /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 373 | 0, /* No PER visible constraints */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 374 | asn_MBR_AutoType_34P0_1, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 375 | 1, /* Elements count */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 376 | &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 377 | }; |
| 378 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 379 | static asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = { |
| 380 | { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common), |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 381 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 382 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
vlm | e0fea71 | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 383 | .type = &asn_DEF_BOOLEAN, |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 384 | .memb_constraints = memb_common_constraint_3, |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 385 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 386 | .default_value = 0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 387 | .name = "common" |
| 388 | }, |
| 389 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 390 | static ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 391 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 392 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 393 | static asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 394 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common at 38 */ |
| 395 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 396 | static asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = { |
| 397 | sizeof(struct AutoType_34P1), |
| 398 | offsetof(struct AutoType_34P1, _asn_ctx), |
| 399 | asn_MAP_AutoType_34P1_tag2el_3, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 400 | 1, /* Count of tags in the map */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 401 | 0, 0, 0, /* Optional elements (not needed) */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 402 | -1, /* Start extensions */ |
| 403 | -1 /* Stop extensions */ |
| 404 | }; |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 405 | asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = { |
| 406 | "AutoType", |
| 407 | "AutoType", |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 408 | SEQUENCE_free, |
| 409 | SEQUENCE_print, |
| 410 | SEQUENCE_constraint, |
| 411 | SEQUENCE_decode_ber, |
| 412 | SEQUENCE_encode_der, |
| 413 | SEQUENCE_decode_xer, |
| 414 | SEQUENCE_encode_xer, |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 415 | 0, /* No PER decoder, -gen-PER to enable */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 416 | 0, /* Use generic outmost tag fetcher */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 417 | asn_DEF_AutoType_34P1_tags_3, |
| 418 | sizeof(asn_DEF_AutoType_34P1_tags_3) |
| 419 | /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */ |
| 420 | asn_DEF_AutoType_34P1_tags_3, /* Same as above */ |
| 421 | sizeof(asn_DEF_AutoType_34P1_tags_3) |
| 422 | /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 423 | 0, /* No PER visible constraints */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 424 | asn_MBR_AutoType_34P1_3, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 425 | 1, /* Elements count */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 426 | &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 427 | }; |
| 428 | |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 429 | |
| 430 | /*** <<< INCLUDES [AutoChoice] >>> ***/ |
| 431 | |
| 432 | #include <AutoType.h> |
| 433 | #include <constr_CHOICE.h> |
| 434 | |
| 435 | /*** <<< DEPS [AutoChoice] >>> ***/ |
| 436 | |
| 437 | typedef enum AutoChoice_PR { |
| 438 | AutoChoice_PR_NOTHING, /* No components present */ |
| 439 | AutoChoice_PR_type1, |
| 440 | AutoChoice_PR_type2, |
| 441 | } AutoChoice_PR; |
| 442 | |
| 443 | /*** <<< TYPE-DECLS [AutoChoice] >>> ***/ |
| 444 | |
| 445 | typedef struct AutoChoice { |
| 446 | AutoChoice_PR present; |
| 447 | union AutoChoice_u { |
| 448 | AutoType_34P0_t type1; |
| 449 | AutoType_34P1_t type2; |
| 450 | } choice; |
| 451 | |
| 452 | /* Context for parsing across buffer boundaries */ |
| 453 | asn_struct_ctx_t _asn_ctx; |
| 454 | } AutoChoice_t; |
| 455 | |
| 456 | /*** <<< FUNC-DECLS [AutoChoice] >>> ***/ |
| 457 | |
| 458 | extern asn_TYPE_descriptor_t asn_DEF_AutoChoice; |
| 459 | |
| 460 | /*** <<< STAT-DEFS [AutoChoice] >>> ***/ |
| 461 | |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 462 | static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = { |
| 463 | { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type1), |
| 464 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 465 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 466 | .type = &asn_DEF_AutoType_34P0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 467 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 468 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 469 | .default_value = 0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 470 | .name = "type1" |
| 471 | }, |
| 472 | { ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type2), |
| 473 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 474 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 475 | .type = &asn_DEF_AutoType_34P1, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 476 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 477 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 478 | .default_value = 0, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 479 | .name = "type2" |
| 480 | }, |
| 481 | }; |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 482 | static asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = { |
vlm | 0c6d381 | 2006-03-21 03:40:38 +0000 | [diff] [blame^] | 483 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 at 37 */ |
| 484 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 at 38 */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 485 | }; |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 486 | static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = { |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 487 | sizeof(struct AutoChoice), |
| 488 | offsetof(struct AutoChoice, _asn_ctx), |
| 489 | offsetof(struct AutoChoice, present), |
| 490 | sizeof(((struct AutoChoice *)0)->present), |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 491 | asn_MAP_AutoChoice_tag2el_1, |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 492 | 2, /* Count of tags in the map */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 493 | .canonical_order = 0, |
| 494 | .ext_start = -1 /* Extensions start */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 495 | }; |
| 496 | asn_TYPE_descriptor_t asn_DEF_AutoChoice = { |
| 497 | "AutoChoice", |
| 498 | "AutoChoice", |
| 499 | CHOICE_free, |
| 500 | CHOICE_print, |
| 501 | CHOICE_constraint, |
| 502 | CHOICE_decode_ber, |
| 503 | CHOICE_encode_der, |
| 504 | CHOICE_decode_xer, |
| 505 | CHOICE_encode_xer, |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 506 | 0, /* No PER decoder, -gen-PER to enable */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 507 | CHOICE_outmost_tag, |
| 508 | 0, /* No effective tags (pointer) */ |
| 509 | 0, /* No effective tags (count) */ |
| 510 | 0, /* No tags (pointer) */ |
| 511 | 0, /* No tags (count) */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 512 | 0, /* No PER visible constraints */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 513 | asn_MBR_AutoChoice_1, |
| 514 | 2, /* Elements count */ |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 515 | &asn_SPC_AutoChoice_specs_1 /* Additional specs */ |
vlm | 1a9741e | 2005-07-03 05:27:19 +0000 | [diff] [blame] | 516 | }; |
| 517 | |