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