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