blob: 8a9b9f8675ea182d519876231f247648d54384df [file] [log] [blame]
vlm0c6d3812006-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,
vlmb1b193e2006-08-18 01:46:46 +000086 0, 0, /* No PER support, use "-gen-PER" to enable */
vlm0c6d3812006-03-21 03:40:38 +000087 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,
vlmb1b193e2006-08-18 01:46:46 +0000142 0, 0, /* No PER support, use "-gen-PER" to enable */
vlm0c6d3812006-03-21 03:40:38 +0000143 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,
vlmb1b193e2006-08-18 01:46:46 +0000192 0, 0, /* No PER support, use "-gen-PER" to enable */
vlm0c6d3812006-03-21 03:40:38 +0000193 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
vlmea226772006-09-13 02:51:20 +0000209#include "SIGNED.h"
vlm0c6d3812006-03-21 03:40:38 +0000210
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,
vlmaf68ef52006-07-13 11:19:01 +0000230 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm0c6d3812006-03-21 03:40:38 +0000231 /* Replace with underlying type checker */
232 td->check_constraints = asn_DEF_SIGNED_16P0.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +0000233 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm0c6d3812006-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;
vlmb1b193e2006-08-18 01:46:46 +0000249 td->uper_encoder = asn_DEF_SIGNED_16P0.uper_encoder;
vlm0c6d3812006-03-21 03:40:38 +0000250 if(!td->per_constraints)
251 td->per_constraints = asn_DEF_SIGNED_16P0.per_constraints;
252 td->elements = asn_DEF_SIGNED_16P0.elements;
253 td->elements_count = asn_DEF_SIGNED_16P0.elements_count;
254 td->specifics = asn_DEF_SIGNED_16P0.specifics;
255}
256
257void
258SignedREAL_free(asn_TYPE_descriptor_t *td,
259 void *struct_ptr, int contents_only) {
260 SignedREAL_1_inherit_TYPE_descriptor(td);
261 td->free_struct(td, struct_ptr, contents_only);
262}
263
264int
265SignedREAL_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
266 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
267 SignedREAL_1_inherit_TYPE_descriptor(td);
268 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
269}
270
271asn_dec_rval_t
272SignedREAL_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
273 void **structure, const void *bufptr, size_t size, int tag_mode) {
274 SignedREAL_1_inherit_TYPE_descriptor(td);
275 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
276}
277
278asn_enc_rval_t
279SignedREAL_encode_der(asn_TYPE_descriptor_t *td,
280 void *structure, int tag_mode, ber_tlv_tag_t tag,
281 asn_app_consume_bytes_f *cb, void *app_key) {
282 SignedREAL_1_inherit_TYPE_descriptor(td);
283 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
284}
285
286asn_dec_rval_t
287SignedREAL_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
288 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
289 SignedREAL_1_inherit_TYPE_descriptor(td);
290 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
291}
292
293asn_enc_rval_t
294SignedREAL_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
295 int ilevel, enum xer_encoder_flags_e flags,
296 asn_app_consume_bytes_f *cb, void *app_key) {
297 SignedREAL_1_inherit_TYPE_descriptor(td);
298 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
299}
300
301
302/*** <<< STAT-DEFS [SignedREAL] >>> ***/
303
304static ber_tlv_tag_t asn_DEF_SignedREAL_tags_1[] = {
305 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
306};
307asn_TYPE_descriptor_t asn_DEF_SignedREAL = {
308 "SignedREAL",
309 "SignedREAL",
310 SignedREAL_free,
311 SignedREAL_print,
312 SignedREAL_constraint,
313 SignedREAL_decode_ber,
314 SignedREAL_encode_der,
315 SignedREAL_decode_xer,
316 SignedREAL_encode_xer,
vlmb1b193e2006-08-18 01:46:46 +0000317 0, 0, /* No PER support, use "-gen-PER" to enable */
vlm0c6d3812006-03-21 03:40:38 +0000318 0, /* Use generic outmost tag fetcher */
319 asn_DEF_SignedREAL_tags_1,
320 sizeof(asn_DEF_SignedREAL_tags_1)
321 /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
322 asn_DEF_SignedREAL_tags_1, /* Same as above */
323 sizeof(asn_DEF_SignedREAL_tags_1)
324 /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
325 0, /* No PER visible constraints */
326 0, 0, /* Defined elsewhere */
327 0 /* No specifics */
328};
329
330
331/*** <<< INCLUDES [SignedSET] >>> ***/
332
vlmea226772006-09-13 02:51:20 +0000333#include "SIGNED.h"
vlm0c6d3812006-03-21 03:40:38 +0000334
335/*** <<< TYPE-DECLS [SignedSET] >>> ***/
336
337typedef SIGNED_16P1_t SignedSET_t;
338
339/*** <<< FUNC-DECLS [SignedSET] >>> ***/
340
341extern asn_TYPE_descriptor_t asn_DEF_SignedSET;
342asn_struct_free_f SignedSET_free;
343asn_struct_print_f SignedSET_print;
344asn_constr_check_f SignedSET_constraint;
345ber_type_decoder_f SignedSET_decode_ber;
346der_type_encoder_f SignedSET_encode_der;
347xer_type_decoder_f SignedSET_decode_xer;
348xer_type_encoder_f SignedSET_encode_xer;
349
350/*** <<< CODE [SignedSET] >>> ***/
351
352int
353SignedSET_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +0000354 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlm0c6d3812006-03-21 03:40:38 +0000355 /* Replace with underlying type checker */
356 td->check_constraints = asn_DEF_SIGNED_16P1.check_constraints;
vlmaf68ef52006-07-13 11:19:01 +0000357 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlm0c6d3812006-03-21 03:40:38 +0000358}
359
360/*
361 * This type is implemented using SIGNED_16P1,
362 * so here we adjust the DEF accordingly.
363 */
364static void
365SignedSET_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
366 td->free_struct = asn_DEF_SIGNED_16P1.free_struct;
367 td->print_struct = asn_DEF_SIGNED_16P1.print_struct;
368 td->ber_decoder = asn_DEF_SIGNED_16P1.ber_decoder;
369 td->der_encoder = asn_DEF_SIGNED_16P1.der_encoder;
370 td->xer_decoder = asn_DEF_SIGNED_16P1.xer_decoder;
371 td->xer_encoder = asn_DEF_SIGNED_16P1.xer_encoder;
372 td->uper_decoder = asn_DEF_SIGNED_16P1.uper_decoder;
vlmb1b193e2006-08-18 01:46:46 +0000373 td->uper_encoder = asn_DEF_SIGNED_16P1.uper_encoder;
vlm0c6d3812006-03-21 03:40:38 +0000374 if(!td->per_constraints)
375 td->per_constraints = asn_DEF_SIGNED_16P1.per_constraints;
376 td->elements = asn_DEF_SIGNED_16P1.elements;
377 td->elements_count = asn_DEF_SIGNED_16P1.elements_count;
378 td->specifics = asn_DEF_SIGNED_16P1.specifics;
379}
380
381void
382SignedSET_free(asn_TYPE_descriptor_t *td,
383 void *struct_ptr, int contents_only) {
384 SignedSET_1_inherit_TYPE_descriptor(td);
385 td->free_struct(td, struct_ptr, contents_only);
386}
387
388int
389SignedSET_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
390 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
391 SignedSET_1_inherit_TYPE_descriptor(td);
392 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
393}
394
395asn_dec_rval_t
396SignedSET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
397 void **structure, const void *bufptr, size_t size, int tag_mode) {
398 SignedSET_1_inherit_TYPE_descriptor(td);
399 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
400}
401
402asn_enc_rval_t
403SignedSET_encode_der(asn_TYPE_descriptor_t *td,
404 void *structure, int tag_mode, ber_tlv_tag_t tag,
405 asn_app_consume_bytes_f *cb, void *app_key) {
406 SignedSET_1_inherit_TYPE_descriptor(td);
407 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
408}
409
410asn_dec_rval_t
411SignedSET_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
412 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
413 SignedSET_1_inherit_TYPE_descriptor(td);
414 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
415}
416
417asn_enc_rval_t
418SignedSET_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
419 int ilevel, enum xer_encoder_flags_e flags,
420 asn_app_consume_bytes_f *cb, void *app_key) {
421 SignedSET_1_inherit_TYPE_descriptor(td);
422 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
423}
424
425
426/*** <<< STAT-DEFS [SignedSET] >>> ***/
427
428static ber_tlv_tag_t asn_DEF_SignedSET_tags_1[] = {
429 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
430};
431asn_TYPE_descriptor_t asn_DEF_SignedSET = {
432 "SignedSET",
433 "SignedSET",
434 SignedSET_free,
435 SignedSET_print,
436 SignedSET_constraint,
437 SignedSET_decode_ber,
438 SignedSET_encode_der,
439 SignedSET_decode_xer,
440 SignedSET_encode_xer,
vlmb1b193e2006-08-18 01:46:46 +0000441 0, 0, /* No PER support, use "-gen-PER" to enable */
vlm0c6d3812006-03-21 03:40:38 +0000442 0, /* Use generic outmost tag fetcher */
443 asn_DEF_SignedSET_tags_1,
444 sizeof(asn_DEF_SignedSET_tags_1)
445 /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
446 asn_DEF_SignedSET_tags_1, /* Same as above */
447 sizeof(asn_DEF_SignedSET_tags_1)
448 /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
449 0, /* No PER visible constraints */
450 0, 0, /* Defined elsewhere */
451 0 /* No specifics */
452};
453