blob: 14906691e43ce510403ee95c840fb21c4f7bd6da [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,
Lev Walkin67a30122017-08-10 05:48:54 -070044 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070045 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070046 0, 0, /* No default value */
Lev Walkinfb953d12007-06-23 20:06:04 +000047 .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,
Lev Walkin67a30122017-08-10 05:48:54 -070053 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070054 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070055 0, 0, /* No default value */
Lev Walkinfb953d12007-06-23 20:06:04 +000056 .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,
Lev Walkin67a30122017-08-10 05:48:54 -070062 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070063 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070064 0, 0, /* No default value */
Lev Walkin34ff9002007-06-26 23:58:16 +000065 .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,
Lev Walkin67a30122017-08-10 05:48:54 -070071 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070072 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070073 0, 0, /* No default value */
Lev Walkin34ff9002007-06-26 23:58:16 +000074 .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),
Lev Walkine3917082017-08-23 10:29:38 -070090 .tag2el = asn_MAP_PDU_tag2el_1,
91 .tag2el_count = 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",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800100 &asn_OP_SEQUENCE,
Lev Walkinfb953d12007-06-23 20:06:04 +0000101 asn_DEF_PDU_tags_1,
102 sizeof(asn_DEF_PDU_tags_1)
103 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
104 asn_DEF_PDU_tags_1, /* Same as above */
105 sizeof(asn_DEF_PDU_tags_1)
106 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700107 { 0, 0, SEQUENCE_constraint },
Lev Walkinfb953d12007-06-23 20:06:04 +0000108 asn_MBR_PDU_1,
Lev Walkin34ff9002007-06-26 23:58:16 +0000109 4, /* Elements count */
Lev Walkinfb953d12007-06-23 20:06:04 +0000110 &asn_SPC_PDU_specs_1 /* Additional specs */
111};
112
Lev Walkin34ff9002007-06-26 23:58:16 +0000113
114/*** <<< INCLUDES [Singleton] >>> ***/
115
116#include <IA5String.h>
117#include <constr_SEQUENCE.h>
118
119/*** <<< TYPE-DECLS [Singleton] >>> ***/
120
121typedef struct Singleton {
122 IA5String_t *opt_z /* DEFAULT z */;
123
124 /* Context for parsing across buffer boundaries */
125 asn_struct_ctx_t _asn_ctx;
126} Singleton_t;
127
128/*** <<< FUNC-DECLS [Singleton] >>> ***/
129
130extern asn_TYPE_descriptor_t asn_DEF_Singleton;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800131extern asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1;
132extern asn_TYPE_member_t asn_MBR_Singleton_1[1];
Lev Walkin34ff9002007-06-26 23:58:16 +0000133
134/*** <<< STAT-DEFS [Singleton] >>> ***/
135
Lev Walkin20696a42017-10-17 21:27:33 -0700136static int asn_DFL_2_cmp(const void *sptr) {
Lev Walkinb37ee632017-10-18 16:52:18 -0700137 static const uint8_t defv[] = "z";
Lev Walkin20696a42017-10-17 21:27:33 -0700138 const IA5String_t *st = sptr;
Lev Walkin8032f7a2007-06-27 01:54:57 +0000139
140 if(!st) {
Lev Walkin20696a42017-10-17 21:27:33 -0700141 return -1; /* No value is not a default value */
Lev Walkin8032f7a2007-06-27 01:54:57 +0000142 }
143
Lev Walkin20696a42017-10-17 21:27:33 -0700144 if(st->size == (sizeof(defv) - 1)
145 && memcmp(st->buf, &defv, sizeof(defv) - 1) == 0)
Lev Walkin8032f7a2007-06-27 01:54:57 +0000146 return 0;
Lev Walkin20696a42017-10-17 21:27:33 -0700147 return 1;
148}
149static int asn_DFL_2_set(void **sptr) {
Lev Walkinb37ee632017-10-18 16:52:18 -0700150 static const uint8_t defv[] = "z";
Lev Walkin20696a42017-10-17 21:27:33 -0700151 IA5String_t *st = *sptr;
152 uint8_t *nstr = MALLOC(sizeof(defv));
Lev Walkin8032f7a2007-06-27 01:54:57 +0000153
Lev Walkin20696a42017-10-17 21:27:33 -0700154 if(!nstr) return -1;
155 memcpy(nstr, defv, sizeof(defv));
156
Lev Walkinb37ee632017-10-18 16:52:18 -0700157 if(st) {
Lev Walkin20696a42017-10-17 21:27:33 -0700158 FREEMEM(st->buf);
159 } else {
160 st = (*sptr = CALLOC(1, sizeof(*st)));
Lev Walkinb37ee632017-10-18 16:52:18 -0700161 if(!st) { FREEMEM(nstr); return -1; }
Lev Walkin20696a42017-10-17 21:27:33 -0700162 }
163 st->buf = nstr;
164 st->size = sizeof(defv) - 1;
165
166 return 0;
Lev Walkin8032f7a2007-06-27 01:54:57 +0000167}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800168asn_TYPE_member_t asn_MBR_Singleton_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000169 { ATF_POINTER, 1, offsetof(struct Singleton, opt_z),
170 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
171 .tag_mode = -1, /* IMPLICIT tag at current level */
172 .type = &asn_DEF_IA5String,
Lev Walkin67a30122017-08-10 05:48:54 -0700173 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700174 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkinb37ee632017-10-18 16:52:18 -0700175 .default_value_cmp = &asn_DFL_2_cmp, /* Compare DEFAULT "z" */
176 .default_value_set = &asn_DFL_2_set, /* 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};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800187asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000188 sizeof(struct Singleton),
189 offsetof(struct Singleton, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700190 .tag2el = asn_MAP_Singleton_tag2el_1,
191 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkin34ff9002007-06-26 23:58:16 +0000192 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",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800200 &asn_OP_SEQUENCE,
Lev Walkin34ff9002007-06-26 23:58:16 +0000201 asn_DEF_Singleton_tags_1,
202 sizeof(asn_DEF_Singleton_tags_1)
203 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
204 asn_DEF_Singleton_tags_1, /* Same as above */
205 sizeof(asn_DEF_Singleton_tags_1)
206 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700207 { 0, 0, SEQUENCE_constraint },
Lev Walkin34ff9002007-06-26 23:58:16 +0000208 asn_MBR_Singleton_1,
209 1, /* Elements count */
210 &asn_SPC_Singleton_specs_1 /* Additional specs */
211};
212
213
214/*** <<< INCLUDES [PDU-2] >>> ***/
215
Lev Walkin2a744a72013-03-27 01:56:23 -0700216#include <NativeInteger.h>
Lev Walkin34ff9002007-06-26 23:58:16 +0000217#include <constr_CHOICE.h>
218
219/*** <<< DEPS [PDU-2] >>> ***/
220
221typedef enum PDU_2_PR {
222 PDU_2_PR_NOTHING, /* No components present */
Lev Walkind7a68112007-06-29 01:42:04 +0000223 PDU_2_PR_main,
Lev Walkin34ff9002007-06-26 23:58:16 +0000224 /* Extensions may appear below */
Lev Walkind7a68112007-06-29 01:42:04 +0000225 PDU_2_PR_ext1,
226 PDU_2_PR_ext0
Lev Walkin34ff9002007-06-26 23:58:16 +0000227} PDU_2_PR;
228
229/*** <<< TYPE-DECLS [PDU-2] >>> ***/
230
231typedef struct PDU_2 {
232 PDU_2_PR present;
233 union PDU_2_u {
Lev Walkin2a744a72013-03-27 01:56:23 -0700234 long main;
Lev Walkin34ff9002007-06-26 23:58:16 +0000235 /*
236 * This type is extensible,
237 * possible extensions are below.
238 */
Lev Walkin2a744a72013-03-27 01:56:23 -0700239 long ext1;
240 long ext0;
Lev Walkin34ff9002007-06-26 23:58:16 +0000241 } choice;
242
243 /* Context for parsing across buffer boundaries */
244 asn_struct_ctx_t _asn_ctx;
245} PDU_2_t;
246
247/*** <<< FUNC-DECLS [PDU-2] >>> ***/
248
249extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800250extern asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1;
251extern asn_TYPE_member_t asn_MBR_PDU_2_1[3];
252extern asn_per_constraints_t asn_PER_type_PDU_2_constr_1;
Lev Walkin34ff9002007-06-26 23:58:16 +0000253
254/*** <<< CTDEFS [PDU-2] >>> ***/
255
Lev Walkin0479e042017-09-26 18:39:58 -0700256asn_per_constraints_t asn_PER_type_PDU_2_constr_1 CC_NOTUSED = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000257 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
258 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
259 0, 0 /* No PER value map */
260};
261
262/*** <<< STAT-DEFS [PDU-2] >>> ***/
263
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800264asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
Lev Walkind7a68112007-06-29 01:42:04 +0000265 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
266 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
Lev Walkin34ff9002007-06-26 23:58:16 +0000267 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700268 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700269 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700270 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700271 0, 0, /* No default value */
Lev Walkind7a68112007-06-29 01:42:04 +0000272 .name = "main"
273 },
274 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
275 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
276 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700277 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700278 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700279 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700280 0, 0, /* No default value */
Lev Walkind7a68112007-06-29 01:42:04 +0000281 .name = "ext1"
282 },
283 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
284 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
285 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700286 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700287 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700288 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700289 0, 0, /* No default value */
Lev Walkind7a68112007-06-29 01:42:04 +0000290 .name = "ext0"
Lev Walkin34ff9002007-06-26 23:58:16 +0000291 },
292};
Lev Walkin20696a42017-10-17 21:27:33 -0700293static const unsigned asn_MAP_PDU_2_to_canonical_1[] = { 0, 2, 1 };
294static const unsigned asn_MAP_PDU_2_from_canonical_1[] = { 0, 2, 1 };
Lev Walkina7591b52014-10-12 18:37:35 -0700295static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700296 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 */
297 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 */
298 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main */
Lev Walkin34ff9002007-06-26 23:58:16 +0000299};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800300asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000301 sizeof(struct PDU_2),
302 offsetof(struct PDU_2, _asn_ctx),
303 offsetof(struct PDU_2, present),
304 sizeof(((struct PDU_2 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700305 .tag2el = asn_MAP_PDU_2_tag2el_1,
306 .tag2el_count = 3, /* Count of tags in the map */
Lev Walkin20696a42017-10-17 21:27:33 -0700307 .to_canonical_order = asn_MAP_PDU_2_to_canonical_1,
308 .from_canonical_order = asn_MAP_PDU_2_from_canonical_1,
Lev Walkin34ff9002007-06-26 23:58:16 +0000309 .ext_start = 1 /* Extensions start */
310};
311asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
312 "PDU-2",
313 "PDU-2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800314 &asn_OP_CHOICE,
Lev Walkin34ff9002007-06-26 23:58:16 +0000315 0, /* No effective tags (pointer) */
316 0, /* No effective tags (count) */
317 0, /* No tags (pointer) */
318 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700319 { 0, &asn_PER_type_PDU_2_constr_1, CHOICE_constraint },
Lev Walkin34ff9002007-06-26 23:58:16 +0000320 asn_MBR_PDU_2_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000321 3, /* Elements count */
Lev Walkin34ff9002007-06-26 23:58:16 +0000322 &asn_SPC_PDU_2_specs_1 /* Additional specs */
323};
324