blob: ad0ac8eaf4be9104afd97ae69c090c3ff1c12b93 [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;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800146extern asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1;
147extern asn_TYPE_member_t asn_MBR_Singleton_1[1];
Lev Walkin34ff9002007-06-26 23:58:16 +0000148
149/*** <<< STAT-DEFS [Singleton] >>> ***/
150
Lev Walkin8032f7a2007-06-27 01:54:57 +0000151static int asn_DFL_2_set(int set_value, void **sptr) {
152 static uint8_t defv[] = "z";
153 IA5String_t *st = *sptr;
154
155 if(!st) {
156 if(!set_value) return -1; /* Not a default value */
157 st = (*sptr = CALLOC(1, sizeof(*st)));
158 if(!st) return -1;
159 }
160
161 if(set_value) {
162 uint8_t *ptr = MALLOC(sizeof(defv));
163 if(!ptr) return -1;
164 memcpy(ptr, &defv, sizeof(defv));
165 FREEMEM(st->buf);
166 st->buf = ptr;
167 st->size = sizeof(defv) - 1;
168 return 0;
169 } else {
170 if(st->size != (sizeof(defv) - 1)
171 || memcmp(st->buf, &defv, sizeof(defv) - 1))
172 return 0;
173 return 1;
174 }
175
176}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800177asn_TYPE_member_t asn_MBR_Singleton_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000178 { ATF_POINTER, 1, offsetof(struct Singleton, opt_z),
179 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
180 .tag_mode = -1, /* IMPLICIT tag at current level */
181 .type = &asn_DEF_IA5String,
182 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400183 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +0000184 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin8032f7a2007-06-27 01:54:57 +0000185 .default_value = asn_DFL_2_set, /* DEFAULT "z" */
Lev Walkin34ff9002007-06-26 23:58:16 +0000186 .name = "opt-z"
187 },
188};
Lev Walkina7591b52014-10-12 18:37:35 -0700189static const int asn_MAP_Singleton_oms_1[] = { 0 };
190static const ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000191 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
192};
Lev Walkina7591b52014-10-12 18:37:35 -0700193static const asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700194 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z */
Lev Walkin34ff9002007-06-26 23:58:16 +0000195};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800196asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000197 sizeof(struct Singleton),
198 offsetof(struct Singleton, _asn_ctx),
199 asn_MAP_Singleton_tag2el_1,
200 1, /* Count of tags in the map */
201 asn_MAP_Singleton_oms_1, /* Optional members */
202 1, 0, /* Root/Additions */
203 -1, /* Start extensions */
204 -1 /* Stop extensions */
205};
206asn_TYPE_descriptor_t asn_DEF_Singleton = {
207 "Singleton",
208 "Singleton",
209 SEQUENCE_free,
210 SEQUENCE_print,
211 SEQUENCE_constraint,
212 SEQUENCE_decode_ber,
213 SEQUENCE_encode_der,
214 SEQUENCE_decode_xer,
215 SEQUENCE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400216 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin34ff9002007-06-26 23:58:16 +0000217 SEQUENCE_decode_uper,
218 SEQUENCE_encode_uper,
219 0, /* Use generic outmost tag fetcher */
220 asn_DEF_Singleton_tags_1,
221 sizeof(asn_DEF_Singleton_tags_1)
222 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
223 asn_DEF_Singleton_tags_1, /* Same as above */
224 sizeof(asn_DEF_Singleton_tags_1)
225 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400226 0, /* No OER visible constraints */
Lev Walkin34ff9002007-06-26 23:58:16 +0000227 0, /* No PER visible constraints */
228 asn_MBR_Singleton_1,
229 1, /* Elements count */
230 &asn_SPC_Singleton_specs_1 /* Additional specs */
231};
232
233
234/*** <<< INCLUDES [PDU-2] >>> ***/
235
Lev Walkin2a744a72013-03-27 01:56:23 -0700236#include <NativeInteger.h>
Lev Walkin34ff9002007-06-26 23:58:16 +0000237#include <constr_CHOICE.h>
238
239/*** <<< DEPS [PDU-2] >>> ***/
240
241typedef enum PDU_2_PR {
242 PDU_2_PR_NOTHING, /* No components present */
Lev Walkind7a68112007-06-29 01:42:04 +0000243 PDU_2_PR_main,
Lev Walkin34ff9002007-06-26 23:58:16 +0000244 /* Extensions may appear below */
Lev Walkind7a68112007-06-29 01:42:04 +0000245 PDU_2_PR_ext1,
246 PDU_2_PR_ext0
Lev Walkin34ff9002007-06-26 23:58:16 +0000247} PDU_2_PR;
248
249/*** <<< TYPE-DECLS [PDU-2] >>> ***/
250
251typedef struct PDU_2 {
252 PDU_2_PR present;
253 union PDU_2_u {
Lev Walkin2a744a72013-03-27 01:56:23 -0700254 long main;
Lev Walkin34ff9002007-06-26 23:58:16 +0000255 /*
256 * This type is extensible,
257 * possible extensions are below.
258 */
Lev Walkin2a744a72013-03-27 01:56:23 -0700259 long ext1;
260 long ext0;
Lev Walkin34ff9002007-06-26 23:58:16 +0000261 } choice;
262
263 /* Context for parsing across buffer boundaries */
264 asn_struct_ctx_t _asn_ctx;
265} PDU_2_t;
266
267/*** <<< FUNC-DECLS [PDU-2] >>> ***/
268
269extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800270extern asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1;
271extern asn_TYPE_member_t asn_MBR_PDU_2_1[3];
272extern asn_per_constraints_t asn_PER_type_PDU_2_constr_1;
Lev Walkin34ff9002007-06-26 23:58:16 +0000273
274/*** <<< CTDEFS [PDU-2] >>> ***/
275
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800276asn_per_constraints_t asn_PER_type_PDU_2_constr_1 GCC_NOTUSED = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000277 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
278 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
279 0, 0 /* No PER value map */
280};
281
282/*** <<< STAT-DEFS [PDU-2] >>> ***/
283
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800284asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
Lev Walkind7a68112007-06-29 01:42:04 +0000285 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
286 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
Lev Walkin34ff9002007-06-26 23:58:16 +0000287 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700288 .type = &asn_DEF_NativeInteger,
Lev Walkin34ff9002007-06-26 23:58:16 +0000289 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400290 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +0000291 .per_constraints = 0, /* No PER visible constraints */
292 .default_value = 0,
Lev Walkind7a68112007-06-29 01:42:04 +0000293 .name = "main"
294 },
295 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
296 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
297 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700298 .type = &asn_DEF_NativeInteger,
Lev Walkind7a68112007-06-29 01:42:04 +0000299 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400300 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkind7a68112007-06-29 01:42:04 +0000301 .per_constraints = 0, /* No PER visible constraints */
302 .default_value = 0,
303 .name = "ext1"
304 },
305 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
306 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
307 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700308 .type = &asn_DEF_NativeInteger,
Lev Walkind7a68112007-06-29 01:42:04 +0000309 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400310 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkind7a68112007-06-29 01:42:04 +0000311 .per_constraints = 0, /* No PER visible constraints */
312 .default_value = 0,
313 .name = "ext0"
Lev Walkin34ff9002007-06-26 23:58:16 +0000314 },
315};
Lev Walkina7591b52014-10-12 18:37:35 -0700316static const int asn_MAP_PDU_2_cmap_1[] = { 0, 2, 1 };
317static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700318 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 */
319 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 */
320 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main */
Lev Walkin34ff9002007-06-26 23:58:16 +0000321};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800322asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000323 sizeof(struct PDU_2),
324 offsetof(struct PDU_2, _asn_ctx),
325 offsetof(struct PDU_2, present),
326 sizeof(((struct PDU_2 *)0)->present),
327 asn_MAP_PDU_2_tag2el_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000328 3, /* Count of tags in the map */
329 .canonical_order = asn_MAP_PDU_2_cmap_1, /* Canonically sorted */
Lev Walkin34ff9002007-06-26 23:58:16 +0000330 .ext_start = 1 /* Extensions start */
331};
332asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
333 "PDU-2",
334 "PDU-2",
335 CHOICE_free,
336 CHOICE_print,
337 CHOICE_constraint,
338 CHOICE_decode_ber,
339 CHOICE_encode_der,
340 CHOICE_decode_xer,
341 CHOICE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400342 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin34ff9002007-06-26 23:58:16 +0000343 CHOICE_decode_uper,
344 CHOICE_encode_uper,
345 CHOICE_outmost_tag,
346 0, /* No effective tags (pointer) */
347 0, /* No effective tags (count) */
348 0, /* No tags (pointer) */
349 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400350 0, /* No OER visible constraints */
Lev Walkin34ff9002007-06-26 23:58:16 +0000351 &asn_PER_type_PDU_2_constr_1,
352 asn_MBR_PDU_2_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000353 3, /* Elements count */
Lev Walkin34ff9002007-06-26 23:58:16 +0000354 &asn_SPC_PDU_2_specs_1 /* Additional specs */
355};
356