FreeCalypso > hg > fc-selenite
annotate src/gpf/ccd/critical_ext.c @ 58:406a2d2c031a
cmh_sms[rs].c: include case fix
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 19 Jul 2018 23:08:12 +0000 |
parents | 1ea54a97e831 |
children |
rev | line source |
---|---|
5
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 +------------------------------------------------------------------------------ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 | File: critical_ext.c |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 +------------------------------------------------------------------------------ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 | Copyright 2002 Texas Instruments Berlin, AG |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 | All rights reserved. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 | This file is confidential and a trade secret of Texas |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 | Instruments Berlin, AG. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 | The receipt of or possession of this file does not convey |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 | any rights to reproduce or disclose its contents or to |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 | manufacture, use, or sell anything it may describe, in |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 | whole, or in part, without the specific written consent of |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 | Texas Instruments Berlin, AG. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 +------------------------------------------------------------------------------ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 | Purpose: Encoding and decoding functions for criticalExtensions |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 | $Identity:$ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 +------------------------------------------------------------------------------ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 * Standard definitions like UCHAR, ERROR etc. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #include "typedefs.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #include "header.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 * Prototypes of ccd (USE_DRIVER EQ undef) for prototypes only |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 * look at ccdapi.h |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #undef USE_DRIVER |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #include "ccdapi.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 * Types and functions for bit access and manipulation |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #include "ccd_globs.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #include "bitfun.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 * Prototypes and constants in the common part of ccd |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 #include "ccd.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 * Declaration of coder/decoder tables |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 #include "ccdtable.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 #include "ccddata.h" |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 #ifndef RUN_INT_RAM |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 +------------------------------------------------------------------------+ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 | PROJECT : CCD (6144) MODULE : critical_ext | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 | STATE : code ROUTINE : cdc_critical_ext_decode | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 +------------------------------------------------------------------------+ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 PURPOSE : Decode elements of type criticalExtensions |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 An element of this type should never be encoded or decoded. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 If the coder faces an IE of this type, it should report an |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 error report and abort. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 Whenever a criticalExtensions-IE is extended from NULL or |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 SEQUENCE {} to another type, its CCD coding type will change |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 and the functions in this file will not be called for that IE |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 any more. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 According to 3GPP TS25.331 V3.6.0, 10.1.1.2.2: |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 Since messages including critical extensions are rejected by |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 receivers not comprehending them, these messages can be |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 modified completely, e.g. IEs may be inserted at any place |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 and IEs may be removed or redefined. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 See also 3GPP TS25.921 V4.3.0, 10.4. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 SHORT cdc_critical_ext_decode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs) |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 #ifdef DEBUG_CCD |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 #ifndef CCD_SYMBOLS |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 TRACE_CCD (globs, "cdc_critical_ext_decode()"); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 #else |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 TRACE_CCD (globs, "cdc_critical_ext_decode() %s", mcomp[melem[e_ref].elemRef].name); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 #endif |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 #endif |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 globs->pstructOffs = melem[e_ref].structOffs; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 /* For optional elements we have already set the valid flag in the |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 * C-structure. We have done it while processing ASN1_SEQ. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 if ( ! cdc_isPresent(e_ref, globs) ) { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 return 1; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 } |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 if (melem[e_ref].elemType EQ 'V' AND mvar[melem[e_ref].elemRef].bSize EQ 0) |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 ccd_recordFault (globs, |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 ERR_CRITICAL_EXT, |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 BREAK, |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 (USHORT) e_ref, |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 globs->pstruct + melem[e_ref].structOffs |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 ); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 return 0; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 } |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 * Currently CCD tool chain does not support extensions of this type. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 * This else-implementation is just an outlook. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 * |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 else |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 U16 compRef = melem[e_ref].elemRef; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 U16 elemRef = mcomp[compRef].componentRef; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 (void) codec[melem[Elem].codingType][DECODE_FUN] |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 (compRef, elemRef, globs); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 }*/ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 return 1; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 } |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 #endif /* !RUN_INT_RAM */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 #ifndef RUN_INT_RAM |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 +------------------------------------------------------------------------+ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 | PROJECT : CCD (6144) MODULE : critical_ext | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 | STATE : code ROUTINE : cdc_critical_ext_encode | |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 +------------------------------------------------------------------------+ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 PURPOSE : Encode elements of type criticalExtensions |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 An element of this type should never be encoded or decoded. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 If the coder faces an IE of this type, it should report an |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 error report and abort. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 SHORT cdc_critical_ext_encode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs) |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 #ifdef DEBUG_CCD |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 #ifndef CCD_SYMBOLS |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 TRACE_CCD (globs, "cdc_critical_ext_encode()"); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 #else |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 TRACE_CCD (globs, "cdc_critical_ext_encode() %s", mcomp[melem[e_ref].elemRef].name); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 #endif |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 #endif |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 globs->pstructOffs = melem[e_ref].structOffs; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 /* For optional elements we have already set the valid flag in the |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 * C-structure. We have done it while processing ASN1_SEQ. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 */ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 if ( ! cdc_isPresent(e_ref, globs) ) { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 return 1; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 } |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 if (melem[e_ref].elemType EQ 'V' AND mvar[melem[e_ref].elemRef].bSize EQ 0) |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 ccd_recordFault (globs, |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 ERR_CRITICAL_EXT, |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 BREAK, |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 (USHORT) e_ref, |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 globs->pstruct + melem[e_ref].structOffs |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 ); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 return 0; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 } |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 /* |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 * Currently CCD tool chain does not support extensions of this type. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 * This else-implementation is just an outlook. |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 * |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 else |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 { |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 U16 compRef = melem[e_ref].elemRef; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 U16 elemRef = mcomp[compRef].componentRef; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 (void) codec[melem[Elem].codingType][ENCODE_FUN] |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 (compRef, elemRef, globs); |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 }*/ |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 return 1; |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 } |
1ea54a97e831
src/gpf: import of Magnetite src/gpf3
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 #endif /* !RUN_INT_RAM */ |