blob: 129ef3d8f910f9cef22a4fbcc2b6aba9820d3384 [file] [log] [blame]
vlm07891132004-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;
vlm07891132004-10-03 09:14:49 +000020
21/*** <<< TYPE-DECLS [T] >>> ***/
22
vlm07891132004-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
vlm0b567bf2005-03-04 22:18:20 +000040/*** <<< FUNC-DECLS [T] >>> ***/
41
42extern asn_TYPE_descriptor_t asn_DEF_T;
43
vlm07891132004-10-03 09:14:49 +000044/*** <<< STAT-DEFS [T] >>> ***/
45
vlm44fe49a2005-03-04 11:26:08 +000046static asn_TYPE_member_t asn_MBR_T_1[] = {
vlm07891132004-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 */
50 .type = (void *)&asn_DEF_INTEGER,
vlm0a9af512005-01-17 12:20:19 +000051 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm07891132004-10-03 09:14:49 +000052 .name = "i"
53 },
54 { ATF_NOFLAGS, 0, offsetof(struct T, s),
55 .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
56 .tag_mode = 0,
57 .type = (void *)&asn_DEF_IA5String,
vlm0a9af512005-01-17 12:20:19 +000058 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm07891132004-10-03 09:14:49 +000059 .name = "s"
60 },
61 { ATF_POINTER, 0, offsetof(struct T, b),
62 .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
63 .tag_mode = -1, /* IMPLICIT tag at current level */
64 .type = (void *)&asn_DEF_BOOLEAN,
vlm0a9af512005-01-17 12:20:19 +000065 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm07891132004-10-03 09:14:49 +000066 .name = "b"
67 },
68};
vlm44fe49a2005-03-04 11:26:08 +000069static ber_tlv_tag_t asn_DEF_T_1_tags[] = {
vlm07891132004-10-03 09:14:49 +000070 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
71};
vlm44fe49a2005-03-04 11:26:08 +000072static asn_TYPE_tag2member_t asn_MAP_T_1_tag2el[] = {
vlm07891132004-10-03 09:14:49 +000073 { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 }, /* s at 16 */
74 { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 0, 0, 0 }, /* i at 15 */
vlmb317f442005-02-25 08:20:32 +000075 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b at 18 */
vlm07891132004-10-03 09:14:49 +000076};
vlm44fe49a2005-03-04 11:26:08 +000077static uint8_t asn_MAP_T_1_mmap[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = {
vlm07891132004-10-03 09:14:49 +000078 (1 << 7) | (1 << 6) | (0 << 5)
79};
vlm44fe49a2005-03-04 11:26:08 +000080static asn_SET_specifics_t asn_SPC_T_1_specs = {
vlm07891132004-10-03 09:14:49 +000081 sizeof(struct T),
82 offsetof(struct T, _asn_ctx),
83 offsetof(struct T, _presence_map),
vlm44fe49a2005-03-04 11:26:08 +000084 asn_MAP_T_1_tag2el,
vlm07891132004-10-03 09:14:49 +000085 3, /* Count of tags in the map */
vlm44fe49a2005-03-04 11:26:08 +000086 asn_MAP_T_1_tag2el, /* Same as above */
vlmb317f442005-02-25 08:20:32 +000087 3, /* Count of tags in the CXER map */
vlm07891132004-10-03 09:14:49 +000088 1, /* Whether extensible */
vlm44fe49a2005-03-04 11:26:08 +000089 (unsigned int *)asn_MAP_T_1_mmap /* Mandatory elements map */
vlm07891132004-10-03 09:14:49 +000090};
91asn_TYPE_descriptor_t asn_DEF_T = {
92 "T",
vlm9de248e2004-10-20 15:50:55 +000093 "T",
vlm07891132004-10-03 09:14:49 +000094 SET_free,
95 SET_print,
96 SET_constraint,
97 SET_decode_ber,
98 SET_encode_der,
vlm9de212e2005-02-14 20:31:31 +000099 SET_decode_xer,
vlm07891132004-10-03 09:14:49 +0000100 SET_encode_xer,
101 0, /* Use generic outmost tag fetcher */
vlm44fe49a2005-03-04 11:26:08 +0000102 asn_DEF_T_1_tags,
103 sizeof(asn_DEF_T_1_tags)
104 /sizeof(asn_DEF_T_1_tags[0]), /* 1 */
105 asn_DEF_T_1_tags, /* Same as above */
106 sizeof(asn_DEF_T_1_tags)
107 /sizeof(asn_DEF_T_1_tags[0]), /* 1 */
108 asn_MBR_T_1,
vlm07891132004-10-03 09:14:49 +0000109 3, /* Elements count */
vlm44fe49a2005-03-04 11:26:08 +0000110 &asn_SPC_T_1_specs /* Additional specs */
vlm07891132004-10-03 09:14:49 +0000111};
112