blob: abfaeb3fa7201a0c3cad5ffa367de14eae0f971b [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 */
Lev Walkinb33425f2017-07-14 14:59:52 +040045 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkinfb953d12007-06-23 20:06:04 +000046 .per_constraints = 0, /* No PER visible constraints */
47 .default_value = 0,
48 .name = "str-o"
49 },
Lev Walkin34ff9002007-06-26 23:58:16 +000050 { ATF_POINTER, 3, offsetof(struct PDU, str_m),
Lev Walkinfb953d12007-06-23 20:06:04 +000051 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
52 .tag_mode = -1, /* IMPLICIT tag at current level */
53 .type = &asn_DEF_IA5String,
54 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040055 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkinfb953d12007-06-23 20:06:04 +000056 .per_constraints = 0, /* No PER visible constraints */
57 .default_value = 0,
58 .name = "str-m"
59 },
Lev Walkin34ff9002007-06-26 23:58:16 +000060 { ATF_POINTER, 2, offsetof(struct PDU, singl),
61 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
62 .tag_mode = -1, /* IMPLICIT tag at current level */
63 .type = &asn_DEF_Singleton,
64 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040065 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +000066 .per_constraints = 0, /* No PER visible constraints */
67 .default_value = 0,
68 .name = "singl"
69 },
70 { ATF_POINTER, 1, offsetof(struct PDU, pdu_2),
71 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
72 .tag_mode = +1, /* EXPLICIT tag at current level */
73 .type = &asn_DEF_PDU_2,
74 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040075 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +000076 .per_constraints = 0, /* No PER visible constraints */
77 .default_value = 0,
78 .name = "pdu-2"
79 },
Lev Walkinfb953d12007-06-23 20:06:04 +000080};
Lev Walkina7591b52014-10-12 18:37:35 -070081static const int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3 };
82static const ber_tlv_tag_t asn_DEF_PDU_tags_1[] = {
Lev Walkinfb953d12007-06-23 20:06:04 +000083 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
84};
Lev Walkina7591b52014-10-12 18:37:35 -070085static const asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070086 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* str-o */
87 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* str-m */
88 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* singl */
89 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* pdu-2 */
Lev Walkinfb953d12007-06-23 20:06:04 +000090};
91static asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1 = {
92 sizeof(struct PDU),
93 offsetof(struct PDU, _asn_ctx),
94 asn_MAP_PDU_tag2el_1,
Lev Walkin34ff9002007-06-26 23:58:16 +000095 4, /* Count of tags in the map */
Lev Walkinfb953d12007-06-23 20:06:04 +000096 asn_MAP_PDU_oms_1, /* Optional members */
Lev Walkin34ff9002007-06-26 23:58:16 +000097 0, 4, /* Root/Additions */
Lev Walkinfb953d12007-06-23 20:06:04 +000098 -1, /* Start extensions */
Lev Walkin34ff9002007-06-26 23:58:16 +000099 5 /* Stop extensions */
Lev Walkinfb953d12007-06-23 20:06:04 +0000100};
101asn_TYPE_descriptor_t asn_DEF_PDU = {
102 "PDU",
103 "PDU",
104 SEQUENCE_free,
105 SEQUENCE_print,
106 SEQUENCE_constraint,
107 SEQUENCE_decode_ber,
108 SEQUENCE_encode_der,
109 SEQUENCE_decode_xer,
110 SEQUENCE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400111 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinfb953d12007-06-23 20:06:04 +0000112 SEQUENCE_decode_uper,
113 SEQUENCE_encode_uper,
114 0, /* Use generic outmost tag fetcher */
115 asn_DEF_PDU_tags_1,
116 sizeof(asn_DEF_PDU_tags_1)
117 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
118 asn_DEF_PDU_tags_1, /* Same as above */
119 sizeof(asn_DEF_PDU_tags_1)
120 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400121 0, /* No OER visible constraints */
Lev Walkinfb953d12007-06-23 20:06:04 +0000122 0, /* No PER visible constraints */
123 asn_MBR_PDU_1,
Lev Walkin34ff9002007-06-26 23:58:16 +0000124 4, /* Elements count */
Lev Walkinfb953d12007-06-23 20:06:04 +0000125 &asn_SPC_PDU_specs_1 /* Additional specs */
126};
127
Lev Walkin34ff9002007-06-26 23:58:16 +0000128
129/*** <<< INCLUDES [Singleton] >>> ***/
130
131#include <IA5String.h>
132#include <constr_SEQUENCE.h>
133
134/*** <<< TYPE-DECLS [Singleton] >>> ***/
135
136typedef struct Singleton {
137 IA5String_t *opt_z /* DEFAULT z */;
138
139 /* Context for parsing across buffer boundaries */
140 asn_struct_ctx_t _asn_ctx;
141} Singleton_t;
142
143/*** <<< FUNC-DECLS [Singleton] >>> ***/
144
145extern asn_TYPE_descriptor_t asn_DEF_Singleton;
146
147/*** <<< STAT-DEFS [Singleton] >>> ***/
148
Lev Walkin8032f7a2007-06-27 01:54:57 +0000149static int asn_DFL_2_set(int set_value, void **sptr) {
150 static uint8_t defv[] = "z";
151 IA5String_t *st = *sptr;
152
153 if(!st) {
154 if(!set_value) return -1; /* Not a default value */
155 st = (*sptr = CALLOC(1, sizeof(*st)));
156 if(!st) return -1;
157 }
158
159 if(set_value) {
160 uint8_t *ptr = MALLOC(sizeof(defv));
161 if(!ptr) return -1;
162 memcpy(ptr, &defv, sizeof(defv));
163 FREEMEM(st->buf);
164 st->buf = ptr;
165 st->size = sizeof(defv) - 1;
166 return 0;
167 } else {
168 if(st->size != (sizeof(defv) - 1)
169 || memcmp(st->buf, &defv, sizeof(defv) - 1))
170 return 0;
171 return 1;
172 }
173
174}
Lev Walkin34ff9002007-06-26 23:58:16 +0000175static asn_TYPE_member_t asn_MBR_Singleton_1[] = {
176 { ATF_POINTER, 1, offsetof(struct Singleton, opt_z),
177 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
178 .tag_mode = -1, /* IMPLICIT tag at current level */
179 .type = &asn_DEF_IA5String,
180 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400181 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +0000182 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin8032f7a2007-06-27 01:54:57 +0000183 .default_value = asn_DFL_2_set, /* DEFAULT "z" */
Lev Walkin34ff9002007-06-26 23:58:16 +0000184 .name = "opt-z"
185 },
186};
Lev Walkina7591b52014-10-12 18:37:35 -0700187static const int asn_MAP_Singleton_oms_1[] = { 0 };
188static const ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000189 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
190};
Lev Walkina7591b52014-10-12 18:37:35 -0700191static const asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700192 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z */
Lev Walkin34ff9002007-06-26 23:58:16 +0000193};
194static asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
195 sizeof(struct Singleton),
196 offsetof(struct Singleton, _asn_ctx),
197 asn_MAP_Singleton_tag2el_1,
198 1, /* Count of tags in the map */
199 asn_MAP_Singleton_oms_1, /* Optional members */
200 1, 0, /* Root/Additions */
201 -1, /* Start extensions */
202 -1 /* Stop extensions */
203};
204asn_TYPE_descriptor_t asn_DEF_Singleton = {
205 "Singleton",
206 "Singleton",
207 SEQUENCE_free,
208 SEQUENCE_print,
209 SEQUENCE_constraint,
210 SEQUENCE_decode_ber,
211 SEQUENCE_encode_der,
212 SEQUENCE_decode_xer,
213 SEQUENCE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400214 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin34ff9002007-06-26 23:58:16 +0000215 SEQUENCE_decode_uper,
216 SEQUENCE_encode_uper,
217 0, /* Use generic outmost tag fetcher */
218 asn_DEF_Singleton_tags_1,
219 sizeof(asn_DEF_Singleton_tags_1)
220 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
221 asn_DEF_Singleton_tags_1, /* Same as above */
222 sizeof(asn_DEF_Singleton_tags_1)
223 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400224 0, /* No OER visible constraints */
Lev Walkin34ff9002007-06-26 23:58:16 +0000225 0, /* No PER visible constraints */
226 asn_MBR_Singleton_1,
227 1, /* Elements count */
228 &asn_SPC_Singleton_specs_1 /* Additional specs */
229};
230
231
232/*** <<< INCLUDES [PDU-2] >>> ***/
233
Lev Walkin2a744a72013-03-27 01:56:23 -0700234#include <NativeInteger.h>
Lev Walkin34ff9002007-06-26 23:58:16 +0000235#include <constr_CHOICE.h>
236
237/*** <<< DEPS [PDU-2] >>> ***/
238
239typedef enum PDU_2_PR {
240 PDU_2_PR_NOTHING, /* No components present */
Lev Walkind7a68112007-06-29 01:42:04 +0000241 PDU_2_PR_main,
Lev Walkin34ff9002007-06-26 23:58:16 +0000242 /* Extensions may appear below */
Lev Walkind7a68112007-06-29 01:42:04 +0000243 PDU_2_PR_ext1,
244 PDU_2_PR_ext0
Lev Walkin34ff9002007-06-26 23:58:16 +0000245} PDU_2_PR;
246
247/*** <<< TYPE-DECLS [PDU-2] >>> ***/
248
249typedef struct PDU_2 {
250 PDU_2_PR present;
251 union PDU_2_u {
Lev Walkin2a744a72013-03-27 01:56:23 -0700252 long main;
Lev Walkin34ff9002007-06-26 23:58:16 +0000253 /*
254 * This type is extensible,
255 * possible extensions are below.
256 */
Lev Walkin2a744a72013-03-27 01:56:23 -0700257 long ext1;
258 long ext0;
Lev Walkin34ff9002007-06-26 23:58:16 +0000259 } choice;
260
261 /* Context for parsing across buffer boundaries */
262 asn_struct_ctx_t _asn_ctx;
263} PDU_2_t;
264
265/*** <<< FUNC-DECLS [PDU-2] >>> ***/
266
267extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
268
269/*** <<< CTDEFS [PDU-2] >>> ***/
270
Lev Walkin2fce55d2013-03-28 05:00:39 -0700271static asn_per_constraints_t asn_PER_type_PDU_2_constr_1 GCC_NOTUSED = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000272 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
273 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
274 0, 0 /* No PER value map */
275};
276
277/*** <<< STAT-DEFS [PDU-2] >>> ***/
278
279static asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
Lev Walkind7a68112007-06-29 01:42:04 +0000280 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
281 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
Lev Walkin34ff9002007-06-26 23:58:16 +0000282 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700283 .type = &asn_DEF_NativeInteger,
Lev Walkin34ff9002007-06-26 23:58:16 +0000284 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400285 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +0000286 .per_constraints = 0, /* No PER visible constraints */
287 .default_value = 0,
Lev Walkind7a68112007-06-29 01:42:04 +0000288 .name = "main"
289 },
290 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
291 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
292 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700293 .type = &asn_DEF_NativeInteger,
Lev Walkind7a68112007-06-29 01:42:04 +0000294 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400295 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkind7a68112007-06-29 01:42:04 +0000296 .per_constraints = 0, /* No PER visible constraints */
297 .default_value = 0,
298 .name = "ext1"
299 },
300 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
301 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
302 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700303 .type = &asn_DEF_NativeInteger,
Lev Walkind7a68112007-06-29 01:42:04 +0000304 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400305 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkind7a68112007-06-29 01:42:04 +0000306 .per_constraints = 0, /* No PER visible constraints */
307 .default_value = 0,
308 .name = "ext0"
Lev Walkin34ff9002007-06-26 23:58:16 +0000309 },
310};
Lev Walkina7591b52014-10-12 18:37:35 -0700311static const int asn_MAP_PDU_2_cmap_1[] = { 0, 2, 1 };
312static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700313 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 */
314 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 */
315 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main */
Lev Walkin34ff9002007-06-26 23:58:16 +0000316};
317static asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
318 sizeof(struct PDU_2),
319 offsetof(struct PDU_2, _asn_ctx),
320 offsetof(struct PDU_2, present),
321 sizeof(((struct PDU_2 *)0)->present),
322 asn_MAP_PDU_2_tag2el_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000323 3, /* Count of tags in the map */
324 .canonical_order = asn_MAP_PDU_2_cmap_1, /* Canonically sorted */
Lev Walkin34ff9002007-06-26 23:58:16 +0000325 .ext_start = 1 /* Extensions start */
326};
327asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
328 "PDU-2",
329 "PDU-2",
330 CHOICE_free,
331 CHOICE_print,
332 CHOICE_constraint,
333 CHOICE_decode_ber,
334 CHOICE_encode_der,
335 CHOICE_decode_xer,
336 CHOICE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400337 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin34ff9002007-06-26 23:58:16 +0000338 CHOICE_decode_uper,
339 CHOICE_encode_uper,
340 CHOICE_outmost_tag,
341 0, /* No effective tags (pointer) */
342 0, /* No effective tags (count) */
343 0, /* No tags (pointer) */
344 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400345 0, /* No OER visible constraints */
Lev Walkin34ff9002007-06-26 23:58:16 +0000346 &asn_PER_type_PDU_2_constr_1,
347 asn_MBR_PDU_2_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000348 3, /* Elements count */
Lev Walkin34ff9002007-06-26 23:58:16 +0000349 &asn_SPC_PDU_2_specs_1 /* Additional specs */
350};
351