blob: 287a47dd2dc9dfa7dd45c76ffd1cc31d3e4f68d5 [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,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700106 SEQUENCE_compare,
Lev Walkinfb953d12007-06-23 20:06:04 +0000107 SEQUENCE_constraint,
108 SEQUENCE_decode_ber,
109 SEQUENCE_encode_der,
110 SEQUENCE_decode_xer,
111 SEQUENCE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400112 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinfb953d12007-06-23 20:06:04 +0000113 SEQUENCE_decode_uper,
114 SEQUENCE_encode_uper,
115 0, /* Use generic outmost tag fetcher */
116 asn_DEF_PDU_tags_1,
117 sizeof(asn_DEF_PDU_tags_1)
118 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
119 asn_DEF_PDU_tags_1, /* Same as above */
120 sizeof(asn_DEF_PDU_tags_1)
121 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400122 0, /* No OER visible constraints */
Lev Walkinfb953d12007-06-23 20:06:04 +0000123 0, /* No PER visible constraints */
124 asn_MBR_PDU_1,
Lev Walkin34ff9002007-06-26 23:58:16 +0000125 4, /* Elements count */
Lev Walkinfb953d12007-06-23 20:06:04 +0000126 &asn_SPC_PDU_specs_1 /* Additional specs */
127};
128
Lev Walkin34ff9002007-06-26 23:58:16 +0000129
130/*** <<< INCLUDES [Singleton] >>> ***/
131
132#include <IA5String.h>
133#include <constr_SEQUENCE.h>
134
135/*** <<< TYPE-DECLS [Singleton] >>> ***/
136
137typedef struct Singleton {
138 IA5String_t *opt_z /* DEFAULT z */;
139
140 /* Context for parsing across buffer boundaries */
141 asn_struct_ctx_t _asn_ctx;
142} Singleton_t;
143
144/*** <<< FUNC-DECLS [Singleton] >>> ***/
145
146extern asn_TYPE_descriptor_t asn_DEF_Singleton;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800147extern asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1;
148extern asn_TYPE_member_t asn_MBR_Singleton_1[1];
Lev Walkin34ff9002007-06-26 23:58:16 +0000149
150/*** <<< STAT-DEFS [Singleton] >>> ***/
151
Lev Walkin8032f7a2007-06-27 01:54:57 +0000152static int asn_DFL_2_set(int set_value, void **sptr) {
153 static uint8_t defv[] = "z";
154 IA5String_t *st = *sptr;
155
156 if(!st) {
157 if(!set_value) return -1; /* Not a default value */
158 st = (*sptr = CALLOC(1, sizeof(*st)));
159 if(!st) return -1;
160 }
161
162 if(set_value) {
163 uint8_t *ptr = MALLOC(sizeof(defv));
164 if(!ptr) return -1;
165 memcpy(ptr, &defv, sizeof(defv));
166 FREEMEM(st->buf);
167 st->buf = ptr;
168 st->size = sizeof(defv) - 1;
169 return 0;
170 } else {
171 if(st->size != (sizeof(defv) - 1)
172 || memcmp(st->buf, &defv, sizeof(defv) - 1))
173 return 0;
174 return 1;
175 }
176
177}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800178asn_TYPE_member_t asn_MBR_Singleton_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000179 { ATF_POINTER, 1, offsetof(struct Singleton, opt_z),
180 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
181 .tag_mode = -1, /* IMPLICIT tag at current level */
182 .type = &asn_DEF_IA5String,
183 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400184 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +0000185 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin8032f7a2007-06-27 01:54:57 +0000186 .default_value = asn_DFL_2_set, /* DEFAULT "z" */
Lev Walkin34ff9002007-06-26 23:58:16 +0000187 .name = "opt-z"
188 },
189};
Lev Walkina7591b52014-10-12 18:37:35 -0700190static const int asn_MAP_Singleton_oms_1[] = { 0 };
191static const ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000192 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
193};
Lev Walkina7591b52014-10-12 18:37:35 -0700194static const asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700195 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z */
Lev Walkin34ff9002007-06-26 23:58:16 +0000196};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800197asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000198 sizeof(struct Singleton),
199 offsetof(struct Singleton, _asn_ctx),
200 asn_MAP_Singleton_tag2el_1,
201 1, /* Count of tags in the map */
202 asn_MAP_Singleton_oms_1, /* Optional members */
203 1, 0, /* Root/Additions */
204 -1, /* Start extensions */
205 -1 /* Stop extensions */
206};
207asn_TYPE_descriptor_t asn_DEF_Singleton = {
208 "Singleton",
209 "Singleton",
210 SEQUENCE_free,
211 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700212 SEQUENCE_compare,
Lev Walkin34ff9002007-06-26 23:58:16 +0000213 SEQUENCE_constraint,
214 SEQUENCE_decode_ber,
215 SEQUENCE_encode_der,
216 SEQUENCE_decode_xer,
217 SEQUENCE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400218 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin34ff9002007-06-26 23:58:16 +0000219 SEQUENCE_decode_uper,
220 SEQUENCE_encode_uper,
221 0, /* Use generic outmost tag fetcher */
222 asn_DEF_Singleton_tags_1,
223 sizeof(asn_DEF_Singleton_tags_1)
224 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
225 asn_DEF_Singleton_tags_1, /* Same as above */
226 sizeof(asn_DEF_Singleton_tags_1)
227 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400228 0, /* No OER visible constraints */
Lev Walkin34ff9002007-06-26 23:58:16 +0000229 0, /* No PER visible constraints */
230 asn_MBR_Singleton_1,
231 1, /* Elements count */
232 &asn_SPC_Singleton_specs_1 /* Additional specs */
233};
234
235
236/*** <<< INCLUDES [PDU-2] >>> ***/
237
Lev Walkin2a744a72013-03-27 01:56:23 -0700238#include <NativeInteger.h>
Lev Walkin34ff9002007-06-26 23:58:16 +0000239#include <constr_CHOICE.h>
240
241/*** <<< DEPS [PDU-2] >>> ***/
242
243typedef enum PDU_2_PR {
244 PDU_2_PR_NOTHING, /* No components present */
Lev Walkind7a68112007-06-29 01:42:04 +0000245 PDU_2_PR_main,
Lev Walkin34ff9002007-06-26 23:58:16 +0000246 /* Extensions may appear below */
Lev Walkind7a68112007-06-29 01:42:04 +0000247 PDU_2_PR_ext1,
248 PDU_2_PR_ext0
Lev Walkin34ff9002007-06-26 23:58:16 +0000249} PDU_2_PR;
250
251/*** <<< TYPE-DECLS [PDU-2] >>> ***/
252
253typedef struct PDU_2 {
254 PDU_2_PR present;
255 union PDU_2_u {
Lev Walkin2a744a72013-03-27 01:56:23 -0700256 long main;
Lev Walkin34ff9002007-06-26 23:58:16 +0000257 /*
258 * This type is extensible,
259 * possible extensions are below.
260 */
Lev Walkin2a744a72013-03-27 01:56:23 -0700261 long ext1;
262 long ext0;
Lev Walkin34ff9002007-06-26 23:58:16 +0000263 } choice;
264
265 /* Context for parsing across buffer boundaries */
266 asn_struct_ctx_t _asn_ctx;
267} PDU_2_t;
268
269/*** <<< FUNC-DECLS [PDU-2] >>> ***/
270
271extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800272extern asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1;
273extern asn_TYPE_member_t asn_MBR_PDU_2_1[3];
274extern asn_per_constraints_t asn_PER_type_PDU_2_constr_1;
Lev Walkin34ff9002007-06-26 23:58:16 +0000275
276/*** <<< CTDEFS [PDU-2] >>> ***/
277
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800278asn_per_constraints_t asn_PER_type_PDU_2_constr_1 GCC_NOTUSED = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000279 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
280 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
281 0, 0 /* No PER value map */
282};
283
284/*** <<< STAT-DEFS [PDU-2] >>> ***/
285
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800286asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
Lev Walkind7a68112007-06-29 01:42:04 +0000287 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
288 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
Lev Walkin34ff9002007-06-26 23:58:16 +0000289 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700290 .type = &asn_DEF_NativeInteger,
Lev Walkin34ff9002007-06-26 23:58:16 +0000291 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400292 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +0000293 .per_constraints = 0, /* No PER visible constraints */
294 .default_value = 0,
Lev Walkind7a68112007-06-29 01:42:04 +0000295 .name = "main"
296 },
297 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
298 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
299 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700300 .type = &asn_DEF_NativeInteger,
Lev Walkind7a68112007-06-29 01:42:04 +0000301 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400302 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkind7a68112007-06-29 01:42:04 +0000303 .per_constraints = 0, /* No PER visible constraints */
304 .default_value = 0,
305 .name = "ext1"
306 },
307 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
308 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
309 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700310 .type = &asn_DEF_NativeInteger,
Lev Walkind7a68112007-06-29 01:42:04 +0000311 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400312 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkind7a68112007-06-29 01:42:04 +0000313 .per_constraints = 0, /* No PER visible constraints */
314 .default_value = 0,
315 .name = "ext0"
Lev Walkin34ff9002007-06-26 23:58:16 +0000316 },
317};
Lev Walkina7591b52014-10-12 18:37:35 -0700318static const int asn_MAP_PDU_2_cmap_1[] = { 0, 2, 1 };
319static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700320 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 */
321 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 */
322 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main */
Lev Walkin34ff9002007-06-26 23:58:16 +0000323};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800324asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000325 sizeof(struct PDU_2),
326 offsetof(struct PDU_2, _asn_ctx),
327 offsetof(struct PDU_2, present),
328 sizeof(((struct PDU_2 *)0)->present),
329 asn_MAP_PDU_2_tag2el_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000330 3, /* Count of tags in the map */
331 .canonical_order = asn_MAP_PDU_2_cmap_1, /* Canonically sorted */
Lev Walkin34ff9002007-06-26 23:58:16 +0000332 .ext_start = 1 /* Extensions start */
333};
334asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
335 "PDU-2",
336 "PDU-2",
337 CHOICE_free,
338 CHOICE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700339 CHOICE_compare,
Lev Walkin34ff9002007-06-26 23:58:16 +0000340 CHOICE_constraint,
341 CHOICE_decode_ber,
342 CHOICE_encode_der,
343 CHOICE_decode_xer,
344 CHOICE_encode_xer,
Lev Walkinb33425f2017-07-14 14:59:52 +0400345 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin34ff9002007-06-26 23:58:16 +0000346 CHOICE_decode_uper,
347 CHOICE_encode_uper,
348 CHOICE_outmost_tag,
349 0, /* No effective tags (pointer) */
350 0, /* No effective tags (count) */
351 0, /* No tags (pointer) */
352 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400353 0, /* No OER visible constraints */
Lev Walkin34ff9002007-06-26 23:58:16 +0000354 &asn_PER_type_PDU_2_constr_1,
355 asn_MBR_PDU_2_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000356 3, /* Elements count */
Lev Walkin34ff9002007-06-26 23:58:16 +0000357 &asn_SPC_PDU_2_specs_1 /* Additional specs */
358};
359