blob: f3657318db6ccd2b6990788954e8846ee747a992 [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 Walkinfb953d12007-06-23 20:06:04 +000045 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040046 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkinfb953d12007-06-23 20:06:04 +000047 .per_constraints = 0, /* No PER visible constraints */
48 .default_value = 0,
49 .name = "str-o"
50 },
Lev Walkin34ff9002007-06-26 23:58:16 +000051 { ATF_POINTER, 3, offsetof(struct PDU, str_m),
Lev Walkinfb953d12007-06-23 20:06:04 +000052 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
53 .tag_mode = -1, /* IMPLICIT tag at current level */
54 .type = &asn_DEF_IA5String,
Lev Walkin67a30122017-08-10 05:48:54 -070055 .type_selector = 0,
Lev Walkinfb953d12007-06-23 20:06:04 +000056 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040057 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkinfb953d12007-06-23 20:06:04 +000058 .per_constraints = 0, /* No PER visible constraints */
59 .default_value = 0,
60 .name = "str-m"
61 },
Lev Walkin34ff9002007-06-26 23:58:16 +000062 { ATF_POINTER, 2, offsetof(struct PDU, singl),
63 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
64 .tag_mode = -1, /* IMPLICIT tag at current level */
65 .type = &asn_DEF_Singleton,
Lev Walkin67a30122017-08-10 05:48:54 -070066 .type_selector = 0,
Lev Walkin34ff9002007-06-26 23:58:16 +000067 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040068 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +000069 .per_constraints = 0, /* No PER visible constraints */
70 .default_value = 0,
71 .name = "singl"
72 },
73 { ATF_POINTER, 1, offsetof(struct PDU, pdu_2),
74 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
75 .tag_mode = +1, /* EXPLICIT tag at current level */
76 .type = &asn_DEF_PDU_2,
Lev Walkin67a30122017-08-10 05:48:54 -070077 .type_selector = 0,
Lev Walkin34ff9002007-06-26 23:58:16 +000078 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040079 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +000080 .per_constraints = 0, /* No PER visible constraints */
81 .default_value = 0,
82 .name = "pdu-2"
83 },
Lev Walkinfb953d12007-06-23 20:06:04 +000084};
Lev Walkina7591b52014-10-12 18:37:35 -070085static const int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3 };
86static const ber_tlv_tag_t asn_DEF_PDU_tags_1[] = {
Lev Walkinfb953d12007-06-23 20:06:04 +000087 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
88};
Lev Walkina7591b52014-10-12 18:37:35 -070089static const asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070090 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* str-o */
91 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* str-m */
92 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* singl */
93 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* pdu-2 */
Lev Walkinfb953d12007-06-23 20:06:04 +000094};
95static asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1 = {
96 sizeof(struct PDU),
97 offsetof(struct PDU, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -070098 .tag2el = asn_MAP_PDU_tag2el_1,
99 .tag2el_count = 4, /* Count of tags in the map */
Lev Walkinfb953d12007-06-23 20:06:04 +0000100 asn_MAP_PDU_oms_1, /* Optional members */
Lev Walkin34ff9002007-06-26 23:58:16 +0000101 0, 4, /* Root/Additions */
Lev Walkinfb953d12007-06-23 20:06:04 +0000102 -1, /* Start extensions */
Lev Walkin34ff9002007-06-26 23:58:16 +0000103 5 /* Stop extensions */
Lev Walkinfb953d12007-06-23 20:06:04 +0000104};
105asn_TYPE_descriptor_t asn_DEF_PDU = {
106 "PDU",
107 "PDU",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800108 &asn_OP_SEQUENCE,
Lev Walkinfb953d12007-06-23 20:06:04 +0000109 SEQUENCE_constraint,
Lev Walkinfb953d12007-06-23 20:06:04 +0000110 asn_DEF_PDU_tags_1,
111 sizeof(asn_DEF_PDU_tags_1)
112 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
113 asn_DEF_PDU_tags_1, /* Same as above */
114 sizeof(asn_DEF_PDU_tags_1)
115 /sizeof(asn_DEF_PDU_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400116 0, /* No OER visible constraints */
Lev Walkinfb953d12007-06-23 20:06:04 +0000117 0, /* No PER visible constraints */
118 asn_MBR_PDU_1,
Lev Walkin34ff9002007-06-26 23:58:16 +0000119 4, /* Elements count */
Lev Walkinfb953d12007-06-23 20:06:04 +0000120 &asn_SPC_PDU_specs_1 /* Additional specs */
121};
122
Lev Walkin34ff9002007-06-26 23:58:16 +0000123
124/*** <<< INCLUDES [Singleton] >>> ***/
125
126#include <IA5String.h>
127#include <constr_SEQUENCE.h>
128
129/*** <<< TYPE-DECLS [Singleton] >>> ***/
130
131typedef struct Singleton {
132 IA5String_t *opt_z /* DEFAULT z */;
133
134 /* Context for parsing across buffer boundaries */
135 asn_struct_ctx_t _asn_ctx;
136} Singleton_t;
137
138/*** <<< FUNC-DECLS [Singleton] >>> ***/
139
140extern asn_TYPE_descriptor_t asn_DEF_Singleton;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800141extern asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1;
142extern asn_TYPE_member_t asn_MBR_Singleton_1[1];
Lev Walkin34ff9002007-06-26 23:58:16 +0000143
144/*** <<< STAT-DEFS [Singleton] >>> ***/
145
Lev Walkin8032f7a2007-06-27 01:54:57 +0000146static int asn_DFL_2_set(int set_value, void **sptr) {
147 static uint8_t defv[] = "z";
148 IA5String_t *st = *sptr;
149
150 if(!st) {
151 if(!set_value) return -1; /* Not a default value */
152 st = (*sptr = CALLOC(1, sizeof(*st)));
153 if(!st) return -1;
154 }
155
156 if(set_value) {
157 uint8_t *ptr = MALLOC(sizeof(defv));
158 if(!ptr) return -1;
159 memcpy(ptr, &defv, sizeof(defv));
160 FREEMEM(st->buf);
161 st->buf = ptr;
162 st->size = sizeof(defv) - 1;
163 return 0;
164 } else {
165 if(st->size != (sizeof(defv) - 1)
166 || memcmp(st->buf, &defv, sizeof(defv) - 1))
167 return 0;
168 return 1;
169 }
170
171}
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800172asn_TYPE_member_t asn_MBR_Singleton_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000173 { ATF_POINTER, 1, offsetof(struct Singleton, opt_z),
174 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
175 .tag_mode = -1, /* IMPLICIT tag at current level */
176 .type = &asn_DEF_IA5String,
Lev Walkin67a30122017-08-10 05:48:54 -0700177 .type_selector = 0,
Lev Walkin34ff9002007-06-26 23:58:16 +0000178 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400179 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +0000180 .per_constraints = 0, /* No PER visible constraints */
Lev Walkin8032f7a2007-06-27 01:54:57 +0000181 .default_value = asn_DFL_2_set, /* DEFAULT "z" */
Lev Walkin34ff9002007-06-26 23:58:16 +0000182 .name = "opt-z"
183 },
184};
Lev Walkina7591b52014-10-12 18:37:35 -0700185static const int asn_MAP_Singleton_oms_1[] = { 0 };
186static const ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000187 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
188};
Lev Walkina7591b52014-10-12 18:37:35 -0700189static const asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700190 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z */
Lev Walkin34ff9002007-06-26 23:58:16 +0000191};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800192asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000193 sizeof(struct Singleton),
194 offsetof(struct Singleton, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700195 .tag2el = asn_MAP_Singleton_tag2el_1,
196 .tag2el_count = 1, /* Count of tags in the map */
Lev Walkin34ff9002007-06-26 23:58:16 +0000197 asn_MAP_Singleton_oms_1, /* Optional members */
198 1, 0, /* Root/Additions */
199 -1, /* Start extensions */
200 -1 /* Stop extensions */
201};
202asn_TYPE_descriptor_t asn_DEF_Singleton = {
203 "Singleton",
204 "Singleton",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800205 &asn_OP_SEQUENCE,
Lev Walkin34ff9002007-06-26 23:58:16 +0000206 SEQUENCE_constraint,
Lev Walkin34ff9002007-06-26 23:58:16 +0000207 asn_DEF_Singleton_tags_1,
208 sizeof(asn_DEF_Singleton_tags_1)
209 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
210 asn_DEF_Singleton_tags_1, /* Same as above */
211 sizeof(asn_DEF_Singleton_tags_1)
212 /sizeof(asn_DEF_Singleton_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400213 0, /* No OER visible constraints */
Lev Walkin34ff9002007-06-26 23:58:16 +0000214 0, /* No PER visible constraints */
215 asn_MBR_Singleton_1,
216 1, /* Elements count */
217 &asn_SPC_Singleton_specs_1 /* Additional specs */
218};
219
220
221/*** <<< INCLUDES [PDU-2] >>> ***/
222
Lev Walkin2a744a72013-03-27 01:56:23 -0700223#include <NativeInteger.h>
Lev Walkin34ff9002007-06-26 23:58:16 +0000224#include <constr_CHOICE.h>
225
226/*** <<< DEPS [PDU-2] >>> ***/
227
228typedef enum PDU_2_PR {
229 PDU_2_PR_NOTHING, /* No components present */
Lev Walkind7a68112007-06-29 01:42:04 +0000230 PDU_2_PR_main,
Lev Walkin34ff9002007-06-26 23:58:16 +0000231 /* Extensions may appear below */
Lev Walkind7a68112007-06-29 01:42:04 +0000232 PDU_2_PR_ext1,
233 PDU_2_PR_ext0
Lev Walkin34ff9002007-06-26 23:58:16 +0000234} PDU_2_PR;
235
236/*** <<< TYPE-DECLS [PDU-2] >>> ***/
237
238typedef struct PDU_2 {
239 PDU_2_PR present;
240 union PDU_2_u {
Lev Walkin2a744a72013-03-27 01:56:23 -0700241 long main;
Lev Walkin34ff9002007-06-26 23:58:16 +0000242 /*
243 * This type is extensible,
244 * possible extensions are below.
245 */
Lev Walkin2a744a72013-03-27 01:56:23 -0700246 long ext1;
247 long ext0;
Lev Walkin34ff9002007-06-26 23:58:16 +0000248 } choice;
249
250 /* Context for parsing across buffer boundaries */
251 asn_struct_ctx_t _asn_ctx;
252} PDU_2_t;
253
254/*** <<< FUNC-DECLS [PDU-2] >>> ***/
255
256extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800257extern asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1;
258extern asn_TYPE_member_t asn_MBR_PDU_2_1[3];
259extern asn_per_constraints_t asn_PER_type_PDU_2_constr_1;
Lev Walkin34ff9002007-06-26 23:58:16 +0000260
261/*** <<< CTDEFS [PDU-2] >>> ***/
262
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800263asn_per_constraints_t asn_PER_type_PDU_2_constr_1 GCC_NOTUSED = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000264 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
265 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
266 0, 0 /* No PER value map */
267};
268
269/*** <<< STAT-DEFS [PDU-2] >>> ***/
270
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800271asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
Lev Walkind7a68112007-06-29 01:42:04 +0000272 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
273 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
Lev Walkin34ff9002007-06-26 23:58:16 +0000274 .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 Walkin34ff9002007-06-26 23:58:16 +0000277 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400278 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin34ff9002007-06-26 23:58:16 +0000279 .per_constraints = 0, /* No PER visible constraints */
280 .default_value = 0,
Lev Walkind7a68112007-06-29 01:42:04 +0000281 .name = "main"
282 },
283 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1),
284 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 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 Walkind7a68112007-06-29 01:42:04 +0000288 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400289 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkind7a68112007-06-29 01:42:04 +0000290 .per_constraints = 0, /* No PER visible constraints */
291 .default_value = 0,
292 .name = "ext1"
293 },
294 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0),
295 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
296 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkin2a744a72013-03-27 01:56:23 -0700297 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700298 .type_selector = 0,
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 = "ext0"
Lev Walkin34ff9002007-06-26 23:58:16 +0000304 },
305};
Lev Walkin18660d22017-08-12 20:45:23 -0700306static const unsigned asn_MAP_PDU_2_cmap_1[] = { 0, 2, 1 };
Lev Walkina7591b52014-10-12 18:37:35 -0700307static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700308 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* ext0 */
309 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ext1 */
310 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 } /* main */
Lev Walkin34ff9002007-06-26 23:58:16 +0000311};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800312asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
Lev Walkin34ff9002007-06-26 23:58:16 +0000313 sizeof(struct PDU_2),
314 offsetof(struct PDU_2, _asn_ctx),
315 offsetof(struct PDU_2, present),
316 sizeof(((struct PDU_2 *)0)->present),
Lev Walkine3917082017-08-23 10:29:38 -0700317 .tag2el = asn_MAP_PDU_2_tag2el_1,
318 .tag2el_count = 3, /* Count of tags in the map */
Lev Walkind7a68112007-06-29 01:42:04 +0000319 .canonical_order = asn_MAP_PDU_2_cmap_1, /* Canonically sorted */
Lev Walkin34ff9002007-06-26 23:58:16 +0000320 .ext_start = 1 /* Extensions start */
321};
322asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
323 "PDU-2",
324 "PDU-2",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800325 &asn_OP_CHOICE,
Lev Walkin34ff9002007-06-26 23:58:16 +0000326 CHOICE_constraint,
Lev Walkin34ff9002007-06-26 23:58:16 +0000327 0, /* No effective tags (pointer) */
328 0, /* No effective tags (count) */
329 0, /* No tags (pointer) */
330 0, /* No tags (count) */
Lev Walkinb33425f2017-07-14 14:59:52 +0400331 0, /* No OER visible constraints */
Lev Walkin34ff9002007-06-26 23:58:16 +0000332 &asn_PER_type_PDU_2_constr_1,
333 asn_MBR_PDU_2_1,
Lev Walkind7a68112007-06-29 01:42:04 +0000334 3, /* Elements count */
Lev Walkin34ff9002007-06-26 23:58:16 +0000335 &asn_SPC_PDU_2_specs_1 /* Additional specs */
336};
337