blob: 849e9a950428ef89571cdcdd9def7a04e4e8a37d [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;
20extern asn_TYPE_descriptor_t asn_DEF_T;
21
22/*** <<< TYPE-DECLS [T] >>> ***/
23
24
25typedef struct T {
26 INTEGER_t i;
27 IA5String_t s;
28 /*
29 * This type is extensible,
30 * possible extensions are below.
31 */
32 BOOLEAN_t *b;
33
34 /* Presence bitmask: ASN_SET_ISPRESENT(pT, T_PR_x) */
35 unsigned int _presence_map
36 [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
37
38 /* Context for parsing across buffer boundaries */
39 asn_struct_ctx_t _asn_ctx;
40} T_t;
41
42/*** <<< STAT-DEFS [T] >>> ***/
43
Lev Walkine0272aa2005-03-04 11:26:08 +000044static asn_TYPE_member_t asn_MBR_T_1[] = {
Lev Walkin2a8672e2004-10-03 09:14:49 +000045 { ATF_NOFLAGS, 0, offsetof(struct T, i),
46 .tag = (ASN_TAG_CLASS_APPLICATION | (3 << 2)),
47 .tag_mode = -1, /* IMPLICIT tag at current level */
48 .type = (void *)&asn_DEF_INTEGER,
Lev Walkinba58e1b2005-01-17 12:20:19 +000049 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin2a8672e2004-10-03 09:14:49 +000050 .name = "i"
51 },
52 { ATF_NOFLAGS, 0, offsetof(struct T, s),
53 .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
54 .tag_mode = 0,
55 .type = (void *)&asn_DEF_IA5String,
Lev Walkinba58e1b2005-01-17 12:20:19 +000056 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin2a8672e2004-10-03 09:14:49 +000057 .name = "s"
58 },
59 { ATF_POINTER, 0, offsetof(struct T, b),
60 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
61 .tag_mode = -1, /* IMPLICIT tag at current level */
62 .type = (void *)&asn_DEF_BOOLEAN,
Lev Walkinba58e1b2005-01-17 12:20:19 +000063 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkin2a8672e2004-10-03 09:14:49 +000064 .name = "b"
65 },
66};
Lev Walkine0272aa2005-03-04 11:26:08 +000067static ber_tlv_tag_t asn_DEF_T_1_tags[] = {
Lev Walkin2a8672e2004-10-03 09:14:49 +000068 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
69};
Lev Walkine0272aa2005-03-04 11:26:08 +000070static asn_TYPE_tag2member_t asn_MAP_T_1_tag2el[] = {
Lev Walkin2a8672e2004-10-03 09:14:49 +000071 { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 }, /* s at 16 */
72 { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 0, 0, 0 }, /* i at 15 */
Lev Walkinf82138b2005-02-25 08:20:32 +000073 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b at 18 */
Lev Walkin2a8672e2004-10-03 09:14:49 +000074};
Lev Walkine0272aa2005-03-04 11:26:08 +000075static uint8_t asn_MAP_T_1_mmap[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = {
Lev Walkin2a8672e2004-10-03 09:14:49 +000076 (1 << 7) | (1 << 6) | (0 << 5)
77};
Lev Walkine0272aa2005-03-04 11:26:08 +000078static asn_SET_specifics_t asn_SPC_T_1_specs = {
Lev Walkin2a8672e2004-10-03 09:14:49 +000079 sizeof(struct T),
80 offsetof(struct T, _asn_ctx),
81 offsetof(struct T, _presence_map),
Lev Walkine0272aa2005-03-04 11:26:08 +000082 asn_MAP_T_1_tag2el,
Lev Walkin2a8672e2004-10-03 09:14:49 +000083 3, /* Count of tags in the map */
Lev Walkine0272aa2005-03-04 11:26:08 +000084 asn_MAP_T_1_tag2el, /* Same as above */
Lev Walkinf82138b2005-02-25 08:20:32 +000085 3, /* Count of tags in the CXER map */
Lev Walkin2a8672e2004-10-03 09:14:49 +000086 1, /* Whether extensible */
Lev Walkine0272aa2005-03-04 11:26:08 +000087 (unsigned int *)asn_MAP_T_1_mmap /* Mandatory elements map */
Lev Walkin2a8672e2004-10-03 09:14:49 +000088};
89asn_TYPE_descriptor_t asn_DEF_T = {
90 "T",
Lev Walkindc06f6b2004-10-20 15:50:55 +000091 "T",
Lev Walkin2a8672e2004-10-03 09:14:49 +000092 SET_free,
93 SET_print,
94 SET_constraint,
95 SET_decode_ber,
96 SET_encode_der,
Lev Walkinb2230802005-02-14 20:31:31 +000097 SET_decode_xer,
Lev Walkin2a8672e2004-10-03 09:14:49 +000098 SET_encode_xer,
99 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000100 asn_DEF_T_1_tags,
101 sizeof(asn_DEF_T_1_tags)
102 /sizeof(asn_DEF_T_1_tags[0]), /* 1 */
103 asn_DEF_T_1_tags, /* Same as above */
104 sizeof(asn_DEF_T_1_tags)
105 /sizeof(asn_DEF_T_1_tags[0]), /* 1 */
106 asn_MBR_T_1,
Lev Walkin2a8672e2004-10-03 09:14:49 +0000107 3, /* Elements count */
Lev Walkine0272aa2005-03-04 11:26:08 +0000108 &asn_SPC_T_1_specs /* Additional specs */
Lev Walkin2a8672e2004-10-03 09:14:49 +0000109};
110