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