blob: ea127a1569521706aa422eb749338087ac44f351 [file] [log] [blame]
Lev Walkinad0d6372017-08-08 02:02:42 -07001
2/*** <<< INCLUDES [Frame] >>> ***/
3
4#include <NativeInteger.h>
5#include <ANY.h>
6#include <asn_ioc.h>
7#include "PrimitiveMessage.h"
8#include "ComplexMessage.h"
9#include <constr_SEQUENCE.h>
10
11/*** <<< TYPE-DECLS [Frame] >>> ***/
12
13typedef struct Frame {
14 long ident;
15 ANY_t value;
16 /*
17 * This type is extensible,
18 * possible extensions are below.
19 */
20
21 /* Context for parsing across buffer boundaries */
22 asn_struct_ctx_t _asn_ctx;
23} Frame_t;
24
25/*** <<< FUNC-DECLS [Frame] >>> ***/
26
27extern asn_TYPE_descriptor_t asn_DEF_Frame;
28
Lev Walkin67a30122017-08-10 05:48:54 -070029/*** <<< IOC-TABLES [Frame] >>> ***/
30
31static const long asn_VAL_basicMessage_0 = 1;
32static const long asn_VAL_2_0 = 2;
33static const asn_ioc_cell_t asn_IOS_FrameTypes_1_rows[] = {
34 { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_basicMessage_0 },
35 { "&Type", aioc__type, &asn_DEF_PrimitiveMessage },
36 { "&id", aioc__value, &asn_DEF_NativeInteger, &asn_VAL_2_0 },
37 { "&Type", aioc__type, &asn_DEF_ComplexMessage }
38};
39static asn_ioc_set_t asn_IOS_FrameTypes_1[] = {
40 2, 2, asn_IOS_FrameTypes_1_rows
41};
42
Lev Walkinad0d6372017-08-08 02:02:42 -070043/*** <<< CODE [Frame] >>> ***/
44
45static int
46memb_ident_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
47 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
48
49 if(!sptr) {
50 ASN__CTFAIL(app_key, td, sptr,
51 "%s: value not given (%s:%d)",
52 td->name, __FILE__, __LINE__);
53 return -1;
54 }
55
56
57 if(1 /* No applicable constraints whatsoever */) {
58 /* Nothing is here. See below */
59 }
60
61 return td->check_constraints(td, sptr, ctfailcb, app_key);
62}
63
Lev Walkin67a30122017-08-10 05:48:54 -070064static asn_TYPE_descriptor_t *
65select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
66 asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
67 size_t constraining_column = 0; /* &id */
68 size_t for_column = 1; /* &Type */
69 size_t row;
70 const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Frame, ident));
71
72 for(row=0; row < itable->rows_count; row++) {
73 asn_ioc_cell_s *constraining_cell = itable->rows[row * itable->columns_count + constraining_column];
74 asn_ioc_cell_s *type_cell = itable->rows[row * itable->columns_count + for_column];
75 if(constraining_cell->type_descriptor->struct_compare(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
76 return type_cell->type_descriptor;
77 }
78 }
79
80 return NULL;
81}
82
Lev Walkinad0d6372017-08-08 02:02:42 -070083static int
84memb_value_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
85 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
86
87 if(!sptr) {
88 ASN__CTFAIL(app_key, td, sptr,
89 "%s: value not given (%s:%d)",
90 td->name, __FILE__, __LINE__);
91 return -1;
92 }
93
94
95 if(1 /* No applicable constraints whatsoever */) {
96 /* Nothing is here. See below */
97 }
98
99 return td->check_constraints(td, sptr, ctfailcb, app_key);
100}
101
102
103/*** <<< STAT-DEFS [Frame] >>> ***/
104
Lev Walkinad0d6372017-08-08 02:02:42 -0700105static asn_TYPE_member_t asn_MBR_Frame_1[] = {
106 { ATF_NOFLAGS, 0, offsetof(struct Frame, ident),
107 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
108 .tag_mode = 0,
109 .type = &asn_DEF_NativeInteger,
Lev Walkin67a30122017-08-10 05:48:54 -0700110 .type_selector = 0,
Lev Walkinad0d6372017-08-08 02:02:42 -0700111 .memb_constraints = memb_ident_constraint_1,
112 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
113 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
114 .default_value = 0,
115 .name = "ident"
116 },
117 { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Frame, value),
118 .tag = -1 /* Ambiguous tag (ANY?) */,
119 .tag_mode = 0,
120 .type = &asn_DEF_ANY,
Lev Walkin67a30122017-08-10 05:48:54 -0700121 .type_selector = select_value_type,
Lev Walkinad0d6372017-08-08 02:02:42 -0700122 .memb_constraints = memb_value_constraint_1,
123 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
124 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
125 .default_value = 0,
126 .name = "value"
127 },
128};
129static const ber_tlv_tag_t asn_DEF_Frame_tags_1[] = {
130 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
131};
132static const asn_TYPE_tag2member_t asn_MAP_Frame_tag2el_1[] = {
133 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* ident */
134};
135static asn_SEQUENCE_specifics_t asn_SPC_Frame_specs_1 = {
136 sizeof(struct Frame),
137 offsetof(struct Frame, _asn_ctx),
138 asn_MAP_Frame_tag2el_1,
139 1, /* Count of tags in the map */
140 0, 0, 0, /* Optional elements (not needed) */
141 1, /* Start extensions */
142 3 /* Stop extensions */
143};
144asn_TYPE_descriptor_t asn_DEF_Frame = {
145 "Frame",
146 "Frame",
147 SEQUENCE_free,
148 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700149 SEQUENCE_compare,
Lev Walkinad0d6372017-08-08 02:02:42 -0700150 SEQUENCE_constraint,
151 SEQUENCE_decode_ber,
152 SEQUENCE_encode_der,
153 SEQUENCE_decode_xer,
154 SEQUENCE_encode_xer,
155 0, 0, /* No OER support, use "-gen-OER" to enable */
156 0, 0, /* No PER support, use "-gen-PER" to enable */
157 0, /* Use generic outmost tag fetcher */
158 asn_DEF_Frame_tags_1,
159 sizeof(asn_DEF_Frame_tags_1)
160 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
161 asn_DEF_Frame_tags_1, /* Same as above */
162 sizeof(asn_DEF_Frame_tags_1)
163 /sizeof(asn_DEF_Frame_tags_1[0]), /* 1 */
164 0, /* No OER visible constraints */
165 0, /* No PER visible constraints */
166 asn_MBR_Frame_1,
167 2, /* Elements count */
168 &asn_SPC_Frame_specs_1 /* Additional specs */
169};
170
171
172/*** <<< INCLUDES [PrimitiveMessage] >>> ***/
173
174#include <constr_SEQUENCE.h>
175
176/*** <<< TYPE-DECLS [PrimitiveMessage] >>> ***/
177
178typedef struct PrimitiveMessage {
179
180 /* Context for parsing across buffer boundaries */
181 asn_struct_ctx_t _asn_ctx;
182} PrimitiveMessage_t;
183
184/*** <<< FUNC-DECLS [PrimitiveMessage] >>> ***/
185
186extern asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage;
187extern asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1;
188
189/*** <<< STAT-DEFS [PrimitiveMessage] >>> ***/
190
191static const ber_tlv_tag_t asn_DEF_PrimitiveMessage_tags_1[] = {
192 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
193};
194asn_SEQUENCE_specifics_t asn_SPC_PrimitiveMessage_specs_1 = {
195 sizeof(struct PrimitiveMessage),
196 offsetof(struct PrimitiveMessage, _asn_ctx),
197 0, /* No top level tags */
198 0, /* No tags in the map */
199 0, 0, 0, /* Optional elements (not needed) */
200 -1, /* Start extensions */
201 -1 /* Stop extensions */
202};
203asn_TYPE_descriptor_t asn_DEF_PrimitiveMessage = {
204 "PrimitiveMessage",
205 "PrimitiveMessage",
206 SEQUENCE_free,
207 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700208 SEQUENCE_compare,
Lev Walkinad0d6372017-08-08 02:02:42 -0700209 SEQUENCE_constraint,
210 SEQUENCE_decode_ber,
211 SEQUENCE_encode_der,
212 SEQUENCE_decode_xer,
213 SEQUENCE_encode_xer,
214 0, 0, /* No OER support, use "-gen-OER" to enable */
215 0, 0, /* No PER support, use "-gen-PER" to enable */
216 0, /* Use generic outmost tag fetcher */
217 asn_DEF_PrimitiveMessage_tags_1,
218 sizeof(asn_DEF_PrimitiveMessage_tags_1)
219 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
220 asn_DEF_PrimitiveMessage_tags_1, /* Same as above */
221 sizeof(asn_DEF_PrimitiveMessage_tags_1)
222 /sizeof(asn_DEF_PrimitiveMessage_tags_1[0]), /* 1 */
223 0, /* No OER visible constraints */
224 0, /* No PER visible constraints */
225 0, 0, /* No members */
226 &asn_SPC_PrimitiveMessage_specs_1 /* Additional specs */
227};
228
229
230/*** <<< INCLUDES [ComplexMessage] >>> ***/
231
232#include <constr_SEQUENCE.h>
233
234/*** <<< TYPE-DECLS [ComplexMessage] >>> ***/
235
236typedef struct ComplexMessage {
237
238 /* Context for parsing across buffer boundaries */
239 asn_struct_ctx_t _asn_ctx;
240} ComplexMessage_t;
241
242/*** <<< FUNC-DECLS [ComplexMessage] >>> ***/
243
244extern asn_TYPE_descriptor_t asn_DEF_ComplexMessage;
245extern asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1;
246
247/*** <<< STAT-DEFS [ComplexMessage] >>> ***/
248
249static const ber_tlv_tag_t asn_DEF_ComplexMessage_tags_1[] = {
250 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
251};
252asn_SEQUENCE_specifics_t asn_SPC_ComplexMessage_specs_1 = {
253 sizeof(struct ComplexMessage),
254 offsetof(struct ComplexMessage, _asn_ctx),
255 0, /* No top level tags */
256 0, /* No tags in the map */
257 0, 0, 0, /* Optional elements (not needed) */
258 -1, /* Start extensions */
259 -1 /* Stop extensions */
260};
261asn_TYPE_descriptor_t asn_DEF_ComplexMessage = {
262 "ComplexMessage",
263 "ComplexMessage",
264 SEQUENCE_free,
265 SEQUENCE_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700266 SEQUENCE_compare,
Lev Walkinad0d6372017-08-08 02:02:42 -0700267 SEQUENCE_constraint,
268 SEQUENCE_decode_ber,
269 SEQUENCE_encode_der,
270 SEQUENCE_decode_xer,
271 SEQUENCE_encode_xer,
272 0, 0, /* No OER support, use "-gen-OER" to enable */
273 0, 0, /* No PER support, use "-gen-PER" to enable */
274 0, /* Use generic outmost tag fetcher */
275 asn_DEF_ComplexMessage_tags_1,
276 sizeof(asn_DEF_ComplexMessage_tags_1)
277 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
278 asn_DEF_ComplexMessage_tags_1, /* Same as above */
279 sizeof(asn_DEF_ComplexMessage_tags_1)
280 /sizeof(asn_DEF_ComplexMessage_tags_1[0]), /* 1 */
281 0, /* No OER visible constraints */
282 0, /* No PER visible constraints */
283 0, 0, /* No members */
284 &asn_SPC_ComplexMessage_specs_1 /* Additional specs */
285};
286