2 /*** <<< INCLUDES [Short] >>> ***/
4 #include <NativeInteger.h>
6 /*** <<< TYPE-DECLS [Short] >>> ***/
10 /*** <<< FUNC-DECLS [Short] >>> ***/
12 extern asn_per_constraints_t asn_PER_type_Short_constr_1;
13 extern asn_TYPE_descriptor_t asn_DEF_Short;
14 asn_struct_free_f Short_free;
15 asn_struct_print_f Short_print;
16 asn_constr_check_f Short_constraint;
17 ber_type_decoder_f Short_decode_ber;
18 der_type_encoder_f Short_encode_der;
19 xer_type_decoder_f Short_decode_xer;
20 xer_type_encoder_f Short_encode_xer;
21 per_type_decoder_f Short_decode_uper;
22 per_type_encoder_f Short_encode_uper;
23 per_type_decoder_f Short_decode_aper;
24 per_type_encoder_f Short_encode_aper;
26 /*** <<< CODE [Short] >>> ***/
29 Short_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
30 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
34 ASN__CTFAIL(app_key, td, sptr,
35 "%s: value not given (%s:%d)",
36 td->name, __FILE__, __LINE__);
40 value = *(const long *)sptr;
42 if((value >= 0 && value <= 65535)) {
43 /* Constraint check succeeded */
46 ASN__CTFAIL(app_key, td, sptr,
47 "%s: constraint failed (%s:%d)",
48 td->name, __FILE__, __LINE__);
54 * This type is implemented using NativeInteger,
55 * so here we adjust the DEF accordingly.
58 /*** <<< CTDEFS [Short] >>> ***/
60 asn_per_constraints_t asn_PER_type_Short_constr_1 CC_NOTUSED = {
61 { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */,
62 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
63 0, 0 /* No PER value map */
66 /*** <<< STAT-DEFS [Short] >>> ***/
68 static const ber_tlv_tag_t asn_DEF_Short_tags_1[] = {
69 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
71 asn_TYPE_descriptor_t asn_DEF_Short = {
74 &asn_OP_NativeInteger,
76 sizeof(asn_DEF_Short_tags_1)
77 /sizeof(asn_DEF_Short_tags_1[0]), /* 1 */
78 asn_DEF_Short_tags_1, /* Same as above */
79 sizeof(asn_DEF_Short_tags_1)
80 /sizeof(asn_DEF_Short_tags_1[0]), /* 1 */
81 { 0, &asn_PER_type_Short_constr_1, Short_constraint },
82 0, 0, /* No members */
87 /*** <<< INCLUDES [Alias] >>> ***/
91 /*** <<< TYPE-DECLS [Alias] >>> ***/
93 typedef Short_t Alias_t;
95 /*** <<< FUNC-DECLS [Alias] >>> ***/
97 extern asn_per_constraints_t asn_PER_type_Alias_constr_1;
98 extern asn_TYPE_descriptor_t asn_DEF_Alias;
99 asn_struct_free_f Alias_free;
100 asn_struct_print_f Alias_print;
101 asn_constr_check_f Alias_constraint;
102 ber_type_decoder_f Alias_decode_ber;
103 der_type_encoder_f Alias_encode_der;
104 xer_type_decoder_f Alias_decode_xer;
105 xer_type_encoder_f Alias_encode_xer;
106 per_type_decoder_f Alias_decode_uper;
107 per_type_encoder_f Alias_encode_uper;
108 per_type_decoder_f Alias_decode_aper;
109 per_type_encoder_f Alias_encode_aper;
111 /*** <<< CODE [Alias] >>> ***/
114 Alias_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
115 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
119 ASN__CTFAIL(app_key, td, sptr,
120 "%s: value not given (%s:%d)",
121 td->name, __FILE__, __LINE__);
125 value = *(const long *)sptr;
127 if((value >= 0 && value <= 65535)) {
128 /* Constraint check succeeded */
131 ASN__CTFAIL(app_key, td, sptr,
132 "%s: constraint failed (%s:%d)",
133 td->name, __FILE__, __LINE__);
139 * This type is implemented using Short,
140 * so here we adjust the DEF accordingly.
143 /*** <<< CTDEFS [Alias] >>> ***/
145 asn_per_constraints_t asn_PER_type_Alias_constr_1 CC_NOTUSED = {
146 { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */,
147 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
148 0, 0 /* No PER value map */
151 /*** <<< STAT-DEFS [Alias] >>> ***/
153 static const ber_tlv_tag_t asn_DEF_Alias_tags_1[] = {
154 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
156 asn_TYPE_descriptor_t asn_DEF_Alias = {
159 &asn_OP_NativeInteger,
160 asn_DEF_Alias_tags_1,
161 sizeof(asn_DEF_Alias_tags_1)
162 /sizeof(asn_DEF_Alias_tags_1[0]), /* 1 */
163 asn_DEF_Alias_tags_1, /* Same as above */
164 sizeof(asn_DEF_Alias_tags_1)
165 /sizeof(asn_DEF_Alias_tags_1[0]), /* 1 */
166 { 0, &asn_PER_type_Alias_constr_1, Alias_constraint },
167 0, 0, /* No members */
172 /*** <<< INCLUDES [Soo] >>> ***/
174 #include <NativeInteger.h>
177 #include <constr_SEQUENCE.h>
179 /*** <<< TYPE-DECLS [Soo] >>> ***/
186 /* Context for parsing across buffer boundaries */
187 asn_struct_ctx_t _asn_ctx;
190 /*** <<< FUNC-DECLS [Soo] >>> ***/
192 extern asn_TYPE_descriptor_t asn_DEF_Soo;
194 /*** <<< CODE [Soo] >>> ***/
197 memb_foo_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
198 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
202 ASN__CTFAIL(app_key, td, sptr,
203 "%s: value not given (%s:%d)",
204 td->name, __FILE__, __LINE__);
208 value = *(const long *)sptr;
210 if((value >= 0 && value <= 65535)) {
211 /* Constraint check succeeded */
214 ASN__CTFAIL(app_key, td, sptr,
215 "%s: constraint failed (%s:%d)",
216 td->name, __FILE__, __LINE__);
222 /*** <<< CTDEFS [Soo] >>> ***/
224 static asn_per_constraints_t asn_PER_memb_foo_constr_2 CC_NOTUSED = {
225 { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */,
226 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
227 0, 0 /* No PER value map */
230 /*** <<< STAT-DEFS [Soo] >>> ***/
232 static asn_TYPE_member_t asn_MBR_Soo_1[] = {
233 { ATF_NOFLAGS, 0, offsetof(struct Soo, foo),
234 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
236 .type = &asn_DEF_NativeInteger,
238 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_foo_constr_2, .general_constraints = memb_foo_constraint_1 },
239 0, 0, /* No default value */
242 { ATF_NOFLAGS, 0, offsetof(struct Soo, bar),
243 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
245 .type = &asn_DEF_Short,
247 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
248 0, 0, /* No default value */
251 { ATF_NOFLAGS, 0, offsetof(struct Soo, baz),
252 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
254 .type = &asn_DEF_Alias,
256 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
257 0, 0, /* No default value */
261 static const ber_tlv_tag_t asn_DEF_Soo_tags_1[] = {
262 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
264 static const asn_TYPE_tag2member_t asn_MAP_Soo_tag2el_1[] = {
265 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* foo */
266 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* bar */
267 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* baz */
269 static asn_SEQUENCE_specifics_t asn_SPC_Soo_specs_1 = {
271 offsetof(struct Soo, _asn_ctx),
272 .tag2el = asn_MAP_Soo_tag2el_1,
273 .tag2el_count = 3, /* Count of tags in the map */
274 0, 0, 0, /* Optional elements (not needed) */
275 -1, /* First extension addition */
277 asn_TYPE_descriptor_t asn_DEF_Soo = {
282 sizeof(asn_DEF_Soo_tags_1)
283 /sizeof(asn_DEF_Soo_tags_1[0]), /* 1 */
284 asn_DEF_Soo_tags_1, /* Same as above */
285 sizeof(asn_DEF_Soo_tags_1)
286 /sizeof(asn_DEF_Soo_tags_1[0]), /* 1 */
287 { 0, 0, SEQUENCE_constraint },
289 3, /* Elements count */
290 &asn_SPC_Soo_specs_1 /* Additional specs */