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