2 /*** <<< INCLUDES [Narrow] >>> ***/
4 #include <NativeInteger.h>
5 #include <constr_SEQUENCE.h>
7 /*** <<< TYPE-DECLS [Narrow] >>> ***/
9 typedef struct Narrow_15P0 {
10 long *narrow1; /* DEFAULT 3 */
12 long *narrow3; /* OPTIONAL */
14 /* Context for parsing across buffer boundaries */
15 asn_struct_ctx_t _asn_ctx;
18 /*** <<< FUNC-DECLS [Narrow] >>> ***/
20 extern asn_TYPE_descriptor_t asn_DEF_Narrow_15P0;
21 extern asn_SEQUENCE_specifics_t asn_SPC_Narrow_15P0_specs_1;
22 extern asn_TYPE_member_t asn_MBR_Narrow_15P0_1[3];
24 /*** <<< CODE [Narrow] >>> ***/
27 memb_narrow1_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
28 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__);
38 value = *(const long *)sptr;
40 if((value >= 1 && value <= 5)) {
41 /* Constraint check succeeded */
44 ASN__CTFAIL(app_key, td, sptr,
45 "%s: constraint failed (%s:%d)",
46 td->name, __FILE__, __LINE__);
52 memb_narrow2_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
53 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
57 ASN__CTFAIL(app_key, td, sptr,
58 "%s: value not given (%s:%d)",
59 td->name, __FILE__, __LINE__);
63 value = *(const long *)sptr;
65 if((value >= 2 && value <= 5)) {
66 /* Constraint check succeeded */
69 ASN__CTFAIL(app_key, td, sptr,
70 "%s: constraint failed (%s:%d)",
71 td->name, __FILE__, __LINE__);
77 memb_narrow3_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 >= 3 && value <= 5)) {
91 /* Constraint check succeeded */
94 ASN__CTFAIL(app_key, td, sptr,
95 "%s: constraint failed (%s:%d)",
96 td->name, __FILE__, __LINE__);
102 /*** <<< STAT-DEFS [Narrow] >>> ***/
104 static int asn_DFL_2_cmp_3(const void *sptr) {
105 const long *st = sptr;
108 return -1; /* No value is not a default value */
111 /* Test default value 3 */
114 static int asn_DFL_2_set_3(void **sptr) {
118 st = (*sptr = CALLOC(1, sizeof(*st)));
122 /* Install default value 3 */
126 asn_TYPE_member_t asn_MBR_Narrow_15P0_1[] = {
127 { ATF_POINTER, 1, offsetof(struct Narrow_15P0, narrow1),
128 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
130 .type = &asn_DEF_NativeInteger,
132 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_narrow1_constraint_1 },
133 .default_value_cmp = &asn_DFL_2_cmp_3, /* Compare DEFAULT 3 */
134 .default_value_set = &asn_DFL_2_set_3, /* Set DEFAULT 3 */
137 { ATF_NOFLAGS, 0, offsetof(struct Narrow_15P0, narrow2),
138 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
139 .tag_mode = +1, /* EXPLICIT tag at current level */
140 .type = &asn_DEF_NativeInteger,
142 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_narrow2_constraint_1 },
143 0, 0, /* No default value */
146 { ATF_POINTER, 1, offsetof(struct Narrow_15P0, narrow3),
147 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
148 .tag_mode = +1, /* EXPLICIT tag at current level */
149 .type = &asn_DEF_NativeInteger,
151 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_narrow3_constraint_1 },
152 0, 0, /* No default value */
156 static const ber_tlv_tag_t asn_DEF_Narrow_15P0_tags_1[] = {
157 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
159 static const asn_TYPE_tag2member_t asn_MAP_Narrow_15P0_tag2el_1[] = {
160 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* narrow1 */
161 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* narrow2 */
162 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 } /* narrow3 */
164 asn_SEQUENCE_specifics_t asn_SPC_Narrow_15P0_specs_1 = {
165 sizeof(struct Narrow_15P0),
166 offsetof(struct Narrow_15P0, _asn_ctx),
167 .tag2el = asn_MAP_Narrow_15P0_tag2el_1,
168 .tag2el_count = 3, /* Count of tags in the map */
169 0, 0, 0, /* Optional elements (not needed) */
170 -1, /* First extension addition */
172 asn_TYPE_descriptor_t asn_DEF_Narrow_15P0 = {
176 asn_DEF_Narrow_15P0_tags_1,
177 sizeof(asn_DEF_Narrow_15P0_tags_1)
178 /sizeof(asn_DEF_Narrow_15P0_tags_1[0]), /* 1 */
179 asn_DEF_Narrow_15P0_tags_1, /* Same as above */
180 sizeof(asn_DEF_Narrow_15P0_tags_1)
181 /sizeof(asn_DEF_Narrow_15P0_tags_1[0]), /* 1 */
182 { 0, 0, SEQUENCE_constraint },
183 asn_MBR_Narrow_15P0_1,
184 3, /* Elements count */
185 &asn_SPC_Narrow_15P0_specs_1 /* Additional specs */
189 /*** <<< INCLUDES [NarrowInteger] >>> ***/
193 /*** <<< TYPE-DECLS [NarrowInteger] >>> ***/
195 typedef Narrow_15P0_t NarrowInteger_t;
197 /*** <<< FUNC-DECLS [NarrowInteger] >>> ***/
199 extern asn_TYPE_descriptor_t asn_DEF_NarrowInteger;
200 asn_struct_free_f NarrowInteger_free;
201 asn_struct_print_f NarrowInteger_print;
202 asn_constr_check_f NarrowInteger_constraint;
203 ber_type_decoder_f NarrowInteger_decode_ber;
204 der_type_encoder_f NarrowInteger_encode_der;
205 xer_type_decoder_f NarrowInteger_decode_xer;
206 xer_type_encoder_f NarrowInteger_encode_xer;
208 /*** <<< CODE [NarrowInteger] >>> ***/
211 * This type is implemented using Narrow_15P0,
212 * so here we adjust the DEF accordingly.
215 /*** <<< STAT-DEFS [NarrowInteger] >>> ***/
217 static const ber_tlv_tag_t asn_DEF_NarrowInteger_tags_1[] = {
218 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
220 asn_TYPE_descriptor_t asn_DEF_NarrowInteger = {
224 asn_DEF_NarrowInteger_tags_1,
225 sizeof(asn_DEF_NarrowInteger_tags_1)
226 /sizeof(asn_DEF_NarrowInteger_tags_1[0]), /* 1 */
227 asn_DEF_NarrowInteger_tags_1, /* Same as above */
228 sizeof(asn_DEF_NarrowInteger_tags_1)
229 /sizeof(asn_DEF_NarrowInteger_tags_1[0]), /* 1 */
230 { 0, 0, SEQUENCE_constraint },
231 asn_MBR_Narrow_15P0_1,
232 3, /* Elements count */
233 &asn_SPC_Narrow_15P0_specs_1 /* Additional specs */