blob: 1a5121f638cb98e0319c9cffb60e07db1e4b8e26 [file] [log] [blame]
Bi-Ruei, Chiubc6ef1f2017-10-20 22:38:01 +08001
2/*** <<< INCLUDES [PacketId] >>> ***/
3
4#include <NativeInteger.h>
5
6/*** <<< TYPE-DECLS [PacketId] >>> ***/
7
8typedef long PacketId_t;
9
10/*** <<< FUNC-DECLS [PacketId] >>> ***/
11
12extern asn_per_constraints_t asn_PER_type_PacketId_constr_1;
13extern asn_TYPE_descriptor_t asn_DEF_PacketId;
14asn_struct_free_f PacketId_free;
15asn_struct_print_f PacketId_print;
16asn_constr_check_f PacketId_constraint;
17ber_type_decoder_f PacketId_decode_ber;
18der_type_encoder_f PacketId_encode_der;
19xer_type_decoder_f PacketId_decode_xer;
20xer_type_encoder_f PacketId_encode_xer;
21per_type_decoder_f PacketId_decode_uper;
22per_type_encoder_f PacketId_encode_uper;
23
24/*** <<< CODE [PacketId] >>> ***/
25
26int
27PacketId_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
28 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
29 long value;
30
31 if(!sptr) {
32 ASN__CTFAIL(app_key, td, sptr,
33 "%s: value not given (%s:%d)",
34 td->name, __FILE__, __LINE__);
35 return -1;
36 }
37
38 value = *(const long *)sptr;
39
40 if((value >= 0 && value <= 65535)) {
41 /* Constraint check succeeded */
42 return 0;
43 } else {
44 ASN__CTFAIL(app_key, td, sptr,
45 "%s: constraint failed (%s:%d)",
46 td->name, __FILE__, __LINE__);
47 return -1;
48 }
49}
50
51/*
52 * This type is implemented using NativeInteger,
53 * so here we adjust the DEF accordingly.
54 */
55
56/*** <<< CTDEFS [PacketId] >>> ***/
57
58asn_per_constraints_t asn_PER_type_PacketId_constr_1 CC_NOTUSED = {
59 { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */,
60 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
61 0, 0 /* No PER value map */
62};
63
64/*** <<< STAT-DEFS [PacketId] >>> ***/
65
66static const ber_tlv_tag_t asn_DEF_PacketId_tags_1[] = {
67 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
68};
69asn_TYPE_descriptor_t asn_DEF_PacketId = {
70 "PacketId",
71 "PacketId",
72 &asn_OP_NativeInteger,
73 asn_DEF_PacketId_tags_1,
74 sizeof(asn_DEF_PacketId_tags_1)
75 /sizeof(asn_DEF_PacketId_tags_1[0]), /* 1 */
76 asn_DEF_PacketId_tags_1, /* Same as above */
77 sizeof(asn_DEF_PacketId_tags_1)
78 /sizeof(asn_DEF_PacketId_tags_1[0]), /* 1 */
79 { 0, &asn_PER_type_PacketId_constr_1, PacketId_constraint },
80 0, 0, /* No members */
81 0 /* No specifics */
82};
83
84
85/*** <<< INCLUDES [Color] >>> ***/
86
87#include <NativeEnumerated.h>
88
89/*** <<< DEPS [Color] >>> ***/
90
91typedef enum Color {
92 Color_red = 0,
93 Color_green = 1,
94 Color_blue = 2
95} e_Color;
96
97/*** <<< TYPE-DECLS [Color] >>> ***/
98
99typedef long Color_t;
100
101/*** <<< FUNC-DECLS [Color] >>> ***/
102
103extern asn_per_constraints_t asn_PER_type_Color_constr_1;
104extern asn_TYPE_descriptor_t asn_DEF_Color;
105extern const asn_INTEGER_specifics_t asn_SPC_Color_specs_1;
106asn_struct_free_f Color_free;
107asn_struct_print_f Color_print;
108asn_constr_check_f Color_constraint;
109ber_type_decoder_f Color_decode_ber;
110der_type_encoder_f Color_encode_der;
111xer_type_decoder_f Color_decode_xer;
112xer_type_encoder_f Color_encode_xer;
113per_type_decoder_f Color_decode_uper;
114per_type_encoder_f Color_encode_uper;
115
116/*** <<< CODE [Color] >>> ***/
117
118/*
119 * This type is implemented using NativeEnumerated,
120 * so here we adjust the DEF accordingly.
121 */
122
123/*** <<< CTDEFS [Color] >>> ***/
124
125asn_per_constraints_t asn_PER_type_Color_constr_1 CC_NOTUSED = {
126 { APC_CONSTRAINED, 2, 2, 0, 2 } /* (0..2) */,
127 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
128 0, 0 /* No PER value map */
129};
130
131/*** <<< STAT-DEFS [Color] >>> ***/
132
133static const asn_INTEGER_enum_map_t asn_MAP_Color_value2enum_1[] = {
134 { 0, 3, "red" },
135 { 1, 5, "green" },
136 { 2, 4, "blue" }
137};
138static const unsigned int asn_MAP_Color_enum2value_1[] = {
139 2, /* blue(2) */
140 1, /* green(1) */
141 0 /* red(0) */
142};
143const asn_INTEGER_specifics_t asn_SPC_Color_specs_1 = {
144 asn_MAP_Color_value2enum_1, /* "tag" => N; sorted by tag */
145 asn_MAP_Color_enum2value_1, /* N => "tag"; sorted by N */
146 3, /* Number of elements in the maps */
147 0, /* Enumeration is not extensible */
148 1, /* Strict enumeration */
149 0, /* Native long size */
150 0
151};
152static const ber_tlv_tag_t asn_DEF_Color_tags_1[] = {
153 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
154};
155asn_TYPE_descriptor_t asn_DEF_Color = {
156 "Color",
157 "Color",
158 &asn_OP_NativeEnumerated,
159 asn_DEF_Color_tags_1,
160 sizeof(asn_DEF_Color_tags_1)
161 /sizeof(asn_DEF_Color_tags_1[0]), /* 1 */
162 asn_DEF_Color_tags_1, /* Same as above */
163 sizeof(asn_DEF_Color_tags_1)
164 /sizeof(asn_DEF_Color_tags_1[0]), /* 1 */
165 { 0, &asn_PER_type_Color_constr_1, NativeEnumerated_constraint },
166 0, 0, /* Defined elsewhere */
167 &asn_SPC_Color_specs_1 /* Additional specs */
168};
169
170
171/*** <<< INCLUDES [Valid] >>> ***/
172
173#include <NativeEnumerated.h>
174
175/*** <<< DEPS [Valid] >>> ***/
176
177typedef enum Valid {
178 Valid_crc_nok = 0,
179 Valid_crc_ok = 1
180} e_Valid;
181
182/*** <<< TYPE-DECLS [Valid] >>> ***/
183
184typedef long Valid_t;
185
186/*** <<< FUNC-DECLS [Valid] >>> ***/
187
188extern asn_per_constraints_t asn_PER_type_Valid_constr_1;
189extern asn_TYPE_descriptor_t asn_DEF_Valid;
190extern const asn_INTEGER_specifics_t asn_SPC_Valid_specs_1;
191asn_struct_free_f Valid_free;
192asn_struct_print_f Valid_print;
193asn_constr_check_f Valid_constraint;
194ber_type_decoder_f Valid_decode_ber;
195der_type_encoder_f Valid_encode_der;
196xer_type_decoder_f Valid_decode_xer;
197xer_type_encoder_f Valid_encode_xer;
198per_type_decoder_f Valid_decode_uper;
199per_type_encoder_f Valid_encode_uper;
200
201/*** <<< CODE [Valid] >>> ***/
202
203/*
204 * This type is implemented using NativeEnumerated,
205 * so here we adjust the DEF accordingly.
206 */
207
208/*** <<< CTDEFS [Valid] >>> ***/
209
210asn_per_constraints_t asn_PER_type_Valid_constr_1 CC_NOTUSED = {
211 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
212 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
213 0, 0 /* No PER value map */
214};
215
216/*** <<< STAT-DEFS [Valid] >>> ***/
217
218static const asn_INTEGER_enum_map_t asn_MAP_Valid_value2enum_1[] = {
219 { 0, 7, "crc-nok" },
220 { 1, 6, "crc-ok" }
221};
222static const unsigned int asn_MAP_Valid_enum2value_1[] = {
223 0, /* crc-nok(0) */
224 1 /* crc-ok(1) */
225};
226const asn_INTEGER_specifics_t asn_SPC_Valid_specs_1 = {
227 asn_MAP_Valid_value2enum_1, /* "tag" => N; sorted by tag */
228 asn_MAP_Valid_enum2value_1, /* N => "tag"; sorted by N */
229 2, /* Number of elements in the maps */
230 0, /* Enumeration is not extensible */
231 1, /* Strict enumeration */
232 0, /* Native long size */
233 0
234};
235static const ber_tlv_tag_t asn_DEF_Valid_tags_1[] = {
236 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
237};
238asn_TYPE_descriptor_t asn_DEF_Valid = {
239 "Valid",
240 "Valid",
241 &asn_OP_NativeEnumerated,
242 asn_DEF_Valid_tags_1,
243 sizeof(asn_DEF_Valid_tags_1)
244 /sizeof(asn_DEF_Valid_tags_1[0]), /* 1 */
245 asn_DEF_Valid_tags_1, /* Same as above */
246 sizeof(asn_DEF_Valid_tags_1)
247 /sizeof(asn_DEF_Valid_tags_1[0]), /* 1 */
248 { 0, &asn_PER_type_Valid_constr_1, NativeEnumerated_constraint },
249 0, 0, /* Defined elsewhere */
250 &asn_SPC_Valid_specs_1 /* Additional specs */
251};
252
253
254/*** <<< INCLUDES [Packet-List] >>> ***/
255
256#include "UpperLayer-List.h"
257
258/*** <<< TYPE-DECLS [Packet-List] >>> ***/
259
260typedef UpperLayer_List_41P0_t Packet_List_t;
261
262/*** <<< FUNC-DECLS [Packet-List] >>> ***/
263
264extern asn_TYPE_descriptor_t asn_DEF_Packet_List;
265asn_struct_free_f Packet_List_free;
266asn_struct_print_f Packet_List_print;
267asn_constr_check_f Packet_List_constraint;
268ber_type_decoder_f Packet_List_decode_ber;
269der_type_encoder_f Packet_List_encode_der;
270xer_type_decoder_f Packet_List_decode_xer;
271xer_type_encoder_f Packet_List_encode_xer;
272per_type_decoder_f Packet_List_decode_uper;
273per_type_encoder_f Packet_List_encode_uper;
274
275/*** <<< CODE [Packet-List] >>> ***/
276
277int
278Packet_List_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
279 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
280 size_t size;
281
282 if(!sptr) {
283 ASN__CTFAIL(app_key, td, sptr,
284 "%s: value not given (%s:%d)",
285 td->name, __FILE__, __LINE__);
286 return -1;
287 }
288
289 /* Determine the number of elements */
290 size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
291
292 if((size >= 1 && size <= 256)) {
293 /* Perform validation of the inner elements */
294 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
295 } else {
296 ASN__CTFAIL(app_key, td, sptr,
297 "%s: constraint failed (%s:%d)",
298 td->name, __FILE__, __LINE__);
299 return -1;
300 }
301}
302
303/*
304 * This type is implemented using UpperLayer_List_41P0,
305 * so here we adjust the DEF accordingly.
306 */
307
308/*** <<< CTDEFS [Packet-List] >>> ***/
309
310static asn_per_constraints_t asn_PER_type_Packet_List_constr_1 CC_NOTUSED = {
311 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
312 { APC_CONSTRAINED, 8, 8, 1, 256 } /* (SIZE(1..256)) */,
313 0, 0 /* No PER value map */
314};
315
316/*** <<< STAT-DEFS [Packet-List] >>> ***/
317
318static const ber_tlv_tag_t asn_DEF_Packet_List_tags_1[] = {
319 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
320};
321asn_TYPE_descriptor_t asn_DEF_Packet_List = {
322 "Packet-List",
323 "Packet-List",
324 &asn_OP_SEQUENCE_OF,
325 asn_DEF_Packet_List_tags_1,
326 sizeof(asn_DEF_Packet_List_tags_1)
327 /sizeof(asn_DEF_Packet_List_tags_1[0]), /* 1 */
328 asn_DEF_Packet_List_tags_1, /* Same as above */
329 sizeof(asn_DEF_Packet_List_tags_1)
330 /sizeof(asn_DEF_Packet_List_tags_1[0]), /* 1 */
331 { 0, &asn_PER_type_Packet_List_constr_1, Packet_List_constraint },
332 asn_MBR_LowerLayer_List_45P0_1,
333 1, /* Single element */
334 &asn_SPC_LowerLayer_List_45P0_specs_1 /* Additional specs */
335};
336
337
338/*** <<< INCLUDES [UpperLayer-List] >>> ***/
339
340#include "LowerLayer-List.h"
341
342/*** <<< TYPE-DECLS [UpperLayer-List] >>> ***/
343
344typedef LowerLayer_List_45P0_t UpperLayer_List_41P0_t;
345
346/*** <<< FUNC-DECLS [UpperLayer-List] >>> ***/
347
348extern asn_per_constraints_t asn_PER_type_UpperLayer_List_41P0_constr_1;
349extern asn_TYPE_descriptor_t asn_DEF_UpperLayer_List_41P0;
350asn_struct_free_f UpperLayer_List_41P0_free;
351asn_struct_print_f UpperLayer_List_41P0_print;
352asn_constr_check_f UpperLayer_List_41P0_constraint;
353ber_type_decoder_f UpperLayer_List_41P0_decode_ber;
354der_type_encoder_f UpperLayer_List_41P0_encode_der;
355xer_type_decoder_f UpperLayer_List_41P0_decode_xer;
356xer_type_encoder_f UpperLayer_List_41P0_encode_xer;
357per_type_decoder_f UpperLayer_List_41P0_decode_uper;
358per_type_encoder_f UpperLayer_List_41P0_encode_uper;
359
360/*** <<< CODE [UpperLayer-List] >>> ***/
361
362int
363UpperLayer_List_41P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
364 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
365 size_t size;
366
367 if(!sptr) {
368 ASN__CTFAIL(app_key, td, sptr,
369 "%s: value not given (%s:%d)",
370 td->name, __FILE__, __LINE__);
371 return -1;
372 }
373
374 /* Determine the number of elements */
375 size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
376
377 if((size >= 1 && size <= 256)) {
378 /* Perform validation of the inner elements */
379 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
380 } else {
381 ASN__CTFAIL(app_key, td, sptr,
382 "%s: constraint failed (%s:%d)",
383 td->name, __FILE__, __LINE__);
384 return -1;
385 }
386}
387
388/*
389 * This type is implemented using LowerLayer_List_45P0,
390 * so here we adjust the DEF accordingly.
391 */
392
393/*** <<< CTDEFS [UpperLayer-List] >>> ***/
394
395asn_per_constraints_t asn_PER_type_UpperLayer_List_41P0_constr_1 CC_NOTUSED = {
396 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
397 { APC_CONSTRAINED, 8, 8, 1, 256 } /* (SIZE(1..256)) */,
398 0, 0 /* No PER value map */
399};
400
401/*** <<< STAT-DEFS [UpperLayer-List] >>> ***/
402
403static const ber_tlv_tag_t asn_DEF_UpperLayer_List_41P0_tags_1[] = {
404 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
405};
406asn_TYPE_descriptor_t asn_DEF_UpperLayer_List_41P0 = {
407 "UpperLayer-List",
408 "UpperLayer-List",
409 &asn_OP_SEQUENCE_OF,
410 asn_DEF_UpperLayer_List_41P0_tags_1,
411 sizeof(asn_DEF_UpperLayer_List_41P0_tags_1)
412 /sizeof(asn_DEF_UpperLayer_List_41P0_tags_1[0]), /* 1 */
413 asn_DEF_UpperLayer_List_41P0_tags_1, /* Same as above */
414 sizeof(asn_DEF_UpperLayer_List_41P0_tags_1)
415 /sizeof(asn_DEF_UpperLayer_List_41P0_tags_1[0]), /* 1 */
416 { 0, &asn_PER_type_UpperLayer_List_41P0_constr_1, UpperLayer_List_41P0_constraint },
417 asn_MBR_LowerLayer_List_45P0_1,
418 1, /* Single element */
419 &asn_SPC_LowerLayer_List_45P0_specs_1 /* Additional specs */
420};
421
422
423/*** <<< INCLUDES [LowerLayer-List] >>> ***/
424
425#include <asn_SEQUENCE_OF.h>
426#include <constr_SEQUENCE_OF.h>
427
428/*** <<< FWD-DECLS [LowerLayer-List] >>> ***/
429
430struct SinglePacket;
431
432/*** <<< TYPE-DECLS [LowerLayer-List] >>> ***/
433
434typedef struct LowerLayer_List_45P0 {
435 A_SEQUENCE_OF(struct SinglePacket) list;
436
437 /* Context for parsing across buffer boundaries */
438 asn_struct_ctx_t _asn_ctx;
439} LowerLayer_List_45P0_t;
440
441/*** <<< FUNC-DECLS [LowerLayer-List] >>> ***/
442
443extern asn_TYPE_descriptor_t asn_DEF_LowerLayer_List_45P0;
444extern asn_SET_OF_specifics_t asn_SPC_LowerLayer_List_45P0_specs_1;
445extern asn_TYPE_member_t asn_MBR_LowerLayer_List_45P0_1[1];
446extern asn_per_constraints_t asn_PER_type_LowerLayer_List_45P0_constr_1;
447
448/*** <<< POST-INCLUDE [LowerLayer-List] >>> ***/
449
450#include "SinglePacket.h"
451
452/*** <<< CTDEFS [LowerLayer-List] >>> ***/
453
454asn_per_constraints_t asn_PER_type_LowerLayer_List_45P0_constr_1 CC_NOTUSED = {
455 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
456 { APC_CONSTRAINED, 8, 8, 1, 256 } /* (SIZE(1..256)) */,
457 0, 0 /* No PER value map */
458};
459
460/*** <<< STAT-DEFS [LowerLayer-List] >>> ***/
461
462asn_TYPE_member_t asn_MBR_LowerLayer_List_45P0_1[] = {
463 { ATF_POINTER, 0, 0,
464 .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
465 .tag_mode = 0,
466 .type = &asn_DEF_SinglePacket_48P0,
467 .type_selector = 0,
468 { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
469 0, 0, /* No default value */
470 .name = ""
471 },
472};
473static const ber_tlv_tag_t asn_DEF_LowerLayer_List_45P0_tags_1[] = {
474 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
475};
476asn_SET_OF_specifics_t asn_SPC_LowerLayer_List_45P0_specs_1 = {
477 sizeof(struct LowerLayer_List_45P0),
478 offsetof(struct LowerLayer_List_45P0, _asn_ctx),
479 0, /* XER encoding is XMLDelimitedItemList */
480};
481asn_TYPE_descriptor_t asn_DEF_LowerLayer_List_45P0 = {
482 "LowerLayer-List",
483 "LowerLayer-List",
484 &asn_OP_SEQUENCE_OF,
485 asn_DEF_LowerLayer_List_45P0_tags_1,
486 sizeof(asn_DEF_LowerLayer_List_45P0_tags_1)
487 /sizeof(asn_DEF_LowerLayer_List_45P0_tags_1[0]), /* 1 */
488 asn_DEF_LowerLayer_List_45P0_tags_1, /* Same as above */
489 sizeof(asn_DEF_LowerLayer_List_45P0_tags_1)
490 /sizeof(asn_DEF_LowerLayer_List_45P0_tags_1[0]), /* 1 */
491 { 0, &asn_PER_type_LowerLayer_List_45P0_constr_1, SEQUENCE_OF_constraint },
492 asn_MBR_LowerLayer_List_45P0_1,
493 1, /* Single element */
494 &asn_SPC_LowerLayer_List_45P0_specs_1 /* Additional specs */
495};
496
497
498/*** <<< INCLUDES [SinglePacket] >>> ***/
499
500#include "Packet.h"
501
502/*** <<< TYPE-DECLS [SinglePacket] >>> ***/
503
504typedef Packet_51P0_t SinglePacket_48P0_t;
505
506/*** <<< FUNC-DECLS [SinglePacket] >>> ***/
507
508extern asn_TYPE_descriptor_t asn_DEF_SinglePacket_48P0;
509asn_struct_free_f SinglePacket_48P0_free;
510asn_struct_print_f SinglePacket_48P0_print;
511asn_constr_check_f SinglePacket_48P0_constraint;
512ber_type_decoder_f SinglePacket_48P0_decode_ber;
513der_type_encoder_f SinglePacket_48P0_encode_der;
514xer_type_decoder_f SinglePacket_48P0_decode_xer;
515xer_type_encoder_f SinglePacket_48P0_encode_xer;
516per_type_decoder_f SinglePacket_48P0_decode_uper;
517per_type_encoder_f SinglePacket_48P0_encode_uper;
518
519/*** <<< CODE [SinglePacket] >>> ***/
520
521/*
522 * This type is implemented using Packet_51P0,
523 * so here we adjust the DEF accordingly.
524 */
525
526/*** <<< STAT-DEFS [SinglePacket] >>> ***/
527
528static const ber_tlv_tag_t asn_DEF_SinglePacket_48P0_tags_1[] = {
529 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
530};
531asn_TYPE_descriptor_t asn_DEF_SinglePacket_48P0 = {
532 "SinglePacket",
533 "SinglePacket",
534 &asn_OP_SEQUENCE,
535 asn_DEF_SinglePacket_48P0_tags_1,
536 sizeof(asn_DEF_SinglePacket_48P0_tags_1)
537 /sizeof(asn_DEF_SinglePacket_48P0_tags_1[0]), /* 1 */
538 asn_DEF_SinglePacket_48P0_tags_1, /* Same as above */
539 sizeof(asn_DEF_SinglePacket_48P0_tags_1)
540 /sizeof(asn_DEF_SinglePacket_48P0_tags_1[0]), /* 1 */
541 { 0, 0, SEQUENCE_constraint },
542 asn_MBR_Packet_51P0_1,
543 3, /* Elements count */
544 &asn_SPC_Packet_51P0_specs_1 /* Additional specs */
545};
546
547
548/*** <<< INCLUDES [Packet] >>> ***/
549
550#include "PacketId.h"
551#include "Color.h"
552#include <ANY.h>
553#include <asn_ioc.h>
554#include <OPEN_TYPE.h>
555#include <constr_CHOICE.h>
556#include <constr_SEQUENCE.h>
557
558/*** <<< DEPS [Packet] >>> ***/
559
560typedef enum value_PR {
561 value_PR_NOTHING, /* No components present */
562
563} value_PR;
564
565/*** <<< TYPE-DECLS [Packet] >>> ***/
566
567typedef struct Packet_51P0 {
568 PacketId_t id;
569 Color_t color;
570 struct value {
571 value_PR present;
572 union Packet_51P0__value_u {
573 } choice;
574
575 /* Context for parsing across buffer boundaries */
576 asn_struct_ctx_t _asn_ctx;
577 } value;
578
579 /* Context for parsing across buffer boundaries */
580 asn_struct_ctx_t _asn_ctx;
581} Packet_51P0_t;
582
583/*** <<< FUNC-DECLS [Packet] >>> ***/
584
585extern asn_TYPE_descriptor_t asn_DEF_Packet_51P0;
586extern asn_SEQUENCE_specifics_t asn_SPC_Packet_51P0_specs_1;
587extern asn_TYPE_member_t asn_MBR_Packet_51P0_1[3];
588
589/*** <<< IOC-TABLES [Packet] >>> ***/
590
591static const asn_ioc_cell_t asn_IOS_ClassItem_1_rows[] = {
592
593};
594static const asn_ioc_set_t asn_IOS_ClassItem_1[] = {
595 0, 0, asn_IOS_ClassItem_1_rows
596};
597
598/*** <<< CODE [Packet] >>> ***/
599
600static int
601memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
602 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
603 long value;
604
605 if(!sptr) {
606 ASN__CTFAIL(app_key, td, sptr,
607 "%s: value not given (%s:%d)",
608 td->name, __FILE__, __LINE__);
609 return -1;
610 }
611
612 value = *(const long *)sptr;
613
614 if((value >= 0 && value <= 65535)) {
615 /* Constraint check succeeded */
616 return 0;
617 } else {
618 ASN__CTFAIL(app_key, td, sptr,
619 "%s: constraint failed (%s:%d)",
620 td->name, __FILE__, __LINE__);
621 return -1;
622 }
623}
624
625static int
626memb_color_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
627 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
628
629 if(!sptr) {
630 ASN__CTFAIL(app_key, td, sptr,
631 "%s: value not given (%s:%d)",
632 td->name, __FILE__, __LINE__);
633 return -1;
634 }
635
636
637 if(1 /* No applicable constraints whatsoever */) {
638 /* Nothing is here. See below */
639 }
640
641 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
642}
643
644static int
645memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
646 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
647
648 if(!sptr) {
649 ASN__CTFAIL(app_key, td, sptr,
650 "%s: value not given (%s:%d)",
651 td->name, __FILE__, __LINE__);
652 return -1;
653 }
654
655
656 if(1 /* No applicable constraints whatsoever */) {
657 /* Nothing is here. See below */
658 }
659
660 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
661}
662
663
664/*** <<< CTDEFS [Packet] >>> ***/
665
666static asn_per_constraints_t asn_PER_memb_id_constr_2 CC_NOTUSED = {
667 { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */,
668 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
669 0, 0 /* No PER value map */
670};
671static asn_per_constraints_t asn_PER_memb_color_constr_3 CC_NOTUSED = {
672 { APC_CONSTRAINED, 2, 2, 0, 2 } /* (0..2) */,
673 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
674 0, 0 /* No PER value map */
675};
676static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
677 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
678 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
679 0, 0 /* No PER value map */
680};
681
682/*** <<< STAT-DEFS [Packet] >>> ***/
683
684static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
685 sizeof(struct value),
686 offsetof(struct value, _asn_ctx),
687 offsetof(struct value, present),
688 sizeof(((struct value *)0)->present),
689 0, /* No top level tags */
690 0, /* No tags in the map */
691 0, 0,
Lev Walkindf2edbb2017-10-21 13:40:07 -0700692 .first_extension = -1 /* Extensions start */
Bi-Ruei, Chiubc6ef1f2017-10-20 22:38:01 +0800693};
694static /* Use -fall-defs-global to expose */
695asn_TYPE_descriptor_t asn_DEF_value_4 = {
696 "value",
697 "value",
698 &asn_OP_OPEN_TYPE,
699 0, /* No effective tags (pointer) */
700 0, /* No effective tags (count) */
701 0, /* No tags (pointer) */
702 0, /* No tags (count) */
703 { 0, 0, OPEN_TYPE_constraint },
704 0, 0, /* No members */
705 &asn_SPC_value_specs_4 /* Additional specs */
706};
707
708asn_TYPE_member_t asn_MBR_Packet_51P0_1[] = {
709 { ATF_NOFLAGS, 0, offsetof(struct Packet_51P0, id),
710 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
711 .tag_mode = 0,
712 .type = &asn_DEF_PacketId,
713 .type_selector = 0,
714 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_id_constr_2, .general_constraints = memb_id_constraint_1 },
715 0, 0, /* No default value */
716 .name = "id"
717 },
718 { ATF_NOFLAGS, 0, offsetof(struct Packet_51P0, color),
719 .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
720 .tag_mode = 0,
721 .type = &asn_DEF_Color,
722 .type_selector = 0,
723 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_color_constr_3, .general_constraints = memb_color_constraint_1 },
724 0, 0, /* No default value */
725 .name = "color"
726 },
727 { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Packet_51P0, value),
728 .tag = -1 /* Ambiguous tag (ANY?) */,
729 .tag_mode = 0,
730 .type = &asn_DEF_value_4,
731 .type_selector = 0,
732 { .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_4, .general_constraints = memb_value_constraint_1 },
733 0, 0, /* No default value */
734 .name = "value"
735 },
736};
737static const ber_tlv_tag_t asn_DEF_Packet_51P0_tags_1[] = {
738 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
739};
740static const asn_TYPE_tag2member_t asn_MAP_Packet_51P0_tag2el_1[] = {
741 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
742 { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* color */
743};
744asn_SEQUENCE_specifics_t asn_SPC_Packet_51P0_specs_1 = {
745 sizeof(struct Packet_51P0),
746 offsetof(struct Packet_51P0, _asn_ctx),
747 .tag2el = asn_MAP_Packet_51P0_tag2el_1,
748 .tag2el_count = 2, /* Count of tags in the map */
749 0, 0, 0, /* Optional elements (not needed) */
Lev Walkindf2edbb2017-10-21 13:40:07 -0700750 -1, /* First extension addition */
Bi-Ruei, Chiubc6ef1f2017-10-20 22:38:01 +0800751};
752asn_TYPE_descriptor_t asn_DEF_Packet_51P0 = {
753 "Packet",
754 "Packet",
755 &asn_OP_SEQUENCE,
756 asn_DEF_Packet_51P0_tags_1,
757 sizeof(asn_DEF_Packet_51P0_tags_1)
758 /sizeof(asn_DEF_Packet_51P0_tags_1[0]), /* 1 */
759 asn_DEF_Packet_51P0_tags_1, /* Same as above */
760 sizeof(asn_DEF_Packet_51P0_tags_1)
761 /sizeof(asn_DEF_Packet_51P0_tags_1[0]), /* 1 */
762 { 0, 0, SEQUENCE_constraint },
763 asn_MBR_Packet_51P0_1,
764 3, /* Elements count */
765 &asn_SPC_Packet_51P0_specs_1 /* Additional specs */
766};
767