blob: 139fd6ab9431b8b3cc953487cd29dee36d536d79 [file] [log] [blame]
vlm3df79662004-06-28 21:13:22 +00001
vlm6e1b13e2004-08-11 05:25:47 +00002/*** <<< INCLUDES [PrimitiveType] >>> ***/
vlm3df79662004-06-28 21:13:22 +00003
4#include <OCTET_STRING.h>
5
6/*** <<< TYPE-DECLS [PrimitiveType] >>> ***/
7
vlm3df79662004-06-28 21:13:22 +00008typedef OCTET_STRING_t PrimitiveType_t;
9
vlm3df79662004-06-28 21:13:22 +000010/*** <<< FUNC-DECLS [PrimitiveType] >>> ***/
11
vlmaafc9412004-09-26 13:12:56 +000012/* This type is equivalent to OCTET_STRING */
vlm02296432004-09-29 13:19:37 +000013#define asn_DEF_PrimitiveType asn_DEF_OCTET_STRING
vlm3df79662004-06-28 21:13:22 +000014
vlm21e46002004-08-20 13:36:32 +000015/*** <<< CODE [PrimitiveType] >>> ***/
16
vlmaafc9412004-09-26 13:12:56 +000017/* This type is equivalent to OCTET_STRING */
vlm3df79662004-06-28 21:13:22 +000018
vlm3df79662004-06-28 21:13:22 +000019
vlm6e1b13e2004-08-11 05:25:47 +000020/*** <<< INCLUDES [ConstructedType] >>> ***/
vlm3df79662004-06-28 21:13:22 +000021
vlm3df79662004-06-28 21:13:22 +000022#include <PrimitiveType.h>
vlm3df79662004-06-28 21:13:22 +000023#include <constr_SEQUENCE.h>
24
vlm3df79662004-06-28 21:13:22 +000025/*** <<< TYPE-DECLS [ConstructedType] >>> ***/
26
vlm3df79662004-06-28 21:13:22 +000027typedef struct ConstructedType {
28 PrimitiveType_t field;
29
30 /* Context for parsing across buffer boundaries */
vlm02296432004-09-29 13:19:37 +000031 asn_struct_ctx_t _asn_ctx;
vlm3df79662004-06-28 21:13:22 +000032} ConstructedType_t;
33
vlm0b567bf2005-03-04 22:18:20 +000034/*** <<< FUNC-DECLS [ConstructedType] >>> ***/
35
36extern asn_TYPE_descriptor_t asn_DEF_ConstructedType;
37
vlm3df79662004-06-28 21:13:22 +000038/*** <<< STAT-DEFS [ConstructedType] >>> ***/
39
vlm44fe49a2005-03-04 11:26:08 +000040static asn_TYPE_member_t asn_MBR_ConstructedType_1[] = {
vlmddd5a7d2004-09-10 09:18:20 +000041 { ATF_NOFLAGS, 0, offsetof(struct ConstructedType, field),
vlm21e46002004-08-20 13:36:32 +000042 .tag = (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
43 .tag_mode = -1, /* IMPLICIT tag at current level */
vlm02296432004-09-29 13:19:37 +000044 .type = (void *)&asn_DEF_PrimitiveType,
vlm0a9af512005-01-17 12:20:19 +000045 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm21e46002004-08-20 13:36:32 +000046 .name = "field"
vlm3df79662004-06-28 21:13:22 +000047 },
48};
vlm44fe49a2005-03-04 11:26:08 +000049static ber_tlv_tag_t asn_DEF_ConstructedType_1_tags[] = {
vlm3df79662004-06-28 21:13:22 +000050 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
51};
vlm44fe49a2005-03-04 11:26:08 +000052static asn_TYPE_tag2member_t asn_MAP_ConstructedType_1_tag2el[] = {
vlm3b0d1e52005-02-25 08:24:19 +000053 { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 0, 0, 0 } /* field at 18 */
vlm3df79662004-06-28 21:13:22 +000054};
vlm44fe49a2005-03-04 11:26:08 +000055static asn_SEQUENCE_specifics_t asn_SPC_ConstructedType_1_specs = {
vlm3df79662004-06-28 21:13:22 +000056 sizeof(struct ConstructedType),
vlm02296432004-09-29 13:19:37 +000057 offsetof(struct ConstructedType, _asn_ctx),
vlm44fe49a2005-03-04 11:26:08 +000058 asn_MAP_ConstructedType_1_tag2el,
vlm3df79662004-06-28 21:13:22 +000059 1, /* Count of tags in the map */
60 -1, /* Start extensions */
61 -1 /* Stop extensions */
62};
vlm02296432004-09-29 13:19:37 +000063asn_TYPE_descriptor_t asn_DEF_ConstructedType = {
vlm3df79662004-06-28 21:13:22 +000064 "ConstructedType",
vlm9de248e2004-10-20 15:50:55 +000065 "ConstructedType",
vlm39ba4c42004-09-22 16:06:28 +000066 SEQUENCE_free,
67 SEQUENCE_print,
vlm3df79662004-06-28 21:13:22 +000068 SEQUENCE_constraint,
69 SEQUENCE_decode_ber,
70 SEQUENCE_encode_der,
vlm2dbab7c2004-10-23 15:07:45 +000071 SEQUENCE_decode_xer,
vlm39ba4c42004-09-22 16:06:28 +000072 SEQUENCE_encode_xer,
vlm3df79662004-06-28 21:13:22 +000073 0, /* Use generic outmost tag fetcher */
vlm44fe49a2005-03-04 11:26:08 +000074 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,
vlm21e46002004-08-20 13:36:32 +000081 1, /* Elements count */
vlm44fe49a2005-03-04 11:26:08 +000082 &asn_SPC_ConstructedType_1_specs /* Additional specs */
vlm3df79662004-06-28 21:13:22 +000083};
84
85
vlm6e1b13e2004-08-11 05:25:47 +000086/*** <<< INCLUDES [T] >>> ***/
vlm3df79662004-06-28 21:13:22 +000087
88#include <ConstructedType.h>
89
90/*** <<< TYPE-DECLS [T] >>> ***/
91
vlm3df79662004-06-28 21:13:22 +000092typedef ConstructedType_t T_t;
93
vlm3df79662004-06-28 21:13:22 +000094/*** <<< FUNC-DECLS [T] >>> ***/
95
vlm02296432004-09-29 13:19:37 +000096extern asn_TYPE_descriptor_t asn_DEF_T;
vlm39ba4c42004-09-22 16:06:28 +000097asn_struct_free_f T_free;
98asn_struct_print_f T_print;
vlm3df79662004-06-28 21:13:22 +000099asn_constr_check_f T_constraint;
100ber_type_decoder_f T_decode_ber;
101der_type_encoder_f T_encode_der;
vlma6af74c2004-10-23 13:26:56 +0000102xer_type_decoder_f T_decode_xer;
vlm39ba4c42004-09-22 16:06:28 +0000103xer_type_encoder_f T_encode_xer;
vlm3df79662004-06-28 21:13:22 +0000104
vlm21e46002004-08-20 13:36:32 +0000105/*** <<< CODE [T] >>> ***/
106
107int
vlm02296432004-09-29 13:19:37 +0000108T_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlm21e46002004-08-20 13:36:32 +0000109 asn_app_consume_bytes_f *app_errlog, void *app_key) {
vlmaafc9412004-09-26 13:12:56 +0000110 /* Replace with underlying type checker */
vlm02296432004-09-29 13:19:37 +0000111 td->check_constraints = asn_DEF_ConstructedType.check_constraints;
vlmaafc9412004-09-26 13:12:56 +0000112 return td->check_constraints(td, sptr, app_errlog, app_key);
vlm21e46002004-08-20 13:36:32 +0000113}
114
115/*
116 * This type is implemented using ConstructedType,
vlmcb0b7fc2004-09-23 22:14:58 +0000117 * so here we adjust the DEF accordingly.
vlm21e46002004-08-20 13:36:32 +0000118 */
119static void
vlm44fe49a2005-03-04 11:26:08 +0000120T_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
vlm02296432004-09-29 13:19:37 +0000121 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;
vlm21e46002004-08-20 13:36:32 +0000130}
131
vlm39ba4c42004-09-22 16:06:28 +0000132void
vlm02296432004-09-29 13:19:37 +0000133T_free(asn_TYPE_descriptor_t *td,
vlm39ba4c42004-09-22 16:06:28 +0000134 void *struct_ptr, int contents_only) {
vlm44fe49a2005-03-04 11:26:08 +0000135 T_0_inherit_TYPE_descriptor(td);
vlm39ba4c42004-09-22 16:06:28 +0000136 td->free_struct(td, struct_ptr, contents_only);
vlm21e46002004-08-20 13:36:32 +0000137}
138
139int
vlm02296432004-09-29 13:19:37 +0000140T_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
vlm21e46002004-08-20 13:36:32 +0000141 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
vlm44fe49a2005-03-04 11:26:08 +0000142 T_0_inherit_TYPE_descriptor(td);
vlm21e46002004-08-20 13:36:32 +0000143 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
144}
145
vlm9de248e2004-10-20 15:50:55 +0000146asn_dec_rval_t
vlm02296432004-09-29 13:19:37 +0000147T_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
vlm39ba4c42004-09-22 16:06:28 +0000148 void **structure, void *bufptr, size_t size, int tag_mode) {
vlm44fe49a2005-03-04 11:26:08 +0000149 T_0_inherit_TYPE_descriptor(td);
vlm02296432004-09-29 13:19:37 +0000150 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
vlm39ba4c42004-09-22 16:06:28 +0000151}
152
153asn_enc_rval_t
vlm02296432004-09-29 13:19:37 +0000154T_encode_der(asn_TYPE_descriptor_t *td,
vlm39ba4c42004-09-22 16:06:28 +0000155 void *structure, int tag_mode, ber_tlv_tag_t tag,
156 asn_app_consume_bytes_f *cb, void *app_key) {
vlm44fe49a2005-03-04 11:26:08 +0000157 T_0_inherit_TYPE_descriptor(td);
vlm39ba4c42004-09-22 16:06:28 +0000158 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
159}
160
vlma6af74c2004-10-23 13:26:56 +0000161asn_dec_rval_t
162T_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) {
vlm44fe49a2005-03-04 11:26:08 +0000164 T_0_inherit_TYPE_descriptor(td);
vlma6af74c2004-10-23 13:26:56 +0000165 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
166}
167
vlm39ba4c42004-09-22 16:06:28 +0000168asn_enc_rval_t
vlm02296432004-09-29 13:19:37 +0000169T_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
vlm39ba4c42004-09-22 16:06:28 +0000170 int ilevel, enum xer_encoder_flags_e flags,
171 asn_app_consume_bytes_f *cb, void *app_key) {
vlm44fe49a2005-03-04 11:26:08 +0000172 T_0_inherit_TYPE_descriptor(td);
vlm39ba4c42004-09-22 16:06:28 +0000173 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
vlm21e46002004-08-20 13:36:32 +0000174}
175
176
vlm3df79662004-06-28 21:13:22 +0000177/*** <<< STAT-DEFS [T] >>> ***/
178
vlm44fe49a2005-03-04 11:26:08 +0000179static ber_tlv_tag_t asn_DEF_T_0_tags[] = {
vlm72425de2004-09-13 08:31:01 +0000180 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
181 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
vlm3df79662004-06-28 21:13:22 +0000182};
vlm02296432004-09-29 13:19:37 +0000183asn_TYPE_descriptor_t asn_DEF_T = {
vlm3df79662004-06-28 21:13:22 +0000184 "T",
vlm9de248e2004-10-20 15:50:55 +0000185 "T",
vlm39ba4c42004-09-22 16:06:28 +0000186 T_free,
187 T_print,
vlm3df79662004-06-28 21:13:22 +0000188 T_constraint,
189 T_decode_ber,
190 T_encode_der,
vlma6af74c2004-10-23 13:26:56 +0000191 T_decode_xer,
vlm39ba4c42004-09-22 16:06:28 +0000192 T_encode_xer,
vlm3df79662004-06-28 21:13:22 +0000193 0, /* Use generic outmost tag fetcher */
vlm44fe49a2005-03-04 11:26:08 +0000194 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 */
vlm21e46002004-08-20 13:36:32 +0000200 0, 0, /* Defined elsewhere */
vlm3df79662004-06-28 21:13:22 +0000201 0 /* No specifics */
202};
203