2 /*** <<< INCLUDES [PDU] >>> ***/
6 #include <constr_SEQUENCE.h>
8 /*** <<< FWD-DECLS [PDU] >>> ***/
13 /*** <<< TYPE-DECLS [PDU] >>> ***/
17 * This type is extensible,
18 * possible extensions are below.
20 IA5String_t *str_o; /* OPTIONAL */
22 struct Singleton *singl;
23 struct PDU_2 *pdu_2; /* OPTIONAL */
25 /* Context for parsing across buffer boundaries */
26 asn_struct_ctx_t _asn_ctx;
29 /*** <<< FUNC-DECLS [PDU] >>> ***/
31 extern asn_TYPE_descriptor_t asn_DEF_PDU;
33 /*** <<< POST-INCLUDE [PDU] >>> ***/
37 /*** <<< STAT-DEFS [PDU] >>> ***/
39 static asn_TYPE_member_t asn_MBR_PDU_1[] = {
40 { ATF_POINTER, 4, offsetof(struct PDU, str_o),
41 .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
42 .tag_mode = -1, /* IMPLICIT tag at current level */
43 .type = &asn_DEF_IA5String,
45 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
46 0, 0, /* No default value */
49 { ATF_POINTER, 3, offsetof(struct PDU, str_m),
50 .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
51 .tag_mode = -1, /* IMPLICIT tag at current level */
52 .type = &asn_DEF_IA5String,
54 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
55 0, 0, /* No default value */
58 { 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,
63 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
64 0, 0, /* No default value */
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,
72 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
73 0, 0, /* No default value */
77 static const int asn_MAP_PDU_oms_1[] = { 0, 1, 2, 3 };
78 static const ber_tlv_tag_t asn_DEF_PDU_tags_1[] = {
79 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
81 static const asn_TYPE_tag2member_t asn_MAP_PDU_tag2el_1[] = {
82 { (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 */
87 static asn_SEQUENCE_specifics_t asn_SPC_PDU_specs_1 = {
89 offsetof(struct PDU, _asn_ctx),
90 .tag2el = asn_MAP_PDU_tag2el_1,
91 .tag2el_count = 4, /* Count of tags in the map */
92 asn_MAP_PDU_oms_1, /* Optional members */
93 0, 4, /* Root/Additions */
94 0, /* First extension addition */
96 asn_TYPE_descriptor_t asn_DEF_PDU = {
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 */
106 { 0, 0, SEQUENCE_constraint },
108 4, /* Elements count */
109 &asn_SPC_PDU_specs_1 /* Additional specs */
113 /*** <<< INCLUDES [Singleton] >>> ***/
115 #include <IA5String.h>
116 #include <constr_SEQUENCE.h>
118 /*** <<< TYPE-DECLS [Singleton] >>> ***/
120 typedef struct Singleton {
121 IA5String_t *opt_z; /* DEFAULT z */
123 /* Context for parsing across buffer boundaries */
124 asn_struct_ctx_t _asn_ctx;
127 /*** <<< FUNC-DECLS [Singleton] >>> ***/
129 extern asn_TYPE_descriptor_t asn_DEF_Singleton;
130 extern asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1;
131 extern asn_TYPE_member_t asn_MBR_Singleton_1[1];
133 /*** <<< STAT-DEFS [Singleton] >>> ***/
135 static int asn_DFL_2_cmp(const void *sptr) {
136 static const uint8_t defv[] = "z";
137 const IA5String_t *st = sptr;
140 return -1; /* No value is not a default value */
143 if(st->size == (sizeof(defv) - 1)
144 && memcmp(st->buf, &defv, sizeof(defv) - 1) == 0)
148 static int asn_DFL_2_set(void **sptr) {
149 static const uint8_t defv[] = "z";
150 IA5String_t *st = *sptr;
151 uint8_t *nstr = MALLOC(sizeof(defv));
154 memcpy(nstr, defv, sizeof(defv));
159 st = (*sptr = CALLOC(1, sizeof(*st)));
160 if(!st) { FREEMEM(nstr); return -1; }
163 st->size = sizeof(defv) - 1;
167 asn_TYPE_member_t asn_MBR_Singleton_1[] = {
168 { 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,
173 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
174 .default_value_cmp = &asn_DFL_2_cmp, /* Compare DEFAULT "z" */
175 .default_value_set = &asn_DFL_2_set, /* Set DEFAULT "z" */
179 static const int asn_MAP_Singleton_oms_1[] = { 0 };
180 static const ber_tlv_tag_t asn_DEF_Singleton_tags_1[] = {
181 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
183 static const asn_TYPE_tag2member_t asn_MAP_Singleton_tag2el_1[] = {
184 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* opt-z */
186 asn_SEQUENCE_specifics_t asn_SPC_Singleton_specs_1 = {
187 sizeof(struct Singleton),
188 offsetof(struct Singleton, _asn_ctx),
189 .tag2el = asn_MAP_Singleton_tag2el_1,
190 .tag2el_count = 1, /* Count of tags in the map */
191 asn_MAP_Singleton_oms_1, /* Optional members */
192 1, 0, /* Root/Additions */
193 -1, /* First extension addition */
195 asn_TYPE_descriptor_t asn_DEF_Singleton = {
199 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 */
205 { 0, 0, SEQUENCE_constraint },
207 1, /* Elements count */
208 &asn_SPC_Singleton_specs_1 /* Additional specs */
212 /*** <<< INCLUDES [PDU-2] >>> ***/
214 #include <NativeInteger.h>
215 #include <constr_CHOICE.h>
217 /*** <<< DEPS [PDU-2] >>> ***/
219 typedef enum PDU_2_PR {
220 PDU_2_PR_NOTHING, /* No components present */
222 /* Extensions may appear below */
227 /*** <<< TYPE-DECLS [PDU-2] >>> ***/
229 typedef struct PDU_2 {
234 * This type is extensible,
235 * possible extensions are below.
241 /* Context for parsing across buffer boundaries */
242 asn_struct_ctx_t _asn_ctx;
245 /*** <<< FUNC-DECLS [PDU-2] >>> ***/
247 extern asn_TYPE_descriptor_t asn_DEF_PDU_2;
248 extern asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1;
249 extern asn_TYPE_member_t asn_MBR_PDU_2_1[3];
250 extern asn_per_constraints_t asn_PER_type_PDU_2_constr_1;
252 /*** <<< CTDEFS [PDU-2] >>> ***/
254 asn_per_constraints_t asn_PER_type_PDU_2_constr_1 CC_NOTUSED = {
255 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
256 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
257 0, 0 /* No PER value map */
260 /*** <<< STAT-DEFS [PDU-2] >>> ***/
262 asn_TYPE_member_t asn_MBR_PDU_2_1[] = {
263 { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main),
264 .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
265 .tag_mode = -1, /* IMPLICIT tag at current level */
266 .type = &asn_DEF_NativeInteger,
268 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
269 0, 0, /* No default value */
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 */
275 .type = &asn_DEF_NativeInteger,
277 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
278 0, 0, /* No default value */
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 */
284 .type = &asn_DEF_NativeInteger,
286 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
287 0, 0, /* No default value */
291 static const unsigned asn_MAP_PDU_2_to_canonical_1[] = { 0, 2, 1 };
292 static const unsigned asn_MAP_PDU_2_from_canonical_1[] = { 0, 2, 1 };
293 static const asn_TYPE_tag2member_t asn_MAP_PDU_2_tag2el_1[] = {
294 { (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 */
298 asn_CHOICE_specifics_t asn_SPC_PDU_2_specs_1 = {
299 sizeof(struct PDU_2),
300 offsetof(struct PDU_2, _asn_ctx),
301 offsetof(struct PDU_2, present),
302 sizeof(((struct PDU_2 *)0)->present),
303 .tag2el = asn_MAP_PDU_2_tag2el_1,
304 .tag2el_count = 3, /* Count of tags in the map */
305 .to_canonical_order = asn_MAP_PDU_2_to_canonical_1,
306 .from_canonical_order = asn_MAP_PDU_2_from_canonical_1,
307 .first_extension = 1 /* Extensions start */
309 asn_TYPE_descriptor_t asn_DEF_PDU_2 = {
313 0, /* No effective tags (pointer) */
314 0, /* No effective tags (count) */
315 0, /* No tags (pointer) */
316 0, /* No tags (count) */
317 { 0, &asn_PER_type_PDU_2_constr_1, CHOICE_constraint },
319 3, /* Elements count */
320 &asn_SPC_PDU_2_specs_1 /* Additional specs */