2 /*** <<< INCLUDES [T] >>> ***/
4 #include <NativeInteger.h>
5 #include <constr_SEQUENCE.h>
7 /*** <<< TYPE-DECLS [T] >>> ***/
12 unsigned long unsigned32;
13 unsigned long unsplit32;
15 /* Context for parsing across buffer boundaries */
16 asn_struct_ctx_t _asn_ctx;
19 /*** <<< FUNC-DECLS [T] >>> ***/
21 /* extern asn_TYPE_descriptor_t asn_DEF_unsigned32_4; // (Use -fall-defs-global to expose) */
22 /* extern asn_TYPE_descriptor_t asn_DEF_unsplit32_5; // (Use -fall-defs-global to expose) */
23 extern asn_TYPE_descriptor_t asn_DEF_T;
25 /*** <<< CODE [T] >>> ***/
28 unsigned32_4_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
29 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
32 ASN__CTFAIL(app_key, td, sptr,
33 "%s: value not given (%s:%d)",
34 td->name, __FILE__, __LINE__);
39 /* Constraint check succeeded */
44 * This type is implemented using NativeInteger,
45 * so here we adjust the DEF accordingly.
48 unsplit32_5_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
49 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
53 ASN__CTFAIL(app_key, td, sptr,
54 "%s: value not given (%s:%d)",
55 td->name, __FILE__, __LINE__);
59 value = *(const unsigned long *)sptr;
61 if(((value >= 5 && value <= 500) || (value >= 600 && value <= 4294967290))) {
62 /* Constraint check succeeded */
65 ASN__CTFAIL(app_key, td, sptr,
66 "%s: constraint failed (%s:%d)",
67 td->name, __FILE__, __LINE__);
73 * This type is implemented using NativeInteger,
74 * so here we adjust the DEF accordingly.
77 memb_small32range_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
78 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
82 ASN__CTFAIL(app_key, td, sptr,
83 "%s: value not given (%s:%d)",
84 td->name, __FILE__, __LINE__);
88 value = *(const long *)sptr;
90 if((value >= -2000000000 && value <= 2000000000)) {
91 /* Constraint check succeeded */
94 ASN__CTFAIL(app_key, td, sptr,
95 "%s: constraint failed (%s:%d)",
96 td->name, __FILE__, __LINE__);
102 memb_full32range_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
103 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
107 ASN__CTFAIL(app_key, td, sptr,
108 "%s: value not given (%s:%d)",
109 td->name, __FILE__, __LINE__);
113 value = *(const long *)sptr;
115 if((value >= (-2147483647L - 1) && value <= 2147483647)) {
116 /* Constraint check succeeded */
119 ASN__CTFAIL(app_key, td, sptr,
120 "%s: constraint failed (%s:%d)",
121 td->name, __FILE__, __LINE__);
127 memb_unsigned32_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
128 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
131 ASN__CTFAIL(app_key, td, sptr,
132 "%s: value not given (%s:%d)",
133 td->name, __FILE__, __LINE__);
138 /* Constraint check succeeded */
143 memb_unsplit32_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
144 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
148 ASN__CTFAIL(app_key, td, sptr,
149 "%s: value not given (%s:%d)",
150 td->name, __FILE__, __LINE__);
154 value = *(const unsigned long *)sptr;
156 if(((value >= 5 && value <= 500) || (value >= 600 && value <= 4294967290))) {
157 /* Constraint check succeeded */
160 ASN__CTFAIL(app_key, td, sptr,
161 "%s: constraint failed (%s:%d)",
162 td->name, __FILE__, __LINE__);
168 /*** <<< CTDEFS [T] >>> ***/
170 static asn_per_constraints_t asn_PER_type_unsigned32_constr_4 CC_NOTUSED = {
171 { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */,
172 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
173 0, 0 /* No PER value map */
175 static asn_per_constraints_t asn_PER_type_unsplit32_constr_5 CC_NOTUSED = {
176 { APC_CONSTRAINED, 32, -1, 5, 4294967290 } /* (5..4294967290) */,
177 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
178 0, 0 /* No PER value map */
180 static asn_per_constraints_t asn_PER_memb_small32range_constr_2 CC_NOTUSED = {
181 { APC_CONSTRAINED, 32, -1, -2000000000, 2000000000 } /* (-2000000000..2000000000) */,
182 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
183 0, 0 /* No PER value map */
185 static asn_per_constraints_t asn_PER_memb_full32range_constr_3 CC_NOTUSED = {
186 { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */,
187 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
188 0, 0 /* No PER value map */
190 static asn_per_constraints_t asn_PER_memb_unsigned32_constr_4 CC_NOTUSED = {
191 { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */,
192 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
193 0, 0 /* No PER value map */
195 static asn_per_constraints_t asn_PER_memb_unsplit32_constr_5 CC_NOTUSED = {
196 { APC_CONSTRAINED, 32, -1, 5, 4294967290 } /* (5..4294967290) */,
197 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
198 0, 0 /* No PER value map */
201 /*** <<< STAT-DEFS [T] >>> ***/
203 static const asn_INTEGER_specifics_t asn_SPC_unsigned32_specs_4 = {
205 0, /* Native long size */
206 1 /* Unsigned representation */
208 static const ber_tlv_tag_t asn_DEF_unsigned32_tags_4[] = {
209 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
210 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
212 static /* Use -fall-defs-global to expose */
213 asn_TYPE_descriptor_t asn_DEF_unsigned32_4 = {
216 &asn_OP_NativeInteger,
217 asn_DEF_unsigned32_tags_4,
218 sizeof(asn_DEF_unsigned32_tags_4)
219 /sizeof(asn_DEF_unsigned32_tags_4[0]) - 1, /* 1 */
220 asn_DEF_unsigned32_tags_4, /* Same as above */
221 sizeof(asn_DEF_unsigned32_tags_4)
222 /sizeof(asn_DEF_unsigned32_tags_4[0]), /* 2 */
223 { 0, &asn_PER_type_unsigned32_constr_4, unsigned32_4_constraint },
224 0, 0, /* No members */
225 &asn_SPC_unsigned32_specs_4 /* Additional specs */
228 static const asn_INTEGER_specifics_t asn_SPC_unsplit32_specs_5 = {
230 0, /* Native long size */
231 1 /* Unsigned representation */
233 static const ber_tlv_tag_t asn_DEF_unsplit32_tags_5[] = {
234 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
235 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
237 static /* Use -fall-defs-global to expose */
238 asn_TYPE_descriptor_t asn_DEF_unsplit32_5 = {
241 &asn_OP_NativeInteger,
242 asn_DEF_unsplit32_tags_5,
243 sizeof(asn_DEF_unsplit32_tags_5)
244 /sizeof(asn_DEF_unsplit32_tags_5[0]) - 1, /* 1 */
245 asn_DEF_unsplit32_tags_5, /* Same as above */
246 sizeof(asn_DEF_unsplit32_tags_5)
247 /sizeof(asn_DEF_unsplit32_tags_5[0]), /* 2 */
248 { 0, &asn_PER_type_unsplit32_constr_5, unsplit32_5_constraint },
249 0, 0, /* No members */
250 &asn_SPC_unsplit32_specs_5 /* Additional specs */
253 static asn_TYPE_member_t asn_MBR_T_1[] = {
254 { ATF_NOFLAGS, 0, offsetof(struct T, small32range),
255 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
256 .tag_mode = -1, /* IMPLICIT tag at current level */
257 .type = &asn_DEF_NativeInteger,
259 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_small32range_constr_2, .general_constraints = memb_small32range_constraint_1 },
260 0, 0, /* No default value */
261 .name = "small32range"
263 { ATF_NOFLAGS, 0, offsetof(struct T, full32range),
264 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
265 .tag_mode = -1, /* IMPLICIT tag at current level */
266 .type = &asn_DEF_NativeInteger,
268 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_full32range_constr_3, .general_constraints = memb_full32range_constraint_1 },
269 0, 0, /* No default value */
270 .name = "full32range"
272 { ATF_NOFLAGS, 0, offsetof(struct T, unsigned32),
273 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
274 .tag_mode = -1, /* IMPLICIT tag at current level */
275 .type = &asn_DEF_unsigned32_4,
277 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_unsigned32_constr_4, .general_constraints = memb_unsigned32_constraint_1 },
278 0, 0, /* No default value */
281 { ATF_NOFLAGS, 0, offsetof(struct T, unsplit32),
282 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
283 .tag_mode = -1, /* IMPLICIT tag at current level */
284 .type = &asn_DEF_unsplit32_5,
286 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_unsplit32_constr_5, .general_constraints = memb_unsplit32_constraint_1 },
287 0, 0, /* No default value */
291 static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
292 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
294 static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
295 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* small32range */
296 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* full32range */
297 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* unsigned32 */
298 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* unsplit32 */
300 static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
302 offsetof(struct T, _asn_ctx),
303 .tag2el = asn_MAP_T_tag2el_1,
304 .tag2el_count = 4, /* Count of tags in the map */
305 0, 0, 0, /* Optional elements (not needed) */
306 -1, /* First extension addition */
308 asn_TYPE_descriptor_t asn_DEF_T = {
313 sizeof(asn_DEF_T_tags_1)
314 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
315 asn_DEF_T_tags_1, /* Same as above */
316 sizeof(asn_DEF_T_tags_1)
317 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
318 { 0, 0, SEQUENCE_constraint },
320 4, /* Elements count */
321 &asn_SPC_T_specs_1 /* Additional specs */