blob: 0f53a295de11d95a85945f87dd304fe4d6e7c292 [file] [log] [blame]
Lev Walkinfb953d12007-06-23 20:06:04 +00001
2/*** <<< INCLUDES [PDU] >>> ***/
3
4#include <IA5String.h>
Lev Walkin34ff9002007-06-26 23:58:16 +00005#include "Singleton.h"
Lev Walkinfb953d12007-06-23 20:06:04 +00006#include <constr_SEQUENCE.h>
7
Lev Walkin34ff9002007-06-26 23:58:16 +00008/*** <<< FWD-DECLS [PDU] >>> ***/
9
10struct PDU_2;
11struct Singleton;
12
Lev Walkinfb953d12007-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;
Lev Walkin34ff9002007-06-26 23:58:16 +000022 struct Singleton *singl;
23 struct PDU_2 *pdu_2 /* OPTIONAL */;
Lev Walkinfb953d12007-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
Lev Walkin34ff9002007-06-26 23:58:16 +000033/*** <<< POST-INCLUDE [PDU] >>> ***/
34
35#include "PDU-2.h"
36
Lev Walkinfb953d12007-06-23 20:06:04 +000037/*** <<< STAT-DEFS [PDU] >>> ***/
38
39static asn_TYPE_member_t asn_MBR_PDU_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +000040 { ATF_POINTER, 4, offsetof(struct PDU, str_o),
Lev Walkinfb953d12007-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 },
Lev Walkin34ff9002007-06-26 23:58:16 +000049 { ATF_POINTER, 3, offsetof(struct PDU, str_m),
Lev Walkinfb953d12007-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 },
Lev Walkin34ff9002007-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 },
Lev Walkinfb953d12007-06-23 20:06:04 +000076};
Lev Walkina7591b52014-10-12 18:37:35 -070077static const int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3 };
78static const ber_tlv_tag_t asn_DEF_PDU_tags_1[] = {
Lev Walkinfb953d12007-06-23 20:06:04 +000079 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
80};
Lev Walkina7591b52014-10-12 18:37:35 -070081static const asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070082 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* str-o */
83 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* str-m */
84 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* singl */
85 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* pdu-2 */
Lev Walkinfb953d12007-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,
Lev Walkin34ff9002007-06-26 23:58:16 +000091 4, /* Count of tags in the map */
Lev Walkinfb953d12007-06-23 20:06:04 +000092 asn_MAP_PDU_oms_1, /* Optional members */
Lev Walkin34ff9002007-06-26 23:58:16 +000093 0, 4, /* Root/Additions */
Lev Walkinfb953d12007-06-23 20:06:04 +000094 -1, /* Start extensions */
Lev Walkin34ff9002007-06-26 23:58:16 +000095 5 /* Stop extensions */
Lev Walkinfb953d12007-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,
Lev Walkin34ff9002007-06-26 23:58:16 +0000118 4, /* Elements count */
Lev Walkinfb953d12007-06-23 20:06:04 +0000119 &asn_SPC_PDU_specs_1 /* Additional specs */
120};
121
Lev Walkin34ff9002007-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
Lev Walkin8032f7a2007-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}
Lev Walkin34ff9002007-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 */
Lev Walkin8032f7a2007-06-27 01:54:57 +0000176 .default_value = asn_DFL_2_set, /* DEFAULT "z" */
Lev Walkin34ff9002007-06-26 23:58:16 +0000177 .name = "opt-z"
178 },
179};
Lev Walkina7591b52014-10-12 18:37:35 -0700180static const int asn_MAP_Singleton_oms_1[] = { 0 };
181static const ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000182 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
183};
Lev Walkina7591b52014-10-12 18:37:35 -0700184static const asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700185 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z */
Lev Walkin34ff9002007-06-26 23:58:16 +0000186};
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
Lev Walkin2a744a72013-03-27 01:56:23 -0700225#include <NativeInteger.h>
Lev Walkin34ff9002007-06-26 23:58:16 +0000226#include <constr_CHOICE.h>
227
228/*** <<< DEPS [PDU-2] >>> ***/
229
230typedef enum PDU_2_PR {
231 PDU_2_PR_NOTHING, /* No components present */
Lev Walkind7a68112007-06-29 01:42:04 +0000232 PDU_2_PR_main,
Lev Walkin34ff9002007-06-26 23:58:16 +0000233 /* Extensions may appear below */
Lev Walkind7a68112007-06-29 01:42:04 +0000234 PDU_2_PR_ext1,
235 PDU_2_PR_ext0
Lev Walkin34ff9002007-06-26 23:58:16 +0000236} PDU_2_PR;
237
238/*** <<< TYPE-DECLS [PDU-2] >>> ***/
239
240typedef struct PDU_2 {
241 PDU_2_PR present;
242 union PDU_2_u {
Lev Walkin2a744a72013-03-27 01:56:23 -0700243 long main;
Lev Walkin34ff9002007-06-26 23:58:16 +0000244 /*
245 * This type is extensible,
246 * possible extensions are below.
247 */
Lev Walkin2a744a72013-03-27 01:56:23 -0700248 long ext1;
249 long ext0;
Lev Walkin34ff9002007-06-26 23:58:16 +0000250 } choice;
251
252 /* Context for parsing across buffer boundaries */
253 asn_struct_ctx_t _asn_ctx;
254} PDU_2_t;
255
256/*** <<< FUNC-DECLS [PDU-2] >>> ***/
257
258extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
259
260/*** <<< CTDEFS [PDU-2] >>> ***/
261
Lev Walkin2fce55d2013-03-28 05:00:39 -0700262static asn_per_constraints_t asn_PER_type_PDU_2_constr_1 GCC_NOTUSED = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000263 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
264 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
265 0, 0 /* No PER value map */
266};
267
268/*** <<< STAT-DEFS [PDU-2] >>> ***/
269
270static asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
Lev Walkind7a68112007-06-29 01:42:04 +0000271 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
272 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
Lev Walkin34ff9002007-06-26 23:58:16 +0000273 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700274 .type = &asn_DEF_NativeInteger,
Lev Walkin34ff9002007-06-26 23:58:16 +0000275 .memb_constraints = 0, /* Defer constraints checking to the member type */
276 .per_constraints = 0, /* No PER visible constraints */
277 .default_value = 0,
Lev Walkind7a68112007-06-29 01:42:04 +0000278 .name = "main"
279 },
280 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
281 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
282 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700283 .type = &asn_DEF_NativeInteger,
Lev Walkind7a68112007-06-29 01:42:04 +0000284 .memb_constraints = 0, /* Defer constraints checking to the member type */
285 .per_constraints = 0, /* No PER visible constraints */
286 .default_value = 0,
287 .name = "ext1"
288 },
289 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
290 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
291 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700292 .type = &asn_DEF_NativeInteger,
Lev Walkind7a68112007-06-29 01:42:04 +0000293 .memb_constraints = 0, /* Defer constraints checking to the member type */
294 .per_constraints = 0, /* No PER visible constraints */
295 .default_value = 0,
296 .name = "ext0"
Lev Walkin34ff9002007-06-26 23:58:16 +0000297 },
298};
Lev Walkina7591b52014-10-12 18:37:35 -0700299static const int asn_MAP_PDU_2_cmap_1[] = { 0, 2, 1 };
300static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700301 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 */
302 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 */
303 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main */
Lev Walkin34ff9002007-06-26 23:58:16 +0000304};
305static asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
306 sizeof(struct PDU_2),
307 offsetof(struct PDU_2, _asn_ctx),
308 offsetof(struct PDU_2, present),
309 sizeof(((struct PDU_2 *)0)->present),
310 asn_MAP_PDU_2_tag2el_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000311 3, /* Count of tags in the map */
312 .canonical_order = asn_MAP_PDU_2_cmap_1, /* Canonically sorted */
Lev Walkin34ff9002007-06-26 23:58:16 +0000313 .ext_start = 1 /* Extensions start */
314};
315asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
316 "PDU-2",
317 "PDU-2",
318 CHOICE_free,
319 CHOICE_print,
320 CHOICE_constraint,
321 CHOICE_decode_ber,
322 CHOICE_encode_der,
323 CHOICE_decode_xer,
324 CHOICE_encode_xer,
325 CHOICE_decode_uper,
326 CHOICE_encode_uper,
327 CHOICE_outmost_tag,
328 0, /* No effective tags (pointer) */
329 0, /* No effective tags (count) */
330 0, /* No tags (pointer) */
331 0, /* No tags (count) */
332 &asn_PER_type_PDU_2_constr_1,
333 asn_MBR_PDU_2_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000334 3, /* Elements count */
Lev Walkin34ff9002007-06-26 23:58:16 +0000335 &asn_SPC_PDU_2_specs_1 /* Additional specs */
336};
337