Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Int1] >>> ***/ |
| 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 [Int1] >>> ***/ |
| 7 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 8 | typedef long Int1_t; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 9 | |
| 10 | /*** <<< FUNC-DECLS [Int1] >>> ***/ |
| 11 | |
| 12 | extern asn_TYPE_descriptor_t asn_DEF_Int1; |
| 13 | asn_struct_free_f Int1_free; |
| 14 | asn_struct_print_f Int1_print; |
| 15 | asn_constr_check_f Int1_constraint; |
| 16 | ber_type_decoder_f Int1_decode_ber; |
| 17 | der_type_encoder_f Int1_encode_der; |
| 18 | xer_type_decoder_f Int1_decode_xer; |
| 19 | xer_type_encoder_f Int1_encode_xer; |
| 20 | per_type_decoder_f Int1_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 21 | per_type_encoder_f Int1_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 22 | |
| 23 | /*** <<< CODE [Int1] >>> ***/ |
| 24 | |
| 25 | int |
| 26 | Int1_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 | Int1_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 | Int1_free(asn_TYPE_descriptor_t *td, |
| 61 | void *struct_ptr, int contents_only) { |
| 62 | Int1_1_inherit_TYPE_descriptor(td); |
| 63 | td->free_struct(td, struct_ptr, contents_only); |
| 64 | } |
| 65 | |
| 66 | int |
| 67 | Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 68 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 69 | Int1_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 | Int1_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 | Int1_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 | Int1_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 | Int1_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 | Int1_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 | Int1_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 | Int1_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 | Int1_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 | Int1_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 | Int1_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 | Int1_encode_uper(asn_TYPE_descriptor_t *td, |
| 112 | asn_per_constraints_t *constraints, |
| 113 | void *structure, asn_per_outp_t *per_out) { |
| 114 | Int1_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 [Int1] >>> ***/ |
| 120 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 121 | static const ber_tlv_tag_t asn_DEF_Int1_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_Int1 = { |
| 125 | "Int1", |
| 126 | "Int1", |
| 127 | Int1_free, |
| 128 | Int1_print, |
| 129 | Int1_constraint, |
| 130 | Int1_decode_ber, |
| 131 | Int1_encode_der, |
| 132 | Int1_decode_xer, |
| 133 | Int1_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 | Int1_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 136 | Int1_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 137 | 0, /* Use generic outmost tag fetcher */ |
| 138 | asn_DEF_Int1_tags_1, |
| 139 | sizeof(asn_DEF_Int1_tags_1) |
| 140 | /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */ |
| 141 | asn_DEF_Int1_tags_1, /* Same as above */ |
| 142 | sizeof(asn_DEF_Int1_tags_1) |
| 143 | /sizeof(asn_DEF_Int1_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 [Int2] >>> ***/ |
| 152 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 153 | #include "Int1.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 154 | |
| 155 | /*** <<< TYPE-DECLS [Int2] >>> ***/ |
| 156 | |
| 157 | typedef Int1_t Int2_t; |
| 158 | |
| 159 | /*** <<< FUNC-DECLS [Int2] >>> ***/ |
| 160 | |
| 161 | extern asn_TYPE_descriptor_t asn_DEF_Int2; |
| 162 | asn_struct_free_f Int2_free; |
| 163 | asn_struct_print_f Int2_print; |
| 164 | asn_constr_check_f Int2_constraint; |
| 165 | ber_type_decoder_f Int2_decode_ber; |
| 166 | der_type_encoder_f Int2_encode_der; |
| 167 | xer_type_decoder_f Int2_decode_xer; |
| 168 | xer_type_encoder_f Int2_encode_xer; |
| 169 | per_type_decoder_f Int2_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 170 | per_type_encoder_f Int2_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 171 | |
| 172 | /*** <<< CODE [Int2] >>> ***/ |
| 173 | |
| 174 | int |
| 175 | Int2_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 | long value; |
| 178 | |
| 179 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 180 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 181 | "%s: value not given (%s:%d)", |
| 182 | td->name, __FILE__, __LINE__); |
| 183 | return -1; |
| 184 | } |
| 185 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 186 | value = *(const long *)sptr; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 187 | |
| 188 | if((value >= 0)) { |
| 189 | /* Constraint check succeeded */ |
| 190 | return 0; |
| 191 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 192 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 193 | "%s: constraint failed (%s:%d)", |
| 194 | td->name, __FILE__, __LINE__); |
| 195 | return -1; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | /* |
| 200 | * This type is implemented using Int1, |
| 201 | * so here we adjust the DEF accordingly. |
| 202 | */ |
| 203 | static void |
| 204 | Int2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 205 | td->free_struct = asn_DEF_Int1.free_struct; |
| 206 | td->print_struct = asn_DEF_Int1.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 207 | td->check_constraints = asn_DEF_Int1.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 208 | td->ber_decoder = asn_DEF_Int1.ber_decoder; |
| 209 | td->der_encoder = asn_DEF_Int1.der_encoder; |
| 210 | td->xer_decoder = asn_DEF_Int1.xer_decoder; |
| 211 | td->xer_encoder = asn_DEF_Int1.xer_encoder; |
| 212 | td->uper_decoder = asn_DEF_Int1.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 213 | td->uper_encoder = asn_DEF_Int1.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 214 | td->oer_decoder = asn_DEF_Int1.oer_decoder; |
| 215 | td->oer_encoder = asn_DEF_Int1.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 216 | if(!td->oer_constraints) |
| 217 | td->oer_constraints = asn_DEF_Int1.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 218 | if(!td->per_constraints) |
| 219 | td->per_constraints = asn_DEF_Int1.per_constraints; |
| 220 | td->elements = asn_DEF_Int1.elements; |
| 221 | td->elements_count = asn_DEF_Int1.elements_count; |
| 222 | td->specifics = asn_DEF_Int1.specifics; |
| 223 | } |
| 224 | |
| 225 | void |
| 226 | Int2_free(asn_TYPE_descriptor_t *td, |
| 227 | void *struct_ptr, int contents_only) { |
| 228 | Int2_1_inherit_TYPE_descriptor(td); |
| 229 | td->free_struct(td, struct_ptr, contents_only); |
| 230 | } |
| 231 | |
| 232 | int |
| 233 | Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 234 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 235 | Int2_1_inherit_TYPE_descriptor(td); |
| 236 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 237 | } |
| 238 | |
| 239 | asn_dec_rval_t |
| 240 | Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 241 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 242 | Int2_1_inherit_TYPE_descriptor(td); |
| 243 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 244 | } |
| 245 | |
| 246 | asn_enc_rval_t |
| 247 | Int2_encode_der(asn_TYPE_descriptor_t *td, |
| 248 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 249 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 250 | Int2_1_inherit_TYPE_descriptor(td); |
| 251 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 252 | } |
| 253 | |
| 254 | asn_dec_rval_t |
| 255 | Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 256 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 257 | Int2_1_inherit_TYPE_descriptor(td); |
| 258 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 259 | } |
| 260 | |
| 261 | asn_enc_rval_t |
| 262 | Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 263 | int ilevel, enum xer_encoder_flags_e flags, |
| 264 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 265 | Int2_1_inherit_TYPE_descriptor(td); |
| 266 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 267 | } |
| 268 | |
| 269 | asn_dec_rval_t |
| 270 | Int2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 271 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 272 | Int2_1_inherit_TYPE_descriptor(td); |
| 273 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 274 | } |
| 275 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 276 | asn_enc_rval_t |
| 277 | Int2_encode_uper(asn_TYPE_descriptor_t *td, |
| 278 | asn_per_constraints_t *constraints, |
| 279 | void *structure, asn_per_outp_t *per_out) { |
| 280 | Int2_1_inherit_TYPE_descriptor(td); |
| 281 | return td->uper_encoder(td, constraints, structure, per_out); |
| 282 | } |
| 283 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 284 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 285 | /*** <<< CTDEFS [Int2] >>> ***/ |
| 286 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 287 | static asn_per_constraints_t asn_PER_type_Int2_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 288 | { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (0..MAX) */, |
| 289 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 290 | 0, 0 /* No PER value map */ |
| 291 | }; |
| 292 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 293 | /*** <<< STAT-DEFS [Int2] >>> ***/ |
| 294 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 295 | static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 296 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 297 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 298 | asn_TYPE_descriptor_t asn_DEF_Int2 = { |
| 299 | "Int2", |
| 300 | "Int2", |
| 301 | Int2_free, |
| 302 | Int2_print, |
| 303 | Int2_constraint, |
| 304 | Int2_decode_ber, |
| 305 | Int2_encode_der, |
| 306 | Int2_decode_xer, |
| 307 | Int2_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 308 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 309 | Int2_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 310 | Int2_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 311 | 0, /* Use generic outmost tag fetcher */ |
| 312 | asn_DEF_Int2_tags_1, |
| 313 | sizeof(asn_DEF_Int2_tags_1) |
| 314 | /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */ |
| 315 | asn_DEF_Int2_tags_1, /* Same as above */ |
| 316 | sizeof(asn_DEF_Int2_tags_1) |
| 317 | /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 318 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 319 | &asn_PER_type_Int2_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 320 | 0, 0, /* No members */ |
| 321 | 0 /* No specifics */ |
| 322 | }; |
| 323 | |
| 324 | |
| 325 | /*** <<< INCLUDES [Int3] >>> ***/ |
| 326 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 327 | #include "Int2.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 328 | |
| 329 | /*** <<< TYPE-DECLS [Int3] >>> ***/ |
| 330 | |
| 331 | typedef Int2_t Int3_t; |
| 332 | |
| 333 | /*** <<< FUNC-DECLS [Int3] >>> ***/ |
| 334 | |
| 335 | extern asn_TYPE_descriptor_t asn_DEF_Int3; |
| 336 | asn_struct_free_f Int3_free; |
| 337 | asn_struct_print_f Int3_print; |
| 338 | asn_constr_check_f Int3_constraint; |
| 339 | ber_type_decoder_f Int3_decode_ber; |
| 340 | der_type_encoder_f Int3_encode_der; |
| 341 | xer_type_decoder_f Int3_decode_xer; |
| 342 | xer_type_encoder_f Int3_encode_xer; |
| 343 | per_type_decoder_f Int3_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 344 | per_type_encoder_f Int3_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 345 | |
| 346 | /*** <<< CODE [Int3] >>> ***/ |
| 347 | |
| 348 | int |
| 349 | Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 350 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 351 | long value; |
| 352 | |
| 353 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 354 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 355 | "%s: value not given (%s:%d)", |
| 356 | td->name, __FILE__, __LINE__); |
| 357 | return -1; |
| 358 | } |
| 359 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 360 | value = *(const long *)sptr; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 361 | |
| 362 | if((value >= 0 && value <= 10)) { |
| 363 | /* Constraint check succeeded */ |
| 364 | return 0; |
| 365 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 366 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 367 | "%s: constraint failed (%s:%d)", |
| 368 | td->name, __FILE__, __LINE__); |
| 369 | return -1; |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | /* |
| 374 | * This type is implemented using Int2, |
| 375 | * so here we adjust the DEF accordingly. |
| 376 | */ |
| 377 | static void |
| 378 | Int3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 379 | td->free_struct = asn_DEF_Int2.free_struct; |
| 380 | td->print_struct = asn_DEF_Int2.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 381 | td->check_constraints = asn_DEF_Int2.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 382 | td->ber_decoder = asn_DEF_Int2.ber_decoder; |
| 383 | td->der_encoder = asn_DEF_Int2.der_encoder; |
| 384 | td->xer_decoder = asn_DEF_Int2.xer_decoder; |
| 385 | td->xer_encoder = asn_DEF_Int2.xer_encoder; |
| 386 | td->uper_decoder = asn_DEF_Int2.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 387 | td->uper_encoder = asn_DEF_Int2.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 388 | td->oer_decoder = asn_DEF_Int2.oer_decoder; |
| 389 | td->oer_encoder = asn_DEF_Int2.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 390 | if(!td->oer_constraints) |
| 391 | td->oer_constraints = asn_DEF_Int2.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 392 | if(!td->per_constraints) |
| 393 | td->per_constraints = asn_DEF_Int2.per_constraints; |
| 394 | td->elements = asn_DEF_Int2.elements; |
| 395 | td->elements_count = asn_DEF_Int2.elements_count; |
| 396 | td->specifics = asn_DEF_Int2.specifics; |
| 397 | } |
| 398 | |
| 399 | void |
| 400 | Int3_free(asn_TYPE_descriptor_t *td, |
| 401 | void *struct_ptr, int contents_only) { |
| 402 | Int3_1_inherit_TYPE_descriptor(td); |
| 403 | td->free_struct(td, struct_ptr, contents_only); |
| 404 | } |
| 405 | |
| 406 | int |
| 407 | Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 408 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 409 | Int3_1_inherit_TYPE_descriptor(td); |
| 410 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 411 | } |
| 412 | |
| 413 | asn_dec_rval_t |
| 414 | Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 415 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 416 | Int3_1_inherit_TYPE_descriptor(td); |
| 417 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 418 | } |
| 419 | |
| 420 | asn_enc_rval_t |
| 421 | Int3_encode_der(asn_TYPE_descriptor_t *td, |
| 422 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 423 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 424 | Int3_1_inherit_TYPE_descriptor(td); |
| 425 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 426 | } |
| 427 | |
| 428 | asn_dec_rval_t |
| 429 | Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 430 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 431 | Int3_1_inherit_TYPE_descriptor(td); |
| 432 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 433 | } |
| 434 | |
| 435 | asn_enc_rval_t |
| 436 | Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 437 | int ilevel, enum xer_encoder_flags_e flags, |
| 438 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 439 | Int3_1_inherit_TYPE_descriptor(td); |
| 440 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 441 | } |
| 442 | |
| 443 | asn_dec_rval_t |
| 444 | Int3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 445 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 446 | Int3_1_inherit_TYPE_descriptor(td); |
| 447 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 448 | } |
| 449 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 450 | asn_enc_rval_t |
| 451 | Int3_encode_uper(asn_TYPE_descriptor_t *td, |
| 452 | asn_per_constraints_t *constraints, |
| 453 | void *structure, asn_per_outp_t *per_out) { |
| 454 | Int3_1_inherit_TYPE_descriptor(td); |
| 455 | return td->uper_encoder(td, constraints, structure, per_out); |
| 456 | } |
| 457 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 458 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 459 | /*** <<< CTDEFS [Int3] >>> ***/ |
| 460 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 461 | static asn_per_constraints_t asn_PER_type_Int3_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 462 | { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */, |
| 463 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 464 | 0, 0 /* No PER value map */ |
| 465 | }; |
| 466 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 467 | /*** <<< STAT-DEFS [Int3] >>> ***/ |
| 468 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 469 | static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 470 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 471 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 472 | asn_TYPE_descriptor_t asn_DEF_Int3 = { |
| 473 | "Int3", |
| 474 | "Int3", |
| 475 | Int3_free, |
| 476 | Int3_print, |
| 477 | Int3_constraint, |
| 478 | Int3_decode_ber, |
| 479 | Int3_encode_der, |
| 480 | Int3_decode_xer, |
| 481 | Int3_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 482 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 483 | Int3_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 484 | Int3_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 485 | 0, /* Use generic outmost tag fetcher */ |
| 486 | asn_DEF_Int3_tags_1, |
| 487 | sizeof(asn_DEF_Int3_tags_1) |
| 488 | /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */ |
| 489 | asn_DEF_Int3_tags_1, /* Same as above */ |
| 490 | sizeof(asn_DEF_Int3_tags_1) |
| 491 | /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 492 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 493 | &asn_PER_type_Int3_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 494 | 0, 0, /* No members */ |
| 495 | 0 /* No specifics */ |
| 496 | }; |
| 497 | |
| 498 | |
| 499 | /*** <<< INCLUDES [Int4] >>> ***/ |
| 500 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 501 | #include "Int3.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 502 | |
| 503 | /*** <<< TYPE-DECLS [Int4] >>> ***/ |
| 504 | |
| 505 | typedef Int3_t Int4_t; |
| 506 | |
| 507 | /*** <<< FUNC-DECLS [Int4] >>> ***/ |
| 508 | |
| 509 | extern asn_TYPE_descriptor_t asn_DEF_Int4; |
| 510 | asn_struct_free_f Int4_free; |
| 511 | asn_struct_print_f Int4_print; |
| 512 | asn_constr_check_f Int4_constraint; |
| 513 | ber_type_decoder_f Int4_decode_ber; |
| 514 | der_type_encoder_f Int4_encode_der; |
| 515 | xer_type_decoder_f Int4_decode_xer; |
| 516 | xer_type_encoder_f Int4_encode_xer; |
| 517 | per_type_decoder_f Int4_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 518 | per_type_encoder_f Int4_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 519 | |
| 520 | /*** <<< CODE [Int4] >>> ***/ |
| 521 | |
| 522 | int |
| 523 | Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 524 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 525 | long value; |
| 526 | |
| 527 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 528 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 529 | "%s: value not given (%s:%d)", |
| 530 | td->name, __FILE__, __LINE__); |
| 531 | return -1; |
| 532 | } |
| 533 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 534 | value = *(const long *)sptr; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 535 | |
| 536 | if((value >= 1 && value <= 10)) { |
| 537 | /* Constraint check succeeded */ |
| 538 | return 0; |
| 539 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 540 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 541 | "%s: constraint failed (%s:%d)", |
| 542 | td->name, __FILE__, __LINE__); |
| 543 | return -1; |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | /* |
| 548 | * This type is implemented using Int3, |
| 549 | * so here we adjust the DEF accordingly. |
| 550 | */ |
| 551 | static void |
| 552 | Int4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 553 | td->free_struct = asn_DEF_Int3.free_struct; |
| 554 | td->print_struct = asn_DEF_Int3.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 555 | td->check_constraints = asn_DEF_Int3.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 556 | td->ber_decoder = asn_DEF_Int3.ber_decoder; |
| 557 | td->der_encoder = asn_DEF_Int3.der_encoder; |
| 558 | td->xer_decoder = asn_DEF_Int3.xer_decoder; |
| 559 | td->xer_encoder = asn_DEF_Int3.xer_encoder; |
| 560 | td->uper_decoder = asn_DEF_Int3.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 561 | td->uper_encoder = asn_DEF_Int3.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 562 | td->oer_decoder = asn_DEF_Int3.oer_decoder; |
| 563 | td->oer_encoder = asn_DEF_Int3.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 564 | if(!td->oer_constraints) |
| 565 | td->oer_constraints = asn_DEF_Int3.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 566 | if(!td->per_constraints) |
| 567 | td->per_constraints = asn_DEF_Int3.per_constraints; |
| 568 | td->elements = asn_DEF_Int3.elements; |
| 569 | td->elements_count = asn_DEF_Int3.elements_count; |
| 570 | td->specifics = asn_DEF_Int3.specifics; |
| 571 | } |
| 572 | |
| 573 | void |
| 574 | Int4_free(asn_TYPE_descriptor_t *td, |
| 575 | void *struct_ptr, int contents_only) { |
| 576 | Int4_1_inherit_TYPE_descriptor(td); |
| 577 | td->free_struct(td, struct_ptr, contents_only); |
| 578 | } |
| 579 | |
| 580 | int |
| 581 | Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 582 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 583 | Int4_1_inherit_TYPE_descriptor(td); |
| 584 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 585 | } |
| 586 | |
| 587 | asn_dec_rval_t |
| 588 | Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 589 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 590 | Int4_1_inherit_TYPE_descriptor(td); |
| 591 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 592 | } |
| 593 | |
| 594 | asn_enc_rval_t |
| 595 | Int4_encode_der(asn_TYPE_descriptor_t *td, |
| 596 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 597 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 598 | Int4_1_inherit_TYPE_descriptor(td); |
| 599 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 600 | } |
| 601 | |
| 602 | asn_dec_rval_t |
| 603 | Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 604 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 605 | Int4_1_inherit_TYPE_descriptor(td); |
| 606 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 607 | } |
| 608 | |
| 609 | asn_enc_rval_t |
| 610 | Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 611 | int ilevel, enum xer_encoder_flags_e flags, |
| 612 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 613 | Int4_1_inherit_TYPE_descriptor(td); |
| 614 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 615 | } |
| 616 | |
| 617 | asn_dec_rval_t |
| 618 | Int4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 619 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 620 | Int4_1_inherit_TYPE_descriptor(td); |
| 621 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 622 | } |
| 623 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 624 | asn_enc_rval_t |
| 625 | Int4_encode_uper(asn_TYPE_descriptor_t *td, |
| 626 | asn_per_constraints_t *constraints, |
| 627 | void *structure, asn_per_outp_t *per_out) { |
| 628 | Int4_1_inherit_TYPE_descriptor(td); |
| 629 | return td->uper_encoder(td, constraints, structure, per_out); |
| 630 | } |
| 631 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 632 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 633 | /*** <<< CTDEFS [Int4] >>> ***/ |
| 634 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 635 | static asn_per_constraints_t asn_PER_type_Int4_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 636 | { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 1, 10 } /* (1..10,...) */, |
| 637 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 638 | 0, 0 /* No PER value map */ |
| 639 | }; |
| 640 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 641 | /*** <<< STAT-DEFS [Int4] >>> ***/ |
| 642 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 643 | static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 644 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 645 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 646 | asn_TYPE_descriptor_t asn_DEF_Int4 = { |
| 647 | "Int4", |
| 648 | "Int4", |
| 649 | Int4_free, |
| 650 | Int4_print, |
| 651 | Int4_constraint, |
| 652 | Int4_decode_ber, |
| 653 | Int4_encode_der, |
| 654 | Int4_decode_xer, |
| 655 | Int4_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 656 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 657 | Int4_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 658 | Int4_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 659 | 0, /* Use generic outmost tag fetcher */ |
| 660 | asn_DEF_Int4_tags_1, |
| 661 | sizeof(asn_DEF_Int4_tags_1) |
| 662 | /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */ |
| 663 | asn_DEF_Int4_tags_1, /* Same as above */ |
| 664 | sizeof(asn_DEF_Int4_tags_1) |
| 665 | /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 666 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 667 | &asn_PER_type_Int4_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 668 | 0, 0, /* No members */ |
| 669 | 0 /* No specifics */ |
| 670 | }; |
| 671 | |
| 672 | |
| 673 | /*** <<< INCLUDES [Int5] >>> ***/ |
| 674 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 675 | #include "Int4.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 676 | |
| 677 | /*** <<< TYPE-DECLS [Int5] >>> ***/ |
| 678 | |
| 679 | typedef Int4_t Int5_t; |
| 680 | |
| 681 | /*** <<< FUNC-DECLS [Int5] >>> ***/ |
| 682 | |
| 683 | extern asn_TYPE_descriptor_t asn_DEF_Int5; |
| 684 | asn_struct_free_f Int5_free; |
| 685 | asn_struct_print_f Int5_print; |
| 686 | asn_constr_check_f Int5_constraint; |
| 687 | ber_type_decoder_f Int5_decode_ber; |
| 688 | der_type_encoder_f Int5_encode_der; |
| 689 | xer_type_decoder_f Int5_decode_xer; |
| 690 | xer_type_encoder_f Int5_encode_xer; |
| 691 | per_type_decoder_f Int5_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 692 | per_type_encoder_f Int5_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 693 | |
| 694 | /*** <<< CODE [Int5] >>> ***/ |
| 695 | |
| 696 | int |
| 697 | Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 698 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 699 | long value; |
| 700 | |
| 701 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 702 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 703 | "%s: value not given (%s:%d)", |
| 704 | td->name, __FILE__, __LINE__); |
| 705 | return -1; |
| 706 | } |
| 707 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 708 | value = *(const long *)sptr; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 709 | |
| 710 | if((value == 5)) { |
| 711 | /* Constraint check succeeded */ |
| 712 | return 0; |
| 713 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 714 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 715 | "%s: constraint failed (%s:%d)", |
| 716 | td->name, __FILE__, __LINE__); |
| 717 | return -1; |
| 718 | } |
| 719 | } |
| 720 | |
| 721 | /* |
| 722 | * This type is implemented using Int4, |
| 723 | * so here we adjust the DEF accordingly. |
| 724 | */ |
| 725 | static void |
| 726 | Int5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 727 | td->free_struct = asn_DEF_Int4.free_struct; |
| 728 | td->print_struct = asn_DEF_Int4.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 729 | td->check_constraints = asn_DEF_Int4.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 730 | td->ber_decoder = asn_DEF_Int4.ber_decoder; |
| 731 | td->der_encoder = asn_DEF_Int4.der_encoder; |
| 732 | td->xer_decoder = asn_DEF_Int4.xer_decoder; |
| 733 | td->xer_encoder = asn_DEF_Int4.xer_encoder; |
| 734 | td->uper_decoder = asn_DEF_Int4.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 735 | td->uper_encoder = asn_DEF_Int4.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 736 | td->oer_decoder = asn_DEF_Int4.oer_decoder; |
| 737 | td->oer_encoder = asn_DEF_Int4.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 738 | if(!td->oer_constraints) |
| 739 | td->oer_constraints = asn_DEF_Int4.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 740 | if(!td->per_constraints) |
| 741 | td->per_constraints = asn_DEF_Int4.per_constraints; |
| 742 | td->elements = asn_DEF_Int4.elements; |
| 743 | td->elements_count = asn_DEF_Int4.elements_count; |
| 744 | td->specifics = asn_DEF_Int4.specifics; |
| 745 | } |
| 746 | |
| 747 | void |
| 748 | Int5_free(asn_TYPE_descriptor_t *td, |
| 749 | void *struct_ptr, int contents_only) { |
| 750 | Int5_1_inherit_TYPE_descriptor(td); |
| 751 | td->free_struct(td, struct_ptr, contents_only); |
| 752 | } |
| 753 | |
| 754 | int |
| 755 | Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 756 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 757 | Int5_1_inherit_TYPE_descriptor(td); |
| 758 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 759 | } |
| 760 | |
| 761 | asn_dec_rval_t |
| 762 | Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 763 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 764 | Int5_1_inherit_TYPE_descriptor(td); |
| 765 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 766 | } |
| 767 | |
| 768 | asn_enc_rval_t |
| 769 | Int5_encode_der(asn_TYPE_descriptor_t *td, |
| 770 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 771 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 772 | Int5_1_inherit_TYPE_descriptor(td); |
| 773 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 774 | } |
| 775 | |
| 776 | asn_dec_rval_t |
| 777 | Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 778 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 779 | Int5_1_inherit_TYPE_descriptor(td); |
| 780 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 781 | } |
| 782 | |
| 783 | asn_enc_rval_t |
| 784 | Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 785 | int ilevel, enum xer_encoder_flags_e flags, |
| 786 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 787 | Int5_1_inherit_TYPE_descriptor(td); |
| 788 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 789 | } |
| 790 | |
| 791 | asn_dec_rval_t |
| 792 | Int5_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 793 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 794 | Int5_1_inherit_TYPE_descriptor(td); |
| 795 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 796 | } |
| 797 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 798 | asn_enc_rval_t |
| 799 | Int5_encode_uper(asn_TYPE_descriptor_t *td, |
| 800 | asn_per_constraints_t *constraints, |
| 801 | void *structure, asn_per_outp_t *per_out) { |
| 802 | Int5_1_inherit_TYPE_descriptor(td); |
| 803 | return td->uper_encoder(td, constraints, structure, per_out); |
| 804 | } |
| 805 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 806 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 807 | /*** <<< CTDEFS [Int5] >>> ***/ |
| 808 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 809 | static asn_per_constraints_t asn_PER_type_Int5_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 810 | { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */, |
| 811 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 812 | 0, 0 /* No PER value map */ |
| 813 | }; |
| 814 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 815 | /*** <<< STAT-DEFS [Int5] >>> ***/ |
| 816 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 817 | static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 818 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 819 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 820 | asn_TYPE_descriptor_t asn_DEF_Int5 = { |
| 821 | "Int5", |
| 822 | "Int5", |
| 823 | Int5_free, |
| 824 | Int5_print, |
| 825 | Int5_constraint, |
| 826 | Int5_decode_ber, |
| 827 | Int5_encode_der, |
| 828 | Int5_decode_xer, |
| 829 | Int5_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 830 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 831 | Int5_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 832 | Int5_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 833 | 0, /* Use generic outmost tag fetcher */ |
| 834 | asn_DEF_Int5_tags_1, |
| 835 | sizeof(asn_DEF_Int5_tags_1) |
| 836 | /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */ |
| 837 | asn_DEF_Int5_tags_1, /* Same as above */ |
| 838 | sizeof(asn_DEF_Int5_tags_1) |
| 839 | /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 840 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 841 | &asn_PER_type_Int5_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 842 | 0, 0, /* No members */ |
| 843 | 0 /* No specifics */ |
| 844 | }; |
| 845 | |
| 846 | |
| 847 | /*** <<< INCLUDES [ExtensibleExtensions] >>> ***/ |
| 848 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 849 | #include <NativeInteger.h> |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 850 | |
| 851 | /*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/ |
| 852 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 853 | typedef long ExtensibleExtensions_t; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 854 | |
| 855 | /*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/ |
| 856 | |
| 857 | extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions; |
| 858 | asn_struct_free_f ExtensibleExtensions_free; |
| 859 | asn_struct_print_f ExtensibleExtensions_print; |
| 860 | asn_constr_check_f ExtensibleExtensions_constraint; |
| 861 | ber_type_decoder_f ExtensibleExtensions_decode_ber; |
| 862 | der_type_encoder_f ExtensibleExtensions_encode_der; |
| 863 | xer_type_decoder_f ExtensibleExtensions_decode_xer; |
| 864 | xer_type_encoder_f ExtensibleExtensions_encode_xer; |
| 865 | per_type_decoder_f ExtensibleExtensions_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 866 | per_type_encoder_f ExtensibleExtensions_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 867 | |
| 868 | /*** <<< CODE [ExtensibleExtensions] >>> ***/ |
| 869 | |
| 870 | int |
| 871 | ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 872 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 873 | long value; |
| 874 | |
| 875 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 876 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 877 | "%s: value not given (%s:%d)", |
| 878 | td->name, __FILE__, __LINE__); |
| 879 | return -1; |
| 880 | } |
| 881 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 882 | value = *(const long *)sptr; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 883 | |
| 884 | if((value >= 1 && value <= 256)) { |
| 885 | /* Constraint check succeeded */ |
| 886 | return 0; |
| 887 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 888 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 889 | "%s: constraint failed (%s:%d)", |
| 890 | td->name, __FILE__, __LINE__); |
| 891 | return -1; |
| 892 | } |
| 893 | } |
| 894 | |
| 895 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 896 | * This type is implemented using NativeInteger, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 897 | * so here we adjust the DEF accordingly. |
| 898 | */ |
| 899 | static void |
| 900 | ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 901 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 902 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 903 | td->check_constraints = asn_DEF_NativeInteger.check_constraints; |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 904 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 905 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 906 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 907 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
| 908 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
| 909 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 910 | td->oer_decoder = asn_DEF_NativeInteger.oer_decoder; |
| 911 | td->oer_encoder = asn_DEF_NativeInteger.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 912 | if(!td->oer_constraints) |
| 913 | td->oer_constraints = asn_DEF_NativeInteger.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 914 | if(!td->per_constraints) |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 915 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
| 916 | td->elements = asn_DEF_NativeInteger.elements; |
| 917 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 918 | td->specifics = asn_DEF_NativeInteger.specifics; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 919 | } |
| 920 | |
| 921 | void |
| 922 | ExtensibleExtensions_free(asn_TYPE_descriptor_t *td, |
| 923 | void *struct_ptr, int contents_only) { |
| 924 | ExtensibleExtensions_1_inherit_TYPE_descriptor(td); |
| 925 | td->free_struct(td, struct_ptr, contents_only); |
| 926 | } |
| 927 | |
| 928 | int |
| 929 | ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 930 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 931 | ExtensibleExtensions_1_inherit_TYPE_descriptor(td); |
| 932 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 933 | } |
| 934 | |
| 935 | asn_dec_rval_t |
| 936 | ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 937 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 938 | ExtensibleExtensions_1_inherit_TYPE_descriptor(td); |
| 939 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 940 | } |
| 941 | |
| 942 | asn_enc_rval_t |
| 943 | ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td, |
| 944 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 945 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 946 | ExtensibleExtensions_1_inherit_TYPE_descriptor(td); |
| 947 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 948 | } |
| 949 | |
| 950 | asn_dec_rval_t |
| 951 | ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 952 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 953 | ExtensibleExtensions_1_inherit_TYPE_descriptor(td); |
| 954 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 955 | } |
| 956 | |
| 957 | asn_enc_rval_t |
| 958 | ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 959 | int ilevel, enum xer_encoder_flags_e flags, |
| 960 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 961 | ExtensibleExtensions_1_inherit_TYPE_descriptor(td); |
| 962 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 963 | } |
| 964 | |
| 965 | asn_dec_rval_t |
| 966 | ExtensibleExtensions_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 967 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 968 | ExtensibleExtensions_1_inherit_TYPE_descriptor(td); |
| 969 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 970 | } |
| 971 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 972 | asn_enc_rval_t |
| 973 | ExtensibleExtensions_encode_uper(asn_TYPE_descriptor_t *td, |
| 974 | asn_per_constraints_t *constraints, |
| 975 | void *structure, asn_per_outp_t *per_out) { |
| 976 | ExtensibleExtensions_1_inherit_TYPE_descriptor(td); |
| 977 | return td->uper_encoder(td, constraints, structure, per_out); |
| 978 | } |
| 979 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 980 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 981 | /*** <<< CTDEFS [ExtensibleExtensions] >>> ***/ |
| 982 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 983 | static asn_per_constraints_t asn_PER_type_ExtensibleExtensions_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 984 | { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 256 } /* (1..256,...) */, |
| 985 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 986 | 0, 0 /* No PER value map */ |
| 987 | }; |
| 988 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 989 | /*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/ |
| 990 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 991 | static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 992 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 993 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 994 | asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = { |
| 995 | "ExtensibleExtensions", |
| 996 | "ExtensibleExtensions", |
| 997 | ExtensibleExtensions_free, |
| 998 | ExtensibleExtensions_print, |
| 999 | ExtensibleExtensions_constraint, |
| 1000 | ExtensibleExtensions_decode_ber, |
| 1001 | ExtensibleExtensions_encode_der, |
| 1002 | ExtensibleExtensions_decode_xer, |
| 1003 | ExtensibleExtensions_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1004 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1005 | ExtensibleExtensions_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1006 | ExtensibleExtensions_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1007 | 0, /* Use generic outmost tag fetcher */ |
| 1008 | asn_DEF_ExtensibleExtensions_tags_1, |
| 1009 | sizeof(asn_DEF_ExtensibleExtensions_tags_1) |
| 1010 | /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */ |
| 1011 | asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */ |
| 1012 | sizeof(asn_DEF_ExtensibleExtensions_tags_1) |
| 1013 | /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1014 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 1015 | &asn_PER_type_ExtensibleExtensions_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1016 | 0, 0, /* No members */ |
| 1017 | 0 /* No specifics */ |
| 1018 | }; |
| 1019 | |
| 1020 | |
| 1021 | /*** <<< INCLUDES [Str1] >>> ***/ |
| 1022 | |
| 1023 | #include <IA5String.h> |
| 1024 | |
| 1025 | /*** <<< TYPE-DECLS [Str1] >>> ***/ |
| 1026 | |
| 1027 | typedef IA5String_t Str1_t; |
| 1028 | |
| 1029 | /*** <<< FUNC-DECLS [Str1] >>> ***/ |
| 1030 | |
| 1031 | extern asn_TYPE_descriptor_t asn_DEF_Str1; |
| 1032 | asn_struct_free_f Str1_free; |
| 1033 | asn_struct_print_f Str1_print; |
| 1034 | asn_constr_check_f Str1_constraint; |
| 1035 | ber_type_decoder_f Str1_decode_ber; |
| 1036 | der_type_encoder_f Str1_encode_der; |
| 1037 | xer_type_decoder_f Str1_decode_xer; |
| 1038 | xer_type_encoder_f Str1_encode_xer; |
| 1039 | per_type_decoder_f Str1_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1040 | per_type_encoder_f Str1_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1041 | |
| 1042 | /*** <<< CODE [Str1] >>> ***/ |
| 1043 | |
| 1044 | int |
| 1045 | Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1046 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1047 | /* Replace with underlying type checker */ |
| 1048 | td->check_constraints = asn_DEF_IA5String.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1049 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1050 | } |
| 1051 | |
| 1052 | /* |
| 1053 | * This type is implemented using IA5String, |
| 1054 | * so here we adjust the DEF accordingly. |
| 1055 | */ |
| 1056 | static void |
| 1057 | Str1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 1058 | td->free_struct = asn_DEF_IA5String.free_struct; |
| 1059 | td->print_struct = asn_DEF_IA5String.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 1060 | td->check_constraints = asn_DEF_IA5String.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1061 | td->ber_decoder = asn_DEF_IA5String.ber_decoder; |
| 1062 | td->der_encoder = asn_DEF_IA5String.der_encoder; |
| 1063 | td->xer_decoder = asn_DEF_IA5String.xer_decoder; |
| 1064 | td->xer_encoder = asn_DEF_IA5String.xer_encoder; |
| 1065 | td->uper_decoder = asn_DEF_IA5String.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1066 | td->uper_encoder = asn_DEF_IA5String.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 1067 | td->oer_decoder = asn_DEF_IA5String.oer_decoder; |
| 1068 | td->oer_encoder = asn_DEF_IA5String.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1069 | if(!td->oer_constraints) |
| 1070 | td->oer_constraints = asn_DEF_IA5String.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1071 | if(!td->per_constraints) |
| 1072 | td->per_constraints = asn_DEF_IA5String.per_constraints; |
| 1073 | td->elements = asn_DEF_IA5String.elements; |
| 1074 | td->elements_count = asn_DEF_IA5String.elements_count; |
| 1075 | td->specifics = asn_DEF_IA5String.specifics; |
| 1076 | } |
| 1077 | |
| 1078 | void |
| 1079 | Str1_free(asn_TYPE_descriptor_t *td, |
| 1080 | void *struct_ptr, int contents_only) { |
| 1081 | Str1_1_inherit_TYPE_descriptor(td); |
| 1082 | td->free_struct(td, struct_ptr, contents_only); |
| 1083 | } |
| 1084 | |
| 1085 | int |
| 1086 | Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1087 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1088 | Str1_1_inherit_TYPE_descriptor(td); |
| 1089 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1090 | } |
| 1091 | |
| 1092 | asn_dec_rval_t |
| 1093 | Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1094 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1095 | Str1_1_inherit_TYPE_descriptor(td); |
| 1096 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1097 | } |
| 1098 | |
| 1099 | asn_enc_rval_t |
| 1100 | Str1_encode_der(asn_TYPE_descriptor_t *td, |
| 1101 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1102 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1103 | Str1_1_inherit_TYPE_descriptor(td); |
| 1104 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1105 | } |
| 1106 | |
| 1107 | asn_dec_rval_t |
| 1108 | Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1109 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1110 | Str1_1_inherit_TYPE_descriptor(td); |
| 1111 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1112 | } |
| 1113 | |
| 1114 | asn_enc_rval_t |
| 1115 | Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1116 | int ilevel, enum xer_encoder_flags_e flags, |
| 1117 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1118 | Str1_1_inherit_TYPE_descriptor(td); |
| 1119 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1120 | } |
| 1121 | |
| 1122 | asn_dec_rval_t |
| 1123 | Str1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1124 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 1125 | Str1_1_inherit_TYPE_descriptor(td); |
| 1126 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 1127 | } |
| 1128 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1129 | asn_enc_rval_t |
| 1130 | Str1_encode_uper(asn_TYPE_descriptor_t *td, |
| 1131 | asn_per_constraints_t *constraints, |
| 1132 | void *structure, asn_per_outp_t *per_out) { |
| 1133 | Str1_1_inherit_TYPE_descriptor(td); |
| 1134 | return td->uper_encoder(td, constraints, structure, per_out); |
| 1135 | } |
| 1136 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1137 | |
| 1138 | /*** <<< STAT-DEFS [Str1] >>> ***/ |
| 1139 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1140 | static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1141 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 1142 | }; |
| 1143 | asn_TYPE_descriptor_t asn_DEF_Str1 = { |
| 1144 | "Str1", |
| 1145 | "Str1", |
| 1146 | Str1_free, |
| 1147 | Str1_print, |
| 1148 | Str1_constraint, |
| 1149 | Str1_decode_ber, |
| 1150 | Str1_encode_der, |
| 1151 | Str1_decode_xer, |
| 1152 | Str1_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1153 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1154 | Str1_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1155 | Str1_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1156 | 0, /* Use generic outmost tag fetcher */ |
| 1157 | asn_DEF_Str1_tags_1, |
| 1158 | sizeof(asn_DEF_Str1_tags_1) |
| 1159 | /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */ |
| 1160 | asn_DEF_Str1_tags_1, /* Same as above */ |
| 1161 | sizeof(asn_DEF_Str1_tags_1) |
| 1162 | /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1163 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1164 | 0, /* No PER visible constraints */ |
| 1165 | 0, 0, /* No members */ |
| 1166 | 0 /* No specifics */ |
| 1167 | }; |
| 1168 | |
| 1169 | |
| 1170 | /*** <<< INCLUDES [Str2] >>> ***/ |
| 1171 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1172 | #include "Str1.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1173 | |
| 1174 | /*** <<< TYPE-DECLS [Str2] >>> ***/ |
| 1175 | |
| 1176 | typedef Str1_t Str2_t; |
| 1177 | |
| 1178 | /*** <<< FUNC-DECLS [Str2] >>> ***/ |
| 1179 | |
| 1180 | extern asn_TYPE_descriptor_t asn_DEF_Str2; |
| 1181 | asn_struct_free_f Str2_free; |
| 1182 | asn_struct_print_f Str2_print; |
| 1183 | asn_constr_check_f Str2_constraint; |
| 1184 | ber_type_decoder_f Str2_decode_ber; |
| 1185 | der_type_encoder_f Str2_encode_der; |
| 1186 | xer_type_decoder_f Str2_decode_xer; |
| 1187 | xer_type_encoder_f Str2_encode_xer; |
| 1188 | per_type_decoder_f Str2_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1189 | per_type_encoder_f Str2_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1190 | |
| 1191 | /*** <<< CTABLES [Str2] >>> ***/ |
| 1192 | |
| 1193 | static int check_permitted_alphabet_1(const void *sptr) { |
| 1194 | /* The underlying type is IA5String */ |
| 1195 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 1196 | const uint8_t *ch = st->buf; |
| 1197 | const uint8_t *end = ch + st->size; |
| 1198 | |
| 1199 | for(; ch < end; ch++) { |
| 1200 | uint8_t cv = *ch; |
| 1201 | if(!(cv <= 127)) return -1; |
| 1202 | } |
| 1203 | return 0; |
| 1204 | } |
| 1205 | |
| 1206 | |
| 1207 | /*** <<< CODE [Str2] >>> ***/ |
| 1208 | |
| 1209 | int |
| 1210 | Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1211 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1212 | const Str1_t *st = (const Str1_t *)sptr; |
| 1213 | size_t size; |
| 1214 | |
| 1215 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1216 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1217 | "%s: value not given (%s:%d)", |
| 1218 | td->name, __FILE__, __LINE__); |
| 1219 | return -1; |
| 1220 | } |
| 1221 | |
| 1222 | size = st->size; |
| 1223 | |
| 1224 | if(((size <= 20) || (size >= 25 && size <= 30)) |
| 1225 | && !check_permitted_alphabet_1(st)) { |
| 1226 | /* Constraint check succeeded */ |
| 1227 | return 0; |
| 1228 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1229 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1230 | "%s: constraint failed (%s:%d)", |
| 1231 | td->name, __FILE__, __LINE__); |
| 1232 | return -1; |
| 1233 | } |
| 1234 | } |
| 1235 | |
| 1236 | /* |
| 1237 | * This type is implemented using Str1, |
| 1238 | * so here we adjust the DEF accordingly. |
| 1239 | */ |
| 1240 | static void |
| 1241 | Str2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 1242 | td->free_struct = asn_DEF_Str1.free_struct; |
| 1243 | td->print_struct = asn_DEF_Str1.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 1244 | td->check_constraints = asn_DEF_Str1.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1245 | td->ber_decoder = asn_DEF_Str1.ber_decoder; |
| 1246 | td->der_encoder = asn_DEF_Str1.der_encoder; |
| 1247 | td->xer_decoder = asn_DEF_Str1.xer_decoder; |
| 1248 | td->xer_encoder = asn_DEF_Str1.xer_encoder; |
| 1249 | td->uper_decoder = asn_DEF_Str1.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1250 | td->uper_encoder = asn_DEF_Str1.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 1251 | td->oer_decoder = asn_DEF_Str1.oer_decoder; |
| 1252 | td->oer_encoder = asn_DEF_Str1.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1253 | if(!td->oer_constraints) |
| 1254 | td->oer_constraints = asn_DEF_Str1.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1255 | if(!td->per_constraints) |
| 1256 | td->per_constraints = asn_DEF_Str1.per_constraints; |
| 1257 | td->elements = asn_DEF_Str1.elements; |
| 1258 | td->elements_count = asn_DEF_Str1.elements_count; |
| 1259 | td->specifics = asn_DEF_Str1.specifics; |
| 1260 | } |
| 1261 | |
| 1262 | void |
| 1263 | Str2_free(asn_TYPE_descriptor_t *td, |
| 1264 | void *struct_ptr, int contents_only) { |
| 1265 | Str2_1_inherit_TYPE_descriptor(td); |
| 1266 | td->free_struct(td, struct_ptr, contents_only); |
| 1267 | } |
| 1268 | |
| 1269 | int |
| 1270 | Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1271 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1272 | Str2_1_inherit_TYPE_descriptor(td); |
| 1273 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1274 | } |
| 1275 | |
| 1276 | asn_dec_rval_t |
| 1277 | Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1278 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1279 | Str2_1_inherit_TYPE_descriptor(td); |
| 1280 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1281 | } |
| 1282 | |
| 1283 | asn_enc_rval_t |
| 1284 | Str2_encode_der(asn_TYPE_descriptor_t *td, |
| 1285 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1286 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1287 | Str2_1_inherit_TYPE_descriptor(td); |
| 1288 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1289 | } |
| 1290 | |
| 1291 | asn_dec_rval_t |
| 1292 | Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1293 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1294 | Str2_1_inherit_TYPE_descriptor(td); |
| 1295 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1296 | } |
| 1297 | |
| 1298 | asn_enc_rval_t |
| 1299 | Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1300 | int ilevel, enum xer_encoder_flags_e flags, |
| 1301 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1302 | Str2_1_inherit_TYPE_descriptor(td); |
| 1303 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1304 | } |
| 1305 | |
| 1306 | asn_dec_rval_t |
| 1307 | Str2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1308 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 1309 | Str2_1_inherit_TYPE_descriptor(td); |
| 1310 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 1311 | } |
| 1312 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1313 | asn_enc_rval_t |
| 1314 | Str2_encode_uper(asn_TYPE_descriptor_t *td, |
| 1315 | asn_per_constraints_t *constraints, |
| 1316 | void *structure, asn_per_outp_t *per_out) { |
| 1317 | Str2_1_inherit_TYPE_descriptor(td); |
| 1318 | return td->uper_encoder(td, constraints, structure, per_out); |
| 1319 | } |
| 1320 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1321 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 1322 | /*** <<< CTDEFS [Str2] >>> ***/ |
| 1323 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 1324 | static asn_per_constraints_t asn_PER_type_Str2_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 1325 | { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, |
| 1326 | { APC_CONSTRAINED, 5, 5, 0, 30 } /* (SIZE(0..30)) */, |
| 1327 | 0, 0 /* No PER character map necessary */ |
| 1328 | }; |
| 1329 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1330 | /*** <<< STAT-DEFS [Str2] >>> ***/ |
| 1331 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1332 | static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1333 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 1334 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1335 | asn_TYPE_descriptor_t asn_DEF_Str2 = { |
| 1336 | "Str2", |
| 1337 | "Str2", |
| 1338 | Str2_free, |
| 1339 | Str2_print, |
| 1340 | Str2_constraint, |
| 1341 | Str2_decode_ber, |
| 1342 | Str2_encode_der, |
| 1343 | Str2_decode_xer, |
| 1344 | Str2_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1345 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1346 | Str2_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1347 | Str2_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1348 | 0, /* Use generic outmost tag fetcher */ |
| 1349 | asn_DEF_Str2_tags_1, |
| 1350 | sizeof(asn_DEF_Str2_tags_1) |
| 1351 | /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */ |
| 1352 | asn_DEF_Str2_tags_1, /* Same as above */ |
| 1353 | sizeof(asn_DEF_Str2_tags_1) |
| 1354 | /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1355 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 1356 | &asn_PER_type_Str2_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1357 | 0, 0, /* No members */ |
| 1358 | 0 /* No specifics */ |
| 1359 | }; |
| 1360 | |
| 1361 | |
| 1362 | /*** <<< INCLUDES [Str3] >>> ***/ |
| 1363 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1364 | #include "Str2.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1365 | |
| 1366 | /*** <<< TYPE-DECLS [Str3] >>> ***/ |
| 1367 | |
| 1368 | typedef Str2_t Str3_t; |
| 1369 | |
| 1370 | /*** <<< FUNC-DECLS [Str3] >>> ***/ |
| 1371 | |
| 1372 | extern asn_TYPE_descriptor_t asn_DEF_Str3; |
| 1373 | asn_struct_free_f Str3_free; |
| 1374 | asn_struct_print_f Str3_print; |
| 1375 | asn_constr_check_f Str3_constraint; |
| 1376 | ber_type_decoder_f Str3_decode_ber; |
| 1377 | der_type_encoder_f Str3_encode_der; |
| 1378 | xer_type_decoder_f Str3_decode_xer; |
| 1379 | xer_type_encoder_f Str3_encode_xer; |
| 1380 | per_type_decoder_f Str3_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1381 | per_type_encoder_f Str3_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1382 | |
| 1383 | /*** <<< CTABLES [Str3] >>> ***/ |
| 1384 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1385 | static const int permitted_alphabet_table_1[256] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 1386 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1387 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1388 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1389 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1390 | 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */ |
| 1391 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1392 | 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1393 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1394 | static const int permitted_alphabet_code2value_1[6] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 1395 | 65,66,67,100,101,102,}; |
| 1396 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1397 | |
| 1398 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1399 | const int *table = permitted_alphabet_table_1; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1400 | /* The underlying type is IA5String */ |
| 1401 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 1402 | const uint8_t *ch = st->buf; |
| 1403 | const uint8_t *end = ch + st->size; |
| 1404 | |
| 1405 | for(; ch < end; ch++) { |
| 1406 | uint8_t cv = *ch; |
| 1407 | if(!table[cv]) return -1; |
| 1408 | } |
| 1409 | return 0; |
| 1410 | } |
| 1411 | |
| 1412 | |
| 1413 | /*** <<< CODE [Str3] >>> ***/ |
| 1414 | |
| 1415 | int |
| 1416 | Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1417 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1418 | const Str2_t *st = (const Str2_t *)sptr; |
| 1419 | size_t size; |
| 1420 | |
| 1421 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1422 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1423 | "%s: value not given (%s:%d)", |
| 1424 | td->name, __FILE__, __LINE__); |
| 1425 | return -1; |
| 1426 | } |
| 1427 | |
| 1428 | size = st->size; |
| 1429 | |
| 1430 | if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27)) |
| 1431 | && !check_permitted_alphabet_1(st)) { |
| 1432 | /* Constraint check succeeded */ |
| 1433 | return 0; |
| 1434 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1435 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1436 | "%s: constraint failed (%s:%d)", |
| 1437 | td->name, __FILE__, __LINE__); |
| 1438 | return -1; |
| 1439 | } |
| 1440 | } |
| 1441 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 1442 | static int asn_PER_MAP_Str3_1_v2c(unsigned int value) { |
| 1443 | if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0])) |
| 1444 | return -1; |
| 1445 | return permitted_alphabet_table_1[value] - 1; |
| 1446 | } |
| 1447 | static int asn_PER_MAP_Str3_1_c2v(unsigned int code) { |
| 1448 | if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0])) |
| 1449 | return -1; |
| 1450 | return permitted_alphabet_code2value_1[code]; |
| 1451 | } |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1452 | /* |
| 1453 | * This type is implemented using Str2, |
| 1454 | * so here we adjust the DEF accordingly. |
| 1455 | */ |
| 1456 | static void |
| 1457 | Str3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 1458 | td->free_struct = asn_DEF_Str2.free_struct; |
| 1459 | td->print_struct = asn_DEF_Str2.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 1460 | td->check_constraints = asn_DEF_Str2.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1461 | td->ber_decoder = asn_DEF_Str2.ber_decoder; |
| 1462 | td->der_encoder = asn_DEF_Str2.der_encoder; |
| 1463 | td->xer_decoder = asn_DEF_Str2.xer_decoder; |
| 1464 | td->xer_encoder = asn_DEF_Str2.xer_encoder; |
| 1465 | td->uper_decoder = asn_DEF_Str2.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1466 | td->uper_encoder = asn_DEF_Str2.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 1467 | td->oer_decoder = asn_DEF_Str2.oer_decoder; |
| 1468 | td->oer_encoder = asn_DEF_Str2.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1469 | if(!td->oer_constraints) |
| 1470 | td->oer_constraints = asn_DEF_Str2.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1471 | if(!td->per_constraints) |
| 1472 | td->per_constraints = asn_DEF_Str2.per_constraints; |
| 1473 | td->elements = asn_DEF_Str2.elements; |
| 1474 | td->elements_count = asn_DEF_Str2.elements_count; |
| 1475 | td->specifics = asn_DEF_Str2.specifics; |
| 1476 | } |
| 1477 | |
| 1478 | void |
| 1479 | Str3_free(asn_TYPE_descriptor_t *td, |
| 1480 | void *struct_ptr, int contents_only) { |
| 1481 | Str3_1_inherit_TYPE_descriptor(td); |
| 1482 | td->free_struct(td, struct_ptr, contents_only); |
| 1483 | } |
| 1484 | |
| 1485 | int |
| 1486 | Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1487 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1488 | Str3_1_inherit_TYPE_descriptor(td); |
| 1489 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1490 | } |
| 1491 | |
| 1492 | asn_dec_rval_t |
| 1493 | Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1494 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1495 | Str3_1_inherit_TYPE_descriptor(td); |
| 1496 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1497 | } |
| 1498 | |
| 1499 | asn_enc_rval_t |
| 1500 | Str3_encode_der(asn_TYPE_descriptor_t *td, |
| 1501 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1502 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1503 | Str3_1_inherit_TYPE_descriptor(td); |
| 1504 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1505 | } |
| 1506 | |
| 1507 | asn_dec_rval_t |
| 1508 | Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1509 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1510 | Str3_1_inherit_TYPE_descriptor(td); |
| 1511 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1512 | } |
| 1513 | |
| 1514 | asn_enc_rval_t |
| 1515 | Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1516 | int ilevel, enum xer_encoder_flags_e flags, |
| 1517 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1518 | Str3_1_inherit_TYPE_descriptor(td); |
| 1519 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1520 | } |
| 1521 | |
| 1522 | asn_dec_rval_t |
| 1523 | Str3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1524 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 1525 | Str3_1_inherit_TYPE_descriptor(td); |
| 1526 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 1527 | } |
| 1528 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1529 | asn_enc_rval_t |
| 1530 | Str3_encode_uper(asn_TYPE_descriptor_t *td, |
| 1531 | asn_per_constraints_t *constraints, |
| 1532 | void *structure, asn_per_outp_t *per_out) { |
| 1533 | Str3_1_inherit_TYPE_descriptor(td); |
| 1534 | return td->uper_encoder(td, constraints, structure, per_out); |
| 1535 | } |
| 1536 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1537 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 1538 | /*** <<< CTDEFS [Str3] >>> ***/ |
| 1539 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 1540 | static asn_per_constraints_t asn_PER_type_Str3_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 1541 | { APC_CONSTRAINED, 3, 3, 65, 102 } /* (65..102) */, |
| 1542 | { APC_CONSTRAINED, 5, 5, 10, 27 } /* (SIZE(10..27)) */, |
| 1543 | asn_PER_MAP_Str3_1_v2c, /* Value to PER code map */ |
| 1544 | asn_PER_MAP_Str3_1_c2v /* PER code to value map */ |
| 1545 | }; |
| 1546 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1547 | /*** <<< STAT-DEFS [Str3] >>> ***/ |
| 1548 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1549 | static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1550 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 1551 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1552 | asn_TYPE_descriptor_t asn_DEF_Str3 = { |
| 1553 | "Str3", |
| 1554 | "Str3", |
| 1555 | Str3_free, |
| 1556 | Str3_print, |
| 1557 | Str3_constraint, |
| 1558 | Str3_decode_ber, |
| 1559 | Str3_encode_der, |
| 1560 | Str3_decode_xer, |
| 1561 | Str3_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1562 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1563 | Str3_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1564 | Str3_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1565 | 0, /* Use generic outmost tag fetcher */ |
| 1566 | asn_DEF_Str3_tags_1, |
| 1567 | sizeof(asn_DEF_Str3_tags_1) |
| 1568 | /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */ |
| 1569 | asn_DEF_Str3_tags_1, /* Same as above */ |
| 1570 | sizeof(asn_DEF_Str3_tags_1) |
| 1571 | /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1572 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 1573 | &asn_PER_type_Str3_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1574 | 0, 0, /* No members */ |
| 1575 | 0 /* No specifics */ |
| 1576 | }; |
| 1577 | |
| 1578 | |
| 1579 | /*** <<< INCLUDES [Str4] >>> ***/ |
| 1580 | |
| 1581 | #include <IA5String.h> |
| 1582 | |
| 1583 | /*** <<< TYPE-DECLS [Str4] >>> ***/ |
| 1584 | |
| 1585 | typedef IA5String_t Str4_t; |
| 1586 | |
| 1587 | /*** <<< FUNC-DECLS [Str4] >>> ***/ |
| 1588 | |
| 1589 | extern asn_TYPE_descriptor_t asn_DEF_Str4; |
| 1590 | asn_struct_free_f Str4_free; |
| 1591 | asn_struct_print_f Str4_print; |
| 1592 | asn_constr_check_f Str4_constraint; |
| 1593 | ber_type_decoder_f Str4_decode_ber; |
| 1594 | der_type_encoder_f Str4_encode_der; |
| 1595 | xer_type_decoder_f Str4_decode_xer; |
| 1596 | xer_type_encoder_f Str4_encode_xer; |
| 1597 | per_type_decoder_f Str4_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1598 | per_type_encoder_f Str4_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1599 | |
| 1600 | /*** <<< CTABLES [Str4] >>> ***/ |
| 1601 | |
| 1602 | static int check_permitted_alphabet_1(const void *sptr) { |
| 1603 | /* The underlying type is IA5String */ |
| 1604 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 1605 | const uint8_t *ch = st->buf; |
| 1606 | const uint8_t *end = ch + st->size; |
| 1607 | |
| 1608 | for(; ch < end; ch++) { |
| 1609 | uint8_t cv = *ch; |
| 1610 | if(!(cv <= 127)) return -1; |
| 1611 | } |
| 1612 | return 0; |
| 1613 | } |
| 1614 | |
| 1615 | |
| 1616 | /*** <<< CODE [Str4] >>> ***/ |
| 1617 | |
| 1618 | int |
| 1619 | Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1620 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1621 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 1622 | |
| 1623 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1624 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1625 | "%s: value not given (%s:%d)", |
| 1626 | td->name, __FILE__, __LINE__); |
| 1627 | return -1; |
| 1628 | } |
| 1629 | |
| 1630 | |
| 1631 | if(!check_permitted_alphabet_1(st)) { |
| 1632 | /* Constraint check succeeded */ |
| 1633 | return 0; |
| 1634 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1635 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1636 | "%s: constraint failed (%s:%d)", |
| 1637 | td->name, __FILE__, __LINE__); |
| 1638 | return -1; |
| 1639 | } |
| 1640 | } |
| 1641 | |
| 1642 | /* |
| 1643 | * This type is implemented using IA5String, |
| 1644 | * so here we adjust the DEF accordingly. |
| 1645 | */ |
| 1646 | static void |
| 1647 | Str4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 1648 | td->free_struct = asn_DEF_IA5String.free_struct; |
| 1649 | td->print_struct = asn_DEF_IA5String.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 1650 | td->check_constraints = asn_DEF_IA5String.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1651 | td->ber_decoder = asn_DEF_IA5String.ber_decoder; |
| 1652 | td->der_encoder = asn_DEF_IA5String.der_encoder; |
| 1653 | td->xer_decoder = asn_DEF_IA5String.xer_decoder; |
| 1654 | td->xer_encoder = asn_DEF_IA5String.xer_encoder; |
| 1655 | td->uper_decoder = asn_DEF_IA5String.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1656 | td->uper_encoder = asn_DEF_IA5String.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 1657 | td->oer_decoder = asn_DEF_IA5String.oer_decoder; |
| 1658 | td->oer_encoder = asn_DEF_IA5String.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1659 | if(!td->oer_constraints) |
| 1660 | td->oer_constraints = asn_DEF_IA5String.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1661 | if(!td->per_constraints) |
| 1662 | td->per_constraints = asn_DEF_IA5String.per_constraints; |
| 1663 | td->elements = asn_DEF_IA5String.elements; |
| 1664 | td->elements_count = asn_DEF_IA5String.elements_count; |
| 1665 | td->specifics = asn_DEF_IA5String.specifics; |
| 1666 | } |
| 1667 | |
| 1668 | void |
| 1669 | Str4_free(asn_TYPE_descriptor_t *td, |
| 1670 | void *struct_ptr, int contents_only) { |
| 1671 | Str4_1_inherit_TYPE_descriptor(td); |
| 1672 | td->free_struct(td, struct_ptr, contents_only); |
| 1673 | } |
| 1674 | |
| 1675 | int |
| 1676 | Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1677 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1678 | Str4_1_inherit_TYPE_descriptor(td); |
| 1679 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1680 | } |
| 1681 | |
| 1682 | asn_dec_rval_t |
| 1683 | Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1684 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1685 | Str4_1_inherit_TYPE_descriptor(td); |
| 1686 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1687 | } |
| 1688 | |
| 1689 | asn_enc_rval_t |
| 1690 | Str4_encode_der(asn_TYPE_descriptor_t *td, |
| 1691 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1692 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1693 | Str4_1_inherit_TYPE_descriptor(td); |
| 1694 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1695 | } |
| 1696 | |
| 1697 | asn_dec_rval_t |
| 1698 | Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1699 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1700 | Str4_1_inherit_TYPE_descriptor(td); |
| 1701 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1702 | } |
| 1703 | |
| 1704 | asn_enc_rval_t |
| 1705 | Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1706 | int ilevel, enum xer_encoder_flags_e flags, |
| 1707 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1708 | Str4_1_inherit_TYPE_descriptor(td); |
| 1709 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1710 | } |
| 1711 | |
| 1712 | asn_dec_rval_t |
| 1713 | Str4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1714 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 1715 | Str4_1_inherit_TYPE_descriptor(td); |
| 1716 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 1717 | } |
| 1718 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1719 | asn_enc_rval_t |
| 1720 | Str4_encode_uper(asn_TYPE_descriptor_t *td, |
| 1721 | asn_per_constraints_t *constraints, |
| 1722 | void *structure, asn_per_outp_t *per_out) { |
| 1723 | Str4_1_inherit_TYPE_descriptor(td); |
| 1724 | return td->uper_encoder(td, constraints, structure, per_out); |
| 1725 | } |
| 1726 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1727 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 1728 | /*** <<< CTDEFS [Str4] >>> ***/ |
| 1729 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 1730 | static asn_per_constraints_t asn_PER_type_Str4_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 1731 | { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, |
| 1732 | { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, |
| 1733 | 0, 0 /* No PER character map necessary */ |
| 1734 | }; |
| 1735 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1736 | /*** <<< STAT-DEFS [Str4] >>> ***/ |
| 1737 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1738 | static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1739 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 1740 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1741 | asn_TYPE_descriptor_t asn_DEF_Str4 = { |
| 1742 | "Str4", |
| 1743 | "Str4", |
| 1744 | Str4_free, |
| 1745 | Str4_print, |
| 1746 | Str4_constraint, |
| 1747 | Str4_decode_ber, |
| 1748 | Str4_encode_der, |
| 1749 | Str4_decode_xer, |
| 1750 | Str4_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1751 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1752 | Str4_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1753 | Str4_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1754 | 0, /* Use generic outmost tag fetcher */ |
| 1755 | asn_DEF_Str4_tags_1, |
| 1756 | sizeof(asn_DEF_Str4_tags_1) |
| 1757 | /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */ |
| 1758 | asn_DEF_Str4_tags_1, /* Same as above */ |
| 1759 | sizeof(asn_DEF_Str4_tags_1) |
| 1760 | /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1761 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 1762 | &asn_PER_type_Str4_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1763 | 0, 0, /* No members */ |
| 1764 | 0 /* No specifics */ |
| 1765 | }; |
| 1766 | |
| 1767 | |
| 1768 | /*** <<< INCLUDES [PER-Visible] >>> ***/ |
| 1769 | |
| 1770 | #include <IA5String.h> |
| 1771 | |
| 1772 | /*** <<< TYPE-DECLS [PER-Visible] >>> ***/ |
| 1773 | |
| 1774 | typedef IA5String_t PER_Visible_t; |
| 1775 | |
| 1776 | /*** <<< FUNC-DECLS [PER-Visible] >>> ***/ |
| 1777 | |
| 1778 | extern asn_TYPE_descriptor_t asn_DEF_PER_Visible; |
| 1779 | asn_struct_free_f PER_Visible_free; |
| 1780 | asn_struct_print_f PER_Visible_print; |
| 1781 | asn_constr_check_f PER_Visible_constraint; |
| 1782 | ber_type_decoder_f PER_Visible_decode_ber; |
| 1783 | der_type_encoder_f PER_Visible_encode_der; |
| 1784 | xer_type_decoder_f PER_Visible_decode_xer; |
| 1785 | xer_type_encoder_f PER_Visible_encode_xer; |
| 1786 | per_type_decoder_f PER_Visible_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1787 | per_type_encoder_f PER_Visible_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1788 | |
| 1789 | /*** <<< CTABLES [PER-Visible] >>> ***/ |
| 1790 | |
| 1791 | static int check_permitted_alphabet_1(const void *sptr) { |
| 1792 | /* The underlying type is IA5String */ |
| 1793 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 1794 | const uint8_t *ch = st->buf; |
| 1795 | const uint8_t *end = ch + st->size; |
| 1796 | |
| 1797 | for(; ch < end; ch++) { |
| 1798 | uint8_t cv = *ch; |
| 1799 | if(!(cv >= 65 && cv <= 70)) return -1; |
| 1800 | } |
| 1801 | return 0; |
| 1802 | } |
| 1803 | |
| 1804 | |
| 1805 | /*** <<< CODE [PER-Visible] >>> ***/ |
| 1806 | |
| 1807 | int |
| 1808 | PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1809 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1810 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 1811 | |
| 1812 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1813 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1814 | "%s: value not given (%s:%d)", |
| 1815 | td->name, __FILE__, __LINE__); |
| 1816 | return -1; |
| 1817 | } |
| 1818 | |
| 1819 | |
| 1820 | if(!check_permitted_alphabet_1(st)) { |
| 1821 | /* Constraint check succeeded */ |
| 1822 | return 0; |
| 1823 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1824 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1825 | "%s: constraint failed (%s:%d)", |
| 1826 | td->name, __FILE__, __LINE__); |
| 1827 | return -1; |
| 1828 | } |
| 1829 | } |
| 1830 | |
| 1831 | /* |
| 1832 | * This type is implemented using IA5String, |
| 1833 | * so here we adjust the DEF accordingly. |
| 1834 | */ |
| 1835 | static void |
| 1836 | PER_Visible_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 1837 | td->free_struct = asn_DEF_IA5String.free_struct; |
| 1838 | td->print_struct = asn_DEF_IA5String.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 1839 | td->check_constraints = asn_DEF_IA5String.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1840 | td->ber_decoder = asn_DEF_IA5String.ber_decoder; |
| 1841 | td->der_encoder = asn_DEF_IA5String.der_encoder; |
| 1842 | td->xer_decoder = asn_DEF_IA5String.xer_decoder; |
| 1843 | td->xer_encoder = asn_DEF_IA5String.xer_encoder; |
| 1844 | td->uper_decoder = asn_DEF_IA5String.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1845 | td->uper_encoder = asn_DEF_IA5String.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 1846 | td->oer_decoder = asn_DEF_IA5String.oer_decoder; |
| 1847 | td->oer_encoder = asn_DEF_IA5String.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1848 | if(!td->oer_constraints) |
| 1849 | td->oer_constraints = asn_DEF_IA5String.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1850 | if(!td->per_constraints) |
| 1851 | td->per_constraints = asn_DEF_IA5String.per_constraints; |
| 1852 | td->elements = asn_DEF_IA5String.elements; |
| 1853 | td->elements_count = asn_DEF_IA5String.elements_count; |
| 1854 | td->specifics = asn_DEF_IA5String.specifics; |
| 1855 | } |
| 1856 | |
| 1857 | void |
| 1858 | PER_Visible_free(asn_TYPE_descriptor_t *td, |
| 1859 | void *struct_ptr, int contents_only) { |
| 1860 | PER_Visible_1_inherit_TYPE_descriptor(td); |
| 1861 | td->free_struct(td, struct_ptr, contents_only); |
| 1862 | } |
| 1863 | |
| 1864 | int |
| 1865 | PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 1866 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 1867 | PER_Visible_1_inherit_TYPE_descriptor(td); |
| 1868 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 1869 | } |
| 1870 | |
| 1871 | asn_dec_rval_t |
| 1872 | PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1873 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 1874 | PER_Visible_1_inherit_TYPE_descriptor(td); |
| 1875 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 1876 | } |
| 1877 | |
| 1878 | asn_enc_rval_t |
| 1879 | PER_Visible_encode_der(asn_TYPE_descriptor_t *td, |
| 1880 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 1881 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1882 | PER_Visible_1_inherit_TYPE_descriptor(td); |
| 1883 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 1884 | } |
| 1885 | |
| 1886 | asn_dec_rval_t |
| 1887 | PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1888 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 1889 | PER_Visible_1_inherit_TYPE_descriptor(td); |
| 1890 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 1891 | } |
| 1892 | |
| 1893 | asn_enc_rval_t |
| 1894 | PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 1895 | int ilevel, enum xer_encoder_flags_e flags, |
| 1896 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 1897 | PER_Visible_1_inherit_TYPE_descriptor(td); |
| 1898 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 1899 | } |
| 1900 | |
| 1901 | asn_dec_rval_t |
| 1902 | PER_Visible_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 1903 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 1904 | PER_Visible_1_inherit_TYPE_descriptor(td); |
| 1905 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 1906 | } |
| 1907 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1908 | asn_enc_rval_t |
| 1909 | PER_Visible_encode_uper(asn_TYPE_descriptor_t *td, |
| 1910 | asn_per_constraints_t *constraints, |
| 1911 | void *structure, asn_per_outp_t *per_out) { |
| 1912 | PER_Visible_1_inherit_TYPE_descriptor(td); |
| 1913 | return td->uper_encoder(td, constraints, structure, per_out); |
| 1914 | } |
| 1915 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1916 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 1917 | /*** <<< CTDEFS [PER-Visible] >>> ***/ |
| 1918 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 1919 | static asn_per_constraints_t asn_PER_type_PER_Visible_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 1920 | { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */, |
| 1921 | { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, |
| 1922 | 0, 0 /* No PER character map necessary */ |
| 1923 | }; |
| 1924 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1925 | /*** <<< STAT-DEFS [PER-Visible] >>> ***/ |
| 1926 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1927 | static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1928 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 1929 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1930 | asn_TYPE_descriptor_t asn_DEF_PER_Visible = { |
| 1931 | "PER-Visible", |
| 1932 | "PER-Visible", |
| 1933 | PER_Visible_free, |
| 1934 | PER_Visible_print, |
| 1935 | PER_Visible_constraint, |
| 1936 | PER_Visible_decode_ber, |
| 1937 | PER_Visible_encode_der, |
| 1938 | PER_Visible_decode_xer, |
| 1939 | PER_Visible_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1940 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1941 | PER_Visible_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1942 | PER_Visible_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1943 | 0, /* Use generic outmost tag fetcher */ |
| 1944 | asn_DEF_PER_Visible_tags_1, |
| 1945 | sizeof(asn_DEF_PER_Visible_tags_1) |
| 1946 | /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */ |
| 1947 | asn_DEF_PER_Visible_tags_1, /* Same as above */ |
| 1948 | sizeof(asn_DEF_PER_Visible_tags_1) |
| 1949 | /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1950 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 1951 | &asn_PER_type_PER_Visible_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1952 | 0, 0, /* No members */ |
| 1953 | 0 /* No specifics */ |
| 1954 | }; |
| 1955 | |
| 1956 | |
| 1957 | /*** <<< INCLUDES [PER-Visible-2] >>> ***/ |
| 1958 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1959 | #include "PER-Visible.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1960 | |
| 1961 | /*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/ |
| 1962 | |
| 1963 | typedef PER_Visible_t PER_Visible_2_t; |
| 1964 | |
| 1965 | /*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/ |
| 1966 | |
| 1967 | extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2; |
| 1968 | asn_struct_free_f PER_Visible_2_free; |
| 1969 | asn_struct_print_f PER_Visible_2_print; |
| 1970 | asn_constr_check_f PER_Visible_2_constraint; |
| 1971 | ber_type_decoder_f PER_Visible_2_decode_ber; |
| 1972 | der_type_encoder_f PER_Visible_2_encode_der; |
| 1973 | xer_type_decoder_f PER_Visible_2_decode_xer; |
| 1974 | xer_type_encoder_f PER_Visible_2_encode_xer; |
| 1975 | per_type_decoder_f PER_Visible_2_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 1976 | per_type_encoder_f PER_Visible_2_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1977 | |
| 1978 | /*** <<< CTABLES [PER-Visible-2] >>> ***/ |
| 1979 | |
| 1980 | static int check_permitted_alphabet_1(const void *sptr) { |
| 1981 | /* The underlying type is IA5String */ |
| 1982 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 1983 | const uint8_t *ch = st->buf; |
| 1984 | const uint8_t *end = ch + st->size; |
| 1985 | |
| 1986 | for(; ch < end; ch++) { |
| 1987 | uint8_t cv = *ch; |
| 1988 | if(!(cv >= 69 && cv <= 70)) return -1; |
| 1989 | } |
| 1990 | return 0; |
| 1991 | } |
| 1992 | |
| 1993 | |
| 1994 | /*** <<< CODE [PER-Visible-2] >>> ***/ |
| 1995 | |
| 1996 | int |
| 1997 | PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1998 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1999 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
| 2000 | |
| 2001 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2002 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2003 | "%s: value not given (%s:%d)", |
| 2004 | td->name, __FILE__, __LINE__); |
| 2005 | return -1; |
| 2006 | } |
| 2007 | |
| 2008 | |
| 2009 | if(!check_permitted_alphabet_1(st)) { |
| 2010 | /* Constraint check succeeded */ |
| 2011 | return 0; |
| 2012 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2013 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2014 | "%s: constraint failed (%s:%d)", |
| 2015 | td->name, __FILE__, __LINE__); |
| 2016 | return -1; |
| 2017 | } |
| 2018 | } |
| 2019 | |
| 2020 | /* |
| 2021 | * This type is implemented using PER_Visible, |
| 2022 | * so here we adjust the DEF accordingly. |
| 2023 | */ |
| 2024 | static void |
| 2025 | PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 2026 | td->free_struct = asn_DEF_PER_Visible.free_struct; |
| 2027 | td->print_struct = asn_DEF_PER_Visible.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 2028 | td->check_constraints = asn_DEF_PER_Visible.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2029 | td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; |
| 2030 | td->der_encoder = asn_DEF_PER_Visible.der_encoder; |
| 2031 | td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; |
| 2032 | td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; |
| 2033 | td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2034 | td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 2035 | td->oer_decoder = asn_DEF_PER_Visible.oer_decoder; |
| 2036 | td->oer_encoder = asn_DEF_PER_Visible.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2037 | if(!td->oer_constraints) |
| 2038 | td->oer_constraints = asn_DEF_PER_Visible.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2039 | if(!td->per_constraints) |
| 2040 | td->per_constraints = asn_DEF_PER_Visible.per_constraints; |
| 2041 | td->elements = asn_DEF_PER_Visible.elements; |
| 2042 | td->elements_count = asn_DEF_PER_Visible.elements_count; |
| 2043 | td->specifics = asn_DEF_PER_Visible.specifics; |
| 2044 | } |
| 2045 | |
| 2046 | void |
| 2047 | PER_Visible_2_free(asn_TYPE_descriptor_t *td, |
| 2048 | void *struct_ptr, int contents_only) { |
| 2049 | PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2050 | td->free_struct(td, struct_ptr, contents_only); |
| 2051 | } |
| 2052 | |
| 2053 | int |
| 2054 | PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 2055 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 2056 | PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2057 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 2058 | } |
| 2059 | |
| 2060 | asn_dec_rval_t |
| 2061 | PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2062 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 2063 | PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2064 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 2065 | } |
| 2066 | |
| 2067 | asn_enc_rval_t |
| 2068 | PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td, |
| 2069 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 2070 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2071 | PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2072 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 2073 | } |
| 2074 | |
| 2075 | asn_dec_rval_t |
| 2076 | PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2077 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 2078 | PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2079 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 2080 | } |
| 2081 | |
| 2082 | asn_enc_rval_t |
| 2083 | PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 2084 | int ilevel, enum xer_encoder_flags_e flags, |
| 2085 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2086 | PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2087 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 2088 | } |
| 2089 | |
| 2090 | asn_dec_rval_t |
| 2091 | PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2092 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 2093 | PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2094 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 2095 | } |
| 2096 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2097 | asn_enc_rval_t |
| 2098 | PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td, |
| 2099 | asn_per_constraints_t *constraints, |
| 2100 | void *structure, asn_per_outp_t *per_out) { |
| 2101 | PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2102 | return td->uper_encoder(td, constraints, structure, per_out); |
| 2103 | } |
| 2104 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2105 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2106 | /*** <<< CTDEFS [PER-Visible-2] >>> ***/ |
| 2107 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 2108 | static asn_per_constraints_t asn_PER_type_PER_Visible_2_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2109 | { APC_CONSTRAINED, 1, 1, 69, 70 } /* (69..70) */, |
| 2110 | { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, |
| 2111 | 0, 0 /* No PER character map necessary */ |
| 2112 | }; |
| 2113 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2114 | /*** <<< STAT-DEFS [PER-Visible-2] >>> ***/ |
| 2115 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2116 | static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2117 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 2118 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2119 | asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = { |
| 2120 | "PER-Visible-2", |
| 2121 | "PER-Visible-2", |
| 2122 | PER_Visible_2_free, |
| 2123 | PER_Visible_2_print, |
| 2124 | PER_Visible_2_constraint, |
| 2125 | PER_Visible_2_decode_ber, |
| 2126 | PER_Visible_2_encode_der, |
| 2127 | PER_Visible_2_decode_xer, |
| 2128 | PER_Visible_2_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2129 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2130 | PER_Visible_2_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2131 | PER_Visible_2_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2132 | 0, /* Use generic outmost tag fetcher */ |
| 2133 | asn_DEF_PER_Visible_2_tags_1, |
| 2134 | sizeof(asn_DEF_PER_Visible_2_tags_1) |
| 2135 | /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */ |
| 2136 | asn_DEF_PER_Visible_2_tags_1, /* Same as above */ |
| 2137 | sizeof(asn_DEF_PER_Visible_2_tags_1) |
| 2138 | /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2139 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 2140 | &asn_PER_type_PER_Visible_2_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2141 | 0, 0, /* No members */ |
| 2142 | 0 /* No specifics */ |
| 2143 | }; |
| 2144 | |
| 2145 | |
| 2146 | /*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/ |
| 2147 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 2148 | #include "PER-Visible.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2149 | |
| 2150 | /*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/ |
| 2151 | |
| 2152 | typedef PER_Visible_t Not_PER_Visible_1_t; |
| 2153 | |
| 2154 | /*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/ |
| 2155 | |
| 2156 | extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1; |
| 2157 | asn_struct_free_f Not_PER_Visible_1_free; |
| 2158 | asn_struct_print_f Not_PER_Visible_1_print; |
| 2159 | asn_constr_check_f Not_PER_Visible_1_constraint; |
| 2160 | ber_type_decoder_f Not_PER_Visible_1_decode_ber; |
| 2161 | der_type_encoder_f Not_PER_Visible_1_encode_der; |
| 2162 | xer_type_decoder_f Not_PER_Visible_1_decode_xer; |
| 2163 | xer_type_encoder_f Not_PER_Visible_1_encode_xer; |
| 2164 | per_type_decoder_f Not_PER_Visible_1_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2165 | per_type_encoder_f Not_PER_Visible_1_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2166 | |
| 2167 | /*** <<< CTABLES [Not-PER-Visible-1] >>> ***/ |
| 2168 | |
| 2169 | static int check_permitted_alphabet_1(const void *sptr) { |
| 2170 | /* The underlying type is IA5String */ |
| 2171 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 2172 | const uint8_t *ch = st->buf; |
| 2173 | const uint8_t *end = ch + st->size; |
| 2174 | |
| 2175 | for(; ch < end; ch++) { |
| 2176 | uint8_t cv = *ch; |
| 2177 | if(!(cv >= 65 && cv <= 70)) return -1; |
| 2178 | } |
| 2179 | return 0; |
| 2180 | } |
| 2181 | |
| 2182 | |
| 2183 | /*** <<< CODE [Not-PER-Visible-1] >>> ***/ |
| 2184 | |
| 2185 | int |
| 2186 | Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2187 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2188 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
| 2189 | |
| 2190 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2191 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2192 | "%s: value not given (%s:%d)", |
| 2193 | td->name, __FILE__, __LINE__); |
| 2194 | return -1; |
| 2195 | } |
| 2196 | |
| 2197 | |
| 2198 | if(!check_permitted_alphabet_1(st)) { |
| 2199 | /* Constraint check succeeded */ |
| 2200 | return 0; |
| 2201 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2202 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2203 | "%s: constraint failed (%s:%d)", |
| 2204 | td->name, __FILE__, __LINE__); |
| 2205 | return -1; |
| 2206 | } |
| 2207 | } |
| 2208 | |
| 2209 | /* |
| 2210 | * This type is implemented using PER_Visible, |
| 2211 | * so here we adjust the DEF accordingly. |
| 2212 | */ |
| 2213 | static void |
| 2214 | Not_PER_Visible_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 2215 | td->free_struct = asn_DEF_PER_Visible.free_struct; |
| 2216 | td->print_struct = asn_DEF_PER_Visible.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 2217 | td->check_constraints = asn_DEF_PER_Visible.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2218 | td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; |
| 2219 | td->der_encoder = asn_DEF_PER_Visible.der_encoder; |
| 2220 | td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; |
| 2221 | td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; |
| 2222 | td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2223 | td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 2224 | td->oer_decoder = asn_DEF_PER_Visible.oer_decoder; |
| 2225 | td->oer_encoder = asn_DEF_PER_Visible.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2226 | if(!td->oer_constraints) |
| 2227 | td->oer_constraints = asn_DEF_PER_Visible.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2228 | if(!td->per_constraints) |
| 2229 | td->per_constraints = asn_DEF_PER_Visible.per_constraints; |
| 2230 | td->elements = asn_DEF_PER_Visible.elements; |
| 2231 | td->elements_count = asn_DEF_PER_Visible.elements_count; |
| 2232 | td->specifics = asn_DEF_PER_Visible.specifics; |
| 2233 | } |
| 2234 | |
| 2235 | void |
| 2236 | Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td, |
| 2237 | void *struct_ptr, int contents_only) { |
| 2238 | Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); |
| 2239 | td->free_struct(td, struct_ptr, contents_only); |
| 2240 | } |
| 2241 | |
| 2242 | int |
| 2243 | Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 2244 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 2245 | Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); |
| 2246 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 2247 | } |
| 2248 | |
| 2249 | asn_dec_rval_t |
| 2250 | Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2251 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 2252 | Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); |
| 2253 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 2254 | } |
| 2255 | |
| 2256 | asn_enc_rval_t |
| 2257 | Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td, |
| 2258 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 2259 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2260 | Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); |
| 2261 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 2262 | } |
| 2263 | |
| 2264 | asn_dec_rval_t |
| 2265 | Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2266 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 2267 | Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); |
| 2268 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 2269 | } |
| 2270 | |
| 2271 | asn_enc_rval_t |
| 2272 | Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 2273 | int ilevel, enum xer_encoder_flags_e flags, |
| 2274 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2275 | Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); |
| 2276 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 2277 | } |
| 2278 | |
| 2279 | asn_dec_rval_t |
| 2280 | Not_PER_Visible_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2281 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 2282 | Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); |
| 2283 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 2284 | } |
| 2285 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2286 | asn_enc_rval_t |
| 2287 | Not_PER_Visible_1_encode_uper(asn_TYPE_descriptor_t *td, |
| 2288 | asn_per_constraints_t *constraints, |
| 2289 | void *structure, asn_per_outp_t *per_out) { |
| 2290 | Not_PER_Visible_1_1_inherit_TYPE_descriptor(td); |
| 2291 | return td->uper_encoder(td, constraints, structure, per_out); |
| 2292 | } |
| 2293 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2294 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2295 | /*** <<< CTDEFS [Not-PER-Visible-1] >>> ***/ |
| 2296 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 2297 | static asn_per_constraints_t asn_PER_type_Not_PER_Visible_1_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2298 | { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */, |
| 2299 | { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, |
| 2300 | 0, 0 /* No PER character map necessary */ |
| 2301 | }; |
| 2302 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2303 | /*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/ |
| 2304 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2305 | static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2306 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 2307 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2308 | asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = { |
| 2309 | "Not-PER-Visible-1", |
| 2310 | "Not-PER-Visible-1", |
| 2311 | Not_PER_Visible_1_free, |
| 2312 | Not_PER_Visible_1_print, |
| 2313 | Not_PER_Visible_1_constraint, |
| 2314 | Not_PER_Visible_1_decode_ber, |
| 2315 | Not_PER_Visible_1_encode_der, |
| 2316 | Not_PER_Visible_1_decode_xer, |
| 2317 | Not_PER_Visible_1_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2318 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2319 | Not_PER_Visible_1_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2320 | Not_PER_Visible_1_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2321 | 0, /* Use generic outmost tag fetcher */ |
| 2322 | asn_DEF_Not_PER_Visible_1_tags_1, |
| 2323 | sizeof(asn_DEF_Not_PER_Visible_1_tags_1) |
| 2324 | /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */ |
| 2325 | asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */ |
| 2326 | sizeof(asn_DEF_Not_PER_Visible_1_tags_1) |
| 2327 | /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2328 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 2329 | &asn_PER_type_Not_PER_Visible_1_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2330 | 0, 0, /* No members */ |
| 2331 | 0 /* No specifics */ |
| 2332 | }; |
| 2333 | |
| 2334 | |
| 2335 | /*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/ |
| 2336 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 2337 | #include "PER-Visible.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2338 | |
| 2339 | /*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/ |
| 2340 | |
| 2341 | typedef PER_Visible_t Not_PER_Visible_2_t; |
| 2342 | |
| 2343 | /*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/ |
| 2344 | |
| 2345 | extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2; |
| 2346 | asn_struct_free_f Not_PER_Visible_2_free; |
| 2347 | asn_struct_print_f Not_PER_Visible_2_print; |
| 2348 | asn_constr_check_f Not_PER_Visible_2_constraint; |
| 2349 | ber_type_decoder_f Not_PER_Visible_2_decode_ber; |
| 2350 | der_type_encoder_f Not_PER_Visible_2_encode_der; |
| 2351 | xer_type_decoder_f Not_PER_Visible_2_decode_xer; |
| 2352 | xer_type_encoder_f Not_PER_Visible_2_encode_xer; |
| 2353 | per_type_decoder_f Not_PER_Visible_2_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2354 | per_type_encoder_f Not_PER_Visible_2_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2355 | |
| 2356 | /*** <<< CTABLES [Not-PER-Visible-2] >>> ***/ |
| 2357 | |
| 2358 | static int check_permitted_alphabet_1(const void *sptr) { |
| 2359 | /* The underlying type is IA5String */ |
| 2360 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 2361 | const uint8_t *ch = st->buf; |
| 2362 | const uint8_t *end = ch + st->size; |
| 2363 | |
| 2364 | for(; ch < end; ch++) { |
| 2365 | uint8_t cv = *ch; |
| 2366 | if(!(cv >= 65 && cv <= 66)) return -1; |
| 2367 | } |
| 2368 | return 0; |
| 2369 | } |
| 2370 | |
| 2371 | |
| 2372 | /*** <<< CODE [Not-PER-Visible-2] >>> ***/ |
| 2373 | |
| 2374 | int |
| 2375 | Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2376 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2377 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
| 2378 | |
| 2379 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2380 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2381 | "%s: value not given (%s:%d)", |
| 2382 | td->name, __FILE__, __LINE__); |
| 2383 | return -1; |
| 2384 | } |
| 2385 | |
| 2386 | |
| 2387 | if(!check_permitted_alphabet_1(st)) { |
| 2388 | /* Constraint check succeeded */ |
| 2389 | return 0; |
| 2390 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2391 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2392 | "%s: constraint failed (%s:%d)", |
| 2393 | td->name, __FILE__, __LINE__); |
| 2394 | return -1; |
| 2395 | } |
| 2396 | } |
| 2397 | |
| 2398 | /* |
| 2399 | * This type is implemented using PER_Visible, |
| 2400 | * so here we adjust the DEF accordingly. |
| 2401 | */ |
| 2402 | static void |
| 2403 | Not_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 2404 | td->free_struct = asn_DEF_PER_Visible.free_struct; |
| 2405 | td->print_struct = asn_DEF_PER_Visible.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 2406 | td->check_constraints = asn_DEF_PER_Visible.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2407 | td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; |
| 2408 | td->der_encoder = asn_DEF_PER_Visible.der_encoder; |
| 2409 | td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; |
| 2410 | td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; |
| 2411 | td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2412 | td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 2413 | td->oer_decoder = asn_DEF_PER_Visible.oer_decoder; |
| 2414 | td->oer_encoder = asn_DEF_PER_Visible.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2415 | if(!td->oer_constraints) |
| 2416 | td->oer_constraints = asn_DEF_PER_Visible.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2417 | if(!td->per_constraints) |
| 2418 | td->per_constraints = asn_DEF_PER_Visible.per_constraints; |
| 2419 | td->elements = asn_DEF_PER_Visible.elements; |
| 2420 | td->elements_count = asn_DEF_PER_Visible.elements_count; |
| 2421 | td->specifics = asn_DEF_PER_Visible.specifics; |
| 2422 | } |
| 2423 | |
| 2424 | void |
| 2425 | Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td, |
| 2426 | void *struct_ptr, int contents_only) { |
| 2427 | Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2428 | td->free_struct(td, struct_ptr, contents_only); |
| 2429 | } |
| 2430 | |
| 2431 | int |
| 2432 | Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 2433 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 2434 | Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2435 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 2436 | } |
| 2437 | |
| 2438 | asn_dec_rval_t |
| 2439 | Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2440 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 2441 | Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2442 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 2443 | } |
| 2444 | |
| 2445 | asn_enc_rval_t |
| 2446 | Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td, |
| 2447 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 2448 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2449 | Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2450 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 2451 | } |
| 2452 | |
| 2453 | asn_dec_rval_t |
| 2454 | Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2455 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 2456 | Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2457 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 2458 | } |
| 2459 | |
| 2460 | asn_enc_rval_t |
| 2461 | Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 2462 | int ilevel, enum xer_encoder_flags_e flags, |
| 2463 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2464 | Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2465 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 2466 | } |
| 2467 | |
| 2468 | asn_dec_rval_t |
| 2469 | Not_PER_Visible_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2470 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 2471 | Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2472 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 2473 | } |
| 2474 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2475 | asn_enc_rval_t |
| 2476 | Not_PER_Visible_2_encode_uper(asn_TYPE_descriptor_t *td, |
| 2477 | asn_per_constraints_t *constraints, |
| 2478 | void *structure, asn_per_outp_t *per_out) { |
| 2479 | Not_PER_Visible_2_1_inherit_TYPE_descriptor(td); |
| 2480 | return td->uper_encoder(td, constraints, structure, per_out); |
| 2481 | } |
| 2482 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2483 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2484 | /*** <<< CTDEFS [Not-PER-Visible-2] >>> ***/ |
| 2485 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 2486 | static asn_per_constraints_t asn_PER_type_Not_PER_Visible_2_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2487 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 2488 | { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, |
| 2489 | 0, 0 /* No PER character map necessary */ |
| 2490 | }; |
| 2491 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2492 | /*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/ |
| 2493 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2494 | static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2495 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 2496 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2497 | asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = { |
| 2498 | "Not-PER-Visible-2", |
| 2499 | "Not-PER-Visible-2", |
| 2500 | Not_PER_Visible_2_free, |
| 2501 | Not_PER_Visible_2_print, |
| 2502 | Not_PER_Visible_2_constraint, |
| 2503 | Not_PER_Visible_2_decode_ber, |
| 2504 | Not_PER_Visible_2_encode_der, |
| 2505 | Not_PER_Visible_2_decode_xer, |
| 2506 | Not_PER_Visible_2_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2507 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2508 | Not_PER_Visible_2_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2509 | Not_PER_Visible_2_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2510 | 0, /* Use generic outmost tag fetcher */ |
| 2511 | asn_DEF_Not_PER_Visible_2_tags_1, |
| 2512 | sizeof(asn_DEF_Not_PER_Visible_2_tags_1) |
| 2513 | /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */ |
| 2514 | asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */ |
| 2515 | sizeof(asn_DEF_Not_PER_Visible_2_tags_1) |
| 2516 | /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2517 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 2518 | &asn_PER_type_Not_PER_Visible_2_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2519 | 0, 0, /* No members */ |
| 2520 | 0 /* No specifics */ |
| 2521 | }; |
| 2522 | |
| 2523 | |
| 2524 | /*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/ |
| 2525 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 2526 | #include "PER-Visible.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2527 | |
| 2528 | /*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/ |
| 2529 | |
| 2530 | typedef PER_Visible_t Not_PER_Visible_3_t; |
| 2531 | |
| 2532 | /*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/ |
| 2533 | |
| 2534 | extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3; |
| 2535 | asn_struct_free_f Not_PER_Visible_3_free; |
| 2536 | asn_struct_print_f Not_PER_Visible_3_print; |
| 2537 | asn_constr_check_f Not_PER_Visible_3_constraint; |
| 2538 | ber_type_decoder_f Not_PER_Visible_3_decode_ber; |
| 2539 | der_type_encoder_f Not_PER_Visible_3_encode_der; |
| 2540 | xer_type_decoder_f Not_PER_Visible_3_decode_xer; |
| 2541 | xer_type_encoder_f Not_PER_Visible_3_encode_xer; |
| 2542 | per_type_decoder_f Not_PER_Visible_3_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2543 | per_type_encoder_f Not_PER_Visible_3_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2544 | |
| 2545 | /*** <<< CTABLES [Not-PER-Visible-3] >>> ***/ |
| 2546 | |
| 2547 | static int check_permitted_alphabet_1(const void *sptr) { |
| 2548 | /* The underlying type is IA5String */ |
| 2549 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 2550 | const uint8_t *ch = st->buf; |
| 2551 | const uint8_t *end = ch + st->size; |
| 2552 | |
| 2553 | for(; ch < end; ch++) { |
| 2554 | uint8_t cv = *ch; |
| 2555 | if(!(cv >= 65 && cv <= 66)) return -1; |
| 2556 | } |
| 2557 | return 0; |
| 2558 | } |
| 2559 | |
| 2560 | |
| 2561 | /*** <<< CODE [Not-PER-Visible-3] >>> ***/ |
| 2562 | |
| 2563 | int |
| 2564 | Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2565 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2566 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
| 2567 | |
| 2568 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2569 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2570 | "%s: value not given (%s:%d)", |
| 2571 | td->name, __FILE__, __LINE__); |
| 2572 | return -1; |
| 2573 | } |
| 2574 | |
| 2575 | |
| 2576 | if(!check_permitted_alphabet_1(st)) { |
| 2577 | /* Constraint check succeeded */ |
| 2578 | return 0; |
| 2579 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2580 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2581 | "%s: constraint failed (%s:%d)", |
| 2582 | td->name, __FILE__, __LINE__); |
| 2583 | return -1; |
| 2584 | } |
| 2585 | } |
| 2586 | |
| 2587 | /* |
| 2588 | * This type is implemented using PER_Visible, |
| 2589 | * so here we adjust the DEF accordingly. |
| 2590 | */ |
| 2591 | static void |
| 2592 | Not_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 2593 | td->free_struct = asn_DEF_PER_Visible.free_struct; |
| 2594 | td->print_struct = asn_DEF_PER_Visible.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 2595 | td->check_constraints = asn_DEF_PER_Visible.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2596 | td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; |
| 2597 | td->der_encoder = asn_DEF_PER_Visible.der_encoder; |
| 2598 | td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; |
| 2599 | td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; |
| 2600 | td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2601 | td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 2602 | td->oer_decoder = asn_DEF_PER_Visible.oer_decoder; |
| 2603 | td->oer_encoder = asn_DEF_PER_Visible.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2604 | if(!td->oer_constraints) |
| 2605 | td->oer_constraints = asn_DEF_PER_Visible.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2606 | if(!td->per_constraints) |
| 2607 | td->per_constraints = asn_DEF_PER_Visible.per_constraints; |
| 2608 | td->elements = asn_DEF_PER_Visible.elements; |
| 2609 | td->elements_count = asn_DEF_PER_Visible.elements_count; |
| 2610 | td->specifics = asn_DEF_PER_Visible.specifics; |
| 2611 | } |
| 2612 | |
| 2613 | void |
| 2614 | Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td, |
| 2615 | void *struct_ptr, int contents_only) { |
| 2616 | Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); |
| 2617 | td->free_struct(td, struct_ptr, contents_only); |
| 2618 | } |
| 2619 | |
| 2620 | int |
| 2621 | Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 2622 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 2623 | Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); |
| 2624 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 2625 | } |
| 2626 | |
| 2627 | asn_dec_rval_t |
| 2628 | Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2629 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 2630 | Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); |
| 2631 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 2632 | } |
| 2633 | |
| 2634 | asn_enc_rval_t |
| 2635 | Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td, |
| 2636 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 2637 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2638 | Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); |
| 2639 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 2640 | } |
| 2641 | |
| 2642 | asn_dec_rval_t |
| 2643 | Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2644 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 2645 | Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); |
| 2646 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 2647 | } |
| 2648 | |
| 2649 | asn_enc_rval_t |
| 2650 | Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 2651 | int ilevel, enum xer_encoder_flags_e flags, |
| 2652 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2653 | Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); |
| 2654 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 2655 | } |
| 2656 | |
| 2657 | asn_dec_rval_t |
| 2658 | Not_PER_Visible_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2659 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 2660 | Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); |
| 2661 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 2662 | } |
| 2663 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2664 | asn_enc_rval_t |
| 2665 | Not_PER_Visible_3_encode_uper(asn_TYPE_descriptor_t *td, |
| 2666 | asn_per_constraints_t *constraints, |
| 2667 | void *structure, asn_per_outp_t *per_out) { |
| 2668 | Not_PER_Visible_3_1_inherit_TYPE_descriptor(td); |
| 2669 | return td->uper_encoder(td, constraints, structure, per_out); |
| 2670 | } |
| 2671 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2672 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2673 | /*** <<< CTDEFS [Not-PER-Visible-3] >>> ***/ |
| 2674 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 2675 | static asn_per_constraints_t asn_PER_type_Not_PER_Visible_3_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2676 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 2677 | { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, |
| 2678 | 0, 0 /* No PER character map necessary */ |
| 2679 | }; |
| 2680 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2681 | /*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/ |
| 2682 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2683 | static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2684 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 2685 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2686 | asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = { |
| 2687 | "Not-PER-Visible-3", |
| 2688 | "Not-PER-Visible-3", |
| 2689 | Not_PER_Visible_3_free, |
| 2690 | Not_PER_Visible_3_print, |
| 2691 | Not_PER_Visible_3_constraint, |
| 2692 | Not_PER_Visible_3_decode_ber, |
| 2693 | Not_PER_Visible_3_encode_der, |
| 2694 | Not_PER_Visible_3_decode_xer, |
| 2695 | Not_PER_Visible_3_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2696 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2697 | Not_PER_Visible_3_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2698 | Not_PER_Visible_3_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2699 | 0, /* Use generic outmost tag fetcher */ |
| 2700 | asn_DEF_Not_PER_Visible_3_tags_1, |
| 2701 | sizeof(asn_DEF_Not_PER_Visible_3_tags_1) |
| 2702 | /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */ |
| 2703 | asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */ |
| 2704 | sizeof(asn_DEF_Not_PER_Visible_3_tags_1) |
| 2705 | /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2706 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 2707 | &asn_PER_type_Not_PER_Visible_3_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2708 | 0, 0, /* No members */ |
| 2709 | 0 /* No specifics */ |
| 2710 | }; |
| 2711 | |
| 2712 | |
| 2713 | /*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/ |
| 2714 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 2715 | #include "PER-Visible.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2716 | |
| 2717 | /*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/ |
| 2718 | |
| 2719 | typedef PER_Visible_t SIZE_but_not_FROM_t; |
| 2720 | |
| 2721 | /*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/ |
| 2722 | |
| 2723 | extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM; |
| 2724 | asn_struct_free_f SIZE_but_not_FROM_free; |
| 2725 | asn_struct_print_f SIZE_but_not_FROM_print; |
| 2726 | asn_constr_check_f SIZE_but_not_FROM_constraint; |
| 2727 | ber_type_decoder_f SIZE_but_not_FROM_decode_ber; |
| 2728 | der_type_encoder_f SIZE_but_not_FROM_encode_der; |
| 2729 | xer_type_decoder_f SIZE_but_not_FROM_decode_xer; |
| 2730 | xer_type_encoder_f SIZE_but_not_FROM_encode_xer; |
| 2731 | per_type_decoder_f SIZE_but_not_FROM_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2732 | per_type_encoder_f SIZE_but_not_FROM_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2733 | |
| 2734 | /*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/ |
| 2735 | |
| 2736 | static int check_permitted_alphabet_1(const void *sptr) { |
| 2737 | /* The underlying type is IA5String */ |
| 2738 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 2739 | const uint8_t *ch = st->buf; |
| 2740 | const uint8_t *end = ch + st->size; |
| 2741 | |
| 2742 | for(; ch < end; ch++) { |
| 2743 | uint8_t cv = *ch; |
| 2744 | if(!(cv >= 65 && cv <= 68)) return -1; |
| 2745 | } |
| 2746 | return 0; |
| 2747 | } |
| 2748 | |
| 2749 | |
| 2750 | /*** <<< CODE [SIZE-but-not-FROM] >>> ***/ |
| 2751 | |
| 2752 | int |
| 2753 | SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2754 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2755 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
| 2756 | size_t size; |
| 2757 | |
| 2758 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2759 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2760 | "%s: value not given (%s:%d)", |
| 2761 | td->name, __FILE__, __LINE__); |
| 2762 | return -1; |
| 2763 | } |
| 2764 | |
| 2765 | size = st->size; |
| 2766 | |
| 2767 | if((size >= 1 && size <= 4) |
| 2768 | && !check_permitted_alphabet_1(st)) { |
| 2769 | /* Constraint check succeeded */ |
| 2770 | return 0; |
| 2771 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2772 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2773 | "%s: constraint failed (%s:%d)", |
| 2774 | td->name, __FILE__, __LINE__); |
| 2775 | return -1; |
| 2776 | } |
| 2777 | } |
| 2778 | |
| 2779 | /* |
| 2780 | * This type is implemented using PER_Visible, |
| 2781 | * so here we adjust the DEF accordingly. |
| 2782 | */ |
| 2783 | static void |
| 2784 | SIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 2785 | td->free_struct = asn_DEF_PER_Visible.free_struct; |
| 2786 | td->print_struct = asn_DEF_PER_Visible.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 2787 | td->check_constraints = asn_DEF_PER_Visible.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2788 | td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; |
| 2789 | td->der_encoder = asn_DEF_PER_Visible.der_encoder; |
| 2790 | td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; |
| 2791 | td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; |
| 2792 | td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2793 | td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 2794 | td->oer_decoder = asn_DEF_PER_Visible.oer_decoder; |
| 2795 | td->oer_encoder = asn_DEF_PER_Visible.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2796 | if(!td->oer_constraints) |
| 2797 | td->oer_constraints = asn_DEF_PER_Visible.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2798 | if(!td->per_constraints) |
| 2799 | td->per_constraints = asn_DEF_PER_Visible.per_constraints; |
| 2800 | td->elements = asn_DEF_PER_Visible.elements; |
| 2801 | td->elements_count = asn_DEF_PER_Visible.elements_count; |
| 2802 | td->specifics = asn_DEF_PER_Visible.specifics; |
| 2803 | } |
| 2804 | |
| 2805 | void |
| 2806 | SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td, |
| 2807 | void *struct_ptr, int contents_only) { |
| 2808 | SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); |
| 2809 | td->free_struct(td, struct_ptr, contents_only); |
| 2810 | } |
| 2811 | |
| 2812 | int |
| 2813 | SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 2814 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 2815 | SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); |
| 2816 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 2817 | } |
| 2818 | |
| 2819 | asn_dec_rval_t |
| 2820 | SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2821 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 2822 | SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); |
| 2823 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 2824 | } |
| 2825 | |
| 2826 | asn_enc_rval_t |
| 2827 | SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td, |
| 2828 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 2829 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2830 | SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); |
| 2831 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 2832 | } |
| 2833 | |
| 2834 | asn_dec_rval_t |
| 2835 | SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2836 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 2837 | SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); |
| 2838 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 2839 | } |
| 2840 | |
| 2841 | asn_enc_rval_t |
| 2842 | SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 2843 | int ilevel, enum xer_encoder_flags_e flags, |
| 2844 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 2845 | SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); |
| 2846 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 2847 | } |
| 2848 | |
| 2849 | asn_dec_rval_t |
| 2850 | SIZE_but_not_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 2851 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 2852 | SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); |
| 2853 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 2854 | } |
| 2855 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2856 | asn_enc_rval_t |
| 2857 | SIZE_but_not_FROM_encode_uper(asn_TYPE_descriptor_t *td, |
| 2858 | asn_per_constraints_t *constraints, |
| 2859 | void *structure, asn_per_outp_t *per_out) { |
| 2860 | SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td); |
| 2861 | return td->uper_encoder(td, constraints, structure, per_out); |
| 2862 | } |
| 2863 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2864 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2865 | /*** <<< CTDEFS [SIZE-but-not-FROM] >>> ***/ |
| 2866 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 2867 | static asn_per_constraints_t asn_PER_type_SIZE_but_not_FROM_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 2868 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 2869 | { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */, |
| 2870 | 0, 0 /* No PER character map necessary */ |
| 2871 | }; |
| 2872 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2873 | /*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/ |
| 2874 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2875 | static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2876 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 2877 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2878 | asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = { |
| 2879 | "SIZE-but-not-FROM", |
| 2880 | "SIZE-but-not-FROM", |
| 2881 | SIZE_but_not_FROM_free, |
| 2882 | SIZE_but_not_FROM_print, |
| 2883 | SIZE_but_not_FROM_constraint, |
| 2884 | SIZE_but_not_FROM_decode_ber, |
| 2885 | SIZE_but_not_FROM_encode_der, |
| 2886 | SIZE_but_not_FROM_decode_xer, |
| 2887 | SIZE_but_not_FROM_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2888 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2889 | SIZE_but_not_FROM_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2890 | SIZE_but_not_FROM_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2891 | 0, /* Use generic outmost tag fetcher */ |
| 2892 | asn_DEF_SIZE_but_not_FROM_tags_1, |
| 2893 | sizeof(asn_DEF_SIZE_but_not_FROM_tags_1) |
| 2894 | /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */ |
| 2895 | asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */ |
| 2896 | sizeof(asn_DEF_SIZE_but_not_FROM_tags_1) |
| 2897 | /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2898 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 2899 | &asn_PER_type_SIZE_but_not_FROM_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2900 | 0, 0, /* No members */ |
| 2901 | 0 /* No specifics */ |
| 2902 | }; |
| 2903 | |
| 2904 | |
| 2905 | /*** <<< INCLUDES [SIZE-and-FROM] >>> ***/ |
| 2906 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 2907 | #include "PER-Visible.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2908 | |
| 2909 | /*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/ |
| 2910 | |
| 2911 | typedef PER_Visible_t SIZE_and_FROM_t; |
| 2912 | |
| 2913 | /*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/ |
| 2914 | |
| 2915 | extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM; |
| 2916 | asn_struct_free_f SIZE_and_FROM_free; |
| 2917 | asn_struct_print_f SIZE_and_FROM_print; |
| 2918 | asn_constr_check_f SIZE_and_FROM_constraint; |
| 2919 | ber_type_decoder_f SIZE_and_FROM_decode_ber; |
| 2920 | der_type_encoder_f SIZE_and_FROM_encode_der; |
| 2921 | xer_type_decoder_f SIZE_and_FROM_decode_xer; |
| 2922 | xer_type_encoder_f SIZE_and_FROM_encode_xer; |
| 2923 | per_type_decoder_f SIZE_and_FROM_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2924 | per_type_encoder_f SIZE_and_FROM_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2925 | |
| 2926 | /*** <<< CTABLES [SIZE-and-FROM] >>> ***/ |
| 2927 | |
| 2928 | static int check_permitted_alphabet_1(const void *sptr) { |
| 2929 | /* The underlying type is IA5String */ |
| 2930 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 2931 | const uint8_t *ch = st->buf; |
| 2932 | const uint8_t *end = ch + st->size; |
| 2933 | |
| 2934 | for(; ch < end; ch++) { |
| 2935 | uint8_t cv = *ch; |
| 2936 | if(!(cv >= 65 && cv <= 68)) return -1; |
| 2937 | } |
| 2938 | return 0; |
| 2939 | } |
| 2940 | |
| 2941 | |
| 2942 | /*** <<< CODE [SIZE-and-FROM] >>> ***/ |
| 2943 | |
| 2944 | int |
| 2945 | SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2946 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2947 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
| 2948 | size_t size; |
| 2949 | |
| 2950 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2951 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2952 | "%s: value not given (%s:%d)", |
| 2953 | td->name, __FILE__, __LINE__); |
| 2954 | return -1; |
| 2955 | } |
| 2956 | |
| 2957 | size = st->size; |
| 2958 | |
| 2959 | if((size >= 1 && size <= 4) |
| 2960 | && !check_permitted_alphabet_1(st)) { |
| 2961 | /* Constraint check succeeded */ |
| 2962 | return 0; |
| 2963 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2964 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2965 | "%s: constraint failed (%s:%d)", |
| 2966 | td->name, __FILE__, __LINE__); |
| 2967 | return -1; |
| 2968 | } |
| 2969 | } |
| 2970 | |
| 2971 | /* |
| 2972 | * This type is implemented using PER_Visible, |
| 2973 | * so here we adjust the DEF accordingly. |
| 2974 | */ |
| 2975 | static void |
| 2976 | SIZE_and_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 2977 | td->free_struct = asn_DEF_PER_Visible.free_struct; |
| 2978 | td->print_struct = asn_DEF_PER_Visible.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 2979 | td->check_constraints = asn_DEF_PER_Visible.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2980 | td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; |
| 2981 | td->der_encoder = asn_DEF_PER_Visible.der_encoder; |
| 2982 | td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; |
| 2983 | td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; |
| 2984 | td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2985 | td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 2986 | td->oer_decoder = asn_DEF_PER_Visible.oer_decoder; |
| 2987 | td->oer_encoder = asn_DEF_PER_Visible.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2988 | if(!td->oer_constraints) |
| 2989 | td->oer_constraints = asn_DEF_PER_Visible.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2990 | if(!td->per_constraints) |
| 2991 | td->per_constraints = asn_DEF_PER_Visible.per_constraints; |
| 2992 | td->elements = asn_DEF_PER_Visible.elements; |
| 2993 | td->elements_count = asn_DEF_PER_Visible.elements_count; |
| 2994 | td->specifics = asn_DEF_PER_Visible.specifics; |
| 2995 | } |
| 2996 | |
| 2997 | void |
| 2998 | SIZE_and_FROM_free(asn_TYPE_descriptor_t *td, |
| 2999 | void *struct_ptr, int contents_only) { |
| 3000 | SIZE_and_FROM_1_inherit_TYPE_descriptor(td); |
| 3001 | td->free_struct(td, struct_ptr, contents_only); |
| 3002 | } |
| 3003 | |
| 3004 | int |
| 3005 | SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 3006 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 3007 | SIZE_and_FROM_1_inherit_TYPE_descriptor(td); |
| 3008 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 3009 | } |
| 3010 | |
| 3011 | asn_dec_rval_t |
| 3012 | SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3013 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 3014 | SIZE_and_FROM_1_inherit_TYPE_descriptor(td); |
| 3015 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 3016 | } |
| 3017 | |
| 3018 | asn_enc_rval_t |
| 3019 | SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td, |
| 3020 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 3021 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3022 | SIZE_and_FROM_1_inherit_TYPE_descriptor(td); |
| 3023 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 3024 | } |
| 3025 | |
| 3026 | asn_dec_rval_t |
| 3027 | SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3028 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 3029 | SIZE_and_FROM_1_inherit_TYPE_descriptor(td); |
| 3030 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 3031 | } |
| 3032 | |
| 3033 | asn_enc_rval_t |
| 3034 | SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 3035 | int ilevel, enum xer_encoder_flags_e flags, |
| 3036 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3037 | SIZE_and_FROM_1_inherit_TYPE_descriptor(td); |
| 3038 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 3039 | } |
| 3040 | |
| 3041 | asn_dec_rval_t |
| 3042 | SIZE_and_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3043 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 3044 | SIZE_and_FROM_1_inherit_TYPE_descriptor(td); |
| 3045 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 3046 | } |
| 3047 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3048 | asn_enc_rval_t |
| 3049 | SIZE_and_FROM_encode_uper(asn_TYPE_descriptor_t *td, |
| 3050 | asn_per_constraints_t *constraints, |
| 3051 | void *structure, asn_per_outp_t *per_out) { |
| 3052 | SIZE_and_FROM_1_inherit_TYPE_descriptor(td); |
| 3053 | return td->uper_encoder(td, constraints, structure, per_out); |
| 3054 | } |
| 3055 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3056 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3057 | /*** <<< CTDEFS [SIZE-and-FROM] >>> ***/ |
| 3058 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 3059 | static asn_per_constraints_t asn_PER_type_SIZE_and_FROM_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3060 | { APC_CONSTRAINED, 2, 2, 65, 68 } /* (65..68) */, |
| 3061 | { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */, |
| 3062 | 0, 0 /* No PER character map necessary */ |
| 3063 | }; |
| 3064 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3065 | /*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/ |
| 3066 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 3067 | static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3068 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 3069 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3070 | asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = { |
| 3071 | "SIZE-and-FROM", |
| 3072 | "SIZE-and-FROM", |
| 3073 | SIZE_and_FROM_free, |
| 3074 | SIZE_and_FROM_print, |
| 3075 | SIZE_and_FROM_constraint, |
| 3076 | SIZE_and_FROM_decode_ber, |
| 3077 | SIZE_and_FROM_encode_der, |
| 3078 | SIZE_and_FROM_decode_xer, |
| 3079 | SIZE_and_FROM_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3080 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3081 | SIZE_and_FROM_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3082 | SIZE_and_FROM_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3083 | 0, /* Use generic outmost tag fetcher */ |
| 3084 | asn_DEF_SIZE_and_FROM_tags_1, |
| 3085 | sizeof(asn_DEF_SIZE_and_FROM_tags_1) |
| 3086 | /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */ |
| 3087 | asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */ |
| 3088 | sizeof(asn_DEF_SIZE_and_FROM_tags_1) |
| 3089 | /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3090 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 3091 | &asn_PER_type_SIZE_and_FROM_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3092 | 0, 0, /* No members */ |
| 3093 | 0 /* No specifics */ |
| 3094 | }; |
| 3095 | |
| 3096 | |
| 3097 | /*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/ |
| 3098 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 3099 | #include "PER-Visible.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3100 | |
| 3101 | /*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/ |
| 3102 | |
| 3103 | typedef PER_Visible_t Neither_SIZE_nor_FROM_t; |
| 3104 | |
| 3105 | /*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/ |
| 3106 | |
| 3107 | extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM; |
| 3108 | asn_struct_free_f Neither_SIZE_nor_FROM_free; |
| 3109 | asn_struct_print_f Neither_SIZE_nor_FROM_print; |
| 3110 | asn_constr_check_f Neither_SIZE_nor_FROM_constraint; |
| 3111 | ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber; |
| 3112 | der_type_encoder_f Neither_SIZE_nor_FROM_encode_der; |
| 3113 | xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer; |
| 3114 | xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer; |
| 3115 | per_type_decoder_f Neither_SIZE_nor_FROM_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3116 | per_type_encoder_f Neither_SIZE_nor_FROM_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3117 | |
| 3118 | /*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/ |
| 3119 | |
| 3120 | static int check_permitted_alphabet_1(const void *sptr) { |
| 3121 | /* The underlying type is IA5String */ |
| 3122 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 3123 | const uint8_t *ch = st->buf; |
| 3124 | const uint8_t *end = ch + st->size; |
| 3125 | |
| 3126 | for(; ch < end; ch++) { |
| 3127 | uint8_t cv = *ch; |
| 3128 | if(!(cv >= 65 && cv <= 70)) return -1; |
| 3129 | } |
| 3130 | return 0; |
| 3131 | } |
| 3132 | |
| 3133 | |
| 3134 | /*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/ |
| 3135 | |
| 3136 | int |
| 3137 | Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 3138 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3139 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
| 3140 | |
| 3141 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3142 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3143 | "%s: value not given (%s:%d)", |
| 3144 | td->name, __FILE__, __LINE__); |
| 3145 | return -1; |
| 3146 | } |
| 3147 | |
| 3148 | |
| 3149 | if(!check_permitted_alphabet_1(st)) { |
| 3150 | /* Constraint check succeeded */ |
| 3151 | return 0; |
| 3152 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3153 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3154 | "%s: constraint failed (%s:%d)", |
| 3155 | td->name, __FILE__, __LINE__); |
| 3156 | return -1; |
| 3157 | } |
| 3158 | } |
| 3159 | |
| 3160 | /* |
| 3161 | * This type is implemented using PER_Visible, |
| 3162 | * so here we adjust the DEF accordingly. |
| 3163 | */ |
| 3164 | static void |
| 3165 | Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 3166 | td->free_struct = asn_DEF_PER_Visible.free_struct; |
| 3167 | td->print_struct = asn_DEF_PER_Visible.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 3168 | td->check_constraints = asn_DEF_PER_Visible.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3169 | td->ber_decoder = asn_DEF_PER_Visible.ber_decoder; |
| 3170 | td->der_encoder = asn_DEF_PER_Visible.der_encoder; |
| 3171 | td->xer_decoder = asn_DEF_PER_Visible.xer_decoder; |
| 3172 | td->xer_encoder = asn_DEF_PER_Visible.xer_encoder; |
| 3173 | td->uper_decoder = asn_DEF_PER_Visible.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3174 | td->uper_encoder = asn_DEF_PER_Visible.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 3175 | td->oer_decoder = asn_DEF_PER_Visible.oer_decoder; |
| 3176 | td->oer_encoder = asn_DEF_PER_Visible.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3177 | if(!td->oer_constraints) |
| 3178 | td->oer_constraints = asn_DEF_PER_Visible.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3179 | if(!td->per_constraints) |
| 3180 | td->per_constraints = asn_DEF_PER_Visible.per_constraints; |
| 3181 | td->elements = asn_DEF_PER_Visible.elements; |
| 3182 | td->elements_count = asn_DEF_PER_Visible.elements_count; |
| 3183 | td->specifics = asn_DEF_PER_Visible.specifics; |
| 3184 | } |
| 3185 | |
| 3186 | void |
| 3187 | Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td, |
| 3188 | void *struct_ptr, int contents_only) { |
| 3189 | Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); |
| 3190 | td->free_struct(td, struct_ptr, contents_only); |
| 3191 | } |
| 3192 | |
| 3193 | int |
| 3194 | Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 3195 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 3196 | Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); |
| 3197 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 3198 | } |
| 3199 | |
| 3200 | asn_dec_rval_t |
| 3201 | Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3202 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 3203 | Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); |
| 3204 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 3205 | } |
| 3206 | |
| 3207 | asn_enc_rval_t |
| 3208 | Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td, |
| 3209 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 3210 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3211 | Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); |
| 3212 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 3213 | } |
| 3214 | |
| 3215 | asn_dec_rval_t |
| 3216 | Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3217 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 3218 | Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); |
| 3219 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 3220 | } |
| 3221 | |
| 3222 | asn_enc_rval_t |
| 3223 | Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 3224 | int ilevel, enum xer_encoder_flags_e flags, |
| 3225 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3226 | Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); |
| 3227 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 3228 | } |
| 3229 | |
| 3230 | asn_dec_rval_t |
| 3231 | Neither_SIZE_nor_FROM_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3232 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 3233 | Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); |
| 3234 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 3235 | } |
| 3236 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3237 | asn_enc_rval_t |
| 3238 | Neither_SIZE_nor_FROM_encode_uper(asn_TYPE_descriptor_t *td, |
| 3239 | asn_per_constraints_t *constraints, |
| 3240 | void *structure, asn_per_outp_t *per_out) { |
| 3241 | Neither_SIZE_nor_FROM_1_inherit_TYPE_descriptor(td); |
| 3242 | return td->uper_encoder(td, constraints, structure, per_out); |
| 3243 | } |
| 3244 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3245 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3246 | /*** <<< CTDEFS [Neither-SIZE-nor-FROM] >>> ***/ |
| 3247 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 3248 | static asn_per_constraints_t asn_PER_type_Neither_SIZE_nor_FROM_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3249 | { APC_CONSTRAINED, 3, 3, 65, 70 } /* (65..70) */, |
| 3250 | { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 } /* (SIZE(0..MAX)) */, |
| 3251 | 0, 0 /* No PER character map necessary */ |
| 3252 | }; |
| 3253 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3254 | /*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/ |
| 3255 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 3256 | static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3257 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 3258 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3259 | asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = { |
| 3260 | "Neither-SIZE-nor-FROM", |
| 3261 | "Neither-SIZE-nor-FROM", |
| 3262 | Neither_SIZE_nor_FROM_free, |
| 3263 | Neither_SIZE_nor_FROM_print, |
| 3264 | Neither_SIZE_nor_FROM_constraint, |
| 3265 | Neither_SIZE_nor_FROM_decode_ber, |
| 3266 | Neither_SIZE_nor_FROM_encode_der, |
| 3267 | Neither_SIZE_nor_FROM_decode_xer, |
| 3268 | Neither_SIZE_nor_FROM_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3269 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3270 | Neither_SIZE_nor_FROM_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3271 | Neither_SIZE_nor_FROM_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3272 | 0, /* Use generic outmost tag fetcher */ |
| 3273 | asn_DEF_Neither_SIZE_nor_FROM_tags_1, |
| 3274 | sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1) |
| 3275 | /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */ |
| 3276 | asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */ |
| 3277 | sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1) |
| 3278 | /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3279 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 3280 | &asn_PER_type_Neither_SIZE_nor_FROM_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3281 | 0, 0, /* No members */ |
| 3282 | 0 /* No specifics */ |
| 3283 | }; |
| 3284 | |
| 3285 | |
| 3286 | /*** <<< INCLUDES [Utf8-4] >>> ***/ |
| 3287 | |
| 3288 | #include <UTF8String.h> |
| 3289 | |
| 3290 | /*** <<< TYPE-DECLS [Utf8-4] >>> ***/ |
| 3291 | |
| 3292 | typedef UTF8String_t Utf8_4_t; |
| 3293 | |
| 3294 | /*** <<< FUNC-DECLS [Utf8-4] >>> ***/ |
| 3295 | |
| 3296 | extern asn_TYPE_descriptor_t asn_DEF_Utf8_4; |
| 3297 | asn_struct_free_f Utf8_4_free; |
| 3298 | asn_struct_print_f Utf8_4_print; |
| 3299 | asn_constr_check_f Utf8_4_constraint; |
| 3300 | ber_type_decoder_f Utf8_4_decode_ber; |
| 3301 | der_type_encoder_f Utf8_4_encode_der; |
| 3302 | xer_type_decoder_f Utf8_4_decode_xer; |
| 3303 | xer_type_encoder_f Utf8_4_encode_xer; |
| 3304 | per_type_decoder_f Utf8_4_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3305 | per_type_encoder_f Utf8_4_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3306 | |
| 3307 | /*** <<< CTABLES [Utf8-4] >>> ***/ |
| 3308 | |
| 3309 | static int check_permitted_alphabet_1(const void *sptr) { |
| 3310 | if(UTF8String_length((const UTF8String_t *)sptr) < 0) |
| 3311 | return -1; /* Alphabet (sic!) test failed. */ |
| 3312 | |
| 3313 | return 0; |
| 3314 | } |
| 3315 | |
| 3316 | |
| 3317 | /*** <<< CODE [Utf8-4] >>> ***/ |
| 3318 | |
| 3319 | int |
| 3320 | Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 3321 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3322 | const UTF8String_t *st = (const UTF8String_t *)sptr; |
| 3323 | |
| 3324 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3325 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3326 | "%s: value not given (%s:%d)", |
| 3327 | td->name, __FILE__, __LINE__); |
| 3328 | return -1; |
| 3329 | } |
| 3330 | |
| 3331 | |
| 3332 | if(!check_permitted_alphabet_1(st)) { |
| 3333 | /* Constraint check succeeded */ |
| 3334 | return 0; |
| 3335 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3336 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3337 | "%s: constraint failed (%s:%d)", |
| 3338 | td->name, __FILE__, __LINE__); |
| 3339 | return -1; |
| 3340 | } |
| 3341 | } |
| 3342 | |
| 3343 | /* |
| 3344 | * This type is implemented using UTF8String, |
| 3345 | * so here we adjust the DEF accordingly. |
| 3346 | */ |
| 3347 | static void |
| 3348 | Utf8_4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 3349 | td->free_struct = asn_DEF_UTF8String.free_struct; |
| 3350 | td->print_struct = asn_DEF_UTF8String.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 3351 | td->check_constraints = asn_DEF_UTF8String.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3352 | td->ber_decoder = asn_DEF_UTF8String.ber_decoder; |
| 3353 | td->der_encoder = asn_DEF_UTF8String.der_encoder; |
| 3354 | td->xer_decoder = asn_DEF_UTF8String.xer_decoder; |
| 3355 | td->xer_encoder = asn_DEF_UTF8String.xer_encoder; |
| 3356 | td->uper_decoder = asn_DEF_UTF8String.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3357 | td->uper_encoder = asn_DEF_UTF8String.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 3358 | td->oer_decoder = asn_DEF_UTF8String.oer_decoder; |
| 3359 | td->oer_encoder = asn_DEF_UTF8String.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3360 | if(!td->oer_constraints) |
| 3361 | td->oer_constraints = asn_DEF_UTF8String.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3362 | if(!td->per_constraints) |
| 3363 | td->per_constraints = asn_DEF_UTF8String.per_constraints; |
| 3364 | td->elements = asn_DEF_UTF8String.elements; |
| 3365 | td->elements_count = asn_DEF_UTF8String.elements_count; |
| 3366 | td->specifics = asn_DEF_UTF8String.specifics; |
| 3367 | } |
| 3368 | |
| 3369 | void |
| 3370 | Utf8_4_free(asn_TYPE_descriptor_t *td, |
| 3371 | void *struct_ptr, int contents_only) { |
| 3372 | Utf8_4_1_inherit_TYPE_descriptor(td); |
| 3373 | td->free_struct(td, struct_ptr, contents_only); |
| 3374 | } |
| 3375 | |
| 3376 | int |
| 3377 | Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 3378 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 3379 | Utf8_4_1_inherit_TYPE_descriptor(td); |
| 3380 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 3381 | } |
| 3382 | |
| 3383 | asn_dec_rval_t |
| 3384 | Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3385 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 3386 | Utf8_4_1_inherit_TYPE_descriptor(td); |
| 3387 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 3388 | } |
| 3389 | |
| 3390 | asn_enc_rval_t |
| 3391 | Utf8_4_encode_der(asn_TYPE_descriptor_t *td, |
| 3392 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 3393 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3394 | Utf8_4_1_inherit_TYPE_descriptor(td); |
| 3395 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 3396 | } |
| 3397 | |
| 3398 | asn_dec_rval_t |
| 3399 | Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3400 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 3401 | Utf8_4_1_inherit_TYPE_descriptor(td); |
| 3402 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 3403 | } |
| 3404 | |
| 3405 | asn_enc_rval_t |
| 3406 | Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 3407 | int ilevel, enum xer_encoder_flags_e flags, |
| 3408 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3409 | Utf8_4_1_inherit_TYPE_descriptor(td); |
| 3410 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 3411 | } |
| 3412 | |
| 3413 | asn_dec_rval_t |
| 3414 | Utf8_4_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3415 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 3416 | Utf8_4_1_inherit_TYPE_descriptor(td); |
| 3417 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 3418 | } |
| 3419 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3420 | asn_enc_rval_t |
| 3421 | Utf8_4_encode_uper(asn_TYPE_descriptor_t *td, |
| 3422 | asn_per_constraints_t *constraints, |
| 3423 | void *structure, asn_per_outp_t *per_out) { |
| 3424 | Utf8_4_1_inherit_TYPE_descriptor(td); |
| 3425 | return td->uper_encoder(td, constraints, structure, per_out); |
| 3426 | } |
| 3427 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3428 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3429 | /*** <<< CTDEFS [Utf8-4] >>> ***/ |
| 3430 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 3431 | static asn_per_constraints_t asn_PER_type_Utf8_4_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3432 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 3433 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 3434 | 0, 0 /* No PER value map */ |
| 3435 | }; |
| 3436 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3437 | /*** <<< STAT-DEFS [Utf8-4] >>> ***/ |
| 3438 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 3439 | static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3440 | (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) |
| 3441 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3442 | asn_TYPE_descriptor_t asn_DEF_Utf8_4 = { |
| 3443 | "Utf8-4", |
| 3444 | "Utf8-4", |
| 3445 | Utf8_4_free, |
| 3446 | Utf8_4_print, |
| 3447 | Utf8_4_constraint, |
| 3448 | Utf8_4_decode_ber, |
| 3449 | Utf8_4_encode_der, |
| 3450 | Utf8_4_decode_xer, |
| 3451 | Utf8_4_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3452 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3453 | Utf8_4_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3454 | Utf8_4_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3455 | 0, /* Use generic outmost tag fetcher */ |
| 3456 | asn_DEF_Utf8_4_tags_1, |
| 3457 | sizeof(asn_DEF_Utf8_4_tags_1) |
| 3458 | /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */ |
| 3459 | asn_DEF_Utf8_4_tags_1, /* Same as above */ |
| 3460 | sizeof(asn_DEF_Utf8_4_tags_1) |
| 3461 | /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3462 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 3463 | &asn_PER_type_Utf8_4_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3464 | 0, 0, /* No members */ |
| 3465 | 0 /* No specifics */ |
| 3466 | }; |
| 3467 | |
| 3468 | |
| 3469 | /*** <<< INCLUDES [Utf8-3] >>> ***/ |
| 3470 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 3471 | #include "Utf8-2.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3472 | |
| 3473 | /*** <<< TYPE-DECLS [Utf8-3] >>> ***/ |
| 3474 | |
| 3475 | typedef Utf8_2_t Utf8_3_t; |
| 3476 | |
| 3477 | /*** <<< FUNC-DECLS [Utf8-3] >>> ***/ |
| 3478 | |
| 3479 | extern asn_TYPE_descriptor_t asn_DEF_Utf8_3; |
| 3480 | asn_struct_free_f Utf8_3_free; |
| 3481 | asn_struct_print_f Utf8_3_print; |
| 3482 | asn_constr_check_f Utf8_3_constraint; |
| 3483 | ber_type_decoder_f Utf8_3_decode_ber; |
| 3484 | der_type_encoder_f Utf8_3_encode_der; |
| 3485 | xer_type_decoder_f Utf8_3_decode_xer; |
| 3486 | xer_type_encoder_f Utf8_3_encode_xer; |
| 3487 | per_type_decoder_f Utf8_3_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3488 | per_type_encoder_f Utf8_3_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3489 | |
| 3490 | /*** <<< CTABLES [Utf8-3] >>> ***/ |
| 3491 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 3492 | static const int permitted_alphabet_table_1[128] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 3493 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 3494 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 3495 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 3496 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 3497 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */ |
| 3498 | 16,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */ |
| 3499 | 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */ |
| 3500 | 42,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3501 | }; |
| 3502 | |
| 3503 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 3504 | const int *table = permitted_alphabet_table_1; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3505 | /* The underlying type is UTF8String */ |
| 3506 | const UTF8String_t *st = (const UTF8String_t *)sptr; |
| 3507 | const uint8_t *ch = st->buf; |
| 3508 | const uint8_t *end = ch + st->size; |
| 3509 | |
| 3510 | for(; ch < end; ch++) { |
| 3511 | uint8_t cv = *ch; |
| 3512 | if(cv >= 0x80) return -1; |
| 3513 | if(!table[cv]) return -1; |
| 3514 | } |
| 3515 | return 0; |
| 3516 | } |
| 3517 | |
| 3518 | |
| 3519 | /*** <<< CODE [Utf8-3] >>> ***/ |
| 3520 | |
| 3521 | int |
| 3522 | Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 3523 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3524 | const Utf8_2_t *st = (const Utf8_2_t *)sptr; |
| 3525 | size_t size; |
| 3526 | |
| 3527 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3528 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3529 | "%s: value not given (%s:%d)", |
| 3530 | td->name, __FILE__, __LINE__); |
| 3531 | return -1; |
| 3532 | } |
| 3533 | |
| 3534 | size = UTF8String_length(st); |
| 3535 | if((ssize_t)size < 0) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3536 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3537 | "%s: UTF-8: broken encoding (%s:%d)", |
| 3538 | td->name, __FILE__, __LINE__); |
| 3539 | return -1; |
| 3540 | } |
| 3541 | |
| 3542 | if((size >= 1 && size <= 2) |
| 3543 | && !check_permitted_alphabet_1(st)) { |
| 3544 | /* Constraint check succeeded */ |
| 3545 | return 0; |
| 3546 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3547 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3548 | "%s: constraint failed (%s:%d)", |
| 3549 | td->name, __FILE__, __LINE__); |
| 3550 | return -1; |
| 3551 | } |
| 3552 | } |
| 3553 | |
| 3554 | /* |
| 3555 | * This type is implemented using Utf8_2, |
| 3556 | * so here we adjust the DEF accordingly. |
| 3557 | */ |
| 3558 | static void |
| 3559 | Utf8_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 3560 | td->free_struct = asn_DEF_Utf8_2.free_struct; |
| 3561 | td->print_struct = asn_DEF_Utf8_2.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 3562 | td->check_constraints = asn_DEF_Utf8_2.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3563 | td->ber_decoder = asn_DEF_Utf8_2.ber_decoder; |
| 3564 | td->der_encoder = asn_DEF_Utf8_2.der_encoder; |
| 3565 | td->xer_decoder = asn_DEF_Utf8_2.xer_decoder; |
| 3566 | td->xer_encoder = asn_DEF_Utf8_2.xer_encoder; |
| 3567 | td->uper_decoder = asn_DEF_Utf8_2.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3568 | td->uper_encoder = asn_DEF_Utf8_2.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 3569 | td->oer_decoder = asn_DEF_Utf8_2.oer_decoder; |
| 3570 | td->oer_encoder = asn_DEF_Utf8_2.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3571 | if(!td->oer_constraints) |
| 3572 | td->oer_constraints = asn_DEF_Utf8_2.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3573 | if(!td->per_constraints) |
| 3574 | td->per_constraints = asn_DEF_Utf8_2.per_constraints; |
| 3575 | td->elements = asn_DEF_Utf8_2.elements; |
| 3576 | td->elements_count = asn_DEF_Utf8_2.elements_count; |
| 3577 | td->specifics = asn_DEF_Utf8_2.specifics; |
| 3578 | } |
| 3579 | |
| 3580 | void |
| 3581 | Utf8_3_free(asn_TYPE_descriptor_t *td, |
| 3582 | void *struct_ptr, int contents_only) { |
| 3583 | Utf8_3_1_inherit_TYPE_descriptor(td); |
| 3584 | td->free_struct(td, struct_ptr, contents_only); |
| 3585 | } |
| 3586 | |
| 3587 | int |
| 3588 | Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 3589 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 3590 | Utf8_3_1_inherit_TYPE_descriptor(td); |
| 3591 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 3592 | } |
| 3593 | |
| 3594 | asn_dec_rval_t |
| 3595 | Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3596 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 3597 | Utf8_3_1_inherit_TYPE_descriptor(td); |
| 3598 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 3599 | } |
| 3600 | |
| 3601 | asn_enc_rval_t |
| 3602 | Utf8_3_encode_der(asn_TYPE_descriptor_t *td, |
| 3603 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 3604 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3605 | Utf8_3_1_inherit_TYPE_descriptor(td); |
| 3606 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 3607 | } |
| 3608 | |
| 3609 | asn_dec_rval_t |
| 3610 | Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3611 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 3612 | Utf8_3_1_inherit_TYPE_descriptor(td); |
| 3613 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 3614 | } |
| 3615 | |
| 3616 | asn_enc_rval_t |
| 3617 | Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 3618 | int ilevel, enum xer_encoder_flags_e flags, |
| 3619 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3620 | Utf8_3_1_inherit_TYPE_descriptor(td); |
| 3621 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 3622 | } |
| 3623 | |
| 3624 | asn_dec_rval_t |
| 3625 | Utf8_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3626 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 3627 | Utf8_3_1_inherit_TYPE_descriptor(td); |
| 3628 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 3629 | } |
| 3630 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3631 | asn_enc_rval_t |
| 3632 | Utf8_3_encode_uper(asn_TYPE_descriptor_t *td, |
| 3633 | asn_per_constraints_t *constraints, |
| 3634 | void *structure, asn_per_outp_t *per_out) { |
| 3635 | Utf8_3_1_inherit_TYPE_descriptor(td); |
| 3636 | return td->uper_encoder(td, constraints, structure, per_out); |
| 3637 | } |
| 3638 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3639 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3640 | /*** <<< CTDEFS [Utf8-3] >>> ***/ |
| 3641 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 3642 | static asn_per_constraints_t asn_PER_type_Utf8_3_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3643 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 3644 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 3645 | 0, 0 /* No PER value map */ |
| 3646 | }; |
| 3647 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3648 | /*** <<< STAT-DEFS [Utf8-3] >>> ***/ |
| 3649 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 3650 | static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3651 | (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) |
| 3652 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3653 | asn_TYPE_descriptor_t asn_DEF_Utf8_3 = { |
| 3654 | "Utf8-3", |
| 3655 | "Utf8-3", |
| 3656 | Utf8_3_free, |
| 3657 | Utf8_3_print, |
| 3658 | Utf8_3_constraint, |
| 3659 | Utf8_3_decode_ber, |
| 3660 | Utf8_3_encode_der, |
| 3661 | Utf8_3_decode_xer, |
| 3662 | Utf8_3_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3663 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3664 | Utf8_3_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3665 | Utf8_3_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3666 | 0, /* Use generic outmost tag fetcher */ |
| 3667 | asn_DEF_Utf8_3_tags_1, |
| 3668 | sizeof(asn_DEF_Utf8_3_tags_1) |
| 3669 | /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */ |
| 3670 | asn_DEF_Utf8_3_tags_1, /* Same as above */ |
| 3671 | sizeof(asn_DEF_Utf8_3_tags_1) |
| 3672 | /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3673 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 3674 | &asn_PER_type_Utf8_3_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3675 | 0, 0, /* No members */ |
| 3676 | 0 /* No specifics */ |
| 3677 | }; |
| 3678 | |
| 3679 | |
| 3680 | /*** <<< INCLUDES [Utf8-2] >>> ***/ |
| 3681 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 3682 | #include "Utf8-1.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3683 | |
| 3684 | /*** <<< TYPE-DECLS [Utf8-2] >>> ***/ |
| 3685 | |
| 3686 | typedef Utf8_1_t Utf8_2_t; |
| 3687 | |
| 3688 | /*** <<< FUNC-DECLS [Utf8-2] >>> ***/ |
| 3689 | |
| 3690 | extern asn_TYPE_descriptor_t asn_DEF_Utf8_2; |
| 3691 | asn_struct_free_f Utf8_2_free; |
| 3692 | asn_struct_print_f Utf8_2_print; |
| 3693 | asn_constr_check_f Utf8_2_constraint; |
| 3694 | ber_type_decoder_f Utf8_2_decode_ber; |
| 3695 | der_type_encoder_f Utf8_2_encode_der; |
| 3696 | xer_type_decoder_f Utf8_2_decode_xer; |
| 3697 | xer_type_encoder_f Utf8_2_encode_xer; |
| 3698 | per_type_decoder_f Utf8_2_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3699 | per_type_encoder_f Utf8_2_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3700 | |
| 3701 | /*** <<< CODE [Utf8-2] >>> ***/ |
| 3702 | |
| 3703 | int |
| 3704 | Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 3705 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3706 | const Utf8_1_t *st = (const Utf8_1_t *)sptr; |
| 3707 | size_t size; |
| 3708 | |
| 3709 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3710 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3711 | "%s: value not given (%s:%d)", |
| 3712 | td->name, __FILE__, __LINE__); |
| 3713 | return -1; |
| 3714 | } |
| 3715 | |
| 3716 | size = UTF8String_length(st); |
| 3717 | if((ssize_t)size < 0) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3718 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3719 | "%s: UTF-8: broken encoding (%s:%d)", |
| 3720 | td->name, __FILE__, __LINE__); |
| 3721 | return -1; |
| 3722 | } |
| 3723 | |
| 3724 | if((size >= 1 && size <= 2)) { |
| 3725 | /* Constraint check succeeded */ |
| 3726 | return 0; |
| 3727 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 3728 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3729 | "%s: constraint failed (%s:%d)", |
| 3730 | td->name, __FILE__, __LINE__); |
| 3731 | return -1; |
| 3732 | } |
| 3733 | } |
| 3734 | |
| 3735 | /* |
| 3736 | * This type is implemented using Utf8_1, |
| 3737 | * so here we adjust the DEF accordingly. |
| 3738 | */ |
| 3739 | static void |
| 3740 | Utf8_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 3741 | td->free_struct = asn_DEF_Utf8_1.free_struct; |
| 3742 | td->print_struct = asn_DEF_Utf8_1.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 3743 | td->check_constraints = asn_DEF_Utf8_1.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3744 | td->ber_decoder = asn_DEF_Utf8_1.ber_decoder; |
| 3745 | td->der_encoder = asn_DEF_Utf8_1.der_encoder; |
| 3746 | td->xer_decoder = asn_DEF_Utf8_1.xer_decoder; |
| 3747 | td->xer_encoder = asn_DEF_Utf8_1.xer_encoder; |
| 3748 | td->uper_decoder = asn_DEF_Utf8_1.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3749 | td->uper_encoder = asn_DEF_Utf8_1.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 3750 | td->oer_decoder = asn_DEF_Utf8_1.oer_decoder; |
| 3751 | td->oer_encoder = asn_DEF_Utf8_1.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3752 | if(!td->oer_constraints) |
| 3753 | td->oer_constraints = asn_DEF_Utf8_1.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3754 | if(!td->per_constraints) |
| 3755 | td->per_constraints = asn_DEF_Utf8_1.per_constraints; |
| 3756 | td->elements = asn_DEF_Utf8_1.elements; |
| 3757 | td->elements_count = asn_DEF_Utf8_1.elements_count; |
| 3758 | td->specifics = asn_DEF_Utf8_1.specifics; |
| 3759 | } |
| 3760 | |
| 3761 | void |
| 3762 | Utf8_2_free(asn_TYPE_descriptor_t *td, |
| 3763 | void *struct_ptr, int contents_only) { |
| 3764 | Utf8_2_1_inherit_TYPE_descriptor(td); |
| 3765 | td->free_struct(td, struct_ptr, contents_only); |
| 3766 | } |
| 3767 | |
| 3768 | int |
| 3769 | Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 3770 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 3771 | Utf8_2_1_inherit_TYPE_descriptor(td); |
| 3772 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 3773 | } |
| 3774 | |
| 3775 | asn_dec_rval_t |
| 3776 | Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3777 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 3778 | Utf8_2_1_inherit_TYPE_descriptor(td); |
| 3779 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 3780 | } |
| 3781 | |
| 3782 | asn_enc_rval_t |
| 3783 | Utf8_2_encode_der(asn_TYPE_descriptor_t *td, |
| 3784 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 3785 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3786 | Utf8_2_1_inherit_TYPE_descriptor(td); |
| 3787 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 3788 | } |
| 3789 | |
| 3790 | asn_dec_rval_t |
| 3791 | Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3792 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 3793 | Utf8_2_1_inherit_TYPE_descriptor(td); |
| 3794 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 3795 | } |
| 3796 | |
| 3797 | asn_enc_rval_t |
| 3798 | Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 3799 | int ilevel, enum xer_encoder_flags_e flags, |
| 3800 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3801 | Utf8_2_1_inherit_TYPE_descriptor(td); |
| 3802 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 3803 | } |
| 3804 | |
| 3805 | asn_dec_rval_t |
| 3806 | Utf8_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3807 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 3808 | Utf8_2_1_inherit_TYPE_descriptor(td); |
| 3809 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 3810 | } |
| 3811 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3812 | asn_enc_rval_t |
| 3813 | Utf8_2_encode_uper(asn_TYPE_descriptor_t *td, |
| 3814 | asn_per_constraints_t *constraints, |
| 3815 | void *structure, asn_per_outp_t *per_out) { |
| 3816 | Utf8_2_1_inherit_TYPE_descriptor(td); |
| 3817 | return td->uper_encoder(td, constraints, structure, per_out); |
| 3818 | } |
| 3819 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3820 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3821 | /*** <<< CTDEFS [Utf8-2] >>> ***/ |
| 3822 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 3823 | static asn_per_constraints_t asn_PER_type_Utf8_2_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 3824 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 3825 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 3826 | 0, 0 /* No PER value map */ |
| 3827 | }; |
| 3828 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3829 | /*** <<< STAT-DEFS [Utf8-2] >>> ***/ |
| 3830 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 3831 | static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3832 | (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) |
| 3833 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3834 | asn_TYPE_descriptor_t asn_DEF_Utf8_2 = { |
| 3835 | "Utf8-2", |
| 3836 | "Utf8-2", |
| 3837 | Utf8_2_free, |
| 3838 | Utf8_2_print, |
| 3839 | Utf8_2_constraint, |
| 3840 | Utf8_2_decode_ber, |
| 3841 | Utf8_2_encode_der, |
| 3842 | Utf8_2_decode_xer, |
| 3843 | Utf8_2_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3844 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3845 | Utf8_2_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3846 | Utf8_2_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3847 | 0, /* Use generic outmost tag fetcher */ |
| 3848 | asn_DEF_Utf8_2_tags_1, |
| 3849 | sizeof(asn_DEF_Utf8_2_tags_1) |
| 3850 | /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */ |
| 3851 | asn_DEF_Utf8_2_tags_1, /* Same as above */ |
| 3852 | sizeof(asn_DEF_Utf8_2_tags_1) |
| 3853 | /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3854 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 3855 | &asn_PER_type_Utf8_2_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3856 | 0, 0, /* No members */ |
| 3857 | 0 /* No specifics */ |
| 3858 | }; |
| 3859 | |
| 3860 | |
| 3861 | /*** <<< INCLUDES [Utf8-1] >>> ***/ |
| 3862 | |
| 3863 | #include <UTF8String.h> |
| 3864 | |
| 3865 | /*** <<< TYPE-DECLS [Utf8-1] >>> ***/ |
| 3866 | |
| 3867 | typedef UTF8String_t Utf8_1_t; |
| 3868 | |
| 3869 | /*** <<< FUNC-DECLS [Utf8-1] >>> ***/ |
| 3870 | |
| 3871 | extern asn_TYPE_descriptor_t asn_DEF_Utf8_1; |
| 3872 | asn_struct_free_f Utf8_1_free; |
| 3873 | asn_struct_print_f Utf8_1_print; |
| 3874 | asn_constr_check_f Utf8_1_constraint; |
| 3875 | ber_type_decoder_f Utf8_1_decode_ber; |
| 3876 | der_type_encoder_f Utf8_1_encode_der; |
| 3877 | xer_type_decoder_f Utf8_1_decode_xer; |
| 3878 | xer_type_encoder_f Utf8_1_encode_xer; |
| 3879 | per_type_decoder_f Utf8_1_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3880 | per_type_encoder_f Utf8_1_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3881 | |
| 3882 | /*** <<< CODE [Utf8-1] >>> ***/ |
| 3883 | |
| 3884 | int |
| 3885 | Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 3886 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3887 | /* Replace with underlying type checker */ |
| 3888 | td->check_constraints = asn_DEF_UTF8String.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 3889 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3890 | } |
| 3891 | |
| 3892 | /* |
| 3893 | * This type is implemented using UTF8String, |
| 3894 | * so here we adjust the DEF accordingly. |
| 3895 | */ |
| 3896 | static void |
| 3897 | Utf8_1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 3898 | td->free_struct = asn_DEF_UTF8String.free_struct; |
| 3899 | td->print_struct = asn_DEF_UTF8String.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 3900 | td->check_constraints = asn_DEF_UTF8String.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3901 | td->ber_decoder = asn_DEF_UTF8String.ber_decoder; |
| 3902 | td->der_encoder = asn_DEF_UTF8String.der_encoder; |
| 3903 | td->xer_decoder = asn_DEF_UTF8String.xer_decoder; |
| 3904 | td->xer_encoder = asn_DEF_UTF8String.xer_encoder; |
| 3905 | td->uper_decoder = asn_DEF_UTF8String.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3906 | td->uper_encoder = asn_DEF_UTF8String.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 3907 | td->oer_decoder = asn_DEF_UTF8String.oer_decoder; |
| 3908 | td->oer_encoder = asn_DEF_UTF8String.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3909 | if(!td->oer_constraints) |
| 3910 | td->oer_constraints = asn_DEF_UTF8String.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3911 | if(!td->per_constraints) |
| 3912 | td->per_constraints = asn_DEF_UTF8String.per_constraints; |
| 3913 | td->elements = asn_DEF_UTF8String.elements; |
| 3914 | td->elements_count = asn_DEF_UTF8String.elements_count; |
| 3915 | td->specifics = asn_DEF_UTF8String.specifics; |
| 3916 | } |
| 3917 | |
| 3918 | void |
| 3919 | Utf8_1_free(asn_TYPE_descriptor_t *td, |
| 3920 | void *struct_ptr, int contents_only) { |
| 3921 | Utf8_1_1_inherit_TYPE_descriptor(td); |
| 3922 | td->free_struct(td, struct_ptr, contents_only); |
| 3923 | } |
| 3924 | |
| 3925 | int |
| 3926 | Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 3927 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 3928 | Utf8_1_1_inherit_TYPE_descriptor(td); |
| 3929 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 3930 | } |
| 3931 | |
| 3932 | asn_dec_rval_t |
| 3933 | Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3934 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 3935 | Utf8_1_1_inherit_TYPE_descriptor(td); |
| 3936 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 3937 | } |
| 3938 | |
| 3939 | asn_enc_rval_t |
| 3940 | Utf8_1_encode_der(asn_TYPE_descriptor_t *td, |
| 3941 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 3942 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3943 | Utf8_1_1_inherit_TYPE_descriptor(td); |
| 3944 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 3945 | } |
| 3946 | |
| 3947 | asn_dec_rval_t |
| 3948 | Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3949 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 3950 | Utf8_1_1_inherit_TYPE_descriptor(td); |
| 3951 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 3952 | } |
| 3953 | |
| 3954 | asn_enc_rval_t |
| 3955 | Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 3956 | int ilevel, enum xer_encoder_flags_e flags, |
| 3957 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 3958 | Utf8_1_1_inherit_TYPE_descriptor(td); |
| 3959 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 3960 | } |
| 3961 | |
| 3962 | asn_dec_rval_t |
| 3963 | Utf8_1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 3964 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 3965 | Utf8_1_1_inherit_TYPE_descriptor(td); |
| 3966 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 3967 | } |
| 3968 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3969 | asn_enc_rval_t |
| 3970 | Utf8_1_encode_uper(asn_TYPE_descriptor_t *td, |
| 3971 | asn_per_constraints_t *constraints, |
| 3972 | void *structure, asn_per_outp_t *per_out) { |
| 3973 | Utf8_1_1_inherit_TYPE_descriptor(td); |
| 3974 | return td->uper_encoder(td, constraints, structure, per_out); |
| 3975 | } |
| 3976 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3977 | |
| 3978 | /*** <<< STAT-DEFS [Utf8-1] >>> ***/ |
| 3979 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 3980 | static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3981 | (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) |
| 3982 | }; |
| 3983 | asn_TYPE_descriptor_t asn_DEF_Utf8_1 = { |
| 3984 | "Utf8-1", |
| 3985 | "Utf8-1", |
| 3986 | Utf8_1_free, |
| 3987 | Utf8_1_print, |
| 3988 | Utf8_1_constraint, |
| 3989 | Utf8_1_decode_ber, |
| 3990 | Utf8_1_encode_der, |
| 3991 | Utf8_1_decode_xer, |
| 3992 | Utf8_1_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 3993 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3994 | Utf8_1_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 3995 | Utf8_1_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 3996 | 0, /* Use generic outmost tag fetcher */ |
| 3997 | asn_DEF_Utf8_1_tags_1, |
| 3998 | sizeof(asn_DEF_Utf8_1_tags_1) |
| 3999 | /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */ |
| 4000 | asn_DEF_Utf8_1_tags_1, /* Same as above */ |
| 4001 | sizeof(asn_DEF_Utf8_1_tags_1) |
| 4002 | /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4003 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4004 | 0, /* No PER visible constraints */ |
| 4005 | 0, 0, /* No members */ |
| 4006 | 0 /* No specifics */ |
| 4007 | }; |
| 4008 | |
| 4009 | |
| 4010 | /*** <<< INCLUDES [VisibleIdentifier] >>> ***/ |
| 4011 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 4012 | #include "Identifier.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4013 | |
| 4014 | /*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/ |
| 4015 | |
| 4016 | typedef Identifier_t VisibleIdentifier_t; |
| 4017 | |
| 4018 | /*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/ |
| 4019 | |
| 4020 | extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier; |
| 4021 | asn_struct_free_f VisibleIdentifier_free; |
| 4022 | asn_struct_print_f VisibleIdentifier_print; |
| 4023 | asn_constr_check_f VisibleIdentifier_constraint; |
| 4024 | ber_type_decoder_f VisibleIdentifier_decode_ber; |
| 4025 | der_type_encoder_f VisibleIdentifier_encode_der; |
| 4026 | xer_type_decoder_f VisibleIdentifier_decode_xer; |
| 4027 | xer_type_encoder_f VisibleIdentifier_encode_xer; |
| 4028 | per_type_decoder_f VisibleIdentifier_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4029 | per_type_encoder_f VisibleIdentifier_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4030 | |
| 4031 | /*** <<< CTABLES [VisibleIdentifier] >>> ***/ |
| 4032 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4033 | static const int permitted_alphabet_table_1[256] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 4034 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 4035 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 4036 | 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */ |
| 4037 | 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */ |
| 4038 | 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */ |
| 4039 | 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */ |
| 4040 | 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */ |
| 4041 | 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4042 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4043 | static const int permitted_alphabet_code2value_1[64] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 4044 | 36,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69, |
| 4045 | 70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85, |
| 4046 | 86,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106, |
| 4047 | 107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122, |
| 4048 | }; |
| 4049 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4050 | |
| 4051 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4052 | const int *table = permitted_alphabet_table_1; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4053 | /* The underlying type is VisibleString */ |
| 4054 | const VisibleString_t *st = (const VisibleString_t *)sptr; |
| 4055 | const uint8_t *ch = st->buf; |
| 4056 | const uint8_t *end = ch + st->size; |
| 4057 | |
| 4058 | for(; ch < end; ch++) { |
| 4059 | uint8_t cv = *ch; |
| 4060 | if(!table[cv]) return -1; |
| 4061 | } |
| 4062 | return 0; |
| 4063 | } |
| 4064 | |
| 4065 | |
| 4066 | /*** <<< CODE [VisibleIdentifier] >>> ***/ |
| 4067 | |
| 4068 | int |
| 4069 | VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 4070 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4071 | const Identifier_t *st = (const Identifier_t *)sptr; |
| 4072 | size_t size; |
| 4073 | |
| 4074 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4075 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4076 | "%s: value not given (%s:%d)", |
| 4077 | td->name, __FILE__, __LINE__); |
| 4078 | return -1; |
| 4079 | } |
| 4080 | |
| 4081 | size = st->size; |
| 4082 | |
| 4083 | if((size >= 1 && size <= 32) |
| 4084 | && !check_permitted_alphabet_1(st)) { |
| 4085 | /* Constraint check succeeded */ |
| 4086 | return 0; |
| 4087 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4088 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4089 | "%s: constraint failed (%s:%d)", |
| 4090 | td->name, __FILE__, __LINE__); |
| 4091 | return -1; |
| 4092 | } |
| 4093 | } |
| 4094 | |
| 4095 | /* |
| 4096 | * This type is implemented using Identifier, |
| 4097 | * so here we adjust the DEF accordingly. |
| 4098 | */ |
| 4099 | static void |
| 4100 | VisibleIdentifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 4101 | td->free_struct = asn_DEF_Identifier.free_struct; |
| 4102 | td->print_struct = asn_DEF_Identifier.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 4103 | td->check_constraints = asn_DEF_Identifier.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4104 | td->ber_decoder = asn_DEF_Identifier.ber_decoder; |
| 4105 | td->der_encoder = asn_DEF_Identifier.der_encoder; |
| 4106 | td->xer_decoder = asn_DEF_Identifier.xer_decoder; |
| 4107 | td->xer_encoder = asn_DEF_Identifier.xer_encoder; |
| 4108 | td->uper_decoder = asn_DEF_Identifier.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4109 | td->uper_encoder = asn_DEF_Identifier.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 4110 | td->oer_decoder = asn_DEF_Identifier.oer_decoder; |
| 4111 | td->oer_encoder = asn_DEF_Identifier.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4112 | if(!td->oer_constraints) |
| 4113 | td->oer_constraints = asn_DEF_Identifier.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4114 | if(!td->per_constraints) |
| 4115 | td->per_constraints = asn_DEF_Identifier.per_constraints; |
| 4116 | td->elements = asn_DEF_Identifier.elements; |
| 4117 | td->elements_count = asn_DEF_Identifier.elements_count; |
| 4118 | td->specifics = asn_DEF_Identifier.specifics; |
| 4119 | } |
| 4120 | |
| 4121 | void |
| 4122 | VisibleIdentifier_free(asn_TYPE_descriptor_t *td, |
| 4123 | void *struct_ptr, int contents_only) { |
| 4124 | VisibleIdentifier_1_inherit_TYPE_descriptor(td); |
| 4125 | td->free_struct(td, struct_ptr, contents_only); |
| 4126 | } |
| 4127 | |
| 4128 | int |
| 4129 | VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 4130 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 4131 | VisibleIdentifier_1_inherit_TYPE_descriptor(td); |
| 4132 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 4133 | } |
| 4134 | |
| 4135 | asn_dec_rval_t |
| 4136 | VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 4137 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 4138 | VisibleIdentifier_1_inherit_TYPE_descriptor(td); |
| 4139 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 4140 | } |
| 4141 | |
| 4142 | asn_enc_rval_t |
| 4143 | VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td, |
| 4144 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 4145 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 4146 | VisibleIdentifier_1_inherit_TYPE_descriptor(td); |
| 4147 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 4148 | } |
| 4149 | |
| 4150 | asn_dec_rval_t |
| 4151 | VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 4152 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 4153 | VisibleIdentifier_1_inherit_TYPE_descriptor(td); |
| 4154 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 4155 | } |
| 4156 | |
| 4157 | asn_enc_rval_t |
| 4158 | VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 4159 | int ilevel, enum xer_encoder_flags_e flags, |
| 4160 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 4161 | VisibleIdentifier_1_inherit_TYPE_descriptor(td); |
| 4162 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 4163 | } |
| 4164 | |
| 4165 | asn_dec_rval_t |
| 4166 | VisibleIdentifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 4167 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 4168 | VisibleIdentifier_1_inherit_TYPE_descriptor(td); |
| 4169 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 4170 | } |
| 4171 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4172 | asn_enc_rval_t |
| 4173 | VisibleIdentifier_encode_uper(asn_TYPE_descriptor_t *td, |
| 4174 | asn_per_constraints_t *constraints, |
| 4175 | void *structure, asn_per_outp_t *per_out) { |
| 4176 | VisibleIdentifier_1_inherit_TYPE_descriptor(td); |
| 4177 | return td->uper_encoder(td, constraints, structure, per_out); |
| 4178 | } |
| 4179 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4180 | |
| 4181 | /*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/ |
| 4182 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4183 | static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4184 | (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)) |
| 4185 | }; |
| 4186 | asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = { |
| 4187 | "VisibleIdentifier", |
| 4188 | "VisibleIdentifier", |
| 4189 | VisibleIdentifier_free, |
| 4190 | VisibleIdentifier_print, |
| 4191 | VisibleIdentifier_constraint, |
| 4192 | VisibleIdentifier_decode_ber, |
| 4193 | VisibleIdentifier_encode_der, |
| 4194 | VisibleIdentifier_decode_xer, |
| 4195 | VisibleIdentifier_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4196 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4197 | VisibleIdentifier_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4198 | VisibleIdentifier_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4199 | 0, /* Use generic outmost tag fetcher */ |
| 4200 | asn_DEF_VisibleIdentifier_tags_1, |
| 4201 | sizeof(asn_DEF_VisibleIdentifier_tags_1) |
| 4202 | /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */ |
| 4203 | asn_DEF_VisibleIdentifier_tags_1, /* Same as above */ |
| 4204 | sizeof(asn_DEF_VisibleIdentifier_tags_1) |
| 4205 | /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4206 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4207 | 0, /* No PER visible constraints */ |
| 4208 | 0, 0, /* No members */ |
| 4209 | 0 /* No specifics */ |
| 4210 | }; |
| 4211 | |
| 4212 | |
| 4213 | /*** <<< INCLUDES [Sequence] >>> ***/ |
| 4214 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 4215 | #include "Int1.h" |
| 4216 | #include "Int4.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4217 | #include <BOOLEAN.h> |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4218 | #include <NativeEnumerated.h> |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4219 | #include <NULL.h> |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 4220 | #include "Int5.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4221 | #include <constr_SEQUENCE.h> |
| 4222 | |
| 4223 | /*** <<< DEPS [Sequence] >>> ***/ |
| 4224 | |
| 4225 | typedef enum enum_c { |
| 4226 | enum_c_one = 1, |
| 4227 | enum_c_two = 2, |
| 4228 | /* |
| 4229 | * Enumeration is extensible |
| 4230 | */ |
| 4231 | enum_c_three = 3 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 4232 | } e_enum_c; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4233 | |
| 4234 | /*** <<< TYPE-DECLS [Sequence] >>> ***/ |
| 4235 | |
| 4236 | typedef struct Sequence { |
| 4237 | Int1_t *int1_c /* DEFAULT 3 */; |
| 4238 | Int4_t int4; |
| 4239 | Int4_t int4_c; |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4240 | BOOLEAN_t *Bool /* DEFAULT 1 */; |
| 4241 | long enum_c; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4242 | NULL_t *null /* OPTIONAL */; |
| 4243 | /* |
| 4244 | * This type is extensible, |
| 4245 | * possible extensions are below. |
| 4246 | */ |
| 4247 | Int5_t *int5_c /* OPTIONAL */; |
| 4248 | |
| 4249 | /* Context for parsing across buffer boundaries */ |
| 4250 | asn_struct_ctx_t _asn_ctx; |
| 4251 | } Sequence_t; |
| 4252 | |
| 4253 | /*** <<< FUNC-DECLS [Sequence] >>> ***/ |
| 4254 | |
| 4255 | /* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */ |
| 4256 | extern asn_TYPE_descriptor_t asn_DEF_Sequence; |
| 4257 | |
| 4258 | /*** <<< CODE [Sequence] >>> ***/ |
| 4259 | |
| 4260 | static int |
| 4261 | enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 4262 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4263 | /* Replace with underlying type checker */ |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4264 | td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 4265 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4266 | } |
| 4267 | |
| 4268 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4269 | * This type is implemented using NativeEnumerated, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4270 | * so here we adjust the DEF accordingly. |
| 4271 | */ |
| 4272 | static void |
| 4273 | enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4274 | td->free_struct = asn_DEF_NativeEnumerated.free_struct; |
| 4275 | td->print_struct = asn_DEF_NativeEnumerated.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 4276 | td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4277 | td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; |
| 4278 | td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; |
| 4279 | td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; |
| 4280 | td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; |
| 4281 | td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; |
| 4282 | td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 4283 | td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder; |
| 4284 | td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4285 | if(!td->oer_constraints) |
| 4286 | td->oer_constraints = asn_DEF_NativeEnumerated.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4287 | if(!td->per_constraints) |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4288 | td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; |
| 4289 | td->elements = asn_DEF_NativeEnumerated.elements; |
| 4290 | td->elements_count = asn_DEF_NativeEnumerated.elements_count; |
| 4291 | /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4292 | } |
| 4293 | |
| 4294 | static void |
| 4295 | enum_c_6_free(asn_TYPE_descriptor_t *td, |
| 4296 | void *struct_ptr, int contents_only) { |
| 4297 | enum_c_6_inherit_TYPE_descriptor(td); |
| 4298 | td->free_struct(td, struct_ptr, contents_only); |
| 4299 | } |
| 4300 | |
| 4301 | static int |
| 4302 | enum_c_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 4303 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 4304 | enum_c_6_inherit_TYPE_descriptor(td); |
| 4305 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 4306 | } |
| 4307 | |
| 4308 | static asn_dec_rval_t |
| 4309 | enum_c_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 4310 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 4311 | enum_c_6_inherit_TYPE_descriptor(td); |
| 4312 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 4313 | } |
| 4314 | |
| 4315 | static asn_enc_rval_t |
| 4316 | enum_c_6_encode_der(asn_TYPE_descriptor_t *td, |
| 4317 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 4318 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 4319 | enum_c_6_inherit_TYPE_descriptor(td); |
| 4320 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 4321 | } |
| 4322 | |
| 4323 | static asn_dec_rval_t |
| 4324 | enum_c_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 4325 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 4326 | enum_c_6_inherit_TYPE_descriptor(td); |
| 4327 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 4328 | } |
| 4329 | |
| 4330 | static asn_enc_rval_t |
| 4331 | enum_c_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 4332 | int ilevel, enum xer_encoder_flags_e flags, |
| 4333 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 4334 | enum_c_6_inherit_TYPE_descriptor(td); |
| 4335 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 4336 | } |
| 4337 | |
| 4338 | static asn_dec_rval_t |
| 4339 | enum_c_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 4340 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 4341 | enum_c_6_inherit_TYPE_descriptor(td); |
| 4342 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 4343 | } |
| 4344 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4345 | static asn_enc_rval_t |
| 4346 | enum_c_6_encode_uper(asn_TYPE_descriptor_t *td, |
| 4347 | asn_per_constraints_t *constraints, |
| 4348 | void *structure, asn_per_outp_t *per_out) { |
| 4349 | enum_c_6_inherit_TYPE_descriptor(td); |
| 4350 | return td->uper_encoder(td, constraints, structure, per_out); |
| 4351 | } |
| 4352 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4353 | static int |
| 4354 | memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 4355 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4356 | long value; |
| 4357 | |
| 4358 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4359 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4360 | "%s: value not given (%s:%d)", |
| 4361 | td->name, __FILE__, __LINE__); |
| 4362 | return -1; |
| 4363 | } |
| 4364 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4365 | value = *(const long *)sptr; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4366 | |
| 4367 | if((value >= -2)) { |
| 4368 | /* Constraint check succeeded */ |
| 4369 | return 0; |
| 4370 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4371 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4372 | "%s: constraint failed (%s:%d)", |
| 4373 | td->name, __FILE__, __LINE__); |
| 4374 | return -1; |
| 4375 | } |
| 4376 | } |
| 4377 | |
| 4378 | static int |
| 4379 | memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 4380 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4381 | long value; |
| 4382 | |
| 4383 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4384 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4385 | "%s: value not given (%s:%d)", |
| 4386 | td->name, __FILE__, __LINE__); |
| 4387 | return -1; |
| 4388 | } |
| 4389 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4390 | value = *(const long *)sptr; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4391 | |
| 4392 | if((value >= 5 && value <= 7)) { |
| 4393 | /* Constraint check succeeded */ |
| 4394 | return 0; |
| 4395 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4396 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4397 | "%s: constraint failed (%s:%d)", |
| 4398 | td->name, __FILE__, __LINE__); |
| 4399 | return -1; |
| 4400 | } |
| 4401 | } |
| 4402 | |
| 4403 | static int |
| 4404 | memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 4405 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4406 | long value; |
| 4407 | |
| 4408 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4409 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4410 | "%s: value not given (%s:%d)", |
| 4411 | td->name, __FILE__, __LINE__); |
| 4412 | return -1; |
| 4413 | } |
| 4414 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4415 | value = *(const long *)sptr; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4416 | |
| 4417 | if((value == 5)) { |
| 4418 | /* Constraint check succeeded */ |
| 4419 | return 0; |
| 4420 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4421 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4422 | "%s: constraint failed (%s:%d)", |
| 4423 | td->name, __FILE__, __LINE__); |
| 4424 | return -1; |
| 4425 | } |
| 4426 | } |
| 4427 | |
| 4428 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 4429 | /*** <<< CTDEFS [Sequence] >>> ***/ |
| 4430 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 4431 | static asn_per_constraints_t asn_PER_type_enum_c_constr_6 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 4432 | { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */, |
| 4433 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 4434 | 0, 0 /* No PER value map */ |
| 4435 | }; |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 4436 | static asn_per_constraints_t asn_PER_memb_int1_c_constr_2 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 4437 | { APC_SEMI_CONSTRAINED, -1, -1, -2, 0 } /* (-2..MAX) */, |
| 4438 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 4439 | 0, 0 /* No PER value map */ |
| 4440 | }; |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 4441 | static asn_per_constraints_t asn_PER_memb_int4_c_constr_4 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 4442 | { APC_CONSTRAINED, 2, 2, 5, 7 } /* (5..7) */, |
| 4443 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 4444 | 0, 0 /* No PER value map */ |
| 4445 | }; |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 4446 | static asn_per_constraints_t asn_PER_memb_int5_c_constr_13 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 4447 | { APC_CONSTRAINED, 0, 0, 5, 5 } /* (5..5) */, |
| 4448 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 4449 | 0, 0 /* No PER value map */ |
| 4450 | }; |
| 4451 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4452 | /*** <<< STAT-DEFS [Sequence] >>> ***/ |
| 4453 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4454 | static int asn_DFL_2_set_3(int set_value, void **sptr) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4455 | Int1_t *st = *sptr; |
| 4456 | |
| 4457 | if(!st) { |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4458 | if(!set_value) return -1; /* Not a default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4459 | st = (*sptr = CALLOC(1, sizeof(*st))); |
| 4460 | if(!st) return -1; |
| 4461 | } |
| 4462 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4463 | if(set_value) { |
| 4464 | /* Install default value 3 */ |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4465 | *st = 3; |
| 4466 | return 0; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4467 | } else { |
| 4468 | /* Test default value 3 */ |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4469 | return (*st == 3); |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4470 | } |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4471 | } |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4472 | static int asn_DFL_5_set_1(int set_value, void **sptr) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4473 | BOOLEAN_t *st = *sptr; |
| 4474 | |
| 4475 | if(!st) { |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4476 | if(!set_value) return -1; /* Not a default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4477 | st = (*sptr = CALLOC(1, sizeof(*st))); |
| 4478 | if(!st) return -1; |
| 4479 | } |
| 4480 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4481 | if(set_value) { |
| 4482 | /* Install default value 1 */ |
| 4483 | *st = 1; |
| 4484 | return 0; |
| 4485 | } else { |
| 4486 | /* Test default value 1 */ |
| 4487 | return (*st == 1); |
| 4488 | } |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4489 | } |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4490 | static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4491 | { 1, 3, "one" }, |
| 4492 | { 2, 3, "two" }, |
| 4493 | { 3, 5, "three" } |
| 4494 | /* This list is extensible */ |
| 4495 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4496 | static const unsigned int asn_MAP_enum_c_enum2value_6[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4497 | 0, /* one(1) */ |
| 4498 | 2, /* three(3) */ |
| 4499 | 1 /* two(2) */ |
| 4500 | /* This list is extensible */ |
| 4501 | }; |
johvik | e70c407 | 2017-05-09 11:06:12 +0200 | [diff] [blame] | 4502 | static asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4503 | asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */ |
| 4504 | asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */ |
| 4505 | 3, /* Number of elements in the maps */ |
| 4506 | 3, /* Extensions before this member */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 4507 | 1, /* Strict enumeration */ |
| 4508 | 0, /* Native long size */ |
| 4509 | 0 |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4510 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4511 | static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4512 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 4513 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4514 | static /* Use -fall-defs-global to expose */ |
| 4515 | asn_TYPE_descriptor_t asn_DEF_enum_c_6 = { |
| 4516 | "enum-c", |
| 4517 | "enum-c", |
| 4518 | enum_c_6_free, |
| 4519 | enum_c_6_print, |
| 4520 | enum_c_6_constraint, |
| 4521 | enum_c_6_decode_ber, |
| 4522 | enum_c_6_encode_der, |
| 4523 | enum_c_6_decode_xer, |
| 4524 | enum_c_6_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4525 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4526 | enum_c_6_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4527 | enum_c_6_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4528 | 0, /* Use generic outmost tag fetcher */ |
| 4529 | asn_DEF_enum_c_tags_6, |
| 4530 | sizeof(asn_DEF_enum_c_tags_6) |
| 4531 | /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */ |
| 4532 | asn_DEF_enum_c_tags_6, /* Same as above */ |
| 4533 | sizeof(asn_DEF_enum_c_tags_6) |
| 4534 | /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4535 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 4536 | &asn_PER_type_enum_c_constr_6, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4537 | 0, 0, /* Defined elsewhere */ |
| 4538 | &asn_SPC_enum_c_specs_6 /* Additional specs */ |
| 4539 | }; |
| 4540 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4541 | static asn_TYPE_member_t asn_MBR_Sequence_1[] = { |
| 4542 | { ATF_POINTER, 1, offsetof(struct Sequence, int1_c), |
| 4543 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 4544 | .tag_mode = 0, |
| 4545 | .type = &asn_DEF_Int1, |
| 4546 | .memb_constraints = memb_int1_c_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4547 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 4548 | .per_constraints = &asn_PER_memb_int1_c_constr_2, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4549 | .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */ |
| 4550 | .name = "int1-c" |
| 4551 | }, |
| 4552 | { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4), |
| 4553 | .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 4554 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 4555 | .type = &asn_DEF_Int4, |
| 4556 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4557 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4558 | .per_constraints = 0, /* No PER visible constraints */ |
| 4559 | .default_value = 0, |
| 4560 | .name = "int4" |
| 4561 | }, |
| 4562 | { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c), |
| 4563 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 4564 | .tag_mode = 0, |
| 4565 | .type = &asn_DEF_Int4, |
| 4566 | .memb_constraints = memb_int4_c_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4567 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 4568 | .per_constraints = &asn_PER_memb_int4_c_constr_4, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4569 | .default_value = 0, |
| 4570 | .name = "int4-c" |
| 4571 | }, |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4572 | { ATF_POINTER, 1, offsetof(struct Sequence, Bool), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4573 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 4574 | .tag_mode = 0, |
| 4575 | .type = &asn_DEF_BOOLEAN, |
| 4576 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4577 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4578 | .per_constraints = 0, /* No PER visible constraints */ |
| 4579 | .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */ |
| 4580 | .name = "bool" |
| 4581 | }, |
| 4582 | { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c), |
| 4583 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), |
| 4584 | .tag_mode = 0, |
| 4585 | .type = &asn_DEF_enum_c_6, |
| 4586 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4587 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 07aaa34 | 2006-10-09 12:52:15 +0000 | [diff] [blame] | 4588 | .per_constraints = 0, /* No PER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4589 | .default_value = 0, |
| 4590 | .name = "enum-c" |
| 4591 | }, |
| 4592 | { ATF_POINTER, 2, offsetof(struct Sequence, null), |
| 4593 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), |
| 4594 | .tag_mode = 0, |
| 4595 | .type = &asn_DEF_NULL, |
| 4596 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4597 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4598 | .per_constraints = 0, /* No PER visible constraints */ |
| 4599 | .default_value = 0, |
| 4600 | .name = "null" |
| 4601 | }, |
| 4602 | { ATF_POINTER, 1, offsetof(struct Sequence, int5_c), |
| 4603 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 4604 | .tag_mode = 0, |
| 4605 | .type = &asn_DEF_Int5, |
| 4606 | .memb_constraints = memb_int5_c_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4607 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 4608 | .per_constraints = &asn_PER_memb_int5_c_constr_13, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4609 | .default_value = 0, |
| 4610 | .name = "int5-c" |
| 4611 | }, |
| 4612 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4613 | static const int asn_MAP_Sequence_oms_1[] = { 0, 3, 5, 6 }; |
| 4614 | static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4615 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 4616 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4617 | static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 4618 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */ |
| 4619 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */ |
| 4620 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */ |
| 4621 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */ |
| 4622 | { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */ |
| 4623 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */ |
| 4624 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4625 | }; |
| 4626 | static asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = { |
| 4627 | sizeof(struct Sequence), |
| 4628 | offsetof(struct Sequence, _asn_ctx), |
| 4629 | asn_MAP_Sequence_tag2el_1, |
| 4630 | 7, /* Count of tags in the map */ |
| 4631 | asn_MAP_Sequence_oms_1, /* Optional members */ |
| 4632 | 3, 1, /* Root/Additions */ |
| 4633 | 5, /* Start extensions */ |
| 4634 | 8 /* Stop extensions */ |
| 4635 | }; |
| 4636 | asn_TYPE_descriptor_t asn_DEF_Sequence = { |
| 4637 | "Sequence", |
| 4638 | "Sequence", |
| 4639 | SEQUENCE_free, |
| 4640 | SEQUENCE_print, |
| 4641 | SEQUENCE_constraint, |
| 4642 | SEQUENCE_decode_ber, |
| 4643 | SEQUENCE_encode_der, |
| 4644 | SEQUENCE_decode_xer, |
| 4645 | SEQUENCE_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4646 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4647 | SEQUENCE_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4648 | SEQUENCE_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4649 | 0, /* Use generic outmost tag fetcher */ |
| 4650 | asn_DEF_Sequence_tags_1, |
| 4651 | sizeof(asn_DEF_Sequence_tags_1) |
| 4652 | /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ |
| 4653 | asn_DEF_Sequence_tags_1, /* Same as above */ |
| 4654 | sizeof(asn_DEF_Sequence_tags_1) |
| 4655 | /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4656 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4657 | 0, /* No PER visible constraints */ |
| 4658 | asn_MBR_Sequence_1, |
| 4659 | 7, /* Elements count */ |
| 4660 | &asn_SPC_Sequence_specs_1 /* Additional specs */ |
| 4661 | }; |
| 4662 | |
| 4663 | |
| 4664 | /*** <<< INCLUDES [SequenceOf] >>> ***/ |
| 4665 | |
| 4666 | #include <asn_SEQUENCE_OF.h> |
| 4667 | #include <constr_SEQUENCE_OF.h> |
| 4668 | |
| 4669 | /*** <<< FWD-DECLS [SequenceOf] >>> ***/ |
| 4670 | |
| 4671 | struct Sequence; |
| 4672 | |
| 4673 | /*** <<< TYPE-DECLS [SequenceOf] >>> ***/ |
| 4674 | |
| 4675 | typedef struct SequenceOf { |
| 4676 | A_SEQUENCE_OF(struct Sequence) list; |
| 4677 | |
| 4678 | /* Context for parsing across buffer boundaries */ |
| 4679 | asn_struct_ctx_t _asn_ctx; |
| 4680 | } SequenceOf_t; |
| 4681 | |
| 4682 | /*** <<< FUNC-DECLS [SequenceOf] >>> ***/ |
| 4683 | |
| 4684 | extern asn_TYPE_descriptor_t asn_DEF_SequenceOf; |
| 4685 | |
| 4686 | /*** <<< POST-INCLUDE [SequenceOf] >>> ***/ |
| 4687 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 4688 | #include "Sequence.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4689 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 4690 | /*** <<< CTDEFS [SequenceOf] >>> ***/ |
| 4691 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 4692 | static asn_per_constraints_t asn_PER_type_SequenceOf_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 4693 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 4694 | { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */, |
| 4695 | 0, 0 /* No PER value map */ |
| 4696 | }; |
| 4697 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4698 | /*** <<< STAT-DEFS [SequenceOf] >>> ***/ |
| 4699 | |
| 4700 | static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = { |
| 4701 | { ATF_POINTER, 0, 0, |
| 4702 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 4703 | .tag_mode = 0, |
| 4704 | .type = &asn_DEF_Sequence, |
| 4705 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4706 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4707 | .per_constraints = 0, /* No PER visible constraints */ |
| 4708 | .default_value = 0, |
| 4709 | .name = "" |
| 4710 | }, |
| 4711 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4712 | static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4713 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 4714 | }; |
| 4715 | static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = { |
| 4716 | sizeof(struct SequenceOf), |
| 4717 | offsetof(struct SequenceOf, _asn_ctx), |
| 4718 | 0, /* XER encoding is XMLDelimitedItemList */ |
| 4719 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4720 | asn_TYPE_descriptor_t asn_DEF_SequenceOf = { |
| 4721 | "SequenceOf", |
| 4722 | "SequenceOf", |
| 4723 | SEQUENCE_OF_free, |
| 4724 | SEQUENCE_OF_print, |
| 4725 | SEQUENCE_OF_constraint, |
| 4726 | SEQUENCE_OF_decode_ber, |
| 4727 | SEQUENCE_OF_encode_der, |
| 4728 | SEQUENCE_OF_decode_xer, |
| 4729 | SEQUENCE_OF_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4730 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4731 | SEQUENCE_OF_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4732 | SEQUENCE_OF_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4733 | 0, /* Use generic outmost tag fetcher */ |
| 4734 | asn_DEF_SequenceOf_tags_1, |
| 4735 | sizeof(asn_DEF_SequenceOf_tags_1) |
| 4736 | /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ |
| 4737 | asn_DEF_SequenceOf_tags_1, /* Same as above */ |
| 4738 | sizeof(asn_DEF_SequenceOf_tags_1) |
| 4739 | /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4740 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 4741 | &asn_PER_type_SequenceOf_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4742 | asn_MBR_SequenceOf_1, |
| 4743 | 1, /* Single element */ |
| 4744 | &asn_SPC_SequenceOf_specs_1 /* Additional specs */ |
| 4745 | }; |
| 4746 | |
| 4747 | |
| 4748 | /*** <<< INCLUDES [Enum0] >>> ***/ |
| 4749 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4750 | #include <NativeEnumerated.h> |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4751 | |
| 4752 | /*** <<< DEPS [Enum0] >>> ***/ |
| 4753 | |
| 4754 | typedef enum Enum0 { |
| 4755 | Enum0_one = 0, |
| 4756 | Enum0_two = 1 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 4757 | } e_Enum0; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4758 | |
| 4759 | /*** <<< TYPE-DECLS [Enum0] >>> ***/ |
| 4760 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4761 | typedef long Enum0_t; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4762 | |
| 4763 | /*** <<< FUNC-DECLS [Enum0] >>> ***/ |
| 4764 | |
| 4765 | extern asn_TYPE_descriptor_t asn_DEF_Enum0; |
| 4766 | asn_struct_free_f Enum0_free; |
| 4767 | asn_struct_print_f Enum0_print; |
| 4768 | asn_constr_check_f Enum0_constraint; |
| 4769 | ber_type_decoder_f Enum0_decode_ber; |
| 4770 | der_type_encoder_f Enum0_encode_der; |
| 4771 | xer_type_decoder_f Enum0_decode_xer; |
| 4772 | xer_type_encoder_f Enum0_encode_xer; |
| 4773 | per_type_decoder_f Enum0_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4774 | per_type_encoder_f Enum0_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4775 | |
| 4776 | /*** <<< CODE [Enum0] >>> ***/ |
| 4777 | |
| 4778 | int |
| 4779 | Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 4780 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4781 | /* Replace with underlying type checker */ |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4782 | td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 4783 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4784 | } |
| 4785 | |
| 4786 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4787 | * This type is implemented using NativeEnumerated, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4788 | * so here we adjust the DEF accordingly. |
| 4789 | */ |
| 4790 | static void |
| 4791 | Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4792 | td->free_struct = asn_DEF_NativeEnumerated.free_struct; |
| 4793 | td->print_struct = asn_DEF_NativeEnumerated.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 4794 | td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4795 | td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; |
| 4796 | td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; |
| 4797 | td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; |
| 4798 | td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; |
| 4799 | td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; |
| 4800 | td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 4801 | td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder; |
| 4802 | td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4803 | if(!td->oer_constraints) |
| 4804 | td->oer_constraints = asn_DEF_NativeEnumerated.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4805 | if(!td->per_constraints) |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4806 | td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; |
| 4807 | td->elements = asn_DEF_NativeEnumerated.elements; |
| 4808 | td->elements_count = asn_DEF_NativeEnumerated.elements_count; |
| 4809 | /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4810 | } |
| 4811 | |
| 4812 | void |
| 4813 | Enum0_free(asn_TYPE_descriptor_t *td, |
| 4814 | void *struct_ptr, int contents_only) { |
| 4815 | Enum0_1_inherit_TYPE_descriptor(td); |
| 4816 | td->free_struct(td, struct_ptr, contents_only); |
| 4817 | } |
| 4818 | |
| 4819 | int |
| 4820 | Enum0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 4821 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 4822 | Enum0_1_inherit_TYPE_descriptor(td); |
| 4823 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 4824 | } |
| 4825 | |
| 4826 | asn_dec_rval_t |
| 4827 | Enum0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 4828 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 4829 | Enum0_1_inherit_TYPE_descriptor(td); |
| 4830 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 4831 | } |
| 4832 | |
| 4833 | asn_enc_rval_t |
| 4834 | Enum0_encode_der(asn_TYPE_descriptor_t *td, |
| 4835 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 4836 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 4837 | Enum0_1_inherit_TYPE_descriptor(td); |
| 4838 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 4839 | } |
| 4840 | |
| 4841 | asn_dec_rval_t |
| 4842 | Enum0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 4843 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 4844 | Enum0_1_inherit_TYPE_descriptor(td); |
| 4845 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 4846 | } |
| 4847 | |
| 4848 | asn_enc_rval_t |
| 4849 | Enum0_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 4850 | int ilevel, enum xer_encoder_flags_e flags, |
| 4851 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 4852 | Enum0_1_inherit_TYPE_descriptor(td); |
| 4853 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 4854 | } |
| 4855 | |
| 4856 | asn_dec_rval_t |
| 4857 | Enum0_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 4858 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 4859 | Enum0_1_inherit_TYPE_descriptor(td); |
| 4860 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 4861 | } |
| 4862 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4863 | asn_enc_rval_t |
| 4864 | Enum0_encode_uper(asn_TYPE_descriptor_t *td, |
| 4865 | asn_per_constraints_t *constraints, |
| 4866 | void *structure, asn_per_outp_t *per_out) { |
| 4867 | Enum0_1_inherit_TYPE_descriptor(td); |
| 4868 | return td->uper_encoder(td, constraints, structure, per_out); |
| 4869 | } |
| 4870 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4871 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 4872 | /*** <<< CTDEFS [Enum0] >>> ***/ |
| 4873 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 4874 | static asn_per_constraints_t asn_PER_type_Enum0_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 4875 | { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, |
| 4876 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 4877 | 0, 0 /* No PER value map */ |
| 4878 | }; |
| 4879 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4880 | /*** <<< STAT-DEFS [Enum0] >>> ***/ |
| 4881 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4882 | static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4883 | { 0, 3, "one" }, |
| 4884 | { 1, 3, "two" } |
| 4885 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4886 | static const unsigned int asn_MAP_Enum0_enum2value_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4887 | 0, /* one(0) */ |
| 4888 | 1 /* two(1) */ |
| 4889 | }; |
johvik | e70c407 | 2017-05-09 11:06:12 +0200 | [diff] [blame] | 4890 | static asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4891 | asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */ |
| 4892 | asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */ |
| 4893 | 2, /* Number of elements in the maps */ |
| 4894 | 0, /* Enumeration is not extensible */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 4895 | 1, /* Strict enumeration */ |
| 4896 | 0, /* Native long size */ |
| 4897 | 0 |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4898 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 4899 | static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4900 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 4901 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4902 | asn_TYPE_descriptor_t asn_DEF_Enum0 = { |
| 4903 | "Enum0", |
| 4904 | "Enum0", |
| 4905 | Enum0_free, |
| 4906 | Enum0_print, |
| 4907 | Enum0_constraint, |
| 4908 | Enum0_decode_ber, |
| 4909 | Enum0_encode_der, |
| 4910 | Enum0_decode_xer, |
| 4911 | Enum0_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4912 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4913 | Enum0_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4914 | Enum0_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4915 | 0, /* Use generic outmost tag fetcher */ |
| 4916 | asn_DEF_Enum0_tags_1, |
| 4917 | sizeof(asn_DEF_Enum0_tags_1) |
| 4918 | /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */ |
| 4919 | asn_DEF_Enum0_tags_1, /* Same as above */ |
| 4920 | sizeof(asn_DEF_Enum0_tags_1) |
| 4921 | /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 4922 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 4923 | &asn_PER_type_Enum0_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4924 | 0, 0, /* Defined elsewhere */ |
| 4925 | &asn_SPC_Enum0_specs_1 /* Additional specs */ |
| 4926 | }; |
| 4927 | |
| 4928 | |
| 4929 | /*** <<< INCLUDES [Enum1] >>> ***/ |
| 4930 | |
| 4931 | #include <NativeEnumerated.h> |
| 4932 | |
| 4933 | /*** <<< DEPS [Enum1] >>> ***/ |
| 4934 | |
| 4935 | typedef enum Enum1 { |
| 4936 | Enum1_one = 0, |
| 4937 | Enum1_two = 1 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 4938 | } e_Enum1; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4939 | |
| 4940 | /*** <<< TYPE-DECLS [Enum1] >>> ***/ |
| 4941 | |
| 4942 | typedef long Enum1_t; |
| 4943 | |
| 4944 | /*** <<< FUNC-DECLS [Enum1] >>> ***/ |
| 4945 | |
| 4946 | extern asn_TYPE_descriptor_t asn_DEF_Enum1; |
| 4947 | asn_struct_free_f Enum1_free; |
| 4948 | asn_struct_print_f Enum1_print; |
| 4949 | asn_constr_check_f Enum1_constraint; |
| 4950 | ber_type_decoder_f Enum1_decode_ber; |
| 4951 | der_type_encoder_f Enum1_encode_der; |
| 4952 | xer_type_decoder_f Enum1_decode_xer; |
| 4953 | xer_type_encoder_f Enum1_encode_xer; |
| 4954 | per_type_decoder_f Enum1_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4955 | per_type_encoder_f Enum1_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4956 | |
| 4957 | /*** <<< CODE [Enum1] >>> ***/ |
| 4958 | |
| 4959 | int |
| 4960 | Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 4961 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4962 | long value; |
| 4963 | |
| 4964 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4965 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4966 | "%s: value not given (%s:%d)", |
| 4967 | td->name, __FILE__, __LINE__); |
| 4968 | return -1; |
| 4969 | } |
| 4970 | |
| 4971 | value = *(const long *)sptr; |
| 4972 | |
| 4973 | if((value == 0)) { |
| 4974 | /* Constraint check succeeded */ |
| 4975 | return 0; |
| 4976 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 4977 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4978 | "%s: constraint failed (%s:%d)", |
| 4979 | td->name, __FILE__, __LINE__); |
| 4980 | return -1; |
| 4981 | } |
| 4982 | } |
| 4983 | |
| 4984 | /* |
| 4985 | * This type is implemented using NativeEnumerated, |
| 4986 | * so here we adjust the DEF accordingly. |
| 4987 | */ |
| 4988 | static void |
| 4989 | Enum1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 4990 | td->free_struct = asn_DEF_NativeEnumerated.free_struct; |
| 4991 | td->print_struct = asn_DEF_NativeEnumerated.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 4992 | td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 4993 | td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; |
| 4994 | td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; |
| 4995 | td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; |
| 4996 | td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; |
| 4997 | td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 4998 | td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 4999 | td->oer_decoder = asn_DEF_NativeEnumerated.oer_decoder; |
| 5000 | td->oer_encoder = asn_DEF_NativeEnumerated.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 5001 | if(!td->oer_constraints) |
| 5002 | td->oer_constraints = asn_DEF_NativeEnumerated.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5003 | if(!td->per_constraints) |
| 5004 | td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; |
| 5005 | td->elements = asn_DEF_NativeEnumerated.elements; |
| 5006 | td->elements_count = asn_DEF_NativeEnumerated.elements_count; |
| 5007 | /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ |
| 5008 | } |
| 5009 | |
| 5010 | void |
| 5011 | Enum1_free(asn_TYPE_descriptor_t *td, |
| 5012 | void *struct_ptr, int contents_only) { |
| 5013 | Enum1_1_inherit_TYPE_descriptor(td); |
| 5014 | td->free_struct(td, struct_ptr, contents_only); |
| 5015 | } |
| 5016 | |
| 5017 | int |
| 5018 | Enum1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 5019 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 5020 | Enum1_1_inherit_TYPE_descriptor(td); |
| 5021 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 5022 | } |
| 5023 | |
| 5024 | asn_dec_rval_t |
| 5025 | Enum1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 5026 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 5027 | Enum1_1_inherit_TYPE_descriptor(td); |
| 5028 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 5029 | } |
| 5030 | |
| 5031 | asn_enc_rval_t |
| 5032 | Enum1_encode_der(asn_TYPE_descriptor_t *td, |
| 5033 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 5034 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 5035 | Enum1_1_inherit_TYPE_descriptor(td); |
| 5036 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 5037 | } |
| 5038 | |
| 5039 | asn_dec_rval_t |
| 5040 | Enum1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 5041 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 5042 | Enum1_1_inherit_TYPE_descriptor(td); |
| 5043 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 5044 | } |
| 5045 | |
| 5046 | asn_enc_rval_t |
| 5047 | Enum1_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 5048 | int ilevel, enum xer_encoder_flags_e flags, |
| 5049 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 5050 | Enum1_1_inherit_TYPE_descriptor(td); |
| 5051 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 5052 | } |
| 5053 | |
| 5054 | asn_dec_rval_t |
| 5055 | Enum1_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 5056 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 5057 | Enum1_1_inherit_TYPE_descriptor(td); |
| 5058 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 5059 | } |
| 5060 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 5061 | asn_enc_rval_t |
| 5062 | Enum1_encode_uper(asn_TYPE_descriptor_t *td, |
| 5063 | asn_per_constraints_t *constraints, |
| 5064 | void *structure, asn_per_outp_t *per_out) { |
| 5065 | Enum1_1_inherit_TYPE_descriptor(td); |
| 5066 | return td->uper_encoder(td, constraints, structure, per_out); |
| 5067 | } |
| 5068 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5069 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 5070 | /*** <<< CTDEFS [Enum1] >>> ***/ |
| 5071 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 5072 | static asn_per_constraints_t asn_PER_type_Enum1_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 5073 | { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, |
| 5074 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 5075 | 0, 0 /* No PER value map */ |
| 5076 | }; |
| 5077 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5078 | /*** <<< STAT-DEFS [Enum1] >>> ***/ |
| 5079 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 5080 | static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5081 | { 0, 3, "one" }, |
| 5082 | { 1, 3, "two" } |
| 5083 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 5084 | static const unsigned int asn_MAP_Enum1_enum2value_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5085 | 0, /* one(0) */ |
| 5086 | 1 /* two(1) */ |
| 5087 | }; |
johvik | e70c407 | 2017-05-09 11:06:12 +0200 | [diff] [blame] | 5088 | static asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5089 | asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */ |
| 5090 | asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */ |
| 5091 | 2, /* Number of elements in the maps */ |
| 5092 | 0, /* Enumeration is not extensible */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 5093 | 1, /* Strict enumeration */ |
| 5094 | 0, /* Native long size */ |
| 5095 | 0 |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5096 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 5097 | static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5098 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 5099 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5100 | asn_TYPE_descriptor_t asn_DEF_Enum1 = { |
| 5101 | "Enum1", |
| 5102 | "Enum1", |
| 5103 | Enum1_free, |
| 5104 | Enum1_print, |
| 5105 | Enum1_constraint, |
| 5106 | Enum1_decode_ber, |
| 5107 | Enum1_encode_der, |
| 5108 | Enum1_decode_xer, |
| 5109 | Enum1_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 5110 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5111 | Enum1_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 5112 | Enum1_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5113 | 0, /* Use generic outmost tag fetcher */ |
| 5114 | asn_DEF_Enum1_tags_1, |
| 5115 | sizeof(asn_DEF_Enum1_tags_1) |
| 5116 | /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ |
| 5117 | asn_DEF_Enum1_tags_1, /* Same as above */ |
| 5118 | sizeof(asn_DEF_Enum1_tags_1) |
| 5119 | /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 5120 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 5121 | &asn_PER_type_Enum1_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5122 | 0, 0, /* Defined elsewhere */ |
| 5123 | &asn_SPC_Enum1_specs_1 /* Additional specs */ |
| 5124 | }; |
| 5125 | |
| 5126 | |
| 5127 | /*** <<< INCLUDES [Identifier] >>> ***/ |
| 5128 | |
| 5129 | #include <VisibleString.h> |
| 5130 | |
| 5131 | /*** <<< TYPE-DECLS [Identifier] >>> ***/ |
| 5132 | |
| 5133 | typedef VisibleString_t Identifier_t; |
| 5134 | |
| 5135 | /*** <<< FUNC-DECLS [Identifier] >>> ***/ |
| 5136 | |
| 5137 | extern asn_TYPE_descriptor_t asn_DEF_Identifier; |
| 5138 | asn_struct_free_f Identifier_free; |
| 5139 | asn_struct_print_f Identifier_print; |
| 5140 | asn_constr_check_f Identifier_constraint; |
| 5141 | ber_type_decoder_f Identifier_decode_ber; |
| 5142 | der_type_encoder_f Identifier_encode_der; |
| 5143 | xer_type_decoder_f Identifier_decode_xer; |
| 5144 | xer_type_encoder_f Identifier_encode_xer; |
| 5145 | per_type_decoder_f Identifier_decode_uper; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 5146 | per_type_encoder_f Identifier_encode_uper; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5147 | |
| 5148 | /*** <<< CTABLES [Identifier] >>> ***/ |
| 5149 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 5150 | static const int permitted_alphabet_table_1[256] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 5151 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 5152 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 5153 | 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */ |
| 5154 | 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */ |
| 5155 | 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */ |
| 5156 | 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */ |
| 5157 | 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */ |
| 5158 | 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5159 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 5160 | static const int permitted_alphabet_code2value_1[64] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 5161 | 36,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69, |
| 5162 | 70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85, |
| 5163 | 86,87,88,89,90,95,97,98,99,100,101,102,103,104,105,106, |
| 5164 | 107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122, |
| 5165 | }; |
| 5166 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5167 | |
| 5168 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 5169 | const int *table = permitted_alphabet_table_1; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5170 | /* The underlying type is VisibleString */ |
| 5171 | const VisibleString_t *st = (const VisibleString_t *)sptr; |
| 5172 | const uint8_t *ch = st->buf; |
| 5173 | const uint8_t *end = ch + st->size; |
| 5174 | |
| 5175 | for(; ch < end; ch++) { |
| 5176 | uint8_t cv = *ch; |
| 5177 | if(!table[cv]) return -1; |
| 5178 | } |
| 5179 | return 0; |
| 5180 | } |
| 5181 | |
| 5182 | |
| 5183 | /*** <<< CODE [Identifier] >>> ***/ |
| 5184 | |
| 5185 | int |
| 5186 | Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 5187 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5188 | const VisibleString_t *st = (const VisibleString_t *)sptr; |
| 5189 | size_t size; |
| 5190 | |
| 5191 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 5192 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5193 | "%s: value not given (%s:%d)", |
| 5194 | td->name, __FILE__, __LINE__); |
| 5195 | return -1; |
| 5196 | } |
| 5197 | |
| 5198 | size = st->size; |
| 5199 | |
| 5200 | if((size >= 1 && size <= 32) |
| 5201 | && !check_permitted_alphabet_1(st)) { |
| 5202 | /* Constraint check succeeded */ |
| 5203 | return 0; |
| 5204 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 5205 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5206 | "%s: constraint failed (%s:%d)", |
| 5207 | td->name, __FILE__, __LINE__); |
| 5208 | return -1; |
| 5209 | } |
| 5210 | } |
| 5211 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 5212 | static int asn_PER_MAP_Identifier_1_v2c(unsigned int value) { |
| 5213 | if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0])) |
| 5214 | return -1; |
| 5215 | return permitted_alphabet_table_1[value] - 1; |
| 5216 | } |
| 5217 | static int asn_PER_MAP_Identifier_1_c2v(unsigned int code) { |
| 5218 | if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0])) |
| 5219 | return -1; |
| 5220 | return permitted_alphabet_code2value_1[code]; |
| 5221 | } |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5222 | /* |
| 5223 | * This type is implemented using VisibleString, |
| 5224 | * so here we adjust the DEF accordingly. |
| 5225 | */ |
| 5226 | static void |
| 5227 | Identifier_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 5228 | td->free_struct = asn_DEF_VisibleString.free_struct; |
| 5229 | td->print_struct = asn_DEF_VisibleString.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 5230 | td->check_constraints = asn_DEF_VisibleString.check_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5231 | td->ber_decoder = asn_DEF_VisibleString.ber_decoder; |
| 5232 | td->der_encoder = asn_DEF_VisibleString.der_encoder; |
| 5233 | td->xer_decoder = asn_DEF_VisibleString.xer_decoder; |
| 5234 | td->xer_encoder = asn_DEF_VisibleString.xer_encoder; |
| 5235 | td->uper_decoder = asn_DEF_VisibleString.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 5236 | td->uper_encoder = asn_DEF_VisibleString.uper_encoder; |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 5237 | td->oer_decoder = asn_DEF_VisibleString.oer_decoder; |
| 5238 | td->oer_encoder = asn_DEF_VisibleString.oer_encoder; |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 5239 | if(!td->oer_constraints) |
| 5240 | td->oer_constraints = asn_DEF_VisibleString.oer_constraints; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5241 | if(!td->per_constraints) |
| 5242 | td->per_constraints = asn_DEF_VisibleString.per_constraints; |
| 5243 | td->elements = asn_DEF_VisibleString.elements; |
| 5244 | td->elements_count = asn_DEF_VisibleString.elements_count; |
| 5245 | td->specifics = asn_DEF_VisibleString.specifics; |
| 5246 | } |
| 5247 | |
| 5248 | void |
| 5249 | Identifier_free(asn_TYPE_descriptor_t *td, |
| 5250 | void *struct_ptr, int contents_only) { |
| 5251 | Identifier_1_inherit_TYPE_descriptor(td); |
| 5252 | td->free_struct(td, struct_ptr, contents_only); |
| 5253 | } |
| 5254 | |
| 5255 | int |
| 5256 | Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 5257 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 5258 | Identifier_1_inherit_TYPE_descriptor(td); |
| 5259 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 5260 | } |
| 5261 | |
| 5262 | asn_dec_rval_t |
| 5263 | Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 5264 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 5265 | Identifier_1_inherit_TYPE_descriptor(td); |
| 5266 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 5267 | } |
| 5268 | |
| 5269 | asn_enc_rval_t |
| 5270 | Identifier_encode_der(asn_TYPE_descriptor_t *td, |
| 5271 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 5272 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 5273 | Identifier_1_inherit_TYPE_descriptor(td); |
| 5274 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 5275 | } |
| 5276 | |
| 5277 | asn_dec_rval_t |
| 5278 | Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 5279 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 5280 | Identifier_1_inherit_TYPE_descriptor(td); |
| 5281 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 5282 | } |
| 5283 | |
| 5284 | asn_enc_rval_t |
| 5285 | Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 5286 | int ilevel, enum xer_encoder_flags_e flags, |
| 5287 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 5288 | Identifier_1_inherit_TYPE_descriptor(td); |
| 5289 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 5290 | } |
| 5291 | |
| 5292 | asn_dec_rval_t |
| 5293 | Identifier_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 5294 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 5295 | Identifier_1_inherit_TYPE_descriptor(td); |
| 5296 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 5297 | } |
| 5298 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 5299 | asn_enc_rval_t |
| 5300 | Identifier_encode_uper(asn_TYPE_descriptor_t *td, |
| 5301 | asn_per_constraints_t *constraints, |
| 5302 | void *structure, asn_per_outp_t *per_out) { |
| 5303 | Identifier_1_inherit_TYPE_descriptor(td); |
| 5304 | return td->uper_encoder(td, constraints, structure, per_out); |
| 5305 | } |
| 5306 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5307 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 5308 | /*** <<< CTDEFS [Identifier] >>> ***/ |
| 5309 | |
Lev Walkin | 2fce55d | 2013-03-28 05:00:39 -0700 | [diff] [blame] | 5310 | static asn_per_constraints_t asn_PER_type_Identifier_constr_1 GCC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 5311 | { APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */, |
| 5312 | { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */, |
| 5313 | asn_PER_MAP_Identifier_1_v2c, /* Value to PER code map */ |
| 5314 | asn_PER_MAP_Identifier_1_c2v /* PER code to value map */ |
| 5315 | }; |
| 5316 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5317 | /*** <<< STAT-DEFS [Identifier] >>> ***/ |
| 5318 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 5319 | static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5320 | (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)) |
| 5321 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5322 | asn_TYPE_descriptor_t asn_DEF_Identifier = { |
| 5323 | "Identifier", |
| 5324 | "Identifier", |
| 5325 | Identifier_free, |
| 5326 | Identifier_print, |
| 5327 | Identifier_constraint, |
| 5328 | Identifier_decode_ber, |
| 5329 | Identifier_encode_der, |
| 5330 | Identifier_decode_xer, |
| 5331 | Identifier_encode_xer, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 5332 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5333 | Identifier_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 5334 | Identifier_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5335 | 0, /* Use generic outmost tag fetcher */ |
| 5336 | asn_DEF_Identifier_tags_1, |
| 5337 | sizeof(asn_DEF_Identifier_tags_1) |
| 5338 | /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */ |
| 5339 | asn_DEF_Identifier_tags_1, /* Same as above */ |
| 5340 | sizeof(asn_DEF_Identifier_tags_1) |
| 5341 | /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 5342 | 0, /* No OER visible constraints */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 5343 | &asn_PER_type_Identifier_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 5344 | 0, 0, /* No members */ |
| 5345 | 0 /* No specifics */ |
| 5346 | }; |
| 5347 | |