vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 1 | |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 2 | /*** <<< INCLUDES [PrimitiveType] >>> ***/ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 3 | |
| 4 | #include <OCTET_STRING.h> |
| 5 | |
| 6 | /*** <<< TYPE-DECLS [PrimitiveType] >>> ***/ |
| 7 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 8 | typedef OCTET_STRING_t PrimitiveType_t; |
| 9 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 10 | /*** <<< FUNC-DECLS [PrimitiveType] >>> ***/ |
| 11 | |
vlm | aafc941 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 12 | /* This type is equivalent to OCTET_STRING */ |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 13 | #define asn_DEF_PrimitiveType asn_DEF_OCTET_STRING |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 14 | |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 15 | /*** <<< CODE [PrimitiveType] >>> ***/ |
| 16 | |
vlm | aafc941 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 17 | /* This type is equivalent to OCTET_STRING */ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 18 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 19 | |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 20 | /*** <<< INCLUDES [ConstructedType] >>> ***/ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 21 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 22 | #include <PrimitiveType.h> |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 23 | #include <constr_SEQUENCE.h> |
| 24 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 25 | /*** <<< TYPE-DECLS [ConstructedType] >>> ***/ |
| 26 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 27 | typedef struct ConstructedType { |
| 28 | PrimitiveType_t field; |
| 29 | |
| 30 | /* Context for parsing across buffer boundaries */ |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 31 | asn_struct_ctx_t _asn_ctx; |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 32 | } ConstructedType_t; |
| 33 | |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 34 | /*** <<< FUNC-DECLS [ConstructedType] >>> ***/ |
| 35 | |
| 36 | extern asn_TYPE_descriptor_t asn_DEF_ConstructedType; |
| 37 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 38 | /*** <<< STAT-DEFS [ConstructedType] >>> ***/ |
| 39 | |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 40 | static asn_TYPE_member_t asn_MBR_ConstructedType_1[] = { |
vlm | ddd5a7d | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 41 | { ATF_NOFLAGS, 0, offsetof(struct ConstructedType, field), |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 42 | .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)), |
| 43 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 44 | .type = (void *)&asn_DEF_PrimitiveType, |
vlm | 0a9af51 | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 45 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 46 | .name = "field" |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 47 | }, |
| 48 | }; |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 49 | static ber_tlv_tag_t asn_DEF_ConstructedType_1_tags[] = { |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 50 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 51 | }; |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 52 | static asn_TYPE_tag2member_t asn_MAP_ConstructedType_1_tag2el[] = { |
vlm | 3b0d1e5 | 2005-02-25 08:24:19 +0000 | [diff] [blame] | 53 | { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 0, 0, 0 } /* field at 18 */ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 54 | }; |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 55 | static asn_SEQUENCE_specifics_t asn_SPC_ConstructedType_1_specs = { |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 56 | sizeof(struct ConstructedType), |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 57 | offsetof(struct ConstructedType, _asn_ctx), |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 58 | asn_MAP_ConstructedType_1_tag2el, |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 59 | 1, /* Count of tags in the map */ |
| 60 | -1, /* Start extensions */ |
| 61 | -1 /* Stop extensions */ |
| 62 | }; |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 63 | asn_TYPE_descriptor_t asn_DEF_ConstructedType = { |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 64 | "ConstructedType", |
vlm | 9de248e | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 65 | "ConstructedType", |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 66 | SEQUENCE_free, |
| 67 | SEQUENCE_print, |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 68 | SEQUENCE_constraint, |
| 69 | SEQUENCE_decode_ber, |
| 70 | SEQUENCE_encode_der, |
vlm | 2dbab7c | 2004-10-23 15:07:45 +0000 | [diff] [blame] | 71 | SEQUENCE_decode_xer, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 72 | SEQUENCE_encode_xer, |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 73 | 0, /* Use generic outmost tag fetcher */ |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 74 | asn_DEF_ConstructedType_1_tags, |
| 75 | sizeof(asn_DEF_ConstructedType_1_tags) |
| 76 | /sizeof(asn_DEF_ConstructedType_1_tags[0]), /* 1 */ |
| 77 | asn_DEF_ConstructedType_1_tags, /* Same as above */ |
| 78 | sizeof(asn_DEF_ConstructedType_1_tags) |
| 79 | /sizeof(asn_DEF_ConstructedType_1_tags[0]), /* 1 */ |
| 80 | asn_MBR_ConstructedType_1, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 81 | 1, /* Elements count */ |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 82 | &asn_SPC_ConstructedType_1_specs /* Additional specs */ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 86 | /*** <<< INCLUDES [T] >>> ***/ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 87 | |
| 88 | #include <ConstructedType.h> |
| 89 | |
| 90 | /*** <<< TYPE-DECLS [T] >>> ***/ |
| 91 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 92 | typedef ConstructedType_t T_t; |
| 93 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 94 | /*** <<< FUNC-DECLS [T] >>> ***/ |
| 95 | |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 96 | extern asn_TYPE_descriptor_t asn_DEF_T; |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 97 | asn_struct_free_f T_free; |
| 98 | asn_struct_print_f T_print; |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 99 | asn_constr_check_f T_constraint; |
| 100 | ber_type_decoder_f T_decode_ber; |
| 101 | der_type_encoder_f T_encode_der; |
vlm | a6af74c | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 102 | xer_type_decoder_f T_decode_xer; |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 103 | xer_type_encoder_f T_encode_xer; |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 104 | |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 105 | /*** <<< CODE [T] >>> ***/ |
| 106 | |
| 107 | int |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 108 | T_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 109 | asn_app_consume_bytes_f *app_errlog, void *app_key) { |
vlm | aafc941 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 110 | /* Replace with underlying type checker */ |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 111 | td->check_constraints = asn_DEF_ConstructedType.check_constraints; |
vlm | aafc941 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 112 | return td->check_constraints(td, sptr, app_errlog, app_key); |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | /* |
| 116 | * This type is implemented using ConstructedType, |
vlm | cb0b7fc | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 117 | * so here we adjust the DEF accordingly. |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 118 | */ |
| 119 | static void |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 120 | T_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 121 | td->free_struct = asn_DEF_ConstructedType.free_struct; |
| 122 | td->print_struct = asn_DEF_ConstructedType.print_struct; |
| 123 | td->ber_decoder = asn_DEF_ConstructedType.ber_decoder; |
| 124 | td->der_encoder = asn_DEF_ConstructedType.der_encoder; |
| 125 | td->xer_decoder = asn_DEF_ConstructedType.xer_decoder; |
| 126 | td->xer_encoder = asn_DEF_ConstructedType.xer_encoder; |
| 127 | td->elements = asn_DEF_ConstructedType.elements; |
| 128 | td->elements_count = asn_DEF_ConstructedType.elements_count; |
| 129 | td->specifics = asn_DEF_ConstructedType.specifics; |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 130 | } |
| 131 | |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 132 | void |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 133 | T_free(asn_TYPE_descriptor_t *td, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 134 | void *struct_ptr, int contents_only) { |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 135 | T_0_inherit_TYPE_descriptor(td); |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 136 | td->free_struct(td, struct_ptr, contents_only); |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | int |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 140 | T_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 141 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 142 | T_0_inherit_TYPE_descriptor(td); |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 143 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 144 | } |
| 145 | |
vlm | 9de248e | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 146 | asn_dec_rval_t |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 147 | T_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 148 | void **structure, void *bufptr, size_t size, int tag_mode) { |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 149 | T_0_inherit_TYPE_descriptor(td); |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 150 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | asn_enc_rval_t |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 154 | T_encode_der(asn_TYPE_descriptor_t *td, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 155 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 156 | asn_app_consume_bytes_f *cb, void *app_key) { |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 157 | T_0_inherit_TYPE_descriptor(td); |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 158 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 159 | } |
| 160 | |
vlm | a6af74c | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 161 | asn_dec_rval_t |
| 162 | T_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 163 | void **structure, const char *opt_mname, void *bufptr, size_t size) { |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 164 | T_0_inherit_TYPE_descriptor(td); |
vlm | a6af74c | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 165 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 166 | } |
| 167 | |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 168 | asn_enc_rval_t |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 169 | T_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 170 | int ilevel, enum xer_encoder_flags_e flags, |
| 171 | asn_app_consume_bytes_f *cb, void *app_key) { |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 172 | T_0_inherit_TYPE_descriptor(td); |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 173 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 177 | /*** <<< STAT-DEFS [T] >>> ***/ |
| 178 | |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 179 | static ber_tlv_tag_t asn_DEF_T_0_tags[] = { |
vlm | 72425de | 2004-09-13 08:31:01 +0000 | [diff] [blame] | 180 | (ASN_TAG_CLASS_CONTEXT | (3 << 2)), |
| 181 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 182 | }; |
vlm | 0229643 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 183 | asn_TYPE_descriptor_t asn_DEF_T = { |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 184 | "T", |
vlm | 9de248e | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 185 | "T", |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 186 | T_free, |
| 187 | T_print, |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 188 | T_constraint, |
| 189 | T_decode_ber, |
| 190 | T_encode_der, |
vlm | a6af74c | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 191 | T_decode_xer, |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 192 | T_encode_xer, |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 193 | 0, /* Use generic outmost tag fetcher */ |
vlm | 44fe49a | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 194 | asn_DEF_T_0_tags, |
| 195 | sizeof(asn_DEF_T_0_tags) |
| 196 | /sizeof(asn_DEF_T_0_tags[0]) - 1, /* 1 */ |
| 197 | asn_DEF_T_0_tags, /* Same as above */ |
| 198 | sizeof(asn_DEF_T_0_tags) |
| 199 | /sizeof(asn_DEF_T_0_tags[0]), /* 2 */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 200 | 0, 0, /* Defined elsewhere */ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 201 | 0 /* No specifics */ |
| 202 | }; |
| 203 | |