Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 1 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 2 | /*** <<< INCLUDES [PrimitiveType] >>> ***/ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 3 | |
| 4 | #include <OCTET_STRING.h> |
| 5 | |
| 6 | /*** <<< TYPE-DECLS [PrimitiveType] >>> ***/ |
| 7 | |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 8 | typedef OCTET_STRING_t PrimitiveType_t; |
| 9 | |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 10 | /*** <<< FUNC-DECLS [PrimitiveType] >>> ***/ |
| 11 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 12 | extern asn_TYPE_descriptor_t asn_DEF_PrimitiveType; |
| 13 | asn_struct_free_f PrimitiveType_free; |
| 14 | asn_struct_print_f PrimitiveType_print; |
| 15 | asn_constr_check_f PrimitiveType_constraint; |
| 16 | ber_type_decoder_f PrimitiveType_decode_ber; |
| 17 | der_type_encoder_f PrimitiveType_encode_der; |
| 18 | xer_type_decoder_f PrimitiveType_decode_xer; |
| 19 | xer_type_encoder_f PrimitiveType_encode_xer; |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 20 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 21 | /*** <<< CODE [PrimitiveType] >>> ***/ |
| 22 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 23 | int |
| 24 | PrimitiveType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 25 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 26 | /* Replace with underlying type checker */ |
| 27 | td->check_constraints = asn_DEF_OCTET_STRING.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 28 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | /* |
| 32 | * This type is implemented using OCTET_STRING, |
| 33 | * so here we adjust the DEF accordingly. |
| 34 | */ |
| 35 | static void |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 36 | PrimitiveType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 37 | td->free_struct = asn_DEF_OCTET_STRING.free_struct; |
| 38 | td->print_struct = asn_DEF_OCTET_STRING.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 39 | td->check_constraints = asn_DEF_OCTET_STRING.check_constraints; |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 40 | td->ber_decoder = asn_DEF_OCTET_STRING.ber_decoder; |
| 41 | td->der_encoder = asn_DEF_OCTET_STRING.der_encoder; |
| 42 | td->xer_decoder = asn_DEF_OCTET_STRING.xer_decoder; |
| 43 | td->xer_encoder = asn_DEF_OCTET_STRING.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 44 | td->uper_decoder = asn_DEF_OCTET_STRING.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 45 | td->uper_encoder = asn_DEF_OCTET_STRING.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 46 | if(!td->per_constraints) |
| 47 | td->per_constraints = asn_DEF_OCTET_STRING.per_constraints; |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 48 | td->elements = asn_DEF_OCTET_STRING.elements; |
| 49 | td->elements_count = asn_DEF_OCTET_STRING.elements_count; |
| 50 | td->specifics = asn_DEF_OCTET_STRING.specifics; |
| 51 | } |
| 52 | |
| 53 | void |
| 54 | PrimitiveType_free(asn_TYPE_descriptor_t *td, |
| 55 | void *struct_ptr, int contents_only) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 56 | PrimitiveType_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 57 | td->free_struct(td, struct_ptr, contents_only); |
| 58 | } |
| 59 | |
| 60 | int |
| 61 | PrimitiveType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 62 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 63 | PrimitiveType_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 64 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 65 | } |
| 66 | |
| 67 | asn_dec_rval_t |
| 68 | PrimitiveType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
Lev Walkin | 3ebc65a | 2005-03-17 21:57:19 +0000 | [diff] [blame] | 69 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 70 | PrimitiveType_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 71 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 72 | } |
| 73 | |
| 74 | asn_enc_rval_t |
| 75 | PrimitiveType_encode_der(asn_TYPE_descriptor_t *td, |
| 76 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 77 | asn_app_consume_bytes_f *cb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 78 | PrimitiveType_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 79 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 80 | } |
| 81 | |
| 82 | asn_dec_rval_t |
| 83 | PrimitiveType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
Lev Walkin | 3ebc65a | 2005-03-17 21:57:19 +0000 | [diff] [blame] | 84 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 85 | PrimitiveType_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 86 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 87 | } |
| 88 | |
| 89 | asn_enc_rval_t |
| 90 | PrimitiveType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 91 | int ilevel, enum xer_encoder_flags_e flags, |
| 92 | asn_app_consume_bytes_f *cb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 93 | PrimitiveType_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 94 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 95 | } |
| 96 | |
| 97 | |
| 98 | /*** <<< STAT-DEFS [PrimitiveType] >>> ***/ |
| 99 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 100 | static const ber_tlv_tag_t asn_DEF_PrimitiveType_tags_1[] = { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 101 | (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) |
| 102 | }; |
| 103 | asn_TYPE_descriptor_t asn_DEF_PrimitiveType = { |
| 104 | "PrimitiveType", |
| 105 | "PrimitiveType", |
| 106 | PrimitiveType_free, |
| 107 | PrimitiveType_print, |
| 108 | PrimitiveType_constraint, |
| 109 | PrimitiveType_decode_ber, |
| 110 | PrimitiveType_encode_der, |
| 111 | PrimitiveType_decode_xer, |
| 112 | PrimitiveType_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 113 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 114 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 115 | asn_DEF_PrimitiveType_tags_1, |
| 116 | sizeof(asn_DEF_PrimitiveType_tags_1) |
| 117 | /sizeof(asn_DEF_PrimitiveType_tags_1[0]), /* 1 */ |
| 118 | asn_DEF_PrimitiveType_tags_1, /* Same as above */ |
| 119 | sizeof(asn_DEF_PrimitiveType_tags_1) |
| 120 | /sizeof(asn_DEF_PrimitiveType_tags_1[0]), /* 1 */ |
| 121 | 0, /* No PER visible constraints */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 122 | 0, 0, /* No members */ |
| 123 | 0 /* No specifics */ |
| 124 | }; |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 125 | |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 126 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 127 | /*** <<< INCLUDES [ConstructedType] >>> ***/ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 128 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 129 | #include "PrimitiveType.h" |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 130 | #include <constr_SEQUENCE.h> |
| 131 | |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 132 | /*** <<< TYPE-DECLS [ConstructedType] >>> ***/ |
| 133 | |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 134 | typedef struct ConstructedType { |
| 135 | PrimitiveType_t field; |
| 136 | |
| 137 | /* Context for parsing across buffer boundaries */ |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 138 | asn_struct_ctx_t _asn_ctx; |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 139 | } ConstructedType_t; |
| 140 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 141 | /*** <<< FUNC-DECLS [ConstructedType] >>> ***/ |
| 142 | |
| 143 | extern asn_TYPE_descriptor_t asn_DEF_ConstructedType; |
| 144 | |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 145 | /*** <<< STAT-DEFS [ConstructedType] >>> ***/ |
| 146 | |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 147 | static asn_TYPE_member_t asn_MBR_ConstructedType_1[] = { |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 148 | { ATF_NOFLAGS, 0, offsetof(struct ConstructedType, field), |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 149 | .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)), |
| 150 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 151 | .type = &asn_DEF_PrimitiveType, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 152 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 153 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 154 | .default_value = 0, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 155 | .name = "field" |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 156 | }, |
| 157 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 158 | static const ber_tlv_tag_t asn_DEF_ConstructedType_tags_1[] = { |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 159 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 160 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 161 | static const asn_TYPE_tag2member_t asn_MAP_ConstructedType_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 162 | { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 0, 0, 0 } /* field */ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 163 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 164 | static asn_SEQUENCE_specifics_t asn_SPC_ConstructedType_specs_1 = { |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 165 | sizeof(struct ConstructedType), |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 166 | offsetof(struct ConstructedType, _asn_ctx), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 167 | asn_MAP_ConstructedType_tag2el_1, |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 168 | 1, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 169 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 170 | -1, /* Start extensions */ |
| 171 | -1 /* Stop extensions */ |
| 172 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 173 | asn_TYPE_descriptor_t asn_DEF_ConstructedType = { |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 174 | "ConstructedType", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 175 | "ConstructedType", |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 176 | SEQUENCE_free, |
| 177 | SEQUENCE_print, |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 178 | SEQUENCE_constraint, |
| 179 | SEQUENCE_decode_ber, |
| 180 | SEQUENCE_encode_der, |
Lev Walkin | 61b40d8 | 2004-10-23 15:07:45 +0000 | [diff] [blame] | 181 | SEQUENCE_decode_xer, |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 182 | SEQUENCE_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 183 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 184 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 185 | asn_DEF_ConstructedType_tags_1, |
| 186 | sizeof(asn_DEF_ConstructedType_tags_1) |
| 187 | /sizeof(asn_DEF_ConstructedType_tags_1[0]), /* 1 */ |
| 188 | asn_DEF_ConstructedType_tags_1, /* Same as above */ |
| 189 | sizeof(asn_DEF_ConstructedType_tags_1) |
| 190 | /sizeof(asn_DEF_ConstructedType_tags_1[0]), /* 1 */ |
| 191 | 0, /* No PER visible constraints */ |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 192 | asn_MBR_ConstructedType_1, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 193 | 1, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 194 | &asn_SPC_ConstructedType_specs_1 /* Additional specs */ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 195 | }; |
| 196 | |
| 197 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 198 | /*** <<< INCLUDES [T] >>> ***/ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 199 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 200 | #include "ConstructedType.h" |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 201 | |
| 202 | /*** <<< TYPE-DECLS [T] >>> ***/ |
| 203 | |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 204 | typedef ConstructedType_t T_t; |
| 205 | |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 206 | /*** <<< FUNC-DECLS [T] >>> ***/ |
| 207 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 208 | extern asn_TYPE_descriptor_t asn_DEF_T; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 209 | asn_struct_free_f T_free; |
| 210 | asn_struct_print_f T_print; |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 211 | asn_constr_check_f T_constraint; |
| 212 | ber_type_decoder_f T_decode_ber; |
| 213 | der_type_encoder_f T_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 214 | xer_type_decoder_f T_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 215 | xer_type_encoder_f T_encode_xer; |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 216 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 217 | /*** <<< CODE [T] >>> ***/ |
| 218 | |
| 219 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 220 | T_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 221 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 154aa18 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 222 | /* Replace with underlying type checker */ |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 223 | td->check_constraints = asn_DEF_ConstructedType.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 224 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | /* |
| 228 | * This type is implemented using ConstructedType, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 229 | * so here we adjust the DEF accordingly. |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 230 | */ |
| 231 | static void |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 232 | T_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 233 | td->free_struct = asn_DEF_ConstructedType.free_struct; |
| 234 | td->print_struct = asn_DEF_ConstructedType.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 235 | td->check_constraints = asn_DEF_ConstructedType.check_constraints; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 236 | td->ber_decoder = asn_DEF_ConstructedType.ber_decoder; |
| 237 | td->der_encoder = asn_DEF_ConstructedType.der_encoder; |
| 238 | td->xer_decoder = asn_DEF_ConstructedType.xer_decoder; |
| 239 | td->xer_encoder = asn_DEF_ConstructedType.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 240 | td->uper_decoder = asn_DEF_ConstructedType.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 241 | td->uper_encoder = asn_DEF_ConstructedType.uper_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 242 | if(!td->per_constraints) |
| 243 | td->per_constraints = asn_DEF_ConstructedType.per_constraints; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 244 | td->elements = asn_DEF_ConstructedType.elements; |
| 245 | td->elements_count = asn_DEF_ConstructedType.elements_count; |
| 246 | td->specifics = asn_DEF_ConstructedType.specifics; |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 247 | } |
| 248 | |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 249 | void |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 250 | T_free(asn_TYPE_descriptor_t *td, |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 251 | void *struct_ptr, int contents_only) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 252 | T_1_inherit_TYPE_descriptor(td); |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 253 | td->free_struct(td, struct_ptr, contents_only); |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 257 | T_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 258 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 259 | T_1_inherit_TYPE_descriptor(td); |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 260 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 261 | } |
| 262 | |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 263 | asn_dec_rval_t |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 264 | T_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
Lev Walkin | 3ebc65a | 2005-03-17 21:57:19 +0000 | [diff] [blame] | 265 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 266 | T_1_inherit_TYPE_descriptor(td); |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 267 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 268 | } |
| 269 | |
| 270 | asn_enc_rval_t |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 271 | T_encode_der(asn_TYPE_descriptor_t *td, |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 272 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 273 | asn_app_consume_bytes_f *cb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 274 | T_1_inherit_TYPE_descriptor(td); |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 275 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 276 | } |
| 277 | |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 278 | asn_dec_rval_t |
| 279 | T_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
Lev Walkin | 3ebc65a | 2005-03-17 21:57:19 +0000 | [diff] [blame] | 280 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 281 | T_1_inherit_TYPE_descriptor(td); |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 282 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 283 | } |
| 284 | |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 285 | asn_enc_rval_t |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 286 | T_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 287 | int ilevel, enum xer_encoder_flags_e flags, |
| 288 | asn_app_consume_bytes_f *cb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 289 | T_1_inherit_TYPE_descriptor(td); |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 290 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 294 | /*** <<< STAT-DEFS [T] >>> ***/ |
| 295 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 296 | static const ber_tlv_tag_t asn_DEF_T_tags_1[] = { |
Lev Walkin | 188ed2c | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 297 | (ASN_TAG_CLASS_CONTEXT | (3 << 2)), |
| 298 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 299 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 300 | asn_TYPE_descriptor_t asn_DEF_T = { |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 301 | "T", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 302 | "T", |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 303 | T_free, |
| 304 | T_print, |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 305 | T_constraint, |
| 306 | T_decode_ber, |
| 307 | T_encode_der, |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 308 | T_decode_xer, |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 309 | T_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 310 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 311 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 312 | asn_DEF_T_tags_1, |
| 313 | sizeof(asn_DEF_T_tags_1) |
| 314 | /sizeof(asn_DEF_T_tags_1[0]) - 1, /* 1 */ |
| 315 | asn_DEF_T_tags_1, /* Same as above */ |
| 316 | sizeof(asn_DEF_T_tags_1) |
| 317 | /sizeof(asn_DEF_T_tags_1[0]), /* 2 */ |
| 318 | 0, /* No PER visible constraints */ |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 319 | 0, 0, /* Defined elsewhere */ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 320 | 0 /* No specifics */ |
| 321 | }; |
| 322 | |