blob: e5bf8c6e30ba2da9562b7b192a8a0b73ba02c6a6 [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 Walkindf2edbb2017-10-21 13:40:07 -070094 0, /* First extension addition */
Lev Walkinfb953d12007-06-23 20:06:04 +000095};
96asn_TYPE_descriptor_t asn_DEF_PDU = {
97 "PDU",
98 "PDU",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +080099 &asn_OP_SEQUENCE,
Lev Walkinfb953d12007-06-23 20:06:04 +0000100 asn_DEF_PDU_tags_1,
101 sizeof(asn_DEF_PDU_tags_1)
102 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
103 asn_DEF_PDU_tags_1, /* Same as above */
104 sizeof(asn_DEF_PDU_tags_1)
105 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700106 { 0, 0, SEQUENCE_constraint },
Lev Walkinfb953d12007-06-23 20:06:04 +0000107 asn_MBR_PDU_1,
Lev Walkin34ff9002007-06-26 23:58:16 +0000108 4, /* Elements count */
Lev Walkinfb953d12007-06-23 20:06:04 +0000109 &asn_SPC_PDU_specs_1 /* Additional specs */
110};
111
Lev Walkin34ff9002007-06-26 23:58:16 +0000112
113/*** <<< INCLUDES [Singleton] >>> ***/
114
115#include <IA5String.h>
116#include <constr_SEQUENCE.h>
117
118/*** <<< TYPE-DECLS [Singleton] >>> ***/
119
120typedef struct Singleton {
121 IA5String_t *opt_z /* DEFAULT z */;
122
123 /* Context for parsing across buffer boundaries */
124 asn_struct_ctx_t _asn_ctx;
125} Singleton_t;
126
127/*** <<< FUNC-DECLS [Singleton] >>> ***/
128
129extern asn_TYPE_descriptor_t asn_DEF_Singleton;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800130extern asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1;
131extern asn_TYPE_member_t asn_MBR_Singleton_1[1];
Lev Walkin34ff9002007-06-26 23:58:16 +0000132
133/*** <<< STAT-DEFS [Singleton] >>> ***/
134
Lev Walkin20696a42017-10-17 21:27:33 -0700135static int asn_DFL_2_cmp(const void *sptr) {
Lev Walkinb37ee632017-10-18 16:52:18 -0700136 static const uint8_t defv[] = "z";
Lev Walkin20696a42017-10-17 21:27:33 -0700137 const IA5String_t *st = sptr;
Lev Walkin8032f7a2007-06-27 01:54:57 +0000138
139 if(!st) {
Lev Walkin20696a42017-10-17 21:27:33 -0700140 return -1; /* No value is not a default value */
Lev Walkin8032f7a2007-06-27 01:54:57 +0000141 }
142
Lev Walkin20696a42017-10-17 21:27:33 -0700143 if(st->size == (sizeof(defv) - 1)
144 && memcmp(st->buf, &defv, sizeof(defv) - 1) == 0)
Lev Walkin8032f7a2007-06-27 01:54:57 +0000145 return 0;
Lev Walkin20696a42017-10-17 21:27:33 -0700146 return 1;
147}
148static int asn_DFL_2_set(void **sptr) {
Lev Walkinb37ee632017-10-18 16:52:18 -0700149 static const uint8_t defv[] = "z";
Lev Walkin20696a42017-10-17 21:27:33 -0700150 IA5String_t *st = *sptr;
151 uint8_t *nstr = MALLOC(sizeof(defv));
Lev Walkin8032f7a2007-06-27 01:54:57 +0000152
Lev Walkin20696a42017-10-17 21:27:33 -0700153 if(!nstr) return -1;
154 memcpy(nstr, defv, sizeof(defv));
155
Lev Walkinb37ee632017-10-18 16:52:18 -0700156 if(st) {
Lev Walkin20696a42017-10-17 21:27:33 -0700157 FREEMEM(st->buf);
158 } else {
159 st = (*sptr = CALLOC(1, sizeof(*st)));
Lev Walkinb37ee632017-10-18 16:52:18 -0700160 if(!st) { FREEMEM(nstr); return -1; }
Lev Walkin20696a42017-10-17 21:27:33 -0700161 }
162 st->buf = nstr;
163 st->size = sizeof(defv) - 1;
164
165 return 0;
Lev Walkin8032f7a2007-06-27 01:54:57 +0000166}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800167asn_TYPE_member_t asn_MBR_Singleton_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000168 { ATF_POINTER, 1, offsetof(struct Singleton, opt_z),
169 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
170 .tag_mode = -1, /* IMPLICIT tag at current level */
171 .type = &asn_DEF_IA5String,
Lev Walkin67a30122017-08-10 05:48:54 -0700172 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700173 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkinb37ee632017-10-18 16:52:18 -0700174 .default_value_cmp = &asn_DFL_2_cmp, /* Compare DEFAULT "z" */
175 .default_value_set = &asn_DFL_2_set, /* Set DEFAULT "z" */
Lev Walkin34ff9002007-06-26 23:58:16 +0000176 .name = "opt-z"
177 },
178};
Lev Walkina7591b52014-10-12 18:37:35 -0700179static const int asn_MAP_Singleton_oms_1[] = { 0 };
180static const ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000181 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
182};
Lev Walkina7591b52014-10-12 18:37:35 -0700183static const asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700184 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z */
Lev Walkin34ff9002007-06-26 23:58:16 +0000185};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800186asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000187 sizeof(struct Singleton),
188 offsetof(struct Singleton, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700189 .tag2el = asn_MAP_Singleton_tag2el_1,
190 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkin34ff9002007-06-26 23:58:16 +0000191 asn_MAP_Singleton_oms_1, /* Optional members */
192 1, 0, /* Root/Additions */
Lev Walkindf2edbb2017-10-21 13:40:07 -0700193 -1, /* First extension addition */
Lev Walkin34ff9002007-06-26 23:58:16 +0000194};
195asn_TYPE_descriptor_t asn_DEF_Singleton = {
196 "Singleton",
197 "Singleton",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800198 &asn_OP_SEQUENCE,
Lev Walkin34ff9002007-06-26 23:58:16 +0000199 asn_DEF_Singleton_tags_1,
200 sizeof(asn_DEF_Singleton_tags_1)
201 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
202 asn_DEF_Singleton_tags_1, /* Same as above */
203 sizeof(asn_DEF_Singleton_tags_1)
204 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700205 { 0, 0, SEQUENCE_constraint },
Lev Walkin34ff9002007-06-26 23:58:16 +0000206 asn_MBR_Singleton_1,
207 1, /* Elements count */
208 &asn_SPC_Singleton_specs_1 /* Additional specs */
209};
210
211
212/*** <<< INCLUDES [PDU-2] >>> ***/
213
Lev Walkin2a744a72013-03-27 01:56:23 -0700214#include <NativeInteger.h>
Lev Walkin34ff9002007-06-26 23:58:16 +0000215#include <constr_CHOICE.h>
216
217/*** <<< DEPS [PDU-2] >>> ***/
218
219typedef enum PDU_2_PR {
220 PDU_2_PR_NOTHING, /* No components present */
Lev Walkind7a68112007-06-29 01:42:04 +0000221 PDU_2_PR_main,
Lev Walkin34ff9002007-06-26 23:58:16 +0000222 /* Extensions may appear below */
Lev Walkind7a68112007-06-29 01:42:04 +0000223 PDU_2_PR_ext1,
224 PDU_2_PR_ext0
Lev Walkin34ff9002007-06-26 23:58:16 +0000225} PDU_2_PR;
226
227/*** <<< TYPE-DECLS [PDU-2] >>> ***/
228
229typedef struct PDU_2 {
230 PDU_2_PR present;
231 union PDU_2_u {
Lev Walkin2a744a72013-03-27 01:56:23 -0700232 long main;
Lev Walkin34ff9002007-06-26 23:58:16 +0000233 /*
234 * This type is extensible,
235 * possible extensions are below.
236 */
Lev Walkin2a744a72013-03-27 01:56:23 -0700237 long ext1;
238 long ext0;
Lev Walkin34ff9002007-06-26 23:58:16 +0000239 } choice;
240
241 /* Context for parsing across buffer boundaries */
242 asn_struct_ctx_t _asn_ctx;
243} PDU_2_t;
244
245/*** <<< FUNC-DECLS [PDU-2] >>> ***/
246
247extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800248extern asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1;
249extern asn_TYPE_member_t asn_MBR_PDU_2_1[3];
250extern asn_per_constraints_t asn_PER_type_PDU_2_constr_1;
Lev Walkin34ff9002007-06-26 23:58:16 +0000251
252/*** <<< CTDEFS [PDU-2] >>> ***/
253
Lev Walkin0479e042017-09-26 18:39:58 -0700254asn_per_constraints_t asn_PER_type_PDU_2_constr_1 CC_NOTUSED = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000255 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
256 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
257 0, 0 /* No PER value map */
258};
259
260/*** <<< STAT-DEFS [PDU-2] >>> ***/
261
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800262asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
Lev Walkind7a68112007-06-29 01:42:04 +0000263 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
264 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
Lev Walkin34ff9002007-06-26 23:58:16 +0000265 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700266 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700267 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700268 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700269 0, 0, /* No default value */
Lev Walkind7a68112007-06-29 01:42:04 +0000270 .name = "main"
271 },
272 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
273 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
274 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700275 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700276 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700277 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700278 0, 0, /* No default value */
Lev Walkind7a68112007-06-29 01:42:04 +0000279 .name = "ext1"
280 },
281 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
282 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
283 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700284 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700285 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700286 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -0700287 0, 0, /* No default value */
Lev Walkind7a68112007-06-29 01:42:04 +0000288 .name = "ext0"
Lev Walkin34ff9002007-06-26 23:58:16 +0000289 },
290};
Lev Walkin20696a42017-10-17 21:27:33 -0700291static const unsigned asn_MAP_PDU_2_to_canonical_1[] = { 0, 2, 1 };
292static const unsigned asn_MAP_PDU_2_from_canonical_1[] = { 0, 2, 1 };
Lev Walkina7591b52014-10-12 18:37:35 -0700293static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700294 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 */
295 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 */
296 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main */
Lev Walkin34ff9002007-06-26 23:58:16 +0000297};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800298asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000299 sizeof(struct PDU_2),
300 offsetof(struct PDU_2, _asn_ctx),
301 offsetof(struct PDU_2, present),
302 sizeof(((struct PDU_2 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700303 .tag2el = asn_MAP_PDU_2_tag2el_1,
304 .tag2el_count = 3, /* Count of tags in the map */
Lev Walkin20696a42017-10-17 21:27:33 -0700305 .to_canonical_order = asn_MAP_PDU_2_to_canonical_1,
306 .from_canonical_order = asn_MAP_PDU_2_from_canonical_1,
Lev Walkindf2edbb2017-10-21 13:40:07 -0700307 .first_extension = 1 /* Extensions start */
Lev Walkin34ff9002007-06-26 23:58:16 +0000308};
309asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
310 "PDU-2",
311 "PDU-2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800312 &asn_OP_CHOICE,
Lev Walkin34ff9002007-06-26 23:58:16 +0000313 0, /* No effective tags (pointer) */
314 0, /* No effective tags (count) */
315 0, /* No tags (pointer) */
316 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700317 { 0, &asn_PER_type_PDU_2_constr_1, CHOICE_constraint },
Lev Walkin34ff9002007-06-26 23:58:16 +0000318 asn_MBR_PDU_2_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000319 3, /* Elements count */
Lev Walkin34ff9002007-06-26 23:58:16 +0000320 &asn_SPC_PDU_2_specs_1 /* Additional specs */
321};
322