Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [MinMax] >>> ***/ |
| 3 | |
| 4 | #include <INTEGER.h> |
| 5 | |
| 6 | /*** <<< TYPE-DECLS [MinMax] >>> ***/ |
| 7 | |
| 8 | typedef INTEGER_t MinMax_16P0_t; |
| 9 | |
| 10 | /*** <<< FUNC-DECLS [MinMax] >>> ***/ |
| 11 | |
| 12 | extern asn_TYPE_descriptor_t asn_DEF_MinMax_16P0; |
| 13 | asn_struct_free_f MinMax_16P0_free; |
| 14 | asn_struct_print_f MinMax_16P0_print; |
| 15 | asn_constr_check_f MinMax_16P0_constraint; |
| 16 | ber_type_decoder_f MinMax_16P0_decode_ber; |
| 17 | der_type_encoder_f MinMax_16P0_encode_der; |
| 18 | xer_type_decoder_f MinMax_16P0_decode_xer; |
| 19 | xer_type_encoder_f MinMax_16P0_encode_xer; |
| 20 | |
| 21 | /*** <<< CODE [MinMax] >>> ***/ |
| 22 | |
| 23 | int |
| 24 | MinMax_16P0_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 25 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 26 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 27 | long value; |
| 28 | |
| 29 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 30 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 31 | "%s: value not given (%s:%d)", |
| 32 | td->name, __FILE__, __LINE__); |
| 33 | return -1; |
| 34 | } |
| 35 | |
| 36 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 37 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 38 | "%s: value too large (%s:%d)", |
| 39 | td->name, __FILE__, __LINE__); |
| 40 | return -1; |
| 41 | } |
| 42 | |
| 43 | if((value >= 3)) { |
| 44 | /* Constraint check succeeded */ |
| 45 | return 0; |
| 46 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 47 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 48 | "%s: constraint failed (%s:%d)", |
| 49 | td->name, __FILE__, __LINE__); |
| 50 | return -1; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /* |
| 55 | * This type is implemented using INTEGER, |
| 56 | * so here we adjust the DEF accordingly. |
| 57 | */ |
| 58 | static void |
| 59 | MinMax_16P0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 60 | td->free_struct = asn_DEF_INTEGER.free_struct; |
| 61 | td->print_struct = asn_DEF_INTEGER.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 62 | td->check_constraints = asn_DEF_INTEGER.check_constraints; |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 63 | td->ber_decoder = asn_DEF_INTEGER.ber_decoder; |
| 64 | td->der_encoder = asn_DEF_INTEGER.der_encoder; |
| 65 | td->xer_decoder = asn_DEF_INTEGER.xer_decoder; |
| 66 | td->xer_encoder = asn_DEF_INTEGER.xer_encoder; |
| 67 | td->uper_decoder = asn_DEF_INTEGER.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 68 | td->uper_encoder = asn_DEF_INTEGER.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame^] | 69 | td->oer_decoder = asn_DEF_INTEGER.oer_decoder; |
| 70 | td->oer_encoder = asn_DEF_INTEGER.oer_encoder; |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 71 | if(!td->per_constraints) |
| 72 | td->per_constraints = asn_DEF_INTEGER.per_constraints; |
| 73 | td->elements = asn_DEF_INTEGER.elements; |
| 74 | td->elements_count = asn_DEF_INTEGER.elements_count; |
| 75 | td->specifics = asn_DEF_INTEGER.specifics; |
| 76 | } |
| 77 | |
| 78 | void |
| 79 | MinMax_16P0_free(asn_TYPE_descriptor_t *td, |
| 80 | void *struct_ptr, int contents_only) { |
| 81 | MinMax_16P0_1_inherit_TYPE_descriptor(td); |
| 82 | td->free_struct(td, struct_ptr, contents_only); |
| 83 | } |
| 84 | |
| 85 | int |
| 86 | MinMax_16P0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 87 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 88 | MinMax_16P0_1_inherit_TYPE_descriptor(td); |
| 89 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 90 | } |
| 91 | |
| 92 | asn_dec_rval_t |
| 93 | MinMax_16P0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 94 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 95 | MinMax_16P0_1_inherit_TYPE_descriptor(td); |
| 96 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 97 | } |
| 98 | |
| 99 | asn_enc_rval_t |
| 100 | MinMax_16P0_encode_der(asn_TYPE_descriptor_t *td, |
| 101 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 102 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 103 | MinMax_16P0_1_inherit_TYPE_descriptor(td); |
| 104 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 105 | } |
| 106 | |
| 107 | asn_dec_rval_t |
| 108 | MinMax_16P0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 109 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 110 | MinMax_16P0_1_inherit_TYPE_descriptor(td); |
| 111 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 112 | } |
| 113 | |
| 114 | asn_enc_rval_t |
| 115 | MinMax_16P0_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 116 | int ilevel, enum xer_encoder_flags_e flags, |
| 117 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 118 | MinMax_16P0_1_inherit_TYPE_descriptor(td); |
| 119 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 120 | } |
| 121 | |
| 122 | |
| 123 | /*** <<< STAT-DEFS [MinMax] >>> ***/ |
| 124 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 125 | static const ber_tlv_tag_t asn_DEF_MinMax_16P0_tags_1[] = { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 126 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 127 | }; |
| 128 | asn_TYPE_descriptor_t asn_DEF_MinMax_16P0 = { |
| 129 | "MinMax", |
| 130 | "MinMax", |
| 131 | MinMax_16P0_free, |
| 132 | MinMax_16P0_print, |
| 133 | MinMax_16P0_constraint, |
| 134 | MinMax_16P0_decode_ber, |
| 135 | MinMax_16P0_encode_der, |
| 136 | MinMax_16P0_decode_xer, |
| 137 | MinMax_16P0_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 138 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame^] | 139 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 140 | 0, /* Use generic outmost tag fetcher */ |
| 141 | asn_DEF_MinMax_16P0_tags_1, |
| 142 | sizeof(asn_DEF_MinMax_16P0_tags_1) |
| 143 | /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ |
| 144 | asn_DEF_MinMax_16P0_tags_1, /* Same as above */ |
| 145 | sizeof(asn_DEF_MinMax_16P0_tags_1) |
| 146 | /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ |
| 147 | 0, /* No PER visible constraints */ |
| 148 | 0, 0, /* No members */ |
| 149 | 0 /* No specifics */ |
| 150 | }; |
| 151 | |
| 152 | |
| 153 | /*** <<< INCLUDES [ThreePlus] >>> ***/ |
| 154 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 155 | #include "MinMax.h" |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 156 | |
| 157 | /*** <<< TYPE-DECLS [ThreePlus] >>> ***/ |
| 158 | |
| 159 | typedef MinMax_16P0_t ThreePlus_t; |
| 160 | |
| 161 | /*** <<< FUNC-DECLS [ThreePlus] >>> ***/ |
| 162 | |
| 163 | extern asn_TYPE_descriptor_t asn_DEF_ThreePlus; |
| 164 | asn_struct_free_f ThreePlus_free; |
| 165 | asn_struct_print_f ThreePlus_print; |
| 166 | asn_constr_check_f ThreePlus_constraint; |
| 167 | ber_type_decoder_f ThreePlus_decode_ber; |
| 168 | der_type_encoder_f ThreePlus_encode_der; |
| 169 | xer_type_decoder_f ThreePlus_decode_xer; |
| 170 | xer_type_encoder_f ThreePlus_encode_xer; |
| 171 | |
| 172 | /*** <<< CODE [ThreePlus] >>> ***/ |
| 173 | |
| 174 | int |
| 175 | ThreePlus_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 | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 177 | const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr; |
| 178 | long value; |
| 179 | |
| 180 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 181 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 182 | "%s: value not given (%s:%d)", |
| 183 | td->name, __FILE__, __LINE__); |
| 184 | return -1; |
| 185 | } |
| 186 | |
| 187 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 188 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 189 | "%s: value too large (%s:%d)", |
| 190 | td->name, __FILE__, __LINE__); |
| 191 | return -1; |
| 192 | } |
| 193 | |
| 194 | if((value >= 3)) { |
| 195 | /* Constraint check succeeded */ |
| 196 | return 0; |
| 197 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 198 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 199 | "%s: constraint failed (%s:%d)", |
| 200 | td->name, __FILE__, __LINE__); |
| 201 | return -1; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | /* |
| 206 | * This type is implemented using MinMax_16P0, |
| 207 | * so here we adjust the DEF accordingly. |
| 208 | */ |
| 209 | static void |
| 210 | ThreePlus_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 211 | td->free_struct = asn_DEF_MinMax_16P0.free_struct; |
| 212 | td->print_struct = asn_DEF_MinMax_16P0.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 213 | td->check_constraints = asn_DEF_MinMax_16P0.check_constraints; |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 214 | td->ber_decoder = asn_DEF_MinMax_16P0.ber_decoder; |
| 215 | td->der_encoder = asn_DEF_MinMax_16P0.der_encoder; |
| 216 | td->xer_decoder = asn_DEF_MinMax_16P0.xer_decoder; |
| 217 | td->xer_encoder = asn_DEF_MinMax_16P0.xer_encoder; |
| 218 | td->uper_decoder = asn_DEF_MinMax_16P0.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 219 | td->uper_encoder = asn_DEF_MinMax_16P0.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame^] | 220 | td->oer_decoder = asn_DEF_MinMax_16P0.oer_decoder; |
| 221 | td->oer_encoder = asn_DEF_MinMax_16P0.oer_encoder; |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 222 | if(!td->per_constraints) |
| 223 | td->per_constraints = asn_DEF_MinMax_16P0.per_constraints; |
| 224 | td->elements = asn_DEF_MinMax_16P0.elements; |
| 225 | td->elements_count = asn_DEF_MinMax_16P0.elements_count; |
| 226 | td->specifics = asn_DEF_MinMax_16P0.specifics; |
| 227 | } |
| 228 | |
| 229 | void |
| 230 | ThreePlus_free(asn_TYPE_descriptor_t *td, |
| 231 | void *struct_ptr, int contents_only) { |
| 232 | ThreePlus_1_inherit_TYPE_descriptor(td); |
| 233 | td->free_struct(td, struct_ptr, contents_only); |
| 234 | } |
| 235 | |
| 236 | int |
| 237 | ThreePlus_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 238 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 239 | ThreePlus_1_inherit_TYPE_descriptor(td); |
| 240 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 241 | } |
| 242 | |
| 243 | asn_dec_rval_t |
| 244 | ThreePlus_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 245 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 246 | ThreePlus_1_inherit_TYPE_descriptor(td); |
| 247 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 248 | } |
| 249 | |
| 250 | asn_enc_rval_t |
| 251 | ThreePlus_encode_der(asn_TYPE_descriptor_t *td, |
| 252 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 253 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 254 | ThreePlus_1_inherit_TYPE_descriptor(td); |
| 255 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 256 | } |
| 257 | |
| 258 | asn_dec_rval_t |
| 259 | ThreePlus_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 260 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 261 | ThreePlus_1_inherit_TYPE_descriptor(td); |
| 262 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 263 | } |
| 264 | |
| 265 | asn_enc_rval_t |
| 266 | ThreePlus_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 267 | int ilevel, enum xer_encoder_flags_e flags, |
| 268 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 269 | ThreePlus_1_inherit_TYPE_descriptor(td); |
| 270 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 271 | } |
| 272 | |
| 273 | |
| 274 | /*** <<< STAT-DEFS [ThreePlus] >>> ***/ |
| 275 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 276 | static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 277 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 278 | }; |
| 279 | asn_TYPE_descriptor_t asn_DEF_ThreePlus = { |
| 280 | "ThreePlus", |
| 281 | "ThreePlus", |
| 282 | ThreePlus_free, |
| 283 | ThreePlus_print, |
| 284 | ThreePlus_constraint, |
| 285 | ThreePlus_decode_ber, |
| 286 | ThreePlus_encode_der, |
| 287 | ThreePlus_decode_xer, |
| 288 | ThreePlus_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 289 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame^] | 290 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 291 | 0, /* Use generic outmost tag fetcher */ |
| 292 | asn_DEF_ThreePlus_tags_1, |
| 293 | sizeof(asn_DEF_ThreePlus_tags_1) |
| 294 | /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ |
| 295 | asn_DEF_ThreePlus_tags_1, /* Same as above */ |
| 296 | sizeof(asn_DEF_ThreePlus_tags_1) |
| 297 | /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ |
| 298 | 0, /* No PER visible constraints */ |
| 299 | 0, 0, /* No members */ |
| 300 | 0 /* No specifics */ |
| 301 | }; |
| 302 | |