blob: ef0ea216f524316a577d3a603135bc6e4c5f244f [file] [log] [blame]
Lev Walkin2a8672e2004-10-03 09:14:49 +00001
2/*** <<< INCLUDES [T] >>> ***/
3
4#include <INTEGER.h>
5#include <IA5String.h>
6#include <BOOLEAN.h>
7#include <constr_SET.h>
8
9/*** <<< DEPS [T] >>> ***/
10
11
12/*
13 * Method of determining the components presence
14 */
15typedef enum T_PR {
16 T_PR_i, /* Member i is present */
17 T_PR_s, /* Member s is present */
18 T_PR_b, /* Member b is present */
19} T_PR;
Lev Walkin2a8672e2004-10-03 09:14:49 +000020
21/*** <<< TYPE-DECLS [T] >>> ***/
22
Lev Walkin2a8672e2004-10-03 09:14:49 +000023typedef struct T {
24 INTEGER_t i;
25 IA5String_t s;
26 /*
27 * This type is extensible,
28 * possible extensions are below.
29 */
30 BOOLEAN_t *b;
31
32 /* Presence bitmask: ASN_SET_ISPRESENT(pT, T_PR_x) */
33 unsigned int _presence_map
34 [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
35
36 /* Context for parsing across buffer boundaries */
37 asn_struct_ctx_t _asn_ctx;
38} T_t;
39
Lev Walkinc8285712005-03-04 22:18:20 +000040/*** <<< FUNC-DECLS [T] >>> ***/
41
42extern asn_TYPE_descriptor_t asn_DEF_T;
43
Lev Walkin2a8672e2004-10-03 09:14:49 +000044/*** <<< STAT-DEFS [T] >>> ***/
45
Lev Walkine0272aa2005-03-04 11:26:08 +000046static asn_TYPE_member_t asn_MBR_T_1[] = {
Lev Walkin2a8672e2004-10-03 09:14:49 +000047 { ATF_NOFLAGS, 0, offsetof(struct T, i),
48 .tag = (ASN_TAG_CLASS_APPLICATION | (3 << 2)),
49 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +000050 .type = &asn_DEF_INTEGER,
Lev Walkin67a30122017-08-10 05:48:54 -070051 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070052 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070053 0, 0, /* No default value */
Lev Walkin2a8672e2004-10-03 09:14:49 +000054 .name = "i"
55 },
56 { ATF_NOFLAGS, 0, offsetof(struct T, s),
57 .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
58 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +000059 .type = &asn_DEF_IA5String,
Lev Walkin67a30122017-08-10 05:48:54 -070060 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070061 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070062 0, 0, /* No default value */
Lev Walkin2a8672e2004-10-03 09:14:49 +000063 .name = "s"
64 },
Lev Walkinb85a8132005-08-18 13:38:19 +000065 { ATF_POINTER, 1, offsetof(struct T, b),
Lev Walkin2a8672e2004-10-03 09:14:49 +000066 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
67 .tag_mode = -1, /* IMPLICIT tag at current level */
Lev Walkinae7bf3f2005-08-29 10:31:14 +000068 .type = &asn_DEF_BOOLEAN,
Lev Walkin67a30122017-08-10 05:48:54 -070069 .type_selector = 0,
Lev Walkin0bfea562017-09-29 23:16:48 -070070 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
Lev Walkin20696a42017-10-17 21:27:33 -070071 0, 0, /* No default value */
Lev Walkin2a8672e2004-10-03 09:14:49 +000072 .name = "b"
73 },
74};
Lev Walkina7591b52014-10-12 18:37:35 -070075static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
Lev Walkin2a8672e2004-10-03 09:14:49 +000076 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
77};
Lev Walkina7591b52014-10-12 18:37:35 -070078static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070079 { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 }, /* s */
80 { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 0, 0, 0 }, /* i */
81 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b */
Lev Walkin2a8672e2004-10-03 09:14:49 +000082};
Lev Walkina7591b52014-10-12 18:37:35 -070083static const uint8_t asn_MAP_T_mmap_1[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = {
Lev Walkin2a8672e2004-10-03 09:14:49 +000084 (1 << 7) | (1 << 6) | (0 << 5)
85};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080086static
87asn_SET_specifics_t asn_SPC_T_specs_1 = {
Lev Walkin2a8672e2004-10-03 09:14:49 +000088 sizeof(struct T),
89 offsetof(struct T, _asn_ctx),
90 offsetof(struct T, _presence_map),
Lev Walkine3917082017-08-23 10:29:38 -070091 .tag2el = asn_MAP_T_tag2el_1,
92 .tag2el_count = 3, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +000093 asn_MAP_T_tag2el_1, /* Same as above */
Lev Walkinf82138b2005-02-25 08:20:32 +000094 3, /* Count of tags in the CXER map */
Lev Walkin2a8672e2004-10-03 09:14:49 +000095 1, /* Whether extensible */
Lev Walkin46ef3f32017-07-06 08:47:53 -070096 (const unsigned int *)asn_MAP_T_mmap_1 /* Mandatory elements map */
Lev Walkin2a8672e2004-10-03 09:14:49 +000097};
98asn_TYPE_descriptor_t asn_DEF_T = {
99 "T",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000100 "T",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800101 &asn_OP_SET,
Lev Walkin59b176e2005-11-26 11:25:14 +0000102 asn_DEF_T_tags_1,
103 sizeof(asn_DEF_T_tags_1)
104 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
105 asn_DEF_T_tags_1, /* Same as above */
106 sizeof(asn_DEF_T_tags_1)
107 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
Lev Walkin0bfea562017-09-29 23:16:48 -0700108 { 0, 0, SET_constraint },
Lev Walkine0272aa2005-03-04 11:26:08 +0000109 asn_MBR_T_1,
Lev Walkin2a8672e2004-10-03 09:14:49 +0000110 3, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000111 &asn_SPC_T_specs_1 /* Additional specs */
Lev Walkin2a8672e2004-10-03 09:14:49 +0000112};
113