blob: 08b5d6622fada3263efc42fcc5ae33507029dc58 [file] [log] [blame]
Lev Walkina00d6b32006-03-21 03:40:38 +00001
2/*** <<< INCLUDES [SIGNED] >>> ***/
3
4#include <REAL.h>
5#include <constr_SEQUENCE.h>
6#include <INTEGER.h>
7#include <constr_SET.h>
8
9/*** <<< DEPS [SIGNED] >>> ***/
10
11
12/*
13 * Method of determining the components presence
14 */
15typedef enum signed_PR {
16 signed_PR_a, /* Member a is present */
17} signed_PR;
18
19/*** <<< TYPE-DECLS [SIGNED] >>> ***/
20
21typedef struct SIGNED_16P0 {
22 REAL_t Signed;
23
24 /* Context for parsing across buffer boundaries */
25 asn_struct_ctx_t _asn_ctx;
26} SIGNED_16P0_t;
27typedef struct SIGNED_16P1 {
28 struct Signed {
29 INTEGER_t a;
30
31 /* Presence bitmask: ASN_SET_ISPRESENT(psigned, signed_PR_x) */
32 unsigned int _presence_map
33 [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
34
35 /* Context for parsing across buffer boundaries */
36 asn_struct_ctx_t _asn_ctx;
37 } Signed;
38
39 /* Context for parsing across buffer boundaries */
40 asn_struct_ctx_t _asn_ctx;
41} SIGNED_16P1_t;
42
43/*** <<< FUNC-DECLS [SIGNED] >>> ***/
44
45extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0;
46extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1;
47
48/*** <<< STAT-DEFS [SIGNED] >>> ***/
49
50static asn_TYPE_member_t asn_MBR_SIGNED_16P0_1[] = {
51 { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P0, Signed),
52 .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
53 .tag_mode = 0,
54 .type = &asn_DEF_REAL,
55 .memb_constraints = 0, /* Defer constraints checking to the member type */
56 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
57 .default_value = 0,
58 .name = "signed"
59 },
60};
61static ber_tlv_tag_t asn_DEF_SIGNED_16P0_tags_1[] = {
62 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
63};
64static asn_TYPE_tag2member_t asn_MAP_SIGNED_16P0_tag2el_1[] = {
65 { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 0, 0, 0 } /* signed at 18 */
66};
67static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P0_specs_1 = {
68 sizeof(struct SIGNED_16P0),
69 offsetof(struct SIGNED_16P0, _asn_ctx),
70 asn_MAP_SIGNED_16P0_tag2el_1,
71 1, /* Count of tags in the map */
72 0, 0, 0, /* Optional elements (not needed) */
73 -1, /* Start extensions */
74 -1 /* Stop extensions */
75};
76asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0 = {
77 "SIGNED",
78 "SIGNED",
79 SEQUENCE_free,
80 SEQUENCE_print,
81 SEQUENCE_constraint,
82 SEQUENCE_decode_ber,
83 SEQUENCE_encode_der,
84 SEQUENCE_decode_xer,
85 SEQUENCE_encode_xer,
86 0, /* No PER decoder, -gen-PER to enable */
87 0, /* Use generic outmost tag fetcher */
88 asn_DEF_SIGNED_16P0_tags_1,
89 sizeof(asn_DEF_SIGNED_16P0_tags_1)
90 /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */
91 asn_DEF_SIGNED_16P0_tags_1, /* Same as above */
92 sizeof(asn_DEF_SIGNED_16P0_tags_1)
93 /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */
94 0, /* No PER visible constraints */
95 asn_MBR_SIGNED_16P0_1,
96 1, /* Elements count */
97 &asn_SPC_SIGNED_16P0_specs_1 /* Additional specs */
98};
99
100static asn_TYPE_member_t asn_MBR_signed_4[] = {
101 { ATF_NOFLAGS, 0, offsetof(struct Signed, a),
102 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
103 .tag_mode = 0,
104 .type = &asn_DEF_INTEGER,
105 .memb_constraints = 0, /* Defer constraints checking to the member type */
106 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
107 .default_value = 0,
108 .name = "a"
109 },
110};
111static ber_tlv_tag_t asn_DEF_signed_tags_4[] = {
112 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
113};
114static asn_TYPE_tag2member_t asn_MAP_signed_tag2el_4[] = {
115 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* a at 19 */
116};
117static uint8_t asn_MAP_signed_mmap_4[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
118 (1 << 7)
119};
120static asn_SET_specifics_t asn_SPC_signed_specs_4 = {
121 sizeof(struct Signed),
122 offsetof(struct Signed, _asn_ctx),
123 offsetof(struct Signed, _presence_map),
124 asn_MAP_signed_tag2el_4,
125 1, /* Count of tags in the map */
126 asn_MAP_signed_tag2el_4, /* Same as above */
127 1, /* Count of tags in the CXER map */
128 0, /* Whether extensible */
129 (unsigned int *)asn_MAP_signed_mmap_4 /* Mandatory elements map */
130};
131static /* Use -fall-defs-global to expose */
132asn_TYPE_descriptor_t asn_DEF_signed_4 = {
133 "signed",
134 "signed",
135 SET_free,
136 SET_print,
137 SET_constraint,
138 SET_decode_ber,
139 SET_encode_der,
140 SET_decode_xer,
141 SET_encode_xer,
142 0, /* No PER decoder, -gen-PER to enable */
143 0, /* Use generic outmost tag fetcher */
144 asn_DEF_signed_tags_4,
145 sizeof(asn_DEF_signed_tags_4)
146 /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */
147 asn_DEF_signed_tags_4, /* Same as above */
148 sizeof(asn_DEF_signed_tags_4)
149 /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */
150 0, /* No PER visible constraints */
151 asn_MBR_signed_4,
152 1, /* Elements count */
153 &asn_SPC_signed_specs_4 /* Additional specs */
154};
155
156static asn_TYPE_member_t asn_MBR_SIGNED_16P1_3[] = {
157 { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P1, Signed),
158 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
159 .tag_mode = 0,
160 .type = &asn_DEF_signed_4,
161 .memb_constraints = 0, /* Defer constraints checking to the member type */
162 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
163 .default_value = 0,
164 .name = "signed"
165 },
166};
167static ber_tlv_tag_t asn_DEF_SIGNED_16P1_tags_3[] = {
168 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
169};
170static asn_TYPE_tag2member_t asn_MAP_SIGNED_16P1_tag2el_3[] = {
171 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* signed at 19 */
172};
173static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P1_specs_3 = {
174 sizeof(struct SIGNED_16P1),
175 offsetof(struct SIGNED_16P1, _asn_ctx),
176 asn_MAP_SIGNED_16P1_tag2el_3,
177 1, /* Count of tags in the map */
178 0, 0, 0, /* Optional elements (not needed) */
179 -1, /* Start extensions */
180 -1 /* Stop extensions */
181};
182asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1 = {
183 "SIGNED",
184 "SIGNED",
185 SEQUENCE_free,
186 SEQUENCE_print,
187 SEQUENCE_constraint,
188 SEQUENCE_decode_ber,
189 SEQUENCE_encode_der,
190 SEQUENCE_decode_xer,
191 SEQUENCE_encode_xer,
192 0, /* No PER decoder, -gen-PER to enable */
193 0, /* Use generic outmost tag fetcher */
194 asn_DEF_SIGNED_16P1_tags_3,
195 sizeof(asn_DEF_SIGNED_16P1_tags_3)
196 /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */
197 asn_DEF_SIGNED_16P1_tags_3, /* Same as above */
198 sizeof(asn_DEF_SIGNED_16P1_tags_3)
199 /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */
200 0, /* No PER visible constraints */
201 asn_MBR_SIGNED_16P1_3,
202 1, /* Elements count */
203 &asn_SPC_SIGNED_16P1_specs_3 /* Additional specs */
204};
205
206
207/*** <<< INCLUDES [SignedREAL] >>> ***/
208
209#include <SIGNED.h>
210
211/*** <<< TYPE-DECLS [SignedREAL] >>> ***/
212
213typedef SIGNED_16P0_t SignedREAL_t;
214
215/*** <<< FUNC-DECLS [SignedREAL] >>> ***/
216
217extern asn_TYPE_descriptor_t asn_DEF_SignedREAL;
218asn_struct_free_f SignedREAL_free;
219asn_struct_print_f SignedREAL_print;
220asn_constr_check_f SignedREAL_constraint;
221ber_type_decoder_f SignedREAL_decode_ber;
222der_type_encoder_f SignedREAL_encode_der;
223xer_type_decoder_f SignedREAL_decode_xer;
224xer_type_encoder_f SignedREAL_encode_xer;
225
226/*** <<< CODE [SignedREAL] >>> ***/
227
228int
229SignedREAL_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000230 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkina00d6b32006-03-21 03:40:38 +0000231 /* Replace with underlying type checker */
232 td->check_constraints = asn_DEF_SIGNED_16P0.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000233 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkina00d6b32006-03-21 03:40:38 +0000234}
235
236/*
237 * This type is implemented using SIGNED_16P0,
238 * so here we adjust the DEF accordingly.
239 */
240static void
241SignedREAL_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
242 td->free_struct = asn_DEF_SIGNED_16P0.free_struct;
243 td->print_struct = asn_DEF_SIGNED_16P0.print_struct;
244 td->ber_decoder = asn_DEF_SIGNED_16P0.ber_decoder;
245 td->der_encoder = asn_DEF_SIGNED_16P0.der_encoder;
246 td->xer_decoder = asn_DEF_SIGNED_16P0.xer_decoder;
247 td->xer_encoder = asn_DEF_SIGNED_16P0.xer_encoder;
248 td->uper_decoder = asn_DEF_SIGNED_16P0.uper_decoder;
249 if(!td->per_constraints)
250 td->per_constraints = asn_DEF_SIGNED_16P0.per_constraints;
251 td->elements = asn_DEF_SIGNED_16P0.elements;
252 td->elements_count = asn_DEF_SIGNED_16P0.elements_count;
253 td->specifics = asn_DEF_SIGNED_16P0.specifics;
254}
255
256void
257SignedREAL_free(asn_TYPE_descriptor_t *td,
258 void *struct_ptr, int contents_only) {
259 SignedREAL_1_inherit_TYPE_descriptor(td);
260 td->free_struct(td, struct_ptr, contents_only);
261}
262
263int
264SignedREAL_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
265 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
266 SignedREAL_1_inherit_TYPE_descriptor(td);
267 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
268}
269
270asn_dec_rval_t
271SignedREAL_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
272 void **structure, const void *bufptr, size_t size, int tag_mode) {
273 SignedREAL_1_inherit_TYPE_descriptor(td);
274 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
275}
276
277asn_enc_rval_t
278SignedREAL_encode_der(asn_TYPE_descriptor_t *td,
279 void *structure, int tag_mode, ber_tlv_tag_t tag,
280 asn_app_consume_bytes_f *cb, void *app_key) {
281 SignedREAL_1_inherit_TYPE_descriptor(td);
282 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
283}
284
285asn_dec_rval_t
286SignedREAL_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
287 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
288 SignedREAL_1_inherit_TYPE_descriptor(td);
289 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
290}
291
292asn_enc_rval_t
293SignedREAL_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
294 int ilevel, enum xer_encoder_flags_e flags,
295 asn_app_consume_bytes_f *cb, void *app_key) {
296 SignedREAL_1_inherit_TYPE_descriptor(td);
297 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
298}
299
300
301/*** <<< STAT-DEFS [SignedREAL] >>> ***/
302
303static ber_tlv_tag_t asn_DEF_SignedREAL_tags_1[] = {
304 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
305};
306asn_TYPE_descriptor_t asn_DEF_SignedREAL = {
307 "SignedREAL",
308 "SignedREAL",
309 SignedREAL_free,
310 SignedREAL_print,
311 SignedREAL_constraint,
312 SignedREAL_decode_ber,
313 SignedREAL_encode_der,
314 SignedREAL_decode_xer,
315 SignedREAL_encode_xer,
316 0, /* No PER decoder, -gen-PER to enable */
317 0, /* Use generic outmost tag fetcher */
318 asn_DEF_SignedREAL_tags_1,
319 sizeof(asn_DEF_SignedREAL_tags_1)
320 /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
321 asn_DEF_SignedREAL_tags_1, /* Same as above */
322 sizeof(asn_DEF_SignedREAL_tags_1)
323 /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
324 0, /* No PER visible constraints */
325 0, 0, /* Defined elsewhere */
326 0 /* No specifics */
327};
328
329
330/*** <<< INCLUDES [SignedSET] >>> ***/
331
332#include <SIGNED.h>
333
334/*** <<< TYPE-DECLS [SignedSET] >>> ***/
335
336typedef SIGNED_16P1_t SignedSET_t;
337
338/*** <<< FUNC-DECLS [SignedSET] >>> ***/
339
340extern asn_TYPE_descriptor_t asn_DEF_SignedSET;
341asn_struct_free_f SignedSET_free;
342asn_struct_print_f SignedSET_print;
343asn_constr_check_f SignedSET_constraint;
344ber_type_decoder_f SignedSET_decode_ber;
345der_type_encoder_f SignedSET_encode_der;
346xer_type_decoder_f SignedSET_decode_xer;
347xer_type_encoder_f SignedSET_encode_xer;
348
349/*** <<< CODE [SignedSET] >>> ***/
350
351int
352SignedSET_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000353 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkina00d6b32006-03-21 03:40:38 +0000354 /* Replace with underlying type checker */
355 td->check_constraints = asn_DEF_SIGNED_16P1.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000356 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkina00d6b32006-03-21 03:40:38 +0000357}
358
359/*
360 * This type is implemented using SIGNED_16P1,
361 * so here we adjust the DEF accordingly.
362 */
363static void
364SignedSET_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
365 td->free_struct = asn_DEF_SIGNED_16P1.free_struct;
366 td->print_struct = asn_DEF_SIGNED_16P1.print_struct;
367 td->ber_decoder = asn_DEF_SIGNED_16P1.ber_decoder;
368 td->der_encoder = asn_DEF_SIGNED_16P1.der_encoder;
369 td->xer_decoder = asn_DEF_SIGNED_16P1.xer_decoder;
370 td->xer_encoder = asn_DEF_SIGNED_16P1.xer_encoder;
371 td->uper_decoder = asn_DEF_SIGNED_16P1.uper_decoder;
372 if(!td->per_constraints)
373 td->per_constraints = asn_DEF_SIGNED_16P1.per_constraints;
374 td->elements = asn_DEF_SIGNED_16P1.elements;
375 td->elements_count = asn_DEF_SIGNED_16P1.elements_count;
376 td->specifics = asn_DEF_SIGNED_16P1.specifics;
377}
378
379void
380SignedSET_free(asn_TYPE_descriptor_t *td,
381 void *struct_ptr, int contents_only) {
382 SignedSET_1_inherit_TYPE_descriptor(td);
383 td->free_struct(td, struct_ptr, contents_only);
384}
385
386int
387SignedSET_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
388 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
389 SignedSET_1_inherit_TYPE_descriptor(td);
390 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
391}
392
393asn_dec_rval_t
394SignedSET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
395 void **structure, const void *bufptr, size_t size, int tag_mode) {
396 SignedSET_1_inherit_TYPE_descriptor(td);
397 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
398}
399
400asn_enc_rval_t
401SignedSET_encode_der(asn_TYPE_descriptor_t *td,
402 void *structure, int tag_mode, ber_tlv_tag_t tag,
403 asn_app_consume_bytes_f *cb, void *app_key) {
404 SignedSET_1_inherit_TYPE_descriptor(td);
405 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
406}
407
408asn_dec_rval_t
409SignedSET_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
410 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
411 SignedSET_1_inherit_TYPE_descriptor(td);
412 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
413}
414
415asn_enc_rval_t
416SignedSET_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
417 int ilevel, enum xer_encoder_flags_e flags,
418 asn_app_consume_bytes_f *cb, void *app_key) {
419 SignedSET_1_inherit_TYPE_descriptor(td);
420 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
421}
422
423
424/*** <<< STAT-DEFS [SignedSET] >>> ***/
425
426static ber_tlv_tag_t asn_DEF_SignedSET_tags_1[] = {
427 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
428};
429asn_TYPE_descriptor_t asn_DEF_SignedSET = {
430 "SignedSET",
431 "SignedSET",
432 SignedSET_free,
433 SignedSET_print,
434 SignedSET_constraint,
435 SignedSET_decode_ber,
436 SignedSET_encode_der,
437 SignedSET_decode_xer,
438 SignedSET_encode_xer,
439 0, /* No PER decoder, -gen-PER to enable */
440 0, /* Use generic outmost tag fetcher */
441 asn_DEF_SignedSET_tags_1,
442 sizeof(asn_DEF_SignedSET_tags_1)
443 /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
444 asn_DEF_SignedSET_tags_1, /* Same as above */
445 sizeof(asn_DEF_SignedSET_tags_1)
446 /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
447 0, /* No PER visible constraints */
448 0, 0, /* Defined elsewhere */
449 0 /* No specifics */
450};
451