blob: 326a705c1b035d023916831f534e629cd1b28c4d [file] [log] [blame]
vlm1a9a7332007-06-23 20:06:04 +00001
2/*** <<< INCLUDES [PDU] >>> ***/
3
4#include <IA5String.h>
vlmee5fe122007-06-26 23:58:16 +00005#include "Singleton.h"
vlm1a9a7332007-06-23 20:06:04 +00006#include <constr_SEQUENCE.h>
7
vlmee5fe122007-06-26 23:58:16 +00008/*** <<< FWD-DECLS [PDU] >>> ***/
9
10struct PDU_2;
11struct Singleton;
12
vlm1a9a7332007-06-23 20:06:04 +000013/*** <<< TYPE-DECLS [PDU] >>> ***/
14
15typedef struct PDU {
16 /*
17 * This type is extensible,
18 * possible extensions are below.
19 */
20 IA5String_t *str_o /* OPTIONAL */;
21 IA5String_t *str_m;
vlmee5fe122007-06-26 23:58:16 +000022 struct Singleton *singl;
23 struct PDU_2 *pdu_2 /* OPTIONAL */;
vlm1a9a7332007-06-23 20:06:04 +000024
25 /* Context for parsing across buffer boundaries */
26 asn_struct_ctx_t _asn_ctx;
27} PDU_t;
28
29/*** <<< FUNC-DECLS [PDU] >>> ***/
30
31extern asn_TYPE_descriptor_t asn_DEF_PDU;
32
vlmee5fe122007-06-26 23:58:16 +000033/*** <<< POST-INCLUDE [PDU] >>> ***/
34
35#include "PDU-2.h"
36
vlm1a9a7332007-06-23 20:06:04 +000037/*** <<< STAT-DEFS [PDU] >>> ***/
38
39static asn_TYPE_member_t asn_MBR_PDU_1[] = {
vlmee5fe122007-06-26 23:58:16 +000040 { ATF_POINTER, 4, offsetof(struct PDU, str_o),
vlm1a9a7332007-06-23 20:06:04 +000041 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
42 .tag_mode = -1, /* IMPLICIT tag at current level */
43 .type = &asn_DEF_IA5String,
44 .memb_constraints = 0, /* Defer constraints checking to the member type */
45 .per_constraints = 0, /* No PER visible constraints */
46 .default_value = 0,
47 .name = "str-o"
48 },
vlmee5fe122007-06-26 23:58:16 +000049 { ATF_POINTER, 3, offsetof(struct PDU, str_m),
vlm1a9a7332007-06-23 20:06:04 +000050 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
51 .tag_mode = -1, /* IMPLICIT tag at current level */
52 .type = &asn_DEF_IA5String,
53 .memb_constraints = 0, /* Defer constraints checking to the member type */
54 .per_constraints = 0, /* No PER visible constraints */
55 .default_value = 0,
56 .name = "str-m"
57 },
vlmee5fe122007-06-26 23:58:16 +000058 { ATF_POINTER, 2, offsetof(struct PDU, singl),
59 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
60 .tag_mode = -1, /* IMPLICIT tag at current level */
61 .type = &asn_DEF_Singleton,
62 .memb_constraints = 0, /* Defer constraints checking to the member type */
63 .per_constraints = 0, /* No PER visible constraints */
64 .default_value = 0,
65 .name = "singl"
66 },
67 { ATF_POINTER, 1, offsetof(struct PDU, pdu_2),
68 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
69 .tag_mode = +1, /* EXPLICIT tag at current level */
70 .type = &asn_DEF_PDU_2,
71 .memb_constraints = 0, /* Defer constraints checking to the member type */
72 .per_constraints = 0, /* No PER visible constraints */
73 .default_value = 0,
74 .name = "pdu-2"
75 },
vlm1a9a7332007-06-23 20:06:04 +000076};
vlmee5fe122007-06-26 23:58:16 +000077static int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3 };
vlm1a9a7332007-06-23 20:06:04 +000078static ber_tlv_tag_t asn_DEF_PDU_tags_1[] = {
79 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
80};
81static asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = {
82 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* str-o at 16 */
vlmee5fe122007-06-26 23:58:16 +000083 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* str-m at 17 */
84 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* singl at 18 */
85 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* pdu-2 at 19 */
vlm1a9a7332007-06-23 20:06:04 +000086};
87static asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1 = {
88 sizeof(struct PDU),
89 offsetof(struct PDU, _asn_ctx),
90 asn_MAP_PDU_tag2el_1,
vlmee5fe122007-06-26 23:58:16 +000091 4, /* Count of tags in the map */
vlm1a9a7332007-06-23 20:06:04 +000092 asn_MAP_PDU_oms_1, /* Optional members */
vlmee5fe122007-06-26 23:58:16 +000093 0, 4, /* Root/Additions */
vlm1a9a7332007-06-23 20:06:04 +000094 -1, /* Start extensions */
vlmee5fe122007-06-26 23:58:16 +000095 5 /* Stop extensions */
vlm1a9a7332007-06-23 20:06:04 +000096};
97asn_TYPE_descriptor_t asn_DEF_PDU = {
98 "PDU",
99 "PDU",
100 SEQUENCE_free,
101 SEQUENCE_print,
102 SEQUENCE_constraint,
103 SEQUENCE_decode_ber,
104 SEQUENCE_encode_der,
105 SEQUENCE_decode_xer,
106 SEQUENCE_encode_xer,
107 SEQUENCE_decode_uper,
108 SEQUENCE_encode_uper,
109 0, /* Use generic outmost tag fetcher */
110 asn_DEF_PDU_tags_1,
111 sizeof(asn_DEF_PDU_tags_1)
112 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
113 asn_DEF_PDU_tags_1, /* Same as above */
114 sizeof(asn_DEF_PDU_tags_1)
115 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
116 0, /* No PER visible constraints */
117 asn_MBR_PDU_1,
vlmee5fe122007-06-26 23:58:16 +0000118 4, /* Elements count */
vlm1a9a7332007-06-23 20:06:04 +0000119 &asn_SPC_PDU_specs_1 /* Additional specs */
120};
121
vlmee5fe122007-06-26 23:58:16 +0000122
123/*** <<< INCLUDES [Singleton] >>> ***/
124
125#include <IA5String.h>
126#include <constr_SEQUENCE.h>
127
128/*** <<< TYPE-DECLS [Singleton] >>> ***/
129
130typedef struct Singleton {
131 IA5String_t *opt_z /* DEFAULT z */;
132
133 /* Context for parsing across buffer boundaries */
134 asn_struct_ctx_t _asn_ctx;
135} Singleton_t;
136
137/*** <<< FUNC-DECLS [Singleton] >>> ***/
138
139extern asn_TYPE_descriptor_t asn_DEF_Singleton;
140
141/*** <<< STAT-DEFS [Singleton] >>> ***/
142
vlm0931f572007-06-27 01:54:57 +0000143static int asn_DFL_2_set(int set_value, void **sptr) {
144 static uint8_t defv[] = "z";
145 IA5String_t *st = *sptr;
146
147 if(!st) {
148 if(!set_value) return -1; /* Not a default value */
149 st = (*sptr = CALLOC(1, sizeof(*st)));
150 if(!st) return -1;
151 }
152
153 if(set_value) {
154 uint8_t *ptr = MALLOC(sizeof(defv));
155 if(!ptr) return -1;
156 memcpy(ptr, &defv, sizeof(defv));
157 FREEMEM(st->buf);
158 st->buf = ptr;
159 st->size = sizeof(defv) - 1;
160 return 0;
161 } else {
162 if(st->size != (sizeof(defv) - 1)
163 || memcmp(st->buf, &defv, sizeof(defv) - 1))
164 return 0;
165 return 1;
166 }
167
168}
vlmee5fe122007-06-26 23:58:16 +0000169static asn_TYPE_member_t asn_MBR_Singleton_1[] = {
170 { ATF_POINTER, 1, offsetof(struct Singleton, opt_z),
171 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
172 .tag_mode = -1, /* IMPLICIT tag at current level */
173 .type = &asn_DEF_IA5String,
174 .memb_constraints = 0, /* Defer constraints checking to the member type */
175 .per_constraints = 0, /* No PER visible constraints */
vlm0931f572007-06-27 01:54:57 +0000176 .default_value = asn_DFL_2_set, /* DEFAULT "z" */
vlmee5fe122007-06-26 23:58:16 +0000177 .name = "opt-z"
178 },
179};
180static int asn_MAP_Singleton_oms_1[] = { 0 };
181static ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
182 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
183};
184static asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
185 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z at 23 */
186};
187static asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
188 sizeof(struct Singleton),
189 offsetof(struct Singleton, _asn_ctx),
190 asn_MAP_Singleton_tag2el_1,
191 1, /* Count of tags in the map */
192 asn_MAP_Singleton_oms_1, /* Optional members */
193 1, 0, /* Root/Additions */
194 -1, /* Start extensions */
195 -1 /* Stop extensions */
196};
197asn_TYPE_descriptor_t asn_DEF_Singleton = {
198 "Singleton",
199 "Singleton",
200 SEQUENCE_free,
201 SEQUENCE_print,
202 SEQUENCE_constraint,
203 SEQUENCE_decode_ber,
204 SEQUENCE_encode_der,
205 SEQUENCE_decode_xer,
206 SEQUENCE_encode_xer,
207 SEQUENCE_decode_uper,
208 SEQUENCE_encode_uper,
209 0, /* Use generic outmost tag fetcher */
210 asn_DEF_Singleton_tags_1,
211 sizeof(asn_DEF_Singleton_tags_1)
212 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
213 asn_DEF_Singleton_tags_1, /* Same as above */
214 sizeof(asn_DEF_Singleton_tags_1)
215 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
216 0, /* No PER visible constraints */
217 asn_MBR_Singleton_1,
218 1, /* Elements count */
219 &asn_SPC_Singleton_specs_1 /* Additional specs */
220};
221
222
223/*** <<< INCLUDES [PDU-2] >>> ***/
224
225#include <IA5String.h>
226#include <constr_CHOICE.h>
227
228/*** <<< DEPS [PDU-2] >>> ***/
229
230typedef enum PDU_2_PR {
231 PDU_2_PR_NOTHING, /* No components present */
232 PDU_2_PR_str_p2,
233 /* Extensions may appear below */
234
235} PDU_2_PR;
236
237/*** <<< TYPE-DECLS [PDU-2] >>> ***/
238
239typedef struct PDU_2 {
240 PDU_2_PR present;
241 union PDU_2_u {
242 IA5String_t str_p2;
243 /*
244 * This type is extensible,
245 * possible extensions are below.
246 */
247 } choice;
248
249 /* Context for parsing across buffer boundaries */
250 asn_struct_ctx_t _asn_ctx;
251} PDU_2_t;
252
253/*** <<< FUNC-DECLS [PDU-2] >>> ***/
254
255extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
256
257/*** <<< CTDEFS [PDU-2] >>> ***/
258
259static asn_per_constraints_t asn_PER_type_PDU_2_constr_1 = {
260 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
261 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
262 0, 0 /* No PER value map */
263};
264
265/*** <<< STAT-DEFS [PDU-2] >>> ***/
266
267static asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
268 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.str_p2),
269 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
270 .tag_mode = -1, /* IMPLICIT tag at current level */
271 .type = &asn_DEF_IA5String,
272 .memb_constraints = 0, /* Defer constraints checking to the member type */
273 .per_constraints = 0, /* No PER visible constraints */
274 .default_value = 0,
275 .name = "str-p2"
276 },
277};
278static asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
279 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* str-p2 at 27 */
280};
281static asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
282 sizeof(struct PDU_2),
283 offsetof(struct PDU_2, _asn_ctx),
284 offsetof(struct PDU_2, present),
285 sizeof(((struct PDU_2 *)0)->present),
286 asn_MAP_PDU_2_tag2el_1,
287 1, /* Count of tags in the map */
288 .canonical_order = 0,
289 .ext_start = 1 /* Extensions start */
290};
291asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
292 "PDU-2",
293 "PDU-2",
294 CHOICE_free,
295 CHOICE_print,
296 CHOICE_constraint,
297 CHOICE_decode_ber,
298 CHOICE_encode_der,
299 CHOICE_decode_xer,
300 CHOICE_encode_xer,
301 CHOICE_decode_uper,
302 CHOICE_encode_uper,
303 CHOICE_outmost_tag,
304 0, /* No effective tags (pointer) */
305 0, /* No effective tags (count) */
306 0, /* No tags (pointer) */
307 0, /* No tags (count) */
308 &asn_PER_type_PDU_2_constr_1,
309 asn_MBR_PDU_2_1,
310 1, /* Elements count */
311 &asn_SPC_PDU_2_specs_1 /* Additional specs */
312};
313