Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/ |
| 3 | |
| 4 | #include <NativeInteger.h> |
| 5 | |
| 6 | /*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/ |
| 7 | |
| 8 | typedef long CN_IntegerUnlimited_t; |
| 9 | |
| 10 | /*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/ |
| 11 | |
| 12 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited; |
| 13 | asn_struct_free_f CN_IntegerUnlimited_free; |
| 14 | asn_struct_print_f CN_IntegerUnlimited_print; |
| 15 | asn_constr_check_f CN_IntegerUnlimited_constraint; |
| 16 | ber_type_decoder_f CN_IntegerUnlimited_decode_ber; |
| 17 | der_type_encoder_f CN_IntegerUnlimited_encode_der; |
| 18 | xer_type_decoder_f CN_IntegerUnlimited_decode_xer; |
| 19 | xer_type_encoder_f CN_IntegerUnlimited_encode_xer; |
| 20 | |
| 21 | /*** <<< CODE [CN-IntegerUnlimited] >>> ***/ |
| 22 | |
| 23 | int |
| 24 | CN_IntegerUnlimited_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 25 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 26 | /* Replace with underlying type checker */ |
| 27 | td->check_constraints = asn_DEF_NativeInteger.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 28 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | /* |
| 32 | * This type is implemented using NativeInteger, |
| 33 | * so here we adjust the DEF accordingly. |
| 34 | */ |
| 35 | static void |
| 36 | CN_IntegerUnlimited_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 37 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 38 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 39 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 40 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 41 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 42 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 43 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 44 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 45 | if(!td->per_constraints) |
| 46 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 47 | td->elements = asn_DEF_NativeInteger.elements; |
| 48 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 49 | td->specifics = asn_DEF_NativeInteger.specifics; |
| 50 | } |
| 51 | |
| 52 | void |
| 53 | CN_IntegerUnlimited_free(asn_TYPE_descriptor_t *td, |
| 54 | void *struct_ptr, int contents_only) { |
| 55 | CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); |
| 56 | td->free_struct(td, struct_ptr, contents_only); |
| 57 | } |
| 58 | |
| 59 | int |
| 60 | CN_IntegerUnlimited_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 61 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 62 | CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); |
| 63 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 64 | } |
| 65 | |
| 66 | asn_dec_rval_t |
| 67 | CN_IntegerUnlimited_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 68 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 69 | CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); |
| 70 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 71 | } |
| 72 | |
| 73 | asn_enc_rval_t |
| 74 | CN_IntegerUnlimited_encode_der(asn_TYPE_descriptor_t *td, |
| 75 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 76 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 77 | CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); |
| 78 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 79 | } |
| 80 | |
| 81 | asn_dec_rval_t |
| 82 | CN_IntegerUnlimited_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 83 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 84 | CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); |
| 85 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 86 | } |
| 87 | |
| 88 | asn_enc_rval_t |
| 89 | CN_IntegerUnlimited_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 90 | int ilevel, enum xer_encoder_flags_e flags, |
| 91 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 92 | CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td); |
| 93 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 94 | } |
| 95 | |
| 96 | |
| 97 | /*** <<< STAT-DEFS [CN-IntegerUnlimited] >>> ***/ |
| 98 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 99 | static ber_tlv_tag_t asn_DEF_CN_IntegerUnlimited_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 100 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 101 | }; |
| 102 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = { |
| 103 | "CN-IntegerUnlimited", |
| 104 | "CN-IntegerUnlimited", |
| 105 | CN_IntegerUnlimited_free, |
| 106 | CN_IntegerUnlimited_print, |
| 107 | CN_IntegerUnlimited_constraint, |
| 108 | CN_IntegerUnlimited_decode_ber, |
| 109 | CN_IntegerUnlimited_encode_der, |
| 110 | CN_IntegerUnlimited_decode_xer, |
| 111 | CN_IntegerUnlimited_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 112 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 113 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 114 | asn_DEF_CN_IntegerUnlimited_tags_1, |
| 115 | sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) |
| 116 | /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */ |
| 117 | asn_DEF_CN_IntegerUnlimited_tags_1, /* Same as above */ |
| 118 | sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) |
| 119 | /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */ |
| 120 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 121 | 0, 0, /* No members */ |
| 122 | 0 /* No specifics */ |
| 123 | }; |
| 124 | |
| 125 | |
| 126 | /*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/ |
| 127 | |
| 128 | #include <NativeInteger.h> |
| 129 | |
| 130 | /*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/ |
| 131 | |
| 132 | typedef long CN_IntegerMinMax_t; |
| 133 | |
| 134 | /*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/ |
| 135 | |
| 136 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax; |
| 137 | asn_struct_free_f CN_IntegerMinMax_free; |
| 138 | asn_struct_print_f CN_IntegerMinMax_print; |
| 139 | asn_constr_check_f CN_IntegerMinMax_constraint; |
| 140 | ber_type_decoder_f CN_IntegerMinMax_decode_ber; |
| 141 | der_type_encoder_f CN_IntegerMinMax_encode_der; |
| 142 | xer_type_decoder_f CN_IntegerMinMax_decode_xer; |
| 143 | xer_type_encoder_f CN_IntegerMinMax_encode_xer; |
| 144 | |
| 145 | /*** <<< CODE [CN-IntegerMinMax] >>> ***/ |
| 146 | |
| 147 | int |
| 148 | CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 149 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 150 | |
| 151 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 152 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 153 | "%s: value not given (%s:%d)", |
| 154 | td->name, __FILE__, __LINE__); |
| 155 | return -1; |
| 156 | } |
| 157 | |
| 158 | |
| 159 | if(1 /* No applicable constraints whatsoever */) { |
| 160 | /* Nothing is here. See below */ |
| 161 | } |
| 162 | |
| 163 | /* Replace with underlying type checker */ |
| 164 | td->check_constraints = asn_DEF_NativeInteger.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 165 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | /* |
| 169 | * This type is implemented using NativeInteger, |
| 170 | * so here we adjust the DEF accordingly. |
| 171 | */ |
| 172 | static void |
| 173 | CN_IntegerMinMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 174 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 175 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 176 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 177 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 178 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 179 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 180 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 181 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 182 | if(!td->per_constraints) |
| 183 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 184 | td->elements = asn_DEF_NativeInteger.elements; |
| 185 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 186 | td->specifics = asn_DEF_NativeInteger.specifics; |
| 187 | } |
| 188 | |
| 189 | void |
| 190 | CN_IntegerMinMax_free(asn_TYPE_descriptor_t *td, |
| 191 | void *struct_ptr, int contents_only) { |
| 192 | CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); |
| 193 | td->free_struct(td, struct_ptr, contents_only); |
| 194 | } |
| 195 | |
| 196 | int |
| 197 | CN_IntegerMinMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 198 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 199 | CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); |
| 200 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 201 | } |
| 202 | |
| 203 | asn_dec_rval_t |
| 204 | CN_IntegerMinMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 205 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 206 | CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); |
| 207 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 208 | } |
| 209 | |
| 210 | asn_enc_rval_t |
| 211 | CN_IntegerMinMax_encode_der(asn_TYPE_descriptor_t *td, |
| 212 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 213 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 214 | CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); |
| 215 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 216 | } |
| 217 | |
| 218 | asn_dec_rval_t |
| 219 | CN_IntegerMinMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 220 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 221 | CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); |
| 222 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 223 | } |
| 224 | |
| 225 | asn_enc_rval_t |
| 226 | CN_IntegerMinMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 227 | int ilevel, enum xer_encoder_flags_e flags, |
| 228 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 229 | CN_IntegerMinMax_1_inherit_TYPE_descriptor(td); |
| 230 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 231 | } |
| 232 | |
| 233 | |
| 234 | /*** <<< STAT-DEFS [CN-IntegerMinMax] >>> ***/ |
| 235 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 236 | static ber_tlv_tag_t asn_DEF_CN_IntegerMinMax_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 237 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 238 | }; |
| 239 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = { |
| 240 | "CN-IntegerMinMax", |
| 241 | "CN-IntegerMinMax", |
| 242 | CN_IntegerMinMax_free, |
| 243 | CN_IntegerMinMax_print, |
| 244 | CN_IntegerMinMax_constraint, |
| 245 | CN_IntegerMinMax_decode_ber, |
| 246 | CN_IntegerMinMax_encode_der, |
| 247 | CN_IntegerMinMax_decode_xer, |
| 248 | CN_IntegerMinMax_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 249 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 250 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 251 | asn_DEF_CN_IntegerMinMax_tags_1, |
| 252 | sizeof(asn_DEF_CN_IntegerMinMax_tags_1) |
| 253 | /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ |
| 254 | asn_DEF_CN_IntegerMinMax_tags_1, /* Same as above */ |
| 255 | sizeof(asn_DEF_CN_IntegerMinMax_tags_1) |
| 256 | /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ |
| 257 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 258 | 0, 0, /* No members */ |
| 259 | 0 /* No specifics */ |
| 260 | }; |
| 261 | |
| 262 | |
| 263 | /*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/ |
| 264 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 265 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 266 | |
| 267 | /*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/ |
| 268 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 269 | typedef long CN_IntegerMinLow_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 270 | |
| 271 | /*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/ |
| 272 | |
| 273 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow; |
| 274 | asn_struct_free_f CN_IntegerMinLow_free; |
| 275 | asn_struct_print_f CN_IntegerMinLow_print; |
| 276 | asn_constr_check_f CN_IntegerMinLow_constraint; |
| 277 | ber_type_decoder_f CN_IntegerMinLow_decode_ber; |
| 278 | der_type_encoder_f CN_IntegerMinLow_encode_der; |
| 279 | xer_type_decoder_f CN_IntegerMinLow_decode_xer; |
| 280 | xer_type_encoder_f CN_IntegerMinLow_encode_xer; |
| 281 | |
| 282 | /*** <<< CODE [CN-IntegerMinLow] >>> ***/ |
| 283 | |
| 284 | int |
| 285 | CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 286 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 287 | long value; |
| 288 | |
| 289 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 290 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 291 | "%s: value not given (%s:%d)", |
| 292 | td->name, __FILE__, __LINE__); |
| 293 | return -1; |
| 294 | } |
| 295 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 296 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 297 | |
| 298 | if((value <= 1)) { |
| 299 | /* Constraint check succeeded */ |
| 300 | return 0; |
| 301 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 302 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 303 | "%s: constraint failed (%s:%d)", |
| 304 | td->name, __FILE__, __LINE__); |
| 305 | return -1; |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 310 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 311 | * so here we adjust the DEF accordingly. |
| 312 | */ |
| 313 | static void |
| 314 | CN_IntegerMinLow_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 315 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 316 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 317 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 318 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 319 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 320 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 321 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 322 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 323 | if(!td->per_constraints) |
| 324 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 325 | td->elements = asn_DEF_NativeInteger.elements; |
| 326 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 327 | td->specifics = asn_DEF_NativeInteger.specifics; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 328 | } |
| 329 | |
| 330 | void |
| 331 | CN_IntegerMinLow_free(asn_TYPE_descriptor_t *td, |
| 332 | void *struct_ptr, int contents_only) { |
| 333 | CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); |
| 334 | td->free_struct(td, struct_ptr, contents_only); |
| 335 | } |
| 336 | |
| 337 | int |
| 338 | CN_IntegerMinLow_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 339 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 340 | CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); |
| 341 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 342 | } |
| 343 | |
| 344 | asn_dec_rval_t |
| 345 | CN_IntegerMinLow_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 346 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 347 | CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); |
| 348 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 349 | } |
| 350 | |
| 351 | asn_enc_rval_t |
| 352 | CN_IntegerMinLow_encode_der(asn_TYPE_descriptor_t *td, |
| 353 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 354 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 355 | CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); |
| 356 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 357 | } |
| 358 | |
| 359 | asn_dec_rval_t |
| 360 | CN_IntegerMinLow_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 361 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 362 | CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); |
| 363 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 364 | } |
| 365 | |
| 366 | asn_enc_rval_t |
| 367 | CN_IntegerMinLow_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 368 | int ilevel, enum xer_encoder_flags_e flags, |
| 369 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 370 | CN_IntegerMinLow_1_inherit_TYPE_descriptor(td); |
| 371 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 372 | } |
| 373 | |
| 374 | |
| 375 | /*** <<< STAT-DEFS [CN-IntegerMinLow] >>> ***/ |
| 376 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 377 | static ber_tlv_tag_t asn_DEF_CN_IntegerMinLow_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 378 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 379 | }; |
| 380 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow = { |
| 381 | "CN-IntegerMinLow", |
| 382 | "CN-IntegerMinLow", |
| 383 | CN_IntegerMinLow_free, |
| 384 | CN_IntegerMinLow_print, |
| 385 | CN_IntegerMinLow_constraint, |
| 386 | CN_IntegerMinLow_decode_ber, |
| 387 | CN_IntegerMinLow_encode_der, |
| 388 | CN_IntegerMinLow_decode_xer, |
| 389 | CN_IntegerMinLow_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 390 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 391 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 392 | asn_DEF_CN_IntegerMinLow_tags_1, |
| 393 | sizeof(asn_DEF_CN_IntegerMinLow_tags_1) |
| 394 | /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ |
| 395 | asn_DEF_CN_IntegerMinLow_tags_1, /* Same as above */ |
| 396 | sizeof(asn_DEF_CN_IntegerMinLow_tags_1) |
| 397 | /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ |
| 398 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 399 | 0, 0, /* No members */ |
| 400 | 0 /* No specifics */ |
| 401 | }; |
| 402 | |
| 403 | |
| 404 | /*** <<< INCLUDES [NO-IntegerMinHigh] >>> ***/ |
| 405 | |
| 406 | #include <INTEGER.h> |
| 407 | |
| 408 | /*** <<< TYPE-DECLS [NO-IntegerMinHigh] >>> ***/ |
| 409 | |
| 410 | typedef INTEGER_t NO_IntegerMinHigh_t; |
| 411 | |
| 412 | /*** <<< FUNC-DECLS [NO-IntegerMinHigh] >>> ***/ |
| 413 | |
| 414 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh; |
| 415 | asn_struct_free_f NO_IntegerMinHigh_free; |
| 416 | asn_struct_print_f NO_IntegerMinHigh_print; |
| 417 | asn_constr_check_f NO_IntegerMinHigh_constraint; |
| 418 | ber_type_decoder_f NO_IntegerMinHigh_decode_ber; |
| 419 | der_type_encoder_f NO_IntegerMinHigh_encode_der; |
| 420 | xer_type_decoder_f NO_IntegerMinHigh_decode_xer; |
| 421 | xer_type_encoder_f NO_IntegerMinHigh_encode_xer; |
| 422 | |
| 423 | /*** <<< CODE [NO-IntegerMinHigh] >>> ***/ |
| 424 | |
| 425 | int |
| 426 | NO_IntegerMinHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 427 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 428 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 429 | long value; |
| 430 | |
| 431 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 432 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 433 | "%s: value not given (%s:%d)", |
| 434 | td->name, __FILE__, __LINE__); |
| 435 | return -1; |
| 436 | } |
| 437 | |
| 438 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 439 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 440 | "%s: value too large (%s:%d)", |
| 441 | td->name, __FILE__, __LINE__); |
| 442 | return -1; |
| 443 | } |
| 444 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 445 | if((value <= 3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 446 | /* Constraint check succeeded */ |
| 447 | return 0; |
| 448 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 449 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 450 | "%s: constraint failed (%s:%d)", |
| 451 | td->name, __FILE__, __LINE__); |
| 452 | return -1; |
| 453 | } |
| 454 | } |
| 455 | |
| 456 | /* |
| 457 | * This type is implemented using INTEGER, |
| 458 | * so here we adjust the DEF accordingly. |
| 459 | */ |
| 460 | static void |
| 461 | NO_IntegerMinHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 462 | td->free_struct = asn_DEF_INTEGER.free_struct; |
| 463 | td->print_struct = asn_DEF_INTEGER.print_struct; |
| 464 | td->ber_decoder = asn_DEF_INTEGER.ber_decoder; |
| 465 | td->der_encoder = asn_DEF_INTEGER.der_encoder; |
| 466 | td->xer_decoder = asn_DEF_INTEGER.xer_decoder; |
| 467 | td->xer_encoder = asn_DEF_INTEGER.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 468 | td->uper_decoder = asn_DEF_INTEGER.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 469 | td->uper_encoder = asn_DEF_INTEGER.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 470 | if(!td->per_constraints) |
| 471 | td->per_constraints = asn_DEF_INTEGER.per_constraints; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 472 | td->elements = asn_DEF_INTEGER.elements; |
| 473 | td->elements_count = asn_DEF_INTEGER.elements_count; |
| 474 | td->specifics = asn_DEF_INTEGER.specifics; |
| 475 | } |
| 476 | |
| 477 | void |
| 478 | NO_IntegerMinHigh_free(asn_TYPE_descriptor_t *td, |
| 479 | void *struct_ptr, int contents_only) { |
| 480 | NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); |
| 481 | td->free_struct(td, struct_ptr, contents_only); |
| 482 | } |
| 483 | |
| 484 | int |
| 485 | NO_IntegerMinHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 486 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 487 | NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); |
| 488 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 489 | } |
| 490 | |
| 491 | asn_dec_rval_t |
| 492 | NO_IntegerMinHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 493 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 494 | NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); |
| 495 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 496 | } |
| 497 | |
| 498 | asn_enc_rval_t |
| 499 | NO_IntegerMinHigh_encode_der(asn_TYPE_descriptor_t *td, |
| 500 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 501 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 502 | NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); |
| 503 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 504 | } |
| 505 | |
| 506 | asn_dec_rval_t |
| 507 | NO_IntegerMinHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 508 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 509 | NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); |
| 510 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 511 | } |
| 512 | |
| 513 | asn_enc_rval_t |
| 514 | NO_IntegerMinHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 515 | int ilevel, enum xer_encoder_flags_e flags, |
| 516 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 517 | NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td); |
| 518 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 519 | } |
| 520 | |
| 521 | |
| 522 | /*** <<< STAT-DEFS [NO-IntegerMinHigh] >>> ***/ |
| 523 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 524 | static ber_tlv_tag_t asn_DEF_NO_IntegerMinHigh_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 525 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 526 | }; |
| 527 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh = { |
| 528 | "NO-IntegerMinHigh", |
| 529 | "NO-IntegerMinHigh", |
| 530 | NO_IntegerMinHigh_free, |
| 531 | NO_IntegerMinHigh_print, |
| 532 | NO_IntegerMinHigh_constraint, |
| 533 | NO_IntegerMinHigh_decode_ber, |
| 534 | NO_IntegerMinHigh_encode_der, |
| 535 | NO_IntegerMinHigh_decode_xer, |
| 536 | NO_IntegerMinHigh_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 537 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 538 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 539 | asn_DEF_NO_IntegerMinHigh_tags_1, |
| 540 | sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) |
| 541 | /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ |
| 542 | asn_DEF_NO_IntegerMinHigh_tags_1, /* Same as above */ |
| 543 | sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) |
| 544 | /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ |
| 545 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 546 | 0, 0, /* No members */ |
| 547 | 0 /* No specifics */ |
| 548 | }; |
| 549 | |
| 550 | |
| 551 | /*** <<< INCLUDES [NO-IntegerLowHigh] >>> ***/ |
| 552 | |
| 553 | #include <INTEGER.h> |
| 554 | |
| 555 | /*** <<< TYPE-DECLS [NO-IntegerLowHigh] >>> ***/ |
| 556 | |
| 557 | typedef INTEGER_t NO_IntegerLowHigh_t; |
| 558 | |
| 559 | /*** <<< FUNC-DECLS [NO-IntegerLowHigh] >>> ***/ |
| 560 | |
| 561 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh; |
| 562 | asn_struct_free_f NO_IntegerLowHigh_free; |
| 563 | asn_struct_print_f NO_IntegerLowHigh_print; |
| 564 | asn_constr_check_f NO_IntegerLowHigh_constraint; |
| 565 | ber_type_decoder_f NO_IntegerLowHigh_decode_ber; |
| 566 | der_type_encoder_f NO_IntegerLowHigh_encode_der; |
| 567 | xer_type_decoder_f NO_IntegerLowHigh_decode_xer; |
| 568 | xer_type_encoder_f NO_IntegerLowHigh_encode_xer; |
| 569 | |
| 570 | /*** <<< CODE [NO-IntegerLowHigh] >>> ***/ |
| 571 | |
| 572 | int |
| 573 | NO_IntegerLowHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 574 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 575 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 576 | long value; |
| 577 | |
| 578 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 579 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 580 | "%s: value not given (%s:%d)", |
| 581 | td->name, __FILE__, __LINE__); |
| 582 | return -1; |
| 583 | } |
| 584 | |
| 585 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 586 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 587 | "%s: value too large (%s:%d)", |
| 588 | td->name, __FILE__, __LINE__); |
| 589 | return -1; |
| 590 | } |
| 591 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 592 | if((value >= 1 && value <= 3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 593 | /* Constraint check succeeded */ |
| 594 | return 0; |
| 595 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 596 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 597 | "%s: constraint failed (%s:%d)", |
| 598 | td->name, __FILE__, __LINE__); |
| 599 | return -1; |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | /* |
| 604 | * This type is implemented using INTEGER, |
| 605 | * so here we adjust the DEF accordingly. |
| 606 | */ |
| 607 | static void |
| 608 | NO_IntegerLowHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 609 | td->free_struct = asn_DEF_INTEGER.free_struct; |
| 610 | td->print_struct = asn_DEF_INTEGER.print_struct; |
| 611 | td->ber_decoder = asn_DEF_INTEGER.ber_decoder; |
| 612 | td->der_encoder = asn_DEF_INTEGER.der_encoder; |
| 613 | td->xer_decoder = asn_DEF_INTEGER.xer_decoder; |
| 614 | td->xer_encoder = asn_DEF_INTEGER.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 615 | td->uper_decoder = asn_DEF_INTEGER.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 616 | td->uper_encoder = asn_DEF_INTEGER.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 617 | if(!td->per_constraints) |
| 618 | td->per_constraints = asn_DEF_INTEGER.per_constraints; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 619 | td->elements = asn_DEF_INTEGER.elements; |
| 620 | td->elements_count = asn_DEF_INTEGER.elements_count; |
| 621 | td->specifics = asn_DEF_INTEGER.specifics; |
| 622 | } |
| 623 | |
| 624 | void |
| 625 | NO_IntegerLowHigh_free(asn_TYPE_descriptor_t *td, |
| 626 | void *struct_ptr, int contents_only) { |
| 627 | NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); |
| 628 | td->free_struct(td, struct_ptr, contents_only); |
| 629 | } |
| 630 | |
| 631 | int |
| 632 | NO_IntegerLowHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 633 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 634 | NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); |
| 635 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 636 | } |
| 637 | |
| 638 | asn_dec_rval_t |
| 639 | NO_IntegerLowHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 640 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 641 | NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); |
| 642 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 643 | } |
| 644 | |
| 645 | asn_enc_rval_t |
| 646 | NO_IntegerLowHigh_encode_der(asn_TYPE_descriptor_t *td, |
| 647 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 648 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 649 | NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); |
| 650 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 651 | } |
| 652 | |
| 653 | asn_dec_rval_t |
| 654 | NO_IntegerLowHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 655 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 656 | NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); |
| 657 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 658 | } |
| 659 | |
| 660 | asn_enc_rval_t |
| 661 | NO_IntegerLowHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 662 | int ilevel, enum xer_encoder_flags_e flags, |
| 663 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 664 | NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td); |
| 665 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 666 | } |
| 667 | |
| 668 | |
| 669 | /*** <<< STAT-DEFS [NO-IntegerLowHigh] >>> ***/ |
| 670 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 671 | static ber_tlv_tag_t asn_DEF_NO_IntegerLowHigh_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 672 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 673 | }; |
| 674 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = { |
| 675 | "NO-IntegerLowHigh", |
| 676 | "NO-IntegerLowHigh", |
| 677 | NO_IntegerLowHigh_free, |
| 678 | NO_IntegerLowHigh_print, |
| 679 | NO_IntegerLowHigh_constraint, |
| 680 | NO_IntegerLowHigh_decode_ber, |
| 681 | NO_IntegerLowHigh_encode_der, |
| 682 | NO_IntegerLowHigh_decode_xer, |
| 683 | NO_IntegerLowHigh_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 684 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 685 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 686 | asn_DEF_NO_IntegerLowHigh_tags_1, |
| 687 | sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) |
| 688 | /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ |
| 689 | asn_DEF_NO_IntegerLowHigh_tags_1, /* Same as above */ |
| 690 | sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) |
| 691 | /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ |
| 692 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 693 | 0, 0, /* No members */ |
| 694 | 0 /* No specifics */ |
| 695 | }; |
| 696 | |
| 697 | |
| 698 | /*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/ |
| 699 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 700 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 701 | |
| 702 | /*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/ |
| 703 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 704 | typedef long CN_IntegerLowMax_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 705 | |
| 706 | /*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/ |
| 707 | |
| 708 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax; |
| 709 | asn_struct_free_f CN_IntegerLowMax_free; |
| 710 | asn_struct_print_f CN_IntegerLowMax_print; |
| 711 | asn_constr_check_f CN_IntegerLowMax_constraint; |
| 712 | ber_type_decoder_f CN_IntegerLowMax_decode_ber; |
| 713 | der_type_encoder_f CN_IntegerLowMax_encode_der; |
| 714 | xer_type_decoder_f CN_IntegerLowMax_decode_xer; |
| 715 | xer_type_encoder_f CN_IntegerLowMax_encode_xer; |
| 716 | |
| 717 | /*** <<< CODE [CN-IntegerLowMax] >>> ***/ |
| 718 | |
| 719 | int |
| 720 | CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 721 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 722 | long value; |
| 723 | |
| 724 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 725 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 726 | "%s: value not given (%s:%d)", |
| 727 | td->name, __FILE__, __LINE__); |
| 728 | return -1; |
| 729 | } |
| 730 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 731 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 732 | |
| 733 | if((value >= 1)) { |
| 734 | /* Constraint check succeeded */ |
| 735 | return 0; |
| 736 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 737 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 738 | "%s: constraint failed (%s:%d)", |
| 739 | td->name, __FILE__, __LINE__); |
| 740 | return -1; |
| 741 | } |
| 742 | } |
| 743 | |
| 744 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 745 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 746 | * so here we adjust the DEF accordingly. |
| 747 | */ |
| 748 | static void |
| 749 | CN_IntegerLowMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 750 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 751 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 752 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 753 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 754 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 755 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 756 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 757 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 758 | if(!td->per_constraints) |
| 759 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 760 | td->elements = asn_DEF_NativeInteger.elements; |
| 761 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 762 | td->specifics = asn_DEF_NativeInteger.specifics; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 763 | } |
| 764 | |
| 765 | void |
| 766 | CN_IntegerLowMax_free(asn_TYPE_descriptor_t *td, |
| 767 | void *struct_ptr, int contents_only) { |
| 768 | CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); |
| 769 | td->free_struct(td, struct_ptr, contents_only); |
| 770 | } |
| 771 | |
| 772 | int |
| 773 | CN_IntegerLowMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 774 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 775 | CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); |
| 776 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 777 | } |
| 778 | |
| 779 | asn_dec_rval_t |
| 780 | CN_IntegerLowMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 781 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 782 | CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); |
| 783 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 784 | } |
| 785 | |
| 786 | asn_enc_rval_t |
| 787 | CN_IntegerLowMax_encode_der(asn_TYPE_descriptor_t *td, |
| 788 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 789 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 790 | CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); |
| 791 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 792 | } |
| 793 | |
| 794 | asn_dec_rval_t |
| 795 | CN_IntegerLowMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 796 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 797 | CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); |
| 798 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 799 | } |
| 800 | |
| 801 | asn_enc_rval_t |
| 802 | CN_IntegerLowMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 803 | int ilevel, enum xer_encoder_flags_e flags, |
| 804 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 805 | CN_IntegerLowMax_1_inherit_TYPE_descriptor(td); |
| 806 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 807 | } |
| 808 | |
| 809 | |
| 810 | /*** <<< STAT-DEFS [CN-IntegerLowMax] >>> ***/ |
| 811 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 812 | static ber_tlv_tag_t asn_DEF_CN_IntegerLowMax_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 813 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 814 | }; |
| 815 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax = { |
| 816 | "CN-IntegerLowMax", |
| 817 | "CN-IntegerLowMax", |
| 818 | CN_IntegerLowMax_free, |
| 819 | CN_IntegerLowMax_print, |
| 820 | CN_IntegerLowMax_constraint, |
| 821 | CN_IntegerLowMax_decode_ber, |
| 822 | CN_IntegerLowMax_encode_der, |
| 823 | CN_IntegerLowMax_decode_xer, |
| 824 | CN_IntegerLowMax_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 825 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 826 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 827 | asn_DEF_CN_IntegerLowMax_tags_1, |
| 828 | sizeof(asn_DEF_CN_IntegerLowMax_tags_1) |
| 829 | /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ |
| 830 | asn_DEF_CN_IntegerLowMax_tags_1, /* Same as above */ |
| 831 | sizeof(asn_DEF_CN_IntegerLowMax_tags_1) |
| 832 | /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ |
| 833 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 834 | 0, 0, /* No members */ |
| 835 | 0 /* No specifics */ |
| 836 | }; |
| 837 | |
| 838 | |
| 839 | /*** <<< INCLUDES [NO-IntegerHighMax] >>> ***/ |
| 840 | |
| 841 | #include <INTEGER.h> |
| 842 | |
| 843 | /*** <<< TYPE-DECLS [NO-IntegerHighMax] >>> ***/ |
| 844 | |
| 845 | typedef INTEGER_t NO_IntegerHighMax_t; |
| 846 | |
| 847 | /*** <<< FUNC-DECLS [NO-IntegerHighMax] >>> ***/ |
| 848 | |
| 849 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax; |
| 850 | asn_struct_free_f NO_IntegerHighMax_free; |
| 851 | asn_struct_print_f NO_IntegerHighMax_print; |
| 852 | asn_constr_check_f NO_IntegerHighMax_constraint; |
| 853 | ber_type_decoder_f NO_IntegerHighMax_decode_ber; |
| 854 | der_type_encoder_f NO_IntegerHighMax_encode_der; |
| 855 | xer_type_decoder_f NO_IntegerHighMax_decode_xer; |
| 856 | xer_type_encoder_f NO_IntegerHighMax_encode_xer; |
| 857 | |
| 858 | /*** <<< CODE [NO-IntegerHighMax] >>> ***/ |
| 859 | |
| 860 | int |
| 861 | NO_IntegerHighMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 862 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 863 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 864 | long value; |
| 865 | |
| 866 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 867 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 868 | "%s: value not given (%s:%d)", |
| 869 | td->name, __FILE__, __LINE__); |
| 870 | return -1; |
| 871 | } |
| 872 | |
| 873 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 874 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 875 | "%s: value too large (%s:%d)", |
| 876 | td->name, __FILE__, __LINE__); |
| 877 | return -1; |
| 878 | } |
| 879 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 880 | if((value >= 3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 881 | /* Constraint check succeeded */ |
| 882 | return 0; |
| 883 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 884 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 885 | "%s: constraint failed (%s:%d)", |
| 886 | td->name, __FILE__, __LINE__); |
| 887 | return -1; |
| 888 | } |
| 889 | } |
| 890 | |
| 891 | /* |
| 892 | * This type is implemented using INTEGER, |
| 893 | * so here we adjust the DEF accordingly. |
| 894 | */ |
| 895 | static void |
| 896 | NO_IntegerHighMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 897 | td->free_struct = asn_DEF_INTEGER.free_struct; |
| 898 | td->print_struct = asn_DEF_INTEGER.print_struct; |
| 899 | td->ber_decoder = asn_DEF_INTEGER.ber_decoder; |
| 900 | td->der_encoder = asn_DEF_INTEGER.der_encoder; |
| 901 | td->xer_decoder = asn_DEF_INTEGER.xer_decoder; |
| 902 | td->xer_encoder = asn_DEF_INTEGER.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 903 | td->uper_decoder = asn_DEF_INTEGER.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 904 | td->uper_encoder = asn_DEF_INTEGER.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 905 | if(!td->per_constraints) |
| 906 | td->per_constraints = asn_DEF_INTEGER.per_constraints; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 907 | td->elements = asn_DEF_INTEGER.elements; |
| 908 | td->elements_count = asn_DEF_INTEGER.elements_count; |
| 909 | td->specifics = asn_DEF_INTEGER.specifics; |
| 910 | } |
| 911 | |
| 912 | void |
| 913 | NO_IntegerHighMax_free(asn_TYPE_descriptor_t *td, |
| 914 | void *struct_ptr, int contents_only) { |
| 915 | NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); |
| 916 | td->free_struct(td, struct_ptr, contents_only); |
| 917 | } |
| 918 | |
| 919 | int |
| 920 | NO_IntegerHighMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 921 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 922 | NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); |
| 923 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 924 | } |
| 925 | |
| 926 | asn_dec_rval_t |
| 927 | NO_IntegerHighMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 928 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 929 | NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); |
| 930 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 931 | } |
| 932 | |
| 933 | asn_enc_rval_t |
| 934 | NO_IntegerHighMax_encode_der(asn_TYPE_descriptor_t *td, |
| 935 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 936 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 937 | NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); |
| 938 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 939 | } |
| 940 | |
| 941 | asn_dec_rval_t |
| 942 | NO_IntegerHighMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 943 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 944 | NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); |
| 945 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 946 | } |
| 947 | |
| 948 | asn_enc_rval_t |
| 949 | NO_IntegerHighMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 950 | int ilevel, enum xer_encoder_flags_e flags, |
| 951 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 952 | NO_IntegerHighMax_1_inherit_TYPE_descriptor(td); |
| 953 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 954 | } |
| 955 | |
| 956 | |
| 957 | /*** <<< STAT-DEFS [NO-IntegerHighMax] >>> ***/ |
| 958 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 959 | static ber_tlv_tag_t asn_DEF_NO_IntegerHighMax_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 960 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 961 | }; |
| 962 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax = { |
| 963 | "NO-IntegerHighMax", |
| 964 | "NO-IntegerHighMax", |
| 965 | NO_IntegerHighMax_free, |
| 966 | NO_IntegerHighMax_print, |
| 967 | NO_IntegerHighMax_constraint, |
| 968 | NO_IntegerHighMax_decode_ber, |
| 969 | NO_IntegerHighMax_encode_der, |
| 970 | NO_IntegerHighMax_decode_xer, |
| 971 | NO_IntegerHighMax_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 972 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 973 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 974 | asn_DEF_NO_IntegerHighMax_tags_1, |
| 975 | sizeof(asn_DEF_NO_IntegerHighMax_tags_1) |
| 976 | /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ |
| 977 | asn_DEF_NO_IntegerHighMax_tags_1, /* Same as above */ |
| 978 | sizeof(asn_DEF_NO_IntegerHighMax_tags_1) |
| 979 | /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ |
| 980 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 981 | 0, 0, /* No members */ |
| 982 | 0 /* No specifics */ |
| 983 | }; |
| 984 | |
| 985 | |
| 986 | /*** <<< INCLUDES [NO-IntegerLowestMax] >>> ***/ |
| 987 | |
| 988 | #include <INTEGER.h> |
| 989 | |
| 990 | /*** <<< TYPE-DECLS [NO-IntegerLowestMax] >>> ***/ |
| 991 | |
| 992 | typedef INTEGER_t NO_IntegerLowestMax_t; |
| 993 | |
| 994 | /*** <<< FUNC-DECLS [NO-IntegerLowestMax] >>> ***/ |
| 995 | |
| 996 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax; |
| 997 | asn_struct_free_f NO_IntegerLowestMax_free; |
| 998 | asn_struct_print_f NO_IntegerLowestMax_print; |
| 999 | asn_constr_check_f NO_IntegerLowestMax_constraint; |
| 1000 | ber_type_decoder_f NO_IntegerLowestMax_decode_ber; |
| 1001 | der_type_encoder_f NO_IntegerLowestMax_encode_der; |
| 1002 | xer_type_decoder_f NO_IntegerLowestMax_decode_xer; |
| 1003 | xer_type_encoder_f NO_IntegerLowestMax_encode_xer; |
| 1004 | |
| 1005 | /*** <<< CODE [NO-IntegerLowestMax] >>> ***/ |
| 1006 | |
| 1007 | int |
| 1008 | NO_IntegerLowestMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1009 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1010 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 1011 | long value; |
| 1012 | |
| 1013 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1014 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1015 | "%s: value not given (%s:%d)", |
| 1016 | td->name, __FILE__, __LINE__); |
| 1017 | return -1; |
| 1018 | } |
| 1019 | |
| 1020 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1021 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1022 | "%s: value too large (%s:%d)", |
| 1023 | td->name, __FILE__, __LINE__); |
| 1024 | return -1; |
| 1025 | } |
| 1026 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1027 | if((value >= -3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1028 | /* Constraint check succeeded */ |
| 1029 | return 0; |
| 1030 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1031 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1032 | "%s: constraint failed (%s:%d)", |
| 1033 | td->name, __FILE__, __LINE__); |
| 1034 | return -1; |
| 1035 | } |
| 1036 | } |
| 1037 | |
| 1038 | /* |
| 1039 | * This type is implemented using INTEGER, |
| 1040 | * so here we adjust the DEF accordingly. |
| 1041 | */ |
| 1042 | static void |
| 1043 | NO_IntegerLowestMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 1044 | td->free_struct = asn_DEF_INTEGER.free_struct; |
| 1045 | td->print_struct = asn_DEF_INTEGER.print_struct; |
| 1046 | td->ber_decoder = asn_DEF_INTEGER.ber_decoder; |
| 1047 | td->der_encoder = asn_DEF_INTEGER.der_encoder; |
| 1048 | td->xer_decoder = asn_DEF_INTEGER.xer_decoder; |
| 1049 | td->xer_encoder = asn_DEF_INTEGER.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1050 | td->uper_decoder = asn_DEF_INTEGER.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1051 | td->uper_encoder = asn_DEF_INTEGER.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1052 | if(!td->per_constraints) |
| 1053 | td->per_constraints = asn_DEF_INTEGER.per_constraints; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1054 | td->elements = asn_DEF_INTEGER.elements; |
| 1055 | td->elements_count = asn_DEF_INTEGER.elements_count; |
| 1056 | td->specifics = asn_DEF_INTEGER.specifics; |
| 1057 | } |
| 1058 | |
| 1059 | void |
| 1060 | NO_IntegerLowestMax_free(asn_TYPE_descriptor_t *td, |
| 1061 | void *struct_ptr, int contents_only) { |
| 1062 | NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); |
| 1063 | td->free_struct(td, struct_ptr, contents_only); |
| 1064 | } |
| 1065 | |
| 1066 | int |
| 1067 | NO_IntegerLowestMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1068 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1069 | NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); |
| 1070 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1071 | } |
| 1072 | |
| 1073 | asn_dec_rval_t |
| 1074 | NO_IntegerLowestMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1075 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1076 | NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); |
| 1077 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1078 | } |
| 1079 | |
| 1080 | asn_enc_rval_t |
| 1081 | NO_IntegerLowestMax_encode_der(asn_TYPE_descriptor_t *td, |
| 1082 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1083 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1084 | NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); |
| 1085 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1086 | } |
| 1087 | |
| 1088 | asn_dec_rval_t |
| 1089 | NO_IntegerLowestMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1090 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1091 | NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); |
| 1092 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1093 | } |
| 1094 | |
| 1095 | asn_enc_rval_t |
| 1096 | NO_IntegerLowestMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1097 | int ilevel, enum xer_encoder_flags_e flags, |
| 1098 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1099 | NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td); |
| 1100 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1101 | } |
| 1102 | |
| 1103 | |
| 1104 | /*** <<< STAT-DEFS [NO-IntegerLowestMax] >>> ***/ |
| 1105 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1106 | static ber_tlv_tag_t asn_DEF_NO_IntegerLowestMax_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1107 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1108 | }; |
| 1109 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax = { |
| 1110 | "NO-IntegerLowestMax", |
| 1111 | "NO-IntegerLowestMax", |
| 1112 | NO_IntegerLowestMax_free, |
| 1113 | NO_IntegerLowestMax_print, |
| 1114 | NO_IntegerLowestMax_constraint, |
| 1115 | NO_IntegerLowestMax_decode_ber, |
| 1116 | NO_IntegerLowestMax_encode_der, |
| 1117 | NO_IntegerLowestMax_decode_xer, |
| 1118 | NO_IntegerLowestMax_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1119 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1120 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1121 | asn_DEF_NO_IntegerLowestMax_tags_1, |
| 1122 | sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) |
| 1123 | /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ |
| 1124 | asn_DEF_NO_IntegerLowestMax_tags_1, /* Same as above */ |
| 1125 | sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) |
| 1126 | /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ |
| 1127 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1128 | 0, 0, /* No members */ |
| 1129 | 0 /* No specifics */ |
| 1130 | }; |
| 1131 | |
| 1132 | |
| 1133 | /*** <<< INCLUDES [NO-IntegerOutRange] >>> ***/ |
| 1134 | |
| 1135 | #include <INTEGER.h> |
| 1136 | |
| 1137 | /*** <<< TYPE-DECLS [NO-IntegerOutRange] >>> ***/ |
| 1138 | |
| 1139 | typedef INTEGER_t NO_IntegerOutRange_t; |
| 1140 | |
| 1141 | /*** <<< FUNC-DECLS [NO-IntegerOutRange] >>> ***/ |
| 1142 | |
| 1143 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange; |
| 1144 | asn_struct_free_f NO_IntegerOutRange_free; |
| 1145 | asn_struct_print_f NO_IntegerOutRange_print; |
| 1146 | asn_constr_check_f NO_IntegerOutRange_constraint; |
| 1147 | ber_type_decoder_f NO_IntegerOutRange_decode_ber; |
| 1148 | der_type_encoder_f NO_IntegerOutRange_encode_der; |
| 1149 | xer_type_decoder_f NO_IntegerOutRange_decode_xer; |
| 1150 | xer_type_encoder_f NO_IntegerOutRange_encode_xer; |
| 1151 | |
| 1152 | /*** <<< CODE [NO-IntegerOutRange] >>> ***/ |
| 1153 | |
| 1154 | int |
| 1155 | NO_IntegerOutRange_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1156 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1157 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 1158 | long value; |
| 1159 | |
| 1160 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1161 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1162 | "%s: value not given (%s:%d)", |
| 1163 | td->name, __FILE__, __LINE__); |
| 1164 | return -1; |
| 1165 | } |
| 1166 | |
| 1167 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1168 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1169 | "%s: value too large (%s:%d)", |
| 1170 | td->name, __FILE__, __LINE__); |
| 1171 | return -1; |
| 1172 | } |
| 1173 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1174 | if((value >= 3000000000 && value <= 3000000001)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1175 | /* Constraint check succeeded */ |
| 1176 | return 0; |
| 1177 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1178 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1179 | "%s: constraint failed (%s:%d)", |
| 1180 | td->name, __FILE__, __LINE__); |
| 1181 | return -1; |
| 1182 | } |
| 1183 | } |
| 1184 | |
| 1185 | /* |
| 1186 | * This type is implemented using INTEGER, |
| 1187 | * so here we adjust the DEF accordingly. |
| 1188 | */ |
| 1189 | static void |
| 1190 | NO_IntegerOutRange_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 1191 | td->free_struct = asn_DEF_INTEGER.free_struct; |
| 1192 | td->print_struct = asn_DEF_INTEGER.print_struct; |
| 1193 | td->ber_decoder = asn_DEF_INTEGER.ber_decoder; |
| 1194 | td->der_encoder = asn_DEF_INTEGER.der_encoder; |
| 1195 | td->xer_decoder = asn_DEF_INTEGER.xer_decoder; |
| 1196 | td->xer_encoder = asn_DEF_INTEGER.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1197 | td->uper_decoder = asn_DEF_INTEGER.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1198 | td->uper_encoder = asn_DEF_INTEGER.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1199 | if(!td->per_constraints) |
| 1200 | td->per_constraints = asn_DEF_INTEGER.per_constraints; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1201 | td->elements = asn_DEF_INTEGER.elements; |
| 1202 | td->elements_count = asn_DEF_INTEGER.elements_count; |
| 1203 | td->specifics = asn_DEF_INTEGER.specifics; |
| 1204 | } |
| 1205 | |
| 1206 | void |
| 1207 | NO_IntegerOutRange_free(asn_TYPE_descriptor_t *td, |
| 1208 | void *struct_ptr, int contents_only) { |
| 1209 | NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); |
| 1210 | td->free_struct(td, struct_ptr, contents_only); |
| 1211 | } |
| 1212 | |
| 1213 | int |
| 1214 | NO_IntegerOutRange_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1215 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1216 | NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); |
| 1217 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1218 | } |
| 1219 | |
| 1220 | asn_dec_rval_t |
| 1221 | NO_IntegerOutRange_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1222 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1223 | NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); |
| 1224 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1225 | } |
| 1226 | |
| 1227 | asn_enc_rval_t |
| 1228 | NO_IntegerOutRange_encode_der(asn_TYPE_descriptor_t *td, |
| 1229 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1230 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1231 | NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); |
| 1232 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1233 | } |
| 1234 | |
| 1235 | asn_dec_rval_t |
| 1236 | NO_IntegerOutRange_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1237 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1238 | NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); |
| 1239 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1240 | } |
| 1241 | |
| 1242 | asn_enc_rval_t |
| 1243 | NO_IntegerOutRange_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1244 | int ilevel, enum xer_encoder_flags_e flags, |
| 1245 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1246 | NO_IntegerOutRange_1_inherit_TYPE_descriptor(td); |
| 1247 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1248 | } |
| 1249 | |
| 1250 | |
| 1251 | /*** <<< STAT-DEFS [NO-IntegerOutRange] >>> ***/ |
| 1252 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1253 | static ber_tlv_tag_t asn_DEF_NO_IntegerOutRange_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1254 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1255 | }; |
| 1256 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange = { |
| 1257 | "NO-IntegerOutRange", |
| 1258 | "NO-IntegerOutRange", |
| 1259 | NO_IntegerOutRange_free, |
| 1260 | NO_IntegerOutRange_print, |
| 1261 | NO_IntegerOutRange_constraint, |
| 1262 | NO_IntegerOutRange_decode_ber, |
| 1263 | NO_IntegerOutRange_encode_der, |
| 1264 | NO_IntegerOutRange_decode_xer, |
| 1265 | NO_IntegerOutRange_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1266 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1267 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1268 | asn_DEF_NO_IntegerOutRange_tags_1, |
| 1269 | sizeof(asn_DEF_NO_IntegerOutRange_tags_1) |
| 1270 | /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ |
| 1271 | asn_DEF_NO_IntegerOutRange_tags_1, /* Same as above */ |
| 1272 | sizeof(asn_DEF_NO_IntegerOutRange_tags_1) |
| 1273 | /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ |
| 1274 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1275 | 0, 0, /* No members */ |
| 1276 | 0 /* No specifics */ |
| 1277 | }; |
| 1278 | |
| 1279 | |
| 1280 | /*** <<< INCLUDES [NO-IntegerOutValue] >>> ***/ |
| 1281 | |
| 1282 | #include <INTEGER.h> |
| 1283 | |
| 1284 | /*** <<< TYPE-DECLS [NO-IntegerOutValue] >>> ***/ |
| 1285 | |
| 1286 | typedef INTEGER_t NO_IntegerOutValue_t; |
| 1287 | |
| 1288 | /*** <<< FUNC-DECLS [NO-IntegerOutValue] >>> ***/ |
| 1289 | |
| 1290 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue; |
| 1291 | asn_struct_free_f NO_IntegerOutValue_free; |
| 1292 | asn_struct_print_f NO_IntegerOutValue_print; |
| 1293 | asn_constr_check_f NO_IntegerOutValue_constraint; |
| 1294 | ber_type_decoder_f NO_IntegerOutValue_decode_ber; |
| 1295 | der_type_encoder_f NO_IntegerOutValue_encode_der; |
| 1296 | xer_type_decoder_f NO_IntegerOutValue_decode_xer; |
| 1297 | xer_type_encoder_f NO_IntegerOutValue_encode_xer; |
| 1298 | |
| 1299 | /*** <<< CODE [NO-IntegerOutValue] >>> ***/ |
| 1300 | |
| 1301 | int |
| 1302 | NO_IntegerOutValue_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1303 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1304 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 1305 | long value; |
| 1306 | |
| 1307 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1308 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1309 | "%s: value not given (%s:%d)", |
| 1310 | td->name, __FILE__, __LINE__); |
| 1311 | return -1; |
| 1312 | } |
| 1313 | |
| 1314 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1315 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1316 | "%s: value too large (%s:%d)", |
| 1317 | td->name, __FILE__, __LINE__); |
| 1318 | return -1; |
| 1319 | } |
| 1320 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1321 | if((value == 3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1322 | /* Constraint check succeeded */ |
| 1323 | return 0; |
| 1324 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1325 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1326 | "%s: constraint failed (%s:%d)", |
| 1327 | td->name, __FILE__, __LINE__); |
| 1328 | return -1; |
| 1329 | } |
| 1330 | } |
| 1331 | |
| 1332 | /* |
| 1333 | * This type is implemented using INTEGER, |
| 1334 | * so here we adjust the DEF accordingly. |
| 1335 | */ |
| 1336 | static void |
| 1337 | NO_IntegerOutValue_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 1338 | td->free_struct = asn_DEF_INTEGER.free_struct; |
| 1339 | td->print_struct = asn_DEF_INTEGER.print_struct; |
| 1340 | td->ber_decoder = asn_DEF_INTEGER.ber_decoder; |
| 1341 | td->der_encoder = asn_DEF_INTEGER.der_encoder; |
| 1342 | td->xer_decoder = asn_DEF_INTEGER.xer_decoder; |
| 1343 | td->xer_encoder = asn_DEF_INTEGER.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1344 | td->uper_decoder = asn_DEF_INTEGER.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1345 | td->uper_encoder = asn_DEF_INTEGER.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1346 | if(!td->per_constraints) |
| 1347 | td->per_constraints = asn_DEF_INTEGER.per_constraints; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1348 | td->elements = asn_DEF_INTEGER.elements; |
| 1349 | td->elements_count = asn_DEF_INTEGER.elements_count; |
| 1350 | td->specifics = asn_DEF_INTEGER.specifics; |
| 1351 | } |
| 1352 | |
| 1353 | void |
| 1354 | NO_IntegerOutValue_free(asn_TYPE_descriptor_t *td, |
| 1355 | void *struct_ptr, int contents_only) { |
| 1356 | NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); |
| 1357 | td->free_struct(td, struct_ptr, contents_only); |
| 1358 | } |
| 1359 | |
| 1360 | int |
| 1361 | NO_IntegerOutValue_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1362 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1363 | NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); |
| 1364 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1365 | } |
| 1366 | |
| 1367 | asn_dec_rval_t |
| 1368 | NO_IntegerOutValue_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1369 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1370 | NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); |
| 1371 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1372 | } |
| 1373 | |
| 1374 | asn_enc_rval_t |
| 1375 | NO_IntegerOutValue_encode_der(asn_TYPE_descriptor_t *td, |
| 1376 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1377 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1378 | NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); |
| 1379 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1380 | } |
| 1381 | |
| 1382 | asn_dec_rval_t |
| 1383 | NO_IntegerOutValue_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1384 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1385 | NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); |
| 1386 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1387 | } |
| 1388 | |
| 1389 | asn_enc_rval_t |
| 1390 | NO_IntegerOutValue_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1391 | int ilevel, enum xer_encoder_flags_e flags, |
| 1392 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1393 | NO_IntegerOutValue_1_inherit_TYPE_descriptor(td); |
| 1394 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1395 | } |
| 1396 | |
| 1397 | |
| 1398 | /*** <<< STAT-DEFS [NO-IntegerOutValue] >>> ***/ |
| 1399 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1400 | static ber_tlv_tag_t asn_DEF_NO_IntegerOutValue_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1401 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1402 | }; |
| 1403 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue = { |
| 1404 | "NO-IntegerOutValue", |
| 1405 | "NO-IntegerOutValue", |
| 1406 | NO_IntegerOutValue_free, |
| 1407 | NO_IntegerOutValue_print, |
| 1408 | NO_IntegerOutValue_constraint, |
| 1409 | NO_IntegerOutValue_decode_ber, |
| 1410 | NO_IntegerOutValue_encode_der, |
| 1411 | NO_IntegerOutValue_decode_xer, |
| 1412 | NO_IntegerOutValue_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1413 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1414 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1415 | asn_DEF_NO_IntegerOutValue_tags_1, |
| 1416 | sizeof(asn_DEF_NO_IntegerOutValue_tags_1) |
| 1417 | /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ |
| 1418 | asn_DEF_NO_IntegerOutValue_tags_1, /* Same as above */ |
| 1419 | sizeof(asn_DEF_NO_IntegerOutValue_tags_1) |
| 1420 | /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ |
| 1421 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1422 | 0, 0, /* No members */ |
| 1423 | 0 /* No specifics */ |
| 1424 | }; |
| 1425 | |
| 1426 | |
| 1427 | /*** <<< INCLUDES [OK-IntegerInRange1] >>> ***/ |
| 1428 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1429 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1430 | |
| 1431 | /*** <<< TYPE-DECLS [OK-IntegerInRange1] >>> ***/ |
| 1432 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1433 | typedef long OK_IntegerInRange1_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1434 | |
| 1435 | /*** <<< FUNC-DECLS [OK-IntegerInRange1] >>> ***/ |
| 1436 | |
| 1437 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1; |
| 1438 | asn_struct_free_f OK_IntegerInRange1_free; |
| 1439 | asn_struct_print_f OK_IntegerInRange1_print; |
| 1440 | asn_constr_check_f OK_IntegerInRange1_constraint; |
| 1441 | ber_type_decoder_f OK_IntegerInRange1_decode_ber; |
| 1442 | der_type_encoder_f OK_IntegerInRange1_encode_der; |
| 1443 | xer_type_decoder_f OK_IntegerInRange1_decode_xer; |
| 1444 | xer_type_encoder_f OK_IntegerInRange1_encode_xer; |
| 1445 | |
| 1446 | /*** <<< CODE [OK-IntegerInRange1] >>> ***/ |
| 1447 | |
| 1448 | int |
| 1449 | OK_IntegerInRange1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1450 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1451 | long value; |
| 1452 | |
| 1453 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1454 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1455 | "%s: value not given (%s:%d)", |
| 1456 | td->name, __FILE__, __LINE__); |
| 1457 | return -1; |
| 1458 | } |
| 1459 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1460 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1461 | |
| 1462 | if((value >= -100 && value <= 100)) { |
| 1463 | /* Constraint check succeeded */ |
| 1464 | return 0; |
| 1465 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1466 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1467 | "%s: constraint failed (%s:%d)", |
| 1468 | td->name, __FILE__, __LINE__); |
| 1469 | return -1; |
| 1470 | } |
| 1471 | } |
| 1472 | |
| 1473 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1474 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1475 | * so here we adjust the DEF accordingly. |
| 1476 | */ |
| 1477 | static void |
| 1478 | OK_IntegerInRange1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1479 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 1480 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 1481 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 1482 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 1483 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 1484 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1485 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1486 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1487 | if(!td->per_constraints) |
| 1488 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1489 | td->elements = asn_DEF_NativeInteger.elements; |
| 1490 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 1491 | td->specifics = asn_DEF_NativeInteger.specifics; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1492 | } |
| 1493 | |
| 1494 | void |
| 1495 | OK_IntegerInRange1_free(asn_TYPE_descriptor_t *td, |
| 1496 | void *struct_ptr, int contents_only) { |
| 1497 | OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); |
| 1498 | td->free_struct(td, struct_ptr, contents_only); |
| 1499 | } |
| 1500 | |
| 1501 | int |
| 1502 | OK_IntegerInRange1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1503 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1504 | OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); |
| 1505 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1506 | } |
| 1507 | |
| 1508 | asn_dec_rval_t |
| 1509 | OK_IntegerInRange1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1510 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1511 | OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); |
| 1512 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1513 | } |
| 1514 | |
| 1515 | asn_enc_rval_t |
| 1516 | OK_IntegerInRange1_encode_der(asn_TYPE_descriptor_t *td, |
| 1517 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1518 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1519 | OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); |
| 1520 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1521 | } |
| 1522 | |
| 1523 | asn_dec_rval_t |
| 1524 | OK_IntegerInRange1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1525 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1526 | OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); |
| 1527 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1528 | } |
| 1529 | |
| 1530 | asn_enc_rval_t |
| 1531 | OK_IntegerInRange1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1532 | int ilevel, enum xer_encoder_flags_e flags, |
| 1533 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1534 | OK_IntegerInRange1_1_inherit_TYPE_descriptor(td); |
| 1535 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1536 | } |
| 1537 | |
| 1538 | |
| 1539 | /*** <<< STAT-DEFS [OK-IntegerInRange1] >>> ***/ |
| 1540 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1541 | static ber_tlv_tag_t asn_DEF_OK_IntegerInRange1_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1542 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1543 | }; |
| 1544 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1 = { |
| 1545 | "OK-IntegerInRange1", |
| 1546 | "OK-IntegerInRange1", |
| 1547 | OK_IntegerInRange1_free, |
| 1548 | OK_IntegerInRange1_print, |
| 1549 | OK_IntegerInRange1_constraint, |
| 1550 | OK_IntegerInRange1_decode_ber, |
| 1551 | OK_IntegerInRange1_encode_der, |
| 1552 | OK_IntegerInRange1_decode_xer, |
| 1553 | OK_IntegerInRange1_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1554 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1555 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1556 | asn_DEF_OK_IntegerInRange1_tags_1, |
| 1557 | sizeof(asn_DEF_OK_IntegerInRange1_tags_1) |
| 1558 | /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ |
| 1559 | asn_DEF_OK_IntegerInRange1_tags_1, /* Same as above */ |
| 1560 | sizeof(asn_DEF_OK_IntegerInRange1_tags_1) |
| 1561 | /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ |
| 1562 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1563 | 0, 0, /* No members */ |
| 1564 | 0 /* No specifics */ |
| 1565 | }; |
| 1566 | |
| 1567 | |
| 1568 | /*** <<< INCLUDES [OK-IntegerInRange2] >>> ***/ |
| 1569 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1570 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1571 | |
| 1572 | /*** <<< TYPE-DECLS [OK-IntegerInRange2] >>> ***/ |
| 1573 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1574 | typedef long OK_IntegerInRange2_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1575 | |
| 1576 | /*** <<< FUNC-DECLS [OK-IntegerInRange2] >>> ***/ |
| 1577 | |
| 1578 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2; |
| 1579 | asn_struct_free_f OK_IntegerInRange2_free; |
| 1580 | asn_struct_print_f OK_IntegerInRange2_print; |
| 1581 | asn_constr_check_f OK_IntegerInRange2_constraint; |
| 1582 | ber_type_decoder_f OK_IntegerInRange2_decode_ber; |
| 1583 | der_type_encoder_f OK_IntegerInRange2_encode_der; |
| 1584 | xer_type_decoder_f OK_IntegerInRange2_decode_xer; |
| 1585 | xer_type_encoder_f OK_IntegerInRange2_encode_xer; |
| 1586 | |
| 1587 | /*** <<< CODE [OK-IntegerInRange2] >>> ***/ |
| 1588 | |
| 1589 | int |
| 1590 | OK_IntegerInRange2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1591 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1592 | long value; |
| 1593 | |
| 1594 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1595 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1596 | "%s: value not given (%s:%d)", |
| 1597 | td->name, __FILE__, __LINE__); |
| 1598 | return -1; |
| 1599 | } |
| 1600 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1601 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1602 | |
| 1603 | if(((value == -100) || (value == 100))) { |
| 1604 | /* Constraint check succeeded */ |
| 1605 | return 0; |
| 1606 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1607 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1608 | "%s: constraint failed (%s:%d)", |
| 1609 | td->name, __FILE__, __LINE__); |
| 1610 | return -1; |
| 1611 | } |
| 1612 | } |
| 1613 | |
| 1614 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1615 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1616 | * so here we adjust the DEF accordingly. |
| 1617 | */ |
| 1618 | static void |
| 1619 | OK_IntegerInRange2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1620 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 1621 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 1622 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 1623 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 1624 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 1625 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1626 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1627 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1628 | if(!td->per_constraints) |
| 1629 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1630 | td->elements = asn_DEF_NativeInteger.elements; |
| 1631 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 1632 | td->specifics = asn_DEF_NativeInteger.specifics; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1633 | } |
| 1634 | |
| 1635 | void |
| 1636 | OK_IntegerInRange2_free(asn_TYPE_descriptor_t *td, |
| 1637 | void *struct_ptr, int contents_only) { |
| 1638 | OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); |
| 1639 | td->free_struct(td, struct_ptr, contents_only); |
| 1640 | } |
| 1641 | |
| 1642 | int |
| 1643 | OK_IntegerInRange2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1644 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1645 | OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); |
| 1646 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1647 | } |
| 1648 | |
| 1649 | asn_dec_rval_t |
| 1650 | OK_IntegerInRange2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1651 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1652 | OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); |
| 1653 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1654 | } |
| 1655 | |
| 1656 | asn_enc_rval_t |
| 1657 | OK_IntegerInRange2_encode_der(asn_TYPE_descriptor_t *td, |
| 1658 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1659 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1660 | OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); |
| 1661 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1662 | } |
| 1663 | |
| 1664 | asn_dec_rval_t |
| 1665 | OK_IntegerInRange2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1666 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1667 | OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); |
| 1668 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1669 | } |
| 1670 | |
| 1671 | asn_enc_rval_t |
| 1672 | OK_IntegerInRange2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1673 | int ilevel, enum xer_encoder_flags_e flags, |
| 1674 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1675 | OK_IntegerInRange2_1_inherit_TYPE_descriptor(td); |
| 1676 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1677 | } |
| 1678 | |
| 1679 | |
| 1680 | /*** <<< STAT-DEFS [OK-IntegerInRange2] >>> ***/ |
| 1681 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1682 | static ber_tlv_tag_t asn_DEF_OK_IntegerInRange2_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1683 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1684 | }; |
| 1685 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2 = { |
| 1686 | "OK-IntegerInRange2", |
| 1687 | "OK-IntegerInRange2", |
| 1688 | OK_IntegerInRange2_free, |
| 1689 | OK_IntegerInRange2_print, |
| 1690 | OK_IntegerInRange2_constraint, |
| 1691 | OK_IntegerInRange2_decode_ber, |
| 1692 | OK_IntegerInRange2_encode_der, |
| 1693 | OK_IntegerInRange2_decode_xer, |
| 1694 | OK_IntegerInRange2_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1695 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1696 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1697 | asn_DEF_OK_IntegerInRange2_tags_1, |
| 1698 | sizeof(asn_DEF_OK_IntegerInRange2_tags_1) |
| 1699 | /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ |
| 1700 | asn_DEF_OK_IntegerInRange2_tags_1, /* Same as above */ |
| 1701 | sizeof(asn_DEF_OK_IntegerInRange2_tags_1) |
| 1702 | /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ |
| 1703 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1704 | 0, 0, /* No members */ |
| 1705 | 0 /* No specifics */ |
| 1706 | }; |
| 1707 | |
| 1708 | |
| 1709 | /*** <<< INCLUDES [OK-IntegerInRange3] >>> ***/ |
| 1710 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1711 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1712 | |
| 1713 | /*** <<< TYPE-DECLS [OK-IntegerInRange3] >>> ***/ |
| 1714 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1715 | typedef long OK_IntegerInRange3_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1716 | |
| 1717 | /*** <<< FUNC-DECLS [OK-IntegerInRange3] >>> ***/ |
| 1718 | |
| 1719 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3; |
| 1720 | asn_struct_free_f OK_IntegerInRange3_free; |
| 1721 | asn_struct_print_f OK_IntegerInRange3_print; |
| 1722 | asn_constr_check_f OK_IntegerInRange3_constraint; |
| 1723 | ber_type_decoder_f OK_IntegerInRange3_decode_ber; |
| 1724 | der_type_encoder_f OK_IntegerInRange3_encode_der; |
| 1725 | xer_type_decoder_f OK_IntegerInRange3_decode_xer; |
| 1726 | xer_type_encoder_f OK_IntegerInRange3_encode_xer; |
| 1727 | |
| 1728 | /*** <<< CODE [OK-IntegerInRange3] >>> ***/ |
| 1729 | |
| 1730 | int |
| 1731 | OK_IntegerInRange3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1732 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1733 | long value; |
| 1734 | |
| 1735 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1736 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1737 | "%s: value not given (%s:%d)", |
| 1738 | td->name, __FILE__, __LINE__); |
| 1739 | return -1; |
| 1740 | } |
| 1741 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1742 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1743 | |
| 1744 | if((value >= -2147483648 && value <= 2147483647)) { |
| 1745 | /* Constraint check succeeded */ |
| 1746 | return 0; |
| 1747 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1748 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1749 | "%s: constraint failed (%s:%d)", |
| 1750 | td->name, __FILE__, __LINE__); |
| 1751 | return -1; |
| 1752 | } |
| 1753 | } |
| 1754 | |
| 1755 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1756 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1757 | * so here we adjust the DEF accordingly. |
| 1758 | */ |
| 1759 | static void |
| 1760 | OK_IntegerInRange3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1761 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 1762 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 1763 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 1764 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 1765 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 1766 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1767 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1768 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1769 | if(!td->per_constraints) |
| 1770 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1771 | td->elements = asn_DEF_NativeInteger.elements; |
| 1772 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 1773 | td->specifics = asn_DEF_NativeInteger.specifics; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1774 | } |
| 1775 | |
| 1776 | void |
| 1777 | OK_IntegerInRange3_free(asn_TYPE_descriptor_t *td, |
| 1778 | void *struct_ptr, int contents_only) { |
| 1779 | OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); |
| 1780 | td->free_struct(td, struct_ptr, contents_only); |
| 1781 | } |
| 1782 | |
| 1783 | int |
| 1784 | OK_IntegerInRange3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1785 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1786 | OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); |
| 1787 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1788 | } |
| 1789 | |
| 1790 | asn_dec_rval_t |
| 1791 | OK_IntegerInRange3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1792 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1793 | OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); |
| 1794 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1795 | } |
| 1796 | |
| 1797 | asn_enc_rval_t |
| 1798 | OK_IntegerInRange3_encode_der(asn_TYPE_descriptor_t *td, |
| 1799 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1800 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1801 | OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); |
| 1802 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1803 | } |
| 1804 | |
| 1805 | asn_dec_rval_t |
| 1806 | OK_IntegerInRange3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1807 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1808 | OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); |
| 1809 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1810 | } |
| 1811 | |
| 1812 | asn_enc_rval_t |
| 1813 | OK_IntegerInRange3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1814 | int ilevel, enum xer_encoder_flags_e flags, |
| 1815 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1816 | OK_IntegerInRange3_1_inherit_TYPE_descriptor(td); |
| 1817 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1818 | } |
| 1819 | |
| 1820 | |
| 1821 | /*** <<< STAT-DEFS [OK-IntegerInRange3] >>> ***/ |
| 1822 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1823 | static ber_tlv_tag_t asn_DEF_OK_IntegerInRange3_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1824 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1825 | }; |
| 1826 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3 = { |
| 1827 | "OK-IntegerInRange3", |
| 1828 | "OK-IntegerInRange3", |
| 1829 | OK_IntegerInRange3_free, |
| 1830 | OK_IntegerInRange3_print, |
| 1831 | OK_IntegerInRange3_constraint, |
| 1832 | OK_IntegerInRange3_decode_ber, |
| 1833 | OK_IntegerInRange3_encode_der, |
| 1834 | OK_IntegerInRange3_decode_xer, |
| 1835 | OK_IntegerInRange3_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1836 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1837 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1838 | asn_DEF_OK_IntegerInRange3_tags_1, |
| 1839 | sizeof(asn_DEF_OK_IntegerInRange3_tags_1) |
| 1840 | /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ |
| 1841 | asn_DEF_OK_IntegerInRange3_tags_1, /* Same as above */ |
| 1842 | sizeof(asn_DEF_OK_IntegerInRange3_tags_1) |
| 1843 | /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ |
| 1844 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1845 | 0, 0, /* No members */ |
| 1846 | 0 /* No specifics */ |
| 1847 | }; |
| 1848 | |
| 1849 | |
| 1850 | /*** <<< INCLUDES [OK-IntegerInRange4] >>> ***/ |
| 1851 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1852 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1853 | |
| 1854 | /*** <<< TYPE-DECLS [OK-IntegerInRange4] >>> ***/ |
| 1855 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1856 | typedef long OK_IntegerInRange4_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1857 | |
| 1858 | /*** <<< FUNC-DECLS [OK-IntegerInRange4] >>> ***/ |
| 1859 | |
| 1860 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4; |
| 1861 | asn_struct_free_f OK_IntegerInRange4_free; |
| 1862 | asn_struct_print_f OK_IntegerInRange4_print; |
| 1863 | asn_constr_check_f OK_IntegerInRange4_constraint; |
| 1864 | ber_type_decoder_f OK_IntegerInRange4_decode_ber; |
| 1865 | der_type_encoder_f OK_IntegerInRange4_encode_der; |
| 1866 | xer_type_decoder_f OK_IntegerInRange4_decode_xer; |
| 1867 | xer_type_encoder_f OK_IntegerInRange4_encode_xer; |
| 1868 | |
| 1869 | /*** <<< CODE [OK-IntegerInRange4] >>> ***/ |
| 1870 | |
| 1871 | int |
| 1872 | OK_IntegerInRange4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1873 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1874 | long value; |
| 1875 | |
| 1876 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1877 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1878 | "%s: value not given (%s:%d)", |
| 1879 | td->name, __FILE__, __LINE__); |
| 1880 | return -1; |
| 1881 | } |
| 1882 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1883 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1884 | |
| 1885 | if(((value == -2147483648) || (value == 2147483647))) { |
| 1886 | /* Constraint check succeeded */ |
| 1887 | return 0; |
| 1888 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 1889 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1890 | "%s: constraint failed (%s:%d)", |
| 1891 | td->name, __FILE__, __LINE__); |
| 1892 | return -1; |
| 1893 | } |
| 1894 | } |
| 1895 | |
| 1896 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1897 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1898 | * so here we adjust the DEF accordingly. |
| 1899 | */ |
| 1900 | static void |
| 1901 | OK_IntegerInRange4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1902 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 1903 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 1904 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 1905 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 1906 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 1907 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1908 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1909 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1910 | if(!td->per_constraints) |
| 1911 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1912 | td->elements = asn_DEF_NativeInteger.elements; |
| 1913 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 1914 | td->specifics = asn_DEF_NativeInteger.specifics; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1915 | } |
| 1916 | |
| 1917 | void |
| 1918 | OK_IntegerInRange4_free(asn_TYPE_descriptor_t *td, |
| 1919 | void *struct_ptr, int contents_only) { |
| 1920 | OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); |
| 1921 | td->free_struct(td, struct_ptr, contents_only); |
| 1922 | } |
| 1923 | |
| 1924 | int |
| 1925 | OK_IntegerInRange4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1926 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1927 | OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); |
| 1928 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1929 | } |
| 1930 | |
| 1931 | asn_dec_rval_t |
| 1932 | OK_IntegerInRange4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1933 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1934 | OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); |
| 1935 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1936 | } |
| 1937 | |
| 1938 | asn_enc_rval_t |
| 1939 | OK_IntegerInRange4_encode_der(asn_TYPE_descriptor_t *td, |
| 1940 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1941 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1942 | OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); |
| 1943 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1944 | } |
| 1945 | |
| 1946 | asn_dec_rval_t |
| 1947 | OK_IntegerInRange4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1948 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1949 | OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); |
| 1950 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1951 | } |
| 1952 | |
| 1953 | asn_enc_rval_t |
| 1954 | OK_IntegerInRange4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1955 | int ilevel, enum xer_encoder_flags_e flags, |
| 1956 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1957 | OK_IntegerInRange4_1_inherit_TYPE_descriptor(td); |
| 1958 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1959 | } |
| 1960 | |
| 1961 | |
| 1962 | /*** <<< STAT-DEFS [OK-IntegerInRange4] >>> ***/ |
| 1963 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1964 | static ber_tlv_tag_t asn_DEF_OK_IntegerInRange4_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1965 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1966 | }; |
| 1967 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = { |
| 1968 | "OK-IntegerInRange4", |
| 1969 | "OK-IntegerInRange4", |
| 1970 | OK_IntegerInRange4_free, |
| 1971 | OK_IntegerInRange4_print, |
| 1972 | OK_IntegerInRange4_constraint, |
| 1973 | OK_IntegerInRange4_decode_ber, |
| 1974 | OK_IntegerInRange4_encode_der, |
| 1975 | OK_IntegerInRange4_decode_xer, |
| 1976 | OK_IntegerInRange4_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1977 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1978 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1979 | asn_DEF_OK_IntegerInRange4_tags_1, |
| 1980 | sizeof(asn_DEF_OK_IntegerInRange4_tags_1) |
| 1981 | /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ |
| 1982 | asn_DEF_OK_IntegerInRange4_tags_1, /* Same as above */ |
| 1983 | sizeof(asn_DEF_OK_IntegerInRange4_tags_1) |
| 1984 | /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ |
| 1985 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1986 | 0, 0, /* No members */ |
| 1987 | 0 /* No specifics */ |
| 1988 | }; |
| 1989 | |
| 1990 | |
| 1991 | /*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/ |
| 1992 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1993 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1994 | |
| 1995 | /*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/ |
| 1996 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1997 | typedef long OK_IntegerInRange5_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1998 | |
| 1999 | /*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/ |
| 2000 | |
| 2001 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5; |
| 2002 | asn_struct_free_f OK_IntegerInRange5_free; |
| 2003 | asn_struct_print_f OK_IntegerInRange5_print; |
| 2004 | asn_constr_check_f OK_IntegerInRange5_constraint; |
| 2005 | ber_type_decoder_f OK_IntegerInRange5_decode_ber; |
| 2006 | der_type_encoder_f OK_IntegerInRange5_encode_der; |
| 2007 | xer_type_decoder_f OK_IntegerInRange5_decode_xer; |
| 2008 | xer_type_encoder_f OK_IntegerInRange5_encode_xer; |
| 2009 | |
| 2010 | /*** <<< CODE [OK-IntegerInRange5] >>> ***/ |
| 2011 | |
| 2012 | int |
| 2013 | OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2014 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 2015 | long value; |
| 2016 | |
| 2017 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 2018 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 2019 | "%s: value not given (%s:%d)", |
| 2020 | td->name, __FILE__, __LINE__); |
| 2021 | return -1; |
| 2022 | } |
| 2023 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2024 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 2025 | |
| 2026 | if(((value == -2147483648) || (value == 2147483647))) { |
| 2027 | /* Constraint check succeeded */ |
| 2028 | return 0; |
| 2029 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 2030 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 2031 | "%s: constraint failed (%s:%d)", |
| 2032 | td->name, __FILE__, __LINE__); |
| 2033 | return -1; |
| 2034 | } |
| 2035 | } |
| 2036 | |
| 2037 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2038 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 2039 | * so here we adjust the DEF accordingly. |
| 2040 | */ |
| 2041 | static void |
| 2042 | OK_IntegerInRange5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2043 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 2044 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 2045 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 2046 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 2047 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 2048 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2049 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2050 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2051 | if(!td->per_constraints) |
| 2052 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2053 | td->elements = asn_DEF_NativeInteger.elements; |
| 2054 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 2055 | td->specifics = asn_DEF_NativeInteger.specifics; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 2056 | } |
| 2057 | |
| 2058 | void |
| 2059 | OK_IntegerInRange5_free(asn_TYPE_descriptor_t *td, |
| 2060 | void *struct_ptr, int contents_only) { |
| 2061 | OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); |
| 2062 | td->free_struct(td, struct_ptr, contents_only); |
| 2063 | } |
| 2064 | |
| 2065 | int |
| 2066 | OK_IntegerInRange5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 2067 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 2068 | OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); |
| 2069 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 2070 | } |
| 2071 | |
| 2072 | asn_dec_rval_t |
| 2073 | OK_IntegerInRange5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2074 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 2075 | OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); |
| 2076 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 2077 | } |
| 2078 | |
| 2079 | asn_enc_rval_t |
| 2080 | OK_IntegerInRange5_encode_der(asn_TYPE_descriptor_t *td, |
| 2081 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 2082 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2083 | OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); |
| 2084 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 2085 | } |
| 2086 | |
| 2087 | asn_dec_rval_t |
| 2088 | OK_IntegerInRange5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2089 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 2090 | OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); |
| 2091 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 2092 | } |
| 2093 | |
| 2094 | asn_enc_rval_t |
| 2095 | OK_IntegerInRange5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 2096 | int ilevel, enum xer_encoder_flags_e flags, |
| 2097 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2098 | OK_IntegerInRange5_1_inherit_TYPE_descriptor(td); |
| 2099 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 2100 | } |
| 2101 | |
| 2102 | |
| 2103 | /*** <<< STAT-DEFS [OK-IntegerInRange5] >>> ***/ |
| 2104 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2105 | static ber_tlv_tag_t asn_DEF_OK_IntegerInRange5_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 2106 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 2107 | }; |
| 2108 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5 = { |
| 2109 | "OK-IntegerInRange5", |
| 2110 | "OK-IntegerInRange5", |
| 2111 | OK_IntegerInRange5_free, |
| 2112 | OK_IntegerInRange5_print, |
| 2113 | OK_IntegerInRange5_constraint, |
| 2114 | OK_IntegerInRange5_decode_ber, |
| 2115 | OK_IntegerInRange5_encode_der, |
| 2116 | OK_IntegerInRange5_decode_xer, |
| 2117 | OK_IntegerInRange5_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2118 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 2119 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2120 | asn_DEF_OK_IntegerInRange5_tags_1, |
| 2121 | sizeof(asn_DEF_OK_IntegerInRange5_tags_1) |
| 2122 | /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ |
| 2123 | asn_DEF_OK_IntegerInRange5_tags_1, /* Same as above */ |
| 2124 | sizeof(asn_DEF_OK_IntegerInRange5_tags_1) |
| 2125 | /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ |
| 2126 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 2127 | 0, 0, /* No members */ |
| 2128 | 0 /* No specifics */ |
| 2129 | }; |
| 2130 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2131 | |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 2132 | /*** <<< INCLUDES [NO-IntegerInRange6] >>> ***/ |
| 2133 | |
| 2134 | #include <INTEGER.h> |
| 2135 | |
| 2136 | /*** <<< TYPE-DECLS [NO-IntegerInRange6] >>> ***/ |
| 2137 | |
| 2138 | typedef INTEGER_t NO_IntegerInRange6_t; |
| 2139 | |
| 2140 | /*** <<< FUNC-DECLS [NO-IntegerInRange6] >>> ***/ |
| 2141 | |
| 2142 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6; |
| 2143 | asn_struct_free_f NO_IntegerInRange6_free; |
| 2144 | asn_struct_print_f NO_IntegerInRange6_print; |
| 2145 | asn_constr_check_f NO_IntegerInRange6_constraint; |
| 2146 | ber_type_decoder_f NO_IntegerInRange6_decode_ber; |
| 2147 | der_type_encoder_f NO_IntegerInRange6_encode_der; |
| 2148 | xer_type_decoder_f NO_IntegerInRange6_decode_xer; |
| 2149 | xer_type_encoder_f NO_IntegerInRange6_encode_xer; |
| 2150 | |
| 2151 | /*** <<< CODE [NO-IntegerInRange6] >>> ***/ |
| 2152 | |
| 2153 | int |
| 2154 | NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2155 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 2156 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 2157 | long value; |
| 2158 | |
| 2159 | if(!sptr) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 2160 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 2161 | "%s: value not given (%s:%d)", |
| 2162 | td->name, __FILE__, __LINE__); |
| 2163 | return -1; |
| 2164 | } |
| 2165 | |
| 2166 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 2167 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 2168 | "%s: value too large (%s:%d)", |
| 2169 | td->name, __FILE__, __LINE__); |
| 2170 | return -1; |
| 2171 | } |
| 2172 | |
| 2173 | if((value >= 0 && value <= 4294967295)) { |
| 2174 | /* Constraint check succeeded */ |
| 2175 | return 0; |
| 2176 | } else { |
Lev Walkin | 739d9bf | 2006-07-13 13:28:32 +0000 | [diff] [blame] | 2177 | _ASN_CTFAIL(app_key, td, sptr, |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 2178 | "%s: constraint failed (%s:%d)", |
| 2179 | td->name, __FILE__, __LINE__); |
| 2180 | return -1; |
| 2181 | } |
| 2182 | } |
| 2183 | |
| 2184 | /* |
| 2185 | * This type is implemented using INTEGER, |
| 2186 | * so here we adjust the DEF accordingly. |
| 2187 | */ |
| 2188 | static void |
| 2189 | NO_IntegerInRange6_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 2190 | td->free_struct = asn_DEF_INTEGER.free_struct; |
| 2191 | td->print_struct = asn_DEF_INTEGER.print_struct; |
| 2192 | td->ber_decoder = asn_DEF_INTEGER.ber_decoder; |
| 2193 | td->der_encoder = asn_DEF_INTEGER.der_encoder; |
| 2194 | td->xer_decoder = asn_DEF_INTEGER.xer_decoder; |
| 2195 | td->xer_encoder = asn_DEF_INTEGER.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2196 | td->uper_decoder = asn_DEF_INTEGER.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2197 | td->uper_encoder = asn_DEF_INTEGER.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2198 | if(!td->per_constraints) |
| 2199 | td->per_constraints = asn_DEF_INTEGER.per_constraints; |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 2200 | td->elements = asn_DEF_INTEGER.elements; |
| 2201 | td->elements_count = asn_DEF_INTEGER.elements_count; |
| 2202 | td->specifics = asn_DEF_INTEGER.specifics; |
| 2203 | } |
| 2204 | |
| 2205 | void |
| 2206 | NO_IntegerInRange6_free(asn_TYPE_descriptor_t *td, |
| 2207 | void *struct_ptr, int contents_only) { |
| 2208 | NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); |
| 2209 | td->free_struct(td, struct_ptr, contents_only); |
| 2210 | } |
| 2211 | |
| 2212 | int |
| 2213 | NO_IntegerInRange6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 2214 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 2215 | NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); |
| 2216 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 2217 | } |
| 2218 | |
| 2219 | asn_dec_rval_t |
| 2220 | NO_IntegerInRange6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2221 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 2222 | NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); |
| 2223 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 2224 | } |
| 2225 | |
| 2226 | asn_enc_rval_t |
| 2227 | NO_IntegerInRange6_encode_der(asn_TYPE_descriptor_t *td, |
| 2228 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 2229 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2230 | NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); |
| 2231 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 2232 | } |
| 2233 | |
| 2234 | asn_dec_rval_t |
| 2235 | NO_IntegerInRange6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2236 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 2237 | NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); |
| 2238 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 2239 | } |
| 2240 | |
| 2241 | asn_enc_rval_t |
| 2242 | NO_IntegerInRange6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 2243 | int ilevel, enum xer_encoder_flags_e flags, |
| 2244 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2245 | NO_IntegerInRange6_1_inherit_TYPE_descriptor(td); |
| 2246 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 2247 | } |
| 2248 | |
| 2249 | |
| 2250 | /*** <<< STAT-DEFS [NO-IntegerInRange6] >>> ***/ |
| 2251 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2252 | static ber_tlv_tag_t asn_DEF_NO_IntegerInRange6_tags_1[] = { |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 2253 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 2254 | }; |
| 2255 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { |
| 2256 | "NO-IntegerInRange6", |
| 2257 | "NO-IntegerInRange6", |
| 2258 | NO_IntegerInRange6_free, |
| 2259 | NO_IntegerInRange6_print, |
| 2260 | NO_IntegerInRange6_constraint, |
| 2261 | NO_IntegerInRange6_decode_ber, |
| 2262 | NO_IntegerInRange6_encode_der, |
| 2263 | NO_IntegerInRange6_decode_xer, |
| 2264 | NO_IntegerInRange6_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2265 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 2266 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2267 | asn_DEF_NO_IntegerInRange6_tags_1, |
| 2268 | sizeof(asn_DEF_NO_IntegerInRange6_tags_1) |
| 2269 | /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ |
| 2270 | asn_DEF_NO_IntegerInRange6_tags_1, /* Same as above */ |
| 2271 | sizeof(asn_DEF_NO_IntegerInRange6_tags_1) |
| 2272 | /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ |
| 2273 | 0, /* No PER visible constraints */ |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 2274 | 0, 0, /* No members */ |
| 2275 | 0 /* No specifics */ |
| 2276 | }; |
| 2277 | |
| 2278 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2279 | /*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/ |
| 2280 | |
| 2281 | #include <NativeInteger.h> |
| 2282 | |
| 2283 | /*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/ |
| 2284 | |
| 2285 | typedef enum CN_IntegerEnumerated1 { |
| 2286 | CN_IntegerEnumerated1_a = 1, |
| 2287 | CN_IntegerEnumerated1_b = 2 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 2288 | } e_CN_IntegerEnumerated1; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2289 | |
| 2290 | /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ |
| 2291 | |
| 2292 | typedef long CN_IntegerEnumerated1_t; |
| 2293 | |
| 2294 | /*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/ |
| 2295 | |
| 2296 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1; |
| 2297 | asn_struct_free_f CN_IntegerEnumerated1_free; |
| 2298 | asn_struct_print_f CN_IntegerEnumerated1_print; |
| 2299 | asn_constr_check_f CN_IntegerEnumerated1_constraint; |
| 2300 | ber_type_decoder_f CN_IntegerEnumerated1_decode_ber; |
| 2301 | der_type_encoder_f CN_IntegerEnumerated1_encode_der; |
| 2302 | xer_type_decoder_f CN_IntegerEnumerated1_decode_xer; |
| 2303 | xer_type_encoder_f CN_IntegerEnumerated1_encode_xer; |
| 2304 | |
| 2305 | /*** <<< CODE [CN-IntegerEnumerated1] >>> ***/ |
| 2306 | |
| 2307 | int |
| 2308 | CN_IntegerEnumerated1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2309 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2310 | /* Replace with underlying type checker */ |
| 2311 | td->check_constraints = asn_DEF_NativeInteger.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2312 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2313 | } |
| 2314 | |
| 2315 | /* |
| 2316 | * This type is implemented using NativeInteger, |
| 2317 | * so here we adjust the DEF accordingly. |
| 2318 | */ |
| 2319 | static void |
| 2320 | CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 2321 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 2322 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 2323 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 2324 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 2325 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 2326 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2327 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2328 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2329 | if(!td->per_constraints) |
| 2330 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2331 | td->elements = asn_DEF_NativeInteger.elements; |
| 2332 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 2333 | td->specifics = asn_DEF_NativeInteger.specifics; |
| 2334 | } |
| 2335 | |
| 2336 | void |
| 2337 | CN_IntegerEnumerated1_free(asn_TYPE_descriptor_t *td, |
| 2338 | void *struct_ptr, int contents_only) { |
| 2339 | CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); |
| 2340 | td->free_struct(td, struct_ptr, contents_only); |
| 2341 | } |
| 2342 | |
| 2343 | int |
| 2344 | CN_IntegerEnumerated1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 2345 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 2346 | CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); |
| 2347 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 2348 | } |
| 2349 | |
| 2350 | asn_dec_rval_t |
| 2351 | CN_IntegerEnumerated1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2352 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 2353 | CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); |
| 2354 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 2355 | } |
| 2356 | |
| 2357 | asn_enc_rval_t |
| 2358 | CN_IntegerEnumerated1_encode_der(asn_TYPE_descriptor_t *td, |
| 2359 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 2360 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2361 | CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); |
| 2362 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 2363 | } |
| 2364 | |
| 2365 | asn_dec_rval_t |
| 2366 | CN_IntegerEnumerated1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2367 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 2368 | CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); |
| 2369 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 2370 | } |
| 2371 | |
| 2372 | asn_enc_rval_t |
| 2373 | CN_IntegerEnumerated1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 2374 | int ilevel, enum xer_encoder_flags_e flags, |
| 2375 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2376 | CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td); |
| 2377 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 2378 | } |
| 2379 | |
| 2380 | |
| 2381 | /*** <<< STAT-DEFS [CN-IntegerEnumerated1] >>> ***/ |
| 2382 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2383 | static ber_tlv_tag_t asn_DEF_CN_IntegerEnumerated1_tags_1[] = { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2384 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 2385 | }; |
| 2386 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = { |
| 2387 | "CN-IntegerEnumerated1", |
| 2388 | "CN-IntegerEnumerated1", |
| 2389 | CN_IntegerEnumerated1_free, |
| 2390 | CN_IntegerEnumerated1_print, |
| 2391 | CN_IntegerEnumerated1_constraint, |
| 2392 | CN_IntegerEnumerated1_decode_ber, |
| 2393 | CN_IntegerEnumerated1_encode_der, |
| 2394 | CN_IntegerEnumerated1_decode_xer, |
| 2395 | CN_IntegerEnumerated1_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2396 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2397 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2398 | asn_DEF_CN_IntegerEnumerated1_tags_1, |
| 2399 | sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) |
| 2400 | /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ |
| 2401 | asn_DEF_CN_IntegerEnumerated1_tags_1, /* Same as above */ |
| 2402 | sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) |
| 2403 | /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ |
| 2404 | 0, /* No PER visible constraints */ |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2405 | 0, 0, /* Defined elsewhere */ |
| 2406 | 0 /* No specifics */ |
| 2407 | }; |
| 2408 | |
| 2409 | |
| 2410 | /*** <<< INCLUDES [NO-IntegerEnumerated2] >>> ***/ |
| 2411 | |
| 2412 | #include <INTEGER.h> |
| 2413 | |
| 2414 | /*** <<< DEPS [NO-IntegerEnumerated2] >>> ***/ |
| 2415 | |
| 2416 | typedef enum NO_IntegerEnumerated2 { |
| 2417 | NO_IntegerEnumerated2_a = 1, |
| 2418 | NO_IntegerEnumerated2_b = 3000000000 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 2419 | } e_NO_IntegerEnumerated2; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2420 | |
| 2421 | /*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/ |
| 2422 | |
| 2423 | typedef INTEGER_t NO_IntegerEnumerated2_t; |
| 2424 | |
| 2425 | /*** <<< FUNC-DECLS [NO-IntegerEnumerated2] >>> ***/ |
| 2426 | |
| 2427 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2; |
| 2428 | asn_struct_free_f NO_IntegerEnumerated2_free; |
| 2429 | asn_struct_print_f NO_IntegerEnumerated2_print; |
| 2430 | asn_constr_check_f NO_IntegerEnumerated2_constraint; |
| 2431 | ber_type_decoder_f NO_IntegerEnumerated2_decode_ber; |
| 2432 | der_type_encoder_f NO_IntegerEnumerated2_encode_der; |
| 2433 | xer_type_decoder_f NO_IntegerEnumerated2_decode_xer; |
| 2434 | xer_type_encoder_f NO_IntegerEnumerated2_encode_xer; |
| 2435 | |
| 2436 | /*** <<< CODE [NO-IntegerEnumerated2] >>> ***/ |
| 2437 | |
| 2438 | int |
| 2439 | NO_IntegerEnumerated2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2440 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2441 | /* Replace with underlying type checker */ |
| 2442 | td->check_constraints = asn_DEF_INTEGER.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2443 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2444 | } |
| 2445 | |
| 2446 | /* |
| 2447 | * This type is implemented using INTEGER, |
| 2448 | * so here we adjust the DEF accordingly. |
| 2449 | */ |
| 2450 | static void |
| 2451 | NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 2452 | td->free_struct = asn_DEF_INTEGER.free_struct; |
| 2453 | td->print_struct = asn_DEF_INTEGER.print_struct; |
| 2454 | td->ber_decoder = asn_DEF_INTEGER.ber_decoder; |
| 2455 | td->der_encoder = asn_DEF_INTEGER.der_encoder; |
| 2456 | td->xer_decoder = asn_DEF_INTEGER.xer_decoder; |
| 2457 | td->xer_encoder = asn_DEF_INTEGER.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2458 | td->uper_decoder = asn_DEF_INTEGER.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2459 | td->uper_encoder = asn_DEF_INTEGER.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2460 | if(!td->per_constraints) |
| 2461 | td->per_constraints = asn_DEF_INTEGER.per_constraints; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2462 | td->elements = asn_DEF_INTEGER.elements; |
| 2463 | td->elements_count = asn_DEF_INTEGER.elements_count; |
| 2464 | td->specifics = asn_DEF_INTEGER.specifics; |
| 2465 | } |
| 2466 | |
| 2467 | void |
| 2468 | NO_IntegerEnumerated2_free(asn_TYPE_descriptor_t *td, |
| 2469 | void *struct_ptr, int contents_only) { |
| 2470 | NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); |
| 2471 | td->free_struct(td, struct_ptr, contents_only); |
| 2472 | } |
| 2473 | |
| 2474 | int |
| 2475 | NO_IntegerEnumerated2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 2476 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 2477 | NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); |
| 2478 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 2479 | } |
| 2480 | |
| 2481 | asn_dec_rval_t |
| 2482 | NO_IntegerEnumerated2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2483 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 2484 | NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); |
| 2485 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 2486 | } |
| 2487 | |
| 2488 | asn_enc_rval_t |
| 2489 | NO_IntegerEnumerated2_encode_der(asn_TYPE_descriptor_t *td, |
| 2490 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 2491 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2492 | NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); |
| 2493 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 2494 | } |
| 2495 | |
| 2496 | asn_dec_rval_t |
| 2497 | NO_IntegerEnumerated2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2498 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 2499 | NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); |
| 2500 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 2501 | } |
| 2502 | |
| 2503 | asn_enc_rval_t |
| 2504 | NO_IntegerEnumerated2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 2505 | int ilevel, enum xer_encoder_flags_e flags, |
| 2506 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2507 | NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td); |
| 2508 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 2509 | } |
| 2510 | |
| 2511 | |
| 2512 | /*** <<< STAT-DEFS [NO-IntegerEnumerated2] >>> ***/ |
| 2513 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2514 | static ber_tlv_tag_t asn_DEF_NO_IntegerEnumerated2_tags_1[] = { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2515 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 2516 | }; |
| 2517 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2 = { |
| 2518 | "NO-IntegerEnumerated2", |
| 2519 | "NO-IntegerEnumerated2", |
| 2520 | NO_IntegerEnumerated2_free, |
| 2521 | NO_IntegerEnumerated2_print, |
| 2522 | NO_IntegerEnumerated2_constraint, |
| 2523 | NO_IntegerEnumerated2_decode_ber, |
| 2524 | NO_IntegerEnumerated2_encode_der, |
| 2525 | NO_IntegerEnumerated2_decode_xer, |
| 2526 | NO_IntegerEnumerated2_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2527 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2528 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2529 | asn_DEF_NO_IntegerEnumerated2_tags_1, |
| 2530 | sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) |
| 2531 | /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ |
| 2532 | asn_DEF_NO_IntegerEnumerated2_tags_1, /* Same as above */ |
| 2533 | sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) |
| 2534 | /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ |
| 2535 | 0, /* No PER visible constraints */ |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 2536 | 0, 0, /* Defined elsewhere */ |
| 2537 | 0 /* No specifics */ |
| 2538 | }; |
| 2539 | |