blob: 86dc8f56fd542d08f7362c8240cc87e4a90bbc58 [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 Walkinfb953d12007-06-23 20:06:04 +000046 .default_value = 0,
47 .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 Walkinfb953d12007-06-23 20:06:04 +000055 .default_value = 0,
56 .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 Walkin34ff9002007-06-26 23:58:16 +000064 .default_value = 0,
65 .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 Walkin34ff9002007-06-26 23:58:16 +000073 .default_value = 0,
74 .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 Walkin8032f7a2007-06-27 01:54:57 +0000136static int asn_DFL_2_set(int set_value, void **sptr) {
137 static uint8_t defv[] = "z";
138 IA5String_t *st = *sptr;
139
140 if(!st) {
141 if(!set_value) return -1; /* Not a default value */
142 st = (*sptr = CALLOC(1, sizeof(*st)));
143 if(!st) return -1;
144 }
145
146 if(set_value) {
147 uint8_t *ptr = MALLOC(sizeof(defv));
148 if(!ptr) return -1;
149 memcpy(ptr, &defv, sizeof(defv));
150 FREEMEM(st->buf);
151 st->buf = ptr;
152 st->size = sizeof(defv) - 1;
153 return 0;
154 } else {
155 if(st->size != (sizeof(defv) - 1)
156 || memcmp(st->buf, &defv, sizeof(defv) - 1))
157 return 0;
158 return 1;
159 }
160
161}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800162asn_TYPE_member_t asn_MBR_Singleton_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000163 { ATF_POINTER, 1, offsetof(struct Singleton, opt_z),
164 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
165 .tag_mode = -1, /* IMPLICIT tag at current level */
166 .type = &asn_DEF_IA5String,
Lev Walkin67a30122017-08-10 05:48:54 -0700167 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700168 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin8032f7a2007-06-27 01:54:57 +0000169 .default_value = asn_DFL_2_set, /* DEFAULT "z" */
Lev Walkin34ff9002007-06-26 23:58:16 +0000170 .name = "opt-z"
171 },
172};
Lev Walkina7591b52014-10-12 18:37:35 -0700173static const int asn_MAP_Singleton_oms_1[] = { 0 };
174static const ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000175 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
176};
Lev Walkina7591b52014-10-12 18:37:35 -0700177static const asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700178 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z */
Lev Walkin34ff9002007-06-26 23:58:16 +0000179};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800180asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000181 sizeof(struct Singleton),
182 offsetof(struct Singleton, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700183 .tag2el = asn_MAP_Singleton_tag2el_1,
184 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkin34ff9002007-06-26 23:58:16 +0000185 asn_MAP_Singleton_oms_1, /* Optional members */
186 1, 0, /* Root/Additions */
187 -1, /* Start extensions */
188 -1 /* Stop extensions */
189};
190asn_TYPE_descriptor_t asn_DEF_Singleton = {
191 "Singleton",
192 "Singleton",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800193 &asn_OP_SEQUENCE,
Lev Walkin34ff9002007-06-26 23:58:16 +0000194 asn_DEF_Singleton_tags_1,
195 sizeof(asn_DEF_Singleton_tags_1)
196 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
197 asn_DEF_Singleton_tags_1, /* Same as above */
198 sizeof(asn_DEF_Singleton_tags_1)
199 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700200 { 0, 0, SEQUENCE_constraint },
Lev Walkin34ff9002007-06-26 23:58:16 +0000201 asn_MBR_Singleton_1,
202 1, /* Elements count */
203 &asn_SPC_Singleton_specs_1 /* Additional specs */
204};
205
206
207/*** <<< INCLUDES [PDU-2] >>> ***/
208
Lev Walkin2a744a72013-03-27 01:56:23 -0700209#include <NativeInteger.h>
Lev Walkin34ff9002007-06-26 23:58:16 +0000210#include <constr_CHOICE.h>
211
212/*** <<< DEPS [PDU-2] >>> ***/
213
214typedef enum PDU_2_PR {
215 PDU_2_PR_NOTHING, /* No components present */
Lev Walkind7a68112007-06-29 01:42:04 +0000216 PDU_2_PR_main,
Lev Walkin34ff9002007-06-26 23:58:16 +0000217 /* Extensions may appear below */
Lev Walkind7a68112007-06-29 01:42:04 +0000218 PDU_2_PR_ext1,
219 PDU_2_PR_ext0
Lev Walkin34ff9002007-06-26 23:58:16 +0000220} PDU_2_PR;
221
222/*** <<< TYPE-DECLS [PDU-2] >>> ***/
223
224typedef struct PDU_2 {
225 PDU_2_PR present;
226 union PDU_2_u {
Lev Walkin2a744a72013-03-27 01:56:23 -0700227 long main;
Lev Walkin34ff9002007-06-26 23:58:16 +0000228 /*
229 * This type is extensible,
230 * possible extensions are below.
231 */
Lev Walkin2a744a72013-03-27 01:56:23 -0700232 long ext1;
233 long ext0;
Lev Walkin34ff9002007-06-26 23:58:16 +0000234 } choice;
235
236 /* Context for parsing across buffer boundaries */
237 asn_struct_ctx_t _asn_ctx;
238} PDU_2_t;
239
240/*** <<< FUNC-DECLS [PDU-2] >>> ***/
241
242extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800243extern asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1;
244extern asn_TYPE_member_t asn_MBR_PDU_2_1[3];
245extern asn_per_constraints_t asn_PER_type_PDU_2_constr_1;
Lev Walkin34ff9002007-06-26 23:58:16 +0000246
247/*** <<< CTDEFS [PDU-2] >>> ***/
248
Lev Walkin0479e042017-09-26 18:39:58 -0700249asn_per_constraints_t asn_PER_type_PDU_2_constr_1 CC_NOTUSED = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000250 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
251 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
252 0, 0 /* No PER value map */
253};
254
255/*** <<< STAT-DEFS [PDU-2] >>> ***/
256
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800257asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
Lev Walkind7a68112007-06-29 01:42:04 +0000258 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
259 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
Lev Walkin34ff9002007-06-26 23:58:16 +0000260 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700261 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700262 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700263 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin34ff9002007-06-26 23:58:16 +0000264 .default_value = 0,
Lev Walkind7a68112007-06-29 01:42:04 +0000265 .name = "main"
266 },
267 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
268 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
269 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700270 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700271 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700272 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkind7a68112007-06-29 01:42:04 +0000273 .default_value = 0,
274 .name = "ext1"
275 },
276 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
277 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
278 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700279 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700280 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -0700281 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkind7a68112007-06-29 01:42:04 +0000282 .default_value = 0,
283 .name = "ext0"
Lev Walkin34ff9002007-06-26 23:58:16 +0000284 },
285};
Lev Walkin18660d22017-08-12 20:45:23 -0700286static const unsigned asn_MAP_PDU_2_cmap_1[] = { 0, 2, 1 };
Lev Walkina7591b52014-10-12 18:37:35 -0700287static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700288 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 */
289 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 */
290 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main */
Lev Walkin34ff9002007-06-26 23:58:16 +0000291};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800292asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000293 sizeof(struct PDU_2),
294 offsetof(struct PDU_2, _asn_ctx),
295 offsetof(struct PDU_2, present),
296 sizeof(((struct PDU_2 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700297 .tag2el = asn_MAP_PDU_2_tag2el_1,
298 .tag2el_count = 3, /* Count of tags in the map */
Lev Walkind7a68112007-06-29 01:42:04 +0000299 .canonical_order = asn_MAP_PDU_2_cmap_1, /* Canonically sorted */
Lev Walkin34ff9002007-06-26 23:58:16 +0000300 .ext_start = 1 /* Extensions start */
301};
302asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
303 "PDU-2",
304 "PDU-2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800305 &asn_OP_CHOICE,
Lev Walkin34ff9002007-06-26 23:58:16 +0000306 0, /* No effective tags (pointer) */
307 0, /* No effective tags (count) */
308 0, /* No tags (pointer) */
309 0, /* No tags (count) */
Lev Walkin0bfea562017-09-29 23:16:48 -0700310 { 0, &asn_PER_type_PDU_2_constr_1, CHOICE_constraint },
Lev Walkin34ff9002007-06-26 23:58:16 +0000311 asn_MBR_PDU_2_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000312 3, /* Elements count */
Lev Walkin34ff9002007-06-26 23:58:16 +0000313 &asn_SPC_PDU_2_specs_1 /* Additional specs */
314};
315