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