blob: 4ee72ad48c649e04639955cc5adb73bc44bd8871 [file] [log] [blame]
vlm097616c2005-01-30 18:34:07 +00001
2/*** <<< INCLUDES [T] >>> ***/
3
4#include <INTEGER.h>
5#include <OCTET_STRING.h>
6#include <REAL.h>
7#include <constr_SET.h>
8#include <constr_SEQUENCE.h>
9
10/*** <<< DEPS [T] >>> ***/
11
12
13/*
14 * Method of determining the components presence
15 */
16typedef enum class_PR {
17} class_PR;
vlm097616c2005-01-30 18:34:07 +000018
19/*** <<< TYPE-DECLS [T] >>> ***/
20
vlm097616c2005-01-30 18:34:07 +000021typedef struct T {
22 INTEGER_t Int;
23 OCTET_STRING_t Char;
24 struct Class {
25 /*
26 * This type is extensible,
27 * possible extensions are below.
28 */
29
30 /* Presence bitmask: ASN_SET_ISPRESENT(pclass, class_PR_x) */
31 unsigned int _presence_map
32 [((0+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
33
34 /* Context for parsing across buffer boundaries */
35 asn_struct_ctx_t _asn_ctx;
36 } Class;
37 REAL_t Double;
38
39 /* Context for parsing across buffer boundaries */
40 asn_struct_ctx_t _asn_ctx;
41} T_t;
42
vlm0b567bf2005-03-04 22:18:20 +000043/*** <<< FUNC-DECLS [T] >>> ***/
44
45extern asn_TYPE_descriptor_t asn_DEF_T;
46
vlm097616c2005-01-30 18:34:07 +000047/*** <<< CODE [T] >>> ***/
48
49static int
vlm337167e2005-11-26 11:25:14 +000050memb_char_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +000051 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlmdb87f2e2005-02-15 03:40:07 +000052 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
vlm097616c2005-01-30 18:34:07 +000053 size_t size;
54
55 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +000056 _ASN_CTFAIL(app_key, td, sptr,
vlm097616c2005-01-30 18:34:07 +000057 "%s: value not given (%s:%d)",
58 td->name, __FILE__, __LINE__);
59 return -1;
60 }
61
62 size = st->size;
63
64 if((size == 1)) {
65 /* Constraint check succeeded */
66 return 0;
67 } else {
vlmd4ae41c2006-07-13 13:28:32 +000068 _ASN_CTFAIL(app_key, td, sptr,
vlm097616c2005-01-30 18:34:07 +000069 "%s: constraint failed (%s:%d)",
70 td->name, __FILE__, __LINE__);
71 return -1;
72 }
73}
74
75
76/*** <<< STAT-DEFS [T] >>> ***/
77
vlm337167e2005-11-26 11:25:14 +000078static ber_tlv_tag_t asn_DEF_class_tags_4[] = {
vlm097616c2005-01-30 18:34:07 +000079 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
80};
vlm337167e2005-11-26 11:25:14 +000081static uint8_t asn_MAP_class_mmap_4[(0 + (8 * sizeof(unsigned int)) - 1) / 8] = {
vlm097616c2005-01-30 18:34:07 +000082 0
83};
vlm337167e2005-11-26 11:25:14 +000084static asn_SET_specifics_t asn_SPC_class_specs_4 = {
vlm097616c2005-01-30 18:34:07 +000085 sizeof(struct Class),
86 offsetof(struct Class, _asn_ctx),
87 offsetof(struct Class, _presence_map),
vlm337167e2005-11-26 11:25:14 +000088 asn_MAP_class_tag2el_4,
vlm097616c2005-01-30 18:34:07 +000089 0, /* Count of tags in the map */
vlm337167e2005-11-26 11:25:14 +000090 asn_MAP_class_tag2el_4, /* Same as above */
vlmb317f442005-02-25 08:20:32 +000091 0, /* Count of tags in the CXER map */
vlm097616c2005-01-30 18:34:07 +000092 1, /* Whether extensible */
vlm337167e2005-11-26 11:25:14 +000093 (unsigned int *)asn_MAP_class_mmap_4 /* Mandatory elements map */
vlm097616c2005-01-30 18:34:07 +000094};
95static /* Use -fall-defs-global to expose */
vlm67d57fe2005-03-06 09:29:03 +000096asn_TYPE_descriptor_t asn_DEF_class_4 = {
vlm097616c2005-01-30 18:34:07 +000097 "class",
98 "class",
99 SET_free,
100 SET_print,
101 SET_constraint,
102 SET_decode_ber,
103 SET_encode_der,
vlm9de212e2005-02-14 20:31:31 +0000104 SET_decode_xer,
vlm097616c2005-01-30 18:34:07 +0000105 SET_encode_xer,
vlmb1b193e2006-08-18 01:46:46 +0000106 0, 0, /* No PER support, use "-gen-PER" to enable */
vlm097616c2005-01-30 18:34:07 +0000107 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +0000108 asn_DEF_class_tags_4,
109 sizeof(asn_DEF_class_tags_4)
110 /sizeof(asn_DEF_class_tags_4[0]), /* 1 */
111 asn_DEF_class_tags_4, /* Same as above */
112 sizeof(asn_DEF_class_tags_4)
113 /sizeof(asn_DEF_class_tags_4[0]), /* 1 */
114 0, /* No PER visible constraints */
vlm097616c2005-01-30 18:34:07 +0000115 0, 0, /* No members */
vlm337167e2005-11-26 11:25:14 +0000116 &asn_SPC_class_specs_4 /* Additional specs */
vlm097616c2005-01-30 18:34:07 +0000117};
118
vlm44fe49a2005-03-04 11:26:08 +0000119static asn_TYPE_member_t asn_MBR_T_1[] = {
vlm097616c2005-01-30 18:34:07 +0000120 { ATF_NOFLAGS, 0, offsetof(struct T, Int),
121 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
122 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000123 .type = &asn_DEF_INTEGER,
vlm097616c2005-01-30 18:34:07 +0000124 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000125 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
126 .default_value = 0,
vlm097616c2005-01-30 18:34:07 +0000127 .name = "int"
128 },
129 { ATF_NOFLAGS, 0, offsetof(struct T, Char),
130 .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
131 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000132 .type = &asn_DEF_OCTET_STRING,
vlm337167e2005-11-26 11:25:14 +0000133 .memb_constraints = memb_char_constraint_1,
134 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
135 .default_value = 0,
vlm097616c2005-01-30 18:34:07 +0000136 .name = "char"
137 },
138 { ATF_NOFLAGS, 0, offsetof(struct T, Class),
139 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
140 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000141 .type = &asn_DEF_class_4,
vlm097616c2005-01-30 18:34:07 +0000142 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000143 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
144 .default_value = 0,
vlm097616c2005-01-30 18:34:07 +0000145 .name = "class"
146 },
147 { ATF_NOFLAGS, 0, offsetof(struct T, Double),
148 .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
149 .tag_mode = 0,
vlme0fea712005-08-29 10:31:14 +0000150 .type = &asn_DEF_REAL,
vlm097616c2005-01-30 18:34:07 +0000151 .memb_constraints = 0, /* Defer constraints checking to the member type */
vlm337167e2005-11-26 11:25:14 +0000152 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
153 .default_value = 0,
vlm097616c2005-01-30 18:34:07 +0000154 .name = "double"
155 },
156};
vlm337167e2005-11-26 11:25:14 +0000157static ber_tlv_tag_t asn_DEF_T_tags_1[] = {
vlm097616c2005-01-30 18:34:07 +0000158 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
159};
vlm337167e2005-11-26 11:25:14 +0000160static asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
vlm097616c2005-01-30 18:34:07 +0000161 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int at 15 */
162 { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* char at 16 */
163 { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 3, 0, 0 }, /* double at 18 */
vlmb317f442005-02-25 08:20:32 +0000164 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 } /* class at 17 */
vlm097616c2005-01-30 18:34:07 +0000165};
vlm337167e2005-11-26 11:25:14 +0000166static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
vlm097616c2005-01-30 18:34:07 +0000167 sizeof(struct T),
168 offsetof(struct T, _asn_ctx),
vlm337167e2005-11-26 11:25:14 +0000169 asn_MAP_T_tag2el_1,
vlm097616c2005-01-30 18:34:07 +0000170 4, /* Count of tags in the map */
vlm337167e2005-11-26 11:25:14 +0000171 0, 0, 0, /* Optional elements (not needed) */
vlm097616c2005-01-30 18:34:07 +0000172 -1, /* Start extensions */
173 -1 /* Stop extensions */
174};
175asn_TYPE_descriptor_t asn_DEF_T = {
176 "T",
177 "T",
178 SEQUENCE_free,
179 SEQUENCE_print,
180 SEQUENCE_constraint,
181 SEQUENCE_decode_ber,
182 SEQUENCE_encode_der,
183 SEQUENCE_decode_xer,
184 SEQUENCE_encode_xer,
vlmb1b193e2006-08-18 01:46:46 +0000185 0, 0, /* No PER support, use "-gen-PER" to enable */
vlm097616c2005-01-30 18:34:07 +0000186 0, /* Use generic outmost tag fetcher */
vlm337167e2005-11-26 11:25:14 +0000187 asn_DEF_T_tags_1,
188 sizeof(asn_DEF_T_tags_1)
189 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
190 asn_DEF_T_tags_1, /* Same as above */
191 sizeof(asn_DEF_T_tags_1)
192 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
193 0, /* No PER visible constraints */
vlm44fe49a2005-03-04 11:26:08 +0000194 asn_MBR_T_1,
vlm097616c2005-01-30 18:34:07 +0000195 4, /* Elements count */
vlm337167e2005-11-26 11:25:14 +0000196 &asn_SPC_T_specs_1 /* Additional specs */
vlm097616c2005-01-30 18:34:07 +0000197};
198