2 /*** <<< INCLUDES [Short] >>> ***/
4 #include <NativeInteger.h>
6 /*** <<< TYPE-DECLS [Short] >>> ***/
10 /*** <<< FUNC-DECLS [Short] >>> ***/
12 extern asn_TYPE_descriptor_t asn_DEF_Short;
13 asn_struct_free_f Short_free;
14 asn_struct_print_f Short_print;
15 asn_constr_check_f Short_constraint;
16 ber_type_decoder_f Short_decode_ber;
17 der_type_encoder_f Short_encode_der;
18 xer_type_decoder_f Short_decode_xer;
19 xer_type_encoder_f Short_encode_xer;
20 oer_type_decoder_f Short_decode_oer;
21 oer_type_encoder_f Short_encode_oer;
23 /*** <<< CODE [Short] >>> ***/
26 Short_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
27 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
31 ASN__CTFAIL(app_key, td, sptr,
32 "%s: value not given (%s:%d)",
33 td->name, __FILE__, __LINE__);
37 value = *(const long *)sptr;
39 if((value >= 0 && value <= 65535)) {
40 /* Constraint check succeeded */
43 ASN__CTFAIL(app_key, td, sptr,
44 "%s: constraint failed (%s:%d)",
45 td->name, __FILE__, __LINE__);
51 * This type is implemented using NativeInteger,
52 * so here we adjust the DEF accordingly.
55 /*** <<< CTDEFS [Short] >>> ***/
57 static asn_oer_constraints_t asn_OER_type_Short_constr_1 CC_NOTUSED = {
58 { 2, 1 } /* (0..65535) */,
61 /*** <<< STAT-DEFS [Short] >>> ***/
63 static const ber_tlv_tag_t asn_DEF_Short_tags_1[] = {
64 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
66 asn_TYPE_descriptor_t asn_DEF_Short = {
69 &asn_OP_NativeInteger,
71 sizeof(asn_DEF_Short_tags_1)
72 /sizeof(asn_DEF_Short_tags_1[0]), /* 1 */
73 asn_DEF_Short_tags_1, /* Same as above */
74 sizeof(asn_DEF_Short_tags_1)
75 /sizeof(asn_DEF_Short_tags_1[0]), /* 1 */
76 { &asn_OER_type_Short_constr_1, 0, Short_constraint },
77 0, 0, /* No members */
82 /*** <<< INCLUDES [Alias] >>> ***/
86 /*** <<< TYPE-DECLS [Alias] >>> ***/
88 typedef Short_t Alias_t;
90 /*** <<< FUNC-DECLS [Alias] >>> ***/
92 extern asn_TYPE_descriptor_t asn_DEF_Alias;
93 asn_struct_free_f Alias_free;
94 asn_struct_print_f Alias_print;
95 asn_constr_check_f Alias_constraint;
96 ber_type_decoder_f Alias_decode_ber;
97 der_type_encoder_f Alias_encode_der;
98 xer_type_decoder_f Alias_decode_xer;
99 xer_type_encoder_f Alias_encode_xer;
100 oer_type_decoder_f Alias_decode_oer;
101 oer_type_encoder_f Alias_encode_oer;
103 /*** <<< CODE [Alias] >>> ***/
106 Alias_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
107 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
111 ASN__CTFAIL(app_key, td, sptr,
112 "%s: value not given (%s:%d)",
113 td->name, __FILE__, __LINE__);
117 value = *(const long *)sptr;
119 if((value >= 0 && value <= 65535)) {
120 /* Constraint check succeeded */
123 ASN__CTFAIL(app_key, td, sptr,
124 "%s: constraint failed (%s:%d)",
125 td->name, __FILE__, __LINE__);
131 * This type is implemented using Short,
132 * so here we adjust the DEF accordingly.
135 /*** <<< CTDEFS [Alias] >>> ***/
137 static asn_oer_constraints_t asn_OER_type_Alias_constr_1 CC_NOTUSED = {
138 { 2, 1 } /* (0..65535) */,
141 /*** <<< STAT-DEFS [Alias] >>> ***/
143 static const ber_tlv_tag_t asn_DEF_Alias_tags_1[] = {
144 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
146 asn_TYPE_descriptor_t asn_DEF_Alias = {
149 &asn_OP_NativeInteger,
150 asn_DEF_Alias_tags_1,
151 sizeof(asn_DEF_Alias_tags_1)
152 /sizeof(asn_DEF_Alias_tags_1[0]), /* 1 */
153 asn_DEF_Alias_tags_1, /* Same as above */
154 sizeof(asn_DEF_Alias_tags_1)
155 /sizeof(asn_DEF_Alias_tags_1[0]), /* 1 */
156 { &asn_OER_type_Alias_constr_1, 0, Alias_constraint },
157 0, 0, /* No members */
162 /*** <<< INCLUDES [Soo] >>> ***/
164 #include <NativeInteger.h>
167 #include <constr_SEQUENCE.h>
169 /*** <<< TYPE-DECLS [Soo] >>> ***/
176 /* Context for parsing across buffer boundaries */
177 asn_struct_ctx_t _asn_ctx;
180 /*** <<< FUNC-DECLS [Soo] >>> ***/
182 extern asn_TYPE_descriptor_t asn_DEF_Soo;
184 /*** <<< CODE [Soo] >>> ***/
187 memb_foo_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
188 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
192 ASN__CTFAIL(app_key, td, sptr,
193 "%s: value not given (%s:%d)",
194 td->name, __FILE__, __LINE__);
198 value = *(const long *)sptr;
200 if((value >= 0 && value <= 65535)) {
201 /* Constraint check succeeded */
204 ASN__CTFAIL(app_key, td, sptr,
205 "%s: constraint failed (%s:%d)",
206 td->name, __FILE__, __LINE__);
212 /*** <<< CTDEFS [Soo] >>> ***/
214 static asn_oer_constraints_t asn_OER_memb_foo_constr_2 CC_NOTUSED = {
215 { 2, 1 } /* (0..65535) */,
218 /*** <<< STAT-DEFS [Soo] >>> ***/
220 static asn_TYPE_member_t asn_MBR_Soo_1[] = {
221 { ATF_NOFLAGS, 0, offsetof(struct Soo, foo),
222 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
224 .type = &asn_DEF_NativeInteger,
226 { .oer_constraints = &asn_OER_memb_foo_constr_2, .per_constraints = 0, .general_constraints = memb_foo_constraint_1 },
227 0, 0, /* No default value */
230 { ATF_NOFLAGS, 0, offsetof(struct Soo, bar),
231 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
233 .type = &asn_DEF_Short,
235 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
236 0, 0, /* No default value */
239 { ATF_NOFLAGS, 0, offsetof(struct Soo, baz),
240 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
242 .type = &asn_DEF_Alias,
244 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
245 0, 0, /* No default value */
249 static const ber_tlv_tag_t asn_DEF_Soo_tags_1[] = {
250 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
252 static const asn_TYPE_tag2member_t asn_MAP_Soo_tag2el_1[] = {
253 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* foo */
254 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* bar */
255 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* baz */
257 static asn_SEQUENCE_specifics_t asn_SPC_Soo_specs_1 = {
259 offsetof(struct Soo, _asn_ctx),
260 .tag2el = asn_MAP_Soo_tag2el_1,
261 .tag2el_count = 3, /* Count of tags in the map */
262 0, 0, 0, /* Optional elements (not needed) */
263 -1, /* First extension addition */
265 asn_TYPE_descriptor_t asn_DEF_Soo = {
270 sizeof(asn_DEF_Soo_tags_1)
271 /sizeof(asn_DEF_Soo_tags_1[0]), /* 1 */
272 asn_DEF_Soo_tags_1, /* Same as above */
273 sizeof(asn_DEF_Soo_tags_1)
274 /sizeof(asn_DEF_Soo_tags_1[0]), /* 1 */
275 { 0, 0, SEQUENCE_constraint },
277 3, /* Elements count */
278 &asn_SPC_Soo_specs_1 /* Additional specs */