-
-
Notifications
You must be signed in to change notification settings - Fork 100
/
oer.c
7594 lines (6039 loc) · 205 KB
/
oer.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* The MIT License (MIT)
*
* Copyright (c) 2018-2019 Erik Moqvist
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* This file was generated by asn1tools version 0.166.0 Sat Oct 21 09:42:10 2023.
*/
#include <string.h>
#include "oer.h"
struct encoder_t {
uint8_t *buf_p;
ssize_t size;
ssize_t pos;
};
struct decoder_t {
const uint8_t *buf_p;
ssize_t size;
ssize_t pos;
};
static uint8_t enumerated_value_length(int32_t value)
{
uint8_t length;
if ((value >=0) && (value < 128)) {
length = 0;
} else if ((value >= -128) && (value < 128)) {
length = 1;
} else if ((value >= -32768) && (value < 32768)) {
length = 2;
} else if ((value >= -8388608) && (value < 8388608)) {
length = 3;
} else {
length = 4;
}
return length;
}
static uint32_t length_determinant_length(uint32_t value)
{
uint32_t length;
if (value < 128u) {
length = 1;
} else if (value < 256u) {
length = 2;
} else if (value < 65536u) {
length = 3;
} else if (value < 16777216u) {
length = 4;
} else {
length = 5;
}
return (length);
}
static uint8_t minimum_uint_length(uint32_t value)
{
uint8_t length;
if (value < 256u) {
length = 1;
} else if (value < 65536u) {
length = 2;
} else if (value < 16777216u) {
length = 3;
} else {
length = 4;
}
return (length);
}
static void encoder_init(struct encoder_t *self_p,
uint8_t *buf_p,
size_t size)
{
self_p->buf_p = buf_p;
self_p->size = (ssize_t)size;
self_p->pos = 0;
}
static ssize_t encoder_get_result(const struct encoder_t *self_p)
{
return (self_p->pos);
}
static void encoder_abort(struct encoder_t *self_p,
ssize_t error)
{
if (self_p->size >= 0) {
self_p->size = -error;
self_p->pos = -error;
}
}
static ssize_t encoder_alloc(struct encoder_t *self_p,
size_t size)
{
ssize_t pos;
if ((self_p->pos + (ssize_t)size) <= self_p->size) {
pos = self_p->pos;
self_p->pos += (ssize_t)size;
} else {
pos = -ENOMEM;
encoder_abort(self_p, ENOMEM);
}
return (pos);
}
static void encoder_append_bytes(struct encoder_t *self_p,
const uint8_t *buf_p,
size_t size)
{
ssize_t pos;
pos = encoder_alloc(self_p, size);
if (pos < 0) {
return;
}
(void)memcpy(&self_p->buf_p[pos], buf_p, size);
}
static void encoder_append_uint8(struct encoder_t *self_p,
uint8_t value)
{
encoder_append_bytes(self_p, &value, sizeof(value));
}
static void encoder_append_uint16(struct encoder_t *self_p,
uint16_t value)
{
uint8_t buf[2];
buf[0] = (uint8_t)(value >> 8);
buf[1] = (uint8_t)value;
encoder_append_bytes(self_p, &buf[0], sizeof(buf));
}
static void encoder_append_uint32(struct encoder_t *self_p,
uint32_t value)
{
uint8_t buf[4];
buf[0] = (uint8_t)(value >> 24);
buf[1] = (uint8_t)(value >> 16);
buf[2] = (uint8_t)(value >> 8);
buf[3] = (uint8_t)value;
encoder_append_bytes(self_p, &buf[0], sizeof(buf));
}
static void encoder_append_uint64(struct encoder_t *self_p,
uint64_t value)
{
uint8_t buf[8];
buf[0] = (uint8_t)(value >> 56);
buf[1] = (uint8_t)(value >> 48);
buf[2] = (uint8_t)(value >> 40);
buf[3] = (uint8_t)(value >> 32);
buf[4] = (uint8_t)(value >> 24);
buf[5] = (uint8_t)(value >> 16);
buf[6] = (uint8_t)(value >> 8);
buf[7] = (uint8_t)value;
encoder_append_bytes(self_p, &buf[0], sizeof(buf));
}
static void encoder_append_int8(struct encoder_t *self_p,
int8_t value)
{
encoder_append_uint8(self_p, (uint8_t)value);
}
static void encoder_append_int16(struct encoder_t *self_p,
int16_t value)
{
encoder_append_uint16(self_p, (uint16_t)value);
}
static void encoder_append_int32(struct encoder_t *self_p,
int32_t value)
{
encoder_append_uint32(self_p, (uint32_t)value);
}
static void encoder_append_int64(struct encoder_t *self_p,
int64_t value)
{
encoder_append_uint64(self_p, (uint64_t)value);
}
static void encoder_append_long_uint(struct encoder_t *self_p,
uint64_t value,
uint8_t number_of_bytes)
{
const uint8_t *value_p = (const uint8_t*)&value;
uint8_t buf[8];
for(uint32_t byte = 0; byte < number_of_bytes; byte++) {
buf[number_of_bytes - byte - 1] = *value_p++;
}
encoder_append_bytes(self_p, buf, number_of_bytes);
}
static void encoder_append_uint(struct encoder_t *self_p,
uint32_t value,
uint8_t number_of_bytes)
{
switch (number_of_bytes) {
case 1:
encoder_append_uint8(self_p, (uint8_t)value);
break;
case 2:
encoder_append_uint16(self_p, (uint16_t)value);
break;
case 3:
encoder_append_uint8(self_p, (uint8_t)(value >> 16));
encoder_append_uint16(self_p, (uint16_t)value);
break;
default:
encoder_append_uint32(self_p, value);
break;
}
}
static void encoder_append_int(struct encoder_t *self_p,
int32_t value,
uint8_t number_of_bytes)
{
switch (number_of_bytes) {
case 1:
encoder_append_int8(self_p, (int8_t)value);
break;
case 2:
encoder_append_int16(self_p, (int16_t)value);
break;
case 3:
encoder_append_uint8(self_p, (uint8_t)((uint32_t)value >> 16));
encoder_append_int16(self_p, (int16_t)value);
break;
default:
encoder_append_int32(self_p, value);
break;
}
}
static void encoder_append_float(struct encoder_t *self_p,
float value)
{
uint32_t i32;
(void)memcpy(&i32, &value, sizeof(i32));
encoder_append_uint32(self_p, i32);
}
static void encoder_append_double(struct encoder_t *self_p,
double value)
{
uint64_t i64;
(void)memcpy(&i64, &value, sizeof(i64));
encoder_append_uint64(self_p, i64);
}
static void encoder_append_bool(struct encoder_t *self_p, bool value)
{
encoder_append_uint8(self_p, value ? 255u : 0u);
}
static void encoder_append_length_determinant(struct encoder_t *self_p,
uint32_t length)
{
if (length < 128u) {
encoder_append_int8(self_p, (int8_t)length);
} else if (length < 256u) {
encoder_append_uint8(self_p, 0x81u);
encoder_append_uint8(self_p, (uint8_t)length);
} else if (length < 65536u) {
encoder_append_uint8(self_p, 0x82u);
encoder_append_uint16(self_p, (uint16_t)length);
} else if (length < 16777216u) {
encoder_append_uint32(self_p, length | (0x83u << 24u));
} else {
encoder_append_uint8(self_p, 0x84u);
encoder_append_uint32(self_p, length);
}
}
static void decoder_init(struct decoder_t *self_p,
const uint8_t *buf_p,
size_t size)
{
self_p->buf_p = buf_p;
self_p->size = (ssize_t)size;
self_p->pos = 0;
}
static ssize_t decoder_get_result(const struct decoder_t *self_p)
{
return (self_p->pos);
}
static void decoder_abort(struct decoder_t *self_p,
ssize_t error)
{
if (self_p->size >= 0) {
self_p->size = -error;
self_p->pos = -error;
}
}
static ssize_t decoder_free(struct decoder_t *self_p,
size_t size)
{
ssize_t pos;
if ((self_p->pos + (ssize_t)size) <= self_p->size) {
pos = self_p->pos;
self_p->pos += (ssize_t)size;
} else {
pos = -EOUTOFDATA;
decoder_abort(self_p, EOUTOFDATA);
}
return (pos);
}
static void decoder_read_bytes(struct decoder_t *self_p,
uint8_t *buf_p,
size_t size)
{
ssize_t pos;
pos = decoder_free(self_p, size);
if (pos >= 0) {
(void)memcpy(buf_p, &self_p->buf_p[pos], size);
} else {
(void)memset(buf_p, 0, size);
}
}
static uint8_t decoder_read_uint8(struct decoder_t *self_p)
{
uint8_t value;
decoder_read_bytes(self_p, &value, sizeof(value));
return (value);
}
static uint16_t decoder_read_uint16(struct decoder_t *self_p)
{
uint8_t buf[2];
decoder_read_bytes(self_p, &buf[0], sizeof(buf));
return (uint16_t)(((uint16_t)buf[0] << 8) | (uint16_t)buf[1]);
}
static uint32_t decoder_read_uint32(struct decoder_t *self_p)
{
uint8_t buf[4];
decoder_read_bytes(self_p, &buf[0], sizeof(buf));
return (((uint32_t)buf[0] << 24)
| ((uint32_t)buf[1] << 16)
| ((uint32_t)buf[2] << 8)
| (uint32_t)buf[3]);
}
static uint64_t decoder_read_uint64(struct decoder_t *self_p)
{
uint8_t buf[8];
decoder_read_bytes(self_p, &buf[0], sizeof(buf));
return (((uint64_t)buf[0] << 56)
| ((uint64_t)buf[1] << 48)
| ((uint64_t)buf[2] << 40)
| ((uint64_t)buf[3] << 32)
| ((uint64_t)buf[4] << 24)
| ((uint64_t)buf[5] << 16)
| ((uint64_t)buf[6] << 8)
| (uint64_t)buf[7]);
}
static int8_t decoder_read_int8(struct decoder_t *self_p)
{
return ((int8_t)decoder_read_uint8(self_p));
}
static int16_t decoder_read_int16(struct decoder_t *self_p)
{
return ((int16_t)decoder_read_uint16(self_p));
}
static int32_t decoder_read_int32(struct decoder_t *self_p)
{
return ((int32_t)decoder_read_uint32(self_p));
}
static int64_t decoder_read_int64(struct decoder_t *self_p)
{
return ((int64_t)decoder_read_uint64(self_p));
}
static uint64_t decoder_read_long_uint(struct decoder_t *self_p,
uint8_t number_of_bytes)
{
uint64_t value = 0;
for(uint8_t byte = 0; byte < number_of_bytes; byte++) {
value = decoder_read_uint8(self_p) | (value << 8);
}
return (value);
}
static uint32_t decoder_read_uint(struct decoder_t *self_p,
uint8_t number_of_bytes)
{
uint32_t value;
switch (number_of_bytes) {
case 1:
value = decoder_read_uint8(self_p);
break;
case 2:
value = decoder_read_uint16(self_p);
break;
case 3:
value = ((uint32_t)decoder_read_uint8(self_p) << 16u);
value |= decoder_read_uint16(self_p);
break;
case 4:
value = decoder_read_uint32(self_p);
break;
default:
value = 0xffffffffu;
break;
}
return (value);
}
static int32_t decoder_read_int(struct decoder_t *self_p,
uint8_t number_of_bytes)
{
int32_t value;
uint32_t tmp;
switch (number_of_bytes) {
case 1:
value = decoder_read_int8(self_p);
break;
case 2:
value = decoder_read_int16(self_p);
break;
case 3:
tmp = ((uint32_t)decoder_read_uint8(self_p) << 16u);
tmp |= decoder_read_uint16(self_p);
if((tmp & 0x800000u) == 0x800000u) {
tmp += 0xff000000u;
}
value = (int32_t)tmp;
break;
case 4:
value = decoder_read_int32(self_p);
break;
default:
value = 2147483647;
break;
}
return (value);
}
static float decoder_read_float(struct decoder_t *self_p)
{
float value;
uint32_t i32;
i32 = decoder_read_uint32(self_p);
(void)memcpy(&value, &i32, sizeof(value));
return (value);
}
static double decoder_read_double(struct decoder_t *self_p)
{
double value;
uint64_t i64;
i64 = decoder_read_uint64(self_p);
(void)memcpy(&value, &i64, sizeof(value));
return (value);
}
static bool decoder_read_bool(struct decoder_t *self_p)
{
return (decoder_read_uint8(self_p) != 0u);
}
static uint32_t decoder_read_length_determinant(struct decoder_t *self_p)
{
uint32_t length;
length = decoder_read_uint8(self_p);
if ((length & 0x80u) != 0u) {
switch (length & 0x7fu) {
case 1:
length = decoder_read_uint8(self_p);
break;
case 2:
length = decoder_read_uint16(self_p);
break;
case 3:
length = (((uint32_t)decoder_read_uint8(self_p) << 16)
| decoder_read_uint16(self_p));
break;
case 4:
length = decoder_read_uint32(self_p);
break;
default:
length = 0xffffffffu;
break;
}
}
return (length);
}
static uint32_t decoder_read_tag(struct decoder_t *self_p)
{
uint32_t tag;
tag = decoder_read_uint8(self_p);
if ((tag & 0x3fu) == 0x3fu) {
do {
tag <<= 8;
tag |= (uint32_t)decoder_read_uint8(self_p);
} while ((tag & 0x80u) == 0x80u);
}
return (tag);
}
static uint32_t get_choice_j_length(const struct oer_c_source_ag_t *src_p) {
uint32_t length;
switch (src_p->j.choice) {
case oer_c_source_ag_j_choice_k_e:
length = 3u;
break;
case oer_c_source_ag_j_choice_l_e:
length = 2u;
break;
default:
length = 0; break;
}
return length;
}
static void oer_c_source_a_encode_inner(
struct encoder_t *encoder_p,
const struct oer_c_source_a_t *src_p)
{
encoder_append_int8(encoder_p, src_p->a);
encoder_append_int16(encoder_p, src_p->b);
encoder_append_int32(encoder_p, src_p->c);
encoder_append_int64(encoder_p, src_p->d);
encoder_append_uint8(encoder_p, src_p->e);
encoder_append_uint16(encoder_p, src_p->f);
encoder_append_uint32(encoder_p, src_p->g);
encoder_append_uint64(encoder_p, src_p->h);
encoder_append_bool(encoder_p, src_p->i);
encoder_append_bytes(encoder_p,
&src_p->j.buf[0],
11);
}
static void oer_c_source_a_decode_inner(
struct decoder_t *decoder_p,
struct oer_c_source_a_t *dst_p)
{
dst_p->a = decoder_read_int8(decoder_p);
dst_p->b = decoder_read_int16(decoder_p);
dst_p->c = decoder_read_int32(decoder_p);
dst_p->d = decoder_read_int64(decoder_p);
dst_p->e = decoder_read_uint8(decoder_p);
dst_p->f = decoder_read_uint16(decoder_p);
dst_p->g = decoder_read_uint32(decoder_p);
dst_p->h = decoder_read_uint64(decoder_p);
dst_p->i = decoder_read_bool(decoder_p);
decoder_read_bytes(decoder_p,
&dst_p->j.buf[0],
11);
}
static void oer_c_source_ab_encode_inner(
struct encoder_t *encoder_p,
const struct oer_c_source_ab_t *src_p)
{
encoder_append_int8(encoder_p, src_p->a);
encoder_append_uint16(encoder_p, src_p->b);
}
static void oer_c_source_ab_decode_inner(
struct decoder_t *decoder_p,
struct oer_c_source_ab_t *dst_p)
{
dst_p->a = decoder_read_int8(decoder_p);
dst_p->b = decoder_read_uint16(decoder_p);
}
static void oer_c_source_q_encode_inner(
struct encoder_t *encoder_p,
const struct oer_c_source_q_t *src_p)
{
switch (src_p->choice) {
case oer_c_source_q_choice_c001_e:
encoder_append_uint(encoder_p, 0x80, 1);
encoder_append_bool(encoder_p, src_p->value.c001);
break;
case oer_c_source_q_choice_c002_e:
encoder_append_uint(encoder_p, 0x81, 1);
encoder_append_bool(encoder_p, src_p->value.c002);
break;
case oer_c_source_q_choice_c003_e:
encoder_append_uint(encoder_p, 0x82, 1);
encoder_append_bool(encoder_p, src_p->value.c003);
break;
case oer_c_source_q_choice_c004_e:
encoder_append_uint(encoder_p, 0x83, 1);
encoder_append_bool(encoder_p, src_p->value.c004);
break;
case oer_c_source_q_choice_c005_e:
encoder_append_uint(encoder_p, 0x84, 1);
encoder_append_bool(encoder_p, src_p->value.c005);
break;
case oer_c_source_q_choice_c006_e:
encoder_append_uint(encoder_p, 0x85, 1);
encoder_append_bool(encoder_p, src_p->value.c006);
break;
case oer_c_source_q_choice_c007_e:
encoder_append_uint(encoder_p, 0x86, 1);
encoder_append_bool(encoder_p, src_p->value.c007);
break;
case oer_c_source_q_choice_c008_e:
encoder_append_uint(encoder_p, 0x87, 1);
encoder_append_bool(encoder_p, src_p->value.c008);
break;
case oer_c_source_q_choice_c009_e:
encoder_append_uint(encoder_p, 0x88, 1);
encoder_append_bool(encoder_p, src_p->value.c009);
break;
case oer_c_source_q_choice_c010_e:
encoder_append_uint(encoder_p, 0x89, 1);
encoder_append_bool(encoder_p, src_p->value.c010);
break;
case oer_c_source_q_choice_c011_e:
encoder_append_uint(encoder_p, 0x8a, 1);
encoder_append_bool(encoder_p, src_p->value.c011);
break;
case oer_c_source_q_choice_c012_e:
encoder_append_uint(encoder_p, 0x8b, 1);
encoder_append_bool(encoder_p, src_p->value.c012);
break;
case oer_c_source_q_choice_c013_e:
encoder_append_uint(encoder_p, 0x8c, 1);
encoder_append_bool(encoder_p, src_p->value.c013);
break;
case oer_c_source_q_choice_c014_e:
encoder_append_uint(encoder_p, 0x8d, 1);
encoder_append_bool(encoder_p, src_p->value.c014);
break;
case oer_c_source_q_choice_c015_e:
encoder_append_uint(encoder_p, 0x8e, 1);
encoder_append_bool(encoder_p, src_p->value.c015);
break;
case oer_c_source_q_choice_c016_e:
encoder_append_uint(encoder_p, 0x8f, 1);
encoder_append_bool(encoder_p, src_p->value.c016);
break;
case oer_c_source_q_choice_c017_e:
encoder_append_uint(encoder_p, 0x90, 1);
encoder_append_bool(encoder_p, src_p->value.c017);
break;
case oer_c_source_q_choice_c018_e:
encoder_append_uint(encoder_p, 0x91, 1);
encoder_append_bool(encoder_p, src_p->value.c018);
break;
case oer_c_source_q_choice_c019_e:
encoder_append_uint(encoder_p, 0x92, 1);
encoder_append_bool(encoder_p, src_p->value.c019);
break;
case oer_c_source_q_choice_c020_e:
encoder_append_uint(encoder_p, 0x93, 1);
encoder_append_bool(encoder_p, src_p->value.c020);
break;
case oer_c_source_q_choice_c021_e:
encoder_append_uint(encoder_p, 0x94, 1);
encoder_append_bool(encoder_p, src_p->value.c021);
break;
case oer_c_source_q_choice_c022_e:
encoder_append_uint(encoder_p, 0x95, 1);
encoder_append_bool(encoder_p, src_p->value.c022);
break;
case oer_c_source_q_choice_c023_e:
encoder_append_uint(encoder_p, 0x96, 1);
encoder_append_bool(encoder_p, src_p->value.c023);
break;
case oer_c_source_q_choice_c024_e:
encoder_append_uint(encoder_p, 0x97, 1);
encoder_append_bool(encoder_p, src_p->value.c024);
break;
case oer_c_source_q_choice_c025_e:
encoder_append_uint(encoder_p, 0x98, 1);
encoder_append_bool(encoder_p, src_p->value.c025);
break;
case oer_c_source_q_choice_c026_e:
encoder_append_uint(encoder_p, 0x99, 1);
encoder_append_bool(encoder_p, src_p->value.c026);
break;
case oer_c_source_q_choice_c027_e:
encoder_append_uint(encoder_p, 0x9a, 1);
encoder_append_bool(encoder_p, src_p->value.c027);
break;
case oer_c_source_q_choice_c028_e:
encoder_append_uint(encoder_p, 0x9b, 1);
encoder_append_bool(encoder_p, src_p->value.c028);
break;
case oer_c_source_q_choice_c029_e:
encoder_append_uint(encoder_p, 0x9c, 1);
encoder_append_bool(encoder_p, src_p->value.c029);
break;
case oer_c_source_q_choice_c030_e:
encoder_append_uint(encoder_p, 0x9d, 1);
encoder_append_bool(encoder_p, src_p->value.c030);
break;
case oer_c_source_q_choice_c031_e:
encoder_append_uint(encoder_p, 0x9e, 1);
encoder_append_bool(encoder_p, src_p->value.c031);
break;
case oer_c_source_q_choice_c032_e:
encoder_append_uint(encoder_p, 0x9f, 1);
encoder_append_bool(encoder_p, src_p->value.c032);
break;
case oer_c_source_q_choice_c033_e:
encoder_append_uint(encoder_p, 0xa0, 1);
encoder_append_bool(encoder_p, src_p->value.c033);
break;
case oer_c_source_q_choice_c034_e:
encoder_append_uint(encoder_p, 0xa1, 1);
encoder_append_bool(encoder_p, src_p->value.c034);
break;
case oer_c_source_q_choice_c035_e:
encoder_append_uint(encoder_p, 0xa2, 1);
encoder_append_bool(encoder_p, src_p->value.c035);
break;
case oer_c_source_q_choice_c036_e:
encoder_append_uint(encoder_p, 0xa3, 1);
encoder_append_bool(encoder_p, src_p->value.c036);
break;
case oer_c_source_q_choice_c037_e:
encoder_append_uint(encoder_p, 0xa4, 1);
encoder_append_bool(encoder_p, src_p->value.c037);
break;
case oer_c_source_q_choice_c038_e:
encoder_append_uint(encoder_p, 0xa5, 1);
encoder_append_bool(encoder_p, src_p->value.c038);
break;
case oer_c_source_q_choice_c039_e:
encoder_append_uint(encoder_p, 0xa6, 1);
encoder_append_bool(encoder_p, src_p->value.c039);
break;
case oer_c_source_q_choice_c040_e:
encoder_append_uint(encoder_p, 0xa7, 1);
encoder_append_bool(encoder_p, src_p->value.c040);
break;
case oer_c_source_q_choice_c041_e:
encoder_append_uint(encoder_p, 0xa8, 1);
encoder_append_bool(encoder_p, src_p->value.c041);
break;
case oer_c_source_q_choice_c042_e:
encoder_append_uint(encoder_p, 0xa9, 1);
encoder_append_bool(encoder_p, src_p->value.c042);
break;
case oer_c_source_q_choice_c043_e:
encoder_append_uint(encoder_p, 0xaa, 1);
encoder_append_bool(encoder_p, src_p->value.c043);
break;
case oer_c_source_q_choice_c044_e:
encoder_append_uint(encoder_p, 0xab, 1);
encoder_append_bool(encoder_p, src_p->value.c044);
break;
case oer_c_source_q_choice_c045_e:
encoder_append_uint(encoder_p, 0xac, 1);
encoder_append_bool(encoder_p, src_p->value.c045);
break;
case oer_c_source_q_choice_c046_e:
encoder_append_uint(encoder_p, 0xad, 1);
encoder_append_bool(encoder_p, src_p->value.c046);
break;
case oer_c_source_q_choice_c047_e:
encoder_append_uint(encoder_p, 0xae, 1);
encoder_append_bool(encoder_p, src_p->value.c047);
break;
case oer_c_source_q_choice_c048_e:
encoder_append_uint(encoder_p, 0xaf, 1);
encoder_append_bool(encoder_p, src_p->value.c048);
break;
case oer_c_source_q_choice_c049_e:
encoder_append_uint(encoder_p, 0xb0, 1);
encoder_append_bool(encoder_p, src_p->value.c049);
break;
case oer_c_source_q_choice_c050_e:
encoder_append_uint(encoder_p, 0xb1, 1);
encoder_append_bool(encoder_p, src_p->value.c050);
break;
case oer_c_source_q_choice_c051_e:
encoder_append_uint(encoder_p, 0xb2, 1);
encoder_append_bool(encoder_p, src_p->value.c051);
break;
case oer_c_source_q_choice_c052_e:
encoder_append_uint(encoder_p, 0xb3, 1);
encoder_append_bool(encoder_p, src_p->value.c052);
break;
case oer_c_source_q_choice_c053_e:
encoder_append_uint(encoder_p, 0xb4, 1);
encoder_append_bool(encoder_p, src_p->value.c053);
break;
case oer_c_source_q_choice_c054_e:
encoder_append_uint(encoder_p, 0xb5, 1);
encoder_append_bool(encoder_p, src_p->value.c054);
break;
case oer_c_source_q_choice_c055_e:
encoder_append_uint(encoder_p, 0xb6, 1);
encoder_append_bool(encoder_p, src_p->value.c055);
break;
case oer_c_source_q_choice_c056_e:
encoder_append_uint(encoder_p, 0xb7, 1);
encoder_append_bool(encoder_p, src_p->value.c056);
break;
case oer_c_source_q_choice_c057_e:
encoder_append_uint(encoder_p, 0xb8, 1);
encoder_append_bool(encoder_p, src_p->value.c057);
break;
case oer_c_source_q_choice_c058_e:
encoder_append_uint(encoder_p, 0xb9, 1);
encoder_append_bool(encoder_p, src_p->value.c058);
break;
case oer_c_source_q_choice_c059_e:
encoder_append_uint(encoder_p, 0xba, 1);
encoder_append_bool(encoder_p, src_p->value.c059);
break;
case oer_c_source_q_choice_c060_e:
encoder_append_uint(encoder_p, 0xbb, 1);
encoder_append_bool(encoder_p, src_p->value.c060);
break;
case oer_c_source_q_choice_c061_e:
encoder_append_uint(encoder_p, 0xbc, 1);
encoder_append_bool(encoder_p, src_p->value.c061);
break;
case oer_c_source_q_choice_c062_e:
encoder_append_uint(encoder_p, 0xbd, 1);
encoder_append_bool(encoder_p, src_p->value.c062);
break;