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