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